@leatcom/portal-sessions 0.3.0-beta.12 → 0.3.0-beta.9
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/{calendar-Cy2FRI9d.js → calendar-CNx63kan.js} +2 -2
- package/dist/{camera-switch-BN2FLfLB.js → camera-switch-DWDTqbUe.js} +2 -2
- package/dist/{caret-left-DsRy3M76.js → caret-left-DnKnL0Ih.js} +2 -2
- package/dist/{close-o5Ljzbh3.js → close-BkhXUisU.js} +2 -2
- package/dist/{crossBlack-BwWOxtR4.js → crossBlack-By059Yuq.js} +2 -2
- package/dist/{dollar-tGFElU94.js → dollar-DJkFEq0l.js} +2 -2
- package/dist/{edit-BqcVfIkQ.js → edit-BzZVrm9d.js} +2 -2
- package/dist/{home-BswdtzQw.js → home-CObkO6rx.js} +2 -2
- package/dist/{information-dH5gtfSy.js → information-DUF95hLD.js} +2 -2
- package/dist/{leat_logo-XWR_Ly4_.js → leat_logo-j7OQmDvt.js} +2 -2
- package/dist/{mail-D5vS9HyR.js → mail-EL5Fin0-.js} +2 -2
- package/dist/{notificationErrorV2-BXfaCZ1a.js → notificationErrorV2-CGbvQ-su.js} +2 -2
- package/dist/{notificationSuccessV2-wAjyDC8V.js → notificationSuccessV2-BhRAIAVE.js} +2 -2
- package/dist/{notificationWarningV2-TD4D2ByD.js → notificationWarningV2-BswHis10.js} +2 -2
- package/dist/portal-sessions.es.js +23 -23
- package/dist/portal-sessions.umd.js +173 -0
- package/dist/{qr-scanner-worker.min-DHRx_o6F.js → qr-scanner-worker.min-CY0V49aw.js} +2 -2
- package/dist/{settings-CcKM2v4e.js → settings-Dca0sJDd.js} +2 -2
- package/dist/{shopping-bag-DW6sl3aA.js → shopping-bag-C4DIWmq2.js} +2 -2
- package/dist/{star-CXnVNTDi.js → star-CGmG_XLj.js} +2 -2
- package/dist/style.css +1 -1
- package/dist/{user-CjnZFFLX.js → user-DZy_M0Yn.js} +2 -2
- package/package.json +9 -5
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`c1892f55c7f480f84c48c65befae803a68799626`},e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:portal-sessions-application-key":!0});var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`79a13198-c4e7-4a37-ba16-c45506dcc0b3`,e._sentryDebugIdIdentifier=`sentry-dbid-79a13198-c4e7-4a37-ba16-c45506dcc0b3`)}catch{}})(),(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("react"),require("react/jsx-runtime"),require("react-dom")):typeof define==`function`&&define.amd?define([`exports`,`react`,`react/jsx-runtime`,`react-dom`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.PortalSessions={},e.React,e[`react/jsx-runtime`],e.ReactDOM))})(this,function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t)=>()=>(e&&(t=e(e=0)),t),d=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),f=(e,t)=>{let n={};for(var r in e)a(n,r,{get:e[r],enumerable:!0});return t||a(n,Symbol.toStringTag,{value:`Module`}),n},p=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=s(t),c=0,u=i.length,d;c<u;c++)d=i[c],!l.call(e,d)&&d!==n&&a(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=o(t,d))||r.enumerable});return e},m=(e,t,n)=>(n=e==null?{}:i(c(e)),p(t||!e||!e.__esModule?a(n,`default`,{value:e,enumerable:!0}):n,e));let h=m(t,1);t=m(t),r=m(r,1);var g=function(e){return e.IDENTIFIER=`identifier`,e.EMAIL=`email`,e}({}),_=function(e){return e.ACTIVE=`ACTIVE`,e.EXPIRED=`EXPIRED`,e.COMPLETED=`COMPLETED`,e}({}),v=function(e){return e.GENERIC=`GENERIC`,e.GIFTCARD=`GIFTCARD`,e.REDEEM_GIFTCARD=`REDEEM_GIFTCARD`,e.TOP_UP_GIFTCARD=`TOP_UP_GIFTCARD`,e.PORTAL=`PORTAL`,e.PREPAID=`PREPAID`,e.PAY_PREPAID=`PAY_PREPAID`,e.TOP_UP_PREPAID=`TOP_UP_PREPAID`,e.POINTS_TRANSACTION=`POINTS_TRANSACTION`,e.VOUCHER=`VOUCHER`,e}({}),y=function(e){return e.CREDIT_RECEPTION=`credit_reception`,e.GIFTCARD_TRANSACTION=`giftcard_transaction`,e.VOUCHER_REDEEMED=`voucher_redeemed`,e.REWARD_RECEPTION=`reward_reception`,e.PREPAID_TRANSACTION=`prepaid_transaction`,e}({}),b=function(e){return e.USER=`user`,e.ENVIRONMENT=`environment`,e}({});function x(e,t){return function(){return e.apply(t,arguments)}}var{toString:S}=Object.prototype,{getPrototypeOf:C}=Object,{iterator:w,toStringTag:T}=Symbol,E=(e=>t=>{let n=S.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),D=e=>(e=e.toLowerCase(),t=>E(t)===e),O=e=>t=>typeof t===e,{isArray:k}=Array,A=O(`undefined`);function j(e){return e!==null&&!A(e)&&e.constructor!==null&&!A(e.constructor)&&P(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var M=D(`ArrayBuffer`);function N(e){let t;return t=typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&M(e.buffer),t}var ee=O(`string`),P=O(`function`),te=O(`number`),ne=e=>typeof e==`object`&&!!e,re=e=>e===!0||e===!1,ie=e=>{if(E(e)!==`object`)return!1;let t=C(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(T in e)&&!(w in e)},F=e=>{if(!ne(e)||j(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},ae=D(`Date`),oe=D(`File`),se=e=>!!(e&&e.uri!==void 0),ce=e=>e&&e.getParts!==void 0,le=D(`Blob`),ue=D(`FileList`),I=e=>ne(e)&&P(e.pipe);function L(){return typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{}}var de=L(),fe=de.FormData===void 0?void 0:de.FormData,pe=e=>{if(!e)return!1;if(fe&&e instanceof fe)return!0;let t=C(e);if(!t||t===Object.prototype||!P(e.append))return!1;let n=E(e);return n===`formdata`||n===`object`&&P(e.toString)&&e.toString()===`[object FormData]`},me=D(`URLSearchParams`),[he,ge,_e,ve]=[`ReadableStream`,`Request`,`Response`,`Headers`].map(D),ye=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``);function be(e,t,{allOwnKeys:n=!1}={}){if(e==null)return;let r,i;if(typeof e!=`object`&&(e=[e]),k(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(j(e))return;let i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length,o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function xe(e,t){if(j(e))return null;t=t.toLowerCase();let n=Object.keys(e),r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}var Se=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:global,Ce=e=>!A(e)&&e!==Se;function we(...e){let{caseless:t,skipUndefined:n}=Ce(this)&&this||{},r={},i=(e,i)=>{if(i===`__proto__`||i===`constructor`||i===`prototype`)return;let a=t&&xe(r,i)||i,o=Ie(r,a)?r[a]:void 0;ie(o)&&ie(e)?r[a]=we(o,e):ie(e)?r[a]=we({},e):k(e)?r[a]=e.slice():(!n||!A(e))&&(r[a]=e)};for(let t=0,n=e.length;t<n;t++)e[t]&&be(e[t],i);return r}var Te=(e,t,n,{allOwnKeys:r}={})=>(be(t,(t,r)=>{n&&P(t)?Object.defineProperty(e,r,{__proto__:null,value:x(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),Ee=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),De=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},Oe=(e,t,n,r)=>{let i,a,o,s={};if(t||={},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&C(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},ke=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let r=e.indexOf(t,n);return r!==-1&&r===n},Ae=e=>{if(!e)return null;if(k(e))return e;let t=e.length;if(!te(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},je=(e=>t=>e&&t instanceof e)(typeof Uint8Array<`u`&&C(Uint8Array)),Me=(e,t)=>{let n=(e&&e[w]).call(e),r;for(;(r=n.next())&&!r.done;){let n=r.value;t.call(e,n[0],n[1])}},Ne=(e,t)=>{let n,r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Pe=D(`HTMLFormElement`),Fe=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),Ie=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Le=D(`RegExp`),Re=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};be(n,(n,i)=>{let a;(a=t(n,i,e))!==!1&&(r[i]=a||n)}),Object.defineProperties(e,r)},ze=e=>{Re(e,(t,n)=>{if(P(e)&&[`arguments`,`caller`,`callee`].includes(n))return!1;let r=e[n];if(P(r)){if(t.enumerable=!1,`writable`in t){t.writable=!1;return}t.set||=()=>{throw Error(`Can not rewrite read-only method '`+n+`'`)}}})},Be=(e,t)=>{let n={},r=e=>{e.forEach(e=>{n[e]=!0})};return k(e)?r(e):r(String(e).split(t)),n},Ve=()=>{},He=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Ue(e){return!!(e&&P(e.append)&&e[T]===`FormData`&&e[w])}var We=e=>{let t=new WeakSet,n=e=>{if(ne(e)){if(t.has(e))return;if(j(e))return e;if(!(`toJSON`in e)){t.add(e);let r=k(e)?[]:{};return be(e,(e,t)=>{let i=n(e);!A(i)&&(r[t]=i)}),t.delete(e),r}}return e};return n(e)},Ge=D(`AsyncFunction`),Ke=e=>e&&(ne(e)||P(e))&&P(e.then)&&P(e.catch),qe=((e,t)=>e?setImmediate:t?((e,t)=>(Se.addEventListener(`message`,({source:n,data:r})=>{n===Se&&r===e&&t.length&&t.shift()()},!1),n=>{t.push(n),Se.postMessage(e,`*`)}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate==`function`,P(Se.postMessage)),R={isArray:k,isArrayBuffer:M,isBuffer:j,isFormData:pe,isArrayBufferView:N,isString:ee,isNumber:te,isBoolean:re,isObject:ne,isPlainObject:ie,isEmptyObject:F,isReadableStream:he,isRequest:ge,isResponse:_e,isHeaders:ve,isUndefined:A,isDate:ae,isFile:oe,isReactNativeBlob:se,isReactNative:ce,isBlob:le,isRegExp:Le,isFunction:P,isStream:I,isURLSearchParams:me,isTypedArray:je,isFileList:ue,forEach:be,merge:we,extend:Te,trim:ye,stripBOM:Ee,inherits:De,toFlatObject:Oe,kindOf:E,kindOfTest:D,endsWith:ke,toArray:Ae,forEachEntry:Me,matchAll:Ne,isHTMLForm:Pe,hasOwnProperty:Ie,hasOwnProp:Ie,reduceDescriptors:Re,freezeMethods:ze,toObjectSet:Be,toCamelCase:Fe,noop:Ve,toFiniteNumber:He,findKey:xe,global:Se,isContextDefined:Ce,isSpecCompliantForm:Ue,toJSONObject:We,isAsyncFn:Ge,isThenable:Ke,setImmediate:qe,asap:typeof queueMicrotask<`u`?queueMicrotask.bind(Se):typeof process<`u`&&process.nextTick||qe,isIterable:e=>e!=null&&P(e[w])},Je=R.toObjectSet([`age`,`authorization`,`content-length`,`content-type`,`etag`,`expires`,`from`,`host`,`if-modified-since`,`if-unmodified-since`,`last-modified`,`location`,`max-forwards`,`proxy-authorization`,`referer`,`retry-after`,`user-agent`]),Ye=e=>{let t={},n,r,i;return e&&e.split(`
|
|
2
|
+
`).forEach(function(e){i=e.indexOf(`:`),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!(!n||t[n]&&Je[n])&&(n===`set-cookie`?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+`, `+r:r)}),t};function Xe(e){let t=0,n=e.length;for(;t<n;){let n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;n>t;){let t=e.charCodeAt(n-1);if(t!==9&&t!==32)break;--n}return t===0&&n===e.length?e:e.slice(t,n)}var Ze=RegExp(`[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+`,`g`),Qe=RegExp(`[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+`,`g`);function $e(e,t){return R.isArray(e)?e.map(e=>$e(e,t)):Xe(String(e).replace(t,``))}var et=e=>$e(e,Ze),tt=e=>$e(e,Qe);function nt(e){let t=Object.create(null);return R.forEach(e.toJSON(),(e,n)=>{t[n]=tt(e)}),t}var rt=Symbol(`internals`);function it(e){return e&&String(e).trim().toLowerCase()}function at(e){return e===!1||e==null?e:R.isArray(e)?e.map(at):et(String(e))}function ot(e){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}var st=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ct(e,t,n,r,i){if(R.isFunction(r))return r.call(this,t,n);if(i&&(t=n),R.isString(t)){if(R.isString(r))return t.indexOf(r)!==-1;if(R.isRegExp(r))return r.test(t)}}function lt(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function ut(e,t){let n=R.toCamelCase(` `+t);[`get`,`set`,`has`].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}var dt=class{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function i(e,t,n){let i=it(t);if(!i)throw Error(`header name must be a non-empty string`);let a=R.findKey(r,i);(!a||r[a]===void 0||n===!0||n===void 0&&r[a]!==!1)&&(r[a||t]=at(e))}let a=(e,t)=>R.forEach(e,(e,n)=>i(e,n,t));if(R.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(R.isString(e)&&(e=e.trim())&&!st(e))a(Ye(e),t);else if(R.isObject(e)&&R.isIterable(e)){let n={},r,i;for(let t of e){if(!R.isArray(t))throw TypeError(`Object iterator must return a key-value pair`);n[i=t[0]]=(r=n[i])?R.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}a(n,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=it(e),e){let n=R.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(t===!0)return ot(e);if(R.isFunction(t))return t.call(this,e,n);if(R.isRegExp(t))return t.exec(e);throw TypeError(`parser must be boolean|regexp|function`)}}}has(e,t){if(e=it(e),e){let n=R.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||ct(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function i(e){if(e=it(e),e){let i=R.findKey(n,e);i&&(!t||ct(n,n[i],i,t))&&(delete n[i],r=!0)}}return R.isArray(e)?e.forEach(i):i(e),r}clear(e){let t=Object.keys(this),n=t.length,r=!1;for(;n--;){let i=t[n];(!e||ct(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){let t=this,n={};return R.forEach(this,(r,i)=>{let a=R.findKey(n,i);if(a){t[a]=at(r),delete t[i];return}let o=e?lt(i):String(i).trim();o!==i&&delete t[i],t[o]=at(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return R.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&R.isArray(n)?n.join(`, `):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+`: `+t).join(`
|
|
3
|
+
`)}getSetCookie(){return this.get(`set-cookie`)||[]}get[Symbol.toStringTag](){return`AxiosHeaders`}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[rt]=this[rt]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=it(e);t[r]||(ut(n,e),t[r]=!0)}return R.isArray(e)?e.forEach(r):r(e),this}};dt.accessor([`Content-Type`,`Content-Length`,`Accept`,`Accept-Encoding`,`User-Agent`,`Authorization`]),R.reduceDescriptors(dt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),R.freezeMethods(dt);var ft=`[REDACTED ****]`;function pt(e){if(R.hasOwnProp(e,`toJSON`))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(R.hasOwnProp(t,`toJSON`))return!0;t=Object.getPrototypeOf(t)}return!1}function mt(e,t){let n=new Set(t.map(e=>String(e).toLowerCase())),r=[],i=e=>{if(typeof e!=`object`||!e||R.isBuffer(e))return e;if(r.indexOf(e)!==-1)return;e instanceof dt&&(e=e.toJSON()),r.push(e);let t;if(R.isArray(e))t=[],e.forEach((e,n)=>{let r=i(e);R.isUndefined(r)||(t[n]=r)});else{if(!R.isPlainObject(e)&&pt(e))return r.pop(),e;t=Object.create(null);for(let[r,a]of Object.entries(e)){let e=n.has(r.toLowerCase())?ft:i(a);R.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return i(e)}var z=class e extends Error{static from(t,n,r,i,a,o){let s=new e(t.message,n||t.code,r,i,a);return s.cause=t,s.name=t.name,t.status!=null&&s.status==null&&(s.status=t.status),o&&Object.assign(s,o),s}constructor(e,t,n,r,i){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name=`AxiosError`,this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){let e=this.config,t=e&&R.hasOwnProp(e,`redact`)?e.redact:void 0,n=R.isArray(t)&&t.length>0?mt(e,t):R.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}};z.ERR_BAD_OPTION_VALUE=`ERR_BAD_OPTION_VALUE`,z.ERR_BAD_OPTION=`ERR_BAD_OPTION`,z.ECONNABORTED=`ECONNABORTED`,z.ETIMEDOUT=`ETIMEDOUT`,z.ECONNREFUSED=`ECONNREFUSED`,z.ERR_NETWORK=`ERR_NETWORK`,z.ERR_FR_TOO_MANY_REDIRECTS=`ERR_FR_TOO_MANY_REDIRECTS`,z.ERR_DEPRECATED=`ERR_DEPRECATED`,z.ERR_BAD_RESPONSE=`ERR_BAD_RESPONSE`,z.ERR_BAD_REQUEST=`ERR_BAD_REQUEST`,z.ERR_CANCELED=`ERR_CANCELED`,z.ERR_NOT_SUPPORT=`ERR_NOT_SUPPORT`,z.ERR_INVALID_URL=`ERR_INVALID_URL`,z.ERR_FORM_DATA_DEPTH_EXCEEDED=`ERR_FORM_DATA_DEPTH_EXCEEDED`;function ht(e){return R.isPlainObject(e)||R.isArray(e)}function gt(e){return R.endsWith(e,`[]`)?e.slice(0,-2):e}function _t(e,t,n){return e?e.concat(t).map(function(e,t){return e=gt(e),!n&&t?`[`+e+`]`:e}).join(n?`.`:``):t}function vt(e){return R.isArray(e)&&!e.some(ht)}var yt=R.toFlatObject(R,{},null,function(e){return/^is[A-Z]/.test(e)});function bt(e,t,n){if(!R.isObject(e))throw TypeError(`target must be an object`);t||=new FormData,n=R.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!R.isUndefined(t[e])});let r=n.metaTokens,i=n.visitor||d,a=n.dots,o=n.indexes,s=n.Blob||typeof Blob<`u`&&Blob,c=n.maxDepth===void 0?100:n.maxDepth,l=s&&R.isSpecCompliantForm(t);if(!R.isFunction(i))throw TypeError(`visitor must be a function`);function u(e){if(e===null)return``;if(R.isDate(e))return e.toISOString();if(R.isBoolean(e))return e.toString();if(!l&&R.isBlob(e))throw new z(`Blob is not supported. Use a Buffer instead.`);return R.isArrayBuffer(e)||R.isTypedArray(e)?l&&typeof Blob==`function`?new Blob([e]):Buffer.from(e):e}function d(e,n,i){let s=e;if(R.isReactNative(t)&&R.isReactNativeBlob(e))return t.append(_t(i,n,a),u(e)),!1;if(e&&!i&&typeof e==`object`){if(R.endsWith(n,`{}`))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(R.isArray(e)&&vt(e)||(R.isFileList(e)||R.endsWith(n,`[]`))&&(s=R.toArray(e)))return n=gt(n),s.forEach(function(e,r){!(R.isUndefined(e)||e===null)&&t.append(o===!0?_t([n],r,a):o===null?n:n+`[]`,u(e))}),!1}return ht(e)?!0:(t.append(_t(i,n,a),u(e)),!1)}let f=[],p=Object.assign(yt,{defaultVisitor:d,convertValue:u,isVisitable:ht});function m(e,n,r=0){if(!R.isUndefined(e)){if(r>c)throw new z(`Object is too deeply nested (`+r+` levels). Max depth: `+c,z.ERR_FORM_DATA_DEPTH_EXCEEDED);if(f.indexOf(e)!==-1)throw Error(`Circular reference detected in `+n.join(`.`));f.push(e),R.forEach(e,function(e,a){(!(R.isUndefined(e)||e===null)&&i.call(t,e,R.isString(a)?a.trim():a,n,p))===!0&&m(e,n?n.concat(a):[a],r+1)}),f.pop()}}if(!R.isObject(e))throw TypeError(`data must be an object`);return m(e),t}function xt(e){let t={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function St(e,t){this._pairs=[],e&&bt(e,this,t)}var Ct=St.prototype;Ct.append=function(e,t){this._pairs.push([e,t])},Ct.toString=function(e){let t=e?function(t){return e.call(this,t,xt)}:xt;return this._pairs.map(function(e){return t(e[0])+`=`+t(e[1])},``).join(`&`)};function wt(e){return encodeURIComponent(e).replace(/%3A/gi,`:`).replace(/%24/g,`$`).replace(/%2C/gi,`,`).replace(/%20/g,`+`)}function B(e,t,n){if(!t)return e;let r=n&&n.encode||wt,i=R.isFunction(n)?{serialize:n}:n,a=i&&i.serialize,o;if(o=a?a(t,i):R.isURLSearchParams(t)?t.toString():new St(t,i).toString(r),o){let t=e.indexOf(`#`);t!==-1&&(e=e.slice(0,t)),e+=(e.indexOf(`?`)===-1?`?`:`&`)+o}return e}var Tt=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&=[]}forEach(e){R.forEach(this.handlers,function(t){t!==null&&e(t)})}},Et={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Dt={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<`u`?URLSearchParams:St,FormData:typeof FormData<`u`?FormData:null,Blob:typeof Blob<`u`?Blob:null},protocols:[`http`,`https`,`file`,`blob`,`url`,`data`]},Ot=f({hasBrowserEnv:()=>kt,hasStandardBrowserEnv:()=>jt,hasStandardBrowserWebWorkerEnv:()=>Mt,navigator:()=>At,origin:()=>Nt}),kt=typeof window<`u`&&typeof document<`u`,At=typeof navigator==`object`&&navigator||void 0,jt=kt&&(!At||[`ReactNative`,`NativeScript`,`NS`].indexOf(At.product)<0),Mt=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope&&typeof self.importScripts==`function`,Nt=kt&&window.location.href||`http://localhost`,Pt={...Ot,...Dt};function Ft(e,t){return bt(e,new Pt.classes.URLSearchParams,{visitor:function(e,t,n,r){return Pt.isNode&&R.isBuffer(e)?(this.append(t,e.toString(`base64`)),!1):r.defaultVisitor.apply(this,arguments)},...t})}function It(e){return R.matchAll(/\w+|\[(\w*)]/g,e).map(e=>e[0]===`[]`?``:e[1]||e[0])}function Lt(e){let t={},n=Object.keys(e),r,i=n.length,a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}function Rt(e){function t(e,n,r,i){let a=e[i++];if(a===`__proto__`)return!0;let o=Number.isFinite(+a),s=i>=e.length;return a=!a&&R.isArray(r)?r.length:a,s?(R.hasOwnProp(r,a)?r[a]=R.isArray(r[a])?r[a].concat(n):[r[a],n]:r[a]=n,!o):((!R.hasOwnProp(r,a)||!R.isObject(r[a]))&&(r[a]=[]),t(e,n,r[a],i)&&R.isArray(r[a])&&(r[a]=Lt(r[a])),!o)}if(R.isFormData(e)&&R.isFunction(e.entries)){let n={};return R.forEachEntry(e,(e,r)=>{t(It(e),r,n,0)}),n}return null}var zt=(e,t)=>e!=null&&R.hasOwnProp(e,t)?e[t]:void 0;function Bt(e,t,n){if(R.isString(e))try{return(t||JSON.parse)(e),R.trim(e)}catch(e){if(e.name!==`SyntaxError`)throw e}return(n||JSON.stringify)(e)}var Vt={transitional:Et,adapter:[`xhr`,`http`,`fetch`],transformRequest:[function(e,t){let n=t.getContentType()||``,r=n.indexOf(`application/json`)>-1,i=R.isObject(e);if(i&&R.isHTMLForm(e)&&(e=new FormData(e)),R.isFormData(e))return r?JSON.stringify(Rt(e)):e;if(R.isArrayBuffer(e)||R.isBuffer(e)||R.isStream(e)||R.isFile(e)||R.isBlob(e)||R.isReadableStream(e))return e;if(R.isArrayBufferView(e))return e.buffer;if(R.isURLSearchParams(e))return t.setContentType(`application/x-www-form-urlencoded;charset=utf-8`,!1),e.toString();let a;if(i){let t=zt(this,`formSerializer`);if(n.indexOf(`application/x-www-form-urlencoded`)>-1)return Ft(e,t).toString();if((a=R.isFileList(e))||n.indexOf(`multipart/form-data`)>-1){let n=zt(this,`env`),r=n&&n.FormData;return bt(a?{"files[]":e}:e,r&&new r,t)}}return i||r?(t.setContentType(`application/json`,!1),Bt(e)):e}],transformResponse:[function(e){let t=zt(this,`transitional`)||Vt.transitional,n=t&&t.forcedJSONParsing,r=zt(this,`responseType`),i=r===`json`;if(R.isResponse(e)||R.isReadableStream(e))return e;if(e&&R.isString(e)&&(n&&!r||i)){let n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,zt(this,`parseReviver`))}catch(e){if(n)throw e.name===`SyntaxError`?z.from(e,z.ERR_BAD_RESPONSE,this,null,zt(this,`response`)):e}}return e}],timeout:0,xsrfCookieName:`XSRF-TOKEN`,xsrfHeaderName:`X-XSRF-TOKEN`,maxContentLength:-1,maxBodyLength:-1,env:{FormData:Pt.classes.FormData,Blob:Pt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:`application/json, text/plain, */*`,"Content-Type":void 0}}};R.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`query`],e=>{Vt.headers[e]={}});function Ht(e,t){let n=this||Vt,r=t||n,i=dt.from(r.headers),a=r.data;return R.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function Ut(e){return!!(e&&e.__CANCEL__)}var Wt=class extends z{constructor(e,t,n){super(e??`canceled`,z.ERR_CANCELED,t,n),this.name=`CanceledError`,this.__CANCEL__=!0}};function Gt(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new z(`Request failed with status code `+n.status,n.status>=400&&n.status<500?z.ERR_BAD_REQUEST:z.ERR_BAD_RESPONSE,n.config,n.request,n))}function Kt(e){let t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||``}function qt(e,t){e||=10;let n=Array(e),r=Array(e),i=0,a=0,o;return t=t===void 0?1e3:t,function(s){let c=Date.now(),l=r[a];o||=c,n[i]=s,r[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;let f=l&&c-l;return f?Math.round(d*1e3/f):void 0}}function Jt(e,t){let n=0,r=1e3/t,i,a,o=(t,r=Date.now())=>{n=r,i=null,a&&=(clearTimeout(a),null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-n;s>=r?o(e,t):(i=e,a||=setTimeout(()=>{a=null,o(i)},r-s))},()=>i&&o(i)]}var Yt=(e,t,n=3)=>{let r=0,i=qt(50,250);return Jt(n=>{if(!n||typeof n.loaded!=`number`)return;let a=n.loaded,o=n.lengthComputable?n.total:void 0,s=o==null?a:Math.min(a,o),c=Math.max(0,s-r),l=i(c);r=Math.max(r,s),e({loaded:s,total:o,progress:o?s/o:void 0,bytes:c,rate:l||void 0,estimated:l&&o?(o-s)/l:void 0,event:n,lengthComputable:o!=null,[t?`download`:`upload`]:!0})},n)},Xt=(e,t)=>{let n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Zt=e=>(...t)=>R.asap(()=>e(...t)),Qt=Pt.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Pt.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Pt.origin),Pt.navigator&&/(msie|trident)/i.test(Pt.navigator.userAgent)):()=>!0,$t=Pt.hasStandardBrowserEnv?{write(e,t,n,r,i,a,o){if(typeof document>`u`)return;let s=[`${e}=${encodeURIComponent(t)}`];R.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),R.isString(r)&&s.push(`path=${r}`),R.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push(`secure`),R.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join(`; `)},read(e){if(typeof document>`u`)return null;let t=document.cookie.split(`;`);for(let n=0;n<t.length;n++){let r=t[n].replace(/^\s+/,``),i=r.indexOf(`=`);if(i!==-1&&r.slice(0,i)===e)return decodeURIComponent(r.slice(i+1))}return null},remove(e){this.write(e,``,Date.now()-864e5,`/`)}}:{write(){},read(){return null},remove(){}};function en(e){return typeof e==`string`?/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e):!1}function tn(e,t){return t?e.replace(/\/?\/$/,``)+`/`+t.replace(/^\/+/,``):e}function nn(e,t,n){let r=!en(t);return e&&(r||n===!1)?tn(e,t):t}var rn=e=>e instanceof dt?{...e}:e;function an(e,t){t||={};let n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(e,t,n,r){return R.isPlainObject(e)&&R.isPlainObject(t)?R.merge.call({caseless:r},e,t):R.isPlainObject(t)?R.merge({},t):R.isArray(t)?t.slice():t}function i(e,t,n,i){if(!R.isUndefined(t))return r(e,t,n,i);if(!R.isUndefined(e))return r(void 0,e,n,i)}function a(e,t){if(!R.isUndefined(t))return r(void 0,t)}function o(e,t){if(!R.isUndefined(t))return r(void 0,t);if(!R.isUndefined(e))return r(void 0,e)}function s(n,i,a){if(R.hasOwnProp(t,a))return r(n,i);if(R.hasOwnProp(e,a))return r(void 0,n)}let c={url:a,method:a,data:a,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,allowedSocketPaths:o,responseEncoding:o,validateStatus:s,headers:(e,t,n)=>i(rn(e),rn(t),n,!0)};return R.forEach(Object.keys({...e,...t}),function(r){if(r===`__proto__`||r===`constructor`||r===`prototype`)return;let a=R.hasOwnProp(c,r)?c[r]:i,o=a(R.hasOwnProp(e,r)?e[r]:void 0,R.hasOwnProp(t,r)?t[r]:void 0,r);R.isUndefined(o)&&a!==s||(n[r]=o)}),n}var on=[`content-type`,`content-length`];function sn(e,t,n){if(n!==`content-only`){e.set(t);return}Object.entries(t).forEach(([t,n])=>{on.includes(t.toLowerCase())&&e.set(t,n)})}var cn=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))),ln=e=>{let t=an({},e),n=e=>R.hasOwnProp(t,e)?t[e]:void 0,r=n(`data`),i=n(`withXSRFToken`),a=n(`xsrfHeaderName`),o=n(`xsrfCookieName`),s=n(`headers`),c=n(`auth`),l=n(`baseURL`),u=n(`allowAbsoluteUrls`),d=n(`url`);if(t.headers=s=dt.from(s),t.url=B(nn(l,d,u),e.params,e.paramsSerializer),c&&s.set(`Authorization`,`Basic `+btoa((c.username||``)+`:`+(c.password?cn(c.password):``))),R.isFormData(r)&&(Pt.hasStandardBrowserEnv||Pt.hasStandardBrowserWebWorkerEnv?s.setContentType(void 0):R.isFunction(r.getHeaders)&&sn(s,r.getHeaders(),n(`formDataHeaderPolicy`))),Pt.hasStandardBrowserEnv&&(R.isFunction(i)&&(i=i(t)),i===!0||i==null&&Qt(t.url))){let e=a&&o&&$t.read(o);e&&s.set(a,e)}return t},un=typeof XMLHttpRequest<`u`&&function(e){return new Promise(function(t,n){let r=ln(e),i=r.data,a=dt.from(r.headers).normalize(),{responseType:o,onUploadProgress:s,onDownloadProgress:c}=r,l,u,d,f,p;function m(){f&&f(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener(`abort`,l)}let h=new XMLHttpRequest;h.open(r.method.toUpperCase(),r.url,!0),h.timeout=r.timeout;function g(){if(!h)return;let r=dt.from(`getAllResponseHeaders`in h&&h.getAllResponseHeaders());Gt(function(e){t(e),m()},function(e){n(e),m()},{data:!o||o===`text`||o===`json`?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:r,config:e,request:h}),h=null}`onloadend`in h?h.onloadend=g:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.startsWith(`file:`))||setTimeout(g)},h.onabort=function(){h&&=(n(new z(`Request aborted`,z.ECONNABORTED,e,h)),m(),null)},h.onerror=function(t){let r=new z(t&&t.message?t.message:`Network Error`,z.ERR_NETWORK,e,h);r.event=t||null,n(r),m(),h=null},h.ontimeout=function(){let t=r.timeout?`timeout of `+r.timeout+`ms exceeded`:`timeout exceeded`,i=r.transitional||Et;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new z(t,i.clarifyTimeoutError?z.ETIMEDOUT:z.ECONNABORTED,e,h)),m(),h=null},i===void 0&&a.setContentType(null),`setRequestHeader`in h&&R.forEach(nt(a),function(e,t){h.setRequestHeader(t,e)}),R.isUndefined(r.withCredentials)||(h.withCredentials=!!r.withCredentials),o&&o!==`json`&&(h.responseType=r.responseType),c&&([d,p]=Yt(c,!0),h.addEventListener(`progress`,d)),s&&h.upload&&([u,f]=Yt(s),h.upload.addEventListener(`progress`,u),h.upload.addEventListener(`loadend`,f)),(r.cancelToken||r.signal)&&(l=t=>{h&&=(n(!t||t.type?new Wt(null,e,h):t),h.abort(),m(),null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener(`abort`,l)));let _=Kt(r.url);if(_&&!Pt.protocols.includes(_)){n(new z(`Unsupported protocol `+_+`:`,z.ERR_BAD_REQUEST,e));return}h.send(i||null)})},dn=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;let n=new AbortController,r=!1,i=function(e){if(!r){r=!0,o();let t=e instanceof Error?e:this.reason;n.abort(t instanceof z?t:new Wt(t instanceof Error?t.message:t))}},a=t&&setTimeout(()=>{a=null,i(new z(`timeout of ${t}ms exceeded`,z.ETIMEDOUT))},t),o=()=>{e&&=(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener(`abort`,i)}),null)};e.forEach(e=>e.addEventListener(`abort`,i));let{signal:s}=n;return s.unsubscribe=()=>R.asap(o),s},fn=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},pn=async function*(e,t){for await(let n of mn(e))yield*fn(n,t)},mn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},hn=(e,t,n,r)=>{let i=pn(e,t),a=0,o,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{let{done:t,value:r}=await i.next();if(t){s(),e.close();return}let o=r.byteLength;n&&n(a+=o),e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel(e){return s(e),i.return()}},{highWaterMark:2})};function gn(e){if(!e||typeof e!=`string`||!e.startsWith(`data:`))return 0;let t=e.indexOf(`,`);if(t<0)return 0;let n=e.slice(5,t),r=e.slice(t+1);if(/;base64/i.test(n)){let e=r.length,t=r.length;for(let n=0;n<t;n++)if(r.charCodeAt(n)===37&&n+2<t){let t=r.charCodeAt(n+1),i=r.charCodeAt(n+2);(t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102)&&(i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102)&&(e-=2,n+=2)}let n=0,i=t-1,a=e=>e>=2&&r.charCodeAt(e-2)===37&&r.charCodeAt(e-1)===51&&(r.charCodeAt(e)===68||r.charCodeAt(e)===100);i>=0&&(r.charCodeAt(i)===61?(n++,i--):a(i)&&(n++,i-=3)),n===1&&i>=0&&(r.charCodeAt(i)===61||a(i))&&n++;let o=Math.floor(e/4)*3-(n||0);return o>0?o:0}if(typeof Buffer<`u`&&typeof Buffer.byteLength==`function`)return Buffer.byteLength(r,`utf8`);let i=0;for(let e=0,t=r.length;e<t;e++){let n=r.charCodeAt(e);if(n<128)i+=1;else if(n<2048)i+=2;else if(n>=55296&&n<=56319&&e+1<t){let t=r.charCodeAt(e+1);t>=56320&&t<=57343?(i+=4,e++):i+=3}else i+=3}return i}var _n=`1.16.1`,vn=64*1024,{isFunction:yn}=R,bn=(e,...t)=>{try{return!!e(...t)}catch{return!1}},xn=e=>{let t=R.global!==void 0&&R.global!==null?R.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=R.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);let{fetch:i,Request:a,Response:o}=e,s=i?yn(i):typeof fetch==`function`,c=yn(a),l=yn(o);if(!s)return!1;let u=s&&yn(n),d=s&&(typeof r==`function`?(e=>t=>e.encode(t))(new r):async e=>new Uint8Array(await new a(e).arrayBuffer())),f=c&&u&&bn(()=>{let e=!1,t=new a(Pt.origin,{body:new n,method:`POST`,get duplex(){return e=!0,`half`}}),r=t.headers.has(`Content-Type`);return t.body!=null&&t.body.cancel(),e&&!r}),p=l&&u&&bn(()=>R.isReadableStream(new o(``).body)),m={stream:p&&(e=>e.body)};s&&[`text`,`arrayBuffer`,`blob`,`formData`,`stream`].forEach(e=>{!m[e]&&(m[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new z(`Response type '${e}' is not supported`,z.ERR_NOT_SUPPORT,n)})});let h=async e=>{if(e==null)return 0;if(R.isBlob(e))return e.size;if(R.isSpecCompliantForm(e))return(await new a(Pt.origin,{method:`POST`,body:e}).arrayBuffer()).byteLength;if(R.isArrayBufferView(e)||R.isArrayBuffer(e))return e.byteLength;if(R.isURLSearchParams(e)&&(e+=``),R.isString(e))return(await d(e)).byteLength},g=async(e,t)=>R.toFiniteNumber(e.getContentLength())??h(t);return async e=>{let{url:t,method:n,data:s,signal:l,cancelToken:u,timeout:d,onDownloadProgress:h,onUploadProgress:_,responseType:v,headers:y,withCredentials:b=`same-origin`,fetchOptions:x,maxContentLength:S,maxBodyLength:C}=ln(e),w=R.isNumber(S)&&S>-1,T=R.isNumber(C)&&C>-1,E=i||fetch;v=v?(v+``).toLowerCase():`text`;let D=dn([l,u&&u.toAbortSignal()],d),O=null,k=D&&D.unsubscribe&&(()=>{D.unsubscribe()}),A;try{if(w&&typeof t==`string`&&t.startsWith(`data:`)&&gn(t)>S)throw new z(`maxContentLength size of `+S+` exceeded`,z.ERR_BAD_RESPONSE,e,O);if(T&&n!==`get`&&n!==`head`){let t=await g(y,s);if(typeof t==`number`&&isFinite(t)&&t>C)throw new z(`Request body larger than maxBodyLength limit`,z.ERR_BAD_REQUEST,e,O)}if(_&&f&&n!==`get`&&n!==`head`&&(A=await g(y,s))!==0){let e=new a(t,{method:`POST`,body:s,duplex:`half`}),n;if(R.isFormData(s)&&(n=e.headers.get(`content-type`))&&y.setContentType(n),e.body){let[t,n]=Xt(A,Yt(Zt(_)));s=hn(e.body,vn,t,n)}}R.isString(b)||(b=b?`include`:`omit`);let i=c&&`credentials`in a.prototype;if(R.isFormData(s)){let e=y.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&y.delete(`content-type`)}y.set(`User-Agent`,`axios/`+_n,!1);let l={...x,signal:D,method:n.toUpperCase(),headers:nt(y.normalize()),body:s,duplex:`half`,credentials:i?b:void 0};O=c&&new a(t,l);let u=await(c?E(O,x):E(t,l));if(w){let t=R.toFiniteNumber(u.headers.get(`content-length`));if(t!=null&&t>S)throw new z(`maxContentLength size of `+S+` exceeded`,z.ERR_BAD_RESPONSE,e,O)}let d=p&&(v===`stream`||v===`response`);if(p&&u.body&&(h||w||d&&k)){let t={};[`status`,`statusText`,`headers`].forEach(e=>{t[e]=u[e]});let n=R.toFiniteNumber(u.headers.get(`content-length`)),[r,i]=h&&Xt(n,Yt(Zt(h),!0))||[],a=0;u=new o(hn(u.body,vn,t=>{if(w&&(a=t,a>S))throw new z(`maxContentLength size of `+S+` exceeded`,z.ERR_BAD_RESPONSE,e,O);r&&r(t)},()=>{i&&i(),k&&k()}),t)}v||=`text`;let j=await m[R.findKey(m,v)||`text`](u,e);if(w&&!p&&!d){let t;if(j!=null&&(typeof j.byteLength==`number`?t=j.byteLength:typeof j.size==`number`?t=j.size:typeof j==`string`&&(t=typeof r==`function`?new r().encode(j).byteLength:j.length)),typeof t==`number`&&t>S)throw new z(`maxContentLength size of `+S+` exceeded`,z.ERR_BAD_RESPONSE,e,O)}return!d&&k&&k(),await new Promise((t,n)=>{Gt(t,n,{data:j,headers:dt.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:O})})}catch(t){if(k&&k(),D&&D.aborted&&D.reason instanceof z){let n=D.reason;throw n.config=e,O&&(n.request=O),t!==n&&(n.cause=t),n}throw t&&t.name===`TypeError`&&/Load failed|fetch/i.test(t.message)?Object.assign(new z(`Network Error`,z.ERR_NETWORK,e,O,t&&t.response),{cause:t.cause||t}):z.from(t,t&&t.code,e,O,t&&t.response)}}},Sn=new Map,Cn=e=>{let t=e&&e.env||{},{fetch:n,Request:r,Response:i}=t,a=[r,i,n],o=a.length,s,c,l=Sn;for(;o--;)s=a[o],c=l.get(s),c===void 0&&l.set(s,c=o?new Map:xn(t)),l=c;return c};Cn();var wn={http:null,xhr:un,fetch:{get:Cn}};R.forEach(wn,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});var Tn=e=>`- ${e}`,En=e=>R.isFunction(e)||e===null||e===!1;function Dn(e,t){e=R.isArray(e)?e:[e];let{length:n}=e,r,i,a={};for(let o=0;o<n;o++){r=e[o];let n;if(i=r,!En(r)&&(i=wn[(n=String(r)).toLowerCase()],i===void 0))throw new z(`Unknown adapter '${n}'`);if(i&&(R.isFunction(i)||(i=i.get(t))))break;a[n||`#`+o]=i}if(!i){let e=Object.entries(a).map(([e,t])=>`adapter ${e} `+(t===!1?`is not supported by the environment`:`is not available in the build`));throw new z(`There is no suitable adapter to dispatch the request `+(n?e.length>1?`since :
|
|
4
|
+
`+e.map(Tn).join(`
|
|
5
|
+
`):` `+Tn(e[0]):`as no adapter specified`),`ERR_NOT_SUPPORT`)}return i}var On={getAdapter:Dn,adapters:wn};function kn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Wt(null,e)}function An(e){return kn(e),e.headers=dt.from(e.headers),e.data=Ht.call(e,e.transformRequest),[`post`,`put`,`patch`].indexOf(e.method)!==-1&&e.headers.setContentType(`application/x-www-form-urlencoded`,!1),On.getAdapter(e.adapter||Vt.adapter,e)(e).then(function(t){kn(e),e.response=t;try{t.data=Ht.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=dt.from(t.headers),t},function(t){if(!Ut(t)&&(kn(e),t&&t.response)){e.response=t.response;try{t.response.data=Ht.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=dt.from(t.response.headers)}return Promise.reject(t)})}var jn={};[`object`,`boolean`,`number`,`function`,`string`,`symbol`].forEach((e,t)=>{jn[e]=function(n){return typeof n===e||`a`+(t<1?`n `:` `)+e}});var Mn={};jn.transitional=function(e,t,n){function r(e,t){return`[Axios v`+_n+`] Transitional option '`+e+`'`+t+(n?`. `+n:``)}return(n,i,a)=>{if(e===!1)throw new z(r(i,` has been removed`+(t?` in `+t:``)),z.ERR_DEPRECATED);return t&&!Mn[i]&&(Mn[i]=!0,console.warn(r(i,` has been deprecated since v`+t+` and will be removed in the near future`))),e?e(n,i,a):!0}},jn.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function Nn(e,t,n){if(typeof e!=`object`)throw new z(`options must be an object`,z.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),i=r.length;for(;i-- >0;){let a=r[i],o=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;if(o){let t=e[a],n=t===void 0||o(t,a,e);if(n!==!0)throw new z(`option `+a+` must be `+n,z.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new z(`Unknown option `+a,z.ERR_BAD_OPTION)}}var Pn={assertOptions:Nn,validators:jn},Fn=Pn.validators,In=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Tt,response:new Tt}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let n=(()=>{if(!t.stack)return``;let e=t.stack.indexOf(`
|
|
6
|
+
`);return e===-1?``:t.stack.slice(e+1)})();try{if(!e.stack)e.stack=n;else if(n){let t=n.indexOf(`
|
|
7
|
+
`),r=t===-1?-1:n.indexOf(`
|
|
8
|
+
`,t+1),i=r===-1?``:n.slice(r+1);String(e.stack).endsWith(i)||(e.stack+=`
|
|
9
|
+
`+n)}}catch{}}throw e}}_request(e,t){typeof e==`string`?(t||={},t.url=e):t=e||{},t=an(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&Pn.assertOptions(n,{silentJSONParsing:Fn.transitional(Fn.boolean),forcedJSONParsing:Fn.transitional(Fn.boolean),clarifyTimeoutError:Fn.transitional(Fn.boolean),legacyInterceptorReqResOrdering:Fn.transitional(Fn.boolean)},!1),r!=null&&(R.isFunction(r)?t.paramsSerializer={serialize:r}:Pn.assertOptions(r,{encode:Fn.function,serialize:Fn.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),Pn.assertOptions(t,{baseUrl:Fn.spelling(`baseURL`),withXsrfToken:Fn.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&R.merge(i.common,i[t.method]);i&&R.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`query`,`common`],e=>{delete i[e]}),t.headers=dt.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s&&=e.synchronous;let n=t.transitional||Et;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[An.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=o.length;let f=t;for(;u<d;){let e=o[u++],t=o[u++];try{f=e(f)}catch(e){t.call(this,e);break}}try{l=An.call(this,f)}catch(e){return Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return e=an(this.defaults,e),B(nn(e.baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};R.forEach([`delete`,`get`,`head`,`options`],function(e){In.prototype[e]=function(t,n){return this.request(an(n||{},{method:e,url:t,data:(n||{}).data}))}}),R.forEach([`post`,`put`,`patch`,`query`],function(e){function t(t){return function(n,r,i){return this.request(an(i||{},{method:e,headers:t?{"Content-Type":`multipart/form-data`}:{},url:n,data:r}))}}In.prototype[e]=t(),e!==`query`&&(In.prototype[e+`Form`]=t(!0))});var Ln=class e{constructor(e){if(typeof e!=`function`)throw TypeError(`executor must be a function.`);let t;this.promise=new Promise(function(e){t=e});let n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new Wt(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function Rn(e){return function(t){return e.apply(null,t)}}function zn(e){return R.isObject(e)&&e.isAxiosError===!0}var Bn={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Bn).forEach(([e,t])=>{Bn[t]=e});function Vn(e){let t=new In(e),n=x(In.prototype.request,t);return R.extend(n,In.prototype,t,{allOwnKeys:!0}),R.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return Vn(an(e,t))},n}var Hn=Vn(Vt);Hn.Axios=In,Hn.CanceledError=Wt,Hn.CancelToken=Ln,Hn.isCancel=Ut,Hn.VERSION=_n,Hn.toFormData=bt,Hn.AxiosError=z,Hn.Cancel=Hn.CanceledError,Hn.all=function(e){return Promise.all(e)},Hn.spread=Rn,Hn.isAxiosError=zn,Hn.mergeConfig=an,Hn.AxiosHeaders=dt,Hn.formToJSON=e=>Rt(R.isHTMLForm(e)?new FormData(e):e),Hn.getAdapter=On.getAdapter,Hn.HttpStatusCode=Bn,Hn.default=Hn;var Un=(0,h.createContext)({});function Wn(){let e=(0,h.useContext)(Un);if(!e)throw Error(`Only use 'useApiContext' within a ApiContext Provider`);return e}var Gn={UNAUTHORIZED:401,MAINTENANCE_MODE:503},Kn=e=>{let t=e.response?.status;return t&&t!==Gn.UNAUTHORIZED&&console.error(e.response),Promise.reject(e)};function qn(){let{apiKey:e,host:t}=Wn(),n=(e,t={},n={})=>o(`GET`,e,t,n),r=(e,t={},n={})=>o(`POST`,e,t,n),i=(e,t={},n={})=>o(`PUT`,e,t,n),a=(e,t={})=>o(`DELETE`,e,t),o=(n,r,i={},a={})=>{let o=Hn.create({baseURL:`${t??`https://api.piggy.eu`}/api/v1/portal-sessions`,...a,headers:{Authorization:`Bearer ${e}`,...a.headers,"X-SDK-Version":`0.3.0-beta.9`}});return o.interceptors.response.use(void 0,Kn),o.request({method:n,url:r,params:n==`GET`?i:{},data:i})};return{get:n,post:r,put:i,destroy:a}}var Jn=m(d(((e,t)=>{(function(){"use strict";var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()}))(),1);function Yn(e){return(0,n.jsxs)(`svg`,{...e,"aria-hidden":`true`,role:`status`,className:(0,Jn.default)(`inline h-5 w-5 animate-spin fill-[#E5E7EB]`,e.className),viewBox:`0 0 100 101`,fill:`red`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,n.jsx)(`path`,{d:`M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z`,fill:`currentFill`}),(0,n.jsx)(`path`,{d:`M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z`,fill:`currentColor`})]})}var Xn=`data:image/svg+xml,%3csvg%20width='331'%20height='297'%20viewBox='0%200%20331%20297'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M260.633%20120.233C256.252%20141.975%20249.682%20152.798%20240.921%20152.798C234.584%20152.798%20229.087%20148.853%20224.473%20140.869C219.859%20132.931%20213.661%20120.233%20205.88%20102.869C196.606%2081.8482%20188.078%2064.6769%20180.297%2051.2559C172.516%2037.8843%20162.543%2026.0991%20150.381%2015.9495C138.171%205.84943%20123.585%200.750732%20106.531%200.750732C66.1304%200.750732%2037.5648%2028.4561%2020.7431%2083.8685C8.56966%20124.042%201.84252%20172.378%200.554243%20228.779C0.43324%20234.077%200.372738%20236.726%201.39875%20238.822C2.29091%20240.644%203.79168%20242.18%205.59324%20243.113C7.66509%20244.187%2010.3571%20244.187%2015.7412%20244.187H49.9832C55.1593%20244.187%2057.7474%20244.187%2059.7252%20243.228C61.4991%20242.369%2062.8933%20241.064%2063.8691%20239.352C64.9571%20237.442%2065.1344%20234.785%2065.489%20229.471C66.8596%20208.929%2069.3476%20191.707%2072.9797%20177.809C78.8046%20155.346%2086.5875%20144.139%2096.3253%20144.139C103.13%20144.139%20109.001%20148.131%20113.848%20156.068C118.693%20164.053%20125.264%20177.425%20133.558%20196.281C146.234%20227.402%20159.374%20251.837%20172.982%20269.586C186.634%20287.335%20205.135%20296.186%20228.48%20296.186C267.948%20296.186%20295.536%20268.672%20311.379%20213.645C322.875%20173.601%20329.307%20125.115%20330.648%2068.1882C330.773%2062.8736%20330.836%2060.2162%20329.81%2058.1189C328.918%2056.2936%20327.419%2054.7593%20325.615%2053.8241C323.543%2052.7496%20320.846%2052.7496%20315.451%2052.7496H281.752C276.521%2052.7496%20273.906%2052.7496%20271.908%2053.7319C270.126%2054.6081%20268.711%2055.9568%20267.751%2057.6953C266.675%2059.6442%20266.547%2062.3114%20266.293%2067.6459C265.272%2089.0314%20263.387%20106.562%20260.633%20120.233Z'%20fill='currentColor'/%3e%3c/svg%3e`;function Zn({children:e,accent:t=`primary`}){return(0,n.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-linear-to-br from-core-gray-50 via-core-white-900 to-core-primary-50 px-6 py-10 text-center`,children:(0,n.jsxs)(`div`,{className:`relative w-full max-w-2xl overflow-hidden rounded-3xl border border-core-gray-100 bg-core-white-900 px-8 py-12 shadow-xl sm:px-12`,children:[(0,n.jsx)(`div`,{className:`absolute -top-20 -right-20 h-48 w-48 rounded-full bg-core-primary-100 opacity-60 blur-3xl`}),(0,n.jsx)(`div`,{className:`absolute -bottom-24 -left-16 h-56 w-56 rounded-full ${t===`red`?`bg-core-red-100`:`bg-core-primary-100`} opacity-40 blur-3xl`}),(0,n.jsxs)(`div`,{className:`relative z-10 flex flex-col items-center gap-8`,children:[(0,n.jsx)(`div`,{className:`flex h-24 w-24 items-center justify-center rounded-3xl bg-core-white-900 shadow-lg ring-1 ring-core-gray-100`,children:(0,n.jsx)(`img`,{alt:`Leat`,src:Xn,className:`h-12 w-12`})}),e]})]})})}function Qn({message:e=``}){return(0,n.jsx)(Zn,{children:(0,n.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,n.jsx)(Yn,{className:`h-8 w-8 text-core-primary-500`}),e&&(0,n.jsx)(`p`,{className:`font-medium text-base text-core-gray-600 leading-7 sm:text-lg`,children:e})]})})}var V=e=>typeof e==`string`,$n=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},er=e=>e==null?``:String(e),tr=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},nr=/###/g,rr=e=>e&&e.includes(`###`)?e.replace(nr,`.`):e,ir=e=>!e||V(e),ar=(e,t,n)=>{let r=V(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(ir(e))return{};let t=rr(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return ir(e)?{}:{obj:e,k:rr(r[i])}},or=(e,t,n)=>{let{obj:r,k:i}=ar(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=ar(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=ar(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},sr=(e,t,n,r)=>{let{obj:i,k:a}=ar(e,t,Object);i[a]=i[a]||[],i[a].push(n)},cr=(e,t)=>{let{obj:n,k:r}=ar(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},lr=(e,t,n)=>{let r=cr(e,n);return r===void 0?cr(t,n):r},ur=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?V(e[r])||e[r]instanceof String||V(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):ur(e[r],t[r],n):e[r]=t[r]);return e},dr=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),fr={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`,"/":`/`},pr=e=>V(e)?e.replace(/[&<>"'\/]/g,e=>fr[e]):e,mr=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},hr=[` `,`,`,`?`,`!`,`;`],gr=new mr(20),_r=(e,t,n)=>{t||=``,n||=``;let r=hr.filter(e=>!t.includes(e)&&!n.includes(e));if(r.length===0)return!0;let i=gr.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},vr=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].includes(typeof t)&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},yr=e=>e?.replace(/_/g,`-`),br={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},xr=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||br,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(e=e.map(e=>V(e)?e.replace(/[\r\n\x00-\x1F\x7F]/g,` `):e),V(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},Sr=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}once(e,t){let n=(...r)=>{t(...r),this.off(e,n)};return this.on(e,n),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n(e,...t)})}},Cr=class extends Sr{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.includes(`.`)?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):V(n)&&i?o.push(...n.split(i)):o.push(n)));let s=cr(this.data,o);return!s&&!t&&!n&&e.includes(`.`)&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!V(n)?s:vr(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.includes(`.`)&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),or(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(V(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.includes(`.`)&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=cr(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?ur(s,n,i):s={...s,...n},or(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},wr={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},Tr=Symbol(`i18next/PATH_KEY`);function Er(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===Tr?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function Dr(e,t){let{[Tr]:n}=e(Er()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`,a=t?.enableSelector===`strict`;if(n.length>1&&i){let e=t?.ns,o=a?Array.isArray(e)?e:e?[e]:null:Array.isArray(e)?e:null;if(o&&(a?o:o.length>1?o.slice(1):[]).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var Or=e=>!V(e)&&typeof e!=`boolean`&&typeof e!=`number`,kr=class e extends Sr{constructor(e,t={}){super(),tr([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=xr.create(`translator`),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=Or(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.includes(n),o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!_r(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:V(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.includes(a[0]))&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:V(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=Dr(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?Dr(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!V(i.count),x=e.hasDefaultValue(i),S=b?this.pluralResolver.getSuffix(d,i.count,i):``,C=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,w=b&&!i.ordinal&&i.count===0,T=w&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${C}`]||i.defaultValue,E=m;y&&!m&&x&&(E=T);let D=Or(E),O=Object.prototype.toString.apply(E);if(y&&E&&D&&!_.includes(O)&&!(V(v)&&Array.isArray(E))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,E,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(E),t=e?[]:{},n=e?g:h;for(let e in E)if(Object.prototype.hasOwnProperty.call(E,e)){let r=`${n}${o}${e}`;x&&!m?t[e]=this.translate(r,{...i,defaultValue:Or(T)?T[e]:void 0,joinArrays:!1,ns:c}):t[e]=this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=E[e])}m=t}}else if(y&&V(v)&&Array.isArray(m))m=m.join(v),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=T),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&T!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,b&&!c?`${s}${this.pluralResolver.getSuffix(d,i.count,i)}`:s,c?T:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);w&&i[`defaultValue${this.options.pluralSeparator}zero`]&&!t.includes(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||T)})}):n(e,s,T))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=V(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!V(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;o<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>i?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=V(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=wr.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return V(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?Dr(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!V(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(V(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!this.checkedLoadedFor[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(this.checkedLoadedFor[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.startsWith(i)&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.startsWith(i)&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!V(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith(`defaultValue`)&&e[t]!==void 0)return!0;return!1}},Ar=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=xr.create(`languageUtils`)}getScriptPartFromCode(e){if(e=yr(e),!e||!e.includes(`-`))return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=yr(e),!e||!e.includes(`-`))return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(V(e)&&e.includes(`-`)){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?!0:!e.includes(`-`)&&!r.includes(`-`)?!1:!!(e.includes(`-`)&&!r.includes(`-`)&&e.slice(0,e.indexOf(`-`))===r||e.startsWith(r)&&r.length>1))}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),V(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return V(e)&&(e.includes(`-`)||e.includes(`_`))?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):V(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.includes(e)||i(this.formatLanguageCode(e))}),r}},jr={zero:0,one:1,two:2,few:3,many:4,other:5},Mr={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},Nr=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=xr.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=yr(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),Mr;if(!e.match(/-|_/))return Mr;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>jr[e]-jr[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},Pr=(e,t,n,r=`.`,i=!0)=>{let a=lr(e,t,n);return!a&&i&&V(n)&&(a=vr(e,n,r),a===void 0&&(a=vr(t,n,r))),a},Fr=e=>e.replace(/\$/g,`$$$$`),Ir=class{constructor(e={}){this.logger=xr.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?pr:t,this.escapeValue=n===void 0?!0:n,this.useRawValueToEscape=r===void 0?!1:r,this.prefix=i?dr(i):a||`{{`,this.suffix=o?dr(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u?dr(u):`-`,this.unescapeSuffix=this.unescapePrefix?``:l?dr(l):``,this.nestingPrefix=d?dr(d):f||dr(`$t(`),this.nestingSuffix=p?dr(p):m||dr(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_===void 0?!1:_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(!e.includes(this.formatSeparator)){let i=Pr(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(Pr(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp(),!this.escapeValue&&typeof e==`string`&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn(`nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.`);let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Fr(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Fr(this.escape(e)):Fr(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0)if(typeof l==`function`){let t=l(e,i,r);a=V(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``;else !V(a)&&!this.useRawValueToEscape&&(a=er(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(!e.includes(n))return e;let r=e.split(RegExp(`${dr(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!V(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!V(i))return i;V(i)||(i=er(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},Lr=e=>{let t=e.toLowerCase().trim(),n={};if(e.includes(`(`)){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].slice(0,-1);t===`currency`&&!i.includes(`:`)?n.currency||=i.trim():t===`relativetime`&&!i.includes(`:`)?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},Rr=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(yr(r),i),t[o]=s),s(n)}},zr=e=>(t,n,r)=>e(yr(n),r)(t),Br=class{constructor(e={}){this.logger=xr.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?Rr:zr;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Rr(t)}format(e,t,n,r={}){if(!t||e==null)return e;let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&!i[0].includes(`)`)&&i.find(e=>e.includes(`)`))){let e=i.findIndex(e=>e.includes(`)`));i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=Lr(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}else this.logger.warn(`there was no format function for ${i}`);return e},e)}},Vr=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},Hr=class extends Sr{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=xr.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{sr(n.loaded,[i],a),Vr(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read(e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();V(e)&&(e=this.languageUtils.toResolveHierarchy(e)),V(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);return}if(!(n==null||n===``)){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}},Ur=()=>({debug:!1,initAsync:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),V(e[1])&&(t.defaultValue=e[1]),V(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Wr=e=>(V(e.ns)&&(e.ns=[e.ns]),V(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),V(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes(`cimode`)&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),e),Gr=()=>{},Kr=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},qr=class e extends Sr{constructor(e={},t){if(super(),this.options=Wr(e),this.services={},this.logger=xr,this.modules={external:[]},Kr(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(V(e.ns)?e.defaultNS=e.ns:e.ns.includes(`translation`)||(e.defaultNS=e.ns[0]));let n=Ur();this.options={...n,...this.options,...Wr(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler);let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?xr.init(r(this.modules.logger),this.options):xr.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:Br;let t=new Ar(this.options);this.store=new Cr(this.options.resources,this.options);let n=this.services;n.logger=xr,n.resourceStore=this.store,n.languageUtils=t,n.pluralResolver=new Nr(t,{prepend:this.options.pluralSeparator}),e&&(n.formatter=r(e),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new Ir(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new Hr(r(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(n.languageDetector=r(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=r(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new kr(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||=Gr,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=$n(),a=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),i.resolve(n),t(e,n)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=Gr){let n=t,r=V(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&(e.includes(t)||e.push(t))})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=$n();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=Gr,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&wr.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&![`cimode`,`dev`].includes(e)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(![`cimode`,`dev`].includes(t)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=$n();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=V(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(V(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n,r){let i=r?.scopeNs,a=(e,t,...r)=>{let o;o=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(r)),o.lng=o.lng||a.lng,o.lngs=o.lngs||a.lngs;let s=o.ns!==void 0&&o.ns!==null;o.ns=o.ns||a.ns,o.keyPrefix!==``&&(o.keyPrefix=o.keyPrefix||n||a.keyPrefix);let c={...this.options,...o};Array.isArray(i)&&!s&&(c.ns=i),typeof o.keyPrefix==`function`&&(o.keyPrefix=Dr(o.keyPrefix,c));let l=this.options.keySeparator||`.`,u;return o.keyPrefix&&Array.isArray(e)?u=e.map(e=>(typeof e==`function`&&(e=Dr(e,c)),`${o.keyPrefix}${l}${e}`)):(typeof e==`function`&&(e=Dr(e,c)),u=o.keyPrefix?`${o.keyPrefix}${l}${e}`:e),this.t(u,o)};return V(e)?a.lng=e:a.lngs=e,a.ns=t,a.keyPrefix=n,a}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=$n();return this.options.ns?(V(e)&&(e=[e]),e.forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=$n();V(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>!r.includes(e)&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services?.languageUtils||new Ar(Ur());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.includes(n.getLanguagePartFromCode(e))||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=Gr){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new Cr(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...Ur().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new Ir(n)}return a.translator=new kr(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();qr.createInstance,qr.dir,qr.init,qr.loadResources,qr.reloadResources,qr.use,qr.changeLanguage,qr.getFixedT,qr.t,qr.exists,qr.setDefaultNamespace,qr.hasLoadedNamespace,qr.loadNamespaces,qr.loadLanguages;var Jr=(e,t=`EUR`)=>new Intl.NumberFormat(qr.language,{style:`currency`,currency:t??`EUR`}).format(e/100),Yr=e=>{window.parent.postMessage(e,`*`)},Xr=(e,t)=>Math.abs(Math.round((t.getTime()-e.getTime())/(1e3*3600*24))),Zr=(e,t)=>Math.abs(Math.round((t.getTime()-e.getTime())/(1e3*3600*24*7))),Qr=(e,t)=>Math.abs(Math.round((t.getTime()-e.getTime())/(1e3*3600*24*365.25))),$r=e=>e===``||e==null||e===`null`,ei=(0,h.createContext)({cameraService:1,cameraFacingMode:b.USER,primaryIdentificationMethod:g.IDENTIFIER}),ti=(0,h.createContext)({portalSession:null,setPortalSession:()=>{},mutate:async()=>{}});function H(){let e=(0,h.useContext)(ti);if(!e)throw Error(`Only use 'usePortalSessionContext' within a PortalSessionProvider`);return e}function ni(e){let{portalSession:t}=H();return(0,h.useEffect)(()=>{t.contact&&e.onContactLink?.(t.contact)},[t.contact]),(0,n.jsx)(ei.Provider,{value:{cameraService:t.input_data.camera_service,cameraFacingMode:t.input_data.facing_mode,primaryIdentificationMethod:t.input_data.primary_identification_method,...e},children:e.children})}function ri(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var ii=e=>{switch(e){case`success`:return si;case`info`:return li;case`warning`:return ci;case`error`:return ui;default:return null}},ai=Array(12).fill(0),oi=({visible:e,className:t})=>h.default.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},h.default.createElement(`div`,{className:`sonner-spinner`},ai.map((e,t)=>h.default.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),si=h.default.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},h.default.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),ci=h.default.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},h.default.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),li=h.default.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},h.default.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),ui=h.default.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},h.default.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),di=h.default.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},h.default.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),h.default.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),fi=()=>{let[e,t]=h.default.useState(document.hidden);return h.default.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},pi=1,mi=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:pi++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],h.default.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(gi(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!h.default.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!h.default.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!h.default.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!h.default.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||pi++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},hi=(e,t)=>{let n=t?.id||pi++;return mi.addToast({title:e,...t,id:n}),n},gi=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,_i=Object.assign(hi,{success:mi.success,info:mi.info,warning:mi.warning,error:mi.error,custom:mi.custom,message:mi.message,promise:mi.promise,dismiss:mi.dismiss,loading:mi.loading},{getHistory:()=>mi.toasts,getToasts:()=>mi.getActiveToasts()});ri(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function vi(e){return e.label!==void 0}var yi=3,bi=`24px`,xi=`16px`,Si=4e3,Ci=356,wi=14,Ti=45,Ei=200;function Di(...e){return e.filter(Boolean).join(` `)}function Oi(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var ki=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:g,actionButtonStyle:_,className:v=``,descriptionClassName:y=``,duration:b,position:x,gap:S,expandByDefault:C,classNames:w,icons:T,closeButtonAriaLabel:E=`Close toast`}=e,[D,O]=h.default.useState(null),[k,A]=h.default.useState(null),[j,M]=h.default.useState(!1),[N,ee]=h.default.useState(!1),[P,te]=h.default.useState(!1),[ne,re]=h.default.useState(!1),[ie,F]=h.default.useState(!1),[ae,oe]=h.default.useState(0),[se,ce]=h.default.useState(0),le=h.default.useRef(n.duration||b||Si),ue=h.default.useRef(null),I=h.default.useRef(null),L=c===0,de=c+1<=o,fe=n.type,pe=n.dismissible!==!1,me=n.className||``,he=n.descriptionClassName||``,ge=h.default.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),_e=h.default.useMemo(()=>n.closeButton??p,[n.closeButton,p]),ve=h.default.useMemo(()=>n.duration||b||Si,[n.duration,b]),ye=h.default.useRef(0),be=h.default.useRef(0),xe=h.default.useRef(0),Se=h.default.useRef(null),[Ce,we]=x.split(`-`),Te=h.default.useMemo(()=>s.reduce((e,t,n)=>n>=ge?e:e+t.height,0),[s,ge]),Ee=fi(),De=n.invert||t,Oe=fe===`loading`;be.current=h.default.useMemo(()=>ge*S+Te,[ge,Te]),h.default.useEffect(()=>{le.current=ve},[ve]),h.default.useEffect(()=>{M(!0)},[]),h.default.useEffect(()=>{let e=I.current;if(e){let t=e.getBoundingClientRect().height;return ce(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),h.default.useLayoutEffect(()=>{if(!j)return;let e=I.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,ce(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[j,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let ke=h.default.useCallback(()=>{ee(!0),oe(be.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},Ei)},[n,d,a,be]);h.default.useEffect(()=>{if(n.promise&&fe===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||Ee?(()=>{if(xe.current<ye.current){let e=new Date().getTime()-ye.current;le.current-=e}xe.current=new Date().getTime()})():le.current!==1/0&&(ye.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),ke()},le.current)),()=>clearTimeout(e)},[u,i,n,fe,Ee,ke]),h.default.useEffect(()=>{n.delete&&(ke(),n.onDismiss==null||n.onDismiss.call(n,n))},[ke,n.delete]);function Ae(){return T?.loading?h.default.createElement(`div`,{className:Di(w?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":fe===`loading`},T.loading):h.default.createElement(oi,{className:Di(w?.loader,n?.classNames?.loader),visible:fe===`loading`})}let je=n.icon||T?.[fe]||ii(fe);return h.default.createElement(`li`,{tabIndex:0,ref:I,className:Di(v,me,w?.toast,n?.classNames?.toast,w?.default,w?.[fe],n?.classNames?.[fe]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":j,"data-promise":!!n.promise,"data-swiped":ie,"data-removed":N,"data-visible":de,"data-y-position":Ce,"data-x-position":we,"data-index":c,"data-front":L,"data-swiping":P,"data-dismissible":pe,"data-type":fe,"data-invert":De,"data-swipe-out":ne,"data-swipe-direction":k,"data-expanded":!!(u||C&&j),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${N?ae:be.current}px`,"--initial-height":C?`auto`:`${se}px`,...m,...n.style},onDragEnd:()=>{te(!1),O(null),Se.current=null},onPointerDown:e=>{e.button!==2&&(Oe||!pe||(ue.current=new Date,oe(be.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(te(!0),Se.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(ne||!pe)return;Se.current=null;let e=Number(I.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(I.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-ue.current?.getTime(),i=D===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=Ti||a>.11){oe(be.current),n.onDismiss==null||n.onDismiss.call(n,n),A(D===`x`?e>0?`right`:`left`:t>0?`down`:`up`),ke(),re(!0);return}else{var o,s;(o=I.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=I.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}F(!1),te(!1),O(null)},onPointerMove:t=>{var n,r;if(!Se.current||!pe||window.getSelection()?.toString().length>0)return;let i=t.clientY-Se.current.y,a=t.clientX-Se.current.x,o=e.swipeDirections??Oi(x);!D&&(Math.abs(a)>1||Math.abs(i)>1)&&O(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(D===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(D===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&F(!0),(n=I.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=I.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},_e&&!n.jsx&&fe!==`loading`?h.default.createElement(`button`,{"aria-label":E,"data-disabled":Oe,"data-close-button":!0,onClick:Oe||!pe?()=>{}:()=>{ke(),n.onDismiss==null||n.onDismiss.call(n,n)},className:Di(w?.closeButton,n?.classNames?.closeButton)},T?.close??di):null,(fe||n.icon||n.promise)&&n.icon!==null&&(T?.[fe]!==null||n.icon)?h.default.createElement(`div`,{"data-icon":``,className:Di(w?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||Ae():null,n.type===`loading`?null:je):null,h.default.createElement(`div`,{"data-content":``,className:Di(w?.content,n?.classNames?.content)},h.default.createElement(`div`,{"data-title":``,className:Di(w?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?h.default.createElement(`div`,{"data-description":``,className:Di(y,he,w?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),h.default.isValidElement(n.cancel)?n.cancel:n.cancel&&vi(n.cancel)?h.default.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||g,onClick:e=>{vi(n.cancel)&&pe&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),ke())},className:Di(w?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,h.default.isValidElement(n.action)?n.action:n.action&&vi(n.action)?h.default.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||_,onClick:e=>{vi(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&ke())},className:Di(w?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Ai(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function ji(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?xi:bi;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Mi=h.default.forwardRef(function(e,t){let{id:n,invert:i,position:a=`bottom-right`,hotkey:o=[`altKey`,`KeyT`],expand:s,closeButton:c,className:l,offset:u,mobileOffset:d,theme:f=`light`,richColors:p,duration:m,style:g,visibleToasts:_=yi,toastOptions:v,dir:y=Ai(),gap:b=wi,icons:x,containerAriaLabel:S=`Notifications`}=e,[C,w]=h.default.useState([]),T=h.default.useMemo(()=>n?C.filter(e=>e.toasterId===n):C.filter(e=>!e.toasterId),[C,n]),E=h.default.useMemo(()=>Array.from(new Set([a].concat(T.filter(e=>e.position).map(e=>e.position)))),[T,a]),[D,O]=h.default.useState([]),[k,A]=h.default.useState(!1),[j,M]=h.default.useState(!1),[N,ee]=h.default.useState(f===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:f),P=h.default.useRef(null),te=o.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),ne=h.default.useRef(null),re=h.default.useRef(!1),ie=h.default.useCallback(e=>{w(t=>(t.find(t=>t.id===e.id)?.delete||mi.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return h.default.useEffect(()=>mi.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{w(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{r.default.flushSync(()=>{w(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[C]),h.default.useEffect(()=>{if(f!==`system`){ee(f);return}if(f===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?ee(`dark`):ee(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{ee(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{ee(e?`dark`:`light`)}catch(e){console.error(e)}})}},[f]),h.default.useEffect(()=>{C.length<=1&&A(!1)},[C]),h.default.useEffect(()=>{let e=e=>{if(o.every(t=>e[t]||e.code===t)){var t;A(!0),(t=P.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===P.current||P.current?.contains(document.activeElement))&&A(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[o]),h.default.useEffect(()=>{if(P.current)return()=>{ne.current&&(ne.current.focus({preventScroll:!0}),ne.current=null,re.current=!1)}},[P.current]),h.default.createElement(`section`,{ref:t,"aria-label":`${S} ${te}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},E.map((t,n)=>{let[r,a]=t.split(`-`);return T.length?h.default.createElement(`ol`,{key:t,dir:y===`auto`?Ai():y,tabIndex:-1,ref:P,className:l,"data-sonner-toaster":!0,"data-sonner-theme":N,"data-y-position":r,"data-x-position":a,style:{"--front-toast-height":`${D[0]?.height||0}px`,"--width":`${Ci}px`,"--gap":`${b}px`,...g,...ji(u,d)},onBlur:e=>{re.current&&!e.currentTarget.contains(e.relatedTarget)&&(re.current=!1,ne.current&&=(ne.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||re.current||(re.current=!0,ne.current=e.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{j||A(!1)},onDragEnd:()=>A(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||M(!0)},onPointerUp:()=>M(!1)},T.filter(e=>!e.position&&n===0||e.position===t).map((n,r)=>h.default.createElement(ki,{key:n.id,icons:x,index:r,toast:n,defaultRichColors:p,duration:v?.duration??m,className:v?.className,descriptionClassName:v?.descriptionClassName,invert:i,visibleToasts:_,closeButton:v?.closeButton??c,interacting:j,position:t,style:v?.style,unstyled:v?.unstyled,classNames:v?.classNames,cancelButtonStyle:v?.cancelButtonStyle,actionButtonStyle:v?.actionButtonStyle,closeButtonAriaLabel:v?.closeButtonAriaLabel,removeToast:ie,toasts:T.filter(e=>e.position==n.position),heights:D.filter(e=>e.position==n.position),setHeights:O,expandByDefault:s,gap:b,expanded:k,swipeDirections:e.swipeDirections}))):null}))}),Ni=`data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_15_20)'%3e%3crect%20width='32'%20height='32'%20rx='4'%20fill='%23E7FBF4'/%3e%3cpath%20d='M10.6668%2017.3333L14.6668%2020L21.3335%2012'%20stroke='%23039855'%20stroke-width='1.6875'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_15_20'%3e%3cpath%20d='M0%2016C0%207.16344%207.16344%200%2016%200V0C24.8366%200%2032%207.16344%2032%2016V16C32%2024.8366%2024.8366%2032%2016%2032V32C7.16344%2032%200%2024.8366%200%2016V16Z'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e`,Pi=`data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_17_95)'%3e%3crect%20width='32'%20height='32'%20rx='4'%20fill='%23FEF3F2'/%3e%3cpath%20d='M12.0003%2012L20.0003%2020M12.0003%2020L20.0003%2012'%20stroke='%23E02731'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_17_95'%3e%3cpath%20d='M0%2016C0%207.16344%207.16344%200%2016%200V0C24.8366%200%2032%207.16344%2032%2016V16C32%2024.8366%2024.8366%2032%2016%2032V32C7.16344%2032%200%2024.8366%200%2016V16Z'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e`,Fi=`data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_17_99)'%3e%3crect%20width='32'%20height='32'%20rx='4'%20fill='%23FFFAEB'/%3e%3cpath%20d='M16.0002%2017.3333V13.3333M16.0002%2020V20.0067M23.0353%2019.3333L17.942%2010.456C17.0833%208.95867%2014.9167%208.95867%2014.058%2010.456L8.96533%2019.3333C8.11266%2020.8187%209.18933%2022.6667%2010.9073%2022.6667H21.0933C22.8107%2022.6667%2023.8873%2020.8187%2023.0353%2019.3333Z'%20stroke='%23CFAA25'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_17_99'%3e%3cpath%20d='M0%2016C0%207.16344%207.16344%200%2016%200C24.8366%200%2032%207.16344%2032%2016C32%2024.8366%2024.8366%2032%2016%2032C7.16344%2032%200%2024.8366%200%2016Z'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e`,Ii=(e,t,n,r)=>{let i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,`warn`,`react-i18next::`,!0);Ui(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},Li={},Ri=(e,t,n,r)=>{Ui(n)&&Li[n]||(Ui(n)&&(Li[n]=new Date),Ii(e,t,n,r))},zi=(e,t)=>()=>{if(e.isInitialized)t();else{let n=()=>{setTimeout(()=>{e.off(`initialized`,n)},0),t()};e.on(`initialized`,n)}},Bi=(e,t,n)=>{e.loadNamespaces(t,zi(e,n))},Vi=(e,t,n,r)=>{if(Ui(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Bi(e,n,r);n.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,zi(e,r))},Hi=(e,t,n={})=>!t.languages||!t.languages.length?(Ri(t,`NO_LANGUAGES`,`i18n.languages were undefined or empty`,{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,r)=>{if(n.bindI18n&&n.bindI18n.indexOf(`languageChanging`)>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}),Ui=e=>typeof e==`string`,Wi=e=>typeof e==`object`&&!!e,Gi=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Ki={"&":`&`,"&":`&`,"<":`<`,"<":`<`,">":`>`,">":`>`,"'":`'`,"'":`'`,""":`"`,""":`"`," ":` `," ":` `,"©":`©`,"©":`©`,"®":`®`,"®":`®`,"…":`…`,"…":`…`,"/":`/`,"/":`/`},qi=e=>Ki[e],Ji={bindI18n:`languageChanged`,bindI18nStore:``,transEmptyNodeValue:``,transSupportBasicHtmlNodes:!0,transWrapTextNodes:``,transKeepBasicHtmlNodesFor:[`br`,`strong`,`i`,`p`],useSuspense:!0,unescape:e=>e.replace(Gi,qi),transDefaultProps:void 0},Yi=(e={})=>{Ji={...Ji,...e}},Xi=()=>Ji,Zi,Qi=e=>{Zi=e},$i=()=>Zi,ea={type:`3rdParty`,init(e){Yi(e.options.react),Qi(e)}},ta=(0,t.createContext)(),na=class{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}},ra=d((e=>{var t=require("react");function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),ia=d((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}function n(e,t){d||a.startTransition===void 0||(d=!0,console.error(`You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.`));var n=t();if(!f){var i=t();o(n,i)||(console.error(`The result of getSnapshot should be cached to avoid an infinite loop`),f=!0)}i=s({inst:{value:n,getSnapshot:t}});var p=i[0].inst,m=i[1];return l(function(){p.value=n,p.getSnapshot=t,r(p)&&m({inst:p})},[e,n,t]),c(function(){return r(p)&&m({inst:p}),e(function(){r(p)&&m({inst:p})})},[e]),u(n),n}function r(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch{return!0}}function i(e,t){return t()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var a=require("react"),o=typeof Object.is==`function`?Object.is:t,s=a.useState,c=a.useEffect,l=a.useLayoutEffect,u=a.useDebugValue,d=!1,f=!1,p=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?i:n;e.useSyncExternalStore=a.useSyncExternalStore===void 0?p:a.useSyncExternalStore,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})),aa=d(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=ra():t.exports=ia()}))(),oa={t:(e,t)=>{if(Ui(t))return t;if(Wi(t)&&Ui(t.defaultValue))return t.defaultValue;if(typeof e==`function`)return``;if(Array.isArray(e)){let t=e[e.length-1];return typeof t==`function`?``:t}return e},ready:!1},sa=()=>()=>{},U=(e,n={})=>{let{i18n:r}=n,{i18n:i,defaultNS:a}=(0,t.useContext)(ta)||{},o=r||i||$i();o&&!o.reportNamespaces&&(o.reportNamespaces=new na),o||Ri(o,`NO_I18NEXT_INSTANCE`,`useTranslation: You will need to pass in an i18next instance by using initReactI18next`);let s=(0,t.useMemo)(()=>({...Xi(),...o?.options?.react,...n}),[o,n]),{useSuspense:c,keyPrefix:l}=s,u=e||a||o?.options?.defaultNS,d=Ui(u)?[u]:u||[`translation`],f=(0,t.useMemo)(()=>d,d);o?.reportNamespaces?.addUsedNamespaces?.(f);let p=(0,t.useRef)(0),m=(0,t.useCallback)(e=>{if(!o)return sa;let{bindI18n:t,bindI18nStore:n}=s,r=()=>{p.current+=1,e()};return t&&o.on(t,r),n&&o.store.on(n,r),()=>{t&&t.split(` `).forEach(e=>o.off(e,r)),n&&n.split(` `).forEach(e=>o.store.off(e,r))}},[o,s]),h=(0,t.useRef)(),g=(0,t.useCallback)(()=>{if(!o)return oa;let e=!!(o.isInitialized||o.initializedStoreOnce)&&f.every(e=>Hi(e,o,s)),t=n.lng||o.language,r=p.current,i=h.current;if(i&&i.ready===e&&i.lng===t&&i.keyPrefix===l&&i.revision===r)return i;let a={t:o.getFixedT(t,s.nsMode===`fallback`?f:f[0],l,{scopeNs:f}),ready:e,lng:t,keyPrefix:l,revision:r};return h.current=a,a},[o,f,l,s,n.lng]),[_,v]=(0,t.useState)(0),{t:y,ready:b}=(0,aa.useSyncExternalStore)(m,g,g);(0,t.useEffect)(()=>{if(o&&!b&&!c){let e=()=>v(e=>e+1);n.lng?Vi(o,n.lng,f,e):Bi(o,f,e)}},[o,n.lng,f,b,c,_]);let x=o||{},S=(0,t.useRef)(null),C=(0,t.useRef)(),w=e=>{let t=Object.getOwnPropertyDescriptors(e);t.__original&&delete t.__original;let n=Object.create(Object.getPrototypeOf(e),t);if(!Object.prototype.hasOwnProperty.call(n,`__original`))try{Object.defineProperty(n,"__original",{value:e,writable:!1,enumerable:!1,configurable:!1})}catch{}return n},T=(0,t.useMemo)(()=>{let e=x,t=e?.language,n=e;e&&(S.current&&S.current.__original===e&&C.current===t?n=S.current:(n=w(e),S.current=n,C.current=t));let r=!b&&!c?(...e)=>(Ri(o,`USE_T_BEFORE_READY`,`useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t.`),y(...e)):y,i=[r,n,b];return i.t=r,i.i18n=n,i.ready=b,i},[y,x,b,x.resolvedLanguage,x.language,x.languages]);if(o&&c&&!b)throw new Promise(e=>{let t=()=>e();n.lng?Vi(o,n.lng,f,t):Bi(o,f,t)});return T};function ca(){let{t:e}=U(),t=(0,n.jsx)(`img`,{src:Ni,alt:`success`}),r=(0,n.jsx)(`img`,{src:Pi,alt:`error`}),i=(0,n.jsx)(`img`,{src:Fi,alt:`warning`}),a=(e,t)=>{if(e===`success`)return o(t);c(t)},o=(n=e(`success`),r={})=>{_i.success(n,{icon:t,...r})},s=(t=e(`warning`))=>{_i.warning(t,{icon:i})},c=(t=e(`somethingWentWrong`))=>{let i=typeof t==`string`?t:t.response?.data.message,a=typeof t==`string`?void 0:t.response?.data.errors,o=(0,n.jsxs)(`div`,{children:[(0,n.jsx)(`p`,{children:i}),a&&Object.keys(a).map(e=>a[e].map(e=>(0,n.jsx)(`li`,{children:e},e)))]});_i.error(o,{icon:r})};return{toast:a,successToast:o,warningToast:s,errorToast:c}}var la=Object.prototype.hasOwnProperty;function ua(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&ua(e[r],t[r]););return r===-1}if(!n||typeof e==`object`){for(n in r=0,e)if(la.call(e,n)&&++r&&!la.call(t,n)||!(n in t)||!ua(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}var da=new WeakMap,fa=()=>{},pa=Object,ma=e=>e===void 0,ha=e=>typeof e==`function`,ga=(e,t)=>({...e,...t}),_a=e=>ha(e.then),va={},ya={},ba=`undefined`,xa=typeof window!=ba,Sa=typeof document!=ba,Ca=xa&&`Deno`in window,wa=()=>xa&&typeof window.requestAnimationFrame!=ba,Ta=(e,t)=>{let n=da.get(e);return[()=>!ma(t)&&e.get(t)||va,r=>{if(!ma(t)){let i=e.get(t);t in ya||(ya[t]=i),n[5](t,ga(i,r),i||va)}},n[6],()=>!ma(t)&&t in ya?ya[t]:!ma(t)&&e.get(t)||va]},Ea=!0,Da=()=>Ea,[Oa,ka]=xa&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[fa,fa],Aa=()=>{let e=Sa&&document.visibilityState;return ma(e)||e!==`hidden`},ja=e=>(Sa&&document.addEventListener(`visibilitychange`,e),Oa(`focus`,e),()=>{Sa&&document.removeEventListener(`visibilitychange`,e),ka(`focus`,e)}),Ma=e=>{let t=()=>{Ea=!0,e()},n=()=>{Ea=!1};return Oa(`online`,t),Oa(`offline`,n),()=>{ka(`online`,t),ka(`offline`,n)}},Na={isOnline:Da,isVisible:Aa},Pa={initFocus:ja,initReconnect:Ma},Fa=!h.default.useId,Ia=!xa||Ca,La=e=>wa()?window.requestAnimationFrame(e):setTimeout(e,1),Ra=Ia?h.useEffect:h.useLayoutEffect,za=typeof navigator<`u`&&navigator.connection,Ba=!Ia&&za&&([`slow-2g`,`2g`].includes(za.effectiveType)||za.saveData),Va=new WeakMap,Ha=e=>pa.prototype.toString.call(e),Ua=(e,t)=>e===`[object ${t}]`,Wa=0,Ga=e=>{let t=typeof e,n=Ha(e),r=Ua(n,`Date`),i=Ua(n,`RegExp`),a=Ua(n,`Object`),o,s;if(pa(e)===e&&!r&&!i){if(o=Va.get(e),o)return o;if(o=++Wa+`~`,Va.set(e,o),Array.isArray(e)){for(o=`@`,s=0;s<e.length;s++)o+=Ga(e[s])+`,`;Va.set(e,o)}if(a){o=`#`;let t=pa.keys(e).sort();for(;!ma(s=t.pop());)ma(e[s])||(o+=s+`:`+Ga(e[s])+`,`);Va.set(e,o)}}else o=r?e.toJSON():t==`symbol`?e.toString():t==`string`?JSON.stringify(e):``+e;return o},Ka=e=>{if(ha(e))try{e=e()}catch{e=``}let t=e;return e=typeof e==`string`?e:(Array.isArray(e)?e.length:e)?Ga(e):``,[e,t]},qa=0,Ja=()=>++qa;async function Ya(...e){let[t,n,r,i]=e,a=ga({populateCache:!0,throwOnError:!0},typeof i==`boolean`?{revalidate:i}:i||{}),o=a.populateCache,s=a.rollbackOnError,c=a.optimisticData,l=e=>typeof s==`function`?s(e):s!==!1,u=a.throwOnError;if(ha(n)){let e=n,r=[],i=t.keys();for(let n of i)!/^\$(inf|sub)\$/.test(n)&&e(t.get(n)._k)&&r.push(n);return Promise.all(r.map(d))}return d(n);async function d(n){let[i]=Ka(n);if(!i)return;let[s,d]=Ta(t,i),[f,p,m,h]=da.get(t),g=()=>{let e=f[i];return(ha(a.revalidate)?a.revalidate(s().data,n):a.revalidate!==!1)&&(delete m[i],delete h[i],e&&e[0])?e[0](2).then(()=>s().data):s().data};if(e.length<3)return g();let _=r,v,y=!1,b=Ja();p[i]=[b,0];let x=!ma(c),S=s(),C=S.data,w=S._c,T=ma(w)?C:w;if(x&&(c=ha(c)?c(T,C):c,d({data:c,_c:T})),ha(_))try{_=_(T)}catch(e){v=e,y=!0}if(_&&_a(_))if(_=await _.catch(e=>{v=e,y=!0}),b!==p[i][0]){if(y)throw v;return _}else y&&x&&l(v)&&(o=!0,d({data:T,_c:void 0}));if(o&&(y||(ha(o)?d({data:o(_,T),error:void 0,_c:void 0}):d({data:_,error:void 0,_c:void 0}))),p[i][1]=Ja(),Promise.resolve(g()).then(()=>{d({_c:void 0})}),y){if(u)throw v;return}return _}}var Xa=(e,t)=>{for(let n in e)e[n][0]&&e[n][0](t)},Za=(e,t)=>{if(!da.has(e)){let n=ga(Pa,t),r=Object.create(null),i=Ya.bind(void 0,e),a=fa,o=Object.create(null),s=(e,t)=>{let n=o[e]||[];return o[e]=n,n.push(t),()=>n.splice(n.indexOf(t),1)},c=(t,n,r)=>{e.set(t,n);let i=o[t];if(i)for(let e of i)e(n,r)},l=()=>{if(!da.has(e)&&(da.set(e,[r,Object.create(null),Object.create(null),Object.create(null),i,c,s]),!Ia)){let t=n.initFocus(setTimeout.bind(void 0,Xa.bind(void 0,r,0))),i=n.initReconnect(setTimeout.bind(void 0,Xa.bind(void 0,r,1)));a=()=>{t&&t(),i&&i(),da.delete(e)}}};return l(),[e,i,l,a]}return[e,da.get(e)[4]]},Qa=(e,t,n,r,i)=>{let a=n.errorRetryCount,o=i.retryCount,s=~~((Math.random()+.5)*(1<<(o<8?o:8)))*n.errorRetryInterval;!ma(a)&&o>a||setTimeout(r,s,i)},$a=ua,[eo,to]=Za(new Map),no=ga({onLoadingSlow:fa,onSuccess:fa,onError:fa,onErrorRetry:Qa,onDiscarded:fa,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Ba?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:Ba?5e3:3e3,compare:$a,isPaused:()=>!1,cache:eo,mutate:to,fallback:{}},Na),ro=(e,t)=>{let n=ga(e,t);if(t){let{use:r,fallback:i}=e,{use:a,fallback:o}=t;r&&a&&(n.use=r.concat(a)),i&&o&&(n.fallback=ga(i,o))}return n},io=(0,h.createContext)({}),ao=e=>{let{value:t}=e,n=(0,h.useContext)(io),r=ha(t),i=(0,h.useMemo)(()=>r?t(n):t,[r,n,t]),a=(0,h.useMemo)(()=>r?i:ro(n,i),[r,n,i]),o=i&&i.provider,s=(0,h.useRef)(void 0);o&&!s.current&&(s.current=Za(o(a.cache||eo),i));let c=s.current;return c&&(a.cache=c[0],a.mutate=c[1]),Ra(()=>{if(c)return c[2]&&c[2](),c[3]},[]),(0,h.createElement)(io.Provider,ga(e,{value:a}))},oo=xa&&window.__SWR_DEVTOOLS_USE__,so=oo?window.__SWR_DEVTOOLS_USE__:[],co=()=>{oo&&(window.__SWR_DEVTOOLS_REACT__=h.default)},lo=e=>ha(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],uo=()=>{let e=(0,h.useContext)(io);return(0,h.useMemo)(()=>ga(no,e),[e])},fo=so.concat(e=>(t,n,r)=>e(t,n&&((...e)=>{let[r]=Ka(t),[,,,i]=da.get(eo);if(r.startsWith(`$inf$`))return n(...e);let a=i[r];return ma(a)?n(...e):(delete i[r],a)}),r)),po=e=>function(...t){let n=uo(),[r,i,a]=lo(t),o=ro(n,a),s=e,{use:c}=o,l=(c||[]).concat(fo);for(let e=l.length;e--;)s=l[e](s);return s(r,i||o.fetcher||null,o)},mo=(e,t,n)=>{let r=t[e]||(t[e]=[]);return r.push(n),()=>{let e=r.indexOf(n);e>=0&&(r[e]=r[r.length-1],r.pop())}};co();var ho=h.default.use||(e=>{switch(e.status){case`pending`:throw e;case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:throw e.status=`pending`,e.then(t=>{e.status=`fulfilled`,e.value=t},t=>{e.status=`rejected`,e.reason=t}),e}}),go={dedupe:!0},_o=Promise.resolve(void 0),vo=()=>fa,yo=(e,t,n)=>{let{cache:r,compare:i,suspense:a,fallbackData:o,revalidateOnMount:s,revalidateIfStale:c,refreshInterval:l,refreshWhenHidden:u,refreshWhenOffline:d,keepPreviousData:f,strictServerPrefetchWarning:p}=n,[m,g,_,v]=da.get(r),[y,b]=Ka(e),x=(0,h.useRef)(!1),S=(0,h.useRef)(!1),C=(0,h.useRef)(y),w=(0,h.useRef)(t),T=(0,h.useRef)(n),E=()=>T.current,D=()=>E().isVisible()&&E().isOnline(),[O,k,A,j]=Ta(r,y),M=(0,h.useRef)({}).current,N=ma(o)?ma(n.fallback)?void 0:n.fallback[y]:o,ee=(e,t)=>{for(let n in M){let r=n;if(r===`data`){if(!i(e[r],t[r])&&(!ma(e[r])||!i(se,t[r])))return!1}else if(t[r]!==e[r])return!1}return!0},P=!x.current,te=(0,h.useMemo)(()=>{let e=O(),n=j(),r=e=>{let n=ga(e);return delete n._k,!(!y||!t||E().isPaused())&&(P&&!ma(s)?s:ma(ma(N)?n.data:N)||c)?{isValidating:!0,isLoading:!0,...n}:n},i=r(e),a=e===n?i:r(n),o=i;return[()=>{let e=r(O());return ee(e,o)?(o.data=e.data,o.isLoading=e.isLoading,o.isValidating=e.isValidating,o.error=e.error,o):(o=e,e)},()=>a]},[r,y]),ne=(0,aa.useSyncExternalStore)((0,h.useCallback)(e=>A(y,(t,n)=>{ee(n,t)||e()}),[r,y]),te[0],te[1]),re=m[y]&&m[y].length>0,ie=ne.data,F=ma(ie)?N&&_a(N)?ho(N):N:ie,ae=ne.error,oe=(0,h.useRef)(F),se=f?ma(ie)?ma(oe.current)?F:oe.current:ie:F,ce=y&&ma(F),le=(0,h.useRef)(null);!Ia&&(0,aa.useSyncExternalStore)(vo,()=>(le.current=!1,le),()=>(le.current=!0,le));let ue=le.current;p&&ue&&!a&&ce&&console.warn(`Missing pre-initiated data for serialized key "${y}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);let I=!y||!t||E().isPaused()||re&&!ma(ae)?!1:P&&!ma(s)?s:a?ma(F)?!1:c:ma(F)||c,L=P&&I,de=ma(ne.isValidating)?L:ne.isValidating,fe=ma(ne.isLoading)?L:ne.isLoading,pe=(0,h.useCallback)(async e=>{let t=w.current;if(!y||!t||S.current||E().isPaused())return!1;let r,a,o=!0,s=e||{},c=!_[y]||!s.dedupe,l=()=>Fa?!S.current&&y===C.current&&x.current:y===C.current,u={isValidating:!1,isLoading:!1},d=()=>{k(u)},f=()=>{let e=_[y];e&&e[1]===a&&delete _[y]},p={isValidating:!0};ma(O().data)&&(p.isLoading=!0);try{if(c&&(k(p),n.loadingTimeout&&ma(O().data)&&setTimeout(()=>{o&&l()&&E().onLoadingSlow(y,n)},n.loadingTimeout),_[y]=[t(b),Ja()]),[r,a]=_[y],r=await r,c&&setTimeout(f,n.dedupingInterval),!_[y]||_[y][1]!==a)return c&&l()&&E().onDiscarded(y),!1;u.error=void 0;let e=g[y];if(!ma(e)&&(a<=e[0]||a<=e[1]||e[1]===0))return d(),c&&l()&&E().onDiscarded(y),!1;let s=O().data;u.data=i(s,r)?s:r,c&&l()&&E().onSuccess(r,y,n)}catch(e){f();let t=E(),{shouldRetryOnError:n}=t;t.isPaused()||(u.error=e,c&&l()&&(t.onError(e,y,t),(n===!0||ha(n)&&n(e))&&(!E().revalidateOnFocus||!E().revalidateOnReconnect||D())&&t.onErrorRetry(e,y,t,e=>{let t=m[y];t&&t[0]&&t[0](3,e)},{retryCount:(s.retryCount||0)+1,dedupe:!0})))}return o=!1,d(),!0},[y,r]),me=(0,h.useCallback)((...e)=>Ya(r,C.current,...e),[]);if(Ra(()=>{w.current=t,T.current=n,ma(ie)||(oe.current=ie)}),Ra(()=>{if(!y)return;let e=pe.bind(void 0,go),t=0;E().revalidateOnFocus&&(t=Date.now()+E().focusThrottleInterval);let n=mo(y,m,(n,r={})=>{if(n==0){let n=Date.now();E().revalidateOnFocus&&n>t&&D()&&(t=n+E().focusThrottleInterval,e())}else if(n==1)E().revalidateOnReconnect&&D()&&e();else if(n==2)return pe();else if(n==3)return pe(r)});return S.current=!1,C.current=y,x.current=!0,k({_k:b}),I&&(_[y]||(ma(F)||Ia?e():La(e))),()=>{S.current=!0,n()}},[y]),Ra(()=>{let e;function t(){let t=ha(l)?l(O().data):l;t&&e!==-1&&(e=setTimeout(n,t))}function n(){!O().error&&(u||E().isVisible())&&(d||E().isOnline())?pe(go).then(t):t()}return t(),()=>{e&&=(clearTimeout(e),-1)}},[l,u,d,y]),(0,h.useDebugValue)(se),a){if(!Fa&&Ia&&ce)throw Error(`Fallback data is required when using Suspense in SSR.`);ce&&(w.current=t,T.current=n,S.current=!1);let e=v[y];if(ho(!ma(e)&&ce?me(e):_o),!ma(ae)&&ce)throw ae;let r=ce?pe(go):_o;!ma(se)&&ce&&(r.status=`fulfilled`,r.value=!0),ho(r)}return{mutate:me,get data(){return M.data=!0,se},get error(){return M.error=!0,ae},get isValidating(){return M.isValidating=!0,de},get isLoading(){return M.isLoading=!0,fe}}};pa.defineProperty(ao,`defaultValue`,{value:no});var bo=po(yo);function xo(e){let t=qn(),{errorToast:n}=ca(),{data:r,error:i,isValidating:a,mutate:o}=bo((0,h.useMemo)(()=>e.url?e.params?[e.url,JSON.stringify(e.params)]:[e.url]:null,[e.url,JSON.stringify(e.params)]),([n,r])=>r?t.get(n,e.params):t.get(n),{shouldRetryOnError:!1,revalidateOnFocus:e.revalidateOnFocus,revalidateOnMount:e.revalidateOnMount,refreshInterval:e.refreshInterval});return(0,h.useEffect)(()=>{r&&e.dataSetter(r.data.data,r.data.meta)},[r]),(0,h.useEffect)(()=>{i&&n(i)},[i]),{data:r,pending:a,error:i,isValidating:a,mutate:o}}function So({message:e}){return(0,n.jsxs)(Zn,{accent:`red`,children:[(0,n.jsxs)(`div`,{className:`space-y-3`,children:[(0,n.jsx)(`p`,{className:`font-semibold text-core-primary-500 text-sm uppercase tracking-[0.2em]`,children:`PortalSessions`}),(0,n.jsx)(`h1`,{className:`font-semibold text-3xl text-core-gray-900 tracking-tight sm:text-5xl`,children:`Session Unavailable`})]}),e&&(0,n.jsx)(`div`,{className:`w-full rounded-2xl border border-core-red-100 bg-core-red-50 px-5 py-4 font-medium text-core-red-700 text-sm`,children:e})]})}function Co(e){let[t,r]=(0,h.useState)(null),i=e.uuid,{mutate:a,error:o,pending:s}=xo({url:i,dataSetter:r});return t?t.status===_.EXPIRED?(0,n.jsx)(So,{message:`Portal session with uuid ${i} has expired.`}):(0,n.jsx)(ti.Provider,{value:{uuid:i,portalSession:t,setPortalSession:r,mutate:a,error:o},children:e.children}):(0,n.jsx)(Qn,{message:`Awaiting new session`})}function wo(){let e=(0,h.useContext)(ei);if(!e)throw Error(`Only use 'useConfigurationContext' within a ConfigurationContext Provider`);return e}var To=[{id:`session`,label:`Session`},{id:`configuration`,label:`Configuration`},{id:`inputData`,label:`Input data`},{id:`raw`,label:`Raw JSON`}];function Eo(e){navigator?.clipboard?.writeText&&navigator.clipboard.writeText(e)}function Do(e){if(e===void 0)return`—`;if(e===null)return`null`;if(typeof e==`string`)return e||`—`;if(typeof e==`boolean`)return e?`true`:`false`;if(typeof e==`number`)return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function Oo({label:e,value:t}){let r=Do(t),i=typeof t==`string`&&t.length>0;return(0,n.jsxs)(`div`,{className:`flex items-start justify-between gap-3 border-white/5 border-b py-2 last:border-none`,children:[(0,n.jsx)(`span`,{className:`shrink-0 font-medium text-[11px] text-white/50 uppercase tracking-wider`,children:e}),(0,n.jsx)(`button`,{type:`button`,title:i?`Click to copy`:void 0,onClick:i?()=>Eo(r):void 0,className:`break-all text-right font-mono text-[12px] text-white ${i?`cursor-pointer hover:text-emerald-300`:`cursor-default`}`,children:r})]})}function ko({title:e,children:t}){return(0,n.jsxs)(`div`,{className:`rounded-xl border border-white/10 bg-white/[0.03] p-4`,children:[(0,n.jsx)(`p`,{className:`m-0 mb-2 font-semibold text-[11px] text-emerald-300 uppercase tracking-widest`,children:e}),(0,n.jsx)(`div`,{className:`flex flex-col`,children:t})]})}function Ao(){let e=wo(),{uuid:t,portalSession:r,error:i}=H(),[a,o]=(0,h.useState)(!1),[s,c]=(0,h.useState)(`session`);(0,h.useEffect)(()=>{let e=e=>{e.key===`Escape`&&o(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let l=r?.input_data??{},u={uuid:t,type:r?.type,contact:r?.contact,currency:r?.currency,loyaltyProgram:r?.loyalty_program,events:r?.events,results:r?.results,inputData:l,error:i?.message},d=Object.entries(e).filter(([,e])=>typeof e!=`function`),f=Object.entries(e).filter(([,e])=>typeof e==`function`);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>!e),className:`fixed top-2 left-1/2 z-[2147483646] flex -translate-x-1/2 transform items-center gap-2 rounded-full border border-white/10 bg-zinc-900/90 px-3 py-1.5 font-medium text-white text-xs shadow-black/30 shadow-lg backdrop-blur transition-all hover:scale-[1.02] hover:bg-zinc-800/95`,"aria-label":`Toggle debug panel`,children:[(0,n.jsx)(`span`,{className:`inline-flex h-2 w-2 animate-pulse rounded-full bg-emerald-400`}),(0,n.jsx)(`span`,{className:`tracking-wide`,children:`DEBUG`}),(0,n.jsx)(`span`,{className:`hidden font-mono text-[10px] text-white/40 sm:inline`,children:t?.slice(0,8)||`no-session`})]}),a&&(0,n.jsxs)(`div`,{className:`fixed inset-0 z-[2147483647] flex items-start justify-center bg-black/40 p-4 backdrop-blur-sm sm:p-8`,children:[(0,n.jsx)(`button`,{type:`button`,"aria-label":`Close debug panel`,className:`absolute inset-0 cursor-default`,onClick:()=>o(!1)}),(0,n.jsxs)(`div`,{className:`relative flex max-h-[calc(100vh-2rem)] w-full max-w-3xl flex-col overflow-hidden rounded-2xl border border-white/10 bg-gradient-to-b from-zinc-900 to-zinc-950 text-white shadow-2xl shadow-black/50`,children:[(0,n.jsxs)(`div`,{className:`flex items-center justify-between gap-4 border-white/10 border-b px-5 py-4`,children:[(0,n.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,n.jsx)(`span`,{className:`inline-flex h-2.5 w-2.5 animate-pulse rounded-full bg-emerald-400`}),(0,n.jsxs)(`div`,{children:[(0,n.jsx)(`p`,{className:`m-0 font-semibold text-sm`,children:`Portal PointsTransactionSession Debug`}),(0,n.jsx)(`p`,{className:`m-0 font-mono text-[11px] text-white/50`,children:t||`no session uuid`})]})]}),(0,n.jsx)(`button`,{type:`button`,onClick:()=>o(!1),className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-full text-white/60 transition-colors hover:bg-white/10 hover:text-white`,"aria-label":`Close`,children:`✕`})]}),(0,n.jsx)(`div`,{className:`flex gap-1 border-white/10 border-b px-3 pt-3`,children:To.map(e=>{let t=s===e.id;return(0,n.jsxs)(`button`,{type:`button`,onClick:()=>c(e.id),className:`relative -mb-px cursor-pointer rounded-t-md px-3 py-2 font-medium text-xs transition-colors ${t?`border-white/10 border-x border-t bg-white/[0.04] text-white`:`text-white/60 hover:text-white`}`,children:[e.label,t&&(0,n.jsx)(`span`,{className:`absolute inset-x-0 -bottom-px h-0.5 bg-emerald-400`})]},e.id)})}),(0,n.jsxs)(`div`,{className:`flex-1 space-y-3 overflow-auto p-5`,children:[s===`session`&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(ko,{title:`Identity`,children:[(0,n.jsx)(Oo,{label:`PointsTransactionSession UUID`,value:t}),(0,n.jsx)(Oo,{label:`Type`,value:r?.type}),(0,n.jsx)(Oo,{label:`Contact UUID`,value:r?.contact?.uuid}),(0,n.jsx)(Oo,{label:`Currency`,value:r?.currency})]}),(0,n.jsxs)(ko,{title:`Loyalty program`,children:[(0,n.jsx)(Oo,{label:`Name`,value:r?.loyalty_program?.name}),(0,n.jsx)(Oo,{label:`Max amount`,value:r?.loyalty_program?.max_amount}),(0,n.jsx)(Oo,{label:`Custom credit name`,value:r?.loyalty_program?.custom_credit_name})]}),(0,n.jsxs)(ko,{title:`Events`,children:[(0,n.jsx)(Oo,{label:`Count`,value:r?.events?.length??0}),r?.events?.slice(-3).map((e,t)=>(0,n.jsx)(Oo,{label:e.type,value:e.created_at},`${e.type}-${e.created_at}-${t}`))]}),i&&(0,n.jsx)(ko,{title:`Error`,children:(0,n.jsx)(Oo,{label:`Message`,value:i.message})})]}),s===`configuration`&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(ko,{title:`Props`,children:[d.length===0&&(0,n.jsx)(`p`,{className:`m-0 py-2 text-[12px] text-white/40`,children:`No configuration provided.`}),d.map(([e,t])=>(0,n.jsx)(Oo,{label:e,value:t},e))]}),(0,n.jsxs)(ko,{title:`Callbacks`,children:[f.length===0&&(0,n.jsx)(`p`,{className:`m-0 py-2 text-[12px] text-white/40`,children:`No callbacks registered.`}),f.map(([e])=>(0,n.jsx)(Oo,{label:e,value:`ƒ registered`},e))]})]}),s===`inputData`&&(0,n.jsxs)(ko,{title:`Resolved input data`,children:[Object.entries(l).length===0&&(0,n.jsx)(`p`,{className:`m-0 py-2 text-[12px] text-white/40`,children:`No input data available.`}),Object.entries(l).map(([e,t])=>(0,n.jsx)(Oo,{label:e,value:t},e))]}),s===`raw`&&(0,n.jsxs)(`div`,{className:`rounded-xl border border-white/10 bg-black/40 p-4`,children:[(0,n.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,n.jsx)(`p`,{className:`m-0 font-semibold text-[11px] text-emerald-300 uppercase tracking-widest`,children:`Raw snapshot`}),(0,n.jsx)(`button`,{type:`button`,onClick:()=>Eo(JSON.stringify(u,null,2)),className:`cursor-pointer rounded-md bg-white/10 px-2 py-1 text-[11px] text-white/80 transition-colors hover:bg-white/20`,children:`Copy JSON`})]}),(0,n.jsx)(`pre`,{className:`m-0 max-h-[60vh] overflow-auto font-mono text-[11px] text-white/80 leading-relaxed`,children:JSON.stringify(u,null,2)})]})]}),(0,n.jsxs)(`div`,{className:`border-white/10 border-t px-5 py-3 text-[11px] text-white/40`,children:[`Press `,(0,n.jsx)(`kbd`,{className:`rounded bg-white/10 px-1 py-0.5`,children:`Esc`}),` `,`to close · Click any value to copy`]})]})]})]})}var jo=m(d(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r(require("react")):typeof define==`function`&&define.amd?define([`react`],r):typeof e==`object`?e.ReactSimpleKeyboard=r(require("react")):n.ReactSimpleKeyboard=r(n.React)})(e,(function(e){return function(){var t={981:function(){typeof Element>`u`||`remove`in Element.prototype||(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)}),typeof self<`u`&&`document`in self&&((!(`classList`in document.createElement(`_`))||document.createElementNS&&!(`classList`in document.createElementNS(`http://www.w3.org/2000/svg`,`g`)))&&function(e){"use strict";if(`Element`in e){var t=`classList`,n=`prototype`,r=e.Element[n],i=Object,a=String[n].trim||function(){return this.replace(/^\s+|\s+$/g,``)},o=Array[n].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1},s=function(e,t){this.name=e,this.code=DOMException[e],this.message=t},c=function(e,t){if(t===``)throw new s(`SYNTAX_ERR`,`The token must not be empty.`);if(/\s/.test(t))throw new s(`INVALID_CHARACTER_ERR`,`The token must not contain space characters.`);return o.call(e,t)},l=function(e){for(var t=a.call(e.getAttribute(`class`)||``),n=t?t.split(/\s+/):[],r=0,i=n.length;r<i;r++)this.push(n[r]);this._updateClassName=function(){e.setAttribute(`class`,this.toString())}},u=l[n]=[],d=function(){return new l(this)};if(s[n]=Error[n],u.item=function(e){return this[e]||null},u.contains=function(e){return~c(this,e+``)},u.add=function(){var e,t=arguments,n=0,r=t.length,i=!1;do~c(this,e=t[n]+``)||(this.push(e),i=!0);while(++n<r);i&&this._updateClassName()},u.remove=function(){var e,t,n=arguments,r=0,i=n.length,a=!1;do for(t=c(this,e=n[r]+``);~t;)this.splice(t,1),a=!0,t=c(this,e);while(++r<i);a&&this._updateClassName()},u.toggle=function(e,t){var n=this.contains(e),r=n?!0!==t&&`remove`:!1!==t&&`add`;return r&&this[r](e),!0===t||!1===t?t:!n},u.replace=function(e,t){var n=c(e+``);~n&&(this.splice(n,1,t),this._updateClassName())},u.toString=function(){return this.join(` `)},i.defineProperty){var f={get:d,enumerable:!0,configurable:!0};try{i.defineProperty(r,t,f)}catch(e){e.number!==void 0&&e.number!==-2146823252||(f.enumerable=!1,i.defineProperty(r,t,f))}}else i[n].__defineGetter__&&r.__defineGetter__(t,d)}}(self),function(){"use strict";var e=document.createElement(`_`);if(e.classList.add(`c1`,`c2`),!e.classList.contains(`c2`)){var t=function(e){var t=DOMTokenList.prototype[e];DOMTokenList.prototype[e]=function(e){var n,r=arguments.length;for(n=0;n<r;n++)e=arguments[n],t.call(this,e)}};t(`add`),t(`remove`)}if(e.classList.toggle(`c3`,!1),e.classList.contains(`c3`)){var n=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return 1 in arguments&&!this.contains(e)==!t?t:n.call(this,e)}}`replace`in document.createElement(`_`).classList||(DOMTokenList.prototype.replace=function(e,t){var n=this.toString().split(` `),r=n.indexOf(e+``);~r&&(n=n.slice(r),this.remove.apply(this,n),this.add(t),this.add.apply(this,n.slice(1)))}),e=null}())},548:function(e){e.exports=function(){"use strict";var e={9306:function(e,t,n){var r=n(4901),i=n(6823),a=TypeError;e.exports=function(e){if(r(e))return e;throw new a(i(e)+` is not a function`)}},5548:function(e,t,n){var r=n(3517),i=n(6823),a=TypeError;e.exports=function(e){if(r(e))return e;throw new a(i(e)+` is not a constructor`)}},3506:function(e,t,n){var r=n(3925),i=String,a=TypeError;e.exports=function(e){if(r(e))return e;throw new a(`Can't set `+i(e)+` as a prototype`)}},6469:function(e,t,n){var r=n(8227),i=n(2360),a=n(4913).f,o=r(`unscopables`),s=Array.prototype;s[o]===void 0&&a(s,o,{configurable:!0,value:i(null)}),e.exports=function(e){s[o][e]=!0}},7829:function(e,t,n){var r=n(8183).charAt;e.exports=function(e,t,n){return t+(n&&r(e,t).length||1)}},8551:function(e,t,n){var r=n(34),i=String,a=TypeError;e.exports=function(e){if(r(e))return e;throw new a(i(e)+` is not an object`)}},235:function(e,t,n){var r=n(9213).forEach;e.exports=n(4598)(`forEach`)?[].forEach:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}},7916:function(e,t,n){var r=n(6080),i=n(9565),a=n(8981),o=n(6319),s=n(4209),c=n(3517),l=n(6198),u=n(4659),d=n(4527),f=n(81),p=n(851),m=n(9539),h=Array;e.exports=function(e){var t=c(this),n=arguments.length,g=n>1?arguments[1]:void 0,_=g!==void 0;_&&(g=r(g,n>2?arguments[2]:void 0));var v,y,b,x,S,C,w=a(e),T=p(w),E=0;if(!T||this===h&&s(T))for(v=l(w),y=t?new this(v):h(v);v>E;E++)C=_?g(w[E],E):w[E],u(y,E,C);else for(y=t?new this:[],S=(x=f(w,T)).next;!(b=i(S,x)).done;E++){C=_?o(x,g,[b.value,E],!0):b.value;try{u(y,E,C)}catch(e){m(x,`throw`,e)}}return d(y,E),y}},9617:function(e,t,n){var r=n(5397),i=n(5610),a=n(6198),o=function(e){return function(t,n,o){var s=r(t),c=a(s);if(c===0)return!e&&-1;var l,u=i(o,c);if(e&&n!=n){for(;c>u;)if((l=s[u++])!=l)return!0}else for(;c>u;u++)if((e||u in s)&&s[u]===n)return e||u||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},9213:function(e,t,n){var r=n(6080),i=n(7055),a=n(8981),o=n(6198),s=n(1469),c=n(4659),l=function(e){var t=e===1,n=e===2,l=e===3,u=e===4,d=e===6,f=e===7,p=e===5||d;return function(m,h,g){for(var _,v,y=a(m),b=i(y),x=o(b),S=r(h,g),C=0,w=0,T=t?s(m,x):n||f?s(m,0):void 0;x>C;C++)if((p||C in b)&&(v=S(_=b[C],C,y),e))if(t)c(T,C,v);else if(v)switch(e){case 3:return!0;case 5:return _;case 6:return C;case 2:c(T,w++,_)}else switch(e){case 4:return!1;case 7:c(T,w++,_)}return d?-1:l||u?u:T}};e.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}},597:function(e,t,n){var r=n(9039),i=n(8227),a=n(9519),o=i(`species`);e.exports=function(e){return a>=51||!r((function(){var t=[];return(t.constructor={})[o]=function(){return{foo:1}},t[e](Boolean).foo!==1}))}},4598:function(e,t,n){var r=n(9039);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){return 1},1)}))}},926:function(e,t,n){var r=n(9306),i=n(8981),a=n(7055),o=n(6198),s=TypeError,c=`Reduce of empty array with no initial value`,l=function(e){return function(t,n,l,u){var d=i(t),f=a(d),p=o(d);if(r(n),p===0&&l<2)throw new s(c);var m=e?p-1:0,h=e?-1:1;if(l<2)for(;;){if(m in f){u=f[m],m+=h;break}if(m+=h,e?m<0:p<=m)throw new s(c)}for(;e?m>=0:p>m;m+=h)m in f&&(u=n(u,f[m],m,d));return u}};e.exports={left:l(!1),right:l(!0)}},4527:function(e,t,n){var r=n(3724),i=n(4376),a=TypeError,o=Object.getOwnPropertyDescriptor;e.exports=r&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}()?function(e,t){if(i(e)&&!o(e,`length`).writable)throw new a(`Cannot set read only .length`);return e.length=t}:function(e,t){return e.length=t}},7680:function(e,t,n){e.exports=n(9504)([].slice)},4488:function(e,t,n){var r=n(7680),i=Math.floor,a=function(e,t){var n=e.length;if(n<8)for(var o,s,c=1;c<n;){for(s=c,o=e[c];s&&t(e[s-1],o)>0;)e[s]=e[--s];s!==c++&&(e[s]=o)}else for(var l=i(n/2),u=a(r(e,0,l),t),d=a(r(e,l),t),f=u.length,p=d.length,m=0,h=0;m<f||h<p;)e[m+h]=m<f&&h<p?t(u[m],d[h])<=0?u[m++]:d[h++]:m<f?u[m++]:d[h++];return e};e.exports=a},7433:function(e,t,n){var r=n(4376),i=n(3517),a=n(34),o=n(8227)(`species`),s=Array;e.exports=function(e){var t;return r(e)&&(t=e.constructor,(i(t)&&(t===s||r(t.prototype))||a(t)&&(t=t[o])===null)&&(t=void 0)),t===void 0?s:t}},1469:function(e,t,n){var r=n(7433);e.exports=function(e,t){return new(r(e))(t===0?0:t)}},6319:function(e,t,n){var r=n(8551),i=n(9539);e.exports=function(e,t,n,a){try{return a?t(r(n)[0],n[1]):t(n)}catch(t){i(e,`throw`,t)}}},4428:function(e,t,n){var r=n(8227)(`iterator`),i=!1;try{var a=0,o={next:function(){return{done:!!a++}},return:function(){i=!0}};o[r]=function(){return this},Array.from(o,(function(){throw 2}))}catch{}e.exports=function(e,t){try{if(!t&&!i)return!1}catch{return!1}var n=!1;try{var a={};a[r]=function(){return{next:function(){return{done:n=!0}}}},e(a)}catch{}return n}},2195:function(e,t,n){var r=n(9504),i=r({}.toString),a=r(``.slice);e.exports=function(e){return a(i(e),8,-1)}},6955:function(e,t,n){var r=n(2140),i=n(4901),a=n(2195),o=n(8227)(`toStringTag`),s=Object,c=a(function(){return arguments}())===`Arguments`;e.exports=r?a:function(e){var t,n,r;return e===void 0?`Undefined`:e===null?`Null`:typeof(n=function(e,t){try{return e[t]}catch{}}(t=s(e),o))==`string`?n:c?a(t):(r=a(t))===`Object`&&i(t.callee)?`Arguments`:r}},7740:function(e,t,n){var r=n(9297),i=n(5031),a=n(7347),o=n(4913);e.exports=function(e,t,n){for(var s=i(t),c=o.f,l=a.f,u=0;u<s.length;u++){var d=s[u];r(e,d)||n&&r(n,d)||c(e,d,l(t,d))}}},1436:function(e,t,n){var r=n(8227)(`match`);e.exports=function(e){var t=/./;try{`/./`[e](t)}catch{try{return t[r]=!1,`/./`[e](t)}catch{}}return!1}},2211:function(e,t,n){e.exports=!n(9039)((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},2529:function(e){e.exports=function(e,t){return{value:e,done:t}}},6699:function(e,t,n){var r=n(3724),i=n(4913),a=n(6980);e.exports=r?function(e,t,n){return i.f(e,t,a(1,n))}:function(e,t,n){return e[t]=n,e}},6980:function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},4659:function(e,t,n){var r=n(3724),i=n(4913),a=n(6980);e.exports=function(e,t,n){r?i.f(e,t,a(0,n)):e[t]=n}},3640:function(e,t,n){var r=n(8551),i=n(4270),a=TypeError;e.exports=function(e){if(r(this),e===`string`||e===`default`)e=`string`;else if(e!==`number`)throw new a(`Incorrect hint`);return i(this,e)}},2106:function(e,t,n){var r=n(283),i=n(4913);e.exports=function(e,t,n){return n.get&&r(n.get,t,{getter:!0}),n.set&&r(n.set,t,{setter:!0}),i.f(e,t,n)}},6840:function(e,t,n){var r=n(4901),i=n(4913),a=n(283),o=n(9433);e.exports=function(e,t,n,s){s||={};var c=s.enumerable,l=s.name===void 0?t:s.name;if(r(n)&&a(n,l,s),s.global)c?e[t]=n:o(t,n);else{try{s.unsafe?e[t]&&(c=!0):delete e[t]}catch{}c?e[t]=n:i.f(e,t,{value:n,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},9433:function(e,t,n){var r=n(4576),i=Object.defineProperty;e.exports=function(e,t){try{i(r,e,{value:t,configurable:!0,writable:!0})}catch{r[e]=t}return t}},4606:function(e,t,n){var r=n(6823),i=TypeError;e.exports=function(e,t){if(!delete e[t])throw new i(`Cannot delete property `+r(t)+` of `+r(e))}},3724:function(e,t,n){e.exports=!n(9039)((function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}))},4055:function(e,t,n){var r=n(4576),i=n(34),a=r.document,o=i(a)&&i(a.createElement);e.exports=function(e){return o?a.createElement(e):{}}},6837:function(e){var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw new t(`Maximum allowed index exceeded`);return e}},7400:function(e){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},9296:function(e,t,n){var r=n(4055)(`span`).classList,i=r&&r.constructor&&r.constructor.prototype;e.exports=i===Object.prototype?void 0:i},8727:function(e){e.exports=[`constructor`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`]},3709:function(e,t,n){var r=n(2839).match(/firefox\/(\d+)/i);e.exports=!!r&&+r[1]},3763:function(e,t,n){var r=n(2839);e.exports=/MSIE|Trident/.test(r)},6193:function(e,t,n){e.exports=n(4215)===`NODE`},2839:function(e,t,n){var r=n(4576).navigator,i=r&&r.userAgent;e.exports=i?String(i):``},9519:function(e,t,n){var r,i,a=n(4576),o=n(2839),s=a.process,c=a.Deno,l=s&&s.versions||c&&c.version,u=l&&l.v8;u&&(i=(r=u.split(`.`))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!i&&o&&(!(r=o.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=o.match(/Chrome\/(\d+)/))&&(i=+r[1]),e.exports=i},3607:function(e,t,n){var r=n(2839).match(/AppleWebKit\/(\d+)\./);e.exports=!!r&&+r[1]},4215:function(e,t,n){var r=n(4576),i=n(2839),a=n(2195),o=function(e){return i.slice(0,e.length)===e};e.exports=o(`Bun/`)?`BUN`:o(`Cloudflare-Workers`)?`CLOUDFLARE`:o(`Deno/`)?`DENO`:o(`Node.js/`)?`NODE`:r.Bun&&typeof Bun.version==`string`?`BUN`:r.Deno&&typeof Deno.version==`object`?`DENO`:a(r.process)===`process`?`NODE`:r.window&&r.document?`BROWSER`:`REST`},6518:function(e,t,n){var r=n(4576),i=n(7347).f,a=n(6699),o=n(6840),s=n(9433),c=n(7740),l=n(2796);e.exports=function(e,t){var n,u,d,f,p,m=e.target,h=e.global,g=e.stat;if(n=h?r:g?r[m]||s(m,{}):r[m]&&r[m].prototype)for(u in t){if(f=t[u],d=e.dontCallGetSet?(p=i(n,u))&&p.value:n[u],!l(h?u:m+(g?`.`:`#`)+u,e.forced)&&d!==void 0){if(typeof f==typeof d)continue;c(f,d)}(e.sham||d&&d.sham)&&a(f,`sham`,!0),o(n,u,f,e)}}},9039:function(e){e.exports=function(e){try{return!!e()}catch{return!0}}},9228:function(e,t,n){n(7495);var r=n(9565),i=n(6840),a=n(7323),o=n(9039),s=n(8227),c=n(6699),l=s(`species`),u=RegExp.prototype;e.exports=function(e,t,n,d){var f=s(e),p=!o((function(){var t={};return t[f]=function(){return 7},``[e](t)!==7})),m=p&&!o((function(){var t=!1,n=/a/;if(e===`split`){var r={};r[l]=function(){return n},(n={constructor:r,flags:``})[f]=/./[f]}return n.exec=function(){return t=!0,null},n[f](``),!t}));if(!p||!m||n){var h=/./[f],g=t(f,``[e],(function(e,t,n,i,o){var s=t.exec;return s===a||s===u.exec?p&&!o?{done:!0,value:r(h,t,n,i)}:{done:!0,value:r(e,n,t,i)}:{done:!1}}));i(String.prototype,e,g[0]),i(u,f,g[1])}d&&c(u[f],`sham`,!0)}},8745:function(e,t,n){var r=n(616),i=Function.prototype,a=i.apply,o=i.call;e.exports=typeof Reflect==`object`&&Reflect.apply||(r?o.bind(a):function(){return o.apply(a,arguments)})},6080:function(e,t,n){var r=n(7476),i=n(9306),a=n(616),o=r(r.bind);e.exports=function(e,t){return i(e),t===void 0?e:a?o(e,t):function(){return e.apply(t,arguments)}}},616:function(e,t,n){e.exports=!n(9039)((function(){var e=function(){}.bind();return typeof e!=`function`||e.hasOwnProperty(`prototype`)}))},566:function(e,t,n){var r=n(9504),i=n(9306),a=n(34),o=n(9297),s=n(7680),c=n(616),l=Function,u=r([].concat),d=r([].join),f={};e.exports=c?l.bind:function(e){var t=i(this),n=t.prototype,r=s(arguments,1),c=function(){var n=u(r,s(arguments));return this instanceof c?function(e,t,n){if(!o(f,t)){for(var r=[],i=0;i<t;i++)r[i]=`a[`+i+`]`;f[t]=l(`C,a`,`return new C(`+d(r,`,`)+`)`)}return f[t](e,n)}(t,n.length,n):t.apply(e,n)};return a(n)&&(c.prototype=n),c}},9565:function(e,t,n){var r=n(616),i=Function.prototype.call;e.exports=r?i.bind(i):function(){return i.apply(i,arguments)}},350:function(e,t,n){var r=n(3724),i=n(9297),a=Function.prototype,o=r&&Object.getOwnPropertyDescriptor,s=i(a,`name`);e.exports={EXISTS:s,PROPER:s&&function(){}.name===`something`,CONFIGURABLE:s&&(!r||r&&o(a,`name`).configurable)}},6706:function(e,t,n){var r=n(9504),i=n(9306);e.exports=function(e,t,n){try{return r(i(Object.getOwnPropertyDescriptor(e,t)[n]))}catch{}}},7476:function(e,t,n){var r=n(2195),i=n(9504);e.exports=function(e){if(r(e)===`Function`)return i(e)}},9504:function(e,t,n){var r=n(616),i=Function.prototype,a=i.call,o=r&&i.bind.bind(a,a);e.exports=r?o:function(e){return function(){return a.apply(e,arguments)}}},7751:function(e,t,n){var r=n(4576),i=n(4901);e.exports=function(e,t){return arguments.length<2?(n=r[e],i(n)?n:void 0):r[e]&&r[e][t];var n}},851:function(e,t,n){var r=n(6955),i=n(5966),a=n(4117),o=n(6269),s=n(8227)(`iterator`);e.exports=function(e){if(!a(e))return i(e,s)||i(e,`@@iterator`)||o[r(e)]}},81:function(e,t,n){var r=n(9565),i=n(9306),a=n(8551),o=n(6823),s=n(851),c=TypeError;e.exports=function(e,t){var n=arguments.length<2?s(e):t;if(i(n))return a(r(n,e));throw new c(o(e)+` is not iterable`)}},5966:function(e,t,n){var r=n(9306),i=n(4117);e.exports=function(e,t){var n=e[t];return i(n)?void 0:r(n)}},2478:function(e,t,n){var r=n(9504),i=n(8981),a=Math.floor,o=r(``.charAt),s=r(``.replace),c=r(``.slice),l=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,u=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,n,r,d,f){var p=n+e.length,m=r.length,h=u;return d!==void 0&&(d=i(d),h=l),s(f,h,(function(i,s){var l;switch(o(s,0)){case`$`:return`$`;case`&`:return e;case"`":return c(t,0,n);case`'`:return c(t,p);case`<`:l=d[c(s,1,-1)];break;default:var u=+s;if(u===0)return i;if(u>m){var f=a(u/10);return f===0?i:f<=m?r[f-1]===void 0?o(s,1):r[f-1]+o(s,1):i}l=r[u-1]}return l===void 0?``:l}))}},4576:function(e,t,n){var r=function(e){return e&&e.Math===Math&&e};e.exports=r(typeof globalThis==`object`&&globalThis)||r(typeof window==`object`&&window)||r(typeof self==`object`&&self)||r(typeof n.g==`object`&&n.g)||r(typeof this==`object`&&this)||function(){return this}()||Function(`return this`)()},9297:function(e,t,n){var r=n(9504),i=n(8981),a=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return a(i(e),t)}},421:function(e){e.exports={}},397:function(e,t,n){e.exports=n(7751)(`document`,`documentElement`)},5917:function(e,t,n){var r=n(3724),i=n(9039),a=n(4055);e.exports=!r&&!i((function(){return Object.defineProperty(a(`div`),"a",{get:function(){return 7}}).a!==7}))},7055:function(e,t,n){var r=n(9504),i=n(9039),a=n(2195),o=Object,s=r(``.split);e.exports=i((function(){return!o(`z`).propertyIsEnumerable(0)}))?function(e){return a(e)===`String`?s(e,``):o(e)}:o},3167:function(e,t,n){var r=n(4901),i=n(34),a=n(2967);e.exports=function(e,t,n){var o,s;return a&&r(o=t.constructor)&&o!==n&&i(s=o.prototype)&&s!==n.prototype&&a(e,s),e}},3706:function(e,t,n){var r=n(9504),i=n(4901),a=n(7629),o=r(Function.toString);i(a.inspectSource)||(a.inspectSource=function(e){return o(e)}),e.exports=a.inspectSource},1181:function(e,t,n){var r,i,a,o=n(8622),s=n(4576),c=n(34),l=n(6699),u=n(9297),d=n(7629),f=n(6119),p=n(421),m=`Object already initialized`,h=s.TypeError,g=s.WeakMap;if(o||d.state){var _=d.state||=new g;_.get=_.get,_.has=_.has,_.set=_.set,r=function(e,t){if(_.has(e))throw new h(m);return t.facade=e,_.set(e,t),t},i=function(e){return _.get(e)||{}},a=function(e){return _.has(e)}}else{var v=f(`state`);p[v]=!0,r=function(e,t){if(u(e,v))throw new h(m);return t.facade=e,l(e,v,t),t},i=function(e){return u(e,v)?e[v]:{}},a=function(e){return u(e,v)}}e.exports={set:r,get:i,has:a,enforce:function(e){return a(e)?i(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!c(t)||(n=i(t)).type!==e)throw new h(`Incompatible receiver, `+e+` required`);return n}}}},4209:function(e,t,n){var r=n(8227),i=n(6269),a=r(`iterator`),o=Array.prototype;e.exports=function(e){return e!==void 0&&(i.Array===e||o[a]===e)}},4376:function(e,t,n){var r=n(2195);e.exports=Array.isArray||function(e){return r(e)===`Array`}},4901:function(e){var t=typeof document==`object`&&document.all;e.exports=t===void 0&&t!==void 0?function(e){return typeof e==`function`||e===t}:function(e){return typeof e==`function`}},3517:function(e,t,n){var r=n(9504),i=n(9039),a=n(4901),o=n(6955),s=n(7751),c=n(3706),l=function(){},u=s(`Reflect`,`construct`),d=/^\s*(?:class|function)\b/,f=r(d.exec),p=!d.test(l),m=function(e){if(!a(e))return!1;try{return u(l,[],e),!0}catch{return!1}},h=function(e){if(!a(e))return!1;switch(o(e)){case`AsyncFunction`:case`GeneratorFunction`:case`AsyncGeneratorFunction`:return!1}try{return p||!!f(d,c(e))}catch{return!0}};h.sham=!0,e.exports=!u||i((function(){var e;return m(m.call)||!m(Object)||!m((function(){e=!0}))||e}))?h:m},2796:function(e,t,n){var r=n(9039),i=n(4901),a=/#|\.prototype\./,o=function(e,t){var n=c[s(e)];return n===u||n!==l&&(i(t)?r(t):!!t)},s=o.normalize=function(e){return String(e).replace(a,`.`).toLowerCase()},c=o.data={},l=o.NATIVE=`N`,u=o.POLYFILL=`P`;e.exports=o},2087:function(e,t,n){var r=n(34),i=Math.floor;e.exports=Number.isInteger||function(e){return!r(e)&&isFinite(e)&&i(e)===e}},4117:function(e){e.exports=function(e){return e==null}},34:function(e,t,n){var r=n(4901);e.exports=function(e){return typeof e==`object`?e!==null:r(e)}},3925:function(e,t,n){var r=n(34);e.exports=function(e){return r(e)||e===null}},6395:function(e){e.exports=!1},5810:function(e,t,n){var r=n(34),i=n(1181).get;e.exports=function(e){if(!r(e))return!1;var t=i(e);return!!t&&t.type===`RawJSON`}},788:function(e,t,n){var r=n(34),i=n(2195),a=n(8227)(`match`);e.exports=function(e){var t;return r(e)&&((t=e[a])===void 0?i(e)===`RegExp`:!!t)}},757:function(e,t,n){var r=n(7751),i=n(4901),a=n(1625),o=n(7040),s=Object;e.exports=o?function(e){return typeof e==`symbol`}:function(e){var t=r(`Symbol`);return i(t)&&a(t.prototype,s(e))}},9539:function(e,t,n){var r=n(9565),i=n(8551),a=n(5966);e.exports=function(e,t,n){var o,s;i(e);try{if(!(o=a(e,`return`))){if(t===`throw`)throw n;return n}o=r(o,e)}catch(e){s=!0,o=e}if(t===`throw`)throw n;if(s)throw o;return i(o),n}},3994:function(e,t,n){var r=n(7657).IteratorPrototype,i=n(2360),a=n(6980),o=n(687),s=n(6269),c=function(){return this};e.exports=function(e,t,n,l){var u=t+` Iterator`;return e.prototype=i(r,{next:a(+!l,n)}),o(e,u,!1,!0),s[u]=c,e}},1088:function(e,t,n){var r=n(6518),i=n(9565),a=n(6395),o=n(350),s=n(4901),c=n(3994),l=n(2787),u=n(2967),d=n(687),f=n(6699),p=n(6840),m=n(8227),h=n(6269),g=n(7657),_=o.PROPER,v=o.CONFIGURABLE,y=g.IteratorPrototype,b=g.BUGGY_SAFARI_ITERATORS,x=m(`iterator`),S=`keys`,C=`values`,w=`entries`,T=function(){return this};e.exports=function(e,t,n,o,m,g,E){c(n,t,o);var D,O,k,A=function(e){if(e===m&&P)return P;if(!b&&e&&e in N)return N[e];switch(e){case S:case C:case w:return function(){return new n(this,e)}}return function(){return new n(this)}},j=t+` Iterator`,M=!1,N=e.prototype,ee=N[x]||N[`@@iterator`]||m&&N[m],P=!b&&ee||A(m),te=t===`Array`&&N.entries||ee;if(te&&(D=l(te.call(new e)))!==Object.prototype&&D.next&&(a||l(D)===y||(u?u(D,y):s(D[x])||p(D,x,T)),d(D,j,!0,!0),a&&(h[j]=T)),_&&m===C&&ee&&ee.name!==C&&(!a&&v?f(N,`name`,C):(M=!0,P=function(){return i(ee,this)})),m)if(O={values:A(C),keys:g?P:A(S),entries:A(w)},E)for(k in O)(b||M||!(k in N))&&p(N,k,O[k]);else r({target:t,proto:!0,forced:b||M},O);return a&&!E||N[x]===P||p(N,x,P,{name:m}),h[t]=P,O}},7657:function(e,t,n){var r,i,a,o=n(9039),s=n(4901),c=n(34),l=n(2360),u=n(2787),d=n(6840),f=n(8227),p=n(6395),m=f(`iterator`),h=!1;[].keys&&(`next`in(a=[].keys())?(i=u(u(a)))!==Object.prototype&&(r=i):h=!0),!c(r)||o((function(){var e={};return r[m].call(e)!==e}))?r={}:p&&(r=l(r)),s(r[m])||d(r,m,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:h}},6269:function(e){e.exports={}},6198:function(e,t,n){var r=n(8014);e.exports=function(e){return r(e.length)}},283:function(e,t,n){var r=n(9504),i=n(9039),a=n(4901),o=n(9297),s=n(3724),c=n(350).CONFIGURABLE,l=n(3706),u=n(1181),d=u.enforce,f=u.get,p=String,m=Object.defineProperty,h=r(``.slice),g=r(``.replace),_=r([].join),v=s&&!i((function(){return m((function(){}),`length`,{value:8}).length!==8})),y=String(String).split(`String`),b=e.exports=function(e,t,n){h(p(t),0,7)===`Symbol(`&&(t=`[`+g(p(t),/^Symbol\(([^)]*)\).*$/,`$1`)+`]`),n&&n.getter&&(t=`get `+t),n&&n.setter&&(t=`set `+t),(!o(e,`name`)||c&&e.name!==t)&&(s?m(e,`name`,{value:t,configurable:!0}):e.name=t),v&&n&&o(n,`arity`)&&e.length!==n.arity&&m(e,`length`,{value:n.arity});try{n&&o(n,`constructor`)&&n.constructor?s&&m(e,`prototype`,{writable:!1}):e.prototype&&=void 0}catch{}var r=d(e);return o(r,`source`)||(r.source=_(y,typeof t==`string`?t:``)),e};Function.prototype.toString=b((function(){return a(this)&&f(this).source||l(this)}),`toString`)},741:function(e){var t=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}},7819:function(e,t,n){e.exports=!n(9039)((function(){var e=`9007199254740993`,t=JSON.rawJSON(e);return!JSON.isRawJSON(t)||JSON.stringify(t)!==e}))},5749:function(e,t,n){var r=n(788),i=TypeError;e.exports=function(e){if(r(e))throw new i(`The method doesn't accept regular expressions`);return e}},4213:function(e,t,n){var r=n(3724),i=n(9504),a=n(9565),o=n(9039),s=n(1072),c=n(3717),l=n(8773),u=n(8981),d=n(7055),f=Object.assign,p=Object.defineProperty,m=i([].concat);e.exports=!f||o((function(){if(r&&f({b:1},f(p({},`a`,{enumerable:!0,get:function(){p(this,`b`,{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var e={},t={},n=Symbol(`assign detection`),i=`abcdefghijklmnopqrst`;return e[n]=7,i.split(``).forEach((function(e){t[e]=e})),f({},e)[n]!==7||s(f({},t)).join(``)!==i}))?function(e,t){for(var n=u(e),i=arguments.length,o=1,f=c.f,p=l.f;i>o;)for(var h,g=d(arguments[o++]),_=f?m(s(g),f(g)):s(g),v=_.length,y=0;v>y;)h=_[y++],r&&!a(p,g,h)||(n[h]=g[h]);return n}:f},2360:function(e,t,n){var r,i=n(8551),a=n(6801),o=n(8727),s=n(421),c=n(397),l=n(4055),u=n(6119),d=`prototype`,f=`script`,p=u(`IE_PROTO`),m=function(){},h=function(e){return`<`+f+`>`+e+`</`+f+`>`},g=function(e){e.write(h(``)),e.close();var t=e.parentWindow.Object;return e=null,t},_=function(){try{r=new ActiveXObject(`htmlfile`)}catch{}var e,t,n;_=typeof document<`u`?document.domain&&r?g(r):(t=l(`iframe`),n=`java`+f+`:`,t.style.display=`none`,c.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(h(`document.F=Object`)),e.close(),e.F):g(r);for(var i=o.length;i--;)delete _[d][o[i]];return _()};s[p]=!0,e.exports=Object.create||function(e,t){var n;return e===null?n=_():(m[d]=i(e),n=new m,m[d]=null,n[p]=e),t===void 0?n:a.f(n,t)}},6801:function(e,t,n){var r=n(3724),i=n(8686),a=n(4913),o=n(8551),s=n(5397),c=n(1072);t.f=r&&!i?Object.defineProperties:function(e,t){o(e);for(var n,r=s(t),i=c(t),l=i.length,u=0;l>u;)a.f(e,n=i[u++],r[n]);return e}},4913:function(e,t,n){var r=n(3724),i=n(5917),a=n(8686),o=n(8551),s=n(6969),c=TypeError,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=`enumerable`,f=`configurable`,p=`writable`;t.f=r?a?function(e,t,n){if(o(e),t=s(t),o(n),typeof e==`function`&&t===`prototype`&&`value`in n&&p in n&&!n[p]){var r=u(e,t);r&&r[p]&&(e[t]=n.value,n={configurable:f in n?n[f]:r[f],enumerable:d in n?n[d]:r[d],writable:!1})}return l(e,t,n)}:l:function(e,t,n){if(o(e),t=s(t),o(n),i)try{return l(e,t,n)}catch{}if(`get`in n||`set`in n)throw new c(`Accessors not supported`);return`value`in n&&(e[t]=n.value),e}},7347:function(e,t,n){var r=n(3724),i=n(9565),a=n(8773),o=n(6980),s=n(5397),c=n(6969),l=n(9297),u=n(5917),d=Object.getOwnPropertyDescriptor;t.f=r?d:function(e,t){if(e=s(e),t=c(t),u)try{return d(e,t)}catch{}if(l(e,t))return o(!i(a.f,e,t),e[t])}},298:function(e,t,n){var r=n(2195),i=n(5397),a=n(8480).f,o=n(7680),s=typeof window==`object`&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return s&&r(e)===`Window`?function(e){try{return a(e)}catch{return o(s)}}(e):a(i(e))}},8480:function(e,t,n){var r=n(1828),i=n(8727).concat(`length`,`prototype`);t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},3717:function(e,t){t.f=Object.getOwnPropertySymbols},2787:function(e,t,n){var r=n(9297),i=n(4901),a=n(8981),o=n(6119),s=n(2211),c=o(`IE_PROTO`),l=Object,u=l.prototype;e.exports=s?l.getPrototypeOf:function(e){var t=a(e);if(r(t,c))return t[c];var n=t.constructor;return i(n)&&t instanceof n?n.prototype:t instanceof l?u:null}},1625:function(e,t,n){e.exports=n(9504)({}.isPrototypeOf)},1828:function(e,t,n){var r=n(9504),i=n(9297),a=n(5397),o=n(9617).indexOf,s=n(421),c=r([].push);e.exports=function(e,t){var n,r=a(e),l=0,u=[];for(n in r)!i(s,n)&&i(r,n)&&c(u,n);for(;t.length>l;)i(r,n=t[l++])&&(~o(u,n)||c(u,n));return u}},1072:function(e,t,n){var r=n(1828),i=n(8727);e.exports=Object.keys||function(e){return r(e,i)}},8773:function(e,t){var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor;t.f=r&&!n.call({1:2},1)?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},2551:function(e,t,n){var r=n(6395),i=n(4576),a=n(9039),o=n(3607);e.exports=r||!a((function(){if(!(o&&o<535)){var e=Math.random();__defineSetter__.call(null,e,(function(){})),delete i[e]}}))},2967:function(e,t,n){var r=n(6706),i=n(34),a=n(7750),o=n(3506);e.exports=Object.setPrototypeOf||(`__proto__`in{}?function(){var e,t=!1,n={};try{(e=r(Object.prototype,`__proto__`,`set`))(n,[]),t=n instanceof Array}catch{}return function(n,r){return a(n),o(r),i(n)&&(t?e(n,r):n.__proto__=r),n}}():void 0)},3179:function(e,t,n){var r=n(2140),i=n(6955);e.exports=r?{}.toString:function(){return`[object `+i(this)+`]`}},4270:function(e,t,n){var r=n(9565),i=n(4901),a=n(34),o=TypeError;e.exports=function(e,t){var n,s;if(t===`string`&&i(n=e.toString)&&!a(s=r(n,e))||i(n=e.valueOf)&&!a(s=r(n,e))||t!==`string`&&i(n=e.toString)&&!a(s=r(n,e)))return s;throw new o(`Can't convert object to primitive value`)}},5031:function(e,t,n){var r=n(7751),i=n(9504),a=n(8480),o=n(3717),s=n(8551),c=i([].concat);e.exports=r(`Reflect`,`ownKeys`)||function(e){var t=a.f(s(e)),n=o.f;return n?c(t,n(e)):t}},8235:function(e,t,n){var r=n(9504),i=n(9297),a=SyntaxError,o=parseInt,s=String.fromCharCode,c=r(``.charAt),l=r(``.slice),u=r(/./.exec),d={'\\"':`"`,"\\\\":`\\`,"\\/":`/`,"\\b":`\b`,"\\f":`\f`,"\\n":`
|
|
10
|
+
`,"\\r":`\r`,"\\t":` `},f=/^[\da-f]{4}$/i,p=/^[\u0000-\u001F]$/;e.exports=function(e,t){for(var n=!0,r=``;t<e.length;){var m=c(e,t);if(m===`\\`){var h=l(e,t,t+2);if(i(d,h))r+=d[h],t+=2;else{if(h!==`\\u`)throw new a(`Unknown escape sequence: "`+h+`"`);var g=l(e,t+=2,t+4);if(!u(f,g))throw new a(`Bad Unicode escape at: `+t);r+=s(o(g,16)),t+=4}}else{if(m===`"`){n=!1,t++;break}if(u(p,m))throw new a(`Bad control character in string literal at: `+t);r+=m,t++}}if(n)throw new a(`Unterminated string at: `+t);return{value:r,end:t}}},9167:function(e,t,n){e.exports=n(4576)},1056:function(e,t,n){var r=n(4913).f;e.exports=function(e,t,n){n in e||r(e,n,{configurable:!0,get:function(){return t[n]},set:function(e){t[n]=e}})}},6682:function(e,t,n){var r=n(9565),i=n(8551),a=n(4901),o=n(2195),s=n(7323),c=TypeError;e.exports=function(e,t){var n=e.exec;if(a(n)){var l=r(n,e,t);return l!==null&&i(l),l}if(o(e)===`RegExp`)return r(s,e,t);throw new c(`RegExp#exec called on incompatible receiver`)}},7323:function(e,t,n){var r,i,a=n(9565),o=n(9504),s=n(655),c=n(7979),l=n(8429),u=n(5745),d=n(2360),f=n(1181).get,p=n(3635),m=n(8814),h=u(`native-string-replace`,String.prototype.replace),g=RegExp.prototype.exec,_=g,v=o(``.charAt),y=o(``.indexOf),b=o(``.replace),x=o(``.slice),S=(i=/b*/g,a(g,r=/a/,`a`),a(g,i,`a`),r.lastIndex!==0||i.lastIndex!==0),C=l.BROKEN_CARET,w=/()??/.exec(``)[1]!==void 0,T=function(e,t){for(var n=e.groups=d(null),r=0;r<t.length;r++){var i=t[r];n[i[0]]=e[i[1]]}};(S||w||C||p||m)&&(_=function(e){var t,n,r,i=this,o=f(i),l=s(e),u=o.raw;if(u)return u.lastIndex=i.lastIndex,t=a(_,u,l),i.lastIndex=u.lastIndex,t&&o.groups&&T(t,o.groups),t;var d=o.groups,p=C&&i.sticky,m=a(c,i),E=i.source,D=0,O=l;if(p){m=b(m,`y`,``),y(m,`g`)===-1&&(m+=`g`),O=x(l,i.lastIndex);var k=i.lastIndex>0&&v(l,i.lastIndex-1);i.lastIndex>0&&(!i.multiline||i.multiline&&k!==`
|
|
11
|
+
`&&k!==`\r`&&k!==`\u2028`&&k!==`\u2029`)&&(E=`(?: (?:`+E+`))`,O=` `+O,D++),n=RegExp(`^(?:`+E+`)`,m)}w&&(n=RegExp(`^`+E+`$(?!\\s)`,m)),S&&(r=i.lastIndex);var A=a(g,p?n:i,O);return p?A?(A.input=l,A[0]=x(A[0],D),A.index=i.lastIndex,i.lastIndex+=A[0].length):i.lastIndex=0:S&&A&&(i.lastIndex=i.global?A.index+A[0].length:r),w&&A&&A.length>1&&a(h,A[0],n,(function(){for(var e=1;e<arguments.length-2;e++)arguments[e]===void 0&&(A[e]=void 0)})),A&&d&&T(A,d),A}),e.exports=_},5213:function(e,t,n){var r=n(4576),i=n(9039),a=r.RegExp;e.exports={correct:!i((function(){var e=!0;try{a(`.`,`d`)}catch{e=!1}var t={},n=``,r=e?`dgimsy`:`gimsy`,i=function(e,r){Object.defineProperty(t,e,{get:function(){return n+=r,!0}})},o={dotAll:`s`,global:`g`,ignoreCase:`i`,multiline:`m`,sticky:`y`};for(var s in e&&(o.hasIndices=`d`),o)i(s,o[s]);return Object.getOwnPropertyDescriptor(a.prototype,`flags`).get.call(t)!==r||n!==r}))}},7979:function(e,t,n){var r=n(8551);e.exports=function(){var e=r(this),t=``;return e.hasIndices&&(t+=`d`),e.global&&(t+=`g`),e.ignoreCase&&(t+=`i`),e.multiline&&(t+=`m`),e.dotAll&&(t+=`s`),e.unicode&&(t+=`u`),e.unicodeSets&&(t+=`v`),e.sticky&&(t+=`y`),t}},1034:function(e,t,n){var r=n(9565),i=n(9297),a=n(1625),o=n(5213),s=n(7979),c=RegExp.prototype;e.exports=o.correct?function(e){return e.flags}:function(e){return o.correct||!a(c,e)||i(e,`flags`)?e.flags:r(s,e)}},8429:function(e,t,n){var r=n(9039),i=n(4576).RegExp,a=r((function(){var e=i(`a`,`y`);return e.lastIndex=2,e.exec(`abcd`)!==null})),o=a||r((function(){return!i(`a`,`y`).sticky}));e.exports={BROKEN_CARET:a||r((function(){var e=i(`^r`,`gy`);return e.lastIndex=2,e.exec(`str`)!==null})),MISSED_STICKY:o,UNSUPPORTED_Y:a}},3635:function(e,t,n){var r=n(9039),i=n(4576).RegExp;e.exports=r((function(){var e=i(`.`,`s`);return!(e.dotAll&&e.test(`
|
|
12
|
+
`)&&e.flags===`s`)}))},8814:function(e,t,n){var r=n(9039),i=n(4576).RegExp;e.exports=r((function(){var e=i(`(?<a>b)`,`g`);return e.exec(`b`).groups.a!==`b`||`b`.replace(e,`$<a>c`)!==`bc`}))},7750:function(e,t,n){var r=n(4117),i=TypeError;e.exports=function(e){if(r(e))throw new i(`Can't call method on `+e);return e}},7633:function(e,t,n){var r=n(7751),i=n(2106),a=n(8227),o=n(3724),s=a(`species`);e.exports=function(e){var t=r(e);o&&t&&!t[s]&&i(t,s,{configurable:!0,get:function(){return this}})}},687:function(e,t,n){var r=n(4913).f,i=n(9297),a=n(8227)(`toStringTag`);e.exports=function(e,t,n){e&&!n&&(e=e.prototype),e&&!i(e,a)&&r(e,a,{configurable:!0,value:t})}},6119:function(e,t,n){var r=n(5745),i=n(3392),a=r(`keys`);e.exports=function(e){return a[e]||(a[e]=i(e))}},7629:function(e,t,n){var r=n(6395),i=n(4576),a=n(9433),o=`__core-js_shared__`,s=e.exports=i[o]||a(o,{});(s.versions||=[]).push({version:`3.49.0`,mode:r?`pure`:`global`,copyright:`© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.`,license:`https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE`,source:`https://github.com/zloirock/core-js`})},5745:function(e,t,n){var r=n(7629);e.exports=function(e,t){return r[e]||(r[e]=t||{})}},2293:function(e,t,n){var r=n(8551),i=n(5548),a=n(4117),o=n(8227)(`species`);e.exports=function(e,t){var n,s=r(e).constructor;return s===void 0||a(n=r(s)[o])?t:i(n)}},8183:function(e,t,n){var r=n(9504),i=n(1291),a=n(655),o=n(7750),s=r(``.charAt),c=r(``.charCodeAt),l=r(``.slice),u=function(e){return function(t,n){var r,u,d=a(o(t)),f=i(n),p=d.length;return f<0||f>=p?e?``:void 0:(r=c(d,f))<55296||r>56319||f+1===p||(u=c(d,f+1))<56320||u>57343?e?s(d,f):r:e?l(d,f,f+2):u-56320+(r-55296<<10)+65536}};e.exports={codeAt:u(!1),charAt:u(!0)}},706:function(e,t,n){var r=n(350).PROPER,i=n(9039),a=n(7452);e.exports=function(e){return i((function(){return!!a[e]()||`
`[e]()!==`
`||r&&a[e].name!==e}))}},3802:function(e,t,n){var r=n(9504),i=n(7750),a=n(655),o=n(7452),s=r(``.replace),c=RegExp(`^[`+o+`]+`),l=RegExp(`(^|[^`+o+`])[`+o+`]+$`),u=function(e){return function(t){var n=a(i(t));return 1&e&&(n=s(n,c,``)),2&e&&(n=s(n,l,`$1`)),n}};e.exports={start:u(1),end:u(2),trim:u(3)}},4495:function(e,t,n){var r=n(9519),i=n(9039),a=n(4576).String;e.exports=!!Object.getOwnPropertySymbols&&!i((function(){var e=Symbol(`symbol detection`);return!a(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},8242:function(e,t,n){var r=n(9565),i=n(7751),a=n(8227),o=n(6840);e.exports=function(){var e=i(`Symbol`),t=e&&e.prototype,n=t&&t.valueOf,s=a(`toPrimitive`);t&&!t[s]&&o(t,s,(function(e){return r(n,this)}),{arity:1})}},1296:function(e,t,n){e.exports=n(4495)&&!!Symbol.for&&!!Symbol.keyFor},1240:function(e,t,n){e.exports=n(9504)(1.1.valueOf)},5610:function(e,t,n){var r=n(1291),i=Math.max,a=Math.min;e.exports=function(e,t){var n=r(e);return n<0?i(n+t,0):a(n,t)}},5397:function(e,t,n){var r=n(7055),i=n(7750);e.exports=function(e){return r(i(e))}},1291:function(e,t,n){var r=n(741);e.exports=function(e){var t=+e;return t!=t||t===0?0:r(t)}},8014:function(e,t,n){var r=n(1291),i=Math.min;e.exports=function(e){var t=r(e);return t>0?i(t,9007199254740991):0}},8981:function(e,t,n){var r=n(7750),i=Object;e.exports=function(e){return i(r(e))}},2777:function(e,t,n){var r=n(9565),i=n(34),a=n(757),o=n(5966),s=n(4270),c=n(8227),l=TypeError,u=c(`toPrimitive`);e.exports=function(e,t){if(!i(e)||a(e))return e;var n,c=o(e,u);if(c){if(t===void 0&&(t=`default`),n=r(c,e,t),!i(n)||a(n))return n;throw new l(`Can't convert object to primitive value`)}return t===void 0&&(t=`number`),s(e,t)}},6969:function(e,t,n){var r=n(2777),i=n(757);e.exports=function(e){var t=r(e,`string`);return i(t)?t:t+``}},2140:function(e,t,n){var r={};r[n(8227)(`toStringTag`)]=`z`,e.exports=String(r)===`[object z]`},655:function(e,t,n){var r=n(6955),i=String;e.exports=function(e){if(r(e)===`Symbol`)throw TypeError(`Cannot convert a Symbol value to a string`);return i(e)}},6823:function(e){var t=String;e.exports=function(e){try{return t(e)}catch{return`Object`}}},3392:function(e,t,n){var r=n(9504),i=0,a=Math.random(),o=r(1.1.toString);e.exports=function(e){return`Symbol(`+(e===void 0?``:e)+`)_`+o(++i+a,36)}},7040:function(e,t,n){e.exports=n(4495)&&!Symbol.sham&&typeof Symbol.iterator==`symbol`},8686:function(e,t,n){var r=n(3724),i=n(9039);e.exports=r&&i((function(){return Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype!==42}))},8622:function(e,t,n){var r=n(4576),i=n(4901),a=r.WeakMap;e.exports=i(a)&&/native code/.test(String(a))},511:function(e,t,n){var r=n(9167),i=n(9297),a=n(1951),o=n(4913).f;e.exports=function(e){var t=r.Symbol||={};i(t,e)||o(t,e,{value:a.f(e)})}},1951:function(e,t,n){t.f=n(8227)},8227:function(e,t,n){var r=n(4576),i=n(5745),a=n(9297),o=n(3392),s=n(4495),c=n(7040),l=r.Symbol,u=i(`wks`),d=c?l.for||l:l&&l.withoutSetter||o;e.exports=function(e){return a(u,e)||(u[e]=s&&a(l,e)?l[e]:d(`Symbol.`+e)),u[e]}},7452:function(e){e.exports=`
|
|
13
|
+
\v\f\r \xA0 \u2028\u2029`},8706:function(e,t,n){var r=n(6518),i=n(9039),a=n(4376),o=n(34),s=n(8981),c=n(6198),l=n(6837),u=n(4659),d=n(4527),f=n(1469),p=n(597),m=n(8227),h=n(9519),g=m(`isConcatSpreadable`),_=h>=51||!i((function(){var e=[];return e[g]=!1,e.concat()[0]!==e})),v=function(e){if(!o(e))return!1;var t=e[g];return t===void 0?a(e):!!t};r({target:`Array`,proto:!0,arity:1,forced:!_||!p(`concat`)},{concat:function(e){var t,n,r,i,a,o=s(this),p=f(o,0),m=0;for(t=-1,r=arguments.length;t<r;t++)if(v(a=t===-1?o:arguments[t]))for(i=c(a),l(m+i),n=0;n<i;n++,m++)n in a&&u(p,m,a[n]);else l(m+1),u(p,m++,a);return d(p,m),p}})},2008:function(e,t,n){var r=n(6518),i=n(9213).filter;r({target:`Array`,proto:!0,forced:!n(597)(`filter`)},{filter:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},3418:function(e,t,n){var r=n(6518),i=n(7916);r({target:`Array`,stat:!0,forced:!n(4428)((function(e){Array.from(e)}))},{from:i})},4423:function(e,t,n){var r=n(6518),i=n(9617).includes,a=n(9039),o=n(6469),s=a((function(){return![,].includes()})),c=a((function(){return[,1].includes(void 0,1)}));r({target:`Array`,proto:!0,forced:s||c},{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),o(`includes`)},5276:function(e,t,n){var r=n(6518),i=n(7476),a=n(9617).indexOf,o=n(4598),s=i([].indexOf),c=!!s&&1/s([1],1,-0)<0;r({target:`Array`,proto:!0,forced:c||!o(`indexOf`)},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return c?s(this,e,t)||0:a(this,e,t)}})},3792:function(e,t,n){var r=n(5397),i=n(6469),a=n(6269),o=n(1181),s=n(4913).f,c=n(1088),l=n(2529),u=n(6395),d=n(3724),f=`Array Iterator`,p=o.set,m=o.getterFor(f);e.exports=c(Array,`Array`,(function(e,t){p(this,{type:f,target:r(e),index:0,kind:t})}),(function(){var e=m(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=null,l(void 0,!0);switch(e.kind){case`keys`:return l(n,!1);case`values`:return l(t[n],!1)}return l([n,t[n]],!1)}),`values`);var h=a.Arguments=a.Array;if(i(`keys`),i(`values`),i(`entries`),!u&&d&&h.name!==`values`)try{s(h,`name`,{value:`values`})}catch{}},8598:function(e,t,n){var r=n(6518),i=n(9504),a=n(7055),o=n(5397),s=n(4598),c=i([].join);r({target:`Array`,proto:!0,forced:a!==Object||!s(`join`,`,`)},{join:function(e){return c(o(this),e===void 0?`,`:e)}})},2062:function(e,t,n){var r=n(6518),i=n(9213).map;r({target:`Array`,proto:!0,forced:!n(597)(`map`)},{map:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},2712:function(e,t,n){var r=n(6518),i=n(926).left,a=n(4598),o=n(9519);r({target:`Array`,proto:!0,forced:!n(6193)&&o>79&&o<83||!a(`reduce`)},{reduce:function(e){var t=arguments.length;return i(this,e,t,t>1?arguments[1]:void 0)}})},4782:function(e,t,n){var r=n(6518),i=n(4376),a=n(3517),o=n(34),s=n(5610),c=n(6198),l=n(5397),u=n(4659),d=n(4527),f=n(8227),p=n(597),m=n(7680),h=p(`slice`),g=f(`species`),_=Array,v=Math.max;r({target:`Array`,proto:!0,forced:!h},{slice:function(e,t){var n,r,f,p=l(this),h=c(p),y=s(e,h),b=s(t===void 0?h:t,h);if(i(p)&&(n=p.constructor,(a(n)&&(n===_||i(n.prototype))||o(n)&&(n=n[g])===null)&&(n=void 0),n===_||n===void 0))return m(p,y,b);for(r=new(n===void 0?_:n)(v(b-y,0)),f=0;y<b;y++,f++)y in p&&u(r,f,p[y]);return d(r,f),r}})},6910:function(e,t,n){var r=n(6518),i=n(9504),a=n(9306),o=n(8981),s=n(6198),c=n(4606),l=n(655),u=n(9039),d=n(4488),f=n(4598),p=n(3709),m=n(3763),h=n(9519),g=n(3607),_=[],v=i(_.sort),y=i(_.push),b=u((function(){_.sort(void 0)})),x=u((function(){_.sort(null)})),S=f(`sort`),C=!u((function(){if(h)return h<70;if(!(p&&p>3)){if(m)return!0;if(g)return g<603;var e,t,n,r,i=``;for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(r=0;r<47;r++)_.push({k:t+r,v:n})}for(_.sort((function(e,t){return t.v-e.v})),r=0;r<_.length;r++)t=_[r].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return i!==`DGBEFHACIJK`}}));r({target:`Array`,proto:!0,forced:b||!x||!S||!C},{sort:function(e){e!==void 0&&a(e);var t=o(this);if(C)return e===void 0?v(t):v(t,e);var n,r,i=[],u=s(t);for(r=0;r<u;r++)r in t&&y(i,t[r]);for(d(i,function(e){return function(t,n){if(n===void 0)return-1;if(t===void 0)return 1;if(e!==void 0)return+e(t,n)||0;var r=l(t),i=l(n);return r===i?0:r>i?1:-1}}(e)),n=s(i),r=0;r<n;)t[r]=i[r++];for(;r<u;)c(t,r++);return t}})},4554:function(e,t,n){var r=n(6518),i=n(8981),a=n(5610),o=n(1291),s=n(6198),c=n(4527),l=n(6837),u=n(1469),d=n(4659),f=n(4606),p=n(597)(`splice`),m=Math.max,h=Math.min;r({target:`Array`,proto:!0,forced:!p},{splice:function(e,t){var n,r,p,g,_,v,y=i(this),b=s(y),x=a(e,b),S=arguments.length;for(S===0?n=r=0:S===1?(n=0,r=b-x):(n=S-2,r=h(m(o(t),0),b-x)),l(b+n-r),p=u(y,r),g=0;g<r;g++)(_=x+g)in y&&d(p,g,y[_]);if(c(p,r),n<r){for(g=x;g<b-r;g++)v=g+n,(_=g+r)in y?y[v]=y[_]:f(y,v);for(g=b;g>b-r+n;g--)f(y,g-1)}else if(n>r)for(g=b-r;g>x;g--)v=g+n-1,(_=g+r-1)in y?y[v]=y[_]:f(y,v);for(g=0;g<n;g++)y[g+x]=arguments[g+2];return c(y,b-r+n),p}})},739:function(e,t,n){var r=n(6518),i=n(9039),a=n(8981),o=n(2777);r({target:`Date`,proto:!0,arity:1,forced:i((function(){return new Date(NaN).toJSON()!==null||Date.prototype.toJSON.call({toISOString:function(){return 1}})!==1}))},{toJSON:function(e){var t=a(this),n=o(t,`number`);return typeof n!=`number`||isFinite(n)?t.toISOString():null}})},9572:function(e,t,n){var r=n(9297),i=n(6840),a=n(3640),o=n(8227)(`toPrimitive`),s=Date.prototype;r(s,o)||i(s,o,a)},2010:function(e,t,n){var r=n(3724),i=n(350).EXISTS,a=n(9504),o=n(2106),s=Function.prototype,c=a(s.toString),l=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,u=a(l.exec);r&&!i&&o(s,`name`,{configurable:!0,get:function(){try{return u(l,c(this))[1]}catch{return``}}})},3110:function(e,t,n){var r=n(6518),i=n(7751),a=n(8745),o=n(9565),s=n(9504),c=n(9039),l=n(4376),u=n(4901),d=n(5810),f=n(757),p=n(2195),m=n(655),h=n(7680),g=n(8235),_=n(3392),v=n(4495),y=n(7819),b=String,x=i(`JSON`,`stringify`),S=s(/./.exec),C=s(``.charAt),w=s(``.charCodeAt),T=s(``.replace),E=s(``.slice),D=s([].push),O=s(1.1.toString),k=/[\uD800-\uDFFF]/g,A=/^[\uD800-\uDBFF]$/,j=/^[\uDC00-\uDFFF]$/,M=_(),N=M.length,ee=!v||c((function(){var e=i(`Symbol`)(`stringify detection`);return x([e])!==`[null]`||x({a:e})!==`{}`||x(Object(e))!==`{}`})),P=c((function(){return x(`\udf06\ud834`)!==`"\\udf06\\ud834"`||x(`\udead`)!==`"\\udead"`})),te=ee?function(e,t){var n=h(arguments),r=re(t);if(u(r)||e!==void 0&&!f(e))return n[1]=function(e,t){if(u(r)&&(t=o(r,this,b(e),t)),!f(t))return t},a(x,null,n)}:x,ne=function(e,t,n){var r=C(n,t-1),i=C(n,t+1);return S(A,e)&&!S(j,i)||S(j,e)&&!S(A,r)?`\\u`+O(w(e,0),16):e},re=function(e){if(u(e))return e;if(l(e)){for(var t=e.length,n=[],r=0;r<t;r++){var i=e[r];typeof i==`string`?D(n,i):typeof i!=`number`&&p(i)!==`Number`&&p(i)!==`String`||D(n,m(i))}var a=n.length,o=!0;return function(e,t){if(o)return o=!1,t;if(l(this))return t;for(var r=0;r<a;r++)if(n[r]===e)return t}}};x&&r({target:`JSON`,stat:!0,arity:3,forced:ee||P||!y},{stringify:function(e,t,n){var r=re(t),i=[],a=te(e,(function(e,t){var n=u(r)?o(r,this,b(e),t):t;return!y&&d(n)?M+(D(i,n.rawJSON)-1):n}),n);if(typeof a!=`string`||(P&&(a=T(a,k,ne)),y))return a;for(var s=``,c=a.length,l=0;l<c;l++){var f=C(a,l);if(f===`"`){var p=g(a,++l).end-1,m=E(a,l,p);s+=E(m,0,N)===M?i[E(m,N)]:`"`+m+`"`,l=p}else s+=f}return s}})},2892:function(e,t,n){var r=n(6518),i=n(6395),a=n(3724),o=n(4576),s=n(9167),c=n(9504),l=n(2796),u=n(9297),d=n(3167),f=n(1625),p=n(757),m=n(2777),h=n(9039),g=n(8480).f,_=n(7347).f,v=n(4913).f,y=n(1240),b=n(3802).trim,x=`Number`,S=o[x],C=s[x],w=S.prototype,T=o.TypeError,E=c(``.slice),D=c(``.charCodeAt),O=function(e){var t,n,r,i,a,o,s,c,l=m(e,`number`);if(p(l))throw new T(`Cannot convert a Symbol value to a number`);if(typeof l==`string`&&l.length>2){if(l=b(l),(t=D(l,0))===43||t===45){if((n=D(l,2))===88||n===120)return NaN}else if(t===48){switch(D(l,1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+l}for(o=(a=E(l,2)).length,s=0;s<o;s++)if((c=D(a,s))<48||c>i)return NaN;return parseInt(a,r)}}return+l},k=l(x,!S(` 0o1`)||!S(`0b1`)||S(`+0x1`)),A=function(e){var t,n=arguments.length<1?0:S(function(e){var t=m(e,`number`);return typeof t==`bigint`?t:O(t)}(e));return f(w,t=this)&&h((function(){y(t)}))?d(Object(n),this,A):n};A.prototype=w,k&&!i&&(w.constructor=A),r({global:!0,constructor:!0,wrap:!0,forced:k},{Number:A});var j=function(e,t){for(var n,r=a?g(t):`MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range`.split(`,`),i=0;r.length>i;i++)u(t,n=r[i])&&!u(e,n)&&v(e,n,_(t,n))};i&&C&&j(s[x],C),(k||i)&&j(s[x],S)},2637:function(e,t,n){n(6518)({target:`Number`,stat:!0},{isInteger:n(2087)})},9085:function(e,t,n){var r=n(6518),i=n(4213);r({target:`Object`,stat:!0,arity:2,forced:Object.assign!==i},{assign:i})},7427:function(e,t,n){var r=n(6518),i=n(3724),a=n(2551),o=n(9306),s=n(8981),c=n(4913);i&&r({target:`Object`,proto:!0,forced:a},{__defineGetter__:function(e,t){c.f(s(this),e,{get:o(t),enumerable:!0,configurable:!0})}})},3851:function(e,t,n){var r=n(6518),i=n(9039),a=n(5397),o=n(7347).f,s=n(3724);r({target:`Object`,stat:!0,forced:!s||i((function(){o(1)})),sham:!s},{getOwnPropertyDescriptor:function(e,t){return o(a(e),t)}})},1278:function(e,t,n){var r=n(6518),i=n(3724),a=n(5031),o=n(5397),s=n(7347),c=n(4659);r({target:`Object`,stat:!0,sham:!i},{getOwnPropertyDescriptors:function(e){for(var t,n,r=o(e),i=s.f,l=a(r),u={},d=0;l.length>d;)(n=i(r,t=l[d++]))!==void 0&&c(u,t,n);return u}})},1480:function(e,t,n){var r=n(6518),i=n(9039),a=n(298).f;r({target:`Object`,stat:!0,forced:i((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:a})},9773:function(e,t,n){var r=n(6518),i=n(4495),a=n(9039),o=n(3717),s=n(8981);r({target:`Object`,stat:!0,forced:!i||a((function(){o.f(1)}))},{getOwnPropertySymbols:function(e){var t=o.f;return t?t(s(e)):[]}})},9432:function(e,t,n){var r=n(6518),i=n(8981),a=n(1072);r({target:`Object`,stat:!0,forced:n(9039)((function(){a(1)}))},{keys:function(e){return a(i(e))}})},6099:function(e,t,n){var r=n(2140),i=n(6840),a=n(3179);r||i(Object.prototype,`toString`,a,{unsafe:!0})},825:function(e,t,n){var r=n(6518),i=n(7751),a=n(8745),o=n(566),s=n(5548),c=n(8551),l=n(34),u=n(2360),d=n(9039),f=i(`Reflect`,`construct`),p=Object.prototype,m=[].push,h=d((function(){function e(){}return!(f((function(){}),[],e)instanceof e)})),g=!d((function(){f((function(){}))})),_=h||g;r({target:`Reflect`,stat:!0,forced:_,sham:_},{construct:function(e,t){s(e);var n=arguments.length<3?e:s(arguments[2]);if(c(t),g&&!h)return f(e,t,n);if(e===n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return a(m,r,t),new(a(o,e,r))}var i=n.prototype,d=u(l(i)?i:p),_=a(e,d,t);return l(_)?_:d}})},4864:function(e,t,n){var r=n(3724),i=n(4576),a=n(9504),o=n(2796),s=n(3167),c=n(6699),l=n(2360),u=n(8480).f,d=n(1625),f=n(788),p=n(655),m=n(1034),h=n(8429),g=n(1056),_=n(6840),v=n(9039),y=n(9297),b=n(1181).enforce,x=n(7633),S=n(8227),C=n(3635),w=n(8814),T=S(`match`),E=i.RegExp,D=E.prototype,O=i.SyntaxError,k=a(D.exec),A=a(``.charAt),j=a(``.replace),M=a(``.indexOf),N=a(``.slice),ee=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,P=/a/g,te=/a/g,ne=new E(P)!==P,re=h.MISSED_STICKY,ie=h.UNSUPPORTED_Y;if(o(`RegExp`,r&&(!ne||re||C||w||v((function(){return te[T]=!1,E(P)!==P||E(te)===te||String(E(P,`i`))!==`/a/i`}))))){for(var F=function(e,t){var n,r,i,a,o,u,h=d(D,this),g=f(e),_=t===void 0,v=[],x=e;if(!h&&g&&_&&e.constructor===F)return e;if((g||d(D,e))&&(e=e.source,_&&(t=m(x))),e=e===void 0?``:p(e),t=t===void 0?``:p(t),x=e,C&&`dotAll`in P&&(r=!!t&&M(t,`s`)>-1)&&(t=j(t,/s/g,``)),n=t,re&&`sticky`in P&&(i=!!t&&M(t,`y`)>-1)&&ie&&(t=j(t,/y/g,``)),w&&(a=function(e){for(var t,n=e.length,r=0,i=``,a=[],o=l(null),s=!1,c=!1,u=0,d=``;r<n;r++){if((t=A(e,r))===`\\`){if(t+=A(e,++r),!c&&A(t,1)===`\\`){i+=`\\x5c`;continue}}else if(t===`]`)s=!1;else if(!s)switch(!0){case t===`[`:s=!0;break;case t===`(`:i+=t,k(ee,N(e,r+1))?(r+=2,c=!0,u++):A(e,r+1)!==`?`&&u++;continue;case t===`>`&&c:if(d===``||y(o,d))throw new O(`Invalid capture group name`);o[d]=!0,a[a.length]=[d,u],c=!1,d=``;continue}c?d+=t:i+=t}for(var f=0;f<a.length;f++)for(var p=`\\k<`+a[f][0]+`>`,m=`\\`+a[f][1];M(i,p)>-1;)i=j(i,p,m);return[i,a]}(e),e=a[0],v=a[1]),o=s(E(e,t),h?this:D,F),(r||i||v.length)&&(u=b(o),r&&(u.dotAll=!0,u.raw=F(function(e){for(var t,n=e.length,r=0,i=``,a=!1;r<n;r++)(t=A(e,r))===`\\`?i+=t+A(e,++r):a||t!==`.`?(t===`[`?a=!0:t===`]`&&(a=!1),i+=t):i+=`[\\s\\S]`;return i}(e),n)),i&&(u.sticky=!0),v.length&&(u.groups=v)),e!==x)try{c(o,`source`,x===``?`(?:)`:x)}catch{}return o},ae=u(E),oe=0;ae.length>oe;)g(F,E,ae[oe++]);D.constructor=F,F.prototype=D,_(i,`RegExp`,F,{constructor:!0})}x(`RegExp`)},7495:function(e,t,n){var r=n(6518),i=n(7323);r({target:`RegExp`,proto:!0,forced:/./.exec!==i},{exec:i})},8781:function(e,t,n){var r=n(350).PROPER,i=n(6840),a=n(8551),o=n(655),s=n(9039),c=n(1034),l=`toString`,u=RegExp.prototype,d=u[l],f=s((function(){return d.call({source:`a`,flags:`b`})!==`/a/b`})),p=r&&d.name!==l;(f||p)&&i(u,l,(function(){var e=a(this);return`/`+o(e.source)+`/`+o(c(e))}),{unsafe:!0})},1699:function(e,t,n){var r=n(6518),i=n(9504),a=n(5749),o=n(7750),s=n(655),c=n(1436),l=i(``.indexOf);r({target:`String`,proto:!0,forced:!c(`includes`)},{includes:function(e){return!!~l(s(o(this)),s(a(e)),arguments.length>1?arguments[1]:void 0)}})},7764:function(e,t,n){var r=n(8183).charAt,i=n(655),a=n(1181),o=n(1088),s=n(2529),c=`String Iterator`,l=a.set,u=a.getterFor(c);o(String,`String`,(function(e){l(this,{type:c,string:i(e),index:0})}),(function(){var e,t=u(this),n=t.string,i=t.index;return i>=n.length?s(void 0,!0):(e=r(n,i),t.index+=e.length,s(e,!1))}))},8543:function(e,t,n){var r=n(6518),i=n(9565),a=n(7476),o=n(3994),s=n(2529),c=n(7750),l=n(8014),u=n(655),d=n(8551),f=n(34),p=n(2195),m=n(788),h=n(1034),g=n(5966),_=n(6840),v=n(9039),y=n(8227),b=n(2293),x=n(7829),S=n(6682),C=n(1181),w=n(6395),T=y(`matchAll`),E=`RegExp String`,D=E+` Iterator`,O=C.set,k=C.getterFor(D),A=RegExp.prototype,j=TypeError,M=a(``.indexOf),N=a(``.matchAll),ee=!!N&&!v((function(){N(`a`,/./)})),P=o((function(e,t,n,r){O(this,{type:D,regexp:e,string:t,global:n,unicode:r,done:!1})}),E,(function(){var e=k(this);if(e.done)return s(void 0,!0);var t=e.regexp,n=e.string,r=S(t,n);return r===null?(e.done=!0,s(void 0,!0)):e.global?(u(r[0])===``&&(t.lastIndex=x(n,l(t.lastIndex),e.unicode)),s(r,!1)):(e.done=!0,s(r,!1))})),te=function(e){var t,n,r,i=d(this),a=u(e),o=b(i,RegExp),s=u(h(i));return t=new o(o===RegExp?i.source:i,s),n=!!~M(s,`g`),r=!!~M(s,`u`)||!!~M(s,`v`),t.lastIndex=l(i.lastIndex),new P(t,a,n,r)};r({target:`String`,proto:!0,forced:ee},{matchAll:function(e){var t,n,r,a,o=c(this);if(f(e)){if(m(e)&&(t=u(c(h(e))),!~M(t,`g`)))throw new j("`.matchAll` does not allow non-global regexes");if(ee)return N(o,e);if((r=g(e,T))===void 0&&w&&p(e)===`RegExp`&&(r=te),r)return i(r,e,o)}else if(ee)return N(o,e);return n=u(o),a=new RegExp(e,`g`),w?i(te,a,n):a[T](n)}}),w||T in A||_(A,T,te)},1761:function(e,t,n){var r=n(9565),i=n(9504),a=n(9228),o=n(8551),s=n(34),c=n(8014),l=n(655),u=n(7750),d=n(5966),f=n(7829),p=n(1034),m=n(6682),h=i(``.indexOf);a(`match`,(function(e,t,n){return[function(t){var n=u(this),i=s(t)?d(t,e):void 0;return i?r(i,t,n):new RegExp(t)[e](l(n))},function(e){var r=o(this),i=l(e),a=n(t,r,i);if(a.done)return a.value;var s=l(p(r));if(!~h(s,`g`))return m(r,i);var u=!!~h(s,`u`)||!!~h(s,`v`);r.lastIndex=0;for(var d,g=[],_=0;(d=m(r,i))!==null;){var v=l(d[0]);g[_]=v,v===``&&(r.lastIndex=f(i,c(r.lastIndex),u)),_++}return _===0?null:g}]}))},5440:function(e,t,n){var r=n(8745),i=n(9565),a=n(9504),o=n(9228),s=n(9039),c=n(8551),l=n(4901),u=n(34),d=n(1291),f=n(8014),p=n(655),m=n(7750),h=n(7829),g=n(5966),_=n(2478),v=n(1034),y=n(6682),b=n(8227)(`replace`),x=Math.max,S=Math.min,C=a([].concat),w=a([].push),T=a(``.indexOf),E=a(``.slice),D=`a`.replace(/./,`$0`)===`$0`,O=!!/./[b]&&/./[b](`a`,`$0`)===``;o(`replace`,(function(e,t,n){var a=O?`$`:`$0`;return[function(e,n){var r=m(this),a=u(e)?g(e,b):void 0;return a?i(a,e,r,n):i(t,p(r),e,n)},function(e,i){var o=c(this),s=p(e),u=l(i);u||(i=p(i));var m=p(v(o));if(typeof i==`string`&&!~T(i,a)&&!~T(i,`$<`)&&!~T(m,`y`)){var g=n(t,o,s,i);if(g.done)return g.value}var b,D=!!~T(m,`g`);D&&(b=!!~T(m,`u`)||!!~T(m,`v`),o.lastIndex=0);for(var O,k=[];(O=y(o,s))!==null&&(w(k,O),D);)p(O[0])===``&&(o.lastIndex=h(s,f(o.lastIndex),b));for(var A,j=``,M=0,N=0;N<k.length;N++){for(var ee,P=p((O=k[N])[0]),te=x(S(d(O.index),s.length),0),ne=[],re=1;re<O.length;re++)w(ne,(A=O[re])===void 0?A:String(A));var ie=O.groups;if(u){var F=C([P],ne,te,s);ie!==void 0&&w(F,ie),ee=p(r(i,void 0,F))}else ee=_(P,s,te,ne,ie,i);te>=M&&(j+=E(s,M,te)+ee,M=te+P.length)}return j+E(s,M)}]}),!!s((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:`7`},e},``.replace(e,`$<a>`)!==`7`}))||!D||O)},744:function(e,t,n){var r=n(9565),i=n(9504),a=n(9228),o=n(8551),s=n(34),c=n(7750),l=n(2293),u=n(7829),d=n(8014),f=n(655),p=n(5966),m=n(1034),h=n(6682),g=n(8429),_=n(9039),v=g.UNSUPPORTED_Y,y=Math.min,b=i([].push),x=i(``.slice),S=i(``.indexOf),C=!_((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n=`ab`.split(e);return n.length!==2||n[0]!==`a`||n[1]!==`b`})),w=`abbc`.split(/(b)*/)[1]===`c`||`test`.split(/(?:)/,-1).length!==4||`ab`.split(/(?:ab)*/).length!==2||`.`.split(/(.?)(.?)/).length!==4||`.`.split(/()()/).length>1||``.split(/.?/).length;a(`split`,(function(e,t,n){var i=`0`.split(void 0,0).length?function(e,n){return e===void 0&&n===0?[]:r(t,this,e,n)}:t;return[function(t,n){var a=c(this),o=s(t)?p(t,e):void 0;return o?r(o,t,a,n):r(i,f(a),t,n)},function(e,r){var a=o(this),s=f(e);if(!w){var c=n(i,a,s,r,i!==t);if(c.done)return c.value}var p=l(a,RegExp),g=f(m(a)),_=!!~S(g,`u`)||!!~S(g,`v`);v?~S(g,`g`)||(g+=`g`):~S(g,`y`)||(g+=`y`);var C=new p(v?`^(?:`+a.source+`)`:a,g),T=r===void 0?4294967295:r>>>0;if(T===0)return[];if(s.length===0)return h(C,s)===null?[s]:[];for(var E=0,D=0,O=[];D<s.length;){C.lastIndex=v?0:D;var k,A=h(C,v?x(s,D):s);if(A===null||(k=y(d(C.lastIndex+(v?D:0)),s.length))===E)D=u(s,D,_);else{if(b(O,x(s,E,D)),O.length===T)return O;for(var j=1;j<=A.length-1;j++)if(b(O,A[j]),O.length===T)return O;D=E=k}}return b(O,x(s,E)),O}]}),w||!C,v)},2762:function(e,t,n){var r=n(6518),i=n(3802).trim;r({target:`String`,proto:!0,forced:n(706)(`trim`)},{trim:function(){return i(this)}})},6761:function(e,t,n){var r=n(6518),i=n(4576),a=n(9565),o=n(9504),s=n(6395),c=n(3724),l=n(4495),u=n(9039),d=n(9297),f=n(1625),p=n(8551),m=n(5397),h=n(6969),g=n(655),_=n(6980),v=n(2360),y=n(1072),b=n(8480),x=n(298),S=n(3717),C=n(7347),w=n(4913),T=n(6801),E=n(8773),D=n(6840),O=n(2106),k=n(5745),A=n(6119),j=n(421),M=n(3392),N=n(8227),ee=n(1951),P=n(511),te=n(8242),ne=n(687),re=n(1181),ie=n(9213).forEach,F=A(`hidden`),ae=`Symbol`,oe=`prototype`,se=re.set,ce=re.getterFor(ae),le=Object[oe],ue=i.Symbol,I=ue&&ue[oe],L=i.RangeError,de=i.TypeError,fe=i.QObject,pe=C.f,me=w.f,he=x.f,ge=E.f,_e=o([].push),ve=k(`symbols`),ye=k(`op-symbols`),be=k(`wks`),xe=!fe||!fe[oe]||!fe[oe].findChild,Se=function(e,t,n){var r=pe(le,t);return r&&delete le[t],me(e,t,n),r&&e!==le&&me(le,t,r),e},Ce=c&&u((function(){return v(me({},`a`,{get:function(){return me(this,`a`,{value:7}).a}})).a!==7}))?Se:me,we=function(e,t){var n=ve[e]=v(I);return se(n,{type:ae,tag:e,description:t}),c||(n.description=t),n},Te=function(e,t,n){e===le&&Te(ye,t,n),p(e);var r=h(t);return p(n),d(ve,r)?((`enumerable`in n?!n.enumerable:!d(e,r)||d(e,F)&&e[F][r])?(d(e,F)||me(e,F,_(1,v(null))),e[F][r]=!0):(d(e,F)&&e[F][r]&&(e[F][r]=!1),n=v(n,{enumerable:_(0,!1)})),Ce(e,r,n)):me(e,r,n)},Ee=function(e,t){p(e);var n=m(t);return ie(y(n).concat(Ae(n)),(function(t){c&&!a(De,n,t)||Te(e,t,n[t])})),e},De=function(e){var t=h(e),n=a(ge,this,t);return!(this===le&&d(ve,t)&&!d(ye,t))&&(!(n||!d(this,t)||!d(ve,t)||d(this,F)&&this[F][t])||n)},Oe=function(e,t){var n=m(e),r=h(t);if(n!==le||!d(ve,r)||d(ye,r)){var i=pe(n,r);return!i||!d(ve,r)||d(n,F)&&n[F][r]||(i.enumerable=!0),i}},ke=function(e){var t=he(m(e)),n=[];return ie(t,(function(e){d(ve,e)||d(j,e)||_e(n,e)})),n},Ae=function(e){var t=e===le,n=he(t?ye:m(e)),r=[];return ie(n,(function(e){!d(ve,e)||t&&!d(le,e)||_e(r,ve[e])})),r};l||(ue=function(){if(f(I,this))throw new de(`Symbol is not a constructor`);var e=arguments.length&&arguments[0]!==void 0?g(arguments[0]):void 0,t=M(e),n=function(e){var r=this===void 0?i:this;r===le&&a(n,ye,e),d(r,F)&&d(r[F],t)&&(r[F][t]=!1);var o=_(1,e);try{Ce(r,t,o)}catch(e){if(!(e instanceof L))throw e;Se(r,t,o)}};return c&&xe&&Ce(le,t,{configurable:!0,set:n}),we(t,e)},D(I=ue[oe],`toString`,(function(){return ce(this).tag})),D(ue,`withoutSetter`,(function(e){return we(M(e),e)})),E.f=De,w.f=Te,T.f=Ee,C.f=Oe,b.f=x.f=ke,S.f=Ae,ee.f=function(e){return we(N(e),e)},c&&(O(I,`description`,{configurable:!0,get:function(){return ce(this).description}}),s||D(le,`propertyIsEnumerable`,De,{unsafe:!0}))),r({global:!0,constructor:!0,wrap:!0,forced:!l,sham:!l},{Symbol:ue}),ie(y(be),(function(e){P(e)})),r({target:ae,stat:!0,forced:!l},{useSetter:function(){xe=!0},useSimple:function(){xe=!1}}),r({target:`Object`,stat:!0,forced:!l,sham:!c},{create:function(e,t){return t===void 0?v(e):Ee(v(e),t)},defineProperty:Te,defineProperties:Ee,getOwnPropertyDescriptor:Oe}),r({target:`Object`,stat:!0,forced:!l},{getOwnPropertyNames:ke}),te(),ne(ue,ae),j[F]=!0},9463:function(e,t,n){var r=n(6518),i=n(3724),a=n(4576),o=n(9565),s=n(9504),c=n(9297),l=n(4901),u=n(1625),d=n(655),f=n(2106),p=n(7740),m=a.Symbol,h=m&&m.prototype;if(i&&l(m)&&(!(`description`in h)||m().description!==void 0)){var g={},_=function(){var e=arguments.length<1||arguments[0]===void 0?void 0:d(arguments[0]),t=u(h,this)?new m(e):e===void 0?m():m(e);return e===``&&(g[t]=!0),t};p(_,m);var v=_.for;_.for={for:function(e){var t=d(e),n=o(v,this,t);return t===``&&(g[n]=!0),n}}.for,_.prototype=h,h.constructor=_;var y=String(m(`description detection`))===`Symbol(description detection)`,b=s(h.valueOf),x=s(h.toString),S=/^Symbol\((.*)\)[^)]+$/,C=s(``.replace),w=s(``.slice);f(h,`description`,{configurable:!0,get:function(){var e=b(this);if(c(g,e))return``;var t=x(e),n=y?w(t,7,-1):C(t,S,`$1`);return n===``?void 0:n}}),r({global:!0,constructor:!0,forced:!0},{Symbol:_})}},1510:function(e,t,n){var r=n(6518),i=n(7751),a=n(9297),o=n(655),s=n(5745),c=n(1296),l=s(`string-to-symbol-registry`),u=s(`symbol-to-string-registry`);r({target:`Symbol`,stat:!0,forced:!c},{for:function(e){var t=o(e);if(a(l,t))return l[t];var n=i(`Symbol`)(t);return l[t]=n,u[n]=t,n}})},2259:function(e,t,n){n(511)(`iterator`)},2675:function(e,t,n){n(6761),n(1510),n(7812),n(3110),n(9773)},7812:function(e,t,n){var r=n(6518),i=n(9297),a=n(757),o=n(6823),s=n(5745),c=n(1296),l=s(`symbol-to-string-registry`);r({target:`Symbol`,stat:!0,forced:!c},{keyFor:function(e){if(!a(e))throw TypeError(o(e)+` is not a symbol`);if(i(l,e))return l[e]}})},5700:function(e,t,n){var r=n(511),i=n(8242);r(`toPrimitive`),i()},8344:function(e,t,n){n(8543)},3500:function(e,t,n){var r=n(4576),i=n(7400),a=n(9296),o=n(235),s=n(6699),c=function(e){if(e&&e.forEach!==o)try{s(e,`forEach`,o)}catch{e.forEach=o}};for(var l in i)i[l]&&c(r[l]&&r[l].prototype);c(a)},2953:function(e,t,n){var r=n(4576),i=n(7400),a=n(9296),o=n(3792),s=n(6699),c=n(687),l=n(8227)(`iterator`),u=o.values,d=function(e,t){if(e){if(e[l]!==u)try{s(e,l,u)}catch{e[l]=u}if(c(e,t,!0),i[t]){for(var n in o)if(e[n]!==o[n])try{s(e,n,o[n])}catch{e[n]=o[n]}}}};for(var f in i)d(r[f]&&r[f].prototype,f);d(a,`DOMTokenList`)}},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,n),a.exports}n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if(typeof globalThis==`object`)return globalThis;try{return this||Function(`return this`)()}catch{if(typeof window==`object`)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};function i(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}(e)||a(e)||function(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
14
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function a(e,t){if(e){if(typeof e==`string`)return o(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}function o(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s(e){return s=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},s(e)}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function l(e,t,n){return(t=u(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e){var t=function(e,t){if(s(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(s(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}(e,`string`);return s(t)==`symbol`?t:t+``}n.r(r),n.d(r,{SimpleKeyboard:function(){return A},default:function(){return j}}),n(5276),n(8598),n(4782),n(4554),n(2010),n(7427),n(6099),n(7495),n(8781),n(5440),n(744),n(2762),typeof Element>`u`||`remove`in Element.prototype||(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)}),typeof self<`u`&&`document`in self&&((!(`classList`in document.createElement(`_`))||document.createElementNS&&!(`classList`in document.createElementNS(`http://www.w3.org/2000/svg`,`g`)))&&function(e){if(`Element`in e){var t=`classList`,n=`prototype`,r=e.Element[n],i=Object,a=String[n].trim||function(){return this.replace(/^\s+|\s+$/g,``)},o=Array[n].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1},s=function(e,t){this.name=e,this.code=DOMException[e],this.message=t},c=function(e,t){if(t===``)throw new s(`SYNTAX_ERR`,`The token must not be empty.`);if(/\s/.test(t))throw new s(`INVALID_CHARACTER_ERR`,`The token must not contain space characters.`);return o.call(e,t)},l=function(e){for(var t=a.call(e.getAttribute(`class`)||``),n=t?t.split(/\s+/):[],r=0,i=n.length;r<i;r++)this.push(n[r]);this._updateClassName=function(){e.setAttribute(`class`,this.toString())}},u=l[n]=[],d=function(){return new l(this)};if(s[n]=Error[n],u.item=function(e){return this[e]||null},u.contains=function(e){return~c(this,e+``)},u.add=function(){var e,t=arguments,n=0,r=t.length,i=!1;do~c(this,e=t[n]+``)||(this.push(e),i=!0);while(++n<r);i&&this._updateClassName()},u.remove=function(){var e,t,n=arguments,r=0,i=n.length,a=!1;do for(t=c(this,e=n[r]+``);~t;)this.splice(t,1),a=!0,t=c(this,e);while(++r<i);a&&this._updateClassName()},u.toggle=function(e,t){var n=this.contains(e),r=n?!0!==t&&`remove`:!1!==t&&`add`;return r&&this[r](e),!0===t||!1===t?t:!n},u.replace=function(e,t){var n=c(e+``);~n&&(this.splice(n,1,t),this._updateClassName())},u.toString=function(){return this.join(` `)},i.defineProperty){var f={get:d,enumerable:!0,configurable:!0};try{i.defineProperty(r,t,f)}catch(e){e.number!==void 0&&e.number!==-2146823252||(f.enumerable=!1,i.defineProperty(r,t,f))}}else i[n].__defineGetter__&&r.__defineGetter__(t,d)}}(self),function(){var e=document.createElement(`_`);if(e.classList.add(`c1`,`c2`),!e.classList.contains(`c2`)){var t=function(e){var t=DOMTokenList.prototype[e];DOMTokenList.prototype[e]=function(e){var n,r=arguments.length;for(n=0;n<r;n++)e=arguments[n],t.call(this,e)}};t(`add`),t(`remove`)}if(e.classList.toggle(`c3`,!1),e.classList.contains(`c3`)){var n=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return 1 in arguments&&!this.contains(e)==!t?t:n.call(this,e)}}`replace`in document.createElement(`_`).classList||(DOMTokenList.prototype.replace=function(e,t){var n=this.toString().split(` `),r=n.indexOf(e+``);~r&&(n=n.slice(r),this.remove.apply(this,n),this.add(t),this.add.apply(this,n.slice(1)))}),e=null}()),n(2675),n(9463),n(2259),n(5700),n(8706),n(2008),n(3418),n(4423),n(3792),n(2062),n(6910),n(739),n(9572),n(2892),n(9085),n(3851),n(1278),n(9432),n(4864),n(1699),n(7764),n(8344),n(3500),n(2953),n(2712),n(2637),n(1480),n(825),n(1761);var d=function(){return e=function e(t){var n=t.getOptions,r=t.getCaretPosition,i=t.getCaretPositionEnd,a=t.dispatch;(function(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)})(this,e),l(this,`getOptions`,void 0),l(this,`getCaretPosition`,void 0),l(this,`getCaretPositionEnd`,void 0),l(this,`dispatch`,void 0),l(this,`maxLengthReached`,void 0),l(this,`isStandardButton`,(function(e){return e&&!(e[0]===`{`&&e[e.length-1]===`}`)})),this.getOptions=n,this.getCaretPosition=r,this.getCaretPositionEnd=i,this.dispatch=a,e.bindMethods(e,this)},t=[{key:`getButtonType`,value:function(e){return e.includes(`{`)&&e.includes(`}`)&&e!==`{//}`?`functionBtn`:`standardBtn`}},{key:`getButtonClass`,value:function(e){var t=this.getButtonType(e),n=e.replace(`{`,``).replace(`}`,``),r=``;return t!==`standardBtn`&&(r=` hg-button-${n}`),`hg-${t}${r}`}},{key:`getDefaultDiplay`,value:function(){return{"{bksp}":`backspace`,"{backspace}":`backspace`,"{enter}":`< enter`,"{shift}":`shift`,"{shiftleft}":`shift`,"{shiftright}":`shift`,"{alt}":`alt`,"{s}":`shift`,"{tab}":`tab`,"{lock}":`caps`,"{capslock}":`caps`,"{accept}":`Submit`,"{space}":` `,"{//}":` `,"{esc}":`esc`,"{escape}":`esc`,"{f1}":`f1`,"{f2}":`f2`,"{f3}":`f3`,"{f4}":`f4`,"{f5}":`f5`,"{f6}":`f6`,"{f7}":`f7`,"{f8}":`f8`,"{f9}":`f9`,"{f10}":`f10`,"{f11}":`f11`,"{f12}":`f12`,"{numpaddivide}":`/`,"{numlock}":`lock`,"{arrowup}":`↑`,"{arrowleft}":`←`,"{arrowdown}":`↓`,"{arrowright}":`→`,"{prtscr}":`print`,"{scrolllock}":`scroll`,"{pause}":`pause`,"{insert}":`ins`,"{home}":`home`,"{pageup}":`up`,"{delete}":`del`,"{forwarddelete}":`del`,"{end}":`end`,"{pagedown}":`down`,"{numpadmultiply}":`*`,"{numpadsubtract}":`-`,"{numpadadd}":`+`,"{numpadenter}":`enter`,"{period}":`.`,"{numpaddecimal}":`.`,"{numpad0}":`0`,"{numpad1}":`1`,"{numpad2}":`2`,"{numpad3}":`3`,"{numpad4}":`4`,"{numpad5}":`5`,"{numpad6}":`6`,"{numpad7}":`7`,"{numpad8}":`8`,"{numpad9}":`9`}}},{key:`getButtonDisplayName`,value:function(e,t){return(t=arguments.length>2&&arguments[2]!==void 0&&arguments[2]?Object.assign({},this.getDefaultDiplay(),t):t||this.getDefaultDiplay())[e]||e}},{key:`getUpdatedInput`,value:function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:n,i=arguments.length>4&&arguments[4]!==void 0&&arguments[4],a=this.getOptions(),o=[n,r,i],s=t;return(e===`{bksp}`||e===`{backspace}`)&&s.length>0?s=this.removeAt.apply(this,[s].concat(o)):(e===`{delete}`||e===`{forwarddelete}`)&&s.length>0?s=this.removeForwardsAt.apply(this,[s].concat(o)):e===`{space}`?s=this.addStringAt.apply(this,[s,` `].concat(o)):e!==`{tab}`||typeof a.tabCharOnTab==`boolean`&&!1===a.tabCharOnTab?e!==`{enter}`&&e!==`{numpadenter}`||!a.newLineOnEnter?e.includes(`numpad`)&&Number.isInteger(Number(e[e.length-2]))?s=this.addStringAt.apply(this,[s,e[e.length-2]].concat(o)):e===`{numpaddivide}`?s=this.addStringAt.apply(this,[s,`/`].concat(o)):e===`{numpadmultiply}`?s=this.addStringAt.apply(this,[s,`*`].concat(o)):e===`{numpadsubtract}`?s=this.addStringAt.apply(this,[s,`-`].concat(o)):e===`{numpadadd}`?s=this.addStringAt.apply(this,[s,`+`].concat(o)):e===`{numpaddecimal}`?s=this.addStringAt.apply(this,[s,`.`].concat(o)):e===`{`||e===`}`?s=this.addStringAt.apply(this,[s,e].concat(o)):e.includes(`{`)||e.includes(`}`)||(s=this.addStringAt.apply(this,[s,e].concat(o))):s=this.addStringAt.apply(this,[s,`
|
|
15
|
+
`].concat(o)):s=this.addStringAt.apply(this,[s,` `].concat(o)),a.debug&&console.log(`Input will be: `+s),s}},{key:`updateCaretPos`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=this.updateCaretPosAction(e,t);this.dispatch((function(e){e.setCaretPosition(n)}))}},{key:`updateCaretPosAction`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=this.getOptions(),r=this.getCaretPosition();return r!=null&&(t?r>0&&(r-=e):r+=e),n.debug&&console.log(`Caret at:`,r),r}},{key:`addStringAt`,value:function(e,t){var n,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e.length,a=arguments.length>4&&arguments[4]!==void 0&&arguments[4];return r||r===0?(n=[e.slice(0,r),t,e.slice(i)].join(``),this.isMaxLengthReached()||a&&this.updateCaretPos(t.length)):n=e+t,n}},{key:`removeAt`,value:function(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e.length,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(n===0&&r===0)return e;if(n===r){var a=/([\uD800-\uDBFF][\uDC00-\uDFFF])/g;n&&n>=0?e.substring(n-2,n).match(a)?(t=e.substr(0,n-2)+e.substr(n),i&&this.updateCaretPos(2,!0)):(t=e.substr(0,n-1)+e.substr(n),i&&this.updateCaretPos(1,!0)):e.slice(-2).match(a)?(t=e.slice(0,-2),i&&this.updateCaretPos(2,!0)):(t=e.slice(0,-1),i&&this.updateCaretPos(1,!0))}else t=e.slice(0,n)+e.slice(r),i&&this.dispatch((function(e){e.setCaretPosition(n)}));return t}},{key:`removeForwardsAt`,value:function(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e.length,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,i=arguments.length>3&&arguments[3]!==void 0&&arguments[3];return e!=null&&e.length&&n!==null?(n===r?t=e.substring(n,n+2).match(/([\uD800-\uDBFF][\uDC00-\uDFFF])/g)?e.substr(0,n)+e.substr(n+2):e.substr(0,n)+e.substr(n+1):(t=e.slice(0,n)+e.slice(r),i&&this.dispatch((function(e){e.setCaretPosition(n)}))),t):e}},{key:`handleMaxLength`,value:function(e,t){var n=this.getOptions(),r=n.maxLength,i=e[n.inputName||`default`],a=t.length-1>=r;if(t.length<=i.length)return!1;if(Number.isInteger(r))return n.debug&&console.log(`maxLength (num) reached:`,a),a?(this.maxLengthReached=!0,!0):(this.maxLengthReached=!1,!1);if(s(r)===`object`){var o=t.length-1>=r[n.inputName||`default`];return n.debug&&console.log(`maxLength (obj) reached:`,o),o?(this.maxLengthReached=!0,!0):(this.maxLengthReached=!1,!1)}}},{key:`isMaxLengthReached`,value:function(){return!!this.maxLengthReached}},{key:`isTouchDevice`,value:function(){return`ontouchstart`in window||navigator.maxTouchPoints}},{key:`pointerEventsSupported`,value:function(){return!!window.PointerEvent}},{key:`camelCase`,value:function(e){return e?e.toLowerCase().trim().split(/[.\-_\s]/g).reduce((function(e,t){return t.length?e+t[0].toUpperCase()+t.slice(1):e})):``}},{key:`chunkArray`,value:function(e,t){return i(Array(Math.ceil(e.length/t))).map((function(n,r){return e.slice(t*r,t+t*r)}))}},{key:`escapeRegex`,value:function(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,`\\$&`)}},{key:`getRtlOffset`,value:function(e,t){var n=e,r=t.indexOf(``);return r<e&&r!=-1&&n--,t.indexOf(``)<e&&r!=-1&&n--,n<0?0:n}},{key:`isConstructor`,value:function(e){try{Reflect.construct(String,[],e)}catch{return!1}return!0}}],n=[{key:`bindMethods`,value:function(e,t){var n,r=function(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=a(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
16
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,s=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){c=!0,o=e},f:function(){try{s||n.return==null||n.return()}finally{if(c)throw o}}}}(Object.getOwnPropertyNames(e.prototype));try{for(r.s();!(n=r.n()).done;){var i=n.value;i===`constructor`||i===`bindMethods`||(t[i]=t[i].bind(t))}}catch(e){r.e(e)}finally{r.f()}}}],t&&c(e.prototype,t),n&&c(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();l(d,`noop`,(function(){}));var f=d;function p(e){return p=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},p(e)}function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,g(r.key),r)}}function h(e,t,n){return(t=g(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e){var t=function(e,t){if(p(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(p(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}(e,`string`);return p(t)==`symbol`?t:t+``}var _=function(){return e=function e(t){var n=this,r=t.dispatch,i=t.getOptions;(function(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)})(this,e),h(this,`getOptions`,void 0),h(this,`dispatch`,void 0),h(this,`isModifierKey`,(function(e){return e.altKey||e.ctrlKey||e.shiftKey||[`Tab`,`CapsLock`,`Esc`,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`].includes(e.code||e.key||n.keyCodeToKey(e?.keyCode))})),this.dispatch=r,this.getOptions=i,f.bindMethods(e,this)},t=[{key:`handleHighlightKeyDown`,value:function(e){var t=this.getOptions();t.physicalKeyboardHighlightPreventDefault&&this.isModifierKey(e)&&(e.preventDefault(),e.stopImmediatePropagation());var n=this.getSimpleKeyboardLayoutKey(e);this.dispatch((function(r){var i,a,o=r.getButtonElement(n),s=r.getButtonElement(`{${n}}`);if(o)i=o,a=n;else{if(!s)return;i=s,a=`{${n}}`}var c,l,u,d,f=function(e){e.style.background=t.physicalKeyboardHighlightBgColor||`#dadce4`,e.style.color=t.physicalKeyboardHighlightTextColor||`black`};if(i)if(Array.isArray(i)){if(i.forEach((function(e){return f(e)})),t.physicalKeyboardHighlightPress)if(t.physicalKeyboardHighlightPressUsePointerEvents)(c=i[0])==null||(l=c.onpointerdown)==null||l.call(c,e);else if(t.physicalKeyboardHighlightPressUseClick){var p;(p=i[0])==null||p.click()}else r.handleButtonClicked(a,e)}else f(i),t.physicalKeyboardHighlightPress&&(t.physicalKeyboardHighlightPressUsePointerEvents?(u=i)==null||(d=u.onpointerdown)==null||d.call(u,e):t.physicalKeyboardHighlightPressUseClick?i.click():r.handleButtonClicked(a,e))}))}},{key:`handleHighlightKeyUp`,value:function(e){var t=this.getOptions();t.physicalKeyboardHighlightPreventDefault&&this.isModifierKey(e)&&(e.preventDefault(),e.stopImmediatePropagation());var n=this.getSimpleKeyboardLayoutKey(e);this.dispatch((function(r){var i,a,o,s=r.getButtonElement(n)||r.getButtonElement(`{${n}}`),c=function(e){e.removeAttribute&&e.removeAttribute(`style`)};s&&(Array.isArray(s)?(s.forEach((function(e){return c(e)})),t.physicalKeyboardHighlightPressUsePointerEvents&&((i=s[0])==null||(a=i.onpointerup)==null||a.call(i,e))):(c(s),t.physicalKeyboardHighlightPressUsePointerEvents&&(s==null||(o=s.onpointerup)==null||o.call(s,e))))}))}},{key:`getSimpleKeyboardLayoutKey`,value:function(e){var t=``,n=e.code||e.key||this.keyCodeToKey(e?.keyCode);return(t=n!=null&&n.includes(`Numpad`)||n!=null&&n.includes(`Shift`)||n!=null&&n.includes(`Space`)||n!=null&&n.includes(`Backspace`)||n!=null&&n.includes(`Control`)||n!=null&&n.includes(`Alt`)||n!=null&&n.includes(`Meta`)?e.code||``:e.key||this.keyCodeToKey(e?.keyCode)||``).length>1?t?.toLowerCase():t}},{key:`keyCodeToKey`,value:function(e){return{8:`Backspace`,9:`Tab`,13:`Enter`,16:`Shift`,17:`Ctrl`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Esc`,32:`Space`,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,48:`0`,49:`1`,50:`2`,51:`3`,52:`4`,53:`5`,54:`6`,55:`7`,56:`8`,57:`9`,65:`A`,66:`B`,67:`C`,68:`D`,69:`E`,70:`F`,71:`G`,72:`H`,73:`I`,74:`J`,75:`K`,76:`L`,77:`M`,78:`N`,79:`O`,80:`P`,81:`Q`,82:`R`,83:`S`,84:`T`,85:`U`,86:`V`,87:`W`,88:`X`,89:`Y`,90:`Z`,91:`Meta`,96:`Numpad0`,97:`Numpad1`,98:`Numpad2`,99:`Numpad3`,100:`Numpad4`,101:`Numpad5`,102:`Numpad6`,103:`Numpad7`,104:`Numpad8`,105:`Numpad9`,106:`NumpadMultiply`,107:`NumpadAdd`,109:`NumpadSubtract`,110:`NumpadDecimal`,111:`NumpadDivide`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`}[e]||``}}],t&&m(e.prototype,t),n&&m(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();function v(e){return v=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},v(e)}function y(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,x(r.key),r)}}function b(e,t,n){return(t=x(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x(e){var t=function(e,t){if(v(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(v(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}(e,`string`);return v(t)==`symbol`?t:t+``}var S=function(){return e=function e(t){var n=t.utilities,r=t.options;(function(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)})(this,e),b(this,`utilities`,void 0),b(this,`options`,void 0),b(this,`candidateBoxElement`,void 0),b(this,`pageIndex`,0),b(this,`pageSize`,void 0),this.utilities=n,this.options=r,f.bindMethods(e,this),this.pageSize=this.utilities.getOptions().layoutCandidatesPageSize||5},t=[{key:`destroy`,value:function(){this.candidateBoxElement&&(this.candidateBoxElement.remove(),this.pageIndex=0)}},{key:`show`,value:function(e){var t=this,n=e.candidateValue,r=e.targetElement,i=e.onSelect;if(n&&n.length){var a=this.utilities.chunkArray(n.split(` `),this.pageSize);this.renderPage({candidateListPages:a,targetElement:r,pageIndex:this.pageIndex,nbPages:a.length,onItemSelected:function(e,n){i(e,n),t.destroy()}})}}},{key:`renderPage`,value:function(e){var t,n=this,r=e.candidateListPages,i=e.targetElement,a=e.pageIndex,o=e.nbPages,s=e.onItemSelected;(t=this.candidateBoxElement)==null||t.remove(),this.candidateBoxElement=document.createElement(`div`),this.candidateBoxElement.className=`hg-candidate-box`;var c=document.createElement(`ul`);c.className=`hg-candidate-box-list`,r[a].forEach((function(e){var t=document.createElement(`li`),r=function(){var e=new(n.options.useTouchEvents?TouchEvent:MouseEvent)(`click`);return Object.defineProperty(e,"target",{value:t}),e};t.className=`hg-candidate-box-list-item`,t.innerHTML=n.options.display?.[e]||e,n.options.useTouchEvents?t.ontouchstart=function(t){return s(e,t||r())}:t.onclick=function(){return s(e,arguments.length>0&&arguments[0]!==void 0?arguments[0]:r())},c.appendChild(t)}));var l=a>0,u=document.createElement(`div`);u.classList.add(`hg-candidate-box-prev`),l&&u.classList.add(`hg-candidate-box-btn-active`);var d=function(){l&&n.renderPage({candidateListPages:r,targetElement:i,pageIndex:a-1,nbPages:o,onItemSelected:s})};this.options.useTouchEvents?u.ontouchstart=d:u.onclick=d,this.candidateBoxElement.appendChild(u),this.candidateBoxElement.appendChild(c);var f=a<o-1,p=document.createElement(`div`);p.classList.add(`hg-candidate-box-next`),f&&p.classList.add(`hg-candidate-box-btn-active`);var m=function(){f&&n.renderPage({candidateListPages:r,targetElement:i,pageIndex:a+1,nbPages:o,onItemSelected:s})};this.options.useTouchEvents?p.ontouchstart=m:p.onclick=m,this.candidateBoxElement.appendChild(p),i.prepend(this.candidateBoxElement)}}],t&&y(e.prototype,t),n&&y(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();function C(e){return function(e){if(Array.isArray(e))return w(e)}(e)||function(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}(e)||function(e,t){if(e){if(typeof e==`string`)return w(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(e,t):void 0}}(e)||function(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
17
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function w(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function T(e){return T=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},T(e)}function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function D(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,k(r.key),r)}}function O(e,t,n){return(t=k(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k(e){var t=function(e,t){if(T(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(T(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}(e,`string`);return T(t)==`symbol`?t:t+``}var A=function(){return e=function e(t,n){var r=this;if(function(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}(this,e),O(this,`input`,void 0),O(this,`options`,void 0),O(this,`utilities`,void 0),O(this,`caretPosition`,void 0),O(this,`caretPositionEnd`,void 0),O(this,`keyboardDOM`,void 0),O(this,`keyboardPluginClasses`,void 0),O(this,`keyboardDOMClass`,void 0),O(this,`buttonElements`,void 0),O(this,`currentInstanceName`,void 0),O(this,`allKeyboardInstances`,void 0),O(this,`keyboardInstanceNames`,void 0),O(this,`isFirstKeyboardInstance`,void 0),O(this,`physicalKeyboard`,void 0),O(this,`modules`,void 0),O(this,`activeButtonClass`,void 0),O(this,`holdInteractionTimeout`,void 0),O(this,`holdTimeout`,void 0),O(this,`isMouseHold`,void 0),O(this,`initialized`,void 0),O(this,`candidateBox`,void 0),O(this,`keyboardRowsDOM`,void 0),O(this,`defaultName`,`default`),O(this,`activeInputElement`,null),O(this,`handleParams`,(function(e,t){var n,r,i;if(typeof e==`string`)n=e.split(`.`).join(``),r=document.querySelector(`.${n}`),i=t;else if(e instanceof HTMLDivElement){if(!e.className)throw console.warn(`Any DOM element passed as parameter must have a class.`),Error(`KEYBOARD_DOM_CLASS_ERROR`);n=e.className.split(` `)[0],r=e,i=t}else n=`simple-keyboard`,r=document.querySelector(`.${n}`),i=e;return{keyboardDOMClass:n,keyboardDOM:r,options:i}})),O(this,`getOptions`,(function(){return r.options})),O(this,`getCaretPosition`,(function(){return r.caretPosition})),O(this,`getCaretPositionEnd`,(function(){return r.caretPositionEnd})),O(this,`registerModule`,(function(e,t){r.modules[e]||(r.modules[e]={}),t(r.modules[e])})),O(this,`getKeyboardClassString`,(function(){var e=[...arguments];return[r.keyboardDOMClass].concat(e).filter((function(e){return!!e})).join(` `)})),typeof window<`u`){var i=this.handleParams(t,n),a=i.keyboardDOMClass,o=i.keyboardDOM,s=i.options,c=s===void 0?{}:s;this.utilities=new f({getOptions:this.getOptions,getCaretPosition:this.getCaretPosition,getCaretPositionEnd:this.getCaretPositionEnd,dispatch:this.dispatch}),this.caretPosition=null,this.caretPositionEnd=null,this.keyboardDOM=o,this.options=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?E(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({layoutName:`default`,theme:`hg-theme-default`,inputName:`default`,preventMouseDownDefault:!1,enableLayoutCandidates:!0,excludeFromLayout:{}},c),this.keyboardPluginClasses=``,f.bindMethods(e,this);var l=this.options.inputName,u=l===void 0?this.defaultName:l;if(this.input={},this.input[u]=``,this.keyboardDOMClass=a,this.buttonElements={},window.SimpleKeyboardInstances||(window.SimpleKeyboardInstances={}),this.currentInstanceName=this.utilities.camelCase(this.keyboardDOMClass),window.SimpleKeyboardInstances[this.currentInstanceName]=this,this.allKeyboardInstances=window.SimpleKeyboardInstances,this.keyboardInstanceNames=Object.keys(window.SimpleKeyboardInstances),this.isFirstKeyboardInstance=this.keyboardInstanceNames[0]===this.currentInstanceName,this.physicalKeyboard=new _({dispatch:this.dispatch,getOptions:this.getOptions}),this.candidateBox=this.options.enableLayoutCandidates?new S({utilities:this.utilities,options:this.options}):null,!this.keyboardDOM)throw console.warn(`".${a}" was not found in the DOM.`),Error(`KEYBOARD_DOM_ERROR`);this.render(),this.modules={},this.loadModules()}},t=[{key:`setCaretPosition`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;this.caretPosition=e,this.caretPositionEnd=t}},{key:`getInputCandidates`,value:function(e){var t=this,n=this.options,r=n.layoutCandidates,i=n.layoutCandidatesCaseSensitiveMatch;if(!r||T(r)!==`object`)return{};var a=Object.keys(r).filter((function(n){var r=e.substring(0,t.getCaretPositionEnd()||0)||e,a=RegExp(`${t.utilities.escapeRegex(n)}\$`,i?`g`:`gi`);return!!C(r.matchAll(a)).length}));if(a.length>1){var o=a.sort((function(e,t){return t.length-e.length}))[0];return{candidateKey:o,candidateValue:r[o]}}if(a.length){var s=a[0];return{candidateKey:s,candidateValue:r[s]}}return{}}},{key:`showCandidatesBox`,value:function(e,t,n){var r=this;this.candidateBox&&this.candidateBox.show({candidateValue:t,targetElement:n,onSelect:function(t,n){var i=r.options,a=i.layoutCandidatesCaseSensitiveMatch,o=i.disableCandidateNormalization,s=i.enableLayoutCandidatesKeyPress,c=t;o||(c=t.normalize(`NFD`)),typeof r.options.beforeInputUpdate==`function`&&r.options.beforeInputUpdate(r);var l=r.getInput(r.options.inputName,!0),u=r.getCaretPositionEnd()||0,d=l.substring(0,u||0)||l,f=RegExp(`${r.utilities.escapeRegex(e)}\$`,a?`g`:`gi`),p=d.replace(f,c),m=l.replace(d,p),h=p.length-d.length,g=(u||l.length)+h;g<0&&(g=0),r.setInput(m,r.options.inputName,!0),r.setCaretPosition(g),s&&typeof r.options.onKeyPress==`function`&&r.options.onKeyPress(t,n),typeof r.options.onChange==`function`&&r.options.onChange(r.getInput(r.options.inputName,!0),n),typeof r.options.onChangeAll==`function`&&r.options.onChangeAll(r.getAllInputs(),n)}})}},{key:`handleButtonClicked`,value:function(e,t){var n=this.options,r=n.inputName,i=r===void 0?this.defaultName:r,a=n.debug;if(e!==`{//}`){this.input[i]||(this.input[i]=``),typeof this.options.beforeInputUpdate==`function`&&this.options.beforeInputUpdate(this);var o=this.utilities.getUpdatedInput(e,this.input[i],this.caretPosition,this.caretPositionEnd);if(this.utilities.isStandardButton(e)&&this.activeInputElement&&this.input[i]&&this.input[i]===o&&this.caretPosition===0&&this.caretPositionEnd===o.length)return this.setInput(``,this.options.inputName,!0),this.setCaretPosition(0),this.activeInputElement.value=``,this.activeInputElement.setSelectionRange(0,0),void this.handleButtonClicked(e,t);if(typeof this.options.onKeyPress==`function`&&this.options.onKeyPress(e,t),this.input[i]!==o&&(!this.options.inputPattern||this.options.inputPattern&&this.inputPatternIsValid(o))){if(this.options.maxLength&&this.utilities.handleMaxLength(this.input,o))return;var s=this.utilities.getUpdatedInput(e,this.input[i],this.caretPosition,this.caretPositionEnd,!0);if(this.setInput(s,this.options.inputName,!0),a&&console.log(`Input changed:`,this.getAllInputs()),this.options.debug&&console.log(`Caret at: `,this.getCaretPosition(),this.getCaretPositionEnd(),`(${this.keyboardDOMClass})`,t?.type),this.options.syncInstanceInputs&&this.syncInstanceInputs(),typeof this.options.onChange==`function`&&this.options.onChange(this.getInput(this.options.inputName,!0),t),typeof this.options.onChangeAll==`function`&&this.options.onChangeAll(this.getAllInputs(),t),t!=null&&t.target&&this.options.enableLayoutCandidates){var c,l=this.getInputCandidates(o),u=l.candidateKey,d=l.candidateValue;u&&d?this.showCandidatesBox(u,d,this.keyboardDOM):(c=this.candidateBox)==null||c.destroy()}}this.caretPositionEnd&&this.caretPosition!==this.caretPositionEnd&&(this.setCaretPosition(this.caretPositionEnd,this.caretPositionEnd),this.activeInputElement&&this.activeInputElement.setSelectionRange(this.caretPositionEnd,this.caretPositionEnd),this.options.debug&&console.log(`Caret position aligned`,this.caretPosition)),a&&console.log(`Key pressed:`,e)}}},{key:`getMouseHold`,value:function(){return this.isMouseHold}},{key:`setMouseHold`,value:function(e){this.options.syncInstanceInputs?this.dispatch((function(t){t.isMouseHold=e})):this.isMouseHold=e}},{key:`handleButtonMouseDown`,value:function(e,t){var n=this;t&&(this.options.preventMouseDownDefault&&t.preventDefault(),this.options.stopMouseDownPropagation&&t.stopPropagation(),t.target.classList.add(this.activeButtonClass)),this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),this.holdTimeout&&clearTimeout(this.holdTimeout),this.setMouseHold(!0),this.options.disableButtonHold||(this.holdTimeout=window.setTimeout((function(){(n.getMouseHold()&&(!e.includes(`{`)&&!e.includes(`}`)||e===`{delete}`||e===`{backspace}`||e===`{bksp}`||e===`{space}`||e===`{tab}`)||e===`{arrowright}`||e===`{arrowleft}`||e===`{arrowup}`||e===`{arrowdown}`)&&(n.options.debug&&console.log(`Button held:`,e),n.handleButtonHold(e)),clearTimeout(n.holdTimeout)}),500))}},{key:`handleButtonMouseUp`,value:function(e,t){var n=this;t&&(this.options.preventMouseUpDefault&&t.preventDefault&&t.preventDefault(),this.options.stopMouseUpPropagation&&t.stopPropagation&&t.stopPropagation(),!(t.target===this.keyboardDOM||t.target&&this.keyboardDOM.contains(t.target)||this.candidateBox&&this.candidateBox.candidateBoxElement&&(t.target===this.candidateBox.candidateBoxElement||t.target&&this.candidateBox.candidateBoxElement.contains(t.target)))&&this.candidateBox&&this.candidateBox.destroy()),this.recurseButtons((function(e){e.classList.remove(n.activeButtonClass)})),this.setMouseHold(!1),this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),e&&typeof this.options.onKeyReleased==`function`&&this.options.onKeyReleased(e,t)}},{key:`handleKeyboardContainerMouseDown`,value:function(e){this.options.preventMouseDownDefault&&e.preventDefault()}},{key:`handleButtonHold`,value:function(e){var t=this;this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),this.holdInteractionTimeout=window.setTimeout((function(){t.getMouseHold()?(t.handleButtonClicked(e),t.handleButtonHold(e)):clearTimeout(t.holdInteractionTimeout)}),100)}},{key:`syncInstanceInputs`,value:function(){var e=this;this.dispatch((function(t){t.replaceInput(e.input),t.setCaretPosition(e.caretPosition,e.caretPositionEnd)}))}},{key:`clearInput`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.inputName||this.defaultName;this.input[e]=``,this.setCaretPosition(0),this.options.syncInstanceInputs&&this.syncInstanceInputs()}},{key:`getInput`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.inputName||this.defaultName,t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.options.syncInstanceInputs&&!t&&this.syncInstanceInputs(),this.options.rtl?``+this.input[e].replace(``,``).replace(``,``)+``:this.input[e]}},{key:`getAllInputs`,value:function(){var e=this,t={};return Object.keys(this.input).forEach((function(n){t[n]=e.getInput(n,!0)})),t}},{key:`setInput`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.inputName||this.defaultName,n=arguments.length>2?arguments[2]:void 0;this.input[t]=e,!n&&this.options.syncInstanceInputs&&this.syncInstanceInputs()}},{key:`replaceInput`,value:function(e){this.input=e}},{key:`setOptions`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=this.changedOptions(e);this.options=Object.assign(this.options,e),t.length&&(this.options.debug&&console.log(`changedOptions`,t),this.onSetOptions(t),this.render())}},{key:`changedOptions`,value:function(e){var t=this;return Object.keys(e).filter((function(n){return JSON.stringify(e[n])!==JSON.stringify(t.options[n])}))}},{key:`onSetOptions`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];e.includes(`layoutName`)&&this.candidateBox&&this.candidateBox.destroy(),(e.includes(`layoutCandidatesPageSize`)||e.includes(`layoutCandidates`))&&this.candidateBox&&(this.candidateBox.destroy(),this.candidateBox=new S({utilities:this.utilities,options:this.options}))}},{key:`resetRows`,value:function(){this.keyboardRowsDOM&&this.keyboardRowsDOM.remove(),this.keyboardDOM.className=this.keyboardDOMClass,this.keyboardDOM.setAttribute(`data-skInstance`,this.currentInstanceName),this.buttonElements={}}},{key:`dispatch`,value:function(e){if(!window.SimpleKeyboardInstances)throw console.warn(`SimpleKeyboardInstances is not defined. Dispatch cannot be called.`),Error(`INSTANCES_VAR_ERROR`);return Object.keys(window.SimpleKeyboardInstances).forEach((function(t){e(window.SimpleKeyboardInstances[t],t)}))}},{key:`addButtonTheme`,value:function(e,t){var n=this;t&&e&&(e.split(` `).forEach((function(r){t.split(` `).forEach((function(t){n.options.buttonTheme||(n.options.buttonTheme=[]);var i=!1;n.options.buttonTheme.map((function(e){if(e!=null&&e.class.split(` `).includes(t)){i=!0;var n=e.buttons.split(` `);n.includes(r)||(i=!0,n.push(r),e.buttons=n.join(` `))}return e})),i||n.options.buttonTheme.push({class:t,buttons:e})}))})),this.render())}},{key:`removeButtonTheme`,value:function(e,t){var n=this;if(!e&&!t)return this.options.buttonTheme=[],void this.render();e&&Array.isArray(this.options.buttonTheme)&&this.options.buttonTheme.length&&(e.split(` `).forEach((function(e){var r;(r=n.options)==null||(r=r.buttonTheme)==null||r.map((function(r,i){if(r&&t&&t.includes(r.class)||!t){var a,o=r?.buttons.split(` `).filter((function(t){return t!==e}));r&&o!=null&&o.length?r.buttons=o.join(` `):((a=n.options.buttonTheme)==null||a.splice(i,1),r=null)}return r}))})),this.render())}},{key:`getButtonElement`,value:function(e){var t,n=this.buttonElements[e];return n&&(t=n.length>1?n:n[0]),t}},{key:`inputPatternIsValid`,value:function(e){var t,n=this.options.inputPattern;if((t=n instanceof RegExp?n:n[this.options.inputName||this.defaultName])&&e){var r=t.test(e);return this.options.debug&&console.log(`inputPattern ("${t}"): ${r?`passed`:`did not pass!`}`),r}return!0}},{key:`setEventListeners`,value:function(){if(this.isFirstKeyboardInstance||!this.allKeyboardInstances){this.options.debug&&console.log(`Caret handling started (${this.keyboardDOMClass})`);var e=this.options.physicalKeyboardHighlightPreventDefault,t=e!==void 0&&e;document.addEventListener(`keyup`,this.handleKeyUp,t),document.addEventListener(`keydown`,this.handleKeyDown,t),document.addEventListener(`mouseup`,this.handleMouseUp),document.addEventListener(`touchend`,this.handleTouchEnd),this.options.updateCaretOnSelectionChange&&document.addEventListener(`selectionchange`,this.handleSelectionChange),document.addEventListener(`select`,this.handleSelect)}}},{key:`handleKeyUp`,value:function(e){this.caretEventHandler(e),this.options.physicalKeyboardHighlight&&this.physicalKeyboard.handleHighlightKeyUp(e)}},{key:`handleKeyDown`,value:function(e){this.options.physicalKeyboardHighlight&&this.physicalKeyboard.handleHighlightKeyDown(e)}},{key:`handleMouseUp`,value:function(e){this.caretEventHandler(e)}},{key:`handleTouchEnd`,value:function(e){this.caretEventHandler(e)}},{key:`handleSelect`,value:function(e){this.caretEventHandler(e)}},{key:`handleSelectionChange`,value:function(e){navigator.userAgent.includes(`Firefox`)||this.caretEventHandler(e)}},{key:`caretEventHandler`,value:function(e){var t,n=this;e.target.tagName&&(t=e.target.tagName.toLowerCase()),this.dispatch((function(r){var i=e.target===r.keyboardDOM||e.target&&r.keyboardDOM.contains(e.target);if(n.options.syncInstanceInputs&&Array.isArray(e.path)&&(i=e.path.some((function(e){var t;return e==null||(t=e.hasAttribute)==null?void 0:t.call(e,`data-skInstance`)}))),(t===`textarea`||t===`input`&&[`text`,`search`,`url`,`tel`,`password`].includes(e.target.type))&&!r.options.disableCaretPositioning){var a=e.target.selectionStart,o=e.target.selectionEnd;r.options.rtl&&(a=r.utilities.getRtlOffset(a,r.getInput()),o=r.utilities.getRtlOffset(o,r.getInput())),r.setCaretPosition(a,o),r.activeInputElement=e.target,r.options.debug&&console.log(`Caret at: `,r.getCaretPosition(),r.getCaretPositionEnd(),e&&e.target.tagName.toLowerCase(),`(${r.keyboardDOMClass})`,e?.type)}else !r.options.disableCaretPositioning&&i||e?.type===`selectionchange`||(r.setCaretPosition(null),r.activeInputElement=null,r.options.debug&&console.log(`Caret position reset due to "${e?.type}" event`,e))}))}},{key:`recurseButtons`,value:function(e){var t=this;e&&Object.keys(this.buttonElements).forEach((function(n){return t.buttonElements[n].forEach(e)}))}},{key:`destroy`,value:function(){this.options.debug&&console.log(`Destroying simple-keyboard instance: ${this.currentInstanceName}`);var e=this.options.physicalKeyboardHighlightPreventDefault,t=e!==void 0&&e;document.removeEventListener(`keyup`,this.handleKeyUp,t),document.removeEventListener(`keydown`,this.handleKeyDown,t),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`touchend`,this.handleTouchEnd),document.removeEventListener(`select`,this.handleSelect),this.options.updateCaretOnSelectionChange&&document.removeEventListener(`selectionchange`,this.handleSelectionChange),document.onpointerup=null,document.ontouchend=null,document.ontouchcancel=null,document.onmouseup=null,this.recurseButtons((function(e){e&&=(e.onpointerdown=null,e.onpointerup=null,e.onpointercancel=null,e.ontouchstart=null,e.ontouchend=null,e.ontouchcancel=null,e.onclick=null,e.onmousedown=null,e.onmouseup=null,e.remove(),null)})),this.keyboardDOM.onpointerdown=null,this.keyboardDOM.ontouchstart=null,this.keyboardDOM.onmousedown=null,this.resetRows(),this.candidateBox&&=(this.candidateBox.destroy(),null),this.activeInputElement=null,this.keyboardDOM.removeAttribute(`data-skInstance`),this.keyboardDOM.innerHTML=``,window.SimpleKeyboardInstances[this.currentInstanceName]=null,delete window.SimpleKeyboardInstances[this.currentInstanceName],this.initialized=!1}},{key:`getButtonThemeClasses`,value:function(e){var t=this.options.buttonTheme,n=[];return Array.isArray(t)&&t.forEach((function(t){if(t&&t.class&&typeof t.class==`string`&&t.buttons&&typeof t.buttons==`string`){var r=t.class.split(` `);t.buttons.split(` `).includes(e)&&(n=[].concat(C(n),C(r)))}else console.warn(`Incorrect "buttonTheme". Please check the documentation.`,t)})),n}},{key:`setDOMButtonAttributes`,value:function(e,t){var n=this.options.buttonAttributes;Array.isArray(n)&&n.forEach((function(n){n.attribute&&typeof n.attribute==`string`&&n.value&&typeof n.value==`string`?n.buttons&&typeof n.buttons==`string`?n.buttons.split(` `).includes(e)&&t(n.attribute,n.value):t(n.attribute,n.value):console.warn(`Incorrect "buttonAttributes". Please check the documentation.`,n)}))}},{key:`onTouchDeviceDetected`,value:function(){this.processAutoTouchEvents(),this.disableContextualWindow()}},{key:`disableContextualWindow`,value:function(){window.oncontextmenu=function(e){var t;if((t=e.target.classList)!=null&&t.contains(`hg-button`))return e.preventDefault(),e.stopPropagation(),!1}}},{key:`processAutoTouchEvents`,value:function(){this.options.autoUseTouchEvents&&(this.options.useTouchEvents=!0,this.options.debug&&console.log(`autoUseTouchEvents: Touch device detected, useTouchEvents enabled.`))}},{key:`onInit`,value:function(){this.options.debug&&console.log(`${this.keyboardDOMClass} Initialized`),this.setEventListeners(),typeof this.options.onInit==`function`&&this.options.onInit(this)}},{key:`beforeFirstRender`,value:function(){this.utilities.isTouchDevice()&&this.onTouchDeviceDetected(),typeof this.options.beforeFirstRender==`function`&&this.options.beforeFirstRender(this),this.isFirstKeyboardInstance&&this.utilities.pointerEventsSupported()&&!this.options.useTouchEvents&&!this.options.useMouseEvents&&this.options.debug&&console.log(`Using PointerEvents as it is supported by this browser`),this.options.useTouchEvents&&this.options.debug&&console.log(`useTouchEvents has been enabled. Only touch events will be used.`)}},{key:`beforeRender`,value:function(){typeof this.options.beforeRender==`function`&&this.options.beforeRender(this)}},{key:`onRender`,value:function(){typeof this.options.onRender==`function`&&this.options.onRender(this)}},{key:`onModulesLoaded`,value:function(){typeof this.options.onModulesLoaded==`function`&&this.options.onModulesLoaded(this)}},{key:`loadModules`,value:function(){var e=this;Array.isArray(this.options.modules)&&(this.options.modules.forEach((function(t){var n=e.utilities.isConstructor(t)?new t(e):t(e);n.init&&n.init(e)})),this.keyboardPluginClasses=`modules-loaded`,this.render(),this.onModulesLoaded())}},{key:`getModuleProp`,value:function(e,t){return!!this.modules[e]&&this.modules[e][t]}},{key:`getModulesList`,value:function(){return Object.keys(this.modules)}},{key:`parseRowDOMContainers`,value:function(e,t,n,r){var i=this,a=Array.from(e.children),o=0;return a.length&&n.forEach((function(n,s){var c=r[s];if(!(c&&c>n))return!1;var l=n-o,u=c-o,d=document.createElement(`div`);d.className+=`hg-button-container`;var f=`${i.options.layoutName}-r${t}c${s}`;d.setAttribute(`data-skUID`,f);var p=a.splice(l,u-l+1);o+=u-l,p.forEach((function(e){return d.appendChild(e)})),a.splice(l,0,d),e.innerHTML=``,a.forEach((function(t){return e.appendChild(t)})),i.options.debug&&console.log(`rowDOMContainer`,p,l,u,o+1)})),e}},{key:`render`,value:function(){var e=this;this.resetRows(),this.initialized||this.beforeFirstRender(),this.beforeRender();var t=`hg-layout-${this.options.layoutName}`,n=this.options.layout||{default:["` 1 2 3 4 5 6 7 8 9 0 - = {bksp}",`{tab} q w e r t y u i o p [ ] \\`,`{lock} a s d f g h j k l ; ' {enter}`,`{shift} z x c v b n m , . / {shift}`,`.com @ {space}`],shift:[`~ ! @ # $ % ^ & * ( ) _ + {bksp}`,`{tab} Q W E R T Y U I O P { } |`,`{lock} A S D F G H J K L : " {enter}`,`{shift} Z X C V B N M < > ? {shift}`,`.com @ {space}`]},r=this.options.useTouchEvents||!1,i=r?`hg-touch-events`:``,a=this.options.useMouseEvents||!1,o=this.options.disableRowButtonContainers;this.keyboardDOM.className=this.getKeyboardClassString(this.options.theme,t,this.keyboardPluginClasses,i),this.keyboardDOM.setAttribute(`data-skInstance`,this.currentInstanceName),this.keyboardRowsDOM=document.createElement(`div`),this.keyboardRowsDOM.className=`hg-rows`,n[this.options.layoutName||this.defaultName].forEach((function(t,n){var i=t.split(` `);e.options.excludeFromLayout&&e.options.excludeFromLayout[e.options.layoutName||e.defaultName]&&(i=i.filter((function(t){return e.options.excludeFromLayout&&!e.options.excludeFromLayout[e.options.layoutName||e.defaultName].includes(t)})));var s=document.createElement(`div`);s.className+=`hg-row`;var c=[],l=[];i.forEach((function(t,i){var u,d=!o&&typeof t==`string`&&t.length>1&&t.indexOf(`[`)===0,f=!o&&typeof t==`string`&&t.length>1&&t.indexOf(`]`)===t.length-1;d&&(c.push(i),t=t.replace(/\[/g,``)),f&&(l.push(i),t=t.replace(/\]/g,``));var p=e.utilities.getButtonClass(t),m=e.utilities.getButtonDisplayName(t,e.options.display,e.options.mergeDisplay),h=e.options.useButtonTag?`button`:`div`,g=document.createElement(h);g.className+=`hg-button ${p}`,(u=g.classList).add.apply(u,C(e.getButtonThemeClasses(t))),e.setDOMButtonAttributes(t,(function(e,t){g.setAttribute(e,t)})),e.activeButtonClass=`hg-activeButton`,!e.utilities.pointerEventsSupported()||r||a?r?(g.ontouchstart=function(n){e.handleButtonClicked(t,n),e.handleButtonMouseDown(t,n)},g.ontouchend=function(n){e.handleButtonMouseUp(t,n)},g.ontouchcancel=function(n){e.handleButtonMouseUp(t,n)}):(g.onclick=function(n){e.setMouseHold(!1),typeof e.options.onKeyReleased==`function`||e.options.useMouseEvents&&e.options.clickOnMouseDown||e.handleButtonClicked(t,n)},g.onmousedown=function(n){(typeof e.options.onKeyReleased==`function`||e.options.useMouseEvents&&e.options.clickOnMouseDown)&&!e.isMouseHold&&e.handleButtonClicked(t,n),e.handleButtonMouseDown(t,n)},g.onmouseup=function(n){e.handleButtonMouseUp(t,n)}):(g.onpointerdown=function(n){e.handleButtonClicked(t,n),e.handleButtonMouseDown(t,n)},g.onpointerup=function(n){e.handleButtonMouseUp(t,n)},g.onpointercancel=function(n){e.handleButtonMouseUp(t,n)}),g.setAttribute(`data-skBtn`,t);var _=`${e.options.layoutName}-r${n}b${i}`;g.setAttribute(`data-skBtnUID`,_);var v=document.createElement(`span`);v.innerHTML=m,g.appendChild(v),e.buttonElements[t]||(e.buttonElements[t]=[]),e.buttonElements[t].push(g),s.appendChild(g)})),s=e.parseRowDOMContainers(s,n,c,l),e.keyboardRowsDOM.appendChild(s)})),this.keyboardDOM.appendChild(this.keyboardRowsDOM),this.onRender(),this.initialized||(this.initialized=!0,!this.utilities.pointerEventsSupported()||r||a?r?(document.ontouchend=function(t){return e.handleButtonMouseUp(void 0,t)},document.ontouchcancel=function(t){return e.handleButtonMouseUp(void 0,t)},this.keyboardDOM.ontouchstart=function(t){return e.handleKeyboardContainerMouseDown(t)}):r||(document.onmouseup=function(t){return e.handleButtonMouseUp(void 0,t)},this.keyboardDOM.onmousedown=function(t){return e.handleKeyboardContainerMouseDown(t)}):(document.onpointerup=function(t){return e.handleButtonMouseUp(void 0,t)},this.keyboardDOM.onpointerdown=function(t){return e.handleKeyboardContainerMouseDown(t)}),this.onInit())}}],t&&D(e.prototype,t),n&&D(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}(),j=A;return r}()},442:function(t){"use strict";t.exports=e}},n={};function r(e){var i=n[e];if(i!==void 0)return i.exports;var a=n[e]={exports:{}};return t[e].call(a.exports,a,a.exports,r),a.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return function(){"use strict";r.r(i),r.d(i,{KeyboardReact:function(){return u},default:function(){return d}}),r(981);var e=r(442),t=r(548),n=r.n(t);function a(e){return a=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},a(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?o(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t,n){return(t=function(e){var t=function(e,t){if(a(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(a(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}(e,`string`);return a(t)==`symbol`?t:t+``}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var l=function(e){return s(s({},e),{},{keyboardRef:null})},u=function(t){var r=t.baseClass||`react-simple-keyboard`,i=e.useRef(null),a=e.useRef(null),o=e.useRef(null),c=e.useRef(t);return e.useEffect((function(){return function(){o.current&&o.current.destroy(),i.current=!1}}),[]),e.useEffect((function(){var e=function(e){return s(s({},e),{},{theme:`simple-keyboard ${e.theme||`hg-theme-default`}`})}(t);if(!i.current){i.current=!0,e.debug&&console.log(`ReactSimpleKeyboard: Init`);var u=a.current,d=`.${r}`;o.current=new(n())(u||d,e),e.keyboardRef&&e.keyboardRef(o.current)}var f=function(e,t){var n=l(t),r=l(e);return Object.keys(n).filter((function(e){return n[e]!==r[e]}))}(c.current,e);if(f.length){var p=o.current;c.current=e,p?.setOptions(e),e.debug&&console.log(`ReactSimpleKeyboard - setOptions called due to updated props:`,f)}}),[i,r,c,t]),e.createElement(`div`,{className:r,ref:a})},d=u}(),i}()}))}))(),1);function Mo({onChange:e,keyboardRef:t,layout:r,theme:i}){let[a,o]=(0,h.useState)(`default`);return(0,n.jsx)(jo.default,{keyboardRef:e=>t.current=e,layoutName:a,layout:r,theme:i,onChange:e,onKeyPress:e=>{(e===`{shift}`||e===`{lock}`)&&o(a===`default`?`shift`:`default`)},preventMouseDownDefault:!0})}function No(){return{subscribe:(e,t)=>{document.addEventListener(e,t)},unsubscribe:(e,t)=>{document.removeEventListener(e,t)},publish:(e,t)=>{let n=new CustomEvent(e,{detail:t});document.dispatchEvent(n)}}}function Po(){let{subscribe:e,unsubscribe:t,publish:n}=No();return{initialize:(t,n)=>{e(`openKeyboard`,t),e(`closeKeyboard`,n)},terminate:(e,n)=>{t(`openKeyboard`,e),t(`closeKeyboard`,n)},open:e=>{n(`openKeyboard`,{inputId:e.target.id,inputValue:e.target.value})},close:()=>{n(`closeKeyboard`)}}}var Fo=`keyboard-custom-overlap-id`;function Io({enabled:e}){let[t,r]=(0,h.useState)(!1),i=(0,h.useRef)(null),a=(0,h.useRef)(null),o=(0,h.useRef)(null),[s,c]=(0,h.useState)(),[l,u]=(0,h.useState)(0),{initialize:d,terminate:f}=Po(),p=e=>{a.current=document.getElementById(e.detail.inputId),i.current?.setInput(e.detail.inputValue),a.current?.addEventListener(`input`,e=>{let t=e.target;i.current?.setInput(t?.value)}),u(y()),r(!0)},m=()=>{u(0),r(!1)};(0,h.useEffect)(()=>(d(p,m),()=>{f(p,m)}),[t]);let g=e=>{if(a&&a.current){_(a.current,e);let t=i.current?.getCaretPosition();t&&a.current?.setSelectionRange(t,t)}},_=(e,t)=>{(Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,`value`)?.set)?.call(e,t);let n=new Event(`input`,{bubbles:!0});e.dispatchEvent(n)},v=()=>{if(!s){let e=o.current?.getBoundingClientRect();return e&&e.x&&!s&&c(e),e}return s},y=()=>{let e=document.querySelectorAll(`#keyboard-custom-overlap-id`),t=v(),n=[...e].map(e=>e.getBoundingClientRect()),r=a.current?.getBoundingClientRect();n.push(r),n.sort((e,t)=>e.bottom>t.bottom?-1:1);let i=0;return n.every(e=>{if(t&&t.top<e.bottom)return i=e.bottom-t.top+8,!1}),i};return e?(0,n.jsx)(`div`,{className:`relative`,style:{height:l},children:(0,n.jsx)(`div`,{ref:o,className:`mobile:hidden absolute bottom-0 left-2 right-2 z-50 mx-auto w-[98vw] max-w-[1200px] ${!t&&s&&`hidden`} ${!t&&!s&&`pointer-events-none opacity-0`}`,children:(0,n.jsx)(Mo,{keyboardRef:i,onChange:g})})}):(0,n.jsx)(n.Fragment,{})}var W=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,Lo=globalThis,Ro=`10.53.1`;function zo(){return Bo(Lo),Lo}function Bo(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||`10.53.1`,t[Ro]=t[`10.53.1`]||{}}function Vo(e,t,n=Lo){let r=n.__SENTRY__=n.__SENTRY__||{},i=r[Ro]=r[`10.53.1`]||{};return i[e]||(i[e]=t())}var Ho=[`debug`,`info`,`warn`,`error`,`log`,`assert`,`trace`],Uo=`Sentry Logger `,Wo={};function Go(e){if(!(`console`in Lo))return e();let t=Lo.console,n={},r=Object.keys(Wo);r.forEach(e=>{let r=Wo[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}function Ko(){$o().enabled=!0}function qo(){$o().enabled=!1}function Jo(){return $o().enabled}function Yo(...e){Qo(`log`,...e)}function Xo(...e){Qo(`warn`,...e)}function Zo(...e){Qo(`error`,...e)}function Qo(e,...t){W&&Jo()&&Go(()=>{Lo.console[e](`${Uo}[${e}]:`,...t)})}function $o(){return W?Vo(`loggerSettings`,()=>({enabled:!1})):{enabled:!1}}var G={enable:Ko,disable:qo,isEnabled:Jo,log:Yo,warn:Xo,error:Zo},es=50,ts=/\(error: (.*)\)/,ns=/captureMessage|captureException/;function rs(...e){let t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0,r=0)=>{let i=[],a=e.split(`
|
|
18
|
+
`);for(let e=n;e<a.length;e++){let n=a[e];n.length>1024&&(n=n.slice(0,1024));let o=ts.test(n)?n.replace(ts,`$1`):n;if(!o.includes(`Error: `)){for(let e of t){let t=e(o);if(t){i.push(t);break}}if(i.length>=es+r)break}}return is(i.slice(r))}}function is(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(as(t).function||``)&&t.pop(),t.reverse(),ns.test(as(t).function||``)&&(t.pop(),ns.test(as(t).function||``)&&t.pop()),t.slice(0,es).map(e=>({...e,filename:e.filename||as(t).filename,function:e.function||`?`}))}function as(e){return e[e.length-1]||{}}var os=`<anonymous>`;function ss(e){try{return!e||typeof e!=`function`?os:e.name||os}catch{return os}}function cs(e){let t=e.exception;if(t){let e=[];try{return t.values.forEach(t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)}),e}catch{return}}}function ls(e){return`__v_isVNode`in e&&e.__v_isVNode?`[VueVNode]`:`[VueViewModel]`}var us={},ds={};function fs(e,t){return us[e]=us[e]||[],us[e].push(t),()=>{let n=us[e];if(n){let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}function ps(e,t){if(!ds[e]){ds[e]=!0;try{t()}catch(t){W&&G.error(`Error while instrumenting ${e}`,t)}}}function ms(e,t){let n=e&&us[e];if(n)for(let r of n)try{r(t)}catch(t){W&&G.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${ss(r)}\nError:`,t)}}var hs=null;function gs(e){let t=`error`;fs(t,e),ps(t,_s)}function _s(){hs=Lo.onerror,Lo.onerror=function(e,t,n,r,i){return ms(`error`,{column:r,error:i,line:n,msg:e,url:t}),hs?hs.apply(this,arguments):!1},Lo.onerror.__SENTRY_INSTRUMENTED__=!0}var vs=null;function ys(e){let t=`unhandledrejection`;fs(t,e),ps(t,bs)}function bs(){vs=Lo.onunhandledrejection,Lo.onunhandledrejection=function(e){return ms(`unhandledrejection`,e),vs?vs.apply(this,arguments):!0},Lo.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var xs=Object.prototype.toString;function Ss(e){switch(xs.call(e)){case`[object Error]`:case`[object Exception]`:case`[object DOMException]`:case`[object WebAssembly.Exception]`:return!0;default:return Is(e,Error)}}function Cs(e,t){return xs.call(e)===`[object ${t}]`}function ws(e){return Cs(e,`ErrorEvent`)}function Ts(e){return Cs(e,`DOMError`)}function Es(e){return Cs(e,`DOMException`)}function Ds(e){return Cs(e,`String`)}function Os(e){return typeof e==`object`&&!!e&&`__sentry_template_string__`in e&&`__sentry_template_values__`in e}function ks(e){return e===null||Os(e)||typeof e!=`object`&&typeof e!=`function`}function As(e){return Cs(e,`Object`)}function js(e){return typeof Event<`u`&&Is(e,Event)}function Ms(e){return typeof Element<`u`&&Is(e,Element)}function Ns(e){return Cs(e,`RegExp`)}function Ps(e){return!!(e?.then&&typeof e.then==`function`)}function Fs(e){return As(e)&&`nativeEvent`in e&&`preventDefault`in e&&`stopPropagation`in e}function Is(e,t){try{return e instanceof t}catch{return!1}}function Ls(e){return!!(typeof e==`object`&&e&&(e.__isVue||e._isVue||e.__v_isVNode))}function Rs(e){return typeof Request<`u`&&Is(e,Request)}var zs=Lo,Bs=80;function Vs(e,t={}){if(!e)return`<unknown>`;try{let n=e,r=[],i=0,a=0,o,s=Array.isArray(t)?t:t.keyAttrs,c=!Array.isArray(t)&&t.maxStringLength||Bs;for(;n&&i++<5&&(o=Hs(n,s),!(o===`html`||i>1&&a+r.length*3+o.length>=c));)r.push(o),a+=o.length,n=n.parentNode;return r.reverse().join(` > `)}catch{return`<unknown>`}}function Hs(e,t){let n=e,r=[];if(!n?.tagName)return``;if(zs.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());let i=t?.length?t.filter(e=>n.getAttribute(e)).map(e=>[e,n.getAttribute(e)]):null;if(i?.length)i.forEach(e=>{r.push(`[${e[0]}="${e[1]}"]`)});else{n.id&&r.push(`#${n.id}`);let e=n.className;if(e&&Ds(e)){let t=e.split(/\s+/);for(let e of t)r.push(`.${e}`)}}for(let e of[`aria-label`,`type`,`name`,`title`,`alt`]){let t=n.getAttribute(e);t&&r.push(`[${e}="${t}"]`)}return r.join(``)}function Us(){try{return zs.document.location.href}catch{return``}}function Ws(e,t=5){if(!zs.HTMLElement)return null;let n=e;for(let e=0;e<t;e++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}function Gs(e,t,n){if(!(t in e))return;let r=e[t];if(typeof r!=`function`)return;let i=n(r);typeof i==`function`&&qs(i,r);try{e[t]=i}catch{W&&G.log(`Failed to replace method "${t}" in object`,e)}}function Ks(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{W&&G.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function qs(e,t){try{e.prototype=t.prototype=t.prototype||{},Ks(e,`__sentry_original__`,t)}catch{}}function Js(e){return e.__sentry_original__}function Ys(e){if(Ss(e))return{message:e.message,name:e.name,stack:e.stack,...Zs(e)};if(js(e)){let t={type:e.type,target:Xs(e.target),currentTarget:Xs(e.currentTarget),...Zs(e)};return typeof CustomEvent<`u`&&Is(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function Xs(e){try{return Ms(e)?Vs(e):Object.prototype.toString.call(e)}catch{return`<unknown>`}}function Zs(e){return typeof e==`object`&&e?Object.fromEntries(Object.entries(e)):{}}function Qs(e){let t=Object.keys(Ys(e));return t.sort(),t[0]?t.join(`, `):`[object has no keys]`}var $s;function ec(e){if($s!==void 0)return $s?$s(e):e();let t=Symbol.for(`__SENTRY_SAFE_RANDOM_ID_WRAPPER__`),n=Lo;return t in n&&typeof n[t]==`function`?($s=n[t],$s(e)):($s=null,e())}function tc(){return ec(()=>Math.random())}function nc(){return ec(()=>Date.now())}function rc(e,t=0){return typeof e!=`string`||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function ic(e,t){if(!Array.isArray(e))return``;let n=[];for(let t=0;t<e.length;t++){let r=e[t];try{Ls(r)?n.push(ls(r)):n.push(String(r))}catch{n.push(`[value cannot be serialized]`)}}return n.join(t)}function ac(e,t,n=!1){return Ds(e)?Ns(t)?t.test(e):Ds(t)?n?e===t:e.includes(t):typeof t==`function`?t(e):!1:!1}function oc(e,t=[],n=!1){for(let r of t)if(ac(e,r,n))return!0;return!1}function sc(){let e=Lo;return e.crypto||e.msCrypto}var cc;function lc(){return tc()*16}function uc(e=sc()){try{if(e?.randomUUID)return ec(()=>e.randomUUID()).replace(/-/g,``)}catch{}return cc||=`10000000100040008000100000000000`,cc.replace(/[018]/g,e=>(e^(lc()&15)>>e/4).toString(16))}function dc(e){return e.exception?.values?.[0]}function fc(e){let{message:t,event_id:n}=e;if(t)return t;let r=dc(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||`<unknown>`:n||`<unknown>`}function pc(e,t,n){let r=e.exception=e.exception||{},i=r.values=r.values||[],a=i[0]=i[0]||{};a.value||=t||``,a.type||=n||`Error`}function mc(e,t){let n=dc(e);if(!n)return;let r={type:`generic`,handled:!0},i=n.mechanism;if(n.mechanism={...r,...i,...t},t&&`data`in t){let e={...i?.data,...t.data};n.mechanism.data=e}}function hc(e){if(gc(e))return!0;try{Ks(e,`__sentry_captured__`,!0)}catch{}return!1}function gc(e){try{return e.__sentry_captured__}catch{}}var _c=1e3;function vc(){return nc()/_c}function yc(){let{performance:e}=Lo;if(!e?.now||!e.timeOrigin)return vc;let t=e.timeOrigin;return()=>(t+ec(()=>e.now()))/_c}var bc;function xc(){return(bc??=yc())()}var Sc=null;function Cc(){let{performance:e}=Lo;if(!e?.now)return;let t=3e5,n=ec(()=>e.now()),r=nc(),i=e.timeOrigin;if(typeof i==`number`&&Math.abs(i+n-r)<t)return i;let a=e.timing?.navigationStart;return typeof a==`number`&&Math.abs(a+n-r)<t?a:r-n}function wc(){return Sc===null&&(Sc=Cc()),Sc}function Tc(e){let t=xc(),n={sid:uc(),init:!0,timestamp:t,started:t,duration:0,status:`ok`,errors:0,ignoreDuration:!1,toJSON:()=>Oc(n)};return e&&Ec(n,e),n}function Ec(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||xc(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:uc()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started==`number`&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration==`number`)e.duration=t.duration;else{let t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors==`number`&&(e.errors=t.errors),t.status&&(e.status=t.status)}function Dc(e,t){let n={};t?n={status:t}:e.status===`ok`&&(n={status:`exited`}),Ec(e,n)}function Oc(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did==`number`||typeof e.did==`string`?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function kc(e,t,n=2){if(!t||typeof t!=`object`||n<=0)return t;if(e&&Object.keys(t).length===0)return e;let r={...e};for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=kc(r[e],t[e],n-1));return r}function Ac(){return uc()}function jc(){return uc().substring(16)}var Mc=`_sentrySpan`;function Nc(e,t){t?Ks(e,Mc,t):delete e[Mc]}function Pc(e){return e[Mc]}var Fc=100,Ic=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Ac(),sampleRand:tc()}}clone(){let t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,Nc(t,Pc(this)),t}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Ec(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return t===null?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let n=typeof t==`function`?t(this):t,{tags:r,attributes:i,extra:a,user:o,contexts:s,level:c,fingerprint:l=[],propagationContext:u,conversationId:d}=(n instanceof e?n.getScopeData():As(n)?t:void 0)||{};return this._tags={...this._tags,...r},this._attributes={...this._attributes,...i},this._extra={...this._extra,...a},this._contexts={...this._contexts,...s},o&&Object.keys(o).length&&(this._user=o),c&&(this._level=c),l.length&&(this._fingerprint=l),u&&(this._propagationContext=u),d&&(this._conversationId=d),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,Nc(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Ac(),sampleRand:tc()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){let n=typeof t==`number`?t:Fc;if(n<=0)return this;let r={timestamp:vc(),...e,message:e.message?rc(e.message,2048):e.message};return this._breadcrumbs.push(r),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client?.recordDroppedEvent(`buffer_overflow`,`log_item`)),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Pc(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=kc(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){let n=t?.event_id||uc();if(!this._client)return W&&G.warn(`No client configured on scope - will not capture exception!`),n;let r=Error(`Sentry syntheticException`);return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){let r=n?.event_id||uc();if(!this._client)return W&&G.warn(`No client configured on scope - will not capture message!`),r;let i=n?.syntheticException??Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureEvent(e,t){let n=e.event_id||t?.event_id||uc();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(W&&G.warn(`No client configured on scope - will not capture event!`),n)}_notifyScopeListeners(){this._notifyingListeners||=(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),!1)}};function Lc(){return Vo(`defaultCurrentScope`,()=>new Ic)}function Rc(){return Vo(`defaultIsolationScope`,()=>new Ic)}var zc=e=>e instanceof Promise&&!e[Bc],Bc=Symbol(`chained PromiseLike`),Vc=(e,t,n)=>{let r=e.then(e=>(t(e),e),e=>{throw n(e),e});return zc(r)&&zc(e)?r:Hc(e,r)},Hc=(e,t)=>{if(!t)return e;let n=!1;for(let r in e){if(r in t)continue;n=!0;let i=e[r];typeof i==`function`?Object.defineProperty(t,r,{value:(...t)=>i.apply(e,t),enumerable:!0,configurable:!0,writable:!0}):t[r]=i}return n&&Object.assign(t,{[Bc]:!0}),t},Uc=class{constructor(e,t){let n;n=e||new Ic;let r;r=t||new Ic,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){let t=this._pushScope(),n;try{n=e(t)}catch(e){throw this._popScope(),e}return Ps(n)?Vc(n,()=>this._popScope(),()=>this._popScope()):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function Wc(){let e=Bo(zo());return e.stack=e.stack||new Uc(Lc(),Rc())}function Gc(e){return Wc().withScope(e)}function Kc(e,t){let n=Wc();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function qc(e){return Wc().withScope(()=>e(Wc().getIsolationScope()))}function Jc(){return{withIsolationScope:qc,withScope:Gc,withSetScope:Kc,withSetIsolationScope:(e,t)=>qc(t),getCurrentScope:()=>Wc().getScope(),getIsolationScope:()=>Wc().getIsolationScope()}}function Yc(e){let t=Bo(e);return t.acs?t.acs:Jc()}function Xc(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.keys(e).includes(`value`)}function Zc(e,t){let{value:n,unit:r}=Xc(e)?e:{value:e,unit:void 0},i=$c(n),a=r&&typeof r==`string`?{unit:r}:{};if(i)return{...i,...a};if(!t||t===`skip-undefined`&&n===void 0)return;let o=``;try{o=JSON.stringify(n)??``}catch{}return{value:o,type:`string`,...a}}function Qc(e,t=!1){let n={};for(let[r,i]of Object.entries(e??{})){let e=Zc(i,t);e&&(n[r]=e)}return n}function $c(e){let t=typeof e==`string`?`string`:typeof e==`boolean`?`boolean`:typeof e==`number`&&!Number.isNaN(e)?Number.isInteger(e)?`integer`:`double`:null;if(t)return{value:e,type:t}}var el;function tl(){return el?.()}function nl(){return el!==void 0}function rl(){return Yc(zo()).getCurrentScope()}function il(){return Yc(zo()).getIsolationScope()}function al(){return Vo(`globalScope`,()=>new Ic)}function ol(...e){let t=Yc(zo());if(e.length===2){let[n,r]=e;return n?t.withSetScope(n,r):t.withScope(r)}return t.withScope(e[0])}function sl(){return rl().getClient()}function cl(e){let t=tl();if(t)return{trace_id:t.traceId,span_id:t.spanId};let{traceId:n,parentSpanId:r,propagationSpanId:i}=e.getPropagationContext(),a={trace_id:n,span_id:i||jc()};return r&&(a.parent_span_id=r),a}var ll=`sentry.source`,ul=`sentry.sample_rate`,dl=`sentry.previous_trace_sample_rate`,fl=`sentry.op`,pl=`sentry.origin`,ml=`sentry.idle_span_finish_reason`,hl=`sentry.measurement_unit`,gl=`sentry.measurement_value`,_l=`sentry.custom_span_name`,vl=`sentry.profile_id`,yl=`sentry.exclusive_time`,bl=`sentry.link.type`,xl=`gen_ai.conversation.id`;function Sl(e){if(e<400&&e>=100)return{code:1};if(e>=400&&e<500)switch(e){case 401:return{code:2,message:`unauthenticated`};case 403:return{code:2,message:`permission_denied`};case 404:return{code:2,message:`not_found`};case 409:return{code:2,message:`already_exists`};case 413:return{code:2,message:`failed_precondition`};case 429:return{code:2,message:`resource_exhausted`};case 499:return{code:2,message:`cancelled`};default:return{code:2,message:`invalid_argument`}}if(e>=500&&e<600)switch(e){case 501:return{code:2,message:`unimplemented`};case 503:return{code:2,message:`unavailable`};case 504:return{code:2,message:`deadline_exceeded`};default:return{code:2,message:`internal_error`}}return{code:2,message:`internal_error`}}function Cl(e,t){e.setAttribute(`http.response.status_code`,t);let n=Sl(t);n.message!==`unknown_error`&&e.setStatus(n)}function wl(e){try{let t=Lo.WeakRef;if(typeof t==`function`)return new t(e)}catch{}return e}function Tl(e){if(e){if(typeof e==`object`&&`deref`in e&&typeof e.deref==`function`)try{return e.deref()}catch{return}return e}}var El=`_sentryScope`,Dl=`_sentryIsolationScope`;function Ol(e,t,n){e&&(Ks(e,Dl,wl(n)),Ks(e,El,t))}function kl(e){let t=e;return{scope:t[El],isolationScope:Tl(t[Dl])}}var Al=`sentry-`;function jl(e){let t=Nl(e);if(!t)return;let n=Object.entries(t).reduce((e,[t,n])=>{if(t.startsWith(`sentry-`)){let r=t.slice(7);e[r]=n}return e},{});if(Object.keys(n).length>0)return n}function Ml(e){if(e)return Fl(Object.entries(e).reduce((e,[t,n])=>(n&&(e[`${Al}${t}`]=n),e),{}))}function Nl(e){if(!(!e||!Ds(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((e,t)=>{let n=Pl(t);return Object.entries(n).forEach(([t,n])=>{e[t]=n}),e},{}):Pl(e)}function Pl(e){return e.split(`,`).map(e=>{let t=e.indexOf(`=`);return t===-1?[]:[e.slice(0,t),e.slice(t+1)].map(e=>{try{return decodeURIComponent(e.trim())}catch{return}})}).reduce((e,[t,n])=>(t&&n&&(e[t]=n),e),{})}function Fl(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((e,[t,n],r)=>{let i=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`,a=r===0?i:`${e},${i}`;return a.length>8192?(W&&G.warn(`Not adding key: ${t} with val: ${n} to baggage header due to exceeding baggage size limits.`),e):a},``)}var Il=/^o(\d+)\./,Ll=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function Rl(e){return e===`http`||e===`https`}function zl(e,t=!1){let{host:n,path:r,pass:i,port:a,projectId:o,protocol:s,publicKey:c}=e;return`${s}://${c}${t&&i?`:${i}`:``}@${n}${a?`:${a}`:``}/${r&&`${r}/`}${o}`}function Bl(e){let t=Ll.exec(e);if(!t){Go(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,i=``,a=``,o=``,s=``]=t.slice(1),c=``,l=s,u=l.split(`/`);if(u.length>1&&(c=u.slice(0,-1).join(`/`),l=u.pop()),l){let e=l.match(/^\d+/);e&&(l=e[0])}return Vl({host:a,pass:i,path:c,projectId:l,port:o,protocol:n,publicKey:r})}function Vl(e){return{protocol:e.protocol,publicKey:e.publicKey||``,pass:e.pass||``,host:e.host,port:e.port||``,path:e.path||``,projectId:e.projectId}}function Hl(e){if(!W)return!0;let{port:t,projectId:n,protocol:r}=e;return[`protocol`,`publicKey`,`host`,`projectId`].find(t=>e[t]?!1:(G.error(`Invalid Sentry Dsn: ${t} missing`),!0))?!1:n.match(/^\d+$/)?Rl(r)?t&&isNaN(parseInt(t,10))?(G.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(G.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(G.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function Ul(e){return e.match(Il)?.[1]}function Wl(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):n&&(r=Ul(n)),r}function Gl(e){let t=typeof e==`string`?Bl(e):Vl(e);if(!(!t||!Hl(t)))return t}function Kl(e){if(typeof e==`boolean`)return Number(e);let t=typeof e==`string`?parseFloat(e):e;if(!(typeof t!=`number`||isNaN(t)||t<0||t>1))return t}var ql=RegExp(`^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$`);function Jl(e){if(!e)return;let t=e.match(ql);if(!t)return;let n;return t[3]===`1`?n=!0:t[3]===`0`&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function Yl(e,t){let n=Jl(e),r=jl(t);if(!n?.traceId)return{traceId:Ac(),sampleRand:tc()};let i=Ql(n,r);r&&(r.sample_rand=i.toString());let{traceId:a,parentSpanId:o,parentSampled:s}=n;return{traceId:a,parentSpanId:o,sampled:s,dsc:r||{},sampleRand:i}}function Xl(e=Ac(),t=jc(),n){let r=``;return n!==void 0&&(r=n?`-1`:`-0`),`${e}-${t}${r}`}function Zl(e=Ac(),t=jc(),n){return`00-${e}-${t}-${n?`01`:`00`}`}function Ql(e,t){let n=Kl(t?.sample_rand);if(n!==void 0)return n;let r=Kl(t?.sample_rate);return r&&e?.parentSampled!==void 0?e.parentSampled?tc()*r:r+tc()*(1-r):tc()}var $l=!1;function eu(e){let{spanId:t,traceId:n}=e.spanContext(),{data:r,op:i,parent_span_id:a,status:o,origin:s,links:c}=cu(e);return{parent_span_id:a,span_id:t,trace_id:n,data:r,op:i,status:o,origin:s,links:c}}function tu(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),i=r?t:cu(e).parent_span_id,a=kl(e).scope;return{parent_span_id:i,span_id:r?a?.getPropagationContext().propagationSpanId||jc():t,trace_id:n}}function nu(e){let{traceId:t,spanId:n}=e.spanContext();return Xl(t,n,mu(e))}function ru(e){let{traceId:t,spanId:n}=e.spanContext();return Zl(t,n,mu(e))}function iu(e){if(e&&e.length>0)return e.map(({context:{spanId:e,traceId:t,traceFlags:n,...r},attributes:i})=>({span_id:e,trace_id:t,sampled:n===1,attributes:i,...r}))}function au(e){if(e?.length)return e.map(({context:{spanId:e,traceId:t,traceFlags:n},attributes:r})=>({span_id:e,trace_id:t,sampled:n===1,attributes:r}))}function ou(e){return typeof e==`number`?su(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?su(e.getTime()):xc()}function su(e){return e>9999999999?e/1e3:e}function cu(e){if(pu(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(fu(e)){let{attributes:r,startTime:i,name:a,endTime:o,status:s,links:c}=e;return{span_id:t,trace_id:n,data:r,description:a,parent_span_id:uu(e),start_timestamp:ou(i),timestamp:ou(o)||void 0,status:hu(s),op:r[fl],origin:r[pl],links:iu(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function lu(e){if(pu(e))return e.getStreamedSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(fu(e)){let{attributes:r,startTime:i,name:a,endTime:o,status:s,links:c}=e;return{name:a,span_id:t,trace_id:n,parent_span_id:uu(e),start_timestamp:ou(i),end_timestamp:ou(o),is_segment:e===Cu(e),status:gu(s),attributes:r,links:au(c)}}return{span_id:t,trace_id:n,start_timestamp:0,name:``,end_timestamp:0,status:`ok`,is_segment:e===Cu(e)}}function uu(e){return`parentSpanId`in e?e.parentSpanId:`parentSpanContext`in e?e.parentSpanContext?.spanId:void 0}function du(e){return{...e,attributes:Qc(e.attributes),links:e.links?.map(e=>({...e,attributes:Qc(e.attributes)}))}}function fu(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function pu(e){return typeof e.getSpanJSON==`function`}function mu(e){let{traceFlags:t}=e.spanContext();return t===1}function hu(e){if(!(!e||e.code===0))return e.code===1?`ok`:e.message||`internal_error`}function gu(e){return!e||e.code===1||e.code===0||e.message===`cancelled`?`ok`:`error`}var _u=`_sentryChildSpans`,vu=`_sentryRootSpan`;function yu(e,t){Ks(t,vu,e[vu]||e),e[_u]?e[_u].add(t):Ks(e,_u,new Set([t]))}function bu(e,t){e[_u]&&e[_u].delete(t)}function xu(e){let t=new Set;function n(e){if(!t.has(e)&&mu(e)){t.add(e);let r=e[_u]?Array.from(e[_u]):[];for(let e of r)n(e)}}return n(e),Array.from(t)}var Su=Cu;function Cu(e){return e[vu]||e}function wu(){let e=Yc(zo());return e.getActiveSpan?e.getActiveSpan():Pc(rl())}function Tu(){$l||=(Go(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),!0)}var Eu=!1;function Du(){if(Eu)return;function e(){let e=wu(),t=e&&Su(e);if(t){let e=`internal_error`;W&&G.log(`[Tracing] Root span: ${e} -> Global error occurred`),t.setStatus({code:2,message:e})}}e.tag=`sentry_tracingErrorCallback`,Eu=!0,gs(e),ys(e)}function Ou(e){if(typeof __SENTRY_TRACING__==`boolean`&&!__SENTRY_TRACING__)return!1;let t=e||sl()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function ku(e){G.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function Au(e,t){if(!t?.length)return!1;for(let n of t){if(Nu(n)){if(e.description&&ac(e.description,n))return W&&ku(e),!0;continue}let t=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!t)continue;let r=n.name?e.description&&ac(e.description,n.name):!0,i=n.op?e.op&&ac(e.op,n.op):!0,a=n.attributes?Object.entries(n.attributes).every(([t,n])=>ju(e.attributes?.[t],n)):!0;if(r&&i&&a)return W&&ku(e),!0}return!1}function ju(e,t){return typeof e==`string`&&(typeof t==`string`||t instanceof RegExp)?ac(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e===t}function Mu(e,t){let n=t.parent_span_id,r=t.span_id;if(n)for(let t of e)t.parent_span_id===r&&(t.parent_span_id=n)}function Nu(e){return typeof e==`string`||e instanceof RegExp}var Pu=`production`,Fu=`_frozenDsc`;function Iu(e,t){Ks(e,Fu,t)}function Lu(e,t){let n=t.getOptions(),{publicKey:r}=t.getDsn()||{},i={environment:n.environment||`production`,release:n.release,public_key:r,trace_id:e,org_id:Wl(t)};return t.emit(`createDsc`,i),i}function Ru(e,t){let n=t.getPropagationContext();return n.dsc||Lu(n.traceId,e)}function zu(e){let t=sl();if(!t)return{};let n=Su(e),r=cu(n),i=r.data,a=n.spanContext().traceState,o=a?.get(`sentry.sample_rate`)??i[`sentry.sample_rate`]??i[`sentry.previous_trace_sample_rate`];function s(e){return(typeof o==`number`||typeof o==`string`)&&(e.sample_rate=`${o}`),e}let c=n[Fu];if(c)return s(c);let l=a?.get(`sentry.dsc`),u=l&&jl(l);if(u)return s(u);let d=Lu(e.spanContext().traceId,t),f=i[`sentry.source`]??i[`sentry.span.source`],p=r.description;return f!==`url`&&p&&(d.transaction=p),Ou()&&(d.sampled=String(mu(n)),d.sample_rand=a?.get(`sentry.sample_rand`)??kl(n).scope?.getPropagationContext().sampleRand.toString()),s(d),t.emit(`createDsc`,d,n),d}var Bu=class{constructor(e={}){this._traceId=e.traceId||Ac(),this._spanId=e.spanId||jc(),this.dropReason=e.dropReason}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:0}}end(e){}setAttribute(e,t){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,t,n){return this}addLink(e){return this}addLinks(e){return this}recordException(e,t){}};function Vu(e){return!!e&&typeof e==`function`&&`_streamed`in e&&!!e._streamed}var Hu=Symbol.for(`sentry.skipNormalization`),Uu=Symbol.for(`sentry.overrideNormalizationDepth`);function Wu(e){return!!e[Hu]}function Gu(e){let t=e[Uu];return typeof t==`number`?t:void 0}function Ku(e,t=100,n=1/0){try{return Ju(``,e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function qu(e,t=3,n=100*1024){let r=Ku(e,t);return Qu(r)>n?qu(e,t-1,n):r}function Ju(e,t,n=1/0,r=1/0,i=$u()){let[a,o]=i;if(t==null||[`boolean`,`string`].includes(typeof t)||typeof t==`number`&&Number.isFinite(t))return t;let s=Yu(e,t);if(!s.startsWith(`[object `))return s;if(Wu(t))return t;let c=Gu(t),l=c===void 0?n:c;if(l===0)return s.replace(`object `,``);if(a(t))return`[Circular ~]`;let u=t;if(u&&typeof u.toJSON==`function`)try{return Ju(``,u.toJSON(),l-1,r,i)}catch{}let d=Array.isArray(t)?[]:{},f=0,p=Ys(t);for(let e in p){if(!Object.prototype.hasOwnProperty.call(p,e))continue;if(f>=r){d[e]=`[MaxProperties ~]`;break}let t=p[e];d[e]=Ju(e,t,l-1,r,i),f++}return o(t),d}function Yu(e,t){try{if(e===`domain`&&t&&typeof t==`object`&&t._events)return`[Domain]`;if(e===`domainEmitter`)return`[DomainEmitter]`;if(typeof global<`u`&&t===global)return`[Global]`;if(typeof window<`u`&&t===window)return`[Window]`;if(typeof document<`u`&&t===document)return`[Document]`;if(Ls(t))return ls(t);if(Fs(t))return`[SyntheticEvent]`;if(typeof t==`number`&&!Number.isFinite(t))return`[${t}]`;if(typeof t==`function`)return`[Function: ${ss(t)}]`;if(typeof t==`symbol`)return`[${String(t)}]`;if(typeof t==`bigint`)return`[BigInt: ${String(t)}]`;let n=Xu(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(e){return`**non-serializable** (${e})`}}function Xu(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:`null prototype`}function Zu(e){return~-encodeURI(e).split(/%..|./).length}function Qu(e){return Zu(JSON.stringify(e))}function $u(){let e=new WeakSet;function t(t){return e.has(t)?!0:(e.add(t),!1)}function n(t){e.delete(t)}return[t,n]}function ed(e,t=[]){return[e,t]}function td(e,t){let[n,r]=e;return[n,[...r,t]]}function nd(e,t){let n=e[1];for(let e of n){let n=e[0].type;if(t(e,n))return!0}return!1}function rd(e,t){return nd(e,(e,n)=>t.includes(n))}function id(e){let t=Bo(Lo);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function ad(e){let[t,n]=e,r=JSON.stringify(t);function i(e){typeof r==`string`?r=typeof e==`string`?r+e:[id(r),e]:r.push(typeof e==`string`?id(e):e)}for(let e of n){let[t,n]=e;if(i(`\n${JSON.stringify(t)}\n`),typeof n==`string`||n instanceof Uint8Array)i(n);else{let e;try{e=JSON.stringify(n)}catch{e=JSON.stringify(Ku(n))}i(e)}}return typeof r==`string`?r:od(r)}function od(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function sd(e){return[{type:`span`},e]}function cd(e){let t=typeof e.data==`string`?id(e.data):e.data;return[{type:`attachment`,length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var ld={sessions:`session`,event:`error`,client_report:`internal`,user_report:`default`,profile_chunk:`profile`,replay_event:`replay`,replay_recording:`replay`,check_in:`monitor`,raw_security:`security`,log:`log_item`,trace_metric:`metric`};function ud(e){return e in ld}function dd(e){return ud(e)?ld[e]:e}function fd(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function pd(e,t,n,r){let i=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:zl(r)},...i&&{trace:i}}}function md(e,t){if(!t)return e;let n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function hd(e,t,n,r){let i=fd(n);return ed({sent_at:new Date().toISOString(),...i&&{sdk:i},...!!r&&t&&{dsn:zl(t)}},[`aggregates`in e?[{type:`sessions`},e]:[{type:`session`},e.toJSON()]])}function gd(e,t,n,r){let i=fd(n),a=e.type&&e.type!==`replay_event`?e.type:`event`;md(e,n?.sdk);let o=pd(e,i,r,t);return delete e.sdkProcessingMetadata,ed(o,[[{type:a},e]])}function _d(e,t){function n(e){return!!e.trace_id&&!!e.public_key}let r=zu(e[0]),i=t?.getDsn(),a=t?.getOptions().tunnel,o={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!a&&i&&{dsn:zl(i)}},{beforeSendSpan:s,ignoreSpans:c}=t?.getOptions()||{},l=c?.length?e.filter(e=>{let t=cu(e);return!Au({description:t.description,op:t.op,attributes:t.data},c)}):e,u=e.length-l.length;u&&t?.recordDroppedEvent(`before_send`,`span`,u);let d=s?e=>{let t=cu(e);return(Vu(s)?t:s(t))||(Tu(),t)}:cu,f=[];for(let e of l){let t=d(e);t&&f.push(sd(t))}return ed(o,f)}function vd(e){if(!W)return;let{description:t=`< unknown name >`,op:n=`< unknown op >`,parent_span_id:r}=cu(e),{spanId:i}=e.spanContext(),a=mu(e),o=Su(e),s=o===e,c=`[Tracing] Starting ${a?`sampled`:`unsampled`} ${s?`root `:``}span`,l=[`op: ${n}`,`name: ${t}`,`ID: ${i}`];if(r&&l.push(`parent ID: ${r}`),!s){let{op:e,description:t}=cu(o);l.push(`root ID: ${o.spanContext().spanId}`),e&&l.push(`root op: ${e}`),t&&l.push(`root description: ${t}`)}G.log(`${c}
|
|
19
|
+
${l.join(`
|
|
20
|
+
`)}`)}function yd(e){if(!W)return;let{description:t=`< unknown name >`,op:n=`< unknown op >`}=cu(e),{spanId:r}=e.spanContext(),i=`[Tracing] Finishing "${n}" ${Su(e)===e?`root `:``}span "${t}" with ID ${r}`;G.log(i)}function bd(e,t,n,r=wu()){let i=r&&Su(r);i&&(W&&G.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),i.addEvent(e,{[gl]:t,[hl]:n}))}function xd(e){if(!e||e.length===0)return;let t={};return e.forEach(e=>{let n=e.attributes||{},r=n[hl],i=n[gl];typeof r==`string`&&typeof i==`number`&&(t[e.name]={value:i,unit:r})}),t}function Sd(e){return e.getOptions().traceLifecycle===`stream`}var Cd=1e3,wd=class{constructor(e={}){this._traceId=e.traceId||Ac(),this._spanId=e.spanId||jc(),this._startTime=e.startTimestamp||xc(),this._links=e.links,this._attributes={},this.setAttributes({[pl]:`manual`,[fl]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),`sampled`in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this._links?this._links.push(e):this._links=[e],this}addLinks(e){return this._links?this._links.push(...e):this._links=e,this}recordException(e,t){}spanContext(){let{_spanId:e,_traceId:t,_sampled:n}=this;return{spanId:e,traceId:t,traceFlags:+!!n}}setAttribute(e,t){return t===void 0?delete this._attributes[e]:this._attributes[e]=t,this}setAttributes(e){return Object.keys(e).forEach(t=>this.setAttribute(t,e[t])),this}updateStartTime(e){this._startTime=ou(e)}setStatus(e){return this._status=e,this}updateName(e){return this._name=e,this.setAttribute(ll,`custom`),this}end(e){this._endTime||(this._endTime=ou(e),yd(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[fl],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:hu(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[pl],profile_id:this._attributes[vl],exclusive_time:this._attributes[yl],measurements:xd(this._events),is_segment:this._isStandaloneSpan&&Su(this)===this||void 0,segment_id:this._isStandaloneSpan?Su(this).spanContext().spanId:void 0,links:iu(this._links)}}getStreamedSpanJSON(){return{name:this._name??``,span_id:this._spanId,trace_id:this._traceId,parent_span_id:this._parentSpanId,start_timestamp:this._startTime,end_timestamp:this._endTime??this._startTime,is_segment:this._isStandaloneSpan||this===Su(this),status:gu(this._status),attributes:this._attributes,links:au(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,t,n){W&&G.log(`[Tracing] Adding an event to span:`,e);let r=Td(t)?t:n||xc(),i=Td(t)?{}:t||{},a={name:e,time:ou(r),attributes:i};return this._events.push(a),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let e=sl();if(e&&(e.emit(`spanEnd`,this),this._isStandaloneSpan||e.emit(`afterSpanEnd`,this)),!(this._isStandaloneSpan||this===Su(this)))return;if(this._isStandaloneSpan){this._sampled?Od(_d([this],e)):(W&&G.log(`[Tracing] Discarding standalone span because its trace was not chosen to be sampled.`),e&&e.recordDroppedEvent(`sample_rate`,`span`));return}else if(e&&Sd(e)){e.emit(`afterSegmentSpanEnd`,this);return}let t=this._convertSpanToTransaction();t&&(kl(this).scope||rl()).captureEvent(t)}_convertSpanToTransaction(){if(!Ed(cu(this)))return;this._name||=(W&&G.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),`<unlabeled transaction>`);let{scope:e,isolationScope:t}=kl(this),n=e?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;let r=xu(this).filter(e=>e!==this&&!Dd(e)).map(e=>cu(e)).filter(Ed),i=this._attributes[ll];delete this._attributes[_l];let a=!1;r.forEach(e=>{delete e.data[_l],e.op?.startsWith(`gen_ai.`)&&(a=!0)});let o={contexts:{trace:eu(this)},spans:r.length>Cd?r.sort((e,t)=>e.start_timestamp-t.start_timestamp).slice(0,Cd):r,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:`transaction`,sdkProcessingMetadata:{capturedSpanScope:e,capturedSpanIsolationScope:t,dynamicSamplingContext:zu(this),hasGenAiSpans:a},request:n,...i&&{transaction_info:{source:i}}},s=xd(this._events);return s&&Object.keys(s).length&&(W&&G.log(`[Measurements] Adding measurements to transaction event`,JSON.stringify(s,void 0,2)),o.measurements=s),o}};function Td(e){return e&&typeof e==`number`||e instanceof Date||Array.isArray(e)}function Ed(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function Dd(e){return e instanceof wd&&e.isStandaloneSpan()}function Od(e){let t=sl();if(!t)return;let n=e[1];if(!n||n.length===0){t.recordDroppedEvent(`before_send`,`span`);return}t.sendEnvelope(e)}function kd(e,t,n){if(!Ou(e))return[!1];let r,i;typeof e.tracesSampler==`function`?(i=e.tracesSampler({...t,inheritOrSampleWith:e=>typeof t.parentSampleRate==`number`?t.parentSampleRate:typeof t.parentSampled==`boolean`?Number(t.parentSampled):e}),r=!0):t.parentSampled===void 0?e.tracesSampleRate!==void 0&&(i=e.tracesSampleRate,r=!0):i=t.parentSampled;let a=Kl(i);if(a===void 0)return W&&G.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(i)} of type ${JSON.stringify(typeof i)}.`),[!1];if(!a)return W&&G.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler==`function`?`tracesSampler returned 0 or false`:`a negative sampling decision was inherited or tracesSampleRate is set to 0`}`),[!1,a,r];let o=n<a;return o||W&&G.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(i)})`),[o,a,r]}var Ad=`__SENTRY_SUPPRESS_TRACING__`;function jd(e){let t=Fd();if(t.startInactiveSpan)return t.startInactiveSpan(e);let n=Pd(e),{forceTransaction:r,parentSpan:i}=e;return(e.scope?t=>ol(e.scope,t):i===void 0?e=>e():e=>Md(i,e))(()=>{let t=rl(),a=Rd(t,i),o=sl();return e.onlyIfParent&&!a?(o?.recordDroppedEvent(`no_parent_span`,`span`),new Bu):Nd({parentSpan:a,spanArguments:n,forceTransaction:r,scope:t})})}function Md(e,t){let n=Fd();return n.withActiveSpan?n.withActiveSpan(e,t):ol(n=>(Nc(n,e||void 0),t(n)))}function Nd({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!Ou()){let r=new Bu;return(n||!e)&&Iu(r,{sampled:`false`,sample_rate:`0`,transaction:t.name,...zu(r)}),r}let i=sl();if(zd(i,t))return Bd(r)||i?.recordDroppedEvent(`ignored`,`span`),new Bu({dropReason:`ignored`,traceId:e?.spanContext().traceId??r.getPropagationContext().traceId});let a=il(),o;if(e&&!n)o=Ld(e,r,t),yu(e,o);else if(e){let n=zu(e),{traceId:i,spanId:a}=e.spanContext(),s=mu(e);o=Id({traceId:i,parentSpanId:a,...t},r,s),Iu(o,n)}else{let{traceId:e,dsc:n,parentSpanId:i,sampled:s}={...a.getPropagationContext(),...r.getPropagationContext()};o=Id({traceId:e,parentSpanId:i,...t},r,s),n&&Iu(o,n)}return vd(o),Ol(o,r,a),o}function Pd(e){let t={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){let n={...t};return n.startTimestamp=ou(e.startTime),delete n.startTime,n}return t}function Fd(){return Yc(zo())}function Id(e,t,n){let r=sl(),i=r?.getOptions()||{},{name:a=``}=e,o={spanAttributes:{...e.attributes},spanName:a,parentSampled:n};r?.emit(`beforeSampling`,o,{decision:!1});let s=o.parentSampled??n,c=o.spanAttributes,l=t.getPropagationContext(),u=Bd(t),[d,f,p]=u?[!1]:kd(i,{name:a,parentSampled:s,attributes:c,parentSampleRate:Kl(l.dsc?.sample_rate)},l.sampleRand),m=new wd({...e,attributes:{[ll]:`custom`,[ul]:f!==void 0&&p?f:void 0,...c},sampled:d});return!d&&r&&!u&&(W&&G.log(`[Tracing] Discarding root span because its trace was not chosen to be sampled.`),r.recordDroppedEvent(`sample_rate`,Sd(r)?`span`:`transaction`)),r&&r.emit(`spanStart`,m),m}function Ld(e,t,n){let{spanId:r,traceId:i}=e.spanContext(),a=Bd(t),o=a?!1:mu(e),s=o?new wd({...n,parentSpanId:r,traceId:i,sampled:o}):new Bu({traceId:i});yu(e,s);let c=sl();return c?(Sd(c)&&s instanceof Bu&&(e instanceof Bu&&e.dropReason?(s.dropReason=e.dropReason,c.recordDroppedEvent(e.dropReason,`span`)):a||(s.dropReason=`sample_rate`,c.recordDroppedEvent(`sample_rate`,`span`))),c.emit(`spanStart`,s),n.endTimestamp&&(c.emit(`spanEnd`,s),c.emit(`afterSpanEnd`,s)),s):s}function Rd(e,t){if(t)return t;if(t===null)return;let n=Pc(e);if(!n)return;let r=sl();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?Su(n):n}function zd(e,t){let n=e?.getOptions().ignoreSpans;return!e||!Sd(e)||!n?.length?!1:Au({description:t.name||``,op:t.attributes?.[`sentry.op`]||t.op,attributes:t.attributes},n)}function Bd(e){return e.getScopeData().sdkProcessingMetadata[Ad]===!0}var Vd={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},Hd=`heartbeatFailed`,Ud=`idleTimeout`,Wd=`finalTimeout`,Gd=`externalFinish`;function Kd(e,t={}){let n=new Map,r=!1,i,a=Gd,o=!t.disableAutoFinish,s=[],{idleTimeout:c=Vd.idleTimeout,finalTimeout:l=Vd.finalTimeout,childSpanTimeout:u=Vd.childSpanTimeout,beforeSpanEnd:d,trimIdleSpanEndTimestamp:f=!0}=t,p=sl();if(!p||!Ou()){let e=new Bu;return Iu(e,{sample_rate:`0`,sampled:`false`,...zu(e)}),e}let m=rl(),h=wu(),g=qd(e);g.end=new Proxy(g.end,{apply(e,t,n){if(d&&d(g),t instanceof Bu)return;let[r,...i]=n,a=ou(r||xc()),o=xu(g).filter(e=>e!==g),s=cu(g);if(!o.length||!f)return S(a),Reflect.apply(e,t,[a,...i]);let c=p.getOptions().ignoreSpans,u=o?.reduce((e,t)=>{let n=cu(t);return!n.timestamp||c&&Au({description:n.description,op:n.op,attributes:n.data},c)?e:e?Math.max(e,n.timestamp):n.timestamp},void 0),m=s.start_timestamp,h=Math.min(m?m+l/1e3:1/0,Math.max(m||-1/0,Math.min(a,u||1/0)));return S(h),Reflect.apply(e,t,[h,...i])}});function _(){i&&=(clearTimeout(i),void 0)}function v(e){_(),i=setTimeout(()=>{!r&&n.size===0&&o&&(a=Ud,g.end(e))},c)}function y(e){i=setTimeout(()=>{!r&&o&&(a=Hd,g.end(e))},u)}function b(e){_(),n.set(e,!0),y(xc()+u/1e3)}function x(e){n.has(e)&&n.delete(e),n.size===0&&v(xc()+c/1e3)}function S(e){r=!0,n.clear(),s.forEach(e=>e()),Nc(m,h);let t=cu(g),{start_timestamp:i}=t;if(!i)return;t.data[`sentry.idle_span_finish_reason`]||g.setAttribute(ml,a);let o=t.status;(!o||o===`unknown`)&&g.setStatus({code:1}),G.log(`[Tracing] Idle span "${t.op}" finished`);let u=xu(g).filter(e=>e!==g),d=0;u.forEach(t=>{t.isRecording()&&(t.setStatus({code:2,message:`cancelled`}),t.end(e),W&&G.log(`[Tracing] Cancelling span since span ended early`,JSON.stringify(t,void 0,2)));let{timestamp:n=0,start_timestamp:r=0}=cu(t),i=r<=e,a=(l+c)/1e3,o=n-r<=a;if(W){let e=JSON.stringify(t,void 0,2);i?o||G.log(`[Tracing] Discarding span since it finished after idle span final timeout`,e):G.log(`[Tracing] Discarding span since it happened after idle span was finished`,e)}(!o||!i)&&(bu(g,t),d++)}),d>0&&g.setAttribute(`sentry.idle_span_discarded_spans`,d)}return s.push(p.on(`spanStart`,e=>{r||e===g||cu(e).timestamp||e instanceof wd&&e.isStandaloneSpan()||xu(g).includes(e)&&b(e.spanContext().spanId)})),s.push(p.on(`spanEnd`,e=>{r||x(e.spanContext().spanId)})),s.push(p.on(`idleSpanEnableAutoFinish`,e=>{e===g&&(o=!0,v(),n.size&&y())})),t.disableAutoFinish||v(),setTimeout(()=>{r||(g.setStatus({code:2,message:`deadline_exceeded`}),a=Wd,g.end())},l),g}function qd(e){let t=jd(e);return Nc(rl(),t),W&&G.log(`[Tracing] Started span is an idle span`),t}function Jd(e,t){let{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:a}=t;Qd(e,t),r&&tf(e,r),nf(e,n),$d(e,i),ef(e,a)}function Yd(e,t){let{extra:n,tags:r,attributes:i,user:a,contexts:o,level:s,sdkProcessingMetadata:c,breadcrumbs:l,fingerprint:u,eventProcessors:d,attachments:f,propagationContext:p,transactionName:m,span:h}=t;Xd(e,`extra`,n),Xd(e,`tags`,r),Xd(e,`attributes`,i),Xd(e,`user`,a),Xd(e,`contexts`,o),e.sdkProcessingMetadata=kc(e.sdkProcessingMetadata,c,2),s&&(e.level=s),m&&(e.transactionName=m),h&&(e.span=h),l.length&&(e.breadcrumbs=[...e.breadcrumbs,...l]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),f.length&&(e.attachments=[...e.attachments,...f]),e.propagationContext={...e.propagationContext,...p}}function Xd(e,t,n){e[t]=kc(e[t],n,1)}function Zd(e,t){let n=al().getScopeData();return e&&Yd(n,e.getScopeData()),t&&Yd(n,t.getScopeData()),n}function Qd(e,t){let{extra:n,tags:r,user:i,contexts:a,level:o,transactionName:s}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(i).length&&(e.user={...i,...e.user}),Object.keys(a).length&&(e.contexts={...a,...e.contexts}),o&&(e.level=o),s&&e.type!==`transaction`&&(e.transaction=s)}function $d(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function ef(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function tf(e,t){e.contexts={trace:tu(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:zu(t),...e.sdkProcessingMetadata};let n=cu(Su(t)).description;n&&!e.transaction&&e.type===`transaction`&&(e.transaction=n)}function nf(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}var rf=`thismessage:/`;function af(e){return`isRelative`in e}function of(e,t){let n=e.indexOf(`://`)<=0&&e.indexOf(`//`)!==0,r=t??(n?rf:void 0);try{if(`canParse`in URL&&!URL.canParse(e,r))return;let t=new URL(e,r);return n?{isRelative:n,pathname:t.pathname,search:t.search,hash:t.hash}:t}catch{}}function sf(e){if(af(e))return e.pathname;let t=new URL(e);return t.search=``,t.hash=``,[`80`,`443`].includes(t.port)&&(t.port=``),t.password&&=`%filtered%`,t.username&&=`%filtered%`,t.toString()}function cf(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let n=t[6]||``,r=t[8]||``;return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function lf(e){return e.split(/[?#]/,1)[0]}function uf(e,t=!0){if(e.startsWith(`data:`)){let n=e.match(/^data:([^;,]+)/),r=n?n[1]:`text/plain`,i=e.includes(`;base64,`),a=e.indexOf(`,`),o=``;if(t&&a!==-1){let t=e.slice(a+1);o=t.length>10?`${t.slice(0,10)}... [truncated]`:t}return`data:${r}${i?`,base64`:``}${o?`,${o}`:``}`}return e}function df(e,t){let n=e.attributes??={};Object.entries(t).forEach(([e,t])=>{t!=null&&!(e in n)&&(n[e]=t)})}var ff=0,pf=1,mf=2;function hf(e){return new _f(t=>{t(e)})}function gf(e){return new _f((t,n)=>{n(e)})}var _f=class e{constructor(e){this._state=ff,this._handlers=[],this._runExecutor(e)}then(t,n){return new e((e,r)=>{this._handlers.push([!1,n=>{if(!t)e(n);else try{e(t(n))}catch(e){r(e)}},t=>{if(!n)r(t);else try{e(n(t))}catch(e){r(e)}}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(t){return new e((e,n)=>{let r,i;return this.then(e=>{i=!1,r=e,t&&t()},e=>{i=!0,r=e,t&&t()}).then(()=>{if(i){n(r);return}e(r)})})}_executeHandlers(){if(this._state===ff)return;let e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||=(this._state===pf&&e[1](this._value),this._state===mf&&e[2](this._value),!0)})}_runExecutor(e){let t=(e,t)=>{if(this._state===ff){if(Ps(t)){t.then(n,r);return}this._state=e,this._value=t,this._executeHandlers()}},n=e=>{t(pf,e)},r=e=>{t(mf,e)};try{e(n,r)}catch(e){r(e)}}};function vf(e,t,n,r=0){try{let i=yf(t,n,e,r);return Ps(i)?i:hf(i)}catch(e){return gf(e)}}function yf(e,t,n,r){let i=n[r];if(!e||!i)return e;let a=i({...e},t);return W&&a===null&&G.log(`Event processor "${i.id||`?`}" dropped event`),Ps(a)?a.then(e=>yf(e,t,n,r+1)):yf(a,t,n,r+1)}var bf,xf,Sf,Cf;function wf(e){let t=Lo._sentryDebugIds,n=Lo._debugIds;if(!t&&!n)return{};let r=t?Object.keys(t):[],i=n?Object.keys(n):[];if(Cf&&r.length===xf&&i.length===Sf)return Cf;xf=r.length,Sf=i.length,Cf={},bf||={};let a=(t,n)=>{for(let r of t){let t=n[r],i=bf?.[r];if(i&&Cf&&t)Cf[i[0]]=t,bf&&(bf[r]=[i[0],t]);else if(t){let n=e(r);for(let e=n.length-1;e>=0;e--){let i=n[e]?.filename;if(i&&Cf&&bf){Cf[i]=t,bf[r]=[i,t];break}}}}};return t&&a(r,t),n&&a(i,n),Cf}function Tf(e,t,n,r,i,a){let{normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=e,c={...t,event_id:t.event_id||n.event_id||uc(),timestamp:t.timestamp||vc()},l=n.integrations||e.integrations.map(e=>e.name);Ef(c,e),kf(c,l),i&&i.emit(`applyFrameMetadata`,t),t.type===void 0&&Df(c,e.stackParser);let u=jf(r,n.captureContext);n.mechanism&&mc(c,n.mechanism);let d=i?i.getEventProcessors():[],f=Zd(a,u),p=[...n.attachments||[],...f.attachments];p.length&&(n.attachments=p),Jd(c,f);let m=[...d,...f.eventProcessors];return(n.data&&n.data.__sentry__===!0?hf(c):vf(m,c,n)).then(e=>(e&&Of(e),typeof o==`number`&&o>0?Af(e,o,s):e))}function Ef(e,t){let{environment:n,release:r,dist:i,maxValueLength:a}=t;e.environment=e.environment||n||`production`,!e.release&&r&&(e.release=r),!e.dist&&i&&(e.dist=i);let o=e.request;o?.url&&a&&(o.url=rc(o.url,a)),a&&e.exception?.values?.forEach(e=>{e.value&&=rc(e.value,a)})}function Df(e,t){let n=wf(t);e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.filename&&(e.debug_id=n[e.filename])})})}function Of(e){let t={};if(e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let n=e.debug_meta.images;Object.entries(t).forEach(([e,t])=>{n.push({type:`sourcemap`,code_file:e,debug_id:t})})}function kf(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function Af(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:Ku(e.data,t,n)}}))},...e.user&&{user:Ku(e.user,t,n)},...e.contexts&&{contexts:Ku(e.contexts,t,n)},...e.extra&&{extra:Ku(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Ku(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>({...e,...e.data&&{data:Ku(e.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=Ku(e.contexts.flags,3,n)),r}function jf(e,t){if(!t)return e;let n=e?e.clone():new Ic;return n.update(t),n}function Mf(e){if(e)return Nf(e)||Ff(e)?{captureContext:e}:e}function Nf(e){return e instanceof Ic||typeof e==`function`}var Pf=[`user`,`level`,`extra`,`contexts`,`tags`,`fingerprint`,`propagationContext`];function Ff(e){return Object.keys(e).some(e=>Pf.includes(e))}function If(e,t){return rl().captureException(e,Mf(t))}function Lf(e,t){return rl().captureEvent(e,t)}function Rf(){let e=sl();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function zf(e){let t=il(),{user:n}=Zd(t,rl()),{userAgent:r}=Lo.navigator||{},i=Tc({user:n,...r&&{userAgent:r},...e}),a=t.getSession();return a?.status===`ok`&&Ec(a,{status:`exited`}),Bf(),t.setSession(i),i}function Bf(){let e=il(),t=rl().getSession()||e.getSession();t&&Dc(t),Vf(),e.setSession()}function Vf(){let e=il(),t=sl(),n=e.getSession();n&&t&&t.captureSession(n)}function Hf(e=!1){if(e){Bf();return}Vf()}function Uf(e){let t=e.protocol?`${e.protocol}:`:``,n=e.port?`:${e.port}`:``;return`${t}//${e.host}${n}${e.path?`/${e.path}`:``}/api/`}function Wf(e){return`${Uf(e)}${e.projectId}/envelope/`}function Gf(e,t){let n={sentry_version:`7`};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function Kf(e,t,n){return t||`${Wf(e)}?${Gf(e,n)}`}var qf=[];function Jf(e,t){let n={};return t.forEach(t=>{t?.beforeSetup&&t.beforeSetup(e)}),t.forEach(t=>{t&&Xf(e,t,n)}),n}function Yf(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function Xf(e,t,n){if(n[t.name]){W&&G.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!qf.includes(t.name)&&typeof t.setupOnce==`function`&&(t.setupOnce(),qf.push(t.name)),t.setup&&typeof t.setup==`function`&&t.setup(e),typeof t.preprocessEvent==`function`){let n=t.preprocessEvent.bind(t);e.on(`preprocessEvent`,(t,r)=>n(t,r,e))}if(typeof t.processEvent==`function`){let n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}[`processSpan`,`processSegmentSpan`].forEach(n=>{let r=t[n];typeof r==`function`&&e.on(n,n=>r.call(t,n,e))}),W&&G.log(`Integration installed: ${t.name}`)}function Zf(e){return e}function Qf(){return typeof __SENTRY_BROWSER_BUNDLE__<`u`&&!!__SENTRY_BROWSER_BUNDLE__}function $f(){return`npm`}function ep(){return!Qf()&&Object.prototype.toString.call(typeof process<`u`?process:0)===`[object process]`}function tp(){return typeof window<`u`&&(!ep()||np())}function np(){return Lo.process?.type===`renderer`}function rp(e,t){let n=t?`auto`:`never`;return[{type:`log`,item_count:e.length,content_type:`application/vnd.sentry.items.log+json`},{version:2,...tp()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function ip(e,t,n,r,i){let a={};return t?.sdk&&(a.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(a.dsn=zl(r)),ed(a,[rp(e,i)])}function ap(e,t){let n=t??op(e)??[];if(n.length===0)return;let r=e.getOptions(),i=ip(n,r._metadata,r.tunnel,e.getDsn(),r.sendDefaultPii);sp().set(e,[]),e.emit(`flushLogs`),e.sendEnvelope(i)}function op(e){return sp().get(e)}function sp(){return Vo(`clientToLogBufferMap`,()=>new WeakMap)}function cp(e,t){let n=t?`auto`:`never`;return[{type:`trace_metric`,item_count:e.length,content_type:`application/vnd.sentry.items.trace-metric+json`},{version:2,...tp()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function lp(e,t,n,r,i){let a={};return t?.sdk&&(a.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(a.dsn=zl(r)),ed(a,[cp(e,i)])}function up(e,t){let n=t??dp(e)??[];if(n.length===0)return;let r=e.getOptions(),i=lp(n,r._metadata,r.tunnel,e.getDsn(),r.sendDefaultPii);fp().set(e,[]),e.emit(`flushMetrics`),e.sendEnvelope(i)}function dp(e){return fp().get(e)}function fp(){return Vo(`clientToMetricBufferMap`,()=>new WeakMap)}function pp(e){return du({trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,name:e.description||``,start_timestamp:e.start_timestamp,end_timestamp:e.timestamp||e.start_timestamp,status:!e.status||e.status===`ok`||e.status===`cancelled`?`ok`:`error`,is_segment:!1,attributes:{...e.data},links:e.links})}function mp(e,t){if(e.type!==`transaction`||!e.spans?.length||!e.sdkProcessingMetadata?.hasGenAiSpans||!t.getOptions().streamGenAiSpans||Sd(t))return;let n=[],r=[];for(let t of e.spans)t.op?.startsWith(`gen_ai.`)?n.push(pp(t)):r.push(t);if(n.length===0)return;e.spans=r;let i=t.getOptions().sendDefaultPii?`auto`:`never`;return[{type:`span`,item_count:n.length,content_type:`application/vnd.sentry.items.span.v2+json`},{version:2,...tp()&&{ingest_settings:{infer_ip:i,infer_user_agent:i}},items:n}]}function hp(e){return typeof e==`object`&&typeof e.unref==`function`&&e.unref(),e}var gp=Symbol.for(`SentryBufferFullError`);function _p(e=100){let t=new Set;function n(){return t.size<e}function r(e){t.delete(e)}function i(e){if(!n())return gf(gp);let i=e();return t.add(i),i.then(()=>r(i),()=>r(i)),i}function a(e){if(!t.size)return hf(!0);let n=Promise.allSettled(Array.from(t)).then(()=>!0);if(!e)return n;let r=[n,new Promise(t=>hp(setTimeout(()=>t(!1),e)))];return Promise.race(r)}return{get $(){return Array.from(t)},add:i,drain:a}}var vp=60*1e3;function yp(e,t=nc()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?vp:r-t}function bp(e,t){return e[t]||e.all||0}function xp(e,t,n=nc()){return bp(e,t)>n}function Sp(e,{statusCode:t,headers:n},r=nc()){let i={...e},a=n?.[`x-sentry-rate-limits`],o=n?.[`retry-after`];if(a)for(let e of a.trim().split(`,`)){let[t,n,,,a]=e.split(`:`,5),o=parseInt(t,10),s=(isNaN(o)?60:o)*1e3;if(!n)i.all=r+s;else for(let e of n.split(`;`))e===`metric_bucket`?(!a||a.split(`;`).includes(`custom`))&&(i[e]=r+s):i[e]=r+s}else o?i.all=r+yp(o,r):t===429&&(i.all=r+60*1e3);return i}function Cp(e,t,n=_p(e.bufferSize||64)){let r={},i=e=>n.drain(e);function a(i){let a=[];if(nd(i,(t,n)=>{let i=dd(n);xp(r,i)?e.recordDroppedEvent(`ratelimit_backoff`,i):a.push(t)}),a.length===0)return Promise.resolve({});let o=ed(i[0],a),s=t=>{if(rd(o,[`client_report`])){W&&G.warn(`Dropping client report. Will not send outcomes (reason: ${t}).`);return}nd(o,(n,r)=>{e.recordDroppedEvent(t,dd(r))})};return n.add(()=>t({body:ad(o)}).then(e=>e.statusCode===413?(W&&G.error(`Sentry responded with status code 413. Envelope was discarded due to exceeding size limits.`),s(`send_error`),e):(W&&e.statusCode!==void 0&&(e.statusCode<200||e.statusCode>=300)&&G.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=Sp(r,e),e),e=>{throw s(`network_error`),W&&G.error(`Encountered error running transport request:`,e),e})).then(e=>e,e=>{if(e===gp)return W&&G.error(`Skipped sending event because buffer is full.`),s(`queue_overflow`),Promise.resolve({});throw e})}return{send:a,flush:i}}function wp(e,t,n){let r=[{type:`client_report`},{timestamp:n||vc(),discarded_events:e}];return ed(t?{dsn:t}:{},[r])}function Tp(e){let t=[];e.message&&t.push(e.message);try{let n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function Ep(e){let{trace_id:t,parent_span_id:n,span_id:r,status:i,origin:a,data:o,op:s}=e.contexts?.trace??{};return{data:o??{},description:e.transaction,op:s,parent_span_id:n,span_id:r??``,start_timestamp:e.start_timestamp??0,status:i,timestamp:e.timestamp,trace_id:t??``,origin:a,profile_id:o?.[vl],exclusive_time:o?.[yl],measurements:e.measurements,is_segment:!0}}function Dp(e){return{type:`transaction`,timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{"sentry.profile_id":e.profile_id},...e.exclusive_time&&{"sentry.exclusive_time":e.exclusive_time}}}},measurements:e.measurements}}var Op=`Not capturing exception because it's already been captured.`,kp=`Discarded session because of missing or non-string release`,Ap=Symbol.for(`SentryInternalError`),jp=Symbol.for(`SentryDoNotSendEventError`),Mp=5e3;function Np(e){return{message:e,[Ap]:!0}}function Pp(e){return{message:e,[jp]:!0}}function Fp(e){return!!e&&typeof e==`object`&&Ap in e}function Ip(e){return!!e&&typeof e==`object`&&jp in e}function Lp(e,t,n,r,i){let a=0,o,s=!1;e.on(n,()=>{a=0,clearTimeout(o),s=!1}),e.on(t,t=>{a+=r(t),a>=8e5?i(e):s||(s=!0,o=hp(setTimeout(()=>{i(e)},Mp)))}),e.on(`flush`,()=>{i(e)})}var Rp=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=_p(e.transportOptions?.bufferSize??64),e.dsn?this._dsn=Gl(e.dsn):W&&G.warn(`No DSN provided, client will not send events.`),this._dsn){let t=Kf(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&Lp(this,`afterCaptureLog`,`flushLogs`,Gp,ap),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&Lp(this,`afterCaptureMetric`,`flushMetrics`,Wp,up)}captureException(e,t,n){let r=uc();if(hc(e))return W&&G.log(Op),r;let i={event_id:r,...t};return this._process(()=>this.eventFromException(e,i).then(e=>this._captureEvent(e,i,n)).then(e=>e),`error`),i.event_id}captureMessage(e,t,n,r){let i={event_id:uc(),...n},a=Os(e)?e:String(e),o=ks(e),s=o?this.eventFromMessage(a,t,i):this.eventFromException(e,i);return this._process(()=>s.then(e=>this._captureEvent(e,i,r)),o?`unknown`:`error`),i.event_id}captureEvent(e,t,n){let r=uc();if(t?.originalException&&hc(t.originalException))return W&&G.log(Op),r;let i={event_id:r,...t},a=e.sdkProcessingMetadata||{},o=a.capturedSpanScope,s=a.capturedSpanIsolationScope,c=zp(e.type);return this._process(()=>this._captureEvent(e,i,o||n,s),c),i.event_id}captureSession(e){this.sendSession(e),Ec(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){let t=this._transport;if(this.emit(`flush`),!t)return!0;let n=await this._isClientDoneProcessing(e),r=await t.flush(e);return n&&r}async close(e){ap(this);let t=await this.flush(e);return this.getOptions().enabled=!1,this.emit(`close`),t}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith(`Spotlight`)))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){let t=this._integrations[e.name];!t&&e.beforeSetup&&e.beforeSetup(this),Xf(this,e,this._integrations),t||Yf(this,[e])}sendEvent(e,t={}){this.emit(`beforeSendEvent`,e,t);let n=mp(e,this),r=gd(e,this._dsn,this._options._metadata,this._options.tunnel);for(let e of t.attachments||[])r=td(r,cd(e));n&&(r=td(r,n)),this.sendEnvelope(r).then(t=>this.emit(`afterSendEvent`,e,t))}sendSession(e){let{release:t,environment:n=Pu}=this._options;if(`aggregates`in e){let r=e.attrs||{};if(!r.release&&!t){W&&G.warn(kp);return}r.release=r.release||t,r.environment=r.environment||n,e.attrs=r}else{if(!e.release&&!t){W&&G.warn(kp);return}e.release=e.release||t,e.environment=e.environment||n}this.emit(`beforeSendSession`,e);let r=hd(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(r)}recordDroppedEvent(e,t,n=1){if(this._options.sendClientReports){let r=`${e}:${t}`;W&&G.log(`Recording outcome: "${r}"${n>1?` (${n} times)`:``}`),this._outcomes[r]=(this._outcomes[r]||0)+n}}on(e,t){let n=this._hooks[e]=this._hooks[e]||new Set,r=(...e)=>t(...e);return n.add(r),()=>{n.delete(r)}}emit(e,...t){let n=this._hooks[e];n&&n.forEach(e=>e(...t))}async sendEnvelope(e){if(this.emit(`beforeEnvelope`,e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(e){return W&&G.error(`Error while sending envelope:`,e),{}}return W&&G.error(`Transport disabled`),{}}registerCleanup(e){}dispose(){}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=Jf(this,e),Yf(this,e)}_updateSessionFromEvent(e,t){let n=t.level===`fatal`,r=!1,i=t.exception?.values;if(i){r=!0,n=!1;for(let e of i)if(e.mechanism?.handled===!1){n=!0;break}}let a=e.status===`ok`;(a&&e.errors===0||a&&n)&&(Ec(e,{...n&&{status:`crashed`},errors:e.errors||Number(r||n)}),this.captureSession(e))}async _isClientDoneProcessing(e){let t=0;for(;!e||t<e;){if(await new Promise(e=>setTimeout(e,1)),!this._numProcessing)return!0;t++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,t,n,r){let i=this.getOptions(),a=Object.keys(this._integrations);return!t.integrations&&a?.length&&(t.integrations=a),this.emit(`preprocessEvent`,e,t),e.type||r.setLastEventId(e.event_id||t.event_id),Tf(i,e,t,n,this,r).then(e=>e===null?e:(this.emit(`postprocessEvent`,e,t),e.contexts={trace:{...e.contexts?.trace,...cl(n)},...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:Ru(this,n),...e.sdkProcessingMetadata},e))}_captureEvent(e,t={},n=rl(),r=il()){return W&&Hp(e)&&G.log(`Captured error event \`${Tp(e)[0]||`<unknown>`}\``),this._processEvent(e,t,n,r).then(e=>e.event_id,e=>{W&&(Ip(e)?G.log(e.message):Fp(e)?G.warn(e.message):G.warn(e))})}_processEvent(e,t,n,r){let i=this.getOptions(),{sampleRate:a}=i,o=Up(e),s=Hp(e),c=`before send for type \`${e.type||`error`}\``,l=a===void 0?void 0:Kl(a);if(s&&typeof l==`number`&&tc()>l)return this.recordDroppedEvent(`sample_rate`,`error`),gf(Pp(`Discarding event because it's not included in the random sample (sampling rate = ${a})`));let u=zp(e.type);return this._prepareEvent(e,t,n,r).then(e=>{if(e===null)throw this.recordDroppedEvent(`event_processor`,u),Pp("An event processor returned `null`, will not send event.");return t.data?.__sentry__===!0?e:Bp(Vp(this,i,e,t),c)}).then(i=>{if(i===null){if(this.recordDroppedEvent(`before_send`,u),o){let t=1+(e.spans||[]).length;this.recordDroppedEvent(`before_send`,`span`,t)}throw Pp(`${c} returned \`null\`, will not send event.`)}let a=n.getSession()||r.getSession();if(s&&a&&this._updateSessionFromEvent(a,i),o){let e=(i.sdkProcessingMetadata?.spanCountBeforeProcessing||0)-(i.spans?i.spans.length:0);e>0&&this.recordDroppedEvent(`before_send`,`span`,e)}let l=i.transaction_info;return o&&l&&i.transaction!==e.transaction&&(i.transaction_info={...l,source:`custom`}),this.sendEvent(i,t),i}).then(null,e=>{throw Ip(e)||Fp(e)?e:(this.captureException(e,{mechanism:{handled:!1,type:`internal`},data:{__sentry__:!0},originalException:e}),Np(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`))})}_process(e,t){this._numProcessing++,this._promiseBuffer.add(e).then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e===gp&&this.recordDroppedEvent(`queue_overflow`,t),e))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([e,t])=>{let[n,r]=e.split(`:`);return{reason:n,category:r,quantity:t}})}_flushOutcomes(){W&&G.log(`Flushing outcomes...`);let e=this._clearOutcomes();if(e.length===0){W&&G.log(`No outcomes to send`);return}if(!this._dsn){W&&G.log(`No dsn provided, will not send outcomes`);return}W&&G.log(`Sending outcomes:`,e);let t=wp(e,this._options.tunnel&&zl(this._dsn));this.sendEnvelope(t)}};function zp(e){return e===`replay_event`?`replay`:e||`error`}function Bp(e,t){let n=`${t} must return \`null\` or a valid event.`;if(Ps(e))return e.then(e=>{if(!As(e)&&e!==null)throw Np(n);return e},e=>{throw Np(`${t} rejected with ${e}`)});if(!As(e)&&e!==null)throw Np(n);return e}function Vp(e,t,n,r){let{beforeSend:i,beforeSendTransaction:a,ignoreSpans:o}=t,s=!Vu(t.beforeSendSpan)&&t.beforeSendSpan,c=n;if(Hp(c)&&i)return i(c,r);if(Up(c)){if(s||o){let t=Ep(c);if(o?.length&&Au({description:t.description,op:t.op,attributes:t.data},o))return null;if(s){let e=s(t);e?c=kc(n,Dp(e)):Tu()}if(c.spans){let t=[],n=c.spans;for(let e of n){if(o?.length&&Au({description:e.description,op:e.op,attributes:e.data},o)){Mu(n,e);continue}if(s){let n=s(e);n?t.push(n):(Tu(),t.push(e))}else t.push(e)}let r=c.spans.length-t.length;r&&e.recordDroppedEvent(`before_send`,`span`,r),c.spans=t}}if(a){if(c.spans){let e=c.spans.length;c.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return a(c,r)}}return c}function Hp(e){return e.type===void 0}function Up(e){return e.type===`transaction`}function Wp(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+Kp(e.attributes)}function Gp(e){let t=0;return e.message&&(t+=e.message.length*2),t+Kp(e.attributes)}function Kp(e){if(!e)return 0;let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)?t+=e.length*qp(e[0]):ks(e)?t+=qp(e):t+=100}),t}function qp(e){return typeof e==`string`?e.length*2:typeof e==`number`?8:typeof e==`boolean`?4:0}function Jp(e){`aggregates`in e?e.attrs?.ip_address===void 0&&(e.attrs={...e.attrs,ip_address:`{{auto}}`}):e.ipAddress===void 0&&(e.ipAddress=`{{auto}}`)}function Yp(e,t,n=[t],r=`npm`){let i=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};i.name||(i.name=`sentry.javascript.${t}`,i.packages=n.map(e=>({name:`${r}:@sentry/${e}`,version:Ro})),i.version=Ro)}function Xp(e={}){let t=e.client||sl();if(!Rf()||!t)return{};let n=Yc(zo());if(n.getTraceData)return n.getTraceData(e);let r=e.scope||rl(),i=e.span||wu();if(!i&&nl())return{};let a=i?nu(i):Zp(r),o=Ml(i?zu(i):Ru(t,r));if(!ql.test(a))return G.warn(`Invalid sentry-trace data. Cannot generate trace data`),{};let s={"sentry-trace":a,baggage:o};return e.propagateTraceparent&&(s.traceparent=i?ru(i):Qp(r)),s}function Zp(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Xl(t,r,n)}function Qp(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Zl(t,r,n)}var $p=100;function em(e,t){let n=sl(),r=il();if(!n)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:a=$p}=n.getOptions();if(a<=0)return;let o={timestamp:vc(),...e},s=i?Go(()=>i(o,t)):o;s!==null&&(n.emit&&n.emit(`beforeAddBreadcrumb`,s,t),r.addBreadcrumb(s,a))}var tm,nm=`FunctionToString`,rm=new WeakMap,im=Zf((()=>({name:nm,setupOnce(){tm=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=Js(this),n=rm.has(sl())&&t!==void 0?t:this;return tm.apply(n,e)}}catch{}},setup(e){rm.set(e,!0)}}))),am=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/^Java exception was raised during method invocation$/],om=`EventFilters`,sm=Zf((e={})=>{let t;return{name:om,setup(n){t=lm(e,n.getOptions())},processEvent(n,r,i){return t||=lm(e,i.getOptions()),um(n,t)?null:n}}}),cm=Zf(((e={})=>({...sm(e),name:`InboundFilters`})));function lm(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:am],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function um(e,t){if(!e.type){if(dm(e,t.ignoreErrors))return W&&G.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${fc(e)}`),!0;if(_m(e))return W&&G.warn(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${fc(e)}`),!0;if(pm(e,t.denyUrls))return W&&G.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${fc(e)}.\nUrl: ${gm(e)}`),!0;if(!mm(e,t.allowUrls))return W&&G.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${fc(e)}.\nUrl: ${gm(e)}`),!0}else if(e.type===`transaction`&&fm(e,t.ignoreTransactions))return W&&G.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${fc(e)}`),!0;return!1}function dm(e,t){return t?.length?Tp(e).some(e=>oc(e,t)):!1}function fm(e,t){if(!t?.length)return!1;let n=e.transaction;return n?oc(n,t):!1}function pm(e,t){if(!t?.length)return!1;let n=gm(e);return n?oc(n,t):!1}function mm(e,t){if(!t?.length)return!0;let n=gm(e);return n?oc(n,t):!0}function hm(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!==`<anonymous>`&&n.filename!==`[native code]`)return n.filename||null}return null}function gm(e){try{let t=[...e.exception?.values??[]].reverse().find(e=>e.mechanism?.parent_id===void 0&&e.stacktrace?.frames?.length)?.stacktrace?.frames;return t?hm(t):null}catch{return W&&G.error(`Cannot extract url for event ${fc(e)}`),null}}function _m(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(e=>e.stacktrace||e.type&&e.type!==`Error`||e.value):!1}function vm(e,t,n,r,i,a){if(!i.exception?.values||!a||!Is(a.originalException,Error))return;let o=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;o&&(i.exception.values=ym(e,t,r,a.originalException,n,i.exception.values,o,0))}function ym(e,t,n,r,i,a,o,s){if(a.length>=n+1)return a;let c=[...a];if(Is(r[i],Error)){xm(o,s,r);let a=e(t,r[i]),l=c.length;Sm(a,i,l,s),c=ym(e,t,n,r[i],i,[a,...c],a,l)}return bm(r)&&r.errors.forEach((a,l)=>{if(Is(a,Error)){xm(o,s,r);let u=e(t,a),d=c.length;Sm(u,`errors[${l}]`,d,s),c=ym(e,t,n,a,i,[u,...c],u,d)}}),c}function bm(e){return Array.isArray(e.errors)}function xm(e,t,n){e.mechanism={handled:!0,type:`auto.core.linked_errors`,...bm(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function Sm(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:`chained`,source:t,exception_id:n,parent_id:r}}function Cm(e){return Ss(e)&&`__sentry_fetch_url_host__`in e&&typeof e.__sentry_fetch_url_host__==`string`}function wm(e){return Cm(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}var Tm=new Set([]);function Em(e){let t=`console`,n=fs(t,e);return ps(t,Dm),n}function Dm(){`console`in Lo&&Ho.forEach(function(e){e in Lo.console&&Gs(Lo.console,e,function(t){return Wo[e]=t,function(...t){let n=t[0],r=Wo[e],i=Tm.size&&typeof n==`string`&&oc(n,Tm);i||ms(`console`,{args:t,level:e}),(!i||W&&G.isEnabled())&&r?.apply(Lo.console,t)}})})}function Om(e){return e===`warn`?`warning`:[`fatal`,`error`,`warning`,`log`,`info`,`debug`].includes(e)?e:`log`}var km=`Dedupe`,Am=Zf((()=>{let e;return{name:km,processEvent(t){if(t.type)return t;try{if(jm(t,e))return W&&G.warn(`Event dropped due to being a duplicate of previously captured event.`),null}catch{}return e=t}}}));function jm(e,t){return t?!!(Mm(e,t)||Nm(e,t)):!1}function Mm(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Fm(e,t)||!Pm(e,t))}function Nm(e,t){let n=Im(t),r=Im(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Fm(e,t)||!Pm(e,t))}function Pm(e,t){let n=cs(e),r=cs(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let e=0;e<r.length;e++){let t=r[e],i=n[e];if(t.filename!==i.filename||t.lineno!==i.lineno||t.colno!==i.colno||t.function!==i.function)return!1}return!0}function Fm(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join(``)===r.join(``)}catch{return!1}}function Im(e){return e.exception?.values?.[0]}var Lm=`ConversationId`,Rm=Zf((()=>({name:Lm,setup(e){e.on(`spanStart`,e=>{let t=rl().getScopeData(),n=il().getScopeData(),r=t.conversationId||n.conversationId;if(r){let{op:t,data:n,description:i}=cu(e);if(!t?.startsWith(`gen_ai.`)&&!n[`ai.operationId`]&&!i?.startsWith(`ai.`))return;e.setAttribute(xl,r)}})}})));function zm(e,t,n,r,i){if(!e.fetchData)return;let{method:a,url:o}=e.fetchData,s=Ou()&&t(o);if(e.endTimestamp){let t=e.fetchData.__span;if(!t)return;let n=r[t];n&&(s&&(Hm(n,e),Bm(n,e,i)),delete r[t]);return}let{spanOrigin:c=`auto.http.browser`,propagateTraceparent:l=!1}=typeof i==`object`?i:{spanOrigin:i},u=sl(),d=!!wu()||!!u&&Sd(u),f=s&&d?jd(Km(o,a,c)):new Bu;if(s&&!d&&u?.recordDroppedEvent(`no_parent_span`,`span`),e.fetchData.__span=f.spanContext().spanId,r[f.spanContext().spanId]=f,n(e.fetchData.url)){let t=e.args[0],n={...e.args[1]||{}},r=Vm(t,n,Ou()&&d?f:void 0,l);r&&(e.args[1]=n,n.headers=r)}if(u){let t={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};u.emit(`beforeOutgoingRequestSpan`,f,t)}return f}function Bm(e,t,n){(typeof n==`object`&&n?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function Vm(e,t,n,r){let i=Xp({span:n,propagateTraceparent:r}),a=i[`sentry-trace`],o=i.baggage,s=i.traceparent;if(!a)return;let c=t.headers||(Rs(e)?e.headers:void 0);if(!c)return{...i};if(Wm(c)){let e=new Headers(c);if(e.get(`sentry-trace`)||e.set(`sentry-trace`,a),r&&s&&!e.get(`traceparent`)&&e.set(`traceparent`,s),o){let t=e.get(`baggage`);t?Um(t)||e.set(`baggage`,`${t},${o}`):e.set(`baggage`,o)}return e}else if(Gm(c)){let e=[...c];e.find(e=>e[0]===`sentry-trace`)||e.push([`sentry-trace`,a]),r&&s&&!e.find(e=>e[0]===`traceparent`)&&e.push([`traceparent`,s]);let t=c.find(e=>e[0]===`baggage`&&typeof e[1]==`string`&&Um(e[1]));return o&&!t&&e.push([`baggage`,o]),e}else{let e=`sentry-trace`in c?c[`sentry-trace`]:void 0,t=`traceparent`in c?c.traceparent:void 0,n=`baggage`in c?c.baggage:void 0,i=n?Array.isArray(n)?[...n]:[n]:[],l=n&&(Array.isArray(n)?n.find(e=>Um(e)):Um(n));o&&!l&&i.push(o);let u=Object.assign({},c,{"sentry-trace":e??a,baggage:i.length>0?i.join(`,`):void 0});return r&&s&&!t&&(u.traceparent=s),u}}function Hm(e,t){if(t.response){Cl(e,t.response.status);let n=t.response?.headers?.get(`content-length`);if(n){let t=parseInt(n);t>0&&e.setAttribute(`http.response_content_length`,t)}}else t.error&&e.setStatus({code:2,message:`internal_error`});e.end()}function Um(e){return typeof e==`string`?e.split(`,`).some(e=>e.trim().startsWith(Al)):!1}function Wm(e){return typeof Headers<`u`&&Is(e,Headers)}function Gm(e){return Array.isArray(e)?e.every(e=>Array.isArray(e)&&e.length===2&&typeof e[0]==`string`):!1}function Km(e,t,n){if(e.startsWith(`data:`))return{name:`${t} ${uf(e)}`,attributes:qm(e,void 0,t,n)};let r=of(e);return{name:`${t} ${r?sf(r):e}`,attributes:qm(e,r,t,n)}}function qm(e,t,n,r){let i={url:uf(e),type:`fetch`,"http.method":n,[pl]:r,[fl]:`http.client`};return t&&(af(t)||(i[`http.url`]=uf(t.href),i[`server.address`]=t.host),t.search&&(i[`http.query`]=t.search),t.hash&&(i[`http.fragment`]=t.hash)),i}function Jm(e){if(e!==void 0){if(e>=400&&e<500)return`warning`;if(e>=500)return`error`}}var Ym=Lo;function Xm(){return`history`in Ym&&!!Ym.history}function Zm(){if(!(`fetch`in Ym))return!1;try{return new Headers,new Request(`data:,`),new Response,!0}catch{return!1}}function Qm(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function $m(){if(typeof EdgeRuntime==`string`)return!0;if(!Zm())return!1;if(Qm(Ym.fetch))return!0;let e=!1,t=Ym.document;if(t&&typeof t.createElement==`function`)try{let n=t.createElement(`iframe`);n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=Qm(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){W&&G.warn(`Could not create sandbox iframe for pure fetch check, bailing to window.fetch: `,e)}return e}function eh(e,t){let n=`fetch`,r=fs(n,e);return ps(n,()=>nh(void 0,t)),r}function th(e){let t=`fetch-body-resolved`,n=fs(t,e);return ps(t,()=>nh(ih)),n}function nh(e,t=!1){t&&!$m()||Gs(Lo,`fetch`,function(t){return function(...n){let r=Error(),{method:i,url:a}=sh(n),o={args:n,fetchData:{method:i,url:a},startTimestamp:xc()*1e3,virtualError:r,headers:ch(n)};return e||ms(`fetch`,{...o}),t.apply(Lo,n).then(async t=>(e?e(t):ms(`fetch`,{...o,endTimestamp:xc()*1e3,response:t}),t),e=>{ms(`fetch`,{...o,endTimestamp:xc()*1e3,error:e}),Ss(e)&&e.stack===void 0&&(e.stack=r.stack,Ks(e,`framesToPop`,1));let t=sl()?.getOptions().enhanceFetchErrorMessages??`always`;if(t!==!1&&e instanceof TypeError&&(e.message===`Failed to fetch`||e.message===`Load failed`||e.message===`NetworkError when attempting to fetch resource.`))try{let n=new URL(o.fetchData.url).host;t===`always`?e.message=`${e.message} (${n})`:Ks(e,`__sentry_fetch_url_host__`,n)}catch{}throw e})}})}async function rh(e,t){if(e?.body){let n=e.body,r=n.getReader(),i=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3),a=!0;for(;a;){let e;try{e=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);let{done:i}=await r.read();clearTimeout(e),i&&(t(),a=!1)}catch{a=!1}finally{clearTimeout(e)}}clearTimeout(i),r.releaseLock(),n.cancel().then(null,()=>{})}}function ih(e){let t;try{t=e.clone()}catch{return}rh(t,()=>{ms(`fetch-body-resolved`,{endTimestamp:xc()*1e3,response:e})})}function ah(e,t){return!!e&&typeof e==`object`&&!!e[t]}function oh(e){return typeof e==`string`?e:e?ah(e,`url`)?e.url:e.toString?e.toString():``:``}function sh(e){if(e.length===0)return{method:`GET`,url:``};if(e.length===2){let[t,n]=e;return{url:oh(t),method:ah(n,`method`)?String(n.method).toUpperCase():Rs(t)&&ah(t,`method`)?String(t.method).toUpperCase():`GET`}}let t=e[0];return{url:oh(t),method:ah(t,`method`)?String(t.method).toUpperCase():`GET`}}function ch(e){let[t,n]=e;try{if(typeof n==`object`&&n&&`headers`in n&&n.headers)return new Headers(n.headers);if(Rs(t))return new Headers(t.headers)}catch{}}var lh=Lo,uh=0;function dh(){return uh>0}function fh(){uh++,setTimeout(()=>{uh--})}function ph(e,t={}){function n(e){return typeof e==`function`}if(!n(e))return e;try{let t=e.__sentry_wrapped__;if(t)return typeof t==`function`?t:e;if(Js(e))return e}catch{return e}let r=function(...n){try{let r=n.map(e=>ph(e,t));return e.apply(this,r)}catch(e){throw fh(),ol(r=>{r.addEventProcessor(e=>(t.mechanism&&(pc(e,void 0,void 0),mc(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),If(e)}),e}};try{for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch{}qs(r,e),Ks(e,`__sentry_wrapped__`,r);try{Object.getOwnPropertyDescriptor(r,`name`).configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function mh(){let e=Us(),{referrer:t}=lh.document||{},{userAgent:n}=lh.navigator||{};return{url:e,headers:{...t&&{Referer:t},...n&&{"User-Agent":n}}}}function hh(e,t){let n=vh(e,t),r={type:Ch(t),value:wh(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===``&&(r.value=`Unrecoverable error caught`),r}function gh(e,t,n,r){let i=sl()?.getOptions().normalizeDepth,a=jh(t),o={__serialized__:qu(t,i)};if(a)return{exception:{values:[hh(e,a)]},extra:o};let s={exception:{values:[{type:js(t)?t.constructor.name:r?`UnhandledRejection`:`Error`,value:kh(t,{isUnhandledRejection:r})}]},extra:o};if(n){let t=vh(e,n);t.length&&(s.exception.values[0].stacktrace={frames:t})}return s}function _h(e,t){return{exception:{values:[hh(e,t)]}}}function vh(e,t){let n=t.stacktrace||t.stack||``,r=bh(t),i=xh(t);try{return e(n,r,i)}catch{}return[]}var yh=/Minified React error #\d+;/i;function bh(e){return e&&yh.test(e.message)?1:0}function xh(e){return typeof e.framesToPop==`number`?e.framesToPop:0}function Sh(e){return typeof WebAssembly<`u`&&WebAssembly.Exception!==void 0?e instanceof WebAssembly.Exception:!1}function Ch(e){let t=e?.name;return!t&&Sh(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:`WebAssembly.Exception`:t}function wh(e){let t=e?.message;return Sh(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:`wasm exception`:t?t.error&&typeof t.error.message==`string`?wm(t.error):wm(e):`No error message`}function Th(e,t,n,r){let i=Dh(e,t,n?.syntheticException||void 0,r);return mc(i),i.level=`error`,n?.event_id&&(i.event_id=n.event_id),hf(i)}function Eh(e,t,n=`info`,r,i){let a=Oh(e,t,r?.syntheticException||void 0,i);return a.level=n,r?.event_id&&(a.event_id=r.event_id),hf(a)}function Dh(e,t,n,r,i){let a;if(ws(t)&&t.error)return _h(e,t.error);if(Ts(t)||Es(t)){let i=t;if(`stack`in t)a=_h(e,t);else{let t=i.name||(Ts(i)?`DOMError`:`DOMException`),o=i.message?`${t}: ${i.message}`:t;a=Oh(e,o,n,r),pc(a,o)}return`code`in i&&(a.tags={...a.tags,"DOMException.code":`${i.code}`}),a}return Ss(t)?_h(e,t):As(t)||js(t)?(a=gh(e,t,n,i),mc(a,{synthetic:!0}),a):(a=Oh(e,t,n,r),pc(a,`${t}`,void 0),mc(a,{synthetic:!0}),a)}function Oh(e,t,n,r){let i={};if(r&&n){let r=vh(e,n);r.length&&(i.exception={values:[{value:t,stacktrace:{frames:r}}]}),mc(i,{synthetic:!0})}if(Os(t)){let{__sentry_template_string__:e,__sentry_template_values__:n}=t;return i.logentry={message:e,params:n},i}return i.message=t,i}function kh(e,{isUnhandledRejection:t}){let n=Qs(e),r=t?`promise rejection`:`exception`;return ws(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:js(e)?`Event \`${Ah(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function Ah(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function jh(e){return Object.values(e).find(e=>e instanceof Error)}var Mh=class extends Rp{constructor(e){let t=Nh(e);Yp(t,`browser`,[`browser`],lh.SENTRY_SDK_SOURCE||$f()),t._metadata?.sdk&&(t._metadata.sdk.settings={infer_ip:t.sendDefaultPii?`auto`:`never`,...t._metadata.sdk.settings}),super(t);let{sendDefaultPii:n,sendClientReports:r,enableLogs:i,_experiments:a,enableMetrics:o}=this._options,s=o??a?.enableMetrics??!0;lh.document&&(r||i||s)&&lh.document.addEventListener(`visibilitychange`,()=>{lh.document.visibilityState===`hidden`&&(r&&this._flushOutcomes(),i&&ap(this),s&&up(this))}),n&&this.on(`beforeSendSession`,Jp)}eventFromException(e,t){return Th(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t=`info`,n){return Eh(this._options.stackParser,e,t,n,this._options.attachStacktrace)}_prepareEvent(e,t,n,r){return e.platform=e.platform||`javascript`,super._prepareEvent(e,t,n,r)}};function Nh(e){return{release:typeof __SENTRY_RELEASE__==`string`?__SENTRY_RELEASE__:lh.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}var Ph=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,K=Lo,Fh=(e,t)=>e>t[1]?`poor`:e>t[0]?`needs-improvement`:`good`,Ih=(e,t,n,r)=>{let i,a;return o=>{t.value>=0&&(o||r)&&(a=t.value-(i??0),(a||i===void 0)&&(i=t.value,t.delta=a,t.rating=Fh(t.value,n),e(t)))}},Lh=(e=!0)=>{let t=K.performance?.getEntriesByType?.(`navigation`)[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},Rh=()=>Lh()?.activationStart??0;function zh(e,t,n){K.document&&K.addEventListener(e,t,n)}function Bh(e,t,n){K.document&&K.removeEventListener(e,t,n)}var Vh=-1,Hh=new Set,Uh=()=>K.document?.visibilityState===`hidden`&&!K.document?.prerendering?0:1/0,Wh=e=>{if(Kh(e)&&Vh>-1){if(e.type===`visibilitychange`||e.type===`pagehide`)for(let e of Hh)e();isFinite(Vh)||(Vh=e.type===`visibilitychange`?e.timeStamp:0,Bh(`prerenderingchange`,Wh,!0))}},Gh=()=>{if(K.document&&Vh<0){let e=Rh();Vh=(K.document.prerendering?void 0:globalThis.performance.getEntriesByType(`visibility-state`).filter(t=>t.name===`hidden`&&t.startTime>e)[0]?.startTime)??Uh(),zh(`visibilitychange`,Wh,!0),zh(`pagehide`,Wh,!0),zh(`prerenderingchange`,Wh,!0)}return{get firstHiddenTime(){return Vh},onHidden(e){Hh.add(e)}}};function Kh(e){return e.type===`pagehide`||K.document?.visibilityState===`hidden`}var qh=()=>`v5-${Date.now()}-${Math.floor(Math.random()*8999999999999)+0xe8d4a51000}`,Jh=(e,t=-1)=>{let n=Lh(),r=`navigate`;return n&&(K.document?.prerendering||Rh()>0?r=`prerender`:K.document?.wasDiscarded?r=`restore`:n.type&&(r=n.type.replace(/_/g,`-`))),{name:e,value:t,rating:`good`,delta:0,entries:[],id:qh(),navigationType:r}},Yh=new WeakMap;function Xh(e,t){try{return Yh.get(e)||Yh.set(e,new t),Yh.get(e)}catch{return new t}}var Zh=class e{constructor(){e.prototype.__init.call(this),e.prototype.__init2.call(this)}__init(){this._sessionValue=0}__init2(){this._sessionEntries=[]}_processEntry(e){if(e.hadRecentInput)return;let t=this._sessionEntries[0],n=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this._sessionValue+=e.value,this._sessionEntries.push(e)):(this._sessionValue=e.value,this._sessionEntries=[e]),this._onAfterProcessingUnexpectedShift?.(e)}},Qh=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},$h=e=>{let t=!1;return()=>{t||=(e(),!0)}},eg=e=>{K.document?.prerendering?addEventListener(`prerenderingchange`,()=>e(),!0):e()},tg=[1800,3e3],ng=(e,t={})=>{eg(()=>{let n=Gh(),r=Jh(`FCP`),i,a=Qh(`paint`,e=>{for(let t of e)t.name===`first-contentful-paint`&&(a.disconnect(),t.startTime<n.firstHiddenTime&&(r.value=Math.max(t.startTime-Rh(),0),r.entries.push(t),i(!0)))});a&&(i=Ih(e,r,tg,t.reportAllChanges))})},rg=[.1,.25],ig=(e,t={})=>{ng($h(()=>{let n=Jh(`CLS`,0),r,i=Gh(),a=Xh(t,Zh),o=e=>{for(let t of e)a._processEntry(t);a._sessionValue>n.value&&(n.value=a._sessionValue,n.entries=a._sessionEntries,r())},s=Qh(`layout-shift`,o);s&&(r=Ih(e,n,rg,t.reportAllChanges),i.onHidden(()=>{o(s.takeRecords()),r(!0)}),K?.setTimeout?.(r))}))},ag=0,og=1/0,sg=0,cg=e=>{e.forEach(e=>{e.interactionId&&(og=Math.min(og,e.interactionId),sg=Math.max(sg,e.interactionId),ag=sg?(sg-og)/7+1:0)})},lg,ug=()=>lg?ag:performance.interactionCount||0,dg=()=>{`interactionCount`in performance||lg||(lg=Qh(`event`,cg,{type:`event`,buffered:!0,durationThreshold:0}))},fg=10,pg=0,mg=()=>ug()-pg,hg=class e{constructor(){e.prototype.__init.call(this),e.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){pg=ug(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){let e=Math.min(this._longestInteractionList.length-1,Math.floor(mg()/50));return this._longestInteractionList[e]}_processEntry(e){if(this._onBeforeProcessingEntry?.(e),!(e.interactionId||e.entryType===`first-input`))return;let t=this._longestInteractionList.at(-1),n=this._longestInteractionMap.get(e.interactionId);if(n||this._longestInteractionList.length<fg||e.duration>t._latency){if(n?e.duration>n._latency?(n.entries=[e],n._latency=e.duration):e.duration===n._latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],_latency:e.duration},this._longestInteractionMap.set(n.id,n),this._longestInteractionList.push(n)),this._longestInteractionList.sort((e,t)=>t._latency-e._latency),this._longestInteractionList.length>fg){let e=this._longestInteractionList.splice(fg);for(let t of e)this._longestInteractionMap.delete(t.id)}this._onAfterProcessingINPCandidate?.(n)}}},gg=e=>{let t=K.requestIdleCallback||K.setTimeout;K.document?.visibilityState===`hidden`?e():(e=$h(e),zh(`visibilitychange`,e,{once:!0,capture:!0}),zh(`pagehide`,e,{once:!0,capture:!0}),t(()=>{e(),Bh(`visibilitychange`,e,{capture:!0}),Bh(`pagehide`,e,{capture:!0})}))},_g=[200,500],vg=40,yg=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&`interactionId`in PerformanceEventTiming.prototype))return;let n=Gh();eg(()=>{dg();let r=Jh(`INP`),i,a=Xh(t,hg),o=e=>{gg(()=>{for(let t of e)a._processEntry(t);let t=a._estimateP98LongestInteraction();t&&t._latency!==r.value&&(r.value=t._latency,r.entries=t.entries,i())})},s=Qh(`event`,o,{durationThreshold:t.durationThreshold??vg});i=Ih(e,r,_g,t.reportAllChanges),s&&(s.observe({type:`first-input`,buffered:!0}),n.onHidden(()=>{o(s.takeRecords()),i(!0)}))})},bg=class{_processEntry(e){this._onBeforeProcessingEntry?.(e)}},xg=[2500,4e3],Sg=(e,t={})=>{eg(()=>{let n=Gh(),r=Jh(`LCP`),i,a=Xh(t,bg),o=e=>{t.reportAllChanges||(e=e.slice(-1));for(let t of e)a._processEntry(t),t.startTime<n.firstHiddenTime&&(r.value=Math.max(t.startTime-Rh(),0),r.entries=[t],i())},s=Qh(`largest-contentful-paint`,o);if(s){i=Ih(e,r,xg,t.reportAllChanges);let n=$h(()=>{o(s.takeRecords()),s.disconnect(),i(!0)}),a=e=>{e.isTrusted&&(gg(n),Bh(e.type,a,{capture:!0}))};for(let e of[`keydown`,`click`,`visibilitychange`])zh(e,a,{capture:!0})}})},Cg=[800,1800],wg=e=>{K.document?.prerendering?eg(()=>wg(e)):K.document?.readyState===`complete`?setTimeout(e):addEventListener(`load`,()=>wg(e),!0)},Tg=(e,t={})=>{let n=Jh(`TTFB`),r=Ih(e,n,Cg,t.reportAllChanges);wg(()=>{let e=Lh();e&&(n.value=Math.max(e.responseStart-Rh(),0),n.entries=[e],r(!0))})},Eg={},Dg={},Og,kg,Ag,jg;function Mg(e,t=!1){return Hg(`cls`,e,Rg,Og,t)}function Ng(e,t=!1){return Hg(`lcp`,e,zg,kg,t)}function Pg(e){return Hg(`ttfb`,e,Bg,Ag)}function Fg(e){return Hg(`inp`,e,Vg,jg)}function Ig(e,t){return Wg(e,t),Dg[e]||(Ug(e),Dg[e]=!0),Gg(e,t)}function Lg(e,t){let n=Eg[e];if(n?.length)for(let r of n)try{r(t)}catch(t){Ph&&G.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${ss(r)}\nError:`,t)}}function Rg(){return ig(e=>{Lg(`cls`,{metric:e}),Og=e},{reportAllChanges:!0})}function zg(){return Sg(e=>{Lg(`lcp`,{metric:e}),kg=e},{reportAllChanges:!0})}function Bg(){return Tg(e=>{Lg(`ttfb`,{metric:e}),Ag=e})}function Vg(){return yg(e=>{Lg(`inp`,{metric:e}),jg=e})}function Hg(e,t,n,r,i=!1){Wg(e,t);let a;return Dg[e]||(a=n(),Dg[e]=!0),r&&t({metric:r}),Gg(e,t,i?a:void 0)}function Ug(e){let t={};e===`event`&&(t.durationThreshold=0),Qh(e,t=>{Lg(e,{entries:t})},t)}function Wg(e,t){Eg[e]=Eg[e]||[],Eg[e].push(t)}function Gg(e,t,n){return()=>{n&&n();let r=Eg[e];if(!r)return;let i=r.indexOf(t);i!==-1&&r.splice(i,1)}}function Kg(e){return`duration`in e}var qg=e=>{let t=t=>{(t.type===`pagehide`||K.document?.visibilityState===`hidden`)&&e(t)};zh(`visibilitychange`,t,{capture:!0,once:!0}),zh(`pagehide`,t,{capture:!0,once:!0})};function Jg(e){return typeof e==`number`&&isFinite(e)}function Yg(e,t,n,{...r}){let i=cu(e).start_timestamp;return i&&i>t&&typeof e.updateStartTime==`function`&&e.updateStartTime(t),Md(e,()=>{let e=jd({startTime:t,...r});return e&&e.end(n),e})}function Xg(e){let t=sl();if(!t)return;let{name:n,transaction:r,attributes:i,startTime:a}=e,{release:o,environment:s,sendDefaultPii:c}=t.getOptions(),l=t.getIntegrationByName(`Replay`)?.getReplayId(),u=rl(),d=u.getUser(),f=d===void 0?void 0:d.email||d.id||d.ip_address,p;try{p=u.getScopeData().contexts.profile.profile_id}catch{}return jd({name:n,attributes:{release:o,environment:s,user:f||void 0,profile_id:p||void 0,replay_id:l||void 0,transaction:r,"user_agent.original":K.navigator?.userAgent,"client.address":c?`{{auto}}`:void 0,...i},startTime:a,experimental:{standalone:!0}})}function Zg(){return K.addEventListener&&K.performance}function Qg(e){return e/1e3}function $g(e){let t=`unknown`,n=`unknown`,r=``;for(let i of e){if(i===`/`){[t,n]=e.split(`/`);break}if(!isNaN(Number(i))){t=r===`h`?`http`:r,n=e.split(r)[1];break}r+=i}return r===e&&(t=r),{name:t,version:n}}function e_(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function t_(e,t){let n,r=!1;function i(e){!r&&n&&t(e,n.spanContext().spanId,n),r=!0}qg(()=>{i(`pagehide`)});let a=e.on(`beforeStartNavigationSpan`,(e,t)=>{t?.isRedirect||(i(`navigation`),a(),o())}),o=e.on(`afterStartPageLoadSpan`,e=>{n=e,o()})}function n_(e){let t=0,n;if(!e_(`layout-shift`))return;let r=Mg(({metric:e})=>{let r=e.entries[e.entries.length-1];r&&(t=e.value,n=r)},!0);t_(e,(e,i)=>{r_(t,n,i,e),r()})}function r_(e,t,n,r){Ph&&G.log(`Sending CLS span (${e})`);let i=t?Qg((wc()||0)+t.startTime):xc(),a=rl().getScopeData().transactionName,o=t?Vs(t.sources[0]?.node):`Layout shift`,s={[pl]:`auto.http.browser.cls`,[fl]:`ui.webvital.cls`,[yl]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t?.sources&&t.sources.forEach((e,t)=>{s[`cls.source.${t+1}`]=Vs(e.node)});let c=Xg({name:o,transaction:a,attributes:s,startTime:i});c&&(c.addEvent(`cls`,{[hl]:``,[gl]:e}),c.end(i))}function i_(e){return e!=null&&e>0&&e<=6e4}function a_(e){let t=0,n;if(!e_(`largest-contentful-paint`))return;let r=Ng(({metric:e})=>{let r=e.entries[e.entries.length-1];!r||!i_(e.value)||(t=e.value,n=r)},!0);t_(e,(e,i)=>{o_(t,n,i,e),r()})}function o_(e,t,n,r){if(!i_(e))return;Ph&&G.log(`Sending LCP span (${e})`);let i=Qg((wc()||0)+(t?.startTime||0)),a=rl().getScopeData().transactionName,o=t?Vs(t.element):`Largest contentful paint`,s={[pl]:`auto.http.browser.lcp`,[fl]:`ui.webvital.lcp`,[yl]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(s[`lcp.element`]=Vs(t.element)),t.id&&(s[`lcp.id`]=t.id),t.url&&(s[`lcp.url`]=t.url),t.loadTime!=null&&(s[`lcp.loadTime`]=t.loadTime),t.renderTime!=null&&(s[`lcp.renderTime`]=t.renderTime),t.size!=null&&(s[`lcp.size`]=t.size));let c=Xg({name:o,transaction:a,attributes:s,startTime:i});c&&(c.addEvent(`lcp`,{[hl]:`millisecond`,[gl]:e}),c.end(i))}function s_(e){return e&&((wc()||performance.timeOrigin)+e)/1e3}function c_(e){let t={};if(e.nextHopProtocol!=null){let{name:n,version:r}=$g(e.nextHopProtocol);t[`network.protocol.version`]=r,t[`network.protocol.name`]=n}return wc()||Zg()?.timeOrigin?l_({...t,"http.request.redirect_start":s_(e.redirectStart),"http.request.redirect_end":s_(e.redirectEnd),"http.request.worker_start":s_(e.workerStart),"http.request.fetch_start":s_(e.fetchStart),"http.request.domain_lookup_start":s_(e.domainLookupStart),"http.request.domain_lookup_end":s_(e.domainLookupEnd),"http.request.connect_start":s_(e.connectStart),"http.request.secure_connection_start":s_(e.secureConnectionStart),"http.request.connection_end":s_(e.connectEnd),"http.request.request_start":s_(e.requestStart),"http.request.response_start":s_(e.responseStart),"http.request.response_end":s_(e.responseEnd),"http.request.time_to_first_byte":e.responseStart==null?void 0:e.responseStart/1e3}):t}function l_(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!=null))}var u_=2147483647,d_=0,f_={},p_,m_;function h_({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){let r=Zg();if(r&&wc()){r.mark&&K.performance.mark(`sentry-tracing-init`);let i=t?a_(n):t===!1?b_():void 0,a=e?n_(n):e===!1?y_():void 0,o=x_();return()=>{o(),i?.(),a?.()}}return()=>void 0}function g_(){Ig(`longtask`,({entries:e})=>{let t=wu();if(!t)return;let{op:n,start_timestamp:r}=cu(t);for(let i of e){let e=Qg(wc()+i.startTime),a=Qg(i.duration);n===`navigation`&&r&&e<r||Yg(t,e,e+a,{name:`Main UI thread blocked`,op:`ui.long-task`,attributes:{[pl]:`auto.ui.browser.metrics`}})}})}function __(){new PerformanceObserver(e=>{let t=wu();if(t)for(let n of e.getEntries()){if(!n.scripts[0])continue;let e=Qg(wc()+n.startTime),{start_timestamp:r,op:i}=cu(t);if(i===`navigation`&&r&&e<r)continue;let a=Qg(n.duration),o={[pl]:`auto.ui.browser.metrics`},{invoker:s,invokerType:c,sourceURL:l,sourceFunctionName:u,sourceCharPosition:d}=n.scripts[0];o[`browser.script.invoker`]=s,o[`browser.script.invoker_type`]=c,l&&(o[`code.filepath`]=l),u&&(o[`code.function`]=u),d!==-1&&(o[`browser.script.source_char_position`]=d),Yg(t,e,e+a,{name:`Main UI thread blocked`,op:`ui.long-animation-frame`,attributes:o})}}).observe({type:`long-animation-frame`,buffered:!0})}function v_(){Ig(`event`,({entries:e})=>{let t=wu();if(t){for(let n of e)if(n.name===`click`){let e=Qg(wc()+n.startTime),r=Qg(n.duration),i={name:Vs(n.target),op:`ui.interaction.${n.name}`,startTime:e,attributes:{[pl]:`auto.ui.browser.metrics`}},a=Ws(n.target);a&&(i.attributes[`ui.component_name`]=a),Yg(t,e,e+r,i)}}})}function y_(){return Mg(({metric:e})=>{let t=e.entries[e.entries.length-1];t&&(f_.cls={value:e.value,unit:``},m_=t)},!0)}function b_(){return Ng(({metric:e})=>{let t=e.entries[e.entries.length-1];!t||!i_(e.value)||(f_.lcp={value:e.value,unit:`millisecond`},p_=t)},!0)}function x_(){return Pg(({metric:e})=>{e.entries[e.entries.length-1]&&(f_.ttfb={value:e.value,unit:`millisecond`})})}function S_(e,t){let n=Zg(),r=wc();if(!n?.getEntries||!r)return;let{spanStreamingEnabled:i,ignorePerformanceApiSpans:a,ignoreResourceSpans:o,recordClsOnPageloadSpan:s,recordLcpOnPageloadSpan:c}=t,l=Qg(r),u=n.getEntries(),{op:d,start_timestamp:f}=cu(e);if(u.slice(d_).forEach(t=>{let n=Qg(t.startTime),r=Qg(Math.max(0,t.duration));if(!(d===`navigation`&&f&&l+n<f))switch(t.entryType){case`navigation`:E_(e,t,l);break;case`mark`:case`paint`:case`measure`:{w_(e,t,n,r,l,a);let i=Gh(),o=t.startTime<i.firstHiddenTime;t.name===`first-paint`&&o&&(f_.fp={value:t.startTime,unit:`millisecond`}),t.name===`first-contentful-paint`&&o&&(f_.fcp={value:t.startTime,unit:`millisecond`});break}case`resource`:A_(e,t,t.name,n,r,l,o);break}}),d_=Math.max(u.length-1,0),j_(e,i),d===`pageload`){if(P_(f_),i){let t=(t,n,r)=>{let i=r??`browser.web_vital.${t}.value`;e.setAttribute(i,n),Ph&&G.log(`Setting web vital attribute`,{[i]:n},`on pageload span`)};[`ttfb`,`fp`,`fcp`].forEach(e=>{f_[e]&&t(e,f_[e].value)}),f_[`ttfb.requestTime`]&&t(`ttfb.requestTime`,f_[`ttfb.requestTime`].value,`browser.web_vital.ttfb.request_time`)}else s||delete f_.cls,c||delete f_.lcp,Object.entries(f_).forEach(([e,t])=>{bd(e,t.value,t.unit)}),M_(e,t);e.setAttribute(i?`browser.performance.time_origin`:`performance.timeOrigin`,l),e.setAttribute(i?`browser.performance.navigation.activation_start`:`performance.activationStart`,Rh())}p_=void 0,m_=void 0,f_={}}function C_(e){if(e?.entryType===`measure`)try{return e.detail.devtools.track===`Components ⚛`}catch{return}}function w_(e,t,n,r,i,a){if(C_(t)||[`mark`,`measure`].includes(t.entryType)&&oc(t.name,a))return;let o=Lh(!1),s=Qg(o?o.requestStart:0),c=i+Math.max(n,s),l=i+n,u=l+r,d={[pl]:`auto.resource.browser.metrics`};c!==l&&(d[`sentry.browser.measure_happened_before_request`]=!0,d[`sentry.browser.measure_start_time`]=c),T_(d,t),c<=u&&Yg(e,c,u,{name:t.name,op:t.entryType,attributes:d})}function T_(e,t){try{let n=t.detail;if(!n)return;if(typeof n==`object`){for(let[t,r]of Object.entries(n))if(r&&ks(r))e[`sentry.browser.measure.detail.${t}`]=r;else if(r!==void 0)try{e[`sentry.browser.measure.detail.${t}`]=JSON.stringify(r)}catch{}return}if(ks(n)){e[`sentry.browser.measure.detail`]=n;return}try{e[`sentry.browser.measure.detail`]=JSON.stringify(n)}catch{}}catch{}}function E_(e,t,n){[`unloadEvent`,`redirect`,`domContentLoadedEvent`,`loadEvent`,`connect`].forEach(r=>{D_(e,t,r,n)}),D_(e,t,`secureConnection`,n,`TLS/SSL`),D_(e,t,`fetch`,n,`cache`),D_(e,t,`domainLookup`,n,`DNS`),k_(e,t,n)}function D_(e,t,n,r,i=n){let a=t[O_(n)],o=t[`${n}Start`];!o||!a||Yg(e,r+Qg(o),r+Qg(a),{op:`browser.${i}`,name:t.name,attributes:{[pl]:`auto.ui.browser.metrics`,...n===`redirect`&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function O_(e){return e===`secureConnection`?`connectEnd`:e===`fetch`?`domainLookupStart`:`${e}End`}function k_(e,t,n){let r=n+Qg(t.requestStart),i=n+Qg(t.responseEnd),a=n+Qg(t.responseStart);t.responseEnd&&(Yg(e,r,i,{op:`browser.request`,name:t.name,attributes:{[pl]:`auto.ui.browser.metrics`}}),Yg(e,a,i,{op:`browser.response`,name:t.name,attributes:{[pl]:`auto.ui.browser.metrics`}}))}function A_(e,t,n,r,i,a,o){if(t.initiatorType===`xmlhttprequest`||t.initiatorType===`fetch`)return;let s=t.initiatorType?`resource.${t.initiatorType}`:`resource.other`;if(o?.includes(s))return;let c={[pl]:`auto.resource.browser.metrics`},l=cf(n);l.protocol&&(c[`url.scheme`]=l.protocol.split(`:`).pop()),l.host&&(c[`server.address`]=l.host),c[`url.same_origin`]=n.includes(K.location.origin),N_(t,c,[[`responseStatus`,`http.response.status_code`],[`transferSize`,`http.response_transfer_size`],[`encodedBodySize`,`http.response_content_length`],[`decodedBodySize`,`http.decoded_response_content_length`],[`renderBlockingStatus`,`resource.render_blocking_status`],[`deliveryType`,`http.response_delivery_type`]]);let u={...c,...c_(t)},d=a+r;Yg(e,d,d+i,{name:n.replace(K.location.origin,``),op:s,attributes:u})}function j_(e,t){let n=K.navigator;if(!n)return;let r=n.connection;r&&(r.effectiveType&&e.setAttribute(t?`network.connection.effective_type`:`effectiveConnectionType`,r.effectiveType),r.type&&e.setAttribute(t?`network.connection.type`:`connectionType`,r.type),Jg(r.rtt)&&(f_[`connection.rtt`]={value:r.rtt,unit:`millisecond`},t&&e.setAttribute(`network.connection.rtt`,r.rtt))),Jg(n.deviceMemory)&&(t?e.setAttribute(`device.memory.estimated_capacity`,n.deviceMemory):e.setAttribute(`deviceMemory`,`${n.deviceMemory} GB`)),Jg(n.hardwareConcurrency)&&(t?e.setAttribute(`device.processor_count`,n.hardwareConcurrency):e.setAttribute(`hardwareConcurrency`,String(n.hardwareConcurrency)))}function M_(e,t){p_&&t.recordLcpOnPageloadSpan&&(p_.element&&e.setAttribute(`lcp.element`,Vs(p_.element)),p_.id&&e.setAttribute(`lcp.id`,p_.id),p_.url&&e.setAttribute(`lcp.url`,p_.url.trim().slice(0,200)),p_.loadTime!=null&&e.setAttribute(`lcp.loadTime`,p_.loadTime),p_.renderTime!=null&&e.setAttribute(`lcp.renderTime`,p_.renderTime),e.setAttribute(`lcp.size`,p_.size)),m_?.sources&&t.recordClsOnPageloadSpan&&m_.sources.forEach((t,n)=>e.setAttribute(`cls.source.${n+1}`,Vs(t.node)))}function N_(e,t,n){n.forEach(([n,r])=>{let i=e[n];i!=null&&(typeof i==`number`&&i<u_||typeof i==`string`)&&(t[r]=i)})}function P_(e){let t=Lh(!1);if(!t)return;let{responseStart:n,requestStart:r}=t;r<=n&&(e[`ttfb.requestTime`]={value:n-r,unit:`millisecond`})}var F_=[],I_=new Map,L_=new Map;function R_(){if(Zg()&&wc()){let e=B_();return()=>{e()}}return()=>void 0}var z_={click:`click`,pointerdown:`click`,pointerup:`click`,mousedown:`click`,mouseup:`click`,touchstart:`click`,touchend:`click`,mouseover:`hover`,mouseout:`hover`,mouseenter:`hover`,mouseleave:`hover`,pointerover:`hover`,pointerout:`hover`,pointerenter:`hover`,pointerleave:`hover`,dragstart:`drag`,dragend:`drag`,drag:`drag`,dragenter:`drag`,dragleave:`drag`,dragover:`drag`,drop:`drag`,keydown:`press`,keyup:`press`,keypress:`press`,input:`press`};function B_(){return Fg(V_)}var V_=({metric:e})=>{if(e.value==null)return;let t=Qg(e.value);if(t>60)return;let n=e.entries.find(t=>t.duration===e.value&&z_[t.name]);if(!n)return;let{interactionId:r}=n,i=z_[n.name],a=Qg(wc()+n.startTime),o=wu(),s=o?Su(o):void 0,c=r==null?void 0:I_.get(r),l=c?.span||s,u=l?cu(l).description:rl().getScopeData().transactionName,d=Xg({name:c?.elementName||Vs(n.target),transaction:u,attributes:{[pl]:`auto.http.browser.inp`,[fl]:`ui.interaction.${i}`,[yl]:n.duration},startTime:a});d&&(d.addEvent(`inp`,{[hl]:`millisecond`,[gl]:e.value}),d.end(a+t))};function H_(e){return e==null?void 0:I_.get(e)}function U_(){let e=Object.keys(z_);tp()&&e.forEach(e=>{K.addEventListener(e,t,{capture:!0,passive:!0})});function t(e){let t=e.target;if(!t)return;let n=Vs(t),r=Math.round(e.timeStamp);if(L_.set(r,n),L_.size>50){let e=L_.keys().next().value;e!==void 0&&L_.delete(e)}}function n(e){let t=Math.round(e.startTime),n=L_.get(t);if(!n)for(let e=-5;e<=5;e++){let r=L_.get(t+e);if(r){n=r;break}}return n||`<unknown>`}let r=({entries:e})=>{let t=wu(),r=t&&Su(t);e.forEach(e=>{if(!Kg(e))return;let t=e.interactionId;if(t==null||I_.has(t))return;let i=e.target?Vs(e.target):n(e);if(F_.length>10){let e=F_.shift();I_.delete(e)}F_.push(t),I_.set(t,{span:r,elementName:i})})};Ig(`event`,r),Ig(`first-input`,r)}function W_(e){let{name:t,op:n,origin:r,metricName:i,value:a,attributes:o,parentSpan:s,reportEvent:c,startTime:l,endTime:u}=e,d=rl().getScopeData().transactionName,f={[pl]:r,[fl]:n,[yl]:0,[`browser.web_vital.${i}.value`]:a,"sentry.transaction":d,"user_agent.original":K.navigator?.userAgent,...o};s&&lu(s).attributes?.[`sentry.op`]===`pageload`&&(f[`sentry.pageload.span_id`]=s.spanContext().spanId),c&&(f[`browser.web_vital.${i}.report_event`]=c);let p=jd({name:t,attributes:f,startTime:l,parentSpan:s});p&&p.end(u??l)}function G_(e){let t=0,n;if(!e_(`largest-contentful-paint`))return;let r=Ng(({metric:e})=>{let r=e.entries[e.entries.length-1];!r||!i_(e.value)||(t=e.value,n=r)},!0);t_(e,(e,i,a)=>{K_(t,n,a,e),r()})}function K_(e,t,n,r){if(!i_(e))return;Ph&&G.log(`Sending LCP span (${e})`);let i=wc()||0,a=Qg(i),o=Qg(i+(t?.startTime||0)),s=t?Vs(t.element):`Largest contentful paint`,c={};t?.element&&(c[`browser.web_vital.lcp.element`]=Vs(t.element)),t?.id&&(c[`browser.web_vital.lcp.id`]=t.id),t?.url&&(c[`browser.web_vital.lcp.url`]=t.url),t?.loadTime!=null&&(c[`browser.web_vital.lcp.load_time`]=t.loadTime),t?.renderTime!=null&&(c[`browser.web_vital.lcp.render_time`]=t.renderTime),t?.size!=null&&(c[`browser.web_vital.lcp.size`]=t.size),W_({name:s,op:`ui.webvital.lcp`,origin:`auto.http.browser.lcp`,metricName:`lcp`,value:e,attributes:c,parentSpan:n,reportEvent:r,startTime:a,endTime:o})}function q_(e){let t=0,n;if(!e_(`layout-shift`))return;let r=Mg(({metric:e})=>{let r=e.entries[e.entries.length-1];r&&(t=e.value,n=r)},!0);t_(e,(e,i,a)=>{J_(t,n,a,e),r()})}function J_(e,t,n,r){Ph&&G.log(`Sending CLS span (${e})`);let i=t?Qg((wc()||0)+t.startTime):xc(),a=t?Vs(t.sources[0]?.node):`Layout shift`,o={};t?.sources&&t.sources.forEach((e,t)=>{o[`browser.web_vital.cls.source.${t+1}`]=Vs(e.node)}),W_({name:a,op:`ui.webvital.cls`,origin:`auto.http.browser.cls`,metricName:`cls`,value:e,attributes:o,parentSpan:n,reportEvent:r,startTime:i})}function Y_(){!Zg()||!wc()||Fg(({metric:e})=>{if(e.value==null||Qg(e.value)>60)return;let t=e.entries.find(t=>t.duration===e.value&&z_[t.name]);t&&X_(e.value,t)})}function X_(e,t){Ph&&G.log(`Sending INP span (${e})`);let n=Qg(wc()+t.startTime),r=Qg(e),i=z_[t.name],a=H_(t.interactionId),o=wu(),s=o?Su(o):void 0,c=a?.span||s,l=c?lu(c).name:rl().getScopeData().transactionName;W_({name:a?.elementName||Vs(t.target),op:`ui.interaction.${i}`,origin:`auto.http.browser.inp`,metricName:`inp`,value:e,attributes:{[yl]:t.duration,"sentry.transaction":l},startTime:n,endTime:n+r,parentSpan:c})}var Z_=1e3,Q_,$_,ev;function tv(e){fs(`dom`,e),ps(`dom`,nv)}function nv(){if(!K.document)return;let e=ms.bind(null,`dom`),t=av(e,!0);K.document.addEventListener(`click`,t,!1),K.document.addEventListener(`keypress`,t,!1),[`EventTarget`,`Node`].forEach(t=>{let n=K[t]?.prototype;n?.hasOwnProperty?.(`addEventListener`)&&(Gs(n,`addEventListener`,function(t){return function(n,r,i){if(n===`click`||n==`keypress`)try{let r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},a=r[n]=r[n]||{refCount:0};if(!a.handler){let r=av(e);a.handler=r,t.call(this,n,r,i)}a.refCount++}catch{}return t.call(this,n,r,i)}}),Gs(n,`removeEventListener`,function(e){return function(t,n,r){if(t===`click`||t==`keypress`)try{let n=this.__sentry_instrumentation_handlers__||{},i=n[t];i&&(i.refCount--,i.refCount<=0&&(e.call(this,t,i.handler,r),i.handler=void 0,delete n[t]),Object.keys(n).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,n,r)}}))})}function rv(e){if(e.type!==$_)return!1;try{if(!e.target||e.target._sentryId!==ev)return!1}catch{}return!0}function iv(e,t){return e===`keypress`?t?.tagName?!(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable):!0:!1}function av(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;let r=ov(n);if(iv(n.type,r))return;Ks(n,`_sentryCaptured`,!0),r&&!r._sentryId&&Ks(r,`_sentryId`,uc());let i=n.type===`keypress`?`input`:n.type;rv(n)||(e({event:n,name:i,global:t}),$_=n.type,ev=r?r._sentryId:void 0),clearTimeout(Q_),Q_=K.setTimeout(()=>{ev=void 0,$_=void 0},Z_)}}function ov(e){try{return e.target}catch{return null}}var sv;function cv(e){let t=`history`;fs(t,e),ps(t,lv)}function lv(){if(K.addEventListener(`popstate`,()=>{let e=K.location.href,t=sv;sv=e,t!==e&&ms(`history`,{from:t,to:e})}),!Xm())return;function e(e){return function(...t){let n=t.length>2?t[2]:void 0;if(n){let r=sv,i=uv(String(n));if(sv=i,r===i)return e.apply(this,t);ms(`history`,{from:r,to:i})}return e.apply(this,t)}}Gs(K.history,`pushState`,e),Gs(K.history,`replaceState`,e)}function uv(e){try{return new URL(e,K.location.origin).toString()}catch{return e}}var dv={};function fv(e){let t=dv[e];if(t)return t;let n=K[e];if(Qm(n))return dv[e]=n.bind(K);let r=K.document;if(r&&typeof r.createElement==`function`)try{let t=r.createElement(`iframe`);t.hidden=!0,r.head.appendChild(t);let i=t.contentWindow;i?.[e]&&(n=i[e]),r.head.removeChild(t)}catch(t){Ph&&G.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,t)}return n&&(dv[e]=n.bind(K))}function pv(e){dv[e]=void 0}var mv=`__sentry_xhr_v3__`;function hv(e){fs(`xhr`,e),ps(`xhr`,gv)}function gv(){if(!K.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){let r=Error(),i=xc()*1e3,a=Ds(n[0])?n[0].toUpperCase():void 0,o=_v(n[1]);if(!a||!o)return e.apply(t,n);t[mv]={method:a,url:o,request_headers:{}},a===`POST`&&o.match(/sentry_key/)&&(t.__sentry_own_request__=!0);let s=()=>{let e=t[mv];if(e&&t.readyState===4){try{e.status_code=t.status}catch{}ms(`xhr`,{endTimestamp:xc()*1e3,startTimestamp:i,xhr:t,virtualError:r})}};return`onreadystatechange`in t&&typeof t.onreadystatechange==`function`?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply(e,t,n){return s(),e.apply(t,n)}}):t.addEventListener(`readystatechange`,s),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){let[r,i]=n,a=t[mv];return a&&Ds(r)&&Ds(i)&&(a.request_headers[r.toLowerCase()]=i),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){let r=t[mv];return r?(n[0]!==void 0&&(r.body=n[0]),ms(`xhr`,{startTimestamp:xc()*1e3,xhr:t}),e.apply(t,n)):e.apply(t,n)}})}function _v(e){if(Ds(e))return e;try{return e.toString()}catch{}}function vv(e){let t;try{t=e.getAllResponseHeaders()}catch(t){return Ph&&G.error(t,`Failed to get xhr response headers`,e),{}}return t?t.split(`\r
|
|
21
|
+
`).reduce((e,t)=>{let[n,r]=t.split(`: `);return r&&(e[n.toLowerCase()]=r),e},{}):{}}var yv=40;function bv(e,t=fv(`fetch`)){let n=0,r=0;async function i(i){let a=i.body.length;n+=a,r++;let o={body:i.body,method:`POST`,referrerPolicy:`strict-origin`,headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{let n=await t(e.url,o);return{statusCode:n.status,headers:{"x-sentry-rate-limits":n.headers.get(`X-Sentry-Rate-Limits`),"retry-after":n.headers.get(`Retry-After`)}}}catch(e){throw pv(`fetch`),e}finally{n-=a,r--}}return Cp(e,i,_p(e.bufferSize||yv))}var xv=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,Sv=30,Cv=50;function wv(e,t,n,r){let i={filename:e,function:t===`<anonymous>`?`?`:t,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}var Tv=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Ev=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Dv=/\((\S*)(?::(\d+))(?::(\d+))\)/,Ov=/at (.+?) ?\(data:(.+?),/,kv=[Sv,e=>{let t=e.match(Ov);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};let n=Tv.exec(e);if(n){let[,e,t,r]=n;return wv(e,`?`,+t,+r)}let r=Ev.exec(e);if(r){if(r[2]?.indexOf(`eval`)===0){let e=Dv.exec(r[2]);e&&(r[2]=e[1],r[3]=e[2],r[4]=e[3])}let[e,t]=Nv(r[1]||`?`,r[2]);return wv(t,e,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}}],Av=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,jv=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Mv=rs(kv,[Cv,e=>{let t=Av.exec(e);if(t){if(t[3]&&t[3].indexOf(` > eval`)>-1){let e=jv.exec(t[3]);e&&(t[1]=t[1]||`eval`,t[3]=e[1],t[4]=e[2],t[5]=``)}let e=t[3],n=t[1]||`?`;return[n,e]=Nv(n,e),wv(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]),Nv=(e,t)=>{let n=e.indexOf(`safari-extension`)!==-1,r=e.indexOf(`safari-web-extension`)!==-1;return n||r?[e.indexOf(`@`)===-1?`?`:e.split(`@`)[0],n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Pv=1024,Fv=`Breadcrumbs`,Iv=Zf(((e={})=>{let t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:Fv,setup(e){t.console&&Em(zv(e)),t.dom&&tv(Rv(e,t.dom)),t.xhr&&hv(Bv(e)),t.fetch&&eh(Vv(e)),t.history&&cv(Hv(e)),t.sentry&&e.on(`beforeSendEvent`,Lv(e))}}}));function Lv(e){return function(t){sl()===e&&em({category:`sentry.${t.type===`transaction`?`transaction`:`event`}`,event_id:t.event_id,level:t.level,message:fc(t)},{event:t})}}function Rv(e,t){return function(n){if(sl()!==e)return;let r,i,a=typeof t==`object`?t.serializeAttribute:void 0,o=typeof t==`object`&&typeof t.maxStringLength==`number`?t.maxStringLength:void 0;o&&o>Pv&&(xv&&G.warn(`\`dom.maxStringLength\` cannot exceed ${Pv}, but a value of ${o} was configured. Sentry will use ${Pv} instead.`),o=Pv),typeof a==`string`&&(a=[a]);try{let e=n.event,t=Uv(e)?e.target:e;r=Vs(t,{keyAttrs:a,maxStringLength:o}),i=Ws(t)}catch{r=`<unknown>`}if(r.length===0)return;let s={category:`ui.${n.name}`,message:r};i&&(s.data={"ui.component_name":i}),em(s,{event:n.event,name:n.name,global:n.global})}}function zv(e){return function(t){if(sl()!==e)return;let n={category:`console`,data:{arguments:t.args,logger:`console`},level:Om(t.level),message:ic(t.args,` `)};if(t.level===`assert`)if(t.args[0]===!1)n.message=`Assertion failed: ${ic(t.args.slice(1),` `)||`console.assert`}`,n.data.arguments=t.args.slice(1);else return;em(n,{input:t.args,level:t.level})}}function Bv(e){return function(t){if(sl()!==e)return;let{startTimestamp:n,endTimestamp:r}=t,i=t.xhr[mv];if(!n||!r||!i)return;let{method:a,url:o,status_code:s,body:c}=i,l={method:a,url:o,status_code:s},u={xhr:t.xhr,input:c,startTimestamp:n,endTimestamp:r},d={category:`xhr`,data:l,type:`http`,level:Jm(s)};e.emit(`beforeOutgoingRequestBreadcrumb`,d,u),em(d,u)}}function Vv(e){return function(t){if(sl()!==e)return;let{startTimestamp:n,endTimestamp:r}=t;if(r&&!(t.fetchData.url.match(/sentry_key/)&&t.fetchData.method===`POST`))if(t.error){let i={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r},a={category:`fetch`,data:t.fetchData,level:`error`,type:`http`};e.emit(`beforeOutgoingRequestBreadcrumb`,a,i),em(a,i)}else{let i=t.response,a={...t.fetchData,status_code:i?.status},o={input:t.args,response:i,startTimestamp:n,endTimestamp:r},s={category:`fetch`,data:a,type:`http`,level:Jm(a.status_code)};e.emit(`beforeOutgoingRequestBreadcrumb`,s,o),em(s,o)}}}function Hv(e){return function(t){if(sl()!==e)return;let n=t.from,r=t.to,i=cf(lh.location.href),a=n?cf(n):void 0,o=cf(r);a?.path||(a=i),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),i.protocol===a.protocol&&i.host===a.host&&(n=a.relative),em({category:`navigation`,data:{from:n,to:r}})}}function Uv(e){return!!e&&!!e.target}var Wv=`EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload`.split(`,`),Gv=`BrowserApiErrors`,Kv=Zf(((e={})=>{let t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:Gv,setupOnce(){t.setTimeout&&Gs(lh,`setTimeout`,qv),t.setInterval&&Gs(lh,`setInterval`,qv),t.requestAnimationFrame&&Gs(lh,`requestAnimationFrame`,Jv),t.XMLHttpRequest&&`XMLHttpRequest`in lh&&Gs(XMLHttpRequest.prototype,`send`,Yv);let e=t.eventTarget;e&&(Array.isArray(e)?e:Wv).forEach(e=>Xv(e,t))}}}));function qv(e){return function(...t){let n=t[0];return t[0]=ph(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${ss(e)}`}}),e.apply(this,t)}}function Jv(e){return function(t){return e.apply(this,[ph(t,{mechanism:{data:{handler:ss(e)},handled:!1,type:`auto.browser.browserapierrors.requestAnimationFrame`}})])}}function Yv(e){return function(...t){let n=this;return[`onload`,`onerror`,`onprogress`,`onreadystatechange`].forEach(e=>{e in n&&typeof n[e]==`function`&&Gs(n,e,function(t){let n={mechanism:{data:{handler:ss(t)},handled:!1,type:`auto.browser.browserapierrors.xhr.${e}`}},r=Js(t);return r&&(n.mechanism.data.handler=ss(r)),ph(t,n)})}),e.apply(this,t)}}function Xv(e,t){let n=lh[e]?.prototype;n?.hasOwnProperty?.(`addEventListener`)&&(Gs(n,`addEventListener`,function(n){return function(r,i,a){try{Zv(i)&&(i.handleEvent=ph(i.handleEvent,{mechanism:{data:{handler:ss(i),target:e},handled:!1,type:`auto.browser.browserapierrors.handleEvent`}}))}catch{}return t.unregisterOriginalCallbacks&&Qv(this,r,i),n.apply(this,[r,ph(i,{mechanism:{data:{handler:ss(i),target:e},handled:!1,type:`auto.browser.browserapierrors.addEventListener`}}),a])}}),Gs(n,`removeEventListener`,function(e){return function(t,n,r){try{let i=n.__sentry_wrapped__;i&&e.call(this,t,i,r)}catch{}return e.call(this,t,n,r)}}))}function Zv(e){return typeof e.handleEvent==`function`}function Qv(e,t,n){e&&typeof e==`object`&&`removeEventListener`in e&&typeof e.removeEventListener==`function`&&e.removeEventListener(t,n)}var $v=Zf((e={})=>{let t=e.lifecycle??`route`;return{name:`BrowserSession`,setupOnce(){if(lh.document===void 0){xv&&G.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}zf({ignoreDuration:!0}),Hf();let e=il(),n=e.getUser();e.addScopeListener(e=>{let t=e.getUser();(n?.id!==t?.id||n?.ip_address!==t?.ip_address)&&(Hf(),n=t)}),t===`route`&&cv(({from:e,to:t})=>{e!==t&&(zf({ignoreDuration:!0}),Hf())})}}}),ey=`CultureContext`,ty=Zf((()=>({name:ey,preprocessEvent(e){let t=ny();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){let t=ny();t&&df(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}})));function ny(){try{let e=lh.Intl;if(!e)return;let t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}var ry=`GlobalHandlers`,iy=Zf(((e={})=>{let t={onerror:!0,onunhandledrejection:!0,...e};return{name:ry,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(ay(e),uy(`onerror`)),t.onunhandledrejection&&(oy(e),uy(`onunhandledrejection`))}}}));function ay(e){gs(t=>{let{stackParser:n,attachStacktrace:r}=dy();if(sl()!==e||dh())return;let{msg:i,url:a,line:o,column:s,error:c}=t,l=ly(Dh(n,c||i,void 0,r,!1),a,o,s);l.level=`error`,Lf(l,{originalException:c,mechanism:{handled:!1,type:`auto.browser.global_handlers.onerror`}})})}function oy(e){ys(t=>{let{stackParser:n,attachStacktrace:r}=dy();if(sl()!==e||dh())return;let i=sy(t),a=ks(i)?cy(i):Dh(n,i,void 0,r,!0);a.level=`error`,Lf(a,{originalException:i,mechanism:{handled:!1,type:`auto.browser.global_handlers.onunhandledrejection`}})})}function sy(e){if(ks(e))return e;try{if(`reason`in e)return e.reason;if(`detail`in e&&`reason`in e.detail)return e.detail.reason}catch{}return e}function cy(e){return{exception:{values:[{type:`UnhandledRejection`,value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function ly(e,t,n,r){let i=e.exception=e.exception||{},a=i.values=i.values||[],o=a[0]=a[0]||{},s=o.stacktrace=o.stacktrace||{},c=s.frames=s.frames||[];return c.length===0&&c.push({colno:r,lineno:n,filename:fy(t)??Us(),function:`?`,in_app:!0}),e}function uy(e){xv&&G.log(`Global Handler attached: ${e}`)}function dy(){return sl()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function fy(e){if(!(!Ds(e)||e.length===0))return e.startsWith(`data:`)?`<${uf(e,!1)}>`:e}var py=Zf(()=>({name:`HttpContext`,preprocessEvent(e){if(!lh.navigator&&!lh.location&&!lh.document)return;let t=mh(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}},processSegmentSpan(e){if(!lh.navigator&&!lh.location&&!lh.document)return;let t=mh();df(e,{"url.full":t.url||void 0,"http.request.header.user_agent":t.headers[`User-Agent`],"http.request.header.referer":t.headers.Referer})}})),my=`cause`,hy=5,gy=`LinkedErrors`,_y=Zf(((e={})=>{let t=e.limit||hy,n=e.key||my;return{name:gy,preprocessEvent(e,r,i){vm(hh,i.getOptions().stackParser,n,t,e,r)}}}));function vy(e){return[cm(),im(),Rm(),Kv(),Iv(),iy(),_y(),Am(),py(),ty(),$v()]}function yy(e){return e.split(`,`).some(e=>e.trim().startsWith(`sentry-`))}function by(e){try{return new URL(e,lh.location.origin).href}catch{return}}function xy(e){return e.entryType===`resource`&&`initiatorType`in e&&typeof e.nextHopProtocol==`string`&&(e.initiatorType===`fetch`||e.initiatorType===`xmlhttprequest`)}function Sy(e){try{return new Headers(e)}catch{return}}var Cy=new WeakMap,wy=new Map,Ty={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function Ey(e,t){let{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:i,shouldCreateSpanForRequest:a,enableHTTPTimings:o,tracePropagationTargets:s,onRequestSpanStart:c,onRequestSpanEnd:l}={...Ty,...t},u=typeof a==`function`?a:e=>!0,d=e=>ky(e,s),f={},p=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor(e=>(e.type===`transaction`&&e.spans&&e.spans.forEach(e=>{if(e.op===`http.client`){let t=wy.get(e.span_id);t&&(e.timestamp=t/1e3,wy.delete(e.span_id))}}),e)),i&&th(e=>{if(e.response){let t=Cy.get(e.response);t&&e.endTimestamp&&wy.set(t,e.endTimestamp)}}),eh(t=>{let n=zm(t,u,d,f,{propagateTraceparent:p,onRequestSpanEnd:l});if(t.response&&t.fetchData.__span&&Cy.set(t.response,t.fetchData.__span),n){let r=by(t.fetchData.url),i=r?cf(r).host:void 0;n.setAttributes({"http.url":r?uf(r):void 0,"server.address":i}),o&&Oy(n,e),c?.(n,{headers:t.headers})}})),r&&hv(t=>{let n=Ay(t,u,d,f,p,l);n&&(o&&Oy(n,e),c?.(n,{headers:Sy(t.xhr.__sentry_xhr_v3__?.request_headers)}))})}var Dy=300;function Oy(e,t){let{url:n}=cu(e).data;if(!n||typeof n!=`string`)return;let r=()=>void setTimeout(i);if(Sd(t)){let t=e.end.bind(e);e.end=e=>{let n=e??xc(),a=!1,o=()=>{a||(a=!0,setTimeout(i),t(n),clearTimeout(s))};r=o;let s=setTimeout(o,Dy)}}let i=Ig(`resource`,({entries:t})=>{t.forEach(t=>{xy(t)&&t.name.endsWith(n)&&(e.setAttributes(c_(t)),r())})})}function ky(e,t){let n=Us();if(n){let r,i;try{r=new URL(e,n),i=new URL(n).origin}catch{return!1}let a=r.origin===i;return t?oc(r.toString(),t)||a&&oc(r.pathname,t):a}else{let n=!!e.match(/^\/(?!\/)/);return t?oc(e,t):n}}function Ay(e,t,n,r,i,a){let o=e.xhr,s=o?.[mv];if(!o||o.__sentry_own_request__||!s)return;let{url:c,method:l}=s,u=Ou()&&t(c);if(e.endTimestamp){let t=o.__sentry_xhr_span_id__;if(!t)return;let n=r[t];n&&(u&&s.status_code!==void 0&&(Cl(n,s.status_code),n.end(),a?.(n,{headers:Sy(vv(o)),error:e.error})),delete r[t]);return}let d=by(c),f=cf(d||c),p=uf(lf(c)),m=sl(),h=!!wu()||!!m&&Sd(m),g=u&&h?jd({name:`${l} ${p}`,attributes:{url:uf(c),type:`xhr`,"http.method":l,"http.url":d?uf(d):void 0,"server.address":f?.host,[pl]:`auto.http.browser`,[fl]:`http.client`,...f?.search&&{"http.query":f?.search},...f?.hash&&{"http.fragment":f?.hash}}}):new Bu;return u&&!h&&m?.recordDroppedEvent(`no_parent_span`,`span`),o.__sentry_xhr_span_id__=g.spanContext().spanId,r[o.__sentry_xhr_span_id__]=g,n(c)&&jy(o,Ou()&&h?g:void 0,i),m&&m.emit(`beforeOutgoingRequestSpan`,g,e),g}function jy(e,t,n){let{"sentry-trace":r,baggage:i,traceparent:a}=Xp({span:t,propagateTraceparent:n});r&&My(e,r,i,a)}function My(e,t,n,r){let i=e.__sentry_xhr_v3__?.request_headers;if(!(i?.[`sentry-trace`]||!e.setRequestHeader))try{if(e.setRequestHeader(`sentry-trace`,t),r&&!i?.traceparent&&e.setRequestHeader(`traceparent`,r),n){let t=i?.baggage;(!t||!yy(t))&&e.setRequestHeader(`baggage`,n)}}catch{}}function Ny(){lh.document?lh.document.addEventListener(`visibilitychange`,()=>{let e=wu();if(!e)return;let t=Su(e);if(lh.document.hidden&&t){let e=`cancelled`,{op:n,status:r}=cu(t);xv&&G.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${n}`),r||t.setStatus({code:2,message:e}),t.setAttribute(`sentry.cancellation_reason`,`document.hidden`),t.end()}}):xv&&G.warn(`[Tracing] Could not set up background tab detection due to lack of global document`)}var Py=`sentry_previous_trace`,Fy=`sentry.previous_trace`;function Iy(e,{linkPreviousTrace:t,consistentTraceSampling:n}){let r=t===`session-storage`,i=r?zy():void 0;e.on(`spanStart`,e=>{if(Su(e)!==e)return;let t=rl().getPropagationContext();i=Ly(i,e,t),r&&Ry(i)});let a=!0;n&&e.on(`beforeSampling`,e=>{if(!i)return;let t=rl(),n=t.getPropagationContext();if(a&&n.parentSpanId){a=!1;return}t.setPropagationContext({...n,dsc:{...n.dsc,sample_rate:String(i.sampleRate),sampled:String(By(i.spanContext))},sampleRand:i.sampleRand}),e.parentSampled=By(i.spanContext),e.parentSampleRate=i.sampleRate,e.spanAttributes={...e.spanAttributes,[dl]:i.sampleRate}})}function Ly(e,t,n){let r=cu(t);function i(){try{return Number(n.dsc?.sample_rate)??Number(r.data?.[`sentry.sample_rate`])}catch{return 0}}let a={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:i(),sampleRand:n.sampleRand};if(!e)return a;let o=e.spanContext;return o.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=3600&&(xv&&G.log(`Adding previous_trace \`${JSON.stringify(o)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:o,attributes:{[bl]:`previous_trace`}}),t.setAttribute(Fy,`${o.traceId}-${o.spanId}-${+!!By(o)}`)),a)}function Ry(e){try{lh.sessionStorage.setItem(Py,JSON.stringify(e))}catch(e){xv&&G.warn(`Could not store previous trace in sessionStorage`,e)}}function zy(){try{let e=lh.sessionStorage?.getItem(Py);return JSON.parse(e)}catch{return}}function By(e){return e.traceFlags===1}var Vy=`BrowserTracing`,Hy=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function Uy(){let e=lh.navigator;return e?.userAgent?Hy.test(e.userAgent):!1}var Wy={...Vd,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:`in-memory`,consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...Ty},Gy=((e={})=>{`enableElementTiming`in e&&Go(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});let t={name:void 0,source:void 0},n=lh.document,{enableInp:r,enableLongTask:i,enableLongAnimationFrame:a,_experiments:{enableInteractions:o,enableStandaloneClsSpans:s,enableStandaloneLcpSpans:c},beforeStartSpan:l,idleTimeout:u,finalTimeout:d,childSpanTimeout:f,markBackgroundSpan:p,traceFetch:m,traceXHR:h,trackFetchStreamPerformance:g,shouldCreateSpanForRequest:_,enableHTTPTimings:v,ignoreResourceSpans:y,ignorePerformanceApiSpans:b,instrumentPageLoad:x,instrumentNavigation:S,detectRedirects:C,linkPreviousTrace:w,consistentTraceSampling:T,enableReportPageLoaded:E,onRequestSpanStart:D,onRequestSpanEnd:O}={...Wy,...e},k=Uy(),A,j,M;function N(e,r,i=!0){let a=r.op===`pageload`,o=r.name,p=l?l(r):r,m=p.attributes||{};if(o!==p.name&&(m[ll]=`custom`,p.attributes=m),!i){let e=vc();jd({...p,startTime:e}).end(e);return}t.name=p.name,t.source=m[ll];let h=Kd(p,{idleTimeout:u,finalTimeout:d,childSpanTimeout:f,disableAutoFinish:a,beforeSpanEnd:t=>{A?.();let n=Sd(e);S_(t,{recordClsOnPageloadSpan:!n&&!s,recordLcpOnPageloadSpan:!n&&!c,ignoreResourceSpans:y,ignorePerformanceApiSpans:b,spanStreamingEnabled:n}),$y(e,void 0);let r=rl(),i=r.getPropagationContext();r.setPropagationContext({...i,traceId:h.spanContext().traceId,sampled:mu(h),dsc:zu(t)}),a&&(M=void 0)},trimIdleSpanEndTimestamp:!E});a&&E&&(M=h),$y(e,h);function g(){n&&[`interactive`,`complete`].includes(n.readyState)&&e.emit(`idleSpanEnableAutoFinish`,h)}a&&!E&&n&&(n.addEventListener(`readystatechange`,()=>{g()}),g())}return{name:Vy,setup(e){if(k){xv&&G.log(`[Tracing] Skipping browserTracingIntegration setup for bot user agent.`);return}Du();let t=Sd(e);if(A=h_({recordClsStandaloneSpans:t?void 0:s||!1,recordLcpStandaloneSpans:t?void 0:c||!1,client:e}),t?(G_(e),q_(e),r&&Y_()):r&&R_(),a&&Lo.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes(`long-animation-frame`)?__():i&&g_(),o&&v_(),C&&n){let e=()=>{j=xc()};addEventListener(`click`,e,{capture:!0}),addEventListener(`keydown`,e,{capture:!0,passive:!0})}function l(){let t=Qy(e);t&&!cu(t).timestamp&&(xv&&G.log(`[Tracing] Finishing current active span with op: ${cu(t).op}`),t.setAttribute(ml,`cancelled`),t.end())}e.on(`startNavigationSpan`,(t,n)=>{if(sl()!==e)return;if(n?.isRedirect){xv&&G.warn(`[Tracing] Detected redirect, navigation span will not be the root span, but a child span.`),N(e,{op:`navigation.redirect`,...t},!1);return}j=void 0,l(),il().setPropagationContext({traceId:Ac(),sampleRand:Math.random(),propagationSpanId:Ou()?void 0:jc()});let r=rl();r.setPropagationContext({traceId:Ac(),sampleRand:Math.random(),propagationSpanId:Ou()?void 0:jc()}),r.setSDKProcessingMetadata({normalizedRequest:void 0}),N(e,{op:`navigation`,...t,parentSpan:null,forceTransaction:!0})}),e.on(`startPageLoadSpan`,(t,n={})=>{if(sl()!==e)return;l();let r=Yl(n.sentryTrace||Jy(`sentry-trace`)||Yy(`sentry-trace`),n.baggage||Jy(`baggage`)||Yy(`baggage`)),i=rl();i.setPropagationContext(r),Ou()||(i.getPropagationContext().propagationSpanId=jc()),i.setSDKProcessingMetadata({normalizedRequest:mh()}),N(e,{op:`pageload`,...t})}),e.on(`endPageloadSpan`,()=>{E&&M&&(M.setAttribute(ml,`reportPageLoaded`),M.end())})},afterAllSetup(e){if(k)return;let n=Us();if(w!==`off`&&Iy(e,{linkPreviousTrace:w,consistentTraceSampling:T}),lh.location){if(x){let t=wc();Ky(e,{name:lh.location.pathname,startTime:t?t/1e3:void 0,attributes:{[ll]:`url`,[pl]:`auto.pageload.browser`}})}S&&cv(({to:t,from:r})=>{if(r===void 0&&n?.indexOf(t)!==-1){n=void 0;return}n=void 0;let i=of(t),a=Qy(e),o=a&&C&&tb(a,j);qy(e,{name:i?.pathname||lh.location.pathname,attributes:{[ll]:`url`,[pl]:`auto.navigation.browser`}},{url:t,isRedirect:o})})}p&&Ny(),o&&Xy(e,u,d,f,t),r&&U_(),Ey(e,{traceFetch:m,traceXHR:h,trackFetchStreamPerformance:g,tracePropagationTargets:e.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:_,enableHTTPTimings:v,onRequestSpanStart:D,onRequestSpanEnd:O})}}});function Ky(e,t,n){e.emit(`startPageLoadSpan`,t,n),rl().setTransactionName(t.name);let r=Qy(e);return r&&e.emit(`afterStartPageLoadSpan`,r),r}function qy(e,t,n){let{url:r,isRedirect:i}=n||{};e.emit(`beforeStartNavigationSpan`,t,{isRedirect:i}),e.emit(`startNavigationSpan`,t,{isRedirect:i});let a=rl();return a.setTransactionName(t.name),r&&!i&&a.setSDKProcessingMetadata({normalizedRequest:{...mh(),url:r}}),Qy(e)}function Jy(e){return(lh.document?.querySelector(`meta[name=${e}]`))?.getAttribute(`content`)||void 0}function Yy(e){return(lh.performance?.getEntriesByType?.(`navigation`)[0])?.serverTiming?.find(t=>t.name===e)?.description}function Xy(e,t,n,r,i){let a=lh.document,o;a&&addEventListener(`click`,()=>{let a=`ui.action.click`,s=Qy(e);if(s){let e=cu(s).op;if([`navigation`,`pageload`].includes(e)){xv&&G.warn(`[Tracing] Did not create ${a} span because a pageload or navigation span is in progress.`);return}}if(o&&=(o.setAttribute(ml,`interactionInterrupted`),o.end(),void 0),!i.name){xv&&G.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}o=Kd({name:i.name,op:a,attributes:{[ll]:i.source||`url`}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})},{capture:!0})}var Zy=`_sentry_idleSpan`;function Qy(e){return e[Zy]}function $y(e,t){Ks(e,Zy,t)}var eb=1.5;function tb(e,t){let n=cu(e),r=vc();return!(r-n.start_timestamp>eb||t&&r-t<=eb)}var nb=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,rb=new WeakSet;function ib(e,t){let n=Gy({...e,instrumentPageLoad:!1,instrumentNavigation:!1}),{useEffect:r,useLocation:i,useNavigationType:a,createRoutesFromChildren:o,matchRoutes:s,stripBasename:c,enableAsyncRouteHandlers:l=!1,instrumentPageLoad:u=!0,instrumentNavigation:d=!0,lazyRouteTimeout:f,lazyRouteManifest:p}=e;return{...n,setup(t){n.setup(t);let r=e.finalTimeout??3e4,i=(e.idleTimeout??1e3)*3,a=f??i;a===1/0?nb&&G.log(`[React Router] lazyRouteTimeout set to Infinity, capping at finalTimeout:`,r,`ms to prevent indefinite hangs`):Number.isNaN(a)?nb&&G.warn(`[React Router] lazyRouteTimeout must be a number, falling back to default:`,i):a<0&&nb&&G.warn(`[React Router] lazyRouteTimeout must be non-negative or Infinity, got:`,a,`falling back to:`,i)},afterAllSetup(e){n.afterAllSetup(e);let r=lh.location?.pathname;u&&r&&Ky(e,{name:r,attributes:{[ll]:`url`,[fl]:`pageload`,[pl]:`auto.pageload.react.reactrouter_v${t}`}}),d&&rb.add(e)}}}function ab(e){return ib(e,`6`)}function ob(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function sb(...e){return t=>{let n=!1,r=e.map(e=>{let r=ob(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():ob(e[t],null)}}}}var cb=Symbol.for(`react.lazy`),lb=h.use;function ub(e){return typeof e==`object`&&!!e&&`then`in e}function db(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===cb&&`_payload`in e&&ub(e._payload)}function fb(e){let t=mb(e),r=h.forwardRef((e,r)=>{let{children:i,...a}=e;db(i)&&typeof lb==`function`&&(i=lb(i._payload));let o=h.Children.toArray(i),s=o.find(gb);if(s){let e=s.props.children,i=o.map(t=>t===s?h.Children.count(e)>1?h.Children.only(null):h.isValidElement(e)?e.props.children:null:t);return(0,n.jsx)(t,{...a,ref:r,children:h.isValidElement(e)?h.cloneElement(e,void 0,i):null})}return(0,n.jsx)(t,{...a,ref:r,children:i})});return r.displayName=`${e}.Slot`,r}var pb=fb(`Slot`);function mb(e){let t=h.forwardRef((e,t)=>{let{children:n,...r}=e;if(db(n)&&typeof lb==`function`&&(n=lb(n._payload)),h.isValidElement(n)){let e=vb(n),i=_b(r,n.props);return n.type!==h.Fragment&&(i.ref=t?sb(t,e):e),h.cloneElement(n,i)}return h.Children.count(n)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hb=Symbol(`radix.slottable`);function gb(e){return h.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===hb}function _b(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function vb(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var yb=(e,t,n)=>{let r=t.lastIndexOf(`?`),i=e[r===-1||r<t.lastIndexOf(`/`)?t:t.slice(0,r)];return i?typeof i==`function`?i():Promise.resolve(i):new Promise((e,r)=>{(typeof queueMicrotask==`function`?queueMicrotask:setTimeout)(r.bind(null,Error(`Unknown variable dynamic import: `+t+(t.split(`/`).length===n?``:`. Note that variables only represent file names one level deep.`))))})},bb=({svgComponent:e,...t})=>(0,n.jsx)(e,{...t});function xb(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=xb(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Sb(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=xb(e))&&(r&&(r+=` `),r+=t);return r}var Cb=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,wb=Sb,Tb=(e,t)=>n=>{if(t?.variants==null)return wb(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Cb(t)||Cb(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return wb(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Eb=Tb(`aspect-square`,{variants:{size:{"2xs":`h-3 w-3`,xs:`h-4 w-4`,sm:`h-5 w-5`,md:`h-6 w-6`,lg:`h-7 w-7`,xl:`h-8 w-8`,"2xl":`h-10 w-10`},variant:{primary:`fill-none stroke-core-white-900 stroke-[1.5]`,secondary:`fill-none stroke-core-gray-400 stroke-[1.5] active:stroke-core-gray-900 `,discovery:`fill-none stroke-core-primary-500 stroke-[1.5] `,destructive:`fill-none stroke-core-red-700 stroke-[1.5] `,placeholder:`fill-none stroke-core-gray-300 stroke-[1.5]`},outline:{true:[],false:[]}},compoundVariants:[{variant:`placeholder`,outline:!1,class:`fill-core-gray-300 stroke-width-0`}],defaultVariants:{variant:`placeholder`,size:`md`}}),Db=f({default:()=>Ob}),Ob,kb=u((()=>{Ob=e=>(0,n.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,n.jsx)(`path`,{d:`M8 4.75V8.25M16 4.75V8.25M7.75 10.75H16.25M6.75 19.25H17.25C18.3546 19.25 19.25 18.3546 19.25 17.25V8.75C19.25 7.64543 18.3546 6.75 17.25 6.75H6.75C5.64543 6.75 4.75 7.64543 4.75 8.75V17.25C4.75 18.3546 5.64543 19.25 6.75 19.25Z`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`})})})),Ab=f({default:()=>jb}),jb,Mb=u((()=>{jb=e=>(0,n.jsx)(`svg`,{height:24,viewBox:`0 0 24 24`,width:24,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,n.jsx)(`path`,{d:`m21.25 7.5c.3796958 0 .693491.28215388.7431534.64822944l.0068466.10177056v8.5c0 1.7330315-1.3564548 3.1492459-3.0655761 3.2448552l-.1844239.0051448h-12.689l.71933009.7196699c.26626656.2662666.29047261.6829303.07261815.9765418l-.07261815.0841184c-.26626657.2662665-.68293025.2904726-.97654174.0726181l-.08411844-.0726181-2-2-.06339799-.0720275c-.00244939-.0031685-.00487398-.0063571-.00727348-.0095656l.07067147.0815931c-.03705327-.0370533-.06941902-.077019-.09709724-.1191603-.01316484-.0201549-.025545-.0411423-.03690171-.0627516-.00483354-.0091218-.00919014-.0178526-.01336588-.0266478-.01274712-.0267885-.02425172-.0552483-.03400215-.0845099-.00225837-.0069437-.00418282-.0130149-.00602813-.019105-.02092163-.0684786-.0322748-.1419912-.0322748-.2181555 0-.0383922.00288471-.0761107.00844919-.1129505.00180466-.0115676.0038603-.0232773.00619514-.0349422.00494363-.0250031.01111685-.0492994.01844184-.073091.00362656-.0116598.00765847-.0237092.01200456-.0356703.00848426-.0232976.01778613-.0453662.02808241-.0668678.00549219-.0116011.01179514-.0239381.01846187-.0361292.01323523-.0240158.02734042-.0467392.04258121-.0686124.00392129-.0057417.00832657-.0118713.01283554-.0179483.0251194-.0332177.04801831-.0595185.07261815-.0841184l2-2c.29289322-.2928932.76776696-.2928932 1.06066018 0 .26626656.2662666.29047261.6829303.07261815.9765418l-.07261815.0841184-.72033009.7196699h12.69c.9181734 0 1.6711923-.7071103 1.7441988-1.6064728l.0058012-.1435272v-8.5c0-.41421356.3357864-.75.75-.75zm-3.0537883-5.35294824.0841184.07261815 2 2c.0254481.02544812.049076.05271652.0706715.08159313l-.0706715-.08159313c.0370533.03705328.069419.07701901.0970972.1191603.0131649.02015493.025545.04114226.0369017.06275154.0048336.00912187.0091902.01785262.0133659.02664784.0127471.02678853.0242517.0552483.0340022.08450994.0022583.00694369.0041828.01301489.0060281.01910493.0209216.06847868.0322748.14199127.0322748.21815554 0 .03839224-.0028847.07611073-.0084492.11295053-.0014988.0095454-.0031606.01924362-.0050138.02891241-.0051364.02710922-.0117072.05340972-.0196232.07912072-.0036265.0116598-.0076584.02370928-.0120045.03567032-.0084843.02329763-.0177862.04536621-.0280824.06686781-.0054922.01160108-.0117952.02393815-.0184619.03612923-.0132352.02401575-.0273404.04673917-.0425812.06861233-.0039213.00574174-.0083266.01187138-.0128356.0179483-.023778.03144192-.0451015.05615345-.0679264.07938506l-.0046917.00473338-2 2c-.2928932.29289321-.767767.29289321-1.0606602 0-.2662665-.26626657-.2904726-.68293025-.0726181-.97654174l.0726181-.08411844.7183301-.71966991h-12.688c-.9181734 0-1.67119234.70711027-1.7441988 1.60647279l-.0058012.14352721v8.5c0 .4142136-.33578644.75-.75.75-.37969577 0-.69349096-.2821539-.74315338-.6482294l-.00684662-.1017706v-8.5c0-1.73303146 1.35645477-3.14924593 3.06557609-3.24485521l.18442391-.00514479h12.689l-.7193301-.71966991c-.2662665-.26626657-.2904726-.68293025-.0726181-.97654174l.0726181-.08411844c.2662666-.26626656.6829303-.29047261.9765418-.07261815zm-6.1962117 5.85294824c2.209139 0 4 1.790861 4 4s-1.790861 4-4 4-4-1.790861-4-4 1.790861-4 4-4zm0 1.5c-1.3807119 0-2.5 1.1192881-2.5 2.5s1.1192881 2.5 2.5 2.5 2.5-1.1192881 2.5-2.5-1.1192881-2.5-2.5-2.5z`,fill:`#212121`})})})),Nb=f({default:()=>Pb}),Pb,Fb=u((()=>{Pb=e=>(0,n.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,n.jsx)(`path`,{d:`M13.25 8.75L9.75 12L13.25 15.25`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`})})})),Ib=f({default:()=>Lb}),Lb,Rb=u((()=>{Lb=e=>(0,n.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,...e,children:(0,n.jsx)(`path`,{d:`M17.25 6.75L6.75 17.25M6.75 6.75L17.25 17.25`,strokeLinecap:`round`,strokeLinejoin:`round`})})})),zb=f({default:()=>Bb}),Bb,Vb=u((()=>{Bb=e=>(0,n.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,n.jsx)(`path`,{d:`M4.7002 4.70016L11.2999 11.2998`,stroke:`#000`,strokeWidth:1.8,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,n.jsx)(`path`,{d:`M11.2998 4.70016L4.70014 11.2998`,stroke:`#000`,strokeWidth:1.8,strokeLinecap:`round`,strokeLinejoin:`round`})]})})),Hb=f({default:()=>Ub}),Ub,Wb=u((()=>{Ub=e=>(0,n.jsxs)(`svg`,{width:24,height:24,fill:`none`,viewBox:`0 0 24 24`,...e,children:[(0,n.jsx)(`circle`,{cx:12,cy:12,r:7.25,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.5}),(0,n.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.5,d:`M14.25 8.75H11.375C10.4775 8.75 9.75 9.47754 9.75 10.375V10.375C9.75 11.2725 10.4775 12 11.375 12H12.625C13.5225 12 14.25 12.7275 14.25 13.625V13.625C14.25 14.5225 13.5225 15.25 12.625 15.25H9.75`}),(0,n.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.5,d:`M12 7.75V8.25`}),(0,n.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.5,d:`M12 15.75V16.25`})]})})),Gb=f({default:()=>Kb}),Kb,qb=u((()=>{Kb=e=>(0,n.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,...e,children:(0,n.jsx)(`path`,{d:`M19.25 19.25H13.75M9 18.25L4.75 19.25L5.75 15L15.0429 5.70711C15.4334 5.31658 16.0666 5.31658 16.4571 5.70711L18.2929 7.54289C18.6834 7.93342 18.6834 8.56658 18.2929 8.95711L9 18.25Z`,strokeLinecap:`round`,strokeLinejoin:`round`})})})),Jb=f({default:()=>Yb}),Yb,Xb=u((()=>{Yb=e=>(0,n.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,n.jsx)(`path`,{d:`M6.75024 19.2502H17.2502C18.3548 19.2502 19.2502 18.3548 19.2502 17.2502V9.75025L12.0002 4.75024L4.75024 9.75025V17.2502C4.75024 18.3548 5.64568 19.2502 6.75024 19.2502Z`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,n.jsx)(`path`,{d:`M9.74963 15.7493C9.74963 14.6447 10.6451 13.7493 11.7496 13.7493H12.2496C13.3542 13.7493 14.2496 14.6447 14.2496 15.7493V19.2493H9.74963V15.7493Z`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`})]})})),Zb=f({default:()=>Qb}),Qb,$b=u((()=>{Qb=e=>(0,n.jsxs)(`svg`,{width:24,height:24,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,...e,children:[(0,n.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M12 13V15`}),(0,n.jsx)(`circle`,{cx:12,cy:9,r:.5}),(0,n.jsx)(`circle`,{cx:12,cy:12,r:7.25,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.5})]})})),ex=f({default:()=>tx}),tx,nx=u((()=>{tx=e=>(0,n.jsx)(`svg`,{width:331,height:297,viewBox:`0 0 331 297`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,n.jsx)(`path`,{d:`M260.633 120.233C256.252 141.975 249.682 152.798 240.921 152.798C234.584 152.798 229.087 148.853 224.473 140.869C219.859 132.931 213.661 120.233 205.88 102.869C196.606 81.8482 188.078 64.6769 180.297 51.2559C172.516 37.8843 162.543 26.0991 150.381 15.9495C138.171 5.84943 123.585 0.750732 106.531 0.750732C66.1304 0.750732 37.5648 28.4561 20.7431 83.8685C8.56966 124.042 1.84252 172.378 0.554243 228.779C0.43324 234.077 0.372738 236.726 1.39875 238.822C2.29091 240.644 3.79168 242.18 5.59324 243.113C7.66509 244.187 10.3571 244.187 15.7412 244.187H49.9832C55.1593 244.187 57.7474 244.187 59.7252 243.228C61.4991 242.369 62.8933 241.064 63.8691 239.352C64.9571 237.442 65.1344 234.785 65.489 229.471C66.8596 208.929 69.3476 191.707 72.9797 177.809C78.8046 155.346 86.5875 144.139 96.3253 144.139C103.13 144.139 109.001 148.131 113.848 156.068C118.693 164.053 125.264 177.425 133.558 196.281C146.234 227.402 159.374 251.837 172.982 269.586C186.634 287.335 205.135 296.186 228.48 296.186C267.948 296.186 295.536 268.672 311.379 213.645C322.875 173.601 329.307 125.115 330.648 68.1882C330.773 62.8736 330.836 60.2162 329.81 58.1189C328.918 56.2936 327.419 54.7593 325.615 53.8241C323.543 52.7496 320.846 52.7496 315.451 52.7496H281.752C276.521 52.7496 273.906 52.7496 271.908 53.7319C270.126 54.6081 268.711 55.9568 267.751 57.6953C266.675 59.6442 266.547 62.3114 266.293 67.6459C265.272 89.0314 263.387 106.562 260.633 120.233Z`,fill:`currentColor`})})})),rx=f({default:()=>ix}),ix,ax=u((()=>{ix=e=>(0,n.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,...e,children:(0,n.jsx)(`path`,{d:`M5.5 6.5L12 12.25L18.5 6.5M6.75 18.25H17.25C18.3546 18.25 19.25 17.3546 19.25 16.25V7.75C19.25 6.64543 18.3546 5.75 17.25 5.75H6.75C5.64543 5.75 4.75 6.64543 4.75 7.75V16.25C4.75 17.3546 5.64543 18.25 6.75 18.25Z`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`})})})),ox=f({default:()=>sx}),sx,cx=u((()=>{sx=e=>(0,n.jsxs)(`svg`,{width:32,height:32,viewBox:`0 0 32 32`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,n.jsxs)(`g`,{clipPath:`url(#clip0_17_95)`,children:[(0,n.jsx)(`rect`,{width:32,height:32,rx:4,fill:`#FEF3F2`}),(0,n.jsx)(`path`,{d:`M12.0003 12L20.0003 20M12.0003 20L20.0003 12`,stroke:`#E02731`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`})]}),(0,n.jsx)(`defs`,{children:(0,n.jsx)(`clipPath`,{id:`clip0_17_95`,children:(0,n.jsx)(`path`,{d:`M0 16C0 7.16344 7.16344 0 16 0V0C24.8366 0 32 7.16344 32 16V16C32 24.8366 24.8366 32 16 32V32C7.16344 32 0 24.8366 0 16V16Z`,fill:`white`})})})]})})),lx=f({default:()=>ux}),ux,dx=u((()=>{ux=e=>(0,n.jsxs)(`svg`,{width:32,height:32,viewBox:`0 0 32 32`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,n.jsxs)(`g`,{clipPath:`url(#clip0_15_20)`,children:[(0,n.jsx)(`rect`,{width:32,height:32,rx:4,fill:`#E7FBF4`}),(0,n.jsx)(`path`,{d:`M10.6668 17.3333L14.6668 20L21.3335 12`,stroke:`#039855`,strokeWidth:1.6875,strokeLinecap:`round`,strokeLinejoin:`round`})]}),(0,n.jsx)(`defs`,{children:(0,n.jsx)(`clipPath`,{id:`clip0_15_20`,children:(0,n.jsx)(`path`,{d:`M0 16C0 7.16344 7.16344 0 16 0V0C24.8366 0 32 7.16344 32 16V16C32 24.8366 24.8366 32 16 32V32C7.16344 32 0 24.8366 0 16V16Z`,fill:`white`})})})]})})),fx=f({default:()=>px}),px,mx=u((()=>{px=e=>(0,n.jsxs)(`svg`,{width:32,height:32,viewBox:`0 0 32 32`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,n.jsxs)(`g`,{clipPath:`url(#clip0_17_99)`,children:[(0,n.jsx)(`rect`,{width:32,height:32,rx:4,fill:`#FFFAEB`}),(0,n.jsx)(`path`,{d:`M16.0002 17.3333V13.3333M16.0002 20V20.0067M23.0353 19.3333L17.942 10.456C17.0833 8.95867 14.9167 8.95867 14.058 10.456L8.96533 19.3333C8.11266 20.8187 9.18933 22.6667 10.9073 22.6667H21.0933C22.8107 22.6667 23.8873 20.8187 23.0353 19.3333Z`,stroke:`#CFAA25`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`})]}),(0,n.jsx)(`defs`,{children:(0,n.jsx)(`clipPath`,{id:`clip0_17_99`,children:(0,n.jsx)(`path`,{d:`M0 16C0 7.16344 7.16344 0 16 0C24.8366 0 32 7.16344 32 16C32 24.8366 24.8366 32 16 32C7.16344 32 0 24.8366 0 16Z`,fill:`white`})})})]})})),hx=f({default:()=>gx}),gx,_x=u((()=>{gx=e=>(0,n.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,n.jsx)(`path`,{d:`M13.1191 5.61336C13.0508 5.11856 12.6279 4.75 12.1285 4.75H11.8715C11.3721 4.75 10.9492 5.11856 10.8809 5.61336L10.7938 6.24511C10.7382 6.64815 10.4403 6.96897 10.0622 7.11922C10.006 7.14156 9.95021 7.16484 9.89497 7.18905C9.52217 7.3524 9.08438 7.3384 8.75876 7.09419L8.45119 6.86351C8.05307 6.56492 7.49597 6.60451 7.14408 6.9564L6.95641 7.14408C6.60452 7.49597 6.56492 8.05306 6.86351 8.45118L7.09419 8.75876C7.33841 9.08437 7.3524 9.52216 7.18905 9.89497C7.16484 9.95021 7.14156 10.006 7.11922 10.0622C6.96897 10.4403 6.64815 10.7382 6.24511 10.7938L5.61336 10.8809C5.11856 10.9492 4.75 11.372 4.75 11.8715V12.1285C4.75 12.6279 5.11856 13.0508 5.61336 13.1191L6.24511 13.2062C6.64815 13.2618 6.96897 13.5597 7.11922 13.9378C7.14156 13.994 7.16484 14.0498 7.18905 14.105C7.3524 14.4778 7.3384 14.9156 7.09419 15.2412L6.86351 15.5488C6.56492 15.9469 6.60451 16.504 6.9564 16.8559L7.14408 17.0436C7.49597 17.3955 8.05306 17.4351 8.45118 17.1365L8.75876 16.9058C9.08437 16.6616 9.52216 16.6476 9.89496 16.811C9.95021 16.8352 10.006 16.8584 10.0622 16.8808C10.4403 17.031 10.7382 17.3519 10.7938 17.7549L10.8809 18.3866C10.9492 18.8814 11.3721 19.25 11.8715 19.25H12.1285C12.6279 19.25 13.0508 18.8814 13.1191 18.3866L13.2062 17.7549C13.2618 17.3519 13.5597 17.031 13.9378 16.8808C13.994 16.8584 14.0498 16.8352 14.105 16.8109C14.4778 16.6476 14.9156 16.6616 15.2412 16.9058L15.5488 17.1365C15.9469 17.4351 16.504 17.3955 16.8559 17.0436L17.0436 16.8559C17.3955 16.504 17.4351 15.9469 17.1365 15.5488L16.9058 15.2412C16.6616 14.9156 16.6476 14.4778 16.811 14.105C16.8352 14.0498 16.8584 13.994 16.8808 13.9378C17.031 13.5597 17.3519 13.2618 17.7549 13.2062L18.3866 13.1191C18.8814 13.0508 19.25 12.6279 19.25 12.1285V11.8715C19.25 11.3721 18.8814 10.9492 18.3866 10.8809L17.7549 10.7938C17.3519 10.7382 17.031 10.4403 16.8808 10.0622C16.8584 10.006 16.8352 9.95021 16.8109 9.89496C16.6476 9.52216 16.6616 9.08437 16.9058 8.75875L17.1365 8.4512C17.4351 8.05308 17.3955 7.49599 17.0436 7.1441L16.8559 6.95642C16.504 6.60453 15.9469 6.56494 15.5488 6.86353L15.2412 7.09419C14.9156 7.33841 14.4778 7.3524 14.105 7.18905C14.0498 7.16484 13.994 7.14156 13.9378 7.11922C13.5597 6.96897 13.2618 6.64815 13.2062 6.24511L13.1191 5.61336Z`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,n.jsx)(`path`,{d:`M13.25 12C13.25 12.6904 12.6904 13.25 12 13.25C11.3096 13.25 10.75 12.6904 10.75 12C10.75 11.3096 11.3096 10.75 12 10.75C12.6904 10.75 13.25 11.3096 13.25 12Z`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`})]})})),vx=f({default:()=>yx}),yx,bx=u((()=>{yx=e=>(0,n.jsxs)(`svg`,{width:24,height:24,fill:`none`,viewBox:`0 0 24 24`,...e,children:[(0,n.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.5,d:`M18.25 7.75H5.75V16.75L4.75 19.25H19.25L18.25 16.75V7.75Z`}),(0,n.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.5,d:`M18.25 7.75L16.25 4.75H7.75L5.75 7.75`}),(0,n.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.5,d:`M9.75 10.75V11.75C9.75 12.9926 10.7574 14 12 14V14C13.2426 14 14.25 12.9926 14.25 11.75V10.75`})]})})),xx=f({default:()=>Sx}),Sx,Cx=u((()=>{Sx=e=>(0,n.jsx)(`svg`,{width:24,height:24,fill:`none`,viewBox:`0 0 24 24`,...e,children:(0,n.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.5,d:`M12 4.75L13.75 10.25H19.25L14.75 13.75L16.25 19.25L12 15.75L7.75 19.25L9.25 13.75L4.75 10.25H10.25L12 4.75Z`})})})),wx=f({default:()=>Tx}),Tx,Ex=u((()=>{Tx=e=>(0,n.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,n.jsx)(`path`,{d:`M15.25 8C15.25 9.79493 13.7949 11.25 12 11.25C10.205 11.25 8.74997 9.79493 8.74997 8C8.74997 6.20507 10.205 4.75 12 4.75C13.7949 4.75 15.25 6.20507 15.25 8Z`}),(0,n.jsx)(`path`,{d:`M6.84748 19.25H17.1525C18.2944 19.25 19.174 18.2681 18.6407 17.2584C17.8563 15.7731 16.068 14 12 14C7.93198 14 6.14364 15.7731 5.35921 17.2584C4.82594 18.2681 5.70556 19.25 6.84748 19.25Z`})]})})),Dx=({icon:e=`user`,size:t=`md`,variant:r=`placeholder`,outline:i=!0})=>{if(h.default.isValidElement(e))return`span`;let a=Ox(e);return a?(0,n.jsx)(bb,{svgComponent:a,className:Eb({variant:r,size:t,outline:i})}):null};function Ox(e){let[t,n]=(0,h.useState)(null),r=async()=>{try{let t=(await yb(Object.assign({"../../assets/svg/calendar.svg":()=>Promise.resolve().then(()=>(kb(),Db)),"../../assets/svg/camera-switch.svg":()=>Promise.resolve().then(()=>(Mb(),Ab)),"../../assets/svg/caret-left.svg":()=>Promise.resolve().then(()=>(Fb(),Nb)),"../../assets/svg/close.svg":()=>Promise.resolve().then(()=>(Rb(),Ib)),"../../assets/svg/crossBlack.svg":()=>Promise.resolve().then(()=>(Vb(),zb)),"../../assets/svg/dollar.svg":()=>Promise.resolve().then(()=>(Wb(),Hb)),"../../assets/svg/edit.svg":()=>Promise.resolve().then(()=>(qb(),Gb)),"../../assets/svg/home.svg":()=>Promise.resolve().then(()=>(Xb(),Jb)),"../../assets/svg/information.svg":()=>Promise.resolve().then(()=>($b(),Zb)),"../../assets/svg/leat_logo.svg":()=>Promise.resolve().then(()=>(nx(),ex)),"../../assets/svg/mail.svg":()=>Promise.resolve().then(()=>(ax(),rx)),"../../assets/svg/notificationErrorV2.svg":()=>Promise.resolve().then(()=>(cx(),ox)),"../../assets/svg/notificationSuccessV2.svg":()=>Promise.resolve().then(()=>(dx(),lx)),"../../assets/svg/notificationWarningV2.svg":()=>Promise.resolve().then(()=>(mx(),fx)),"../../assets/svg/settings.svg":()=>Promise.resolve().then(()=>(_x(),hx)),"../../assets/svg/shopping-bag.svg":()=>Promise.resolve().then(()=>(bx(),vx)),"../../assets/svg/star.svg":()=>Promise.resolve().then(()=>(Cx(),xx)),"../../assets/svg/user.svg":()=>Promise.resolve().then(()=>(Ex(),wx))}),`../../assets/svg/${e}.svg?react`,5)).default;n(()=>t)}catch(t){console.error(`Failed to import icon: ${e}`,t),n(null)}};return(0,h.useEffect)(()=>{r()},[e]),t}var kx=Tb(`group inline-flex shrink-0 select-none items-center justify-center rounded-lg font-medium antialiased transition-colors duration-100 hover:shadow-none focus:outline-0 focus:outline-core-primary-500 focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-2 disabled:pointer-events-none`,{variants:{size:{sm:`h-8 gap-1 px-2 py-1 text-xs leading-4`,md:`h-10 gap-1 px-3 py-2 text-sm leading-5`,lg:`h-12 gap-1 px-3 py-3 text-base leading-6`},variant:{primary:`bg-core-primary-500 text-core-white-900 outline-primary hover:bg-core-primary-600 disabled:bg-core-primary-disabled`,secondary:`box-border border border-core-gray-200 bg-core-white-900 shadow-xs hover:bg-core-gray-50 disabled:opacity-30`,destructive:`bg-core-red-500 text-core-white-900 hover:bg-core-red-600 focus:outline-core-red-500 disabled:bg-core-red-200`,"destructive-outline":`box-border border border-core-red-200 text-core-red-700 shadow-xs hover:bg-core-red-50 focus:outline-core-red-500 disabled:opacity-40`,"link-gray":`bg-transparent underline-offset-2 hover:bg-surface hover:underline disabled:opacity-30`}},defaultVariants:{variant:`primary`,size:`md`}}),Ax={primary:`primary`,secondary:`secondary`,destructive:`primary`,"destructive-outline":`destructive`,"link-gray":`secondary`},jx={sm:`xs`,md:`sm`,lg:`md`},Mx=h.default.forwardRef(({after:e,asChild:t=!1,before:r,children:i,className:a,variant:o=`primary`,size:s=`md`,pending:c=!1,disabled:l=!1,onClick:u,...d},f)=>{let p=t?pb:`button`,m=e=>(0,Jn.default)(`group-hover:opacity-70`,e.props?.className),h=e=>e.props?.icon??`user`;return(0,n.jsxs)(p,{className:(0,Jn.default)(kx({variant:o,size:s}),a),disabled:l||c,onClick:u,ref:f,...d,children:[(0,n.jsxs)(`span`,{className:`flex items-center gap-1 ${c&&`opacity-0`}`,children:[r&&(0,n.jsx)(Dx,{className:m(r),icon:h(r),variant:Ax[o],size:jx[s]}),i,e&&(0,n.jsx)(Dx,{className:(0,Jn.default)(m(e),`${c&&`opacity-0`}`),icon:h(e),variant:Ax[o],size:jx[s]})]}),c&&(0,n.jsx)(Yn,{className:`absolute`})]})});Mx.displayName=`Button`;function Nx(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function Px(e={}){let{initialEntries:t=[`/`],initialIndex:n,v5Compat:r=!1}=e,i;i=t.map((e,t)=>u(e,typeof e==`string`?null:e.state,t===0?`default`:void 0,typeof e==`string`?void 0:e.mask));let a=c(n??i.length-1),o=`POP`,s=null;function c(e){return Math.min(Math.max(e,0),i.length-1)}function l(){return i[a]}function u(e,t=null,n,r){let a=Rx(i?l().pathname:`/`,e,t,n,r);return Ix(a.pathname.charAt(0)===`/`,`relative pathnames are not supported in memory history: ${JSON.stringify(e)}`),a}function d(e){return typeof e==`string`?e:zx(e)}return{get index(){return a},get action(){return o},get location(){return l()},createHref:d,createURL(e){return new URL(d(e),`http://localhost`)},encodeLocation(e){let t=typeof e==`string`?Bx(e):e;return{pathname:t.pathname||``,search:t.search||``,hash:t.hash||``}},push(e,t){o=`PUSH`;let n=Nx(e)?e:u(e,t);a+=1,i.splice(a,i.length,n),r&&s&&s({action:o,location:n,delta:1})},replace(e,t){o=`REPLACE`;let n=Nx(e)?e:u(e,t);i[a]=n,r&&s&&s({action:o,location:n,delta:0})},go(e){o=`POP`;let t=c(a+e),n=i[t];a=t,s&&s({action:o,location:n,delta:e})},listen(e){return s=e,()=>{s=null}}}}function Fx(e,t){if(e===!1||e==null)throw Error(t)}function Ix(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function Lx(){return Math.random().toString(36).substring(2,10)}function Rx(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?Bx(t):t,state:n,key:t&&t.key||r||Lx(),mask:i}}function zx({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function Bx(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Vx(e,t,n=`/`){return Hx(e,t,n,!1)}function Hx(e,t,n,r,i){let a=sS((typeof t==`string`?Bx(t):t).pathname||`/`,n);if(a==null)return null;let o=i??Wx(e),s=null,c=oS(a);for(let e=0;s==null&&e<o.length;++e)s=rS(o[e],c,r);return s}function Ux(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function Wx(e){let t=Gx(e);return qx(t),t}function Gx(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;Fx(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=gS([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(Fx(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Gx(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:tS(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of Kx(e.path))a(e,t,!0,n)}),t}function Kx(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=Kx(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function qx(e){e.sort((e,t)=>e.score===t.score?nS(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Jx=/^:[\w-]+$/,Yx=3,Xx=2,Zx=1,Qx=10,$x=-2,eS=e=>e===`*`;function tS(e,t){let n=e.split(`/`),r=n.length;return n.some(eS)&&(r+=$x),t&&(r+=Xx),n.filter(e=>!eS(e)).reduce((e,t)=>e+(Jx.test(t)?Yx:t===``?Zx:Qx),r)}function nS(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function rS(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=iS({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=iS({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:gS([a,u.pathname]),pathnameBase:vS(gS([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=gS([a,u.pathnameBase]))}return o}function iS(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=aS(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function aS(e,t=!1,n=!0){Ix(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function oS(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return Ix(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function sS(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}var cS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function lS(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?Bx(e):e,a;return n?(n=hS(n),a=n.startsWith(`/`)?uS(n.substring(1),`/`):uS(n,t)):a=t,{pathname:a,search:yS(r),hash:bS(i)}}function uS(e,t){let n=_S(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function dS(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function fS(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function pS(e){let t=fS(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function mS(e,t,n,r=!1){let i;typeof e==`string`?i=Bx(e):(i={...e},Fx(!i.pathname||!i.pathname.includes(`?`),dS(`?`,`pathname`,`search`,i)),Fx(!i.pathname||!i.pathname.includes(`#`),dS(`#`,`pathname`,`hash`,i)),Fx(!i.search||!i.search.includes(`#`),dS(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=lS(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var hS=e=>e.replace(/\/\/+/g,`/`),gS=e=>hS(e.join(`/`)),_S=e=>e.replace(/\/+$/,``),vS=e=>_S(e).replace(/^\/*/,`/`),yS=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,bS=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,xS=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function SS(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function CS(e){return gS(e.map(e=>e.route.path).filter(Boolean))||`/`}var wS=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function TS(e,t){let n=e;if(typeof n!=`string`||!cS.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(wS)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=sS(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{Ix(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var ES=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(ES);var DS=[`GET`,...ES];new Set(DS);var OS=h.createContext(null);OS.displayName=`DataRouter`;var kS=h.createContext(null);kS.displayName=`DataRouterState`;var AS=h.createContext(!1);function jS(){return h.useContext(AS)}var MS=h.createContext({isTransitioning:!1});MS.displayName=`ViewTransition`;var NS=h.createContext(new Map);NS.displayName=`Fetchers`;var PS=h.createContext(null);PS.displayName=`Await`;var FS=h.createContext(null);FS.displayName=`Navigation`;var IS=h.createContext(null);IS.displayName=`Location`;var LS=h.createContext({outlet:null,matches:[],isDataRoute:!1});LS.displayName=`Route`;var RS=h.createContext(null);RS.displayName=`RouteError`;var zS=`REACT_ROUTER_ERROR`,BS=`REDIRECT`,VS=`ROUTE_ERROR_RESPONSE`;function HS(e){if(e.startsWith(`${zS}:${BS}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function US(e){if(e.startsWith(`${zS}:${VS}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new xS(t.status,t.statusText,t.data)}catch{}}function WS(e,{relative:t}={}){Fx(GS(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=h.useContext(FS),{hash:i,pathname:a,search:o}=tC(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:gS([n,a])),r.createHref({pathname:s,search:o,hash:i})}function GS(){return h.useContext(IS)!=null}function KS(){return Fx(GS(),`useLocation() may be used only in the context of a <Router> component.`),h.useContext(IS).location}function qS(){return h.useContext(IS).navigationType}var JS=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function YS(e){h.useContext(FS).static||h.useLayoutEffect(e)}function XS(){let{isDataRoute:e}=h.useContext(LS);return e?bC():ZS()}function ZS(){Fx(GS(),`useNavigate() may be used only in the context of a <Router> component.`);let e=h.useContext(OS),{basename:t,navigator:n}=h.useContext(FS),{matches:r}=h.useContext(LS),{pathname:i}=KS(),a=JSON.stringify(pS(r)),o=h.useRef(!1);return YS(()=>{o.current=!0}),h.useCallback((r,s={})=>{if(Ix(o.current,JS),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=mS(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:gS([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var QS=h.createContext(null);function $S(e){let t=h.useContext(LS).outlet;return h.useMemo(()=>t&&h.createElement(QS.Provider,{value:e},t),[t,e])}function eC(){let{matches:e}=h.useContext(LS);return e[e.length-1]?.params??{}}function tC(e,{relative:t}={}){let{matches:n}=h.useContext(LS),{pathname:r}=KS(),i=JSON.stringify(pS(n));return h.useMemo(()=>mS(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function nC(e,t){return rC(e,t)}function rC(e,t,n){Fx(GS(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=h.useContext(FS),{matches:i}=h.useContext(LS),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;SC(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
22
|
+
|
|
23
|
+
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=KS(),d;if(t){let e=typeof t==`string`?Bx(t):t;Fx(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):Vx(e,{pathname:p});Ix(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),Ix(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let g=uC(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:gS([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:gS([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&g?h.createElement(IS.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},g):g}function iC(){let e=yC(),t=SS(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=h.createElement(h.Fragment,null,h.createElement(`p`,null,`💿 Hey developer 👋`),h.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,h.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,h.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),h.createElement(h.Fragment,null,h.createElement(`h2`,null,`Unexpected Application Error!`),h.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?h.createElement(`pre`,{style:i},n):null,o)}var aC=h.createElement(iC,null),oC=class extends h.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=US(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:h.createElement(LS.Provider,{value:this.props.routeContext},h.createElement(RS.Provider,{value:e,children:this.props.component}));return this.context?h.createElement(cC,{error:e},t):t}};oC.contextType=AS;var sC=new WeakMap;function cC({children:e,error:t}){let{basename:n}=h.useContext(FS);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=HS(t.digest);if(e){let r=sC.get(t);if(r)throw r;let i=TS(e.location,n);if(wS&&!sC.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw sC.set(t,n),n}return h.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function lC({routeContext:e,match:t,children:n}){let r=h.useContext(OS);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),h.createElement(LS.Provider,{value:e},n)}function uC(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);Fx(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:CS(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||aC,o&&(s<0&&c===0?(SC(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),g=()=>{let t;return t=u?f:d?p:n.route.Component?h.createElement(n.route.Component,null):n.route.element?n.route.element:e,h.createElement(lC,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?h.createElement(oC,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:g(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):g()},null)}function dC(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fC(e){let t=h.useContext(OS);return Fx(t,dC(e)),t}function pC(e){let t=h.useContext(kS);return Fx(t,dC(e)),t}function mC(e){let t=h.useContext(LS);return Fx(t,dC(e)),t}function hC(e){let t=mC(e),n=t.matches[t.matches.length-1];return Fx(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function gC(){return hC(`useRouteId`)}function _C(){let e=pC(`useNavigation`);return h.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function vC(){let{matches:e,loaderData:t}=pC(`useMatches`);return h.useMemo(()=>e.map(e=>Ux(e,t)),[e,t])}function yC(){let e=h.useContext(RS),t=pC(`useRouteError`),n=hC(`useRouteError`);return e===void 0?t.errors?.[n]:e}function bC(){let{router:e}=fC(`useNavigate`),t=hC(`useNavigate`),n=h.useRef(!1);return YS(()=>{n.current=!0}),h.useCallback(async(r,i={})=>{Ix(n.current,JS),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var xC={};function SC(e,t,n){!t&&!xC[e]&&(xC[e]=!0,Ix(!1,n))}h.memo(CC);function CC({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return rC(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function wC({basename:e,children:t,initialEntries:n,initialIndex:r,useTransitions:i}){let a=h.useRef();a.current??=Px({initialEntries:n,initialIndex:r,v5Compat:!0});let o=a.current,[s,c]=h.useState({action:o.action,location:o.location}),l=h.useCallback(e=>{i===!1?c(e):h.startTransition(()=>c(e))},[i]);return h.useLayoutEffect(()=>o.listen(l),[o,l]),h.createElement(OC,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:o,useTransitions:i})}function TC({to:e,replace:t,state:n,relative:r}){Fx(GS(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=h.useContext(FS);Ix(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=h.useContext(LS),{pathname:o}=KS(),s=XS(),c=mS(e,pS(a),o,r===`path`),l=JSON.stringify(c);return h.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function EC(e){return $S(e.context)}function DC(e){Fx(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function OC({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){Fx(!GS(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=h.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=Bx(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,g=h.useMemo(()=>{let e=sS(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return Ix(g!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:h.createElement(FS.Provider,{value:c},h.createElement(IS.Provider,{children:t,value:g}))}function kC({children:e,location:t}){return nC(AC(e),t)}h.Component;function AC(e,t=[]){let n=[];return h.Children.forEach(e,(e,r)=>{if(!h.isValidElement(e))return;let i=[...t,r];if(e.type===h.Fragment){n.push.apply(n,AC(e.props.children,i));return}Fx(e.type===DC,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Fx(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=AC(e.props.children,i)),n.push(a)}),n}var jC=`get`,MC=`application/x-www-form-urlencoded`;function NC(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function PC(e){return NC(e)&&e.tagName.toLowerCase()===`button`}function FC(e){return NC(e)&&e.tagName.toLowerCase()===`form`}function IC(e){return NC(e)&&e.tagName.toLowerCase()===`input`}function LC(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function RC(e,t){return e.button===0&&(!t||t===`_self`)&&!LC(e)}var zC=null;function BC(){if(zC===null)try{new FormData(document.createElement(`form`),0),zC=!1}catch{zC=!0}return zC}var VC=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function HC(e){return e!=null&&!VC.has(e)?(Ix(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${MC}"`),null):e}function UC(e,t){let n,r,i,a,o;if(FC(e)){let o=e.getAttribute(`action`);r=o?sS(o,t):null,n=e.getAttribute(`method`)||jC,i=HC(e.getAttribute(`enctype`))||MC,a=new FormData(e)}else if(PC(e)||IC(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?sS(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||jC,i=HC(e.getAttribute(`formenctype`))||HC(o.getAttribute(`enctype`))||MC,a=new FormData(o,e),!BC()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(NC(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=jC,r=null,i=MC,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var WC={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},GC=/[&><\u2028\u2029]/g;function KC(e){return e.replace(GC,e=>WC[e])}function qC(e,t){if(e===!1||e==null)throw Error(t)}function JC(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&sS(i.pathname,t)===`/`?i.pathname=`${_S(t)}/_root.${r}`:i.pathname=`${_S(i.pathname)}.${r}`,i}async function YC(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function XC(e){return e!=null&&typeof e.page==`string`}function ZC(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function QC(e,t,n){return rw((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await YC(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(ZC).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function $C(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function ew(e,t,{includeHydrateFallback:n}={}){return tw(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function tw(e){return[...new Set(e)]}function nw(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function rw(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!XC(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(nw(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function iw(){let e=h.useContext(OS);return qC(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function aw(){let e=h.useContext(kS);return qC(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var ow=h.createContext(void 0);ow.displayName=`FrameworkContext`;function sw(){let e=h.useContext(ow);return qC(e,`You must render this element inside a <HydratedRouter> element`),e}function cw(e,t){let n=h.useContext(ow),[r,i]=h.useState(!1),[a,o]=h.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=h.useRef(null);h.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),h.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:lw(s,p),onBlur:lw(c,m),onMouseEnter:lw(l,p),onMouseLeave:lw(u,m),onTouchStart:lw(d,p)}]:[a,f,{}]:[!1,f,{}]}function lw(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function uw({page:e,...t}){let n=jS(),{router:r}=iw(),i=h.useMemo(()=>Vx(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?n?h.createElement(fw,{page:e,matches:i,...t}):h.createElement(pw,{page:e,matches:i,...t}):null}function dw(e){let{manifest:t,routeModules:n}=sw(),[r,i]=h.useState([]);return h.useEffect(()=>{let r=!1;return QC(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function fw({page:e,matches:t,...n}){let r=KS(),{future:i}=sw(),{basename:a}=iw(),o=h.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=JC(e,a,i.unstable_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.unstable_trailingSlashAwareDataRequests,e,r,t]);return h.createElement(h.Fragment,null,o.map(e=>h.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function pw({page:e,matches:t,...n}){let r=KS(),{future:i,manifest:a,routeModules:o}=sw(),{basename:s}=iw(),{loaderData:c,matches:l}=aw(),u=h.useMemo(()=>$C(e,t,l,a,r,`data`),[e,t,l,a,r]),d=h.useMemo(()=>$C(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=h.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=JC(e,s,i.unstable_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.unstable_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=h.useMemo(()=>ew(d,a),[d,a]),m=dw(d);return h.createElement(h.Fragment,null,f.map(e=>h.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>h.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>h.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function mw(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}h.Component;var hw=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{hw&&(window.__reactRouterVersion=`7.15.1`)}catch{}function gw({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=h.useState({action:n.action,location:n.location}),o=h.useCallback(e=>{r===!1?a(e):h.startTransition(()=>a(e))},[r]);return h.useLayoutEffect(()=>n.listen(o),[n,o]),h.createElement(OC,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}gw.displayName=`unstable_HistoryRouter`;var _w=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vw=h.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:g,navigator:_,useTransitions:v}=h.useContext(FS),y=typeof l==`string`&&_w.test(l),b=TS(l,g);l=b.to;let x=WS(l,{relative:r}),S=KS(),C=null;if(o){let e=mS(o,[],S.mask?S.mask.pathname:`/`,!0);g!==`/`&&(e.pathname=e.pathname===`/`?g:gS([g,e.pathname])),C=_.createHref(e)}let[w,T,E]=cw(n,p),D=Tw(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:v});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(b.isExternal||i),A=h.createElement(`a`,{...p,...E,href:(k?C:void 0)||b.absoluteURL||x,onClick:k?O:e,ref:mw(m,T),target:c,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?h.createElement(h.Fragment,null,A,h.createElement(uw,{page:x})):A});vw.displayName=`Link`;var yw=h.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=tC(a,{relative:c.relative}),d=KS(),f=h.useContext(kS),{navigator:p,basename:m}=h.useContext(FS),g=f!=null&&Fw(u)&&o===!0,_=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,v=d.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&m&&(y=sS(y,m)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!r&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!r&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return h.createElement(vw,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});yw.displayName=`NavLink`;var bw=h.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=jC,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:g}=h.useContext(FS),_=Ow(),v=kw(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&_w.test(s);return h.createElement(`form`,{ref:m,method:y,action:v,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>_(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});g&&n!==!1?h.startTransition(()=>p()):p()},...p,"data-discover":!b&&e===`render`?`true`:void 0})});bw.displayName=`Form`;function xw({getKey:e,storageKey:t,...n}){let r=h.useContext(ow),{basename:i}=h.useContext(FS),a=KS(),o=vC();Nw({getKey:e,storageKey:t});let s=h.useMemo(()=>{if(!r||!e)return null;let t=Mw(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return h.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${KC(JSON.stringify(t||Aw))}, ${KC(JSON.stringify(s))})`}})}xw.displayName=`ScrollRestoration`;function Sw(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Cw(e){let t=h.useContext(OS);return Fx(t,Sw(e)),t}function ww(e){let t=h.useContext(kS);return Fx(t,Sw(e)),t}function Tw(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=XS(),d=KS(),f=tC(e,{relative:o});return h.useCallback(p=>{if(RC(p,t)){p.preventDefault();let t=n===void 0?zx(d)===zx(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?h.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}var Ew=0,Dw=()=>`__${String(++Ew)}__`;function Ow(){let{router:e}=Cw(`useSubmit`),{basename:t}=h.useContext(FS),n=gC(),r=e.fetch,i=e.navigate;return h.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=UC(e,t);a.navigate===!1?await r(a.fetcherKey||Dw(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function kw(e,{relative:t}={}){let{basename:n}=h.useContext(FS),r=h.useContext(LS);Fx(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...tC(e||`.`,{relative:t})},o=KS();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:gS([n,a.pathname])),zx(a)}var Aw=`react-router-scroll-positions`,jw={};function Mw(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:sS(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Nw({getKey:e,storageKey:t}={}){let{router:n}=Cw(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=ww(`useScrollRestoration`),{basename:a}=h.useContext(FS),o=KS(),s=vC(),c=_C();h.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Pw(h.useCallback(()=>{if(c.state===`idle`){let t=Mw(o,s,a,e);jw[t]=window.scrollY}try{sessionStorage.setItem(t||Aw,JSON.stringify(jw))}catch(e){Ix(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(h.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||Aw);e&&(jw=JSON.parse(e))}catch{}},[t]),h.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(jw,()=>window.scrollY,e?(t,n)=>Mw(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),h.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{Ix(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function Pw(e,t){let{capture:n}=t||{};h.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Fw(e,{relative:t}={}){let n=h.useContext(MS);Fx(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Cw(`useViewTransitionState`),i=tC(e,{relative:t});if(!n.isTransitioning)return!1;let a=sS(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=sS(n.nextLocation.pathname,r)||n.nextLocation.pathname;return iS(i.pathname,o)!=null||iS(i.pathname,a)!=null}var Iw=({className:e,children:t,path:r,to:i,variant:a=`primary`,size:o=`md`,...s})=>(0,n.jsx)(yw,{className:(0,Jn.default)(kx({variant:a,size:o}),e),to:i??r,...s,children:(0,n.jsx)(`span`,{className:`flex items-center gap-1`,children:t})});Iw.displayName=`NavLinkButton`;function Lw(){let{t:e}=U(),[t,r]=(0,h.useState)(!1);return(0,n.jsxs)(Zn,{accent:`red`,children:[(0,n.jsxs)(`div`,{className:`space-y-3`,children:[(0,n.jsx)(`p`,{className:`font-semibold text-core-red-500 text-sm uppercase tracking-[0.2em]`,children:e(`error`,{defaultValue:`Error`})}),(0,n.jsx)(`h1`,{className:`font-semibold text-3xl text-core-gray-900 tracking-tight sm:text-5xl`,children:`Oops!`}),(0,n.jsx)(`p`,{className:`mx-auto max-w-xl text-base text-core-gray-500 leading-7 sm:text-lg`,children:e(`sorrySomethingWentWrong`)})]}),(0,n.jsx)(Mx,{onClick:()=>{r(!0),window.location.replace(`/`)},pending:t,children:e(`back`)})]})}var Rw=class extends h.Component{constructor(e){super(e),this.state={hasError:!1,scope:void 0}}componentDidMount(){let e=new Mh({dsn:`https://5b16c396f6e8f6e4b0b87455bea7e96b@o80526.ingest.us.sentry.io/4507345428283392`,transport:bv,stackParser:Mv,integrations:[...vy({}).filter(e=>![`BrowserApiErrors`,`Breadcrumbs`,`GlobalHandlers`].includes(e.name)),ab({useEffect:h.useEffect,useLocation:KS,useNavigationType:qS,createRoutesFromChildren:AC,matchRoutes:Vx})]}),t=new Ic;t.setClient(e),e.init(),this.setState({...this.state,scope:t})}componentDidCatch(e,t){console.error(`ErrorBoundary: `,e,t),this.state.scope.captureException(e),this.setState({...this.state,hasError:!0})}render(){return this.state.hasError?(0,n.jsx)(Lw,{}):this.props.children}};function zw(){let{apiKey:e,host:t}=Wn(),n=(e,t={},n={})=>o(`GET`,e,t,n),r=(e,t={},n={})=>o(`POST`,e,t,n),i=(e,t={},n={})=>o(`PUT`,e,t,n),a=(e,t={})=>o(`DELETE`,e,t),o=(n,r,i={},a={})=>{let o=Hn.create({baseURL:`${t??`https://api.piggy.eu`}/api/v2/portal-sessions`,...a,headers:{Authorization:`Bearer ${e}`,...a.headers,"X-SDK-Version":`0.3.0-beta.9`}});return o.interceptors.response.use(void 0,Kn),o.request({method:n,url:r,params:n==`GET`?i:{},data:i})};return{get:n,post:r,put:i,destroy:a}}function Bw({children:e,id:t,className:r}){return(0,n.jsx)(`div`,{id:t,className:`flex h-full max-h-full flex-col bg-white md:h-fit md:rounded-lg md:border md:shadow-md ${r}`,children:e})}function Vw({children:e,className:t}){return(0,n.jsx)(`div`,{className:`grow overflow-y-auto px-6 py-4 ${t??``}`,children:e})}function Hw({children:e}){return(0,n.jsx)(`div`,{className:`border-t px-6 py-4`,children:e})}function Uw({children:e}){return(0,n.jsx)(`div`,{className:`border-b px-6 py-4`,children:e})}function Ww({children:e}){return(0,n.jsx)(`p`,{className:`text-gray-500 text-sm leading-5`,children:e})}function Gw({children:e}){return(0,n.jsx)(`h2`,{className:`font-semibold text-gray-900 text-lg leading-6`,children:e})}function Kw({onSubmit:e,children:t}){return(0,n.jsx)(`form`,{onSubmit:t=>{t.preventDefault(),e&&e(t)},children:t})}function qw({children:e}){return(0,n.jsx)(`div`,{className:`h-screen w-screen md:p-6`,children:(0,n.jsx)(`div`,{className:`flex h-full max-h-full items-center justify-center *:grow md:mx-auto md:max-w-[420px]`,children:e})})}var Jw=({children:e,className:t,description:r,disabled:i,required:a=!1,tooltip:o,htmlFor:s})=>!e&&!o&&!r?null:(0,n.jsx)(`label`,{htmlFor:s,className:`inline-flex shrink-0 items-center gap-1 text-core-gray-800 antialiased `,children:(0,n.jsxs)(`div`,{className:(0,Jn.default)(`inline-flex cursor-pointer items-center gap-1 text-sm font-medium leading-6`,t,i&&`pointer-events-none text-core-gray-300`),children:[e?(0,n.jsx)(`span`,{className:(0,Jn.default)(i&&`pointer-events-none text-core-gray-300`),children:e}):null,r?(0,n.jsx)(`span`,{className:(0,Jn.default)(`font-normal text-core-gray-500`,i&&`text-current`),children:r}):null,a?(0,n.jsx)(`span`,{className:`font-normal text-core-red-500`,children:`*`}):null]})}),Yw=({helperText:e,error:t,disabled:r})=>e?(0,n.jsx)(`span`,{className:(0,Jn.default)(`text-start text-sm leading-6 text-core-gray-500 antialiased `,t&&`text-core-red-500`,r&&`text-core-gray-300`),children:e}):null;Jw.displayName=`Label`,Yw.displayName=`HelperText`;var Xw=Object.assign(Jw,{Helper:Yw}),Zw=({id:e,defaultChecked:t=!1,disabled:r,onChange:i})=>{let a=r,[o,s]=h.default.useState(t);return(0,n.jsx)(`div`,{className:`flex h-6 w-6 items-center justify-center`,children:(0,n.jsx)(`input`,{className:(0,Jn.default)(`h-4 w-4 rounded-sm border border-core-gray-200 bg-core-white-900 text-core-primary-500 shadow-xs`,`hover:border-core-gray-300 hover:shadow-none`,`checked:bg-core-primary-500`,`focus:outline-0 focus:ring-core-primary-500 focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-2`,`disabled:border disabled:border-core-gray-200 disabled:bg-core-gray-50 disabled:shadow-none`,`disabled:checked:bg-core-gray-200`),id:e,type:`checkbox`,checked:o,onChange:e=>{a||s(!o),i?.(e.target.checked)},disabled:a})})},Qw=h.default.createContext(null);function $w(e=!1){let t=h.default.useContext(Qw);if(!t&&!e)throw Error(`Checkbox.Item must be used within a CheckboxGroup or CheckboxGroup.Root`);return t}var eT=h.default.forwardRef(({children:e,description:t,disabled:r,helperText:i,id:a,label:o,required:s,tooltip:c},l)=>{let u=h.default.useId(),d=a??u,f=o??t??c??i?(0,n.jsxs)(`div`,{className:`inline-flex flex-col`,children:[(0,n.jsx)(Xw,{className:`cursor-default`,description:t,required:s,tooltip:c,htmlFor:d,disabled:r,children:o}),(0,n.jsx)(Xw.Helper,{disabled:r,helperText:i})]}):null;return(0,n.jsx)(Qw.Provider,{value:{disabled:r},children:(0,n.jsxs)(`div`,{ref:l,"aria-describedby":i?`${d}__describer`:void 0,"aria-labelledby":o?`${d}__label`:void 0,className:`flex flex-col gap-4`,role:`group`,children:[o??i??t??c?(0,n.jsx)(`div`,{className:`flex flex-col`,children:f}):null,e?(0,n.jsx)(`div`,{className:(0,Jn.default)(`flex flex-col gap-2`),children:e}):null]})})});eT.displayName=`CheckboxGroup`,Object.assign(eT,{Item:({disabled:e,label:t,defaultChecked:r})=>{let{disabled:i}=$w()??{};return(0,n.jsx)(tT,{disabled:e??i,label:t,defaultChecked:r})}});var tT=({id:e,children:t,defaultChecked:r=!1,description:i,disabled:a,helperText:o,label:s,required:c=!1,tooltip:l,onChange:u})=>{let d=h.default.useId(),f=e??d,p=!!$w(!0),m=s??i??l??o?(0,n.jsxs)(`div`,{className:`inline-flex flex-col`,children:[(0,n.jsx)(Xw,{className:(0,Jn.default)(p&&`font-normal`),description:i,required:c,tooltip:l,htmlFor:f,disabled:a,children:s}),(0,n.jsx)(Xw.Helper,{disabled:a,helperText:o})]}):null;return(0,n.jsxs)(`div`,{className:`flex gap-3`,children:[(0,n.jsx)(Zw,{id:f,defaultChecked:r,disabled:a,onChange:u}),t||m]})};tT.displayName=`Checkbox`;var nT=({id:e,name:t,label:r,description:i,required:a,type:o=`text`,value:s,placeholder:c,disabled:l,error:u=!1,helperText:d=``,onChange:f,beforeIcon:p,afterIcon:m,autoFocus:g,onFocus:_,onBlur:v})=>{let[y,b]=(0,h.useState)(d),x=(0,h.useRef)(null),[S,C]=(0,h.useState)(!1),{open:w,close:T}=Po();(0,h.useEffect)(()=>()=>{T()},[]);let E=()=>{x.current&&b(x.current.validationMessage),C(!1),T(),v?.()},D=async e=>{C(!0),(async()=>w(e))().then(()=>x.current?.scrollIntoView({behavior:`smooth`,block:`center`})),_?.()},O=e=>{f?.(e)},k=h.default.useId(),A=e??k;return(0,n.jsxs)(`div`,{className:`flex flex-col gap-2 antialiased`,children:[(0,n.jsx)(Xw,{description:i,disabled:l,htmlFor:A,required:a,children:r}),(0,n.jsx)(`div`,{className:(0,Jn.default)(`box flex h-10 flex-start flex-col justify-center self-stretch rounded-sm border border-core-gray-200 shadow-xs`,l?`pointer-events-none bg-core-gray-50 shadow-none outline-core-gray-200`:`bg-core-white-900 hover:border hover:border-core-gray-300 hover:shadow-none`,S&&!u&&`border-core-primary-500 ring-1 ring-core-primary-500`,u&&`border-core-red-500`,u&&S&&`border-core-red-500 ring-1 ring-core-red-500`),children:(0,n.jsxs)(`div`,{className:`flex flex-row gap-2 self-stretch p-2`,children:[p&&(0,n.jsx)(Dx,{icon:p}),(0,n.jsx)(`input`,{type:o,id:A,name:t,className:`flex grow border-none bg-transparent p-0 text-core-gray-800 text-sm placeholder:text-core-gray-500 focus:ring-0 disabled:text-core-gray-300 disabled:placeholder:text-core-gray-300`,value:s,onChange:O,onBlur:E,ref:x,placeholder:c,onFocus:D,disabled:l,autoFocus:g}),m&&(0,n.jsx)(Dx,{icon:m})]})}),(0,n.jsx)(`div`,{className:`grid overflow-hidden transition-all duration-300 ease-out ${d||y?`grid-rows-[1fr] opacity-100`:`grid-rows-[0fr] opacity-0`}`,children:(0,n.jsx)(`div`,{className:`overflow-hidden`,children:(0,n.jsx)(Xw.Helper,{error:u,helperText:d||y})})})]})};nT.displayName=`Input`;var rT=({id:e,name:t,label:r,required:i,description:a,value:o,placeholder:s,disabled:c,error:l=!1,helperText:u=``,autoFocus:d,onChange:f})=>{let[p,m]=(0,h.useState)(u),g=(0,h.useRef)(null),[_,v]=(0,h.useState)(!1),{open:y,close:b}=Po();(0,h.useEffect)(()=>()=>{b()},[]);let x=()=>{g.current&&m(g.current.validationMessage),v(!1),b()},S=async e=>{v(!0),(async()=>y(e))().then(()=>g.current?.scrollIntoView({behavior:`smooth`,block:`center`}))},C=e=>{f?.(e)},w=h.default.useId(),T=e??w;return(0,n.jsxs)(`div`,{className:`flex flex-col gap-2 antialiased`,children:[(0,n.jsx)(Xw,{description:a,disabled:c,htmlFor:T,required:i,children:r}),(0,n.jsx)(`div`,{className:(0,Jn.default)(`flex-start box relative flex h-10 flex-col justify-center self-stretch rounded-sm border border-core-gray-200 shadow-xs`,c?`pointer-events-none bg-core-gray-50 shadow-none outline-core-gray-200`:` bg-core-white-900 hover:border hover:border-core-gray-300 hover:shadow-none `,_&&!l&&`border-core-primary-500 ring-1 ring-core-primary-500`,l&&`border-core-red-500`,l&&_&&`border-core-red-500 ring-1 ring-core-red-500`),children:(0,n.jsxs)(`div`,{className:`flex flex-row gap-2 self-stretch p-2`,children:[(0,n.jsx)(Dx,{icon:`mail`}),(0,n.jsx)(`input`,{type:`email`,id:T,name:t,className:`flex grow border-none bg-transparent p-0 text-sm text-core-gray-800 placeholder:text-core-gray-500 focus:ring-0 disabled:text-core-gray-300 disabled:placeholder:text-core-gray-300`,value:o,onChange:C,onBlur:x,ref:g,placeholder:s,onFocus:S,disabled:c,autoFocus:d})]})}),(0,n.jsx)(`div`,{className:`transition-grid-rows grid overflow-hidden duration-300 ease-out ${u||p?`grid-rows-[1fr] opacity-100`:`grid-rows-[0fr] opacity-0`}`,children:(0,n.jsx)(`div`,{className:`overflow-hidden`,children:(0,n.jsx)(Xw.Helper,{error:l,helperText:u||p})})})]})};rT.displayName=`InputEmail`;var iT=({id:e,name:t,label:r,required:i,description:a,placeholder:o,value:s,disabled:c,error:l=!1,helperText:u,onChange:d,type:f=`date`})=>{let[p,m]=(0,h.useState)(!1),g=h.default.useId(),_=e??g;return(0,n.jsxs)(`div`,{className:`flex flex-col gap-2 antialiased`,children:[(0,n.jsx)(Xw,{description:a,disabled:c,htmlFor:_,required:i,children:r}),(0,n.jsx)(`div`,{className:(0,Jn.default)(`flex-start box relative flex h-10 flex-col justify-center self-stretch rounded-sm border border-core-gray-200 shadow-xs ring-core-primary-500 `,c?`pointer-events-none bg-core-gray-50 shadow-none outline-core-gray-200`:` bg-core-white-900 hover:border hover:border-core-gray-300 hover:shadow-none `,p&&!l&&`border-core-primary-500 ring-1 ring-core-primary-500 selection:bg-core-primary-500`,l&&`border-core-red-500`,l&&p&&`border-core-red-500 ring-1 ring-core-red-500`),children:(0,n.jsxs)(`div`,{className:`flex w-full flex-row gap-2 self-stretch p-2`,children:[(0,n.jsx)(`input`,{type:f,id:_,name:t,value:s,max:`2200-01-01`,className:`flex grow border-none bg-transparent p-0 text-sm text-core-gray-800 placeholder:text-core-gray-500 focus:ring-0 disabled:text-core-gray-300 disabled:placeholder:text-core-gray-300`,placeholder:o,onChange:d,onFocus:()=>m(!0),onBlur:()=>m(!1),disabled:c}),(0,n.jsx)(Dx,{icon:`calendar`})]})}),(0,n.jsx)(`div`,{className:`grid overflow-hidden transition-all duration-300 ease-out ${u?`grid-rows-[1fr] opacity-100`:`grid-rows-[0fr] opacity-100`}`,children:(0,n.jsx)(`div`,{className:`overflow-hidden`,children:(0,n.jsx)(Xw.Helper,{error:l,helperText:u})})})]})};iT.displayName=`Input`;function aT(){let{t:e}=U(),{successToast:t}=ca(),{portalSession:n}=H(),r=zw();return{findOrCreateContact:async({email:i,createIfNotFound:a})=>(await r.post(`${n.uuid}/contacts`,{email:i,create_if_not_found:a}).then(n=>(n.data.data.was_created&&t(e(`contactHasBeenCreated`)),n))).data.data}}function oT(){let{t:e}=U(),{successToast:t}=ca(),{portalSession:n}=H(),{onContactLink:r}=wo(),i=zw();return{linkContactToSession:async a=>{await i.post(`${n.uuid}/link-contact/${a.id}`).then(n=>(n.data.data.was_updated&&(t(e(`contactHasBeenLinkedToSession`)),r?.(a)),n))}}}function sT({onCancel:e,onSuccess:t}){let{t:r}=U(),{errorToast:i}=ca(),[a,o]=(0,h.useState)(!1),{portalSession:s}=H(),{findOrCreateContact:c}=aT(),{linkContactToSession:l}=oT(),[u,d]=(0,h.useState)(!0),[f,p]=(0,h.useState)(``);return(0,n.jsx)(qw,{children:(0,n.jsxs)(Bw,{id:Fo,children:[(0,n.jsxs)(Uw,{children:[(0,n.jsx)(Gw,{children:r(`authenticateViaEmail`)}),(0,n.jsx)(Ww,{children:`Type: ${s.type}`})]}),(0,n.jsxs)(Kw,{onSubmit:async()=>{o(!0);try{await l(await c({email:f,createIfNotFound:u})),await t()}catch(e){i(e)}finally{o(!1)}},children:[(0,n.jsxs)(Vw,{children:[(0,n.jsx)(nT,{value:f,placeholder:`john.doe@example.com`,label:r(`emailAddress`),onChange:e=>p(e.target.value),beforeIcon:`mail`}),(0,n.jsx)(tT,{required:!0,label:r(`createContactIfNotFound`),defaultChecked:u,onChange:e=>d(e)})]}),(0,n.jsx)(Hw,{children:(0,n.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,n.jsx)(Mx,{type:`submit`,className:`w-full`,pending:a,disabled:!f,children:r(`continue`)}),(0,n.jsx)(Mx,{className:`w-full`,variant:`secondary`,onClick:e,children:r(`back`)})]})})]})]})})}function cT(e){let t=zw(),{errorToast:n}=ca(),{data:r,error:i,isValidating:a,mutate:o}=bo((0,h.useMemo)(()=>e.url?e.params?[e.url,JSON.stringify(e.params)]:[e.url]:null,[e.url,JSON.stringify(e.params)]),([n,r])=>r?t.get(n,e.params):t.get(n),{shouldRetryOnError:!1,revalidateOnFocus:e.revalidateOnFocus,revalidateOnMount:e.revalidateOnMount,refreshInterval:e.refreshInterval});return(0,h.useEffect)(()=>{r&&e.dataSetter(r.data.data,r.data.meta)},[r]),(0,h.useEffect)(()=>{i&&n(i)},[i]),{data:r,pending:a,error:i,isValidating:a,mutate:o}}var lT={info:`border-core-primary-100 bg-core-primary-50 text-core-gray-700`,success:`border-core-green-100 bg-core-green-50 text-core-gray-700`,warning:`border-core-primary-100 bg-core-primary-50 text-core-gray-700`,error:`border-core-red-100 bg-core-red-50 text-core-gray-700`},uT={info:`discovery`,success:`discovery`,warning:`discovery`,error:`destructive`},dT={info:`information`,success:`notificationSuccessV2`,warning:`notificationWarningV2`,error:`notificationErrorV2`};function fT({children:e,className:t,icon:r,title:i,variant:a=`info`}){return(0,n.jsxs)(`div`,{className:(0,Jn.default)(`flex gap-3 rounded-xl border p-4 text-sm leading-5`,lT[a],t),children:[(0,n.jsx)(`div`,{className:`mt-0.5 shrink-0`,children:(0,n.jsx)(Dx,{icon:r??dT[a],size:`sm`,variant:uT[a]})}),(0,n.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[i?(0,n.jsx)(`div`,{className:`font-medium text-core-gray-900`,children:i}):null,(0,n.jsx)(`div`,{children:e})]})]})}function pT(){let{t:e}=U(),{successToast:t}=ca(),{portalSession:n}=H(),r=zw();return{linkIdentifierToContact:async(i,a)=>{await r.post(`${n.uuid}/contact-identifiers/${i.id}/link-to-contact/${a.id}`).then(n=>(t(e(`contactIdentifierWasLinked`)),n))}}}function mT(e){let{t}=U(),{id:r,onSuccess:i,onCancel:a}=e,{errorToast:o}=ca(),[s,c]=(0,h.useState)(!1),{portalSession:l}=H(),{findOrCreateContact:u}=aT(),{linkContactToSession:d}=oT(),{linkIdentifierToContact:f}=pT(),[p,m]=(0,h.useState)(!0),[g,_]=(0,h.useState)(null),[v,y]=(0,h.useState)(``);cT({url:`${l.uuid}/contact-identifiers/${r}`,dataSetter:_});let b=async e=>{c(!0);try{await d(e),await i()}catch(e){o(e)}finally{c(!1)}},x=async()=>{if(g){c(!0);try{let e=await u({email:v,createIfNotFound:p});await f(g,e),await d(e),await i()}catch(e){o(e)}finally{c(!1)}}},S=g?.contact;return(0,n.jsx)(qw,{children:(0,n.jsxs)(Bw,{children:[(0,n.jsxs)(Uw,{children:[(0,n.jsx)(Gw,{children:t(`linkIdentifier`)}),(0,n.jsx)(Ww,{children:g?.value})]}),(0,n.jsx)(Vw,{children:S?(0,n.jsx)(fT,{variant:`success`,children:t(`thisIdentifierIsLinkedToContact`,{contact:g.contact.email})}):(0,n.jsxs)(`div`,{children:[(0,n.jsx)(fT,{children:`This identifier is not linked to a contact`}),(0,n.jsx)(nT,{value:v,placeholder:`john.doe@example.com`,label:t(`emailAddress`),onChange:e=>y(e.target.value),beforeIcon:`mail`}),(0,n.jsx)(tT,{required:!0,label:t(`createContactIfNotFound`),defaultChecked:p,onChange:e=>m(e)})]})}),(0,n.jsx)(Hw,{children:(0,n.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[S?(0,n.jsx)(Mx,{className:`w-full`,onClick:()=>b(S),pending:s,children:t(`continue`)}):(0,n.jsx)(Mx,{className:`w-full`,onClick:x,pending:s,disabled:!v,children:t(p?`createContactAndLink`:`findContactAndLink`)}),(0,n.jsx)(Mx,{type:`submit`,className:`w-full`,variant:`secondary`,pending:s,onClick:a,children:t(`cancel`)})]})})]})})}var hT=typeof window<`u`?h.useLayoutEffect:()=>{},gT=()=>window.visualViewport?[window.visualViewport.width,window.visualViewport.height]:[window.innerWidth,window.innerHeight],_T=()=>{let[e,t]=(0,h.useState)(),n=(0,h.useCallback)(()=>{let e=gT();t(t=>t&&t[0]===e[0]&&t[1]===e[1]?t:e)},[]);return hT(n,[n]),(0,h.useEffect)(()=>{let e=()=>{n(),setTimeout(n,1e3)};return window.addEventListener(`resize`,e),window.addEventListener(`orientationchange`,e),window.visualViewport?.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`orientationchange`,e),window.visualViewport?.removeEventListener(`resize`,e)}},[n]),e},vT=`data:image/svg+xml,%3csvg%20height='24'%20viewBox='0%200%2024%2024'%20width='24'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m21.25%207.5c.3796958%200%20.693491.28215388.7431534.64822944l.0068466.10177056v8.5c0%201.7330315-1.3564548%203.1492459-3.0655761%203.2448552l-.1844239.0051448h-12.689l.71933009.7196699c.26626656.2662666.29047261.6829303.07261815.9765418l-.07261815.0841184c-.26626657.2662665-.68293025.2904726-.97654174.0726181l-.08411844-.0726181-2-2-.06339799-.0720275c-.00244939-.0031685-.00487398-.0063571-.00727348-.0095656l.07067147.0815931c-.03705327-.0370533-.06941902-.077019-.09709724-.1191603-.01316484-.0201549-.025545-.0411423-.03690171-.0627516-.00483354-.0091218-.00919014-.0178526-.01336588-.0266478-.01274712-.0267885-.02425172-.0552483-.03400215-.0845099-.00225837-.0069437-.00418282-.0130149-.00602813-.019105-.02092163-.0684786-.0322748-.1419912-.0322748-.2181555%200-.0383922.00288471-.0761107.00844919-.1129505.00180466-.0115676.0038603-.0232773.00619514-.0349422.00494363-.0250031.01111685-.0492994.01844184-.073091.00362656-.0116598.00765847-.0237092.01200456-.0356703.00848426-.0232976.01778613-.0453662.02808241-.0668678.00549219-.0116011.01179514-.0239381.01846187-.0361292.01323523-.0240158.02734042-.0467392.04258121-.0686124.00392129-.0057417.00832657-.0118713.01283554-.0179483.0251194-.0332177.04801831-.0595185.07261815-.0841184l2-2c.29289322-.2928932.76776696-.2928932%201.06066018%200%20.26626656.2662666.29047261.6829303.07261815.9765418l-.07261815.0841184-.72033009.7196699h12.69c.9181734%200%201.6711923-.7071103%201.7441988-1.6064728l.0058012-.1435272v-8.5c0-.41421356.3357864-.75.75-.75zm-3.0537883-5.35294824.0841184.07261815%202%202c.0254481.02544812.049076.05271652.0706715.08159313l-.0706715-.08159313c.0370533.03705328.069419.07701901.0970972.1191603.0131649.02015493.025545.04114226.0369017.06275154.0048336.00912187.0091902.01785262.0133659.02664784.0127471.02678853.0242517.0552483.0340022.08450994.0022583.00694369.0041828.01301489.0060281.01910493.0209216.06847868.0322748.14199127.0322748.21815554%200%20.03839224-.0028847.07611073-.0084492.11295053-.0014988.0095454-.0031606.01924362-.0050138.02891241-.0051364.02710922-.0117072.05340972-.0196232.07912072-.0036265.0116598-.0076584.02370928-.0120045.03567032-.0084843.02329763-.0177862.04536621-.0280824.06686781-.0054922.01160108-.0117952.02393815-.0184619.03612923-.0132352.02401575-.0273404.04673917-.0425812.06861233-.0039213.00574174-.0083266.01187138-.0128356.0179483-.023778.03144192-.0451015.05615345-.0679264.07938506l-.0046917.00473338-2%202c-.2928932.29289321-.767767.29289321-1.0606602%200-.2662665-.26626657-.2904726-.68293025-.0726181-.97654174l.0726181-.08411844.7183301-.71966991h-12.688c-.9181734%200-1.67119234.70711027-1.7441988%201.60647279l-.0058012.14352721v8.5c0%20.4142136-.33578644.75-.75.75-.37969577%200-.69349096-.2821539-.74315338-.6482294l-.00684662-.1017706v-8.5c0-1.73303146%201.35645477-3.14924593%203.06557609-3.24485521l.18442391-.00514479h12.689l-.7193301-.71966991c-.2662665-.26626657-.2904726-.68293025-.0726181-.97654174l.0726181-.08411844c.2662666-.26626656.6829303-.29047261.9765418-.07261815zm-6.1962117%205.85294824c2.209139%200%204%201.790861%204%204s-1.790861%204-4%204-4-1.790861-4-4%201.790861-4%204-4zm0%201.5c-1.3807119%200-2.5%201.1192881-2.5%202.5s1.1192881%202.5%202.5%202.5%202.5-1.1192881%202.5-2.5-1.1192881-2.5-2.5-2.5z'%20fill='%23212121'/%3e%3c/svg%3e`,yT=f({createWorker:()=>bT}),bT,xT=u((()=>{bT=()=>new Worker(URL.createObjectURL(new Blob([`class x{constructor(a,b){this.width=b;this.height=a.length/b;this.data=a}static createEmpty(a,b){return new x(new Uint8ClampedArray(a*b),a)}get(a,b){return 0>a||a>=this.width||0>b||b>=this.height?!1:!!this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c?1:0}setRegion(a,b,c,d,e){for(let f=b;f<b+d;f++)for(let g=a;g<a+c;g++)this.set(g,f,!!e)}}
|
|
24
|
+
class A{constructor(a,b,c){this.width=a;a*=b;if(c&&c.length!==a)throw Error("Wrong buffer size");this.data=c||new Uint8ClampedArray(a)}get(a,b){return this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c}}
|
|
25
|
+
class ba{constructor(a){this.bitOffset=this.byteOffset=0;this.bytes=a}readBits(a){if(1>a||32<a||a>this.available())throw Error("Cannot read "+a.toString()+" bits");var b=0;if(0<this.bitOffset){b=8-this.bitOffset;var c=a<b?a:b;b-=c;b=(this.bytes[this.byteOffset]&255>>8-c<<b)>>b;a-=c;this.bitOffset+=c;8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(0<a){for(;8<=a;)b=b<<8|this.bytes[this.byteOffset]&255,this.byteOffset++,a-=8;0<a&&(c=8-a,b=b<<a|(this.bytes[this.byteOffset]&255>>c<<c)>>c,
|
|
26
|
+
this.bitOffset+=a)}return b}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}var B,C=B||(B={});C.Numeric="numeric";C.Alphanumeric="alphanumeric";C.Byte="byte";C.Kanji="kanji";C.ECI="eci";C.StructuredAppend="structuredappend";var D,E=D||(D={});E[E.Terminator=0]="Terminator";E[E.Numeric=1]="Numeric";E[E.Alphanumeric=2]="Alphanumeric";E[E.Byte=4]="Byte";E[E.Kanji=8]="Kanji";E[E.ECI=7]="ECI";E[E.StructuredAppend=3]="StructuredAppend";let F="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:".split("");
|
|
27
|
+
function ca(a,b){let c=[],d="";b=a.readBits([8,16,16][b]);for(let e=0;e<b;e++){let f=a.readBits(8);c.push(f)}try{d+=decodeURIComponent(c.map(e=>\`%\${("0"+e.toString(16)).substr(-2)}\`).join(""))}catch(e){}return{bytes:c,text:d}}
|
|
28
|
+
function da(a,b){a=new ba(a);let c=9>=b?0:26>=b?1:2;for(b={text:"",bytes:[],chunks:[],version:b};4<=a.available();){var d=a.readBits(4);if(d===D.Terminator)return b;if(d===D.ECI)0===a.readBits(1)?b.chunks.push({type:B.ECI,assignmentNumber:a.readBits(7)}):0===a.readBits(1)?b.chunks.push({type:B.ECI,assignmentNumber:a.readBits(14)}):0===a.readBits(1)?b.chunks.push({type:B.ECI,assignmentNumber:a.readBits(21)}):b.chunks.push({type:B.ECI,assignmentNumber:-1});else if(d===D.Numeric){var e=a,f=[];d="";for(var g=
|
|
29
|
+
e.readBits([10,12,14][c]);3<=g;){var h=e.readBits(10);if(1E3<=h)throw Error("Invalid numeric value above 999");var k=Math.floor(h/100),m=Math.floor(h/10)%10;h%=10;f.push(48+k,48+m,48+h);d+=k.toString()+m.toString()+h.toString();g-=3}if(2===g){g=e.readBits(7);if(100<=g)throw Error("Invalid numeric value above 99");e=Math.floor(g/10);g%=10;f.push(48+e,48+g);d+=e.toString()+g.toString()}else if(1===g){e=e.readBits(4);if(10<=e)throw Error("Invalid numeric value above 9");f.push(48+e);d+=e.toString()}b.text+=
|
|
30
|
+
d;b.bytes.push(...f);b.chunks.push({type:B.Numeric,text:d})}else if(d===D.Alphanumeric){e=a;f=[];d="";for(g=e.readBits([9,11,13][c]);2<=g;)m=e.readBits(11),k=Math.floor(m/45),m%=45,f.push(F[k].charCodeAt(0),F[m].charCodeAt(0)),d+=F[k]+F[m],g-=2;1===g&&(e=e.readBits(6),f.push(F[e].charCodeAt(0)),d+=F[e]);b.text+=d;b.bytes.push(...f);b.chunks.push({type:B.Alphanumeric,text:d})}else if(d===D.Byte)d=ca(a,c),b.text+=d.text,b.bytes.push(...d.bytes),b.chunks.push({type:B.Byte,bytes:d.bytes,text:d.text});
|
|
31
|
+
else if(d===D.Kanji){f=a;d=[];e=f.readBits([8,10,12][c]);for(g=0;g<e;g++)k=f.readBits(13),k=Math.floor(k/192)<<8|k%192,k=7936>k?k+33088:k+49472,d.push(k>>8,k&255);f=(new TextDecoder("shift-jis")).decode(Uint8Array.from(d));b.text+=f;b.bytes.push(...d);b.chunks.push({type:B.Kanji,bytes:d,text:f})}else d===D.StructuredAppend&&b.chunks.push({type:B.StructuredAppend,currentSequence:a.readBits(4),totalSequence:a.readBits(4),parity:a.readBits(8)})}if(0===a.available()||0===a.readBits(a.available()))return b}
|
|
32
|
+
class G{constructor(a,b){if(0===b.length)throw Error("No coefficients.");this.field=a;let c=b.length;if(1<c&&0===b[0]){let d=1;for(;d<c&&0===b[d];)d++;if(d===c)this.coefficients=a.zero.coefficients;else for(this.coefficients=new Uint8ClampedArray(c-d),a=0;a<this.coefficients.length;a++)this.coefficients[a]=b[d+a]}else this.coefficients=b}degree(){return this.coefficients.length-1}isZero(){return 0===this.coefficients[0]}getCoefficient(a){return this.coefficients[this.coefficients.length-1-a]}addOrSubtract(a){if(this.isZero())return a;
|
|
33
|
+
if(a.isZero())return this;let b=this.coefficients;a=a.coefficients;b.length>a.length&&([b,a]=[a,b]);let c=new Uint8ClampedArray(a.length),d=a.length-b.length;for(var e=0;e<d;e++)c[e]=a[e];for(e=d;e<a.length;e++)c[e]=b[e-d]^a[e];return new G(this.field,c)}multiply(a){if(0===a)return this.field.zero;if(1===a)return this;let b=this.coefficients.length,c=new Uint8ClampedArray(b);for(let d=0;d<b;d++)c[d]=this.field.multiply(this.coefficients[d],a);return new G(this.field,c)}multiplyPoly(a){if(this.isZero()||
|
|
34
|
+
a.isZero())return this.field.zero;let b=this.coefficients,c=b.length;a=a.coefficients;let d=a.length,e=new Uint8ClampedArray(c+d-1);for(let f=0;f<c;f++){let g=b[f];for(let h=0;h<d;h++)e[f+h]=H(e[f+h],this.field.multiply(g,a[h]))}return new G(this.field,e)}multiplyByMonomial(a,b){if(0>a)throw Error("Invalid degree less than 0");if(0===b)return this.field.zero;let c=this.coefficients.length;a=new Uint8ClampedArray(c+a);for(let d=0;d<c;d++)a[d]=this.field.multiply(this.coefficients[d],b);return new G(this.field,
|
|
35
|
+
a)}evaluateAt(a){let b=0;if(0===a)return this.getCoefficient(0);let c=this.coefficients.length;if(1===a)return this.coefficients.forEach(d=>{b^=d}),b;b=this.coefficients[0];for(let d=1;d<c;d++)b=H(this.field.multiply(a,b),this.coefficients[d]);return b}}function H(a,b){return a^b}
|
|
36
|
+
class ea{constructor(a,b,c){this.primitive=a;this.size=b;this.generatorBase=c;this.expTable=Array(this.size);this.logTable=Array(this.size);a=1;for(b=0;b<this.size;b++)this.expTable[b]=a,a*=2,a>=this.size&&(a=(a^this.primitive)&this.size-1);for(a=0;a<this.size-1;a++)this.logTable[this.expTable[a]]=a;this.zero=new G(this,Uint8ClampedArray.from([0]));this.one=new G(this,Uint8ClampedArray.from([1]))}multiply(a,b){return 0===a||0===b?0:this.expTable[(this.logTable[a]+this.logTable[b])%(this.size-1)]}inverse(a){if(0===
|
|
37
|
+
a)throw Error("Can't invert 0");return this.expTable[this.size-this.logTable[a]-1]}buildMonomial(a,b){if(0>a)throw Error("Invalid monomial degree less than 0");if(0===b)return this.zero;a=new Uint8ClampedArray(a+1);a[0]=b;return new G(this,a)}log(a){if(0===a)throw Error("Can't take log(0)");return this.logTable[a]}exp(a){return this.expTable[a]}}
|
|
38
|
+
function fa(a,b,c,d){b.degree()<c.degree()&&([b,c]=[c,b]);let e=a.zero;for(var f=a.one;c.degree()>=d/2;){var g=b;let h=e;b=c;e=f;if(b.isZero())return null;c=g;f=a.zero;g=b.getCoefficient(b.degree());for(g=a.inverse(g);c.degree()>=b.degree()&&!c.isZero();){let k=c.degree()-b.degree(),m=a.multiply(c.getCoefficient(c.degree()),g);f=f.addOrSubtract(a.buildMonomial(k,m));c=c.addOrSubtract(b.multiplyByMonomial(k,m))}f=f.multiplyPoly(e).addOrSubtract(h);if(c.degree()>=b.degree())return null}d=f.getCoefficient(0);
|
|
39
|
+
if(0===d)return null;a=a.inverse(d);return[f.multiply(a),c.multiply(a)]}
|
|
40
|
+
function ha(a,b){let c=new Uint8ClampedArray(a.length);c.set(a);a=new ea(285,256,0);var d=new G(a,c),e=new Uint8ClampedArray(b),f=!1;for(var g=0;g<b;g++){var h=d.evaluateAt(a.exp(g+a.generatorBase));e[e.length-1-g]=h;0!==h&&(f=!0)}if(!f)return c;d=new G(a,e);d=fa(a,a.buildMonomial(b,1),d,b);if(null===d)return null;b=d[0];g=b.degree();if(1===g)b=[b.getCoefficient(1)];else{e=Array(g);f=0;for(h=1;h<a.size&&f<g;h++)0===b.evaluateAt(h)&&(e[f]=a.inverse(h),f++);b=f!==g?null:e}if(null==b)return null;e=d[1];
|
|
41
|
+
f=b.length;d=Array(f);for(g=0;g<f;g++){h=a.inverse(b[g]);let k=1;for(let m=0;m<f;m++)g!==m&&(k=a.multiply(k,H(1,a.multiply(b[m],h))));d[g]=a.multiply(e.evaluateAt(h),a.inverse(k));0!==a.generatorBase&&(d[g]=a.multiply(d[g],h))}for(e=0;e<b.length;e++){f=c.length-1-a.log(b[e]);if(0>f)return null;c[f]^=d[e]}return c}
|
|
42
|
+
let I=[{infoBits:null,versionNumber:1,alignmentPatternCenters:[],errorCorrectionLevels:[{ecCodewordsPerBlock:7,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:13,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:13}]},{ecCodewordsPerBlock:17,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:2,alignmentPatternCenters:[6,18],errorCorrectionLevels:[{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,
|
|
43
|
+
dataCodewordsPerBlock:34}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:28}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]}]},{infoBits:null,versionNumber:3,alignmentPatternCenters:[6,22],errorCorrectionLevels:[{ecCodewordsPerBlock:15,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:55}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:18,
|
|
44
|
+
ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:13}]}]},{infoBits:null,versionNumber:4,alignmentPatternCenters:[6,26],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:80}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:32}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:9}]}]},
|
|
45
|
+
{infoBits:null,versionNumber:5,alignmentPatternCenters:[6,30],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:43}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:11},{numBlocks:2,dataCodewordsPerBlock:12}]}]},{infoBits:null,versionNumber:6,alignmentPatternCenters:[6,
|
|
46
|
+
34],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:27}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:31892,versionNumber:7,alignmentPatternCenters:[6,22,38],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:78}]},{ecCodewordsPerBlock:18,
|
|
47
|
+
ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:31}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:13},{numBlocks:1,dataCodewordsPerBlock:14}]}]},{infoBits:34236,versionNumber:8,alignmentPatternCenters:[6,24,42],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:97}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:38},
|
|
48
|
+
{numBlocks:2,dataCodewordsPerBlock:39}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:18},{numBlocks:2,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:14},{numBlocks:2,dataCodewordsPerBlock:15}]}]},{infoBits:39577,versionNumber:9,alignmentPatternCenters:[6,26,46],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:36},
|
|
49
|
+
{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:12},{numBlocks:4,dataCodewordsPerBlock:13}]}]},{infoBits:42195,versionNumber:10,alignmentPatternCenters:[6,28,50],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68},{numBlocks:2,dataCodewordsPerBlock:69}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,
|
|
50
|
+
dataCodewordsPerBlock:43},{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]}]},{infoBits:48118,versionNumber:11,alignmentPatternCenters:[6,30,54],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:81}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,
|
|
51
|
+
dataCodewordsPerBlock:50},{numBlocks:4,dataCodewordsPerBlock:51}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:22},{numBlocks:4,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:12},{numBlocks:8,dataCodewordsPerBlock:13}]}]},{infoBits:51042,versionNumber:12,alignmentPatternCenters:[6,32,58],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:92},{numBlocks:2,dataCodewordsPerBlock:93}]},
|
|
52
|
+
{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:20},{numBlocks:6,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:55367,versionNumber:13,alignmentPatternCenters:[6,34,62],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:107}]},
|
|
53
|
+
{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:37},{numBlocks:1,dataCodewordsPerBlock:38}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:20},{numBlocks:4,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:11},{numBlocks:4,dataCodewordsPerBlock:12}]}]},{infoBits:58893,versionNumber:14,alignmentPatternCenters:[6,26,46,66],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:115},
|
|
54
|
+
{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:40},{numBlocks:5,dataCodewordsPerBlock:41}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:16},{numBlocks:5,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:5,dataCodewordsPerBlock:13}]}]},{infoBits:63784,versionNumber:15,alignmentPatternCenters:[6,26,48,70],errorCorrectionLevels:[{ecCodewordsPerBlock:22,
|
|
55
|
+
ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:87},{numBlocks:1,dataCodewordsPerBlock:88}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:41},{numBlocks:5,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:7,dataCodewordsPerBlock:13}]}]},{infoBits:68472,versionNumber:16,alignmentPatternCenters:[6,26,50,
|
|
56
|
+
74],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:98},{numBlocks:1,dataCodewordsPerBlock:99}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:70749,
|
|
57
|
+
versionNumber:17,alignmentPatternCenters:[6,30,54,78],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:1,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22},{numBlocks:15,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:17,
|
|
58
|
+
dataCodewordsPerBlock:15}]}]},{infoBits:76311,versionNumber:18,alignmentPatternCenters:[6,30,56,82],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:120},{numBlocks:1,dataCodewordsPerBlock:121}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:43},{numBlocks:4,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:1,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,
|
|
59
|
+
dataCodewordsPerBlock:14},{numBlocks:19,dataCodewordsPerBlock:15}]}]},{infoBits:79154,versionNumber:19,alignmentPatternCenters:[6,30,58,86],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:113},{numBlocks:4,dataCodewordsPerBlock:114}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:44},{numBlocks:11,dataCodewordsPerBlock:45}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:21},{numBlocks:4,dataCodewordsPerBlock:22}]},
|
|
60
|
+
{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:13},{numBlocks:16,dataCodewordsPerBlock:14}]}]},{infoBits:84390,versionNumber:20,alignmentPatternCenters:[6,34,62,90],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:41},{numBlocks:13,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},
|
|
61
|
+
{numBlocks:5,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:15},{numBlocks:10,dataCodewordsPerBlock:16}]}]},{infoBits:87683,versionNumber:21,alignmentPatternCenters:[6,28,50,72,94],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:116},{numBlocks:4,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},
|
|
62
|
+
{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:16},{numBlocks:6,dataCodewordsPerBlock:17}]}]},{infoBits:92361,versionNumber:22,alignmentPatternCenters:[6,26,50,74,98],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:111},{numBlocks:7,dataCodewordsPerBlock:112}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},
|
|
63
|
+
{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:13}]}]},{infoBits:96236,versionNumber:23,alignmentPatternCenters:[6,30,54,74,102],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:121},{numBlocks:5,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:47},{numBlocks:14,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},
|
|
64
|
+
{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:16,dataCodewordsPerBlock:15},{numBlocks:14,dataCodewordsPerBlock:16}]}]},{infoBits:102084,versionNumber:24,alignmentPatternCenters:[6,28,54,80,106],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:45},{numBlocks:14,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,
|
|
65
|
+
ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:30,dataCodewordsPerBlock:16},{numBlocks:2,dataCodewordsPerBlock:17}]}]},{infoBits:102881,versionNumber:25,alignmentPatternCenters:[6,32,58,84,110],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:106},{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:47},{numBlocks:13,
|
|
66
|
+
dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:110507,versionNumber:26,alignmentPatternCenters:[6,30,58,86,114],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:114},{numBlocks:2,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,
|
|
67
|
+
dataCodewordsPerBlock:46},{numBlocks:4,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:28,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:33,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]}]},{infoBits:110734,versionNumber:27,alignmentPatternCenters:[6,34,62,90,118],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},
|
|
68
|
+
{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:23},{numBlocks:26,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:117786,versionNumber:28,alignmentPatternCenters:[6,26,50,74,98,122],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:117},
|
|
69
|
+
{numBlocks:10,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:45},{numBlocks:23,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:24},{numBlocks:31,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:31,dataCodewordsPerBlock:16}]}]},{infoBits:119615,versionNumber:29,alignmentPatternCenters:[6,30,54,78,102,126],errorCorrectionLevels:[{ecCodewordsPerBlock:30,
|
|
70
|
+
ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:116},{numBlocks:7,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:21,dataCodewordsPerBlock:45},{numBlocks:7,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:23},{numBlocks:37,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:26,dataCodewordsPerBlock:16}]}]},{infoBits:126325,versionNumber:30,alignmentPatternCenters:[6,
|
|
71
|
+
26,52,78,104,130],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:115},{numBlocks:10,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:47},{numBlocks:10,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:25,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:25,dataCodewordsPerBlock:16}]}]},
|
|
72
|
+
{infoBits:127568,versionNumber:31,alignmentPatternCenters:[6,30,56,82,108,134],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:3,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:46},{numBlocks:29,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:24},{numBlocks:1,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},
|
|
73
|
+
{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:133589,versionNumber:32,alignmentPatternCenters:[6,34,60,86,112,138],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:24},{numBlocks:35,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,
|
|
74
|
+
dataCodewordsPerBlock:15},{numBlocks:35,dataCodewordsPerBlock:16}]}]},{infoBits:136944,versionNumber:33,alignmentPatternCenters:[6,30,58,86,114,142],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:21,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:24},{numBlocks:19,dataCodewordsPerBlock:25}]},
|
|
75
|
+
{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:141498,versionNumber:34,alignmentPatternCenters:[6,34,62,90,118,146],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:6,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:44,
|
|
76
|
+
dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:59,dataCodewordsPerBlock:16},{numBlocks:1,dataCodewordsPerBlock:17}]}]},{infoBits:145311,versionNumber:35,alignmentPatternCenters:[6,30,54,78,102,126,150],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:121},{numBlocks:7,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:47},{numBlocks:26,dataCodewordsPerBlock:48}]},
|
|
77
|
+
{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:39,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:41,dataCodewordsPerBlock:16}]}]},{infoBits:150283,versionNumber:36,alignmentPatternCenters:[6,24,50,76,102,128,154],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:121},{numBlocks:14,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,
|
|
78
|
+
dataCodewordsPerBlock:47},{numBlocks:34,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:46,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:64,dataCodewordsPerBlock:16}]}]},{infoBits:152622,versionNumber:37,alignmentPatternCenters:[6,28,54,80,106,132,158],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},
|
|
79
|
+
{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:46},{numBlocks:14,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:49,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:24,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:158308,versionNumber:38,alignmentPatternCenters:[6,32,58,84,110,136,162],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,
|
|
80
|
+
dataCodewordsPerBlock:122},{numBlocks:18,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:46},{numBlocks:32,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:48,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:15},{numBlocks:32,dataCodewordsPerBlock:16}]}]},{infoBits:161089,versionNumber:39,alignmentPatternCenters:[6,26,54,82,110,138,166],
|
|
81
|
+
errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:40,dataCodewordsPerBlock:47},{numBlocks:7,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:43,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:15},{numBlocks:67,dataCodewordsPerBlock:16}]}]},{infoBits:167017,
|
|
82
|
+
versionNumber:40,alignmentPatternCenters:[6,30,58,86,114,142,170],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:118},{numBlocks:6,dataCodewordsPerBlock:119}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:18,dataCodewordsPerBlock:47},{numBlocks:31,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:24},{numBlocks:34,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:15},
|
|
83
|
+
{numBlocks:61,dataCodewordsPerBlock:16}]}]}];function J(a,b){a^=b;for(b=0;a;)b++,a&=a-1;return b}function K(a,b){return b<<1|a}
|
|
84
|
+
let ia=[{bits:21522,formatInfo:{errorCorrectionLevel:1,dataMask:0}},{bits:20773,formatInfo:{errorCorrectionLevel:1,dataMask:1}},{bits:24188,formatInfo:{errorCorrectionLevel:1,dataMask:2}},{bits:23371,formatInfo:{errorCorrectionLevel:1,dataMask:3}},{bits:17913,formatInfo:{errorCorrectionLevel:1,dataMask:4}},{bits:16590,formatInfo:{errorCorrectionLevel:1,dataMask:5}},{bits:20375,formatInfo:{errorCorrectionLevel:1,dataMask:6}},{bits:19104,formatInfo:{errorCorrectionLevel:1,dataMask:7}},{bits:30660,formatInfo:{errorCorrectionLevel:0,
|
|
85
|
+
dataMask:0}},{bits:29427,formatInfo:{errorCorrectionLevel:0,dataMask:1}},{bits:32170,formatInfo:{errorCorrectionLevel:0,dataMask:2}},{bits:30877,formatInfo:{errorCorrectionLevel:0,dataMask:3}},{bits:26159,formatInfo:{errorCorrectionLevel:0,dataMask:4}},{bits:25368,formatInfo:{errorCorrectionLevel:0,dataMask:5}},{bits:27713,formatInfo:{errorCorrectionLevel:0,dataMask:6}},{bits:26998,formatInfo:{errorCorrectionLevel:0,dataMask:7}},{bits:5769,formatInfo:{errorCorrectionLevel:3,dataMask:0}},{bits:5054,
|
|
86
|
+
formatInfo:{errorCorrectionLevel:3,dataMask:1}},{bits:7399,formatInfo:{errorCorrectionLevel:3,dataMask:2}},{bits:6608,formatInfo:{errorCorrectionLevel:3,dataMask:3}},{bits:1890,formatInfo:{errorCorrectionLevel:3,dataMask:4}},{bits:597,formatInfo:{errorCorrectionLevel:3,dataMask:5}},{bits:3340,formatInfo:{errorCorrectionLevel:3,dataMask:6}},{bits:2107,formatInfo:{errorCorrectionLevel:3,dataMask:7}},{bits:13663,formatInfo:{errorCorrectionLevel:2,dataMask:0}},{bits:12392,formatInfo:{errorCorrectionLevel:2,
|
|
87
|
+
dataMask:1}},{bits:16177,formatInfo:{errorCorrectionLevel:2,dataMask:2}},{bits:14854,formatInfo:{errorCorrectionLevel:2,dataMask:3}},{bits:9396,formatInfo:{errorCorrectionLevel:2,dataMask:4}},{bits:8579,formatInfo:{errorCorrectionLevel:2,dataMask:5}},{bits:11994,formatInfo:{errorCorrectionLevel:2,dataMask:6}},{bits:11245,formatInfo:{errorCorrectionLevel:2,dataMask:7}}],ja=[a=>0===(a.y+a.x)%2,a=>0===a.y%2,a=>0===a.x%3,a=>0===(a.y+a.x)%3,a=>0===(Math.floor(a.y/2)+Math.floor(a.x/3))%2,a=>0===a.x*a.y%
|
|
88
|
+
2+a.x*a.y%3,a=>0===(a.y*a.x%2+a.y*a.x%3)%2,a=>0===((a.y+a.x)%2+a.y*a.x%3)%2];
|
|
89
|
+
function ka(a,b,c){c=ja[c.dataMask];let d=a.height;var e=17+4*b.versionNumber;let f=x.createEmpty(e,e);f.setRegion(0,0,9,9,!0);f.setRegion(e-8,0,8,9,!0);f.setRegion(0,e-8,9,8,!0);for(var g of b.alignmentPatternCenters)for(var h of b.alignmentPatternCenters)6===g&&6===h||6===g&&h===e-7||g===e-7&&6===h||f.setRegion(g-2,h-2,5,5,!0);f.setRegion(6,9,1,e-17,!0);f.setRegion(9,6,e-17,1,!0);6<b.versionNumber&&(f.setRegion(e-11,0,3,6,!0),f.setRegion(0,e-11,6,3,!0));b=[];h=g=0;e=!0;for(let k=d-1;0<k;k-=2){6===
|
|
90
|
+
k&&k--;for(let m=0;m<d;m++){let l=e?d-1-m:m;for(let n=0;2>n;n++){let q=k-n;if(!f.get(q,l)){h++;let r=a.get(q,l);c({y:l,x:q})&&(r=!r);g=g<<1|r;8===h&&(b.push(g),g=h=0)}}}e=!e}return b}
|
|
91
|
+
function la(a){var b=a.height,c=Math.floor((b-17)/4);if(6>=c)return I[c-1];c=0;for(var d=5;0<=d;d--)for(var e=b-9;e>=b-11;e--)c=K(a.get(e,d),c);d=0;for(e=5;0<=e;e--)for(let g=b-9;g>=b-11;g--)d=K(a.get(e,g),d);a=Infinity;let f;for(let g of I){if(g.infoBits===c||g.infoBits===d)return g;b=J(c,g.infoBits);b<a&&(f=g,a=b);b=J(d,g.infoBits);b<a&&(f=g,a=b)}if(3>=a)return f}
|
|
92
|
+
function ma(a){let b=0;for(var c=0;8>=c;c++)6!==c&&(b=K(a.get(c,8),b));for(c=7;0<=c;c--)6!==c&&(b=K(a.get(8,c),b));var d=a.height;c=0;for(var e=d-1;e>=d-7;e--)c=K(a.get(8,e),c);for(e=d-8;e<d;e++)c=K(a.get(e,8),c);a=Infinity;d=null;for(let {bits:f,formatInfo:g}of ia){if(f===b||f===c)return g;e=J(b,f);e<a&&(d=g,a=e);b!==c&&(e=J(c,f),e<a&&(d=g,a=e))}return 3>=a?d:null}
|
|
93
|
+
function na(a,b,c){let d=b.errorCorrectionLevels[c],e=[],f=0;d.ecBlocks.forEach(h=>{for(let k=0;k<h.numBlocks;k++)e.push({numDataCodewords:h.dataCodewordsPerBlock,codewords:[]}),f+=h.dataCodewordsPerBlock+d.ecCodewordsPerBlock});if(a.length<f)return null;a=a.slice(0,f);b=d.ecBlocks[0].dataCodewordsPerBlock;for(c=0;c<b;c++)for(var g of e)g.codewords.push(a.shift());if(1<d.ecBlocks.length)for(g=d.ecBlocks[0].numBlocks,b=d.ecBlocks[1].numBlocks,c=0;c<b;c++)e[g+c].codewords.push(a.shift());for(;0<a.length;)for(let h of e)h.codewords.push(a.shift());
|
|
94
|
+
return e}function L(a){let b=la(a);if(!b)return null;var c=ma(a);if(!c)return null;a=ka(a,b,c);var d=na(a,b,c.errorCorrectionLevel);if(!d)return null;c=d.reduce((e,f)=>e+f.numDataCodewords,0);c=new Uint8ClampedArray(c);a=0;for(let e of d){d=ha(e.codewords,e.codewords.length-e.numDataCodewords);if(!d)return null;for(let f=0;f<e.numDataCodewords;f++)c[a++]=d[f]}try{return da(c,b.versionNumber)}catch(e){return null}}
|
|
95
|
+
function M(a,b,c,d){var e=a.x-b.x+c.x-d.x;let f=a.y-b.y+c.y-d.y;if(0===e&&0===f)return{a11:b.x-a.x,a12:b.y-a.y,a13:0,a21:c.x-b.x,a22:c.y-b.y,a23:0,a31:a.x,a32:a.y,a33:1};let g=b.x-c.x;var h=d.x-c.x;let k=b.y-c.y,m=d.y-c.y;c=g*m-h*k;h=(e*m-h*f)/c;e=(g*f-e*k)/c;return{a11:b.x-a.x+h*b.x,a12:b.y-a.y+h*b.y,a13:h,a21:d.x-a.x+e*d.x,a22:d.y-a.y+e*d.y,a23:e,a31:a.x,a32:a.y,a33:1}}
|
|
96
|
+
function oa(a,b,c,d){a=M(a,b,c,d);return{a11:a.a22*a.a33-a.a23*a.a32,a12:a.a13*a.a32-a.a12*a.a33,a13:a.a12*a.a23-a.a13*a.a22,a21:a.a23*a.a31-a.a21*a.a33,a22:a.a11*a.a33-a.a13*a.a31,a23:a.a13*a.a21-a.a11*a.a23,a31:a.a21*a.a32-a.a22*a.a31,a32:a.a12*a.a31-a.a11*a.a32,a33:a.a11*a.a22-a.a12*a.a21}}
|
|
97
|
+
function pa(a,b){var c=oa({x:3.5,y:3.5},{x:b.dimension-3.5,y:3.5},{x:b.dimension-6.5,y:b.dimension-6.5},{x:3.5,y:b.dimension-3.5}),d=M(b.topLeft,b.topRight,b.alignmentPattern,b.bottomLeft),e=d.a11*c.a11+d.a21*c.a12+d.a31*c.a13,f=d.a12*c.a11+d.a22*c.a12+d.a32*c.a13,g=d.a13*c.a11+d.a23*c.a12+d.a33*c.a13,h=d.a11*c.a21+d.a21*c.a22+d.a31*c.a23,k=d.a12*c.a21+d.a22*c.a22+d.a32*c.a23,m=d.a13*c.a21+d.a23*c.a22+d.a33*c.a23,l=d.a11*c.a31+d.a21*c.a32+d.a31*c.a33,n=d.a12*c.a31+d.a22*c.a32+d.a32*c.a33,q=d.a13*
|
|
98
|
+
c.a31+d.a23*c.a32+d.a33*c.a33;c=x.createEmpty(b.dimension,b.dimension);d=(r,u)=>{const p=g*r+m*u+q;return{x:(e*r+h*u+l)/p,y:(f*r+k*u+n)/p}};for(let r=0;r<b.dimension;r++)for(let u=0;u<b.dimension;u++){let p=d(u+.5,r+.5);c.set(u,r,a.get(Math.floor(p.x),Math.floor(p.y)))}return{matrix:c,mappingFunction:d}}let N=(a,b)=>Math.sqrt(Math.pow(b.x-a.x,2)+Math.pow(b.y-a.y,2));function O(a){return a.reduce((b,c)=>b+c)}
|
|
99
|
+
function qa(a,b,c){let d=N(a,b),e=N(b,c),f=N(a,c),g,h,k;e>=d&&e>=f?[g,h,k]=[b,a,c]:f>=e&&f>=d?[g,h,k]=[a,b,c]:[g,h,k]=[a,c,b];0>(k.x-h.x)*(g.y-h.y)-(k.y-h.y)*(g.x-h.x)&&([g,k]=[k,g]);return{bottomLeft:g,topLeft:h,topRight:k}}
|
|
100
|
+
function ra(a,b,c,d){d=(O(P(a,c,d,5))/7+O(P(a,b,d,5))/7+O(P(c,a,d,5))/7+O(P(b,a,d,5))/7)/4;if(1>d)throw Error("Invalid module size");b=Math.round(N(a,b)/d);a=Math.round(N(a,c)/d);a=Math.floor((b+a)/2)+7;switch(a%4){case 0:a++;break;case 2:a--}return{dimension:a,moduleSize:d}}
|
|
101
|
+
function Q(a,b,c,d){let e=[{x:Math.floor(a.x),y:Math.floor(a.y)}];var f=Math.abs(b.y-a.y)>Math.abs(b.x-a.x);if(f){var g=Math.floor(a.y);var h=Math.floor(a.x);a=Math.floor(b.y);b=Math.floor(b.x)}else g=Math.floor(a.x),h=Math.floor(a.y),a=Math.floor(b.x),b=Math.floor(b.y);let k=Math.abs(a-g),m=Math.abs(b-h),l=Math.floor(-k/2),n=g<a?1:-1,q=h<b?1:-1,r=!0;for(let u=g,p=h;u!==a+n;u+=n){g=f?p:u;h=f?u:p;if(c.get(g,h)!==r&&(r=!r,e.push({x:g,y:h}),e.length===d+1))break;l+=m;if(0<l){if(p===b)break;p+=q;l-=k}}c=
|
|
102
|
+
[];for(f=0;f<d;f++)e[f]&&e[f+1]?c.push(N(e[f],e[f+1])):c.push(0);return c}function P(a,b,c,d){let e=b.y-a.y,f=b.x-a.x;b=Q(a,b,c,Math.ceil(d/2));a=Q(a,{x:a.x-f,y:a.y-e},c,Math.ceil(d/2));c=b.shift()+a.shift()-1;return a.concat(c).concat(...b)}function R(a,b){let c=O(a)/O(b),d=0;b.forEach((e,f)=>{d+=Math.pow(a[f]-e*c,2)});return{averageSize:c,error:d}}
|
|
103
|
+
function S(a,b,c){try{let d=P(a,{x:-1,y:a.y},c,b.length),e=P(a,{x:a.x,y:-1},c,b.length),f=P(a,{x:Math.max(0,a.x-a.y)-1,y:Math.max(0,a.y-a.x)-1},c,b.length),g=P(a,{x:Math.min(c.width,a.x+a.y)+1,y:Math.min(c.height,a.y+a.x)+1},c,b.length),h=R(d,b),k=R(e,b),m=R(f,b),l=R(g,b),n=(h.averageSize+k.averageSize+m.averageSize+l.averageSize)/4;return Math.sqrt(h.error*h.error+k.error*k.error+m.error*m.error+l.error*l.error)+(Math.pow(h.averageSize-n,2)+Math.pow(k.averageSize-n,2)+Math.pow(m.averageSize-n,2)+
|
|
104
|
+
Math.pow(l.averageSize-n,2))/n}catch(d){return Infinity}}function T(a,b){for(var c=Math.round(b.x);a.get(c,Math.round(b.y));)c--;for(var d=Math.round(b.x);a.get(d,Math.round(b.y));)d++;c=(c+d)/2;for(d=Math.round(b.y);a.get(Math.round(c),d);)d--;for(b=Math.round(b.y);a.get(Math.round(c),b);)b++;return{x:c,y:(d+b)/2}}
|
|
105
|
+
function sa(a){var b=[],c=[];let d=[];var e=[];for(let p=0;p<=a.height;p++){var f=0,g=!1;let t=[0,0,0,0,0];for(let v=-1;v<=a.width;v++){var h=a.get(v,p);if(h===g)f++;else{t=[t[1],t[2],t[3],t[4],f];f=1;g=h;var k=O(t)/7;k=Math.abs(t[0]-k)<k&&Math.abs(t[1]-k)<k&&Math.abs(t[2]-3*k)<3*k&&Math.abs(t[3]-k)<k&&Math.abs(t[4]-k)<k&&!h;var m=O(t.slice(-3))/3;h=Math.abs(t[2]-m)<m&&Math.abs(t[3]-m)<m&&Math.abs(t[4]-m)<m&&h;if(k){let z=v-t[3]-t[4],y=z-t[2];k={startX:y,endX:z,y:p};m=c.filter(w=>y>=w.bottom.startX&&
|
|
106
|
+
y<=w.bottom.endX||z>=w.bottom.startX&&y<=w.bottom.endX||y<=w.bottom.startX&&z>=w.bottom.endX&&1.5>t[2]/(w.bottom.endX-w.bottom.startX)&&.5<t[2]/(w.bottom.endX-w.bottom.startX));0<m.length?m[0].bottom=k:c.push({top:k,bottom:k})}if(h){let z=v-t[4],y=z-t[3];h={startX:y,y:p,endX:z};k=e.filter(w=>y>=w.bottom.startX&&y<=w.bottom.endX||z>=w.bottom.startX&&y<=w.bottom.endX||y<=w.bottom.startX&&z>=w.bottom.endX&&1.5>t[2]/(w.bottom.endX-w.bottom.startX)&&.5<t[2]/(w.bottom.endX-w.bottom.startX));0<k.length?
|
|
107
|
+
k[0].bottom=h:e.push({top:h,bottom:h})}}}b.push(...c.filter(v=>v.bottom.y!==p&&2<=v.bottom.y-v.top.y));c=c.filter(v=>v.bottom.y===p);d.push(...e.filter(v=>v.bottom.y!==p));e=e.filter(v=>v.bottom.y===p)}b.push(...c.filter(p=>2<=p.bottom.y-p.top.y));d.push(...e);c=[];for(var l of b)2>l.bottom.y-l.top.y||(b=(l.top.startX+l.top.endX+l.bottom.startX+l.bottom.endX)/4,e=(l.top.y+l.bottom.y+1)/2,a.get(Math.round(b),Math.round(e))&&(f=[l.top.endX-l.top.startX,l.bottom.endX-l.bottom.startX,l.bottom.y-l.top.y+
|
|
108
|
+
1],f=O(f)/f.length,g=S({x:Math.round(b),y:Math.round(e)},[1,1,3,1,1],a),c.push({score:g,x:b,y:e,size:f})));if(3>c.length)return null;c.sort((p,t)=>p.score-t.score);l=[];for(b=0;b<Math.min(c.length,5);++b){e=c[b];f=[];for(var n of c)n!==e&&f.push(Object.assign(Object.assign({},n),{score:n.score+Math.pow(n.size-e.size,2)/e.size}));f.sort((p,t)=>p.score-t.score);l.push({points:[e,f[0],f[1]],score:e.score+f[0].score+f[1].score})}l.sort((p,t)=>p.score-t.score);let {topRight:q,topLeft:r,bottomLeft:u}=qa(...l[0].points);
|
|
109
|
+
l=U(a,d,q,r,u);n=[];l&&n.push({alignmentPattern:{x:l.alignmentPattern.x,y:l.alignmentPattern.y},bottomLeft:{x:u.x,y:u.y},dimension:l.dimension,topLeft:{x:r.x,y:r.y},topRight:{x:q.x,y:q.y}});l=T(a,q);b=T(a,r);c=T(a,u);(a=U(a,d,l,b,c))&&n.push({alignmentPattern:{x:a.alignmentPattern.x,y:a.alignmentPattern.y},bottomLeft:{x:c.x,y:c.y},topLeft:{x:b.x,y:b.y},topRight:{x:l.x,y:l.y},dimension:a.dimension});return 0===n.length?null:n}
|
|
110
|
+
function U(a,b,c,d,e){let f,g;try{({dimension:f,moduleSize:g}=ra(d,c,e,a))}catch(l){return null}var h=c.x-d.x+e.x,k=c.y-d.y+e.y;c=(N(d,e)+N(d,c))/2/g;e=1-3/c;let m={x:d.x+e*(h-d.x),y:d.y+e*(k-d.y)};b=b.map(l=>{const n=(l.top.startX+l.top.endX+l.bottom.startX+l.bottom.endX)/4;l=(l.top.y+l.bottom.y+1)/2;if(a.get(Math.floor(n),Math.floor(l))){var q=S({x:Math.floor(n),y:Math.floor(l)},[1,1,1],a)+N({x:n,y:l},m);return{x:n,y:l,score:q}}}).filter(l=>!!l).sort((l,n)=>l.score-n.score);return{alignmentPattern:15<=
|
|
111
|
+
c&&b.length?b[0]:m,dimension:f}}
|
|
112
|
+
function V(a){var b=sa(a);if(!b)return null;for(let e of b){b=pa(a,e);var c=b.matrix;if(null==c)c=null;else{var d=L(c);if(d)c=d;else{for(d=0;d<c.width;d++)for(let f=d+1;f<c.height;f++)c.get(d,f)!==c.get(f,d)&&(c.set(d,f,!c.get(d,f)),c.set(f,d,!c.get(f,d)));c=L(c)}}if(c)return{binaryData:c.bytes,data:c.text,chunks:c.chunks,version:c.version,location:{topRightCorner:b.mappingFunction(e.dimension,0),topLeftCorner:b.mappingFunction(0,0),bottomRightCorner:b.mappingFunction(e.dimension,e.dimension),bottomLeftCorner:b.mappingFunction(0,
|
|
113
|
+
e.dimension),topRightFinderPattern:e.topRight,topLeftFinderPattern:e.topLeft,bottomLeftFinderPattern:e.bottomLeft,bottomRightAlignmentPattern:e.alignmentPattern},matrix:b.matrix}}return null}let ta={inversionAttempts:"attemptBoth",greyScaleWeights:{red:.2126,green:.7152,blue:.0722,useIntegerApproximation:!1},canOverwriteImage:!0};function W(a,b){Object.keys(b).forEach(c=>{a[c]=b[c]})}
|
|
114
|
+
function X(a,b,c,d={}){let e=Object.create(null);W(e,ta);W(e,d);d="onlyInvert"===e.inversionAttempts||"invertFirst"===e.inversionAttempts;var f="attemptBoth"===e.inversionAttempts||d;var g=e.greyScaleWeights,h=e.canOverwriteImage,k=b*c;if(a.length!==4*k)throw Error("Malformed data passed to binarizer.");var m=0;if(h){var l=new Uint8ClampedArray(a.buffer,m,k);m+=k}l=new A(b,c,l);if(g.useIntegerApproximation)for(var n=0;n<c;n++)for(var q=0;q<b;q++){var r=4*(n*b+q);l.set(q,n,g.red*a[r]+g.green*a[r+1]+
|
|
115
|
+
g.blue*a[r+2]+128>>8)}else for(n=0;n<c;n++)for(q=0;q<b;q++)r=4*(n*b+q),l.set(q,n,g.red*a[r]+g.green*a[r+1]+g.blue*a[r+2]);g=Math.ceil(b/8);n=Math.ceil(c/8);q=g*n;if(h){var u=new Uint8ClampedArray(a.buffer,m,q);m+=q}u=new A(g,n,u);for(q=0;q<n;q++)for(r=0;r<g;r++){var p=Infinity,t=0;for(var v=0;8>v;v++)for(let w=0;8>w;w++){let aa=l.get(8*r+w,8*q+v);p=Math.min(p,aa);t=Math.max(t,aa)}v=(p+t)/2;v=Math.min(255,1.11*v);24>=t-p&&(v=p/2,0<q&&0<r&&(t=(u.get(r,q-1)+2*u.get(r-1,q)+u.get(r-1,q-1))/4,p<t&&(v=t)));
|
|
116
|
+
u.set(r,q,v)}h?(q=new Uint8ClampedArray(a.buffer,m,k),m+=k,q=new x(q,b)):q=x.createEmpty(b,c);r=null;f&&(h?(a=new Uint8ClampedArray(a.buffer,m,k),r=new x(a,b)):r=x.createEmpty(b,c));for(b=0;b<n;b++)for(a=0;a<g;a++){c=g-3;c=2>a?2:a>c?c:a;h=n-3;h=2>b?2:b>h?h:b;k=0;for(m=-2;2>=m;m++)for(p=-2;2>=p;p++)k+=u.get(c+m,h+p);c=k/25;for(h=0;8>h;h++)for(k=0;8>k;k++)m=8*a+h,p=8*b+k,t=l.get(m,p),q.set(m,p,t<=c),f&&r.set(m,p,!(t<=c))}f=f?{binarized:q,inverted:r}:{binarized:q};let {binarized:z,inverted:y}=f;(f=V(d?
|
|
117
|
+
y:z))||"attemptBoth"!==e.inversionAttempts&&"invertFirst"!==e.inversionAttempts||(f=V(d?z:y));return f}X.default=X;let Y="dontInvert",Z={red:77,green:150,blue:29,useIntegerApproximation:!0};
|
|
118
|
+
self.onmessage=a=>{let b=a.data.id,c=a.data.data;switch(a.data.type){case "decode":(a=X(c.data,c.width,c.height,{inversionAttempts:Y,greyScaleWeights:Z}))?self.postMessage({id:b,type:"qrResult",data:a.data,cornerPoints:[a.location.topLeftCorner,a.location.topRightCorner,a.location.bottomRightCorner,a.location.bottomLeftCorner]}):self.postMessage({id:b,type:"qrResult",data:null});break;case "grayscaleWeights":Z.red=c.red;Z.green=c.green;Z.blue=c.blue;Z.useIntegerApproximation=c.useIntegerApproximation;
|
|
119
|
+
break;case "inversionMode":switch(c){case "original":Y="dontInvert";break;case "invert":Y="onlyInvert";break;case "both":Y="attemptBoth";break;default:throw Error("Invalid inversion mode");}break;case "close":self.close()}}
|
|
120
|
+
`]),{type:`application/javascript`}))})),ST=class e{constructor(t,n,r,i,a){this._legacyCanvasSize=e.DEFAULT_CANVAS_SIZE,this._preferredCamera=`environment`,this._maxScansPerSecond=25,this._lastScanTimestamp=-1,this._destroyed=this._flashOn=this._paused=this._active=!1,this.$video=t,this.$canvas=document.createElement(`canvas`),r&&typeof r==`object`?this._onDecode=n:(console.warn(r||i||a?`You're using a deprecated version of the QrScanner constructor which will be removed in the future`:`Note that the type of the scan result passed to onDecode will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true.`),this._legacyOnDecode=n),n=typeof r==`object`?r:{},this._onDecodeError=n.onDecodeError||(typeof r==`function`?r:this._onDecodeError),this._calculateScanRegion=n.calculateScanRegion||(typeof i==`function`?i:this._calculateScanRegion),this._preferredCamera=n.preferredCamera||a||this._preferredCamera,this._legacyCanvasSize=typeof r==`number`?r:typeof i==`number`?i:this._legacyCanvasSize,this._maxScansPerSecond=n.maxScansPerSecond||this._maxScansPerSecond,this._onPlay=this._onPlay.bind(this),this._onLoadedMetaData=this._onLoadedMetaData.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),this._updateOverlay=this._updateOverlay.bind(this),t.disablePictureInPicture=!0,t.playsInline=!0,t.muted=!0;let o=!1;if(t.hidden&&(t.hidden=!1,o=!0),document.body.contains(t)||(document.body.appendChild(t),o=!0),r=t.parentElement,n.highlightScanRegion||n.highlightCodeOutline){if(i=!!n.overlay,this.$overlay=n.overlay||document.createElement(`div`),a=this.$overlay.style,a.position=`absolute`,a.display=`none`,a.pointerEvents=`none`,this.$overlay.classList.add(`scan-region-highlight`),!i&&n.highlightScanRegion){this.$overlay.innerHTML=`<svg class="scan-region-highlight-svg" viewBox="0 0 238 238" preserveAspectRatio="none" style="position:absolute;width:100%;height:100%;left:0;top:0;fill:none;stroke:#e9b213;stroke-width:4;stroke-linecap:round;stroke-linejoin:round"><path d="M31 2H10a8 8 0 0 0-8 8v21M207 2h21a8 8 0 0 1 8 8v21m0 176v21a8 8 0 0 1-8 8h-21m-176 0H10a8 8 0 0 1-8-8v-21"/></svg>`;try{this.$overlay.firstElementChild.animate({transform:[`scale(.98)`,`scale(1.01)`]},{duration:400,iterations:1/0,direction:`alternate`,easing:`ease-in-out`})}catch{}r.insertBefore(this.$overlay,this.$video.nextSibling)}n.highlightCodeOutline&&(this.$overlay.insertAdjacentHTML(`beforeend`,`<svg class="code-outline-highlight" preserveAspectRatio="none" style="display:none;width:100%;height:100%;fill:none;stroke:#e9b213;stroke-width:5;stroke-dasharray:25;stroke-linecap:round;stroke-linejoin:round"><polygon/></svg>`),this.$codeOutlineHighlight=this.$overlay.lastElementChild)}this._scanRegion=this._calculateScanRegion(t),requestAnimationFrame(()=>{let e=window.getComputedStyle(t);e.display===`none`&&(t.style.setProperty(`display`,`block`,`important`),o=!0),e.visibility!==`visible`&&(t.style.setProperty(`visibility`,`visible`,`important`),o=!0),o&&(console.warn(`QrScanner has overwritten the video hiding style to avoid Safari stopping the playback.`),t.style.opacity=`0`,t.style.width=`0`,t.style.height=`0`,this.$overlay&&this.$overlay.parentElement&&this.$overlay.parentElement.removeChild(this.$overlay),delete this.$overlay,delete this.$codeOutlineHighlight),this.$overlay&&this._updateOverlay()}),t.addEventListener(`play`,this._onPlay),t.addEventListener(`loadedmetadata`,this._onLoadedMetaData),document.addEventListener(`visibilitychange`,this._onVisibilityChange),window.addEventListener(`resize`,this._updateOverlay),this._qrEnginePromise=e.createQrEngine()}static set WORKER_PATH(e){console.warn(`Setting QrScanner.WORKER_PATH is not required and not supported anymore. Have a look at the README for new setup instructions.`)}static async hasCamera(){try{return!!(await e.listCameras(!1)).length}catch{return!1}}static async listCameras(t=!1){if(!navigator.mediaDevices)return[];let n=async()=>(await navigator.mediaDevices.enumerateDevices()).filter(e=>e.kind===`videoinput`),r;try{t&&(await n()).every(e=>!e.label)&&(r=await navigator.mediaDevices.getUserMedia({audio:!1,video:!0}))}catch{}try{return(await n()).map((e,t)=>({id:e.deviceId,label:e.label||(t===0?`Default Camera`:`Camera ${t+1}`)}))}finally{r&&(console.warn(`Call listCameras after successfully starting a QR scanner to avoid creating a temporary video stream`),e._stopVideoStream(r))}}async hasFlash(){let t;try{if(this.$video.srcObject){if(!(this.$video.srcObject instanceof MediaStream))return!1;t=this.$video.srcObject}else t=(await this._getCameraStream()).stream;return`torch`in t.getVideoTracks()[0].getSettings()}catch{return!1}finally{t&&t!==this.$video.srcObject&&(console.warn(`Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream`),e._stopVideoStream(t))}}isFlashOn(){return this._flashOn}async toggleFlash(){this._flashOn?await this.turnFlashOff():await this.turnFlashOn()}async turnFlashOn(){if(!this._flashOn&&!this._destroyed&&(this._flashOn=!0,this._active&&!this._paused))try{if(!await this.hasFlash())throw`No flash available`;await this.$video.srcObject.getVideoTracks()[0].applyConstraints({advanced:[{torch:!0}]})}catch(e){throw this._flashOn=!1,e}}async turnFlashOff(){this._flashOn&&(this._flashOn=!1,await this._restartVideoStream())}destroy(){this.$video.removeEventListener(`loadedmetadata`,this._onLoadedMetaData),this.$video.removeEventListener(`play`,this._onPlay),document.removeEventListener(`visibilitychange`,this._onVisibilityChange),window.removeEventListener(`resize`,this._updateOverlay),this._destroyed=!0,this._flashOn=!1,this.stop(),e._postWorkerMessage(this._qrEnginePromise,`close`)}async start(){if(this._destroyed)throw Error(`The QR scanner can not be started as it had been destroyed.`);if((!this._active||this._paused)&&(window.location.protocol!==`https:`&&console.warn(`The camera stream is only accessible if the page is transferred via https.`),this._active=!0,!document.hidden))if(this._paused=!1,this.$video.srcObject)await this.$video.play();else try{let{stream:t,facingMode:n}=await this._getCameraStream();!this._active||this._paused?e._stopVideoStream(t):(this._setVideoMirror(n),this.$video.srcObject=t,await this.$video.play(),this._flashOn&&(this._flashOn=!1,this.turnFlashOn().catch(()=>{})))}catch(e){if(!this._paused)throw this._active=!1,e}}stop(){this.pause(),this._active=!1}async pause(t=!1){if(this._paused=!0,!this._active)return!0;this.$video.pause(),this.$overlay&&(this.$overlay.style.display=`none`);let n=()=>{this.$video.srcObject instanceof MediaStream&&(e._stopVideoStream(this.$video.srcObject),this.$video.srcObject=null)};return t?(n(),!0):(await new Promise(e=>setTimeout(e,300)),this._paused?(n(),!0):!1)}async setCamera(e){e!==this._preferredCamera&&(this._preferredCamera=e,await this._restartVideoStream())}static async scanImage(t,n,r,i,a=!1,o=!1){let s,c=!1;n&&(`scanRegion`in n||`qrEngine`in n||`canvas`in n||`disallowCanvasResizing`in n||`alsoTryWithoutScanRegion`in n||`returnDetailedScanResult`in n)?(s=n.scanRegion,r=n.qrEngine,i=n.canvas,a=n.disallowCanvasResizing||!1,o=n.alsoTryWithoutScanRegion||!1,c=!0):console.warn(n||r||i||a||o?`You're using a deprecated api for scanImage which will be removed in the future.`:`Note that the return type of scanImage will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true.`),n=!!r;try{let l,u;[r,l]=await Promise.all([r||e.createQrEngine(),e._loadImage(t)]),[i,u]=e._drawToCanvas(l,s,i,a);let d;if(r instanceof Worker){let t=r;n||e._postWorkerMessageSync(t,`inversionMode`,`both`),d=await new Promise((n,r)=>{let a,o,c,l=-1;o=i=>{i.data.id===l&&(t.removeEventListener(`message`,o),t.removeEventListener(`error`,c),clearTimeout(a),i.data.data===null?r(e.NO_QR_CODE_FOUND):n({data:i.data.data,cornerPoints:e._convertPoints(i.data.cornerPoints,s)}))},c=e=>{t.removeEventListener(`message`,o),t.removeEventListener(`error`,c),clearTimeout(a),r(`Scanner error: `+(e?e.message||e:`Unknown Error`))},t.addEventListener(`message`,o),t.addEventListener(`error`,c),a=setTimeout(()=>c(`timeout`),1e4);let d=u.getImageData(0,0,i.width,i.height);l=e._postWorkerMessageSync(t,`decode`,d,[d.data.buffer])})}else d=await Promise.race([new Promise((e,t)=>window.setTimeout(()=>t(`Scanner error: timeout`),1e4)),(async()=>{try{var[n]=await r.detect(i);if(!n)throw e.NO_QR_CODE_FOUND;return{data:n.rawValue,cornerPoints:e._convertPoints(n.cornerPoints,s)}}catch(r){if(n=r.message||r,/not implemented|service unavailable/.test(n))return e._disableBarcodeDetector=!0,e.scanImage(t,{scanRegion:s,canvas:i,disallowCanvasResizing:a,alsoTryWithoutScanRegion:o});throw`Scanner error: ${n}`}})()]);return c?d:d.data}catch(n){if(!s||!o)throw n;let l=await e.scanImage(t,{qrEngine:r,canvas:i,disallowCanvasResizing:a});return c?l:l.data}finally{n||e._postWorkerMessage(r,`close`)}}setGrayscaleWeights(t,n,r,i=!0){e._postWorkerMessage(this._qrEnginePromise,`grayscaleWeights`,{red:t,green:n,blue:r,useIntegerApproximation:i})}setInversionMode(t){e._postWorkerMessage(this._qrEnginePromise,`inversionMode`,t)}static async createQrEngine(t){if(t&&console.warn(`Specifying a worker path is not required and not supported anymore.`),t=()=>Promise.resolve().then(()=>(xT(),yT)).then(e=>e.createWorker()),!(!e._disableBarcodeDetector&&`BarcodeDetector`in window&&BarcodeDetector.getSupportedFormats&&(await BarcodeDetector.getSupportedFormats()).includes(`qr_code`)))return t();let n=navigator.userAgentData;return n&&n.brands.some(({brand:e})=>/Chromium/i.test(e))&&/mac ?OS/i.test(n.platform)&&await n.getHighEntropyValues([`architecture`,`platformVersion`]).then(({architecture:e,platformVersion:t})=>/arm/i.test(e||`arm`)&&13<=parseInt(t||`13`)).catch(()=>!0)?t():new BarcodeDetector({formats:[`qr_code`]})}_onPlay(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay(),this.$overlay&&(this.$overlay.style.display=``),this._scanFrame()}_onLoadedMetaData(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay()}_onVisibilityChange(){document.hidden?this.pause():this._active&&this.start()}_calculateScanRegion(e){let t=Math.round(2/3*Math.min(e.videoWidth,e.videoHeight));return{x:Math.round((e.videoWidth-t)/2),y:Math.round((e.videoHeight-t)/2),width:t,height:t,downScaledWidth:this._legacyCanvasSize,downScaledHeight:this._legacyCanvasSize}}_updateOverlay(){requestAnimationFrame(()=>{if(this.$overlay){var e=this.$video,t=e.videoWidth,n=e.videoHeight,r=e.offsetWidth,i=e.offsetHeight,a=e.offsetLeft,o=e.offsetTop,s=window.getComputedStyle(e),c=s.objectFit,l=t/n,u=r/i;switch(c){case`none`:var d=t,f=n;break;case`fill`:d=r,f=i;break;default:(c===`cover`?l>u:l<u)?(f=i,d=f*l):(d=r,f=d/l),c===`scale-down`&&(d=Math.min(d,t),f=Math.min(f,n))}var[p,m]=s.objectPosition.split(` `).map((e,t)=>{let n=parseFloat(e);return e.endsWith(`%`)?(t?i-f:r-d)*n/100:n});s=this._scanRegion.width||t,u=this._scanRegion.height||n,c=this._scanRegion.x||0;var h=this._scanRegion.y||0;l=this.$overlay.style,l.width=`${s/t*d}px`,l.height=`${u/n*f}px`,l.top=`${o+m+h/n*f}px`,n=/scaleX\(-1\)/.test(e.style.transform),l.left=`${a+(n?r-p-d:p)+(n?t-c-s:c)/t*d}px`,l.transform=e.style.transform}})}static _convertPoints(e,t){if(!t)return e;let n=t.x||0,r=t.y||0,i=t.width&&t.downScaledWidth?t.width/t.downScaledWidth:1;t=t.height&&t.downScaledHeight?t.height/t.downScaledHeight:1;for(let a of e)a.x=a.x*i+n,a.y=a.y*t+r;return e}_scanFrame(){!this._active||this.$video.paused||this.$video.ended||(`requestVideoFrameCallback`in this.$video?this.$video.requestVideoFrameCallback.bind(this.$video):requestAnimationFrame)(async()=>{if(!(1>=this.$video.readyState)){var t=Date.now()-this._lastScanTimestamp,n=1e3/this._maxScansPerSecond;t<n&&await new Promise(e=>setTimeout(e,n-t)),this._lastScanTimestamp=Date.now();try{var r=await e.scanImage(this.$video,{scanRegion:this._scanRegion,qrEngine:this._qrEnginePromise,canvas:this.$canvas})}catch(e){if(!this._active)return;this._onDecodeError(e)}!e._disableBarcodeDetector||await this._qrEnginePromise instanceof Worker||(this._qrEnginePromise=e.createQrEngine()),r?(this._onDecode?this._onDecode(r):this._legacyOnDecode&&this._legacyOnDecode(r.data),this.$codeOutlineHighlight&&(clearTimeout(this._codeOutlineHighlightRemovalTimeout),this._codeOutlineHighlightRemovalTimeout=void 0,this.$codeOutlineHighlight.setAttribute(`viewBox`,`${this._scanRegion.x||0} ${this._scanRegion.y||0} ${this._scanRegion.width||this.$video.videoWidth} ${this._scanRegion.height||this.$video.videoHeight}`),this.$codeOutlineHighlight.firstElementChild.setAttribute(`points`,r.cornerPoints.map(({x:e,y:t})=>`${e},${t}`).join(` `)),this.$codeOutlineHighlight.style.display=``)):this.$codeOutlineHighlight&&!this._codeOutlineHighlightRemovalTimeout&&(this._codeOutlineHighlightRemovalTimeout=setTimeout(()=>this.$codeOutlineHighlight.style.display=`none`,100))}this._scanFrame()})}_onDecodeError(t){t!==e.NO_QR_CODE_FOUND&&console.log(t)}async _getCameraStream(){if(!navigator.mediaDevices)throw`Camera not found.`;let e=/^(environment|user)$/.test(this._preferredCamera)?`facingMode`:`deviceId`,t=[{width:{min:1024}},{width:{min:768}},{}],n=t.map(t=>Object.assign({},t,{[e]:{exact:this._preferredCamera}}));for(let e of[...n,...t])try{let t=await navigator.mediaDevices.getUserMedia({video:e,audio:!1});return{stream:t,facingMode:this._getFacingMode(t)||(e.facingMode?this._preferredCamera:this._preferredCamera===`environment`?`user`:`environment`)}}catch{}throw`Camera not found.`}async _restartVideoStream(){let e=this._paused;await this.pause(!0)&&!e&&this._active&&await this.start()}static _stopVideoStream(e){for(let t of e.getTracks())t.stop(),e.removeTrack(t)}_setVideoMirror(e){this.$video.style.transform=`scaleX(`+(e===`user`?-1:1)+`)`}_getFacingMode(e){return(e=e.getVideoTracks()[0])?/rear|back|environment/i.test(e.label)?`environment`:/front|user|face/i.test(e.label)?`user`:null:null}static _drawToCanvas(e,t,n,r=!1){n||=document.createElement(`canvas`);let i=t&&t.x?t.x:0,a=t&&t.y?t.y:0,o=t&&t.width?t.width:e.videoWidth||e.width,s=t&&t.height?t.height:e.videoHeight||e.height;return r||(r=t&&t.downScaledWidth?t.downScaledWidth:o,t=t&&t.downScaledHeight?t.downScaledHeight:s,n.width!==r&&(n.width=r),n.height!==t&&(n.height=t)),t=n.getContext(`2d`,{alpha:!1}),t.imageSmoothingEnabled=!1,t.drawImage(e,i,a,o,s,0,0,n.width,n.height),[n,t]}static async _loadImage(t){if(t instanceof Image)return await e._awaitImageLoad(t),t;if(t instanceof HTMLVideoElement||t instanceof HTMLCanvasElement||t instanceof SVGImageElement||`OffscreenCanvas`in window&&t instanceof OffscreenCanvas||`ImageBitmap`in window&&t instanceof ImageBitmap)return t;if(t instanceof File||t instanceof Blob||t instanceof URL||typeof t==`string`){let n=new Image;n.src=t instanceof File||t instanceof Blob?URL.createObjectURL(t):t.toString();try{return await e._awaitImageLoad(n),n}finally{(t instanceof File||t instanceof Blob)&&URL.revokeObjectURL(n.src)}}else throw`Unsupported image type.`}static async _awaitImageLoad(e){e.complete&&e.naturalWidth!==0||await new Promise((t,n)=>{let r=i=>{e.removeEventListener(`load`,r),e.removeEventListener(`error`,r),i instanceof ErrorEvent?n(`Image load error`):t()};e.addEventListener(`load`,r),e.addEventListener(`error`,r)})}static async _postWorkerMessage(t,n,r,i){return e._postWorkerMessageSync(await t,n,r,i)}static _postWorkerMessageSync(t,n,r,i){if(!(t instanceof Worker))return-1;let a=e._workerMessageId++;return t.postMessage({id:a,type:n,data:r},i),a}};ST.DEFAULT_CANVAS_SIZE=400,ST.NO_QR_CODE_FOUND=`No QR code found`,ST._disableBarcodeDetector=!1,ST._workerMessageId=0;var CT=d(((e,t)=>{(function(n,r){"use strict";var i=`1.0.41`,a=``,o=`?`,s=`function`,c=`undefined`,l=`object`,u=`string`,d=`major`,f=`model`,p=`name`,m=`type`,h=`vendor`,g=`version`,_=`architecture`,v=`console`,y=`mobile`,b=`tablet`,x=`smarttv`,S=`wearable`,C=`embedded`,w=500,T=`Amazon`,E=`Apple`,D=`ASUS`,O=`BlackBerry`,k=`Browser`,A=`Chrome`,j=`Edge`,M=`Firefox`,N=`Google`,ee=`Honor`,P=`Huawei`,te=`Lenovo`,ne=`LG`,re=`Microsoft`,ie=`Motorola`,F=`Nvidia`,ae=`OnePlus`,oe=`Opera`,se=`OPPO`,ce=`Samsung`,le=`Sharp`,ue=`Sony`,I=`Xiaomi`,L=`Zebra`,de=`Facebook`,fe=`Chromium OS`,pe=`Mac OS`,me=` Browser`,he=function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n},ge=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},_e=function(e,t){return typeof e===u?ve(t).indexOf(ve(e))!==-1:!1},ve=function(e){return e.toLowerCase()},ye=function(e){return typeof e===u?e.replace(/[^\d\.]/g,a).split(`.`)[0]:r},be=function(e,t){if(typeof e===u)return e=e.replace(/^\s\s*/,a),typeof t===c?e:e.substring(0,w)},xe=function(e,t){for(var n=0,i,a,o,c,u,d;n<t.length&&!u;){var f=t[n],p=t[n+1];for(i=a=0;i<f.length&&!u&&f[i];)if(u=f[i++].exec(e),u)for(o=0;o<p.length;o++)d=u[++a],c=p[o],typeof c===l&&c.length>0?c.length===2?typeof c[1]==s?this[c[0]]=c[1].call(this,d):this[c[0]]=c[1]:c.length===3?typeof c[1]===s&&!(c[1].exec&&c[1].test)?this[c[0]]=d?c[1].call(this,d,c[2]):r:this[c[0]]=d?d.replace(c[1],c[2]):r:c.length===4&&(this[c[0]]=d?c[3].call(this,d.replace(c[1],c[2])):r):this[c]=d||r;n+=2}},Se=function(e,t){for(var n in t)if(typeof t[n]===l&&t[n].length>0){for(var i=0;i<t[n].length;i++)if(_e(t[n][i],e))return n===o?r:n}else if(_e(t[n],e))return n===o?r:n;return t.hasOwnProperty(`*`)?t[`*`]:e},Ce={"1.0":`/8`,1.2:`/1`,1.3:`/3`,"2.0":`/412`,"2.0.2":`/416`,"2.0.3":`/417`,"2.0.4":`/419`,"?":`/`},we={ME:`4.90`,"NT 3.11":`NT3.51`,"NT 4.0":`NT4.0`,2e3:`NT 5.0`,XP:[`NT 5.1`,`NT 5.2`],Vista:`NT 6.0`,7:`NT 6.1`,8:`NT 6.2`,8.1:`NT 6.3`,10:[`NT 6.4`,`NT 10.0`],RT:`ARM`},Te={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[g,[p,`Chrome`]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[g,[p,`Edge`]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[p,g],[/opios[\/ ]+([\w\.]+)/i],[g,[p,oe+` Mini`]],[/\bop(?:rg)?x\/([\w\.]+)/i],[g,[p,oe+` GX`]],[/\bopr\/([\w\.]+)/i],[g,[p,oe]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[g,[p,`Baidu`]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[g,[p,`Maxthon`]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[p,g],[/quark(?:pc)?\/([-\w\.]+)/i],[g,[p,`Quark`]],[/\bddg\/([\w\.]+)/i],[g,[p,`DuckDuckGo`]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[g,[p,`UC`+k]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[g,[p,`WeChat`]],[/konqueror\/([\w\.]+)/i],[g,[p,`Konqueror`]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[g,[p,`IE`]],[/ya(?:search)?browser\/([\w\.]+)/i],[g,[p,`Yandex`]],[/slbrowser\/([\w\.]+)/i],[g,[p,`Smart Lenovo `+k]],[/(avast|avg)\/([\w\.]+)/i],[[p,/(.+)/,`$1 Secure `+k],g],[/\bfocus\/([\w\.]+)/i],[g,[p,M+` Focus`]],[/\bopt\/([\w\.]+)/i],[g,[p,oe+` Touch`]],[/coc_coc\w+\/([\w\.]+)/i],[g,[p,`Coc Coc`]],[/dolfin\/([\w\.]+)/i],[g,[p,`Dolphin`]],[/coast\/([\w\.]+)/i],[g,[p,oe+` Coast`]],[/miuibrowser\/([\w\.]+)/i],[g,[p,`MIUI`+me]],[/fxios\/([\w\.-]+)/i],[g,[p,M]],[/\bqihoobrowser\/?([\w\.]*)/i],[g,[p,`360`]],[/\b(qq)\/([\w\.]+)/i],[[p,/(.+)/,`$1Browser`],g],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[p,/(.+)/,`$1`+me],g],[/samsungbrowser\/([\w\.]+)/i],[g,[p,ce+` Internet`]],[/metasr[\/ ]?([\d\.]+)/i],[g,[p,`Sogou Explorer`]],[/(sogou)mo\w+\/([\d\.]+)/i],[[p,`Sogou Mobile`],g],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[p,g],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[p],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[g,p],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[p,de],g],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[p,g],[/\bgsa\/([\w\.]+) .*safari\//i],[g,[p,`GSA`]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[g,[p,`TikTok`]],[/headlesschrome(?:\/([\w\.]+)| )/i],[g,[p,A+` Headless`]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[p,A+` WebView`],g],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[g,[p,`Android `+k]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[p,g],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[g,[p,`Mobile Safari`]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[g,p],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[p,[g,Se,Ce]],[/(webkit|khtml)\/([\w\.]+)/i],[p,g],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[p,`Netscape`],g],[/(wolvic|librewolf)\/([\w\.]+)/i],[p,g],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[g,[p,M+` Reality`]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[p,[g,/_/g,`.`]],[/(cobalt)\/([\w\.]+)/i],[p,[g,/master.|lts./,``]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[_,`amd64`]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[_,`ia32`]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[_,`arm64`]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[_,`armhf`]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[_,`arm`]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[_,/ower/,a,ve]],[/ sun4\w[;\)]/i],[[_,`sparc`]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[_,ve]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[f,[h,ce],[m,b]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[f,[h,ce],[m,y]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[f,[h,E],[m,y]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[f,[h,E],[m,b]],[/(macintosh);/i],[f,[h,E]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[f,[h,le],[m,y]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[f,[h,ee],[m,b]],[/honor([-\w ]+)[;\)]/i],[f,[h,ee],[m,y]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[f,[h,P],[m,b]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[f,[h,P],[m,y]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[f,/_/g,` `],[h,I],[m,b]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[f,/_/g,` `],[h,I],[m,y]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[f,[h,se],[m,y]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[f,[h,Se,{OnePlus:[`304`,`403`,`203`],"*":se}],[m,b]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[f,[h,`Vivo`],[m,y]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[f,[h,`Realme`],[m,y]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[f,[h,ie],[m,y]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[f,[h,ie],[m,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[f,[h,ne],[m,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[f,[h,ne],[m,y]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[f,[h,te],[m,b]],[/(nokia) (t[12][01])/i],[h,f,[m,b]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[f,/_/g,` `],[m,y],[h,`Nokia`]],[/(pixel (c|tablet))\b/i],[f,[h,N],[m,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[f,[h,N],[m,y]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[f,[h,ue],[m,y]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[f,`Xperia Tablet`],[h,ue],[m,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[f,[h,ae],[m,y]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[f,[h,T],[m,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[f,/(.+)/g,`Fire Phone $1`],[h,T],[m,y]],[/(playbook);[-\w\),; ]+(rim)/i],[f,h,[m,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[f,[h,O],[m,y]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[f,[h,D],[m,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[f,[h,D],[m,y]],[/(nexus 9)/i],[f,[h,`HTC`],[m,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[f,/_/g,` `],[m,y]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[f,[h,`TCL`],[m,b]],[/(itel) ((\w+))/i],[[h,ve],f,[m,Se,{tablet:[`p10001l`,`w7001`],"*":`mobile`}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[f,[h,`Acer`],[m,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[f,[h,`Meizu`],[m,y]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[f,[h,`Ulefone`],[m,y]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[f,[h,`Energizer`],[m,y]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[f,[h,`Cat`],[m,y]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[f,[h,`Smartfren`],[m,y]],[/droid.+; (a(?:015|06[35]|142p?))/i],[f,[h,`Nothing`],[m,y]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[f,[h,`Archos`],[m,b]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[f,[h,`Archos`],[m,y]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[h,f,[m,b]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[h,f,[m,y]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,f,[m,b]],[/(surface duo)/i],[f,[h,re],[m,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[f,[h,`Fairphone`],[m,y]],[/(u304aa)/i],[f,[h,`AT&T`],[m,y]],[/\bsie-(\w*)/i],[f,[h,`Siemens`],[m,y]],[/\b(rct\w+) b/i],[f,[h,`RCA`],[m,b]],[/\b(venue[\d ]{2,7}) b/i],[f,[h,`Dell`],[m,b]],[/\b(q(?:mv|ta)\w+) b/i],[f,[h,`Verizon`],[m,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[f,[h,`Barnes & Noble`],[m,b]],[/\b(tm\d{3}\w+) b/i],[f,[h,`NuVision`],[m,b]],[/\b(k88) b/i],[f,[h,`ZTE`],[m,b]],[/\b(nx\d{3}j) b/i],[f,[h,`ZTE`],[m,y]],[/\b(gen\d{3}) b.+49h/i],[f,[h,`Swiss`],[m,y]],[/\b(zur\d{3}) b/i],[f,[h,`Swiss`],[m,b]],[/\b((zeki)?tb.*\b) b/i],[f,[h,`Zeki`],[m,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,`Dragon Touch`],f,[m,b]],[/\b(ns-?\w{0,9}) b/i],[f,[h,`Insignia`],[m,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[f,[h,`NextBook`],[m,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,`Voice`],f,[m,y]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,`LvTel`],f,[m,y]],[/\b(ph-1) /i],[f,[h,`Essential`],[m,y]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[f,[h,`Envizen`],[m,b]],[/\b(trio[-\w\. ]+) b/i],[f,[h,`MachSpeed`],[m,b]],[/\btu_(1491) b/i],[f,[h,`Rotor`],[m,b]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[f,[h,F],[m,b]],[/(sprint) (\w+)/i],[h,f,[m,y]],[/(kin\.[onetw]{3})/i],[[f,/\./g,` `],[h,re],[m,y]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[f,[h,L],[m,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[f,[h,L],[m,y]],[/smart-tv.+(samsung)/i],[h,[m,x]],[/hbbtv.+maple;(\d+)/i],[[f,/^/,`SmartTV`],[h,ce],[m,x]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,ne],[m,x]],[/(apple) ?tv/i],[h,[f,E+` TV`],[m,x]],[/crkey/i],[[f,A+`cast`],[h,N],[m,x]],[/droid.+aft(\w+)( bui|\))/i],[f,[h,T],[m,x]],[/(shield \w+ tv)/i],[f,[h,F],[m,x]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[f,[h,le],[m,x]],[/(bravia[\w ]+)( bui|\))/i],[f,[h,ue],[m,x]],[/(mi(tv|box)-?\w+) bui/i],[f,[h,I],[m,x]],[/Hbbtv.*(technisat) (.*);/i],[h,f,[m,x]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[h,be],[f,be],[m,x]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[f,[m,x]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[m,x]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,f,[m,v]],[/droid.+; (shield)( bui|\))/i],[f,[h,F],[m,v]],[/(playstation \w+)/i],[f,[h,ue],[m,v]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[f,[h,re],[m,v]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[f,[h,ce],[m,S]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[h,f,[m,S]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[f,[h,se],[m,S]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[f,[h,E],[m,S]],[/(opwwe\d{3})/i],[f,[h,ae],[m,S]],[/(moto 360)/i],[f,[h,ie],[m,S]],[/(smartwatch 3)/i],[f,[h,ue],[m,S]],[/(g watch r)/i],[f,[h,ne],[m,S]],[/droid.+; (wt63?0{2,3})\)/i],[f,[h,L],[m,S]],[/droid.+; (glass) \d/i],[f,[h,N],[m,S]],[/(pico) (4|neo3(?: link|pro)?)/i],[h,f,[m,S]],[/; (quest( \d| pro)?)/i],[f,[h,de],[m,S]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[m,C]],[/(aeobc)\b/i],[f,[h,T],[m,C]],[/(homepod).+mac os/i],[f,[h,E],[m,C]],[/windows iot/i],[[m,C]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[f,[m,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[f,[m,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[m,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[m,y]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[f,[h,`Generic`]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[g,[p,j+`HTML`]],[/(arkweb)\/([\w\.]+)/i],[p,g],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[g,[p,`Blink`]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[p,g],[/ladybird\//i],[[p,`LibWeb`]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[g,p]],os:[[/microsoft (windows) (vista|xp)/i],[p,g],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[p,[g,Se,we]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[g,Se,we],[p,`Windows`]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[g,/_/g,`.`],[p,`iOS`]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[p,pe],[g,/_/g,`.`]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[g,p],[/(ubuntu) ([\w\.]+) like android/i],[[p,/(.+)/,`$1 Touch`],g],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[p,g],[/\(bb(10);/i],[g,[p,O]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[g,[p,`Symbian`]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[g,[p,M+` OS`]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[g,[p,`webOS`]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[g,[p,`watchOS`]],[/crkey\/([\d\.]+)/i],[g,[p,A+`cast`]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[p,fe],g],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[p,g],[/(sunos) ?([\w\.\d]*)/i],[[p,`Solaris`],g],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[p,g]]},Ee=function(e,t){if(typeof e===l&&(t=e,e=r),!(this instanceof Ee))return new Ee(e,t).getResult();var i=typeof n!==c&&n.navigator?n.navigator:r,o=e||(i&&i.userAgent?i.userAgent:a),v=i&&i.userAgentData?i.userAgentData:r,x=t?he(Te,t):Te,S=i&&i.userAgent==o;return this.getBrowser=function(){var e={};return e[p]=r,e[g]=r,xe.call(e,o,x.browser),e[d]=ye(e[g]),S&&i&&i.brave&&typeof i.brave.isBrave==s&&(e[p]=`Brave`),e},this.getCPU=function(){var e={};return e[_]=r,xe.call(e,o,x.cpu),e},this.getDevice=function(){var e={};return e[h]=r,e[f]=r,e[m]=r,xe.call(e,o,x.device),S&&!e[m]&&v&&v.mobile&&(e[m]=y),S&&e[f]==`Macintosh`&&i&&typeof i.standalone!==c&&i.maxTouchPoints&&i.maxTouchPoints>2&&(e[f]=`iPad`,e[m]=b),e},this.getEngine=function(){var e={};return e[p]=r,e[g]=r,xe.call(e,o,x.engine),e},this.getOS=function(){var e={};return e[p]=r,e[g]=r,xe.call(e,o,x.os),S&&!e[p]&&v&&v.platform&&v.platform!=`Unknown`&&(e[p]=v.platform.replace(/chrome os/i,fe).replace(/macos/i,pe)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return o},this.setUA=function(e){return o=typeof e===u&&e.length>w?be(e,w):e,this},this.setUA(o),this};Ee.VERSION=i,Ee.BROWSER=ge([p,g,d]),Ee.CPU=ge([_]),Ee.DEVICE=ge([f,h,m,v,y,x,b,S,C]),Ee.ENGINE=Ee.OS=ge([p,g]),typeof e===c?typeof define===s&&define.amd?define(function(){return Ee}):typeof n!==c&&(n.UAParser=Ee):(typeof t!==c&&t.exports&&(e=t.exports=Ee),e.UAParser=Ee);var De=typeof n!==c&&(n.jQuery||n.Zepto);if(De&&!De.ua){var Oe=new Ee;De.ua=Oe.getResult(),De.ua.get=function(){return Oe.getUA()},De.ua.set=function(e){Oe.setUA(e);var t=Oe.getResult();for(var n in t)De.ua[n]=t[n]}}})(typeof window==`object`?window:e)})),wT=d((e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(e){return e&&typeof e==`object`&&`default`in e?e.default:e}t(require("react"));var n=new(CT()),r=n.getBrowser();n.getCPU();var i=n.getDevice(),a=n.getEngine(),o=n.getOS(),s=n.getUA(),c={Mobile:`mobile`,Tablet:`tablet`,SmartTv:`smarttv`,Console:`console`,Wearable:`wearable`,Embedded:`embedded`,Browser:void 0},l={Chrome:`Chrome`,Firefox:`Firefox`,Opera:`Opera`,Yandex:`Yandex`,Safari:`Safari`,InternetExplorer:`Internet Explorer`,Edge:`Edge`,Chromium:`Chromium`,Ie:`IE`,MobileSafari:`Mobile Safari`,EdgeChromium:`Edge Chromium`,MIUI:`MIUI Browser`,SamsungBrowser:`Samsung Browser`},u={IOS:`iOS`,Android:`Android`,WindowsPhone:`Windows Phone`,Windows:`Windows`,MAC_OS:`Mac OS`},d=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`none`;return e||t},f=function(){return typeof window<`u`&&(window.navigator||navigator)?window.navigator||navigator:!1},p=function(e){var t=f();return t&&t.platform&&(t.platform.indexOf(e)!==-1||t.platform===`MacIntel`&&t.maxTouchPoints>1&&!window.MSStream)},m=function(e){return e.type===c.Mobile},h=function(e){return e.type===c.Tablet},g=function(e){var t=e.type;return t===c.Mobile||t===c.Tablet},_=function(e){return e.type===c.SmartTv},v=function(e){return e.type===c.Browser},y=function(e){return e.type===c.Wearable},b=function(e){return e.type===c.Console},x=function(e){return e.type===c.Embedded},S=function(e){var t=e.vendor;return d(t)},C=function(e){var t=e.model;return d(t)},w=function(e){var t=e.type;return d(t,`browser`)},T=function(e){return e.name===u.Android},E=function(e){return e.name===u.Windows},D=function(e){return e.name===u.MAC_OS},O=function(e){return e.name===u.WindowsPhone},k=function(e){return e.name===u.IOS},A=function(e){var t=e.version;return d(t)},j=function(e){var t=e.name;return d(t)},M=function(e){return e.name===l.Chrome},N=function(e){return e.name===l.Firefox},ee=function(e){return e.name===l.Chromium},P=function(e){return e.name===l.Edge},te=function(e){return e.name===l.Yandex},ne=function(e){var t=e.name;return t===l.Safari||t===l.MobileSafari},re=function(e){return e.name===l.MobileSafari},ie=function(e){return e.name===l.Opera},F=function(e){var t=e.name;return t===l.InternetExplorer||t===l.Ie},ae=function(e){return e.name===l.MIUI},oe=function(e){return e.name===l.SamsungBrowser},se=function(e){var t=e.version;return d(t)},ce=function(e){var t=e.major;return d(t)},le=function(e){var t=e.name;return d(t)},ue=function(e){var t=e.name;return d(t)},I=function(e){var t=e.version;return d(t)},L=function(){var e=f(),t=e&&e.userAgent&&e.userAgent.toLowerCase();return typeof t==`string`?/electron/.test(t):!1},de=function(e){return typeof e==`string`&&e.indexOf(`Edg/`)!==-1},fe=function(){var e=f();return e&&(/iPad|iPhone|iPod/.test(e.platform)||e.platform===`MacIntel`&&e.maxTouchPoints>1)&&!window.MSStream},pe=function(){return p(`iPad`)},me=function(){return p(`iPhone`)},he=function(){return p(`iPod`)},ge=function(e){return d(e)};_(i),b(i),y(i),x(i),re(r)||pe(),ee(r);var _e=g(i)||pe();m(i);var ve=h(i)||pe();v(i),v(i),T(o),O(o),k(o)||pe(),M(r),N(r),ne(r),ie(r),F(r),A(o),j(o),se(r),ce(r),le(r),S(i),C(i),ue(a),I(a),ge(s),P(r)||de(s),te(r),w(i),fe(),pe(),me(),he(),L(),de(s),P(r)&&de(s),E(o),D(o),ae(r),oe(r),e.isMobile=_e,e.isTablet=ve}))();function TT({onScan:e}){let{t}=U(),{cameraFacingMode:r}=wo(),[i,a]=(0,h.useState)(r),o=(0,h.useRef)(null),s=(0,h.useRef)(null),[c,l]=(0,h.useState)(!1),[u,d]=(0,h.useState)(!(wT.isMobile&&!wT.isTablet)),f=t=>{e(t?.data)},p=e=>{};(0,h.useEffect)(()=>(u&&m(),()=>{s?.current||o?.current?.stop()}),[u]);let m=()=>{s?.current&&!o.current&&(o.current=new ST(s?.current,f,{onDecodeError:p,preferredCamera:i}),o?.current?.start().then(()=>l(!0)).catch(e=>{e&&l(!1)}))};return(0,n.jsxs)(`div`,{className:`relative`,children:[(0,n.jsx)(`video`,{className:`max-h-[calc(100vh-381px)] min-h-[370px] rounded-sm object-cover`,ref:s,autoPlay:!0,muted:!0,playsInline:!0}),u?(0,n.jsx)(`div`,{className:`absolute top-2 right-2 flex h-10 w-10 cursor-pointer items-center justify-center rounded-sm bg-white shadow-overlay`,onClick:()=>{let e=i===b.USER?b.ENVIRONMENT:b.USER;a(e),o?.current?.setCamera(e)},children:(0,n.jsx)(`img`,{src:vT,alt:`camera-switch`})}):(0,n.jsx)(`div`,{className:`absolute top-1/2 right-1/2 left-1/2 flex items-center justify-center`,children:(0,n.jsx)(Mx,{disabled:u,onClick:()=>d(!0),children:t(`enableCamera`)})})]})}var ET,DT,OT=(ET=function(e,t){return ET=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},ET(e,t)},function(e,t){function n(){this.constructor=e}ET(e,t),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}),kT=function(e){function t(t){var n,r,i,a=this.constructor,o=e.call(this,t)||this;return Object.defineProperty(o,"name",{value:a.name,enumerable:!1,configurable:!0}),n=o,r=a.prototype,(i=Object.setPrototypeOf)?i(n,r):n.__proto__=r,function(e,t){t===void 0&&(t=e.constructor);var n=Error.captureStackTrace;n&&n(e,t)}(o),o}return OT(t,e),t}(Error),AT=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),jT=function(e){function t(t){t===void 0&&(t=void 0);var n=e.call(this,t)||this;return n.message=t,n}return AT(t,e),t.prototype.getKind=function(){return this.constructor.kind},t.kind=`Exception`,t}(kT),MT=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),NT=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return MT(t,e),t.kind=`ArgumentException`,t}(jT),PT=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),q=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return PT(t,e),t.kind=`IllegalArgumentException`,t}(jT),FT=function(){function e(e){if(this.binarizer=e,e===null)throw new q(`Binarizer must be non-null.`)}return e.prototype.getWidth=function(){return this.binarizer.getWidth()},e.prototype.getHeight=function(){return this.binarizer.getHeight()},e.prototype.getBlackRow=function(e,t){return this.binarizer.getBlackRow(e,t)},e.prototype.getBlackMatrix=function(){return this.matrix!==null&&this.matrix!==void 0||(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},e.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},e.prototype.crop=function(t,n,r,i){var a=this.binarizer.getLuminanceSource().crop(t,n,r,i);return new e(this.binarizer.createBinarizer(a))},e.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},e.prototype.rotateCounterClockwise=function(){var t=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new e(this.binarizer.createBinarizer(t))},e.prototype.rotateCounterClockwise45=function(){var t=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new e(this.binarizer.createBinarizer(t))},e.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch{return``}},e}(),IT=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),LT=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return IT(t,e),t.getChecksumInstance=function(){return new t},t.kind=`ChecksumException`,t}(jT),RT=function(){function e(e){this.source=e}return e.prototype.getLuminanceSource=function(){return this.source},e.prototype.getWidth=function(){return this.source.getWidth()},e.prototype.getHeight=function(){return this.source.getHeight()},e}(),zT=function(){function e(){}return e.arraycopy=function(e,t,n,r,i){for(;i--;)n[r++]=e[t++]},e.currentTimeMillis=function(){return Date.now()},e}(),BT=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),VT=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return BT(t,e),t.kind=`IndexOutOfBoundsException`,t}(jT),HT=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),UT=function(e){function t(t,n){t===void 0&&(t=void 0),n===void 0&&(n=void 0);var r=e.call(this,n)||this;return r.index=t,r.message=n,r}return HT(t,e),t.kind=`ArrayIndexOutOfBoundsException`,t}(VT),WT=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},GT=function(){function e(){}return e.fill=function(e,t){for(var n=0,r=e.length;n<r;n++)e[n]=t},e.fillWithin=function(t,n,r,i){e.rangeCheck(t.length,n,r);for(var a=n;a<r;a++)t[a]=i},e.rangeCheck=function(e,t,n){if(t>n)throw new q(`fromIndex(`+t+`) > toIndex(`+n+`)`);if(t<0)throw new UT(t);if(n>e)throw new UT(n)},e.asList=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e},e.create=function(e,t,n){return Array.from({length:e}).map((function(e){return Array.from({length:t}).fill(n)}))},e.createInt32Array=function(e,t,n){return Array.from({length:e}).map((function(e){return Int32Array.from({length:t}).fill(n)}))},e.equals=function(e,t){if(!e||!t||!e.length||!t.length||e.length!==t.length)return!1;for(var n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0},e.hashCode=function(e){var t,n;if(e===null)return 0;var r=1;try{for(var i=WT(e),a=i.next();!a.done;a=i.next())r=31*r+a.value}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},e.fillUint8Array=function(e,t){for(var n=0;n!==e.length;n++)e[n]=t},e.copyOf=function(e,t){return e.slice(0,t)},e.copyOfUint8Array=function(e,t){if(e.length<=t){var n=new Uint8Array(t);return n.set(e),n}return e.slice(0,t)},e.copyOfRange=function(e,t,n){var r=n-t,i=new Int32Array(r);return zT.arraycopy(e,t,i,0,r),i},e.binarySearch=function(t,n,r){r===void 0&&(r=e.numberComparator);for(var i=0,a=t.length-1;i<=a;){var o=a+i>>1,s=r(n,t[o]);if(s>0)i=o+1;else{if(!(s<0))return o;a=o-1}}return-i-1},e.numberComparator=function(e,t){return e-t},e}(),KT=function(){function e(){}return e.numberOfTrailingZeros=function(e){var t;if(e===0)return 32;var n=31;return(t=e<<16)!=0&&(n-=16,e=t),(t=e<<8)!=0&&(n-=8,e=t),(t=e<<4)!=0&&(n-=4,e=t),(t=e<<2)!=0&&(n-=2,e=t),n-(e<<1>>>31)},e.numberOfLeadingZeros=function(e){if(e===0)return 32;var t=1;return!(e>>>16)&&(t+=16,e<<=16),!(e>>>24)&&(t+=8,e<<=8),!(e>>>28)&&(t+=4,e<<=4),!(e>>>30)&&(t+=2,e<<=2),t-=e>>>31},e.toHexString=function(e){return e.toString(16)},e.toBinaryString=function(e){return String(parseInt(String(e),2))},e.bitCount=function(e){return e=(e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135,e+=e>>>8,63&(e+=e>>>16)},e.truncDivision=function(e,t){return Math.trunc(e/t)},e.parseInt=function(e,t){return t===void 0&&(t=void 0),parseInt(e,t)},e.MIN_VALUE_32_BITS=-2147483648,e.MAX_VALUE=2**53-1,e}(),qT=function(){function e(t,n){t===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=t,this.bits=n??e.makeArray(t))}return e.prototype.getSize=function(){return this.size},e.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},e.prototype.ensureCapacity=function(t){if(t>32*this.bits.length){var n=e.makeArray(t);zT.arraycopy(this.bits,0,n,0,this.bits.length),this.bits=n}},e.prototype.get=function(e){return(this.bits[Math.floor(e/32)]&1<<(31&e))!=0},e.prototype.set=function(e){this.bits[Math.floor(e/32)]|=1<<(31&e)},e.prototype.flip=function(e){this.bits[Math.floor(e/32)]^=1<<(31&e)},e.prototype.getNextSet=function(e){var t=this.size;if(e>=t)return t;var n=this.bits,r=Math.floor(e/32),i=n[r];i&=~((1<<(31&e))-1);for(var a=n.length;i===0;){if(++r===a)return t;i=n[r]}var o=32*r+KT.numberOfTrailingZeros(i);return o>t?t:o},e.prototype.getNextUnset=function(e){var t=this.size;if(e>=t)return t;var n=this.bits,r=Math.floor(e/32),i=~n[r];i&=~((1<<(31&e))-1);for(var a=n.length;i===0;){if(++r===a)return t;i=~n[r]}var o=32*r+KT.numberOfTrailingZeros(i);return o>t?t:o},e.prototype.setBulk=function(e,t){this.bits[Math.floor(e/32)]=t},e.prototype.setRange=function(e,t){if(t<e||e<0||t>this.size)throw new q;if(t!==e){t--;for(var n=Math.floor(e/32),r=Math.floor(t/32),i=this.bits,a=n;a<=r;a++){var o=(2<<(a<r?31:31&t))-(1<<(a>n?0:31&e));i[a]|=o}}},e.prototype.clear=function(){for(var e=this.bits.length,t=this.bits,n=0;n<e;n++)t[n]=0},e.prototype.isRange=function(e,t,n){if(t<e||e<0||t>this.size)throw new q;if(t===e)return!0;t--;for(var r=Math.floor(e/32),i=Math.floor(t/32),a=this.bits,o=r;o<=i;o++){var s=(2<<(o<i?31:31&t))-(1<<(o>r?0:31&e))&4294967295;if((a[o]&s)!==(n?s:0))return!1}return!0},e.prototype.appendBit=function(e){this.ensureCapacity(this.size+1),e&&(this.bits[Math.floor(this.size/32)]|=1<<(31&this.size)),this.size++},e.prototype.appendBits=function(e,t){if(t<0||t>32)throw new q(`Num bits must be between 0 and 32`);this.ensureCapacity(this.size+t);for(var n=t;n>0;n--)this.appendBit((e>>n-1&1)==1)},e.prototype.appendBitArray=function(e){var t=e.size;this.ensureCapacity(this.size+t);for(var n=0;n<t;n++)this.appendBit(e.get(n))},e.prototype.xor=function(e){if(this.size!==e.size)throw new q(`Sizes don't match`);for(var t=this.bits,n=0,r=t.length;n<r;n++)t[n]^=e.bits[n]},e.prototype.toBytes=function(e,t,n,r){for(var i=0;i<r;i++){for(var a=0,o=0;o<8;o++)this.get(e)&&(a|=1<<7-o),e++;t[n+i]=a}},e.prototype.getBitArray=function(){return this.bits},e.prototype.reverse=function(){for(var e=new Int32Array(this.bits.length),t=Math.floor((this.size-1)/32),n=t+1,r=this.bits,i=0;i<n;i++){var a=r[i];a=(a=(a=(a=(a=a>>1&1431655765|(1431655765&a)<<1)>>2&858993459|(858993459&a)<<2)>>4&252645135|(252645135&a)<<4)>>8&16711935|(16711935&a)<<8)>>16&65535|(65535&a)<<16,e[t-i]=a}if(this.size!==32*n){var o=32*n-this.size,s=e[0]>>>o;for(i=1;i<n;i++){var c=e[i];s|=c<<32-o,e[i-1]=s,s=c>>>o}e[n-1]=s}this.bits=e},e.makeArray=function(e){return new Int32Array(Math.floor((e+31)/32))},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.size===n.size&>.equals(this.bits,n.bits)},e.prototype.hashCode=function(){return 31*this.size+GT.hashCode(this.bits)},e.prototype.toString=function(){for(var e=``,t=0,n=this.size;t<n;t++)!(7&t)&&(e+=` `),e+=this.get(t)?`X`:`.`;return e},e.prototype.clone=function(){return new e(this.size,this.bits.slice())},e}();(function(e){e[e.OTHER=0]=`OTHER`,e[e.PURE_BARCODE=1]=`PURE_BARCODE`,e[e.POSSIBLE_FORMATS=2]=`POSSIBLE_FORMATS`,e[e.TRY_HARDER=3]=`TRY_HARDER`,e[e.CHARACTER_SET=4]=`CHARACTER_SET`,e[e.ALLOWED_LENGTHS=5]=`ALLOWED_LENGTHS`,e[e.ASSUME_CODE_39_CHECK_DIGIT=6]=`ASSUME_CODE_39_CHECK_DIGIT`,e[e.ASSUME_GS1=7]=`ASSUME_GS1`,e[e.RETURN_CODABAR_START_END=8]=`RETURN_CODABAR_START_END`,e[e.NEED_RESULT_POINT_CALLBACK=9]=`NEED_RESULT_POINT_CALLBACK`,e[e.ALLOWED_EAN_EXTENSIONS=10]=`ALLOWED_EAN_EXTENSIONS`})(DT||={});var JT,YT=DT,XT=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),J=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return XT(t,e),t.getFormatInstance=function(){return new t},t.kind=`FormatException`,t}(jT),ZT=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};(function(e){e[e.Cp437=0]=`Cp437`,e[e.ISO8859_1=1]=`ISO8859_1`,e[e.ISO8859_2=2]=`ISO8859_2`,e[e.ISO8859_3=3]=`ISO8859_3`,e[e.ISO8859_4=4]=`ISO8859_4`,e[e.ISO8859_5=5]=`ISO8859_5`,e[e.ISO8859_6=6]=`ISO8859_6`,e[e.ISO8859_7=7]=`ISO8859_7`,e[e.ISO8859_8=8]=`ISO8859_8`,e[e.ISO8859_9=9]=`ISO8859_9`,e[e.ISO8859_10=10]=`ISO8859_10`,e[e.ISO8859_11=11]=`ISO8859_11`,e[e.ISO8859_13=12]=`ISO8859_13`,e[e.ISO8859_14=13]=`ISO8859_14`,e[e.ISO8859_15=14]=`ISO8859_15`,e[e.ISO8859_16=15]=`ISO8859_16`,e[e.SJIS=16]=`SJIS`,e[e.Cp1250=17]=`Cp1250`,e[e.Cp1251=18]=`Cp1251`,e[e.Cp1252=19]=`Cp1252`,e[e.Cp1256=20]=`Cp1256`,e[e.UnicodeBigUnmarked=21]=`UnicodeBigUnmarked`,e[e.UTF8=22]=`UTF8`,e[e.ASCII=23]=`ASCII`,e[e.Big5=24]=`Big5`,e[e.GB18030=25]=`GB18030`,e[e.EUC_KR=26]=`EUC_KR`})(JT||={});var QT,$T=function(){function e(t,n,r){for(var i,a,o=[],s=3;s<arguments.length;s++)o[s-3]=arguments[s];this.valueIdentifier=t,this.name=r,this.values=typeof n==`number`?Int32Array.from([n]):n,this.otherEncodingNames=o,e.VALUE_IDENTIFIER_TO_ECI.set(t,this),e.NAME_TO_ECI.set(r,this);for(var c=this.values,l=0,u=c.length;l!==u;l++){var d=c[l];e.VALUES_TO_ECI.set(d,this)}try{for(var f=ZT(o),p=f.next();!p.done;p=f.next()){var m=p.value;e.NAME_TO_ECI.set(m,this)}}catch(e){i={error:e}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}}return e.prototype.getValueIdentifier=function(){return this.valueIdentifier},e.prototype.getName=function(){return this.name},e.prototype.getValue=function(){return this.values[0]},e.getCharacterSetECIByValue=function(t){if(t<0||t>=900)throw new J(`incorect value`);var n=e.VALUES_TO_ECI.get(t);if(n===void 0)throw new J(`incorect value`);return n},e.getCharacterSetECIByName=function(t){var n=e.NAME_TO_ECI.get(t);if(n===void 0)throw new J(`incorect value`);return n},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.getName()===n.getName()},e.VALUE_IDENTIFIER_TO_ECI=new Map,e.VALUES_TO_ECI=new Map,e.NAME_TO_ECI=new Map,e.Cp437=new e(JT.Cp437,Int32Array.from([0,2]),`Cp437`),e.ISO8859_1=new e(JT.ISO8859_1,Int32Array.from([1,3]),`ISO-8859-1`,`ISO88591`,`ISO8859_1`),e.ISO8859_2=new e(JT.ISO8859_2,4,`ISO-8859-2`,`ISO88592`,`ISO8859_2`),e.ISO8859_3=new e(JT.ISO8859_3,5,`ISO-8859-3`,`ISO88593`,`ISO8859_3`),e.ISO8859_4=new e(JT.ISO8859_4,6,`ISO-8859-4`,`ISO88594`,`ISO8859_4`),e.ISO8859_5=new e(JT.ISO8859_5,7,`ISO-8859-5`,`ISO88595`,`ISO8859_5`),e.ISO8859_6=new e(JT.ISO8859_6,8,`ISO-8859-6`,`ISO88596`,`ISO8859_6`),e.ISO8859_7=new e(JT.ISO8859_7,9,`ISO-8859-7`,`ISO88597`,`ISO8859_7`),e.ISO8859_8=new e(JT.ISO8859_8,10,`ISO-8859-8`,`ISO88598`,`ISO8859_8`),e.ISO8859_9=new e(JT.ISO8859_9,11,`ISO-8859-9`,`ISO88599`,`ISO8859_9`),e.ISO8859_10=new e(JT.ISO8859_10,12,`ISO-8859-10`,`ISO885910`,`ISO8859_10`),e.ISO8859_11=new e(JT.ISO8859_11,13,`ISO-8859-11`,`ISO885911`,`ISO8859_11`),e.ISO8859_13=new e(JT.ISO8859_13,15,`ISO-8859-13`,`ISO885913`,`ISO8859_13`),e.ISO8859_14=new e(JT.ISO8859_14,16,`ISO-8859-14`,`ISO885914`,`ISO8859_14`),e.ISO8859_15=new e(JT.ISO8859_15,17,`ISO-8859-15`,`ISO885915`,`ISO8859_15`),e.ISO8859_16=new e(JT.ISO8859_16,18,`ISO-8859-16`,`ISO885916`,`ISO8859_16`),e.SJIS=new e(JT.SJIS,20,`SJIS`,`Shift_JIS`),e.Cp1250=new e(JT.Cp1250,21,`Cp1250`,`windows-1250`),e.Cp1251=new e(JT.Cp1251,22,`Cp1251`,`windows-1251`),e.Cp1252=new e(JT.Cp1252,23,`Cp1252`,`windows-1252`),e.Cp1256=new e(JT.Cp1256,24,`Cp1256`,`windows-1256`),e.UnicodeBigUnmarked=new e(JT.UnicodeBigUnmarked,25,`UnicodeBigUnmarked`,`UTF-16BE`,`UnicodeBig`),e.UTF8=new e(JT.UTF8,26,`UTF8`,`UTF-8`),e.ASCII=new e(JT.ASCII,Int32Array.from([27,170]),`ASCII`,`US-ASCII`),e.Big5=new e(JT.Big5,28,`Big5`),e.GB18030=new e(JT.GB18030,29,`GB18030`,`GB2312`,`EUC_CN`,`GBK`),e.EUC_KR=new e(JT.EUC_KR,30,`EUC_KR`,`EUC-KR`),e}(),eE=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),tE=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return eE(t,e),t.kind=`UnsupportedOperationException`,t}(jT),nE=function(){function e(){}return e.decode=function(e,t){var n=this.encodingName(t);return this.customDecoder?this.customDecoder(e,n):typeof TextDecoder>`u`||this.shouldDecodeOnFallback(n)?this.decodeFallback(e,n):new TextDecoder(n).decode(e)},e.shouldDecodeOnFallback=function(t){return!e.isBrowser()&&t===`ISO-8859-1`},e.encode=function(e,t){var n=this.encodingName(t);return this.customEncoder?this.customEncoder(e,n):typeof TextEncoder>`u`?this.encodeFallback(e):new TextEncoder().encode(e)},e.isBrowser=function(){return typeof window<`u`&&{}.toString.call(window)===`[object Window]`},e.encodingName=function(e){return typeof e==`string`?e:e.getName()},e.encodingCharacterSet=function(e){return e instanceof $T?e:$T.getCharacterSetECIByName(e)},e.decodeFallback=function(t,n){var r=this.encodingCharacterSet(n);if(e.isDecodeFallbackSupported(r)){for(var i=``,a=0,o=t.length;a<o;a++){var s=t[a].toString(16);s.length<2&&(s=`0`+s),i+=`%`+s}return decodeURIComponent(i)}if(r.equals($T.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(t.buffer));throw new tE(`Encoding `+this.encodingName(n)+` not supported by fallback.`)},e.isDecodeFallbackSupported=function(e){return e.equals($T.UTF8)||e.equals($T.ISO8859_1)||e.equals($T.ASCII)},e.encodeFallback=function(e){for(var t=btoa(unescape(encodeURIComponent(e))).split(``),n=[],r=0;r<t.length;r++)n.push(t[r].charCodeAt(0));return new Uint8Array(n)},e}(),rE=function(){function e(){}return e.castAsNonUtf8Char=function(e,t){t===void 0&&(t=null);var n=t?t.getName():this.ISO88591;return nE.decode(new Uint8Array([e]),n)},e.guessEncoding=function(t,n){if(n!=null&&n.get(YT.CHARACTER_SET)!==void 0)return n.get(YT.CHARACTER_SET).toString();for(var r=t.length,i=!0,a=!0,o=!0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=t.length>3&&t[0]===239&&t[1]===187&&t[2]===191,y=0;y<r&&(i||a||o);y++){var b=255&t[y];o&&(s>0?128&b?s--:o=!1:128&b&&(64&b?(s++,32&b?(s++,16&b?(s++,8&b?o=!1:u++):l++):c++):o=!1)),i&&(b>127&&b<160?i=!1:b>159&&(b<192||b===215||b===247)&&_++),a&&(d>0?b<64||b===127||b>252?a=!1:d--:b===128||b===160||b>239?a=!1:b>160&&b<224?(f++,m=0,++p>h&&(h=p)):b>127?(d++,p=0,++m>g&&(g=m)):(p=0,m=0))}return o&&s>0&&(o=!1),a&&d>0&&(a=!1),o&&(v||c+l+u>0)?e.UTF8:a&&(e.ASSUME_SHIFT_JIS||h>=3||g>=3)?e.SHIFT_JIS:i&&a?h===2&&f===2||10*_>=r?e.SHIFT_JIS:e.ISO88591:i?e.ISO88591:a?e.SHIFT_JIS:o?e.UTF8:e.PLATFORM_DEFAULT_ENCODING},e.format=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=-1;function i(e,n,i,a,o,s){if(e===`%%`)return`%`;if(t[++r]!==void 0){e=a?parseInt(a.substr(1)):void 0;var c,l=o?parseInt(o.substr(1)):void 0;switch(s){case`s`:c=t[r];break;case`c`:c=t[r][0];break;case`f`:c=parseFloat(t[r]).toFixed(e);break;case`p`:c=parseFloat(t[r]).toPrecision(e);break;case`e`:c=parseFloat(t[r]).toExponential(e);break;case`x`:c=parseInt(t[r]).toString(l||16);break;case`d`:c=parseFloat(parseInt(t[r],l||10).toPrecision(e)).toFixed(0)}c=typeof c==`object`?JSON.stringify(c):(+c).toString(l);for(var u=parseInt(i),d=i&&i[0]+``==`0`?`0`:` `;c.length<u;)c=n===void 0?d+c:c+d;return c}}return e.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,i)},e.getBytes=function(e,t){return nE.encode(e,t)},e.getCharCode=function(e,t){return t===void 0&&(t=0),e.charCodeAt(t)},e.getCharAt=function(e){return String.fromCharCode(e)},e.SHIFT_JIS=$T.SJIS.getName(),e.GB2312=`GB2312`,e.ISO88591=$T.ISO8859_1.getName(),e.EUC_JP=`EUC_JP`,e.UTF8=$T.UTF8.getName(),e.PLATFORM_DEFAULT_ENCODING=e.UTF8,e.ASSUME_SHIFT_JIS=!1,e}(),iE=function(){function e(e){e===void 0&&(e=``),this.value=e}return e.prototype.enableDecoding=function(e){return this.encoding=e,this},e.prototype.append=function(e){return typeof e==`string`?this.value+=e.toString():this.encoding?this.value+=rE.castAsNonUtf8Char(e,this.encoding):this.value+=String.fromCharCode(e),this},e.prototype.appendChars=function(e,t,n){for(var r=t;t<t+n;r++)this.append(e[r]);return this},e.prototype.length=function(){return this.value.length},e.prototype.charAt=function(e){return this.value.charAt(e)},e.prototype.deleteCharAt=function(e){this.value=this.value.substr(0,e)+this.value.substring(e+1)},e.prototype.setCharAt=function(e,t){this.value=this.value.substr(0,e)+t+this.value.substr(e+1)},e.prototype.substring=function(e,t){return this.value.substring(e,t)},e.prototype.setLengthToZero=function(){this.value=``},e.prototype.toString=function(){return this.value},e.prototype.insert=function(e,t){this.value=this.value.substr(0,e)+t+this.value.substr(e+t.length)},e}(),aE=function(){function e(e,t,n,r){if(this.width=e,this.height=t,this.rowSize=n,this.bits=r,t??=e,this.height=t,e<1||t<1)throw new q(`Both dimensions must be greater than 0`);n??=Math.floor((e+31)/32),this.rowSize=n,r??(this.bits=new Int32Array(this.rowSize*this.height))}return e.parseFromBooleanArray=function(t){for(var n=t.length,r=t[0].length,i=new e(r,n),a=0;a<n;a++)for(var o=t[a],s=0;s<r;s++)o[s]&&i.set(s,a);return i},e.parseFromString=function(t,n,r){if(t===null)throw new q(`stringRepresentation cannot be null`);for(var i=Array(t.length),a=0,o=0,s=-1,c=0,l=0;l<t.length;)if(t.charAt(l)===`
|
|
121
|
+
`||t.charAt(l)===`\r`){if(a>o){if(s===-1)s=a-o;else if(a-o!==s)throw new q(`row lengths do not match`);o=a,c++}l++}else if(t.substring(l,l+n.length)===n)l+=n.length,i[a]=!0,a++;else{if(t.substring(l,l+r.length)!==r)throw new q(`illegal character encountered: `+t.substring(l));l+=r.length,i[a]=!1,a++}if(a>o){if(s===-1)s=a-o;else if(a-o!==s)throw new q(`row lengths do not match`);c++}for(var u=new e(s,c),d=0;d<a;d++)i[d]&&u.set(Math.floor(d%s),Math.floor(d/s));return u},e.prototype.get=function(e,t){var n=t*this.rowSize+Math.floor(e/32);return(this.bits[n]>>>(31&e)&1)!=0},e.prototype.set=function(e,t){var n=t*this.rowSize+Math.floor(e/32);this.bits[n]|=1<<(31&e)&4294967295},e.prototype.unset=function(e,t){var n=t*this.rowSize+Math.floor(e/32);this.bits[n]&=~(1<<(31&e)&4294967295)},e.prototype.flip=function(e,t){var n=t*this.rowSize+Math.floor(e/32);this.bits[n]^=1<<(31&e)&4294967295},e.prototype.xor=function(e){if(this.width!==e.getWidth()||this.height!==e.getHeight()||this.rowSize!==e.getRowSize())throw new q(`input matrix dimensions do not match`);for(var t=new qT(Math.floor(this.width/32)+1),n=this.rowSize,r=this.bits,i=0,a=this.height;i<a;i++)for(var o=i*n,s=e.getRow(i,t).getBitArray(),c=0;c<n;c++)r[o+c]^=s[c]},e.prototype.clear=function(){for(var e=this.bits,t=e.length,n=0;n<t;n++)e[n]=0},e.prototype.setRegion=function(e,t,n,r){if(t<0||e<0)throw new q(`Left and top must be nonnegative`);if(r<1||n<1)throw new q(`Height and width must be at least 1`);var i=e+n,a=t+r;if(a>this.height||i>this.width)throw new q(`The region must fit inside the matrix`);for(var o=this.rowSize,s=this.bits,c=t;c<a;c++)for(var l=c*o,u=e;u<i;u++)s[l+Math.floor(u/32)]|=1<<(31&u)&4294967295},e.prototype.getRow=function(e,t){t==null||t.getSize()<this.width?t=new qT(this.width):t.clear();for(var n=this.rowSize,r=this.bits,i=e*n,a=0;a<n;a++)t.setBulk(32*a,r[i+a]);return t},e.prototype.setRow=function(e,t){zT.arraycopy(t.getBitArray(),0,this.bits,e*this.rowSize,this.rowSize)},e.prototype.rotate180=function(){for(var e=this.getWidth(),t=this.getHeight(),n=new qT(e),r=new qT(e),i=0,a=Math.floor((t+1)/2);i<a;i++)n=this.getRow(i,n),r=this.getRow(t-1-i,r),n.reverse(),r.reverse(),this.setRow(i,r),this.setRow(t-1-i,n)},e.prototype.getEnclosingRectangle=function(){for(var e=this.width,t=this.height,n=this.rowSize,r=this.bits,i=e,a=t,o=-1,s=-1,c=0;c<t;c++)for(var l=0;l<n;l++){var u=r[c*n+l];if(u!==0){if(c<a&&(a=c),c>s&&(s=c),32*l<i){for(var d=0;!(u<<31-d&4294967295);)d++;32*l+d<i&&(i=32*l+d)}if(32*l+31>o){for(d=31;!(u>>>d);)d--;32*l+d>o&&(o=32*l+d)}}}return o<i||s<a?null:Int32Array.from([i,a,o-i+1,s-a+1])},e.prototype.getTopLeftOnBit=function(){for(var e=this.rowSize,t=this.bits,n=0;n<t.length&&t[n]===0;)n++;if(n===t.length)return null;for(var r=n/e,i=n%e*32,a=t[n],o=0;!(a<<31-o&4294967295);)o++;return i+=o,Int32Array.from([i,r])},e.prototype.getBottomRightOnBit=function(){for(var e=this.rowSize,t=this.bits,n=t.length-1;n>=0&&t[n]===0;)n--;if(n<0)return null;for(var r=Math.floor(n/e),i=32*Math.floor(n%e),a=t[n],o=31;!(a>>>o);)o--;return i+=o,Int32Array.from([i,r])},e.prototype.getWidth=function(){return this.width},e.prototype.getHeight=function(){return this.height},e.prototype.getRowSize=function(){return this.rowSize},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.width===n.width&&this.height===n.height&&this.rowSize===n.rowSize&>.equals(this.bits,n.bits)},e.prototype.hashCode=function(){var e=this.width;return e=31*(e=31*(e=31*(e=31*e+this.width)+this.height)+this.rowSize)+GT.hashCode(this.bits)},e.prototype.toString=function(e,t,n){return e===void 0&&(e=`X `),t===void 0&&(t=` `),n===void 0&&(n=`
|
|
122
|
+
`),this.buildToString(e,t,n)},e.prototype.buildToString=function(e,t,n){for(var r=new iE,i=0,a=this.height;i<a;i++){for(var o=0,s=this.width;o<s;o++)r.append(this.get(o,i)?e:t);r.append(n)}return r.toString()},e.prototype.clone=function(){return new e(this.width,this.height,this.rowSize,this.bits.slice())},e}(),oE=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Y=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return oE(t,e),t.getNotFoundInstance=function(){return new t},t.kind=`NotFoundException`,t}(jT),sE=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),cE=function(e){function t(n){var r=e.call(this,n)||this;return r.luminances=t.EMPTY,r.buckets=new Int32Array(t.LUMINANCE_BUCKETS),r}return sE(t,e),t.prototype.getBlackRow=function(e,n){var r=this.getLuminanceSource(),i=r.getWidth();n==null||n.getSize()<i?n=new qT(i):n.clear(),this.initArrays(i);for(var a=r.getRow(e,this.luminances),o=this.buckets,s=0;s<i;s++)o[(255&a[s])>>t.LUMINANCE_SHIFT]++;var c=t.estimateBlackPoint(o);if(i<3)for(s=0;s<i;s++)(255&a[s])<c&&n.set(s);else{var l=255&a[0],u=255&a[1];for(s=1;s<i-1;s++){var d=255&a[s+1];(4*u-l-d)/2<c&&n.set(s),l=u,u=d}}return n},t.prototype.getBlackMatrix=function(){var e=this.getLuminanceSource(),n=e.getWidth(),r=e.getHeight(),i=new aE(n,r);this.initArrays(n);for(var a=this.buckets,o=1;o<5;o++)for(var s=Math.floor(r*o/5),c=e.getRow(s,this.luminances),l=Math.floor(4*n/5),u=Math.floor(n/5);u<l;u++)a[(255&c[u])>>t.LUMINANCE_SHIFT]++;var d=t.estimateBlackPoint(a),f=e.getMatrix();for(o=0;o<r;o++){var p=o*n;for(u=0;u<n;u++)(255&f[p+u])<d&&i.set(u,o)}return i},t.prototype.createBinarizer=function(e){return new t(e)},t.prototype.initArrays=function(e){this.luminances.length<e&&(this.luminances=new Uint8ClampedArray(e));for(var n=this.buckets,r=0;r<t.LUMINANCE_BUCKETS;r++)n[r]=0},t.estimateBlackPoint=function(e){for(var n=e.length,r=0,i=0,a=0,o=0;o<n;o++)e[o]>a&&(i=o,a=e[o]),e[o]>r&&(r=e[o]);var s=0,c=0;for(o=0;o<n;o++){var l=o-i;(p=e[o]*l*l)>c&&(s=o,c=p)}if(i>s){var u=i;i=s,s=u}if(s-i<=n/16)throw new Y;var d=s-1,f=-1;for(o=s-1;o>i;o--){var p,m=o-i;(p=m*m*(s-o)*(r-e[o]))>f&&(d=o,f=p)}return d<<t.LUMINANCE_SHIFT},t.LUMINANCE_BITS=5,t.LUMINANCE_SHIFT=8-t.LUMINANCE_BITS,t.LUMINANCE_BUCKETS=1<<t.LUMINANCE_BITS,t.EMPTY=Uint8ClampedArray.from([0]),t}(RT),lE=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),uE=function(e){function t(t){var n=e.call(this,t)||this;return n.matrix=null,n}return lE(t,e),t.prototype.getBlackMatrix=function(){if(this.matrix!==null)return this.matrix;var n=this.getLuminanceSource(),r=n.getWidth(),i=n.getHeight();if(r>=t.MINIMUM_DIMENSION&&i>=t.MINIMUM_DIMENSION){var a=n.getMatrix(),o=r>>t.BLOCK_SIZE_POWER;(r&t.BLOCK_SIZE_MASK)!=0&&o++;var s=i>>t.BLOCK_SIZE_POWER;(i&t.BLOCK_SIZE_MASK)!=0&&s++;var c=t.calculateBlackPoints(a,o,s,r,i),l=new aE(r,i);t.calculateThresholdForBlock(a,o,s,r,i,c,l),this.matrix=l}else this.matrix=e.prototype.getBlackMatrix.call(this);return this.matrix},t.prototype.createBinarizer=function(e){return new t(e)},t.calculateThresholdForBlock=function(e,n,r,i,a,o,s){for(var c=a-t.BLOCK_SIZE,l=i-t.BLOCK_SIZE,u=0;u<r;u++){var d=u<<t.BLOCK_SIZE_POWER;d>c&&(d=c);for(var f=t.cap(u,2,r-3),p=0;p<n;p++){var m=p<<t.BLOCK_SIZE_POWER;m>l&&(m=l);for(var h=t.cap(p,2,n-3),g=0,_=-2;_<=2;_++){var v=o[f+_];g+=v[h-2]+v[h-1]+v[h]+v[h+1]+v[h+2]}var y=g/25;t.thresholdBlock(e,m,d,y,i,s)}}},t.cap=function(e,t,n){return e<t?t:e>n?n:e},t.thresholdBlock=function(e,n,r,i,a,o){for(var s=0,c=r*a+n;s<t.BLOCK_SIZE;s++,c+=a)for(var l=0;l<t.BLOCK_SIZE;l++)(255&e[c+l])<=i&&o.set(n+l,r+s)},t.calculateBlackPoints=function(e,n,r,i,a){for(var o=a-t.BLOCK_SIZE,s=i-t.BLOCK_SIZE,c=Array(r),l=0;l<r;l++){c[l]=new Int32Array(n);var u=l<<t.BLOCK_SIZE_POWER;u>o&&(u=o);for(var d=0;d<n;d++){var f=d<<t.BLOCK_SIZE_POWER;f>s&&(f=s);for(var p=0,m=255,h=0,g=0,_=u*i+f;g<t.BLOCK_SIZE;g++,_+=i){for(var v=0;v<t.BLOCK_SIZE;v++){var y=255&e[_+v];p+=y,y<m&&(m=y),y>h&&(h=y)}if(h-m>t.MIN_DYNAMIC_RANGE)for(g++,_+=i;g<t.BLOCK_SIZE;g++,_+=i)for(v=0;v<t.BLOCK_SIZE;v++)p+=255&e[_+v]}var b=p>>2*t.BLOCK_SIZE_POWER;if(h-m<=t.MIN_DYNAMIC_RANGE&&(b=m/2,l>0&&d>0)){var x=(c[l-1][d]+2*c[l][d-1]+c[l-1][d-1])/4;m<x&&(b=x)}c[l][d]=b}}return c},t.BLOCK_SIZE_POWER=3,t.BLOCK_SIZE=1<<t.BLOCK_SIZE_POWER,t.BLOCK_SIZE_MASK=t.BLOCK_SIZE-1,t.MINIMUM_DIMENSION=5*t.BLOCK_SIZE,t.MIN_DYNAMIC_RANGE=24,t}(cE),dE=function(){function e(e,t){this.width=e,this.height=t}return e.prototype.getWidth=function(){return this.width},e.prototype.getHeight=function(){return this.height},e.prototype.isCropSupported=function(){return!1},e.prototype.crop=function(e,t,n,r){throw new tE(`This luminance source does not support cropping.`)},e.prototype.isRotateSupported=function(){return!1},e.prototype.rotateCounterClockwise=function(){throw new tE(`This luminance source does not support rotation by 90 degrees.`)},e.prototype.rotateCounterClockwise45=function(){throw new tE(`This luminance source does not support rotation by 45 degrees.`)},e.prototype.toString=function(){for(var e=new Uint8ClampedArray(this.width),t=new iE,n=0;n<this.height;n++){for(var r=this.getRow(n,e),i=0;i<this.width;i++){var a=255&r[i],o=void 0;o=a<64?`#`:a<128?`+`:a<192?`.`:` `,t.append(o)}t.append(`
|
|
123
|
+
`)}return t.toString()},e}(),fE=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),pE=function(e){function t(t){var n=e.call(this,t.getWidth(),t.getHeight())||this;return n.delegate=t,n}return fE(t,e),t.prototype.getRow=function(e,t){for(var n=this.delegate.getRow(e,t),r=this.getWidth(),i=0;i<r;i++)n[i]=255-(255&n[i]);return n},t.prototype.getMatrix=function(){for(var e=this.delegate.getMatrix(),t=this.getWidth()*this.getHeight(),n=new Uint8ClampedArray(t),r=0;r<t;r++)n[r]=255-(255&e[r]);return n},t.prototype.isCropSupported=function(){return this.delegate.isCropSupported()},t.prototype.crop=function(e,n,r,i){return new t(this.delegate.crop(e,n,r,i))},t.prototype.isRotateSupported=function(){return this.delegate.isRotateSupported()},t.prototype.invert=function(){return this.delegate},t.prototype.rotateCounterClockwise=function(){return new t(this.delegate.rotateCounterClockwise())},t.prototype.rotateCounterClockwise45=function(){return new t(this.delegate.rotateCounterClockwise45())},t}(dE),mE=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),hE=function(e){function t(n){var r=e.call(this,n.width,n.height)||this;return r.canvas=n,r.tempCanvasElement=null,r.buffer=t.makeBufferFromCanvasImageData(n),r}return mE(t,e),t.makeBufferFromCanvasImageData=function(e){var n=e.getContext(`2d`).getImageData(0,0,e.width,e.height);return t.toGrayscaleBuffer(n.data,e.width,e.height)},t.toGrayscaleBuffer=function(e,t,n){for(var r=new Uint8ClampedArray(t*n),i=0,a=0,o=e.length;i<o;i+=4,a++){var s=void 0;s=e[i+3]===0?255:306*e[i]+601*e[i+1]+117*e[i+2]+512>>10,r[a]=s}return r},t.prototype.getRow=function(e,t){if(e<0||e>=this.getHeight())throw new q(`Requested row is outside the image: `+e);var n=this.getWidth(),r=e*n;return t===null?t=this.buffer.slice(r,r+n):(t.length<n&&(t=new Uint8ClampedArray(n)),t.set(this.buffer.slice(r,r+n))),t},t.prototype.getMatrix=function(){return this.buffer},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(t,n,r,i){return e.prototype.crop.call(this,t,n,r,i),this},t.prototype.isRotateSupported=function(){return!0},t.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},t.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},t.prototype.getTempCanvasElement=function(){if(this.tempCanvasElement===null){var e=this.canvas.ownerDocument.createElement(`canvas`);e.width=this.canvas.width,e.height=this.canvas.height,this.tempCanvasElement=e}return this.tempCanvasElement},t.prototype.rotate=function(e){var n=this.getTempCanvasElement(),r=n.getContext(`2d`),i=e*t.DEGREE_TO_RADIANS,a=this.canvas.width,o=this.canvas.height,s=Math.ceil(Math.abs(Math.cos(i))*a+Math.abs(Math.sin(i))*o),c=Math.ceil(Math.abs(Math.sin(i))*a+Math.abs(Math.cos(i))*o);return n.width=s,n.height=c,r.translate(s/2,c/2),r.rotate(i),r.drawImage(this.canvas,a/-2,o/-2),this.buffer=t.makeBufferFromCanvasImageData(n),this},t.prototype.invert=function(){return new pE(this)},t.DEGREE_TO_RADIANS=Math.PI/180,t}(dE),gE=function(){function e(e,t,n){this.deviceId=e,this.label=t,this.kind=`videoinput`,this.groupId=n||void 0}return e.prototype.toJSON=function(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}},e}(),_E=function(e,t,n,r){return new(n||=Promise)((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},vE=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw TypeError(`Generator is already executing.`);for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!((i=i.length>0&&i[i.length-1])||a[0]!==6&&a[0]!==2)){o=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(a[0]===6&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},yE=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},bE=function(){function e(e,t,n){t===void 0&&(t=500),this.reader=e,this.timeBetweenScansMillis=t,this._hints=n,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}return Object.defineProperty(e.prototype,"hasNavigator",{get:function(){return typeof navigator<`u`},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isMediaDevicesSuported",{get:function(){return this.hasNavigator&&!!navigator.mediaDevices},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canEnumerateDevices",{get:function(){return!(!this.isMediaDevicesSuported||!navigator.mediaDevices.enumerateDevices)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timeBetweenDecodingAttempts",{get:function(){return this._timeBetweenDecodingAttempts},set:function(e){this._timeBetweenDecodingAttempts=e<0?0:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hints",{get:function(){return this._hints},set:function(e){this._hints=e||null},enumerable:!1,configurable:!0}),e.prototype.listVideoInputDevices=function(){return _E(this,void 0,void 0,(function(){var e,t,n,r,i,a,o,s,c,l,u,d;return vE(this,(function(f){switch(f.label){case 0:if(!this.hasNavigator)throw Error(`Can't enumerate devices, navigator is not present.`);if(!this.canEnumerateDevices)throw Error(`Can't enumerate devices, method not supported.`);return[4,navigator.mediaDevices.enumerateDevices()];case 1:e=f.sent(),t=[];try{for(n=yE(e),r=n.next();!r.done;r=n.next())i=r.value,(a=i.kind===`video`?`videoinput`:i.kind)===`videoinput`&&(o=i.deviceId||i.id,s=i.label||`Video device `+(t.length+1),c=i.groupId,l={deviceId:o,label:s,kind:a,groupId:c},t.push(l))}catch(e){u={error:e}}finally{try{r&&!r.done&&(d=n.return)&&d.call(n)}finally{if(u)throw u.error}}return[2,t]}}))}))},e.prototype.getVideoInputDevices=function(){return _E(this,void 0,void 0,(function(){return vE(this,(function(e){switch(e.label){case 0:return[4,this.listVideoInputDevices()];case 1:return[2,e.sent().map((function(e){return new gE(e.deviceId,e.label)}))]}}))}))},e.prototype.findDeviceById=function(e){return _E(this,void 0,void 0,(function(){var t;return vE(this,(function(n){switch(n.label){case 0:return[4,this.listVideoInputDevices()];case 1:return(t=n.sent())?[2,t.find((function(t){return t.deviceId===e}))]:[2,null]}}))}))},e.prototype.decodeFromInputVideoDevice=function(e,t){return _E(this,void 0,void 0,(function(){return vE(this,(function(n){switch(n.label){case 0:return[4,this.decodeOnceFromVideoDevice(e,t)];case 1:return[2,n.sent()]}}))}))},e.prototype.decodeOnceFromVideoDevice=function(e,t){return _E(this,void 0,void 0,(function(){var n;return vE(this,(function(r){switch(r.label){case 0:return this.reset(),n={video:e?{deviceId:{exact:e}}:{facingMode:`environment`}},[4,this.decodeOnceFromConstraints(n,t)];case 1:return[2,r.sent()]}}))}))},e.prototype.decodeOnceFromConstraints=function(e,t){return _E(this,void 0,void 0,(function(){var n;return vE(this,(function(r){switch(r.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return n=r.sent(),[4,this.decodeOnceFromStream(n,t)];case 2:return[2,r.sent()]}}))}))},e.prototype.decodeOnceFromStream=function(e,t){return _E(this,void 0,void 0,(function(){var n;return vE(this,(function(r){switch(r.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,t)];case 1:return n=r.sent(),[4,this.decodeOnce(n)];case 2:return[2,r.sent()]}}))}))},e.prototype.decodeFromInputVideoDeviceContinuously=function(e,t,n){return _E(this,void 0,void 0,(function(){return vE(this,(function(r){switch(r.label){case 0:return[4,this.decodeFromVideoDevice(e,t,n)];case 1:return[2,r.sent()]}}))}))},e.prototype.decodeFromVideoDevice=function(e,t,n){return _E(this,void 0,void 0,(function(){var r;return vE(this,(function(i){switch(i.label){case 0:return r={video:e?{deviceId:{exact:e}}:{facingMode:`environment`}},[4,this.decodeFromConstraints(r,t,n)];case 1:return[2,i.sent()]}}))}))},e.prototype.decodeFromConstraints=function(e,t,n){return _E(this,void 0,void 0,(function(){var r;return vE(this,(function(i){switch(i.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return r=i.sent(),[4,this.decodeFromStream(r,t,n)];case 2:return[2,i.sent()]}}))}))},e.prototype.decodeFromStream=function(e,t,n){return _E(this,void 0,void 0,(function(){var r;return vE(this,(function(i){switch(i.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,t)];case 1:return r=i.sent(),[4,this.decodeContinuously(r,n)];case 2:return[2,i.sent()]}}))}))},e.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},e.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},e.prototype.attachStreamToVideo=function(e,t){return _E(this,void 0,void 0,(function(){var n;return vE(this,(function(r){switch(r.label){case 0:return n=this.prepareVideoElement(t),this.addVideoSource(n,e),this.videoElement=n,this.stream=e,[4,this.playVideoOnLoadAsync(n)];case 1:return r.sent(),[2,n]}}))}))},e.prototype.playVideoOnLoadAsync=function(e){var t=this;return new Promise((function(n,r){return t.playVideoOnLoad(e,(function(){return n()}))}))},e.prototype.playVideoOnLoad=function(e,t){var n=this;this.videoEndedListener=function(){return n.stopStreams()},this.videoCanPlayListener=function(){return n.tryPlayVideo(e)},e.addEventListener(`ended`,this.videoEndedListener),e.addEventListener(`canplay`,this.videoCanPlayListener),e.addEventListener(`playing`,t),this.tryPlayVideo(e)},e.prototype.isVideoPlaying=function(e){return e.currentTime>0&&!e.paused&&!e.ended&&e.readyState>2},e.prototype.tryPlayVideo=function(e){return _E(this,void 0,void 0,(function(){return vE(this,(function(t){switch(t.label){case 0:if(this.isVideoPlaying(e))return console.warn(`Trying to play video that is already playing.`),[2];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,e.play()];case 2:return t.sent(),[3,4];case 3:return t.sent(),console.warn(`It was not possible to play the video.`),[3,4];case 4:return[2]}}))}))},e.prototype.getMediaElement=function(e,t){var n=document.getElementById(e);if(!n)throw new NT(`element with id '`+e+`' not found`);if(n.nodeName.toLowerCase()!==t.toLowerCase())throw new NT(`element with id '`+e+`' must be an `+t+` element`);return n},e.prototype.decodeFromImage=function(e,t){if(!e&&!t)throw new NT(`either imageElement with a src set or an url must be provided`);return t&&!e?this.decodeFromImageUrl(t):this.decodeFromImageElement(e)},e.prototype.decodeFromVideo=function(e,t){if(!e&&!t)throw new NT(`Either an element with a src set or an URL must be provided`);return t&&!e?this.decodeFromVideoUrl(t):this.decodeFromVideoElement(e)},e.prototype.decodeFromVideoContinuously=function(e,t,n){if(e===void 0&&t===void 0)throw new NT(`Either an element with a src set or an URL must be provided`);return t&&!e?this.decodeFromVideoUrlContinuously(t,n):this.decodeFromVideoElementContinuously(e,n)},e.prototype.decodeFromImageElement=function(e){if(!e)throw new NT(`An image element must be provided.`);this.reset();var t=this.prepareImageElement(e);return this.imageElement=t,this.isImageLoaded(t)?this.decodeOnce(t,!1,!0):this._decodeOnLoadImage(t)},e.prototype.decodeFromVideoElement=function(e){var t=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideo(t)},e.prototype.decodeFromVideoElementContinuously=function(e,t){var n=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideoContinuously(n,t)},e.prototype._decodeFromVideoElementSetup=function(e){if(!e)throw new NT(`A video element must be provided.`);this.reset();var t=this.prepareVideoElement(e);return this.videoElement=t,t},e.prototype.decodeFromImageUrl=function(e){if(!e)throw new NT(`An URL must be provided.`);this.reset();var t=this.prepareImageElement();this.imageElement=t;var n=this._decodeOnLoadImage(t);return t.src=e,n},e.prototype.decodeFromVideoUrl=function(e){if(!e)throw new NT(`An URL must be provided.`);this.reset();var t=this.prepareVideoElement(),n=this.decodeFromVideoElement(t);return t.src=e,n},e.prototype.decodeFromVideoUrlContinuously=function(e,t){if(!e)throw new NT(`An URL must be provided.`);this.reset();var n=this.prepareVideoElement(),r=this.decodeFromVideoElementContinuously(n,t);return n.src=e,r},e.prototype._decodeOnLoadImage=function(e){var t=this;return new Promise((function(n,r){t.imageLoadedListener=function(){return t.decodeOnce(e,!1,!0).then(n,r)},e.addEventListener(`load`,t.imageLoadedListener)}))},e.prototype._decodeOnLoadVideo=function(e){return _E(this,void 0,void 0,(function(){return vE(this,(function(t){switch(t.label){case 0:return[4,this.playVideoOnLoadAsync(e)];case 1:return t.sent(),[4,this.decodeOnce(e)];case 2:return[2,t.sent()]}}))}))},e.prototype._decodeOnLoadVideoContinuously=function(e,t){return _E(this,void 0,void 0,(function(){return vE(this,(function(n){switch(n.label){case 0:return[4,this.playVideoOnLoadAsync(e)];case 1:return n.sent(),this.decodeContinuously(e,t),[2]}}))}))},e.prototype.isImageLoaded=function(e){return!!e.complete&&e.naturalWidth!==0},e.prototype.prepareImageElement=function(e){var t;return e===void 0&&((t=document.createElement(`img`)).width=200,t.height=200),typeof e==`string`&&(t=this.getMediaElement(e,`img`)),e instanceof HTMLImageElement&&(t=e),t},e.prototype.prepareVideoElement=function(e){var t;return e||typeof document>`u`||((t=document.createElement(`video`)).width=200,t.height=200),typeof e==`string`&&(t=this.getMediaElement(e,`video`)),e instanceof HTMLVideoElement&&(t=e),t.setAttribute(`autoplay`,`true`),t.setAttribute(`muted`,`true`),t.setAttribute(`playsinline`,`true`),t},e.prototype.decodeOnce=function(e,t,n){var r=this;t===void 0&&(t=!0),n===void 0&&(n=!0),this._stopAsyncDecode=!1;var i=function(a,o){if(r._stopAsyncDecode)return o(new Y(`Video stream has ended before any code could be detected.`)),void(r._stopAsyncDecode=void 0);try{a(r.decode(e))}catch(e){if(t&&e instanceof Y||(e instanceof LT||e instanceof J)&&n)return setTimeout(i,r._timeBetweenDecodingAttempts,a,o);o(e)}};return new Promise((function(e,t){return i(e,t)}))},e.prototype.decodeContinuously=function(e,t){var n=this;this._stopContinuousDecode=!1;var r=function(){if(n._stopContinuousDecode)n._stopContinuousDecode=void 0;else try{t(n.decode(e),null),setTimeout(r,n.timeBetweenScansMillis)}catch(e){t(null,e),(e instanceof LT||e instanceof J||e instanceof Y)&&setTimeout(r,n._timeBetweenDecodingAttempts)}};r()},e.prototype.decode=function(e){var t=this.createBinaryBitmap(e);return this.decodeBitmap(t)},e.prototype.createBinaryBitmap=function(e){var t=this.getCaptureCanvasContext(e);return this.drawImageOnCanvas(t,e),new FT(new uE(new hE(this.getCaptureCanvas(e))))},e.prototype.getCaptureCanvasContext=function(e){if(!this.captureCanvasContext){var t=this.getCaptureCanvas(e).getContext(`2d`);this.captureCanvasContext=t}return this.captureCanvasContext},e.prototype.getCaptureCanvas=function(e){if(!this.captureCanvas){var t=this.createCaptureCanvas(e);this.captureCanvas=t}return this.captureCanvas},e.prototype.drawImageOnCanvas=function(e,t){e.drawImage(t,0,0)},e.prototype.decodeBitmap=function(e){return this.reader.decode(e,this._hints)},e.prototype.createCaptureCanvas=function(e){if(typeof document>`u`)return this._destroyCaptureCanvas(),null;var t,n,r=document.createElement(`canvas`);return e!==void 0&&(e instanceof HTMLVideoElement?(t=e.videoWidth,n=e.videoHeight):e instanceof HTMLImageElement&&(t=e.naturalWidth||e.width,n=e.naturalHeight||e.height)),r.style.width=t+`px`,r.style.height=n+`px`,r.width=t,r.height=n,r},e.prototype.stopStreams=function(){this.stream&&=(this.stream.getVideoTracks().forEach((function(e){return e.stop()})),void 0),!1===this._stopAsyncDecode&&this.stopAsyncDecode(),!1===this._stopContinuousDecode&&this.stopContinuousDecode()},e.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},e.prototype._destroyVideoElement=function(){this.videoElement&&=(this.videoEndedListener!==void 0&&this.videoElement.removeEventListener(`ended`,this.videoEndedListener),this.videoPlayingEventListener!==void 0&&this.videoElement.removeEventListener(`playing`,this.videoPlayingEventListener),this.videoCanPlayListener!==void 0&&this.videoElement.removeEventListener(`loadedmetadata`,this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),void 0)},e.prototype._destroyImageElement=function(){this.imageElement&&=(this.imageLoadedListener!==void 0&&this.imageElement.removeEventListener(`load`,this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute(`src`),void 0)},e.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},e.prototype.addVideoSource=function(e,t){try{e.srcObject=t}catch{e.src=URL.createObjectURL(t)}},e.prototype.cleanVideoSource=function(e){try{e.srcObject=null}catch{e.src=``}this.videoElement.removeAttribute(`src`)},e}(),xE=function(){function e(e,t,n,r,i,a){n===void 0&&(n=t==null?0:8*t.length),a===void 0&&(a=zT.currentTimeMillis()),this.text=e,this.rawBytes=t,this.numBits=n,this.resultPoints=r,this.format=i,this.timestamp=a,this.text=e,this.rawBytes=t,this.numBits=n??(t==null?0:8*t.length),this.resultPoints=r,this.format=i,this.resultMetadata=null,this.timestamp=a??zT.currentTimeMillis()}return e.prototype.getText=function(){return this.text},e.prototype.getRawBytes=function(){return this.rawBytes},e.prototype.getNumBits=function(){return this.numBits},e.prototype.getResultPoints=function(){return this.resultPoints},e.prototype.getBarcodeFormat=function(){return this.format},e.prototype.getResultMetadata=function(){return this.resultMetadata},e.prototype.putMetadata=function(e,t){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(e,t)},e.prototype.putAllMetadata=function(e){e!==null&&(this.resultMetadata===null?this.resultMetadata=e:this.resultMetadata=new Map(e))},e.prototype.addResultPoints=function(e){var t=this.resultPoints;if(t===null)this.resultPoints=e;else if(e!==null&&e.length>0){var n=Array(t.length+e.length);zT.arraycopy(t,0,n,0,t.length),zT.arraycopy(e,0,n,t.length,e.length),this.resultPoints=n}},e.prototype.getTimestamp=function(){return this.timestamp},e.prototype.toString=function(){return this.text},e}();(function(e){e[e.AZTEC=0]=`AZTEC`,e[e.CODABAR=1]=`CODABAR`,e[e.CODE_39=2]=`CODE_39`,e[e.CODE_93=3]=`CODE_93`,e[e.CODE_128=4]=`CODE_128`,e[e.DATA_MATRIX=5]=`DATA_MATRIX`,e[e.EAN_8=6]=`EAN_8`,e[e.EAN_13=7]=`EAN_13`,e[e.ITF=8]=`ITF`,e[e.MAXICODE=9]=`MAXICODE`,e[e.PDF_417=10]=`PDF_417`,e[e.QR_CODE=11]=`QR_CODE`,e[e.RSS_14=12]=`RSS_14`,e[e.RSS_EXPANDED=13]=`RSS_EXPANDED`,e[e.UPC_A=14]=`UPC_A`,e[e.UPC_E=15]=`UPC_E`,e[e.UPC_EAN_EXTENSION=16]=`UPC_EAN_EXTENSION`})(QT||={});var SE,X=QT;(function(e){e[e.OTHER=0]=`OTHER`,e[e.ORIENTATION=1]=`ORIENTATION`,e[e.BYTE_SEGMENTS=2]=`BYTE_SEGMENTS`,e[e.ERROR_CORRECTION_LEVEL=3]=`ERROR_CORRECTION_LEVEL`,e[e.ISSUE_NUMBER=4]=`ISSUE_NUMBER`,e[e.SUGGESTED_PRICE=5]=`SUGGESTED_PRICE`,e[e.POSSIBLE_COUNTRY=6]=`POSSIBLE_COUNTRY`,e[e.UPC_EAN_EXTENSION=7]=`UPC_EAN_EXTENSION`,e[e.PDF417_EXTRA_METADATA=8]=`PDF417_EXTRA_METADATA`,e[e.STRUCTURED_APPEND_SEQUENCE=9]=`STRUCTURED_APPEND_SEQUENCE`,e[e.STRUCTURED_APPEND_PARITY=10]=`STRUCTURED_APPEND_PARITY`})(SE||={});var CE,wE=SE,TE=function(){function e(e,t,n,r,i,a){i===void 0&&(i=-1),a===void 0&&(a=-1),this.rawBytes=e,this.text=t,this.byteSegments=n,this.ecLevel=r,this.structuredAppendSequenceNumber=i,this.structuredAppendParity=a,this.numBits=e==null?0:8*e.length}return e.prototype.getRawBytes=function(){return this.rawBytes},e.prototype.getNumBits=function(){return this.numBits},e.prototype.setNumBits=function(e){this.numBits=e},e.prototype.getText=function(){return this.text},e.prototype.getByteSegments=function(){return this.byteSegments},e.prototype.getECLevel=function(){return this.ecLevel},e.prototype.getErrorsCorrected=function(){return this.errorsCorrected},e.prototype.setErrorsCorrected=function(e){this.errorsCorrected=e},e.prototype.getErasures=function(){return this.erasures},e.prototype.setErasures=function(e){this.erasures=e},e.prototype.getOther=function(){return this.other},e.prototype.setOther=function(e){this.other=e},e.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0},e.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity},e.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber},e}(),EE=function(){function e(){}return e.prototype.exp=function(e){return this.expTable[e]},e.prototype.log=function(e){if(e===0)throw new q;return this.logTable[e]},e.addOrSubtract=function(e,t){return e^t},e}(),DE=function(){function e(e,t){if(t.length===0)throw new q;this.field=e;var n=t.length;if(n>1&&t[0]===0){for(var r=1;r<n&&t[r]===0;)r++;r===n?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(n-r),zT.arraycopy(t,r,this.coefficients,0,this.coefficients.length))}else this.coefficients=t}return e.prototype.getCoefficients=function(){return this.coefficients},e.prototype.getDegree=function(){return this.coefficients.length-1},e.prototype.isZero=function(){return this.coefficients[0]===0},e.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},e.prototype.evaluateAt=function(e){if(e===0)return this.getCoefficient(0);var t,n=this.coefficients;if(e===1){t=0;for(var r=0,i=n.length;r!==i;r++){var a=n[r];t=EE.addOrSubtract(t,a)}return t}t=n[0];var o=n.length,s=this.field;for(r=1;r<o;r++)t=EE.addOrSubtract(s.multiply(e,t),n[r]);return t},e.prototype.addOrSubtract=function(t){if(!this.field.equals(t.field))throw new q(`GenericGFPolys do not have same GenericGF field`);if(this.isZero())return t;if(t.isZero())return this;var n=this.coefficients,r=t.coefficients;if(n.length>r.length){var i=n;n=r,r=i}var a=new Int32Array(r.length),o=r.length-n.length;zT.arraycopy(r,0,a,0,o);for(var s=o;s<r.length;s++)a[s]=EE.addOrSubtract(n[s-o],r[s]);return new e(this.field,a)},e.prototype.multiply=function(t){if(!this.field.equals(t.field))throw new q(`GenericGFPolys do not have same GenericGF field`);if(this.isZero()||t.isZero())return this.field.getZero();for(var n=this.coefficients,r=n.length,i=t.coefficients,a=i.length,o=new Int32Array(r+a-1),s=this.field,c=0;c<r;c++)for(var l=n[c],u=0;u<a;u++)o[c+u]=EE.addOrSubtract(o[c+u],s.multiply(l,i[u]));return new e(s,o)},e.prototype.multiplyScalar=function(t){if(t===0)return this.field.getZero();if(t===1)return this;for(var n=this.coefficients.length,r=this.field,i=new Int32Array(n),a=this.coefficients,o=0;o<n;o++)i[o]=r.multiply(a[o],t);return new e(r,i)},e.prototype.multiplyByMonomial=function(t,n){if(t<0)throw new q;if(n===0)return this.field.getZero();for(var r=this.coefficients,i=r.length,a=new Int32Array(i+t),o=this.field,s=0;s<i;s++)a[s]=o.multiply(r[s],n);return new e(o,a)},e.prototype.divide=function(e){if(!this.field.equals(e.field))throw new q(`GenericGFPolys do not have same GenericGF field`);if(e.isZero())throw new q(`Divide by 0`);for(var t=this.field,n=t.getZero(),r=this,i=e.getCoefficient(e.getDegree()),a=t.inverse(i);r.getDegree()>=e.getDegree()&&!r.isZero();){var o=r.getDegree()-e.getDegree(),s=t.multiply(r.getCoefficient(r.getDegree()),a),c=e.multiplyByMonomial(o,s),l=t.buildMonomial(o,s);n=n.addOrSubtract(l),r=r.addOrSubtract(c)}return[n,r]},e.prototype.toString=function(){for(var e=``,t=this.getDegree();t>=0;t--){var n=this.getCoefficient(t);if(n!==0){if(n<0?(e+=` - `,n=-n):e.length>0&&(e+=` + `),t===0||n!==1){var r=this.field.log(n);r===0?e+=`1`:r===1?e+=`a`:(e+=`a^`,e+=r)}t!==0&&(t===1?e+=`x`:(e+=`x^`,e+=t))}}return e},e}(),OE=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),kE=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return OE(t,e),t.kind=`ArithmeticException`,t}(jT),AE=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),jE=function(e){function t(t,n,r){var i=e.call(this)||this;i.primitive=t,i.size=n,i.generatorBase=r;for(var a=new Int32Array(n),o=1,s=0;s<n;s++)a[s]=o,(o*=2)>=n&&(o^=t,o&=n-1);i.expTable=a;var c=new Int32Array(n);for(s=0;s<n-1;s++)c[a[s]]=s;return i.logTable=c,i.zero=new DE(i,Int32Array.from([0])),i.one=new DE(i,Int32Array.from([1])),i}return AE(t,e),t.prototype.getZero=function(){return this.zero},t.prototype.getOne=function(){return this.one},t.prototype.buildMonomial=function(e,t){if(e<0)throw new q;if(t===0)return this.zero;var n=new Int32Array(e+1);return n[0]=t,new DE(this,n)},t.prototype.inverse=function(e){if(e===0)throw new kE;return this.expTable[this.size-this.logTable[e]-1]},t.prototype.multiply=function(e,t){return e===0||t===0?0:this.expTable[(this.logTable[e]+this.logTable[t])%(this.size-1)]},t.prototype.getSize=function(){return this.size},t.prototype.getGeneratorBase=function(){return this.generatorBase},t.prototype.toString=function(){return`GF(0x`+KT.toHexString(this.primitive)+`,`+this.size+`)`},t.prototype.equals=function(e){return e===this},t.AZTEC_DATA_12=new t(4201,4096,1),t.AZTEC_DATA_10=new t(1033,1024,1),t.AZTEC_DATA_6=new t(67,64,1),t.AZTEC_PARAM=new t(19,16,1),t.QR_CODE_FIELD_256=new t(285,256,0),t.DATA_MATRIX_FIELD_256=new t(301,256,1),t.AZTEC_DATA_8=t.DATA_MATRIX_FIELD_256,t.MAXICODE_FIELD_64=t.AZTEC_DATA_6,t}(EE),ME=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),NE=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return ME(t,e),t.kind=`ReedSolomonException`,t}(jT),PE=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),FE=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return PE(t,e),t.kind=`IllegalStateException`,t}(jT),IE=function(){function e(e){this.field=e}return e.prototype.decode=function(e,t){for(var n=this.field,r=new DE(n,e),i=new Int32Array(t),a=!0,o=0;o<t;o++){var s=r.evaluateAt(n.exp(o+n.getGeneratorBase()));i[i.length-1-o]=s,s!==0&&(a=!1)}if(!a){var c=new DE(n,i),l=this.runEuclideanAlgorithm(n.buildMonomial(t,1),c,t),u=l[0],d=l[1],f=this.findErrorLocations(u),p=this.findErrorMagnitudes(d,f);for(o=0;o<f.length;o++){var m=e.length-1-n.log(f[o]);if(m<0)throw new NE(`Bad error location`);e[m]=jE.addOrSubtract(e[m],p[o])}}},e.prototype.runEuclideanAlgorithm=function(e,t,n){if(e.getDegree()<t.getDegree()){var r=e;e=t,t=r}for(var i=this.field,a=e,o=t,s=i.getZero(),c=i.getOne();o.getDegree()>=(n/2|0);){var l=a,u=s;if(s=c,(a=o).isZero())throw new NE(`r_{i-1} was zero`);o=l;for(var d=i.getZero(),f=a.getCoefficient(a.getDegree()),p=i.inverse(f);o.getDegree()>=a.getDegree()&&!o.isZero();){var m=o.getDegree()-a.getDegree(),h=i.multiply(o.getCoefficient(o.getDegree()),p);d=d.addOrSubtract(i.buildMonomial(m,h)),o=o.addOrSubtract(a.multiplyByMonomial(m,h))}if(c=d.multiply(s).addOrSubtract(u),o.getDegree()>=a.getDegree())throw new FE(`Division algorithm failed to reduce polynomial?`)}var g=c.getCoefficient(0);if(g===0)throw new NE(`sigmaTilde(0) was zero`);var _=i.inverse(g);return[c.multiplyScalar(_),o.multiplyScalar(_)]},e.prototype.findErrorLocations=function(e){var t=e.getDegree();if(t===1)return Int32Array.from([e.getCoefficient(1)]);for(var n=new Int32Array(t),r=0,i=this.field,a=1;a<i.getSize()&&r<t;a++)e.evaluateAt(a)===0&&(n[r]=i.inverse(a),r++);if(r!==t)throw new NE(`Error locator degree does not match number of roots`);return n},e.prototype.findErrorMagnitudes=function(e,t){for(var n=t.length,r=new Int32Array(n),i=this.field,a=0;a<n;a++){for(var o=i.inverse(t[a]),s=1,c=0;c<n;c++)if(a!==c){var l=i.multiply(t[c],o),u=1&l?-2&l:1|l;s=i.multiply(s,u)}r[a]=i.multiply(e.evaluateAt(o),i.inverse(s)),i.getGeneratorBase()!==0&&(r[a]=i.multiply(r[a],o))}return r},e}();(function(e){e[e.UPPER=0]=`UPPER`,e[e.LOWER=1]=`LOWER`,e[e.MIXED=2]=`MIXED`,e[e.DIGIT=3]=`DIGIT`,e[e.PUNCT=4]=`PUNCT`,e[e.BINARY=5]=`BINARY`})(CE||={});var LE=function(){function e(){}return e.prototype.decode=function(t){this.ddata=t;var n=t.getBits(),r=this.extractBits(n),i=this.correctBits(r),a=new TE(e.convertBoolArrayToByteArray(i),e.getEncodedData(i),null,null);return a.setNumBits(i.length),a},e.highLevelDecode=function(e){return this.getEncodedData(e)},e.getEncodedData=function(t){for(var n=t.length,r=CE.UPPER,i=CE.UPPER,a=``,o=0;o<n;)if(i===CE.BINARY){if(n-o<5)break;var s=e.readCode(t,o,5);if(o+=5,s===0){if(n-o<11)break;s=e.readCode(t,o,11)+31,o+=11}for(var c=0;c<s;c++){if(n-o<8){o=n;break}var l=e.readCode(t,o,8);a+=rE.castAsNonUtf8Char(l),o+=8}i=r}else{var u=i===CE.DIGIT?4:5;if(n-o<u)break;l=e.readCode(t,o,u),o+=u;var d=e.getCharacter(i,l);d.startsWith(`CTRL_`)?(r=i,i=e.getTable(d.charAt(5)),d.charAt(6)===`L`&&(r=i)):(a+=d,i=r)}return a},e.getTable=function(e){switch(e){case`L`:return CE.LOWER;case`P`:return CE.PUNCT;case`M`:return CE.MIXED;case`D`:return CE.DIGIT;case`B`:return CE.BINARY;default:return CE.UPPER}},e.getCharacter=function(t,n){switch(t){case CE.UPPER:return e.UPPER_TABLE[n];case CE.LOWER:return e.LOWER_TABLE[n];case CE.MIXED:return e.MIXED_TABLE[n];case CE.PUNCT:return e.PUNCT_TABLE[n];case CE.DIGIT:return e.DIGIT_TABLE[n];default:throw new FE(`Bad table`)}},e.prototype.correctBits=function(t){var n,r;this.ddata.getNbLayers()<=2?(r=6,n=jE.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(r=8,n=jE.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(r=10,n=jE.AZTEC_DATA_10):(r=12,n=jE.AZTEC_DATA_12);var i=this.ddata.getNbDatablocks(),a=t.length/r;if(a<i)throw new J;for(var o=t.length%r,s=new Int32Array(a),c=0;c<a;c++,o+=r)s[c]=e.readCode(t,o,r);try{new IE(n).decode(s,a-i)}catch(e){throw new J(e)}var l=(1<<r)-1,u=0;for(c=0;c<i;c++){if((p=s[c])===0||p===l)throw new J;p!==1&&p!==l-1||u++}var d=Array(i*r-u),f=0;for(c=0;c<i;c++){var p;if((p=s[c])===1||p===l-1)d.fill(p>1,f,f+r-1),f+=r-1;else for(var m=r-1;m>=0;--m)d[f++]=(p&1<<m)!=0}return d},e.prototype.extractBits=function(e){var t=this.ddata.isCompact(),n=this.ddata.getNbLayers(),r=(t?11:14)+4*n,i=new Int32Array(r),a=Array(this.totalBitsInLayer(n,t));if(t)for(var o=0;o<i.length;o++)i[o]=o;else{var s=r+1+2*KT.truncDivision(KT.truncDivision(r,2)-1,15),c=r/2,l=KT.truncDivision(s,2);for(o=0;o<c;o++){var u=o+KT.truncDivision(o,15);i[c-o-1]=l-u-1,i[c+o]=l+u+1}}o=0;for(var d=0;o<n;o++){for(var f=4*(n-o)+(t?9:12),p=2*o,m=r-1-p,h=0;h<f;h++)for(var g=2*h,_=0;_<2;_++)a[d+g+_]=e.get(i[p+_],i[p+h]),a[d+2*f+g+_]=e.get(i[p+h],i[m-_]),a[d+4*f+g+_]=e.get(i[m-_],i[m-h]),a[d+6*f+g+_]=e.get(i[m-h],i[p+_]);d+=8*f}return a},e.readCode=function(e,t,n){for(var r=0,i=t;i<t+n;i++)r<<=1,e[i]&&(r|=1);return r},e.readByte=function(t,n){var r=t.length-n;return r>=8?e.readCode(t,n,8):e.readCode(t,n,r)<<8-r},e.convertBoolArrayToByteArray=function(t){for(var n=new Uint8Array((t.length+7)/8),r=0;r<n.length;r++)n[r]=e.readByte(t,8*r);return n},e.prototype.totalBitsInLayer=function(e,t){return((t?88:112)+16*e)*e},e.UPPER_TABLE=`CTRL_PS. .A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.CTRL_LL.CTRL_ML.CTRL_DL.CTRL_BS`.split(`.`),e.LOWER_TABLE=`CTRL_PS. .a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.CTRL_US.CTRL_ML.CTRL_DL.CTRL_BS`.split(`.`),e.MIXED_TABLE=`CTRL_PS. .\\1.\\2.\\3.\\4.\\5.\\6.\\7.\b. .
|
|
124
|
+
.\\13.\f.\r.\\33.\\34.\\35.\\36.\\37.@.\\.^._.\`.|.~.\\177.CTRL_LL.CTRL_UL.CTRL_PL.CTRL_BS`.split(`.`),e.PUNCT_TABLE=[``,`\r`,`\r
|
|
125
|
+
`,`. `,`, `,`: `,`!`,`"`,`#`,`$`,`%`,`&`,`'`,`(`,`)`,`*`,`+`,`,`,`-`,`.`,`/`,`:`,`;`,`<`,`=`,`>`,`?`,`[`,`]`,`{`,`}`,`CTRL_UL`],e.DIGIT_TABLE=[`CTRL_PS`,` `,`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`,`,`,`.`,`CTRL_UL`,`CTRL_US`],e}(),RE=function(){function e(){}return e.round=function(e){return e===NaN?0:e<=-(2**53-1)?-(2**53-1):e>=2**53-1?2**53-1:e+(e<0?-.5:.5)|0},e.distance=function(e,t,n,r){var i=e-n,a=t-r;return Math.sqrt(i*i+a*a)},e.sum=function(e){for(var t=0,n=0,r=e.length;n!==r;n++)t+=e[n];return t},e}(),zE=function(){function e(){}return e.floatToIntBits=function(e){return e},e.MAX_VALUE=2**53-1,e}(),Z=function(){function e(e,t){this.x=e,this.y=t}return e.prototype.getX=function(){return this.x},e.prototype.getY=function(){return this.y},e.prototype.equals=function(t){if(t instanceof e){var n=t;return this.x===n.x&&this.y===n.y}return!1},e.prototype.hashCode=function(){return 31*zE.floatToIntBits(this.x)+zE.floatToIntBits(this.y)},e.prototype.toString=function(){return`(`+this.x+`,`+this.y+`)`},e.orderBestPatterns=function(e){var t,n,r,i=this.distance(e[0],e[1]),a=this.distance(e[1],e[2]),o=this.distance(e[0],e[2]);if(a>=i&&a>=o?(n=e[0],t=e[1],r=e[2]):o>=a&&o>=i?(n=e[1],t=e[0],r=e[2]):(n=e[2],t=e[0],r=e[1]),this.crossProductZ(t,n,r)<0){var s=t;t=r,r=s}e[0]=t,e[1]=n,e[2]=r},e.distance=function(e,t){return RE.distance(e.x,e.y,t.x,t.y)},e.crossProductZ=function(e,t,n){var r=t.x,i=t.y;return(n.x-r)*(e.y-i)-(n.y-i)*(e.x-r)},e}(),BE=function(){function e(e,t){this.bits=e,this.points=t}return e.prototype.getBits=function(){return this.bits},e.prototype.getPoints=function(){return this.points},e}(),VE=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),HE=function(e){function t(t,n,r,i,a){var o=e.call(this,t,n)||this;return o.compact=r,o.nbDatablocks=i,o.nbLayers=a,o}return VE(t,e),t.prototype.getNbLayers=function(){return this.nbLayers},t.prototype.getNbDatablocks=function(){return this.nbDatablocks},t.prototype.isCompact=function(){return this.compact},t}(BE),UE=function(){function e(t,n,r,i){this.image=t,this.height=t.getHeight(),this.width=t.getWidth(),n??=e.INIT_SIZE,r??=t.getWidth()/2|0,i??=t.getHeight()/2|0;var a=n/2|0;if(this.leftInit=r-a,this.rightInit=r+a,this.upInit=i-a,this.downInit=i+a,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new Y}return e.prototype.detect=function(){for(var e=this.leftInit,t=this.rightInit,n=this.upInit,r=this.downInit,i=!1,a=!0,o=!1,s=!1,c=!1,l=!1,u=!1,d=this.width,f=this.height;a;){a=!1;for(var p=!0;(p||!s)&&t<d;)(p=this.containsBlackPoint(n,r,t,!1))?(t++,a=!0,s=!0):s||t++;if(t>=d){i=!0;break}for(var m=!0;(m||!c)&&r<f;)(m=this.containsBlackPoint(e,t,r,!0))?(r++,a=!0,c=!0):c||r++;if(r>=f){i=!0;break}for(var h=!0;(h||!l)&&e>=0;)(h=this.containsBlackPoint(n,r,e,!1))?(e--,a=!0,l=!0):l||e--;if(e<0){i=!0;break}for(var g=!0;(g||!u)&&n>=0;)(g=this.containsBlackPoint(e,t,n,!0))?(n--,a=!0,u=!0):u||n--;if(n<0){i=!0;break}a&&(o=!0)}if(!i&&o){for(var _=t-e,v=null,y=1;v===null&&y<_;y++)v=this.getBlackPointOnSegment(e,r-y,e+y,r);if(v==null)throw new Y;var b=null;for(y=1;b===null&&y<_;y++)b=this.getBlackPointOnSegment(e,n+y,e+y,n);if(b==null)throw new Y;var x=null;for(y=1;x===null&&y<_;y++)x=this.getBlackPointOnSegment(t,n+y,t-y,n);if(x==null)throw new Y;var S=null;for(y=1;S===null&&y<_;y++)S=this.getBlackPointOnSegment(t,r-y,t-y,r);if(S==null)throw new Y;return this.centerEdges(S,v,x,b)}throw new Y},e.prototype.getBlackPointOnSegment=function(e,t,n,r){for(var i=RE.round(RE.distance(e,t,n,r)),a=(n-e)/i,o=(r-t)/i,s=this.image,c=0;c<i;c++){var l=RE.round(e+c*a),u=RE.round(t+c*o);if(s.get(l,u))return new Z(l,u)}return null},e.prototype.centerEdges=function(t,n,r,i){var a=t.getX(),o=t.getY(),s=n.getX(),c=n.getY(),l=r.getX(),u=r.getY(),d=i.getX(),f=i.getY(),p=e.CORR;return a<this.width/2?[new Z(d-p,f+p),new Z(s+p,c+p),new Z(l-p,u-p),new Z(a+p,o-p)]:[new Z(d+p,f+p),new Z(s+p,c-p),new Z(l-p,u+p),new Z(a-p,o-p)]},e.prototype.containsBlackPoint=function(e,t,n,r){var i=this.image;if(r){for(var a=e;a<=t;a++)if(i.get(a,n))return!0}else for(var o=e;o<=t;o++)if(i.get(n,o))return!0;return!1},e.INIT_SIZE=10,e.CORR=1,e}(),WE=function(){function e(){}return e.checkAndNudgePoints=function(e,t){for(var n=e.getWidth(),r=e.getHeight(),i=!0,a=0;a<t.length&&i;a+=2){var o=Math.floor(t[a]),s=Math.floor(t[a+1]);if(o<-1||o>n||s<-1||s>r)throw new Y;i=!1,o===-1?(t[a]=0,i=!0):o===n&&(t[a]=n-1,i=!0),s===-1?(t[a+1]=0,i=!0):s===r&&(t[a+1]=r-1,i=!0)}for(i=!0,a=t.length-2;a>=0&&i;a-=2){if(o=Math.floor(t[a]),s=Math.floor(t[a+1]),o<-1||o>n||s<-1||s>r)throw new Y;i=!1,o===-1?(t[a]=0,i=!0):o===n&&(t[a]=n-1,i=!0),s===-1?(t[a+1]=0,i=!0):s===r&&(t[a+1]=r-1,i=!0)}},e}(),GE=function(){function e(e,t,n,r,i,a,o,s,c){this.a11=e,this.a21=t,this.a31=n,this.a12=r,this.a22=i,this.a32=a,this.a13=o,this.a23=s,this.a33=c}return e.quadrilateralToQuadrilateral=function(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g){var _=e.quadrilateralToSquare(t,n,r,i,a,o,s,c);return e.squareToQuadrilateral(l,u,d,f,p,m,h,g).times(_)},e.prototype.transformPoints=function(e){for(var t=e.length,n=this.a11,r=this.a12,i=this.a13,a=this.a21,o=this.a22,s=this.a23,c=this.a31,l=this.a32,u=this.a33,d=0;d<t;d+=2){var f=e[d],p=e[d+1],m=i*f+s*p+u;e[d]=(n*f+a*p+c)/m,e[d+1]=(r*f+o*p+l)/m}},e.prototype.transformPointsWithValues=function(e,t){for(var n=this.a11,r=this.a12,i=this.a13,a=this.a21,o=this.a22,s=this.a23,c=this.a31,l=this.a32,u=this.a33,d=e.length,f=0;f<d;f++){var p=e[f],m=t[f],h=i*p+s*m+u;e[f]=(n*p+a*m+c)/h,t[f]=(r*p+o*m+l)/h}},e.squareToQuadrilateral=function(t,n,r,i,a,o,s,c){var l=t-r+a-s,u=n-i+o-c;if(l===0&&u===0)return new e(r-t,a-r,t,i-n,o-i,n,0,0,1);var d=r-a,f=s-a,p=i-o,m=c-o,h=d*m-f*p,g=(l*m-f*u)/h,_=(d*u-l*p)/h;return new e(r-t+g*r,s-t+_*s,t,i-n+g*i,c-n+_*c,n,g,_,1)},e.quadrilateralToSquare=function(t,n,r,i,a,o,s,c){return e.squareToQuadrilateral(t,n,r,i,a,o,s,c).buildAdjoint()},e.prototype.buildAdjoint=function(){return new e(this.a22*this.a33-this.a23*this.a32,this.a23*this.a31-this.a21*this.a33,this.a21*this.a32-this.a22*this.a31,this.a13*this.a32-this.a12*this.a33,this.a11*this.a33-this.a13*this.a31,this.a12*this.a31-this.a11*this.a32,this.a12*this.a23-this.a13*this.a22,this.a13*this.a21-this.a11*this.a23,this.a11*this.a22-this.a12*this.a21)},e.prototype.times=function(t){return new e(this.a11*t.a11+this.a21*t.a12+this.a31*t.a13,this.a11*t.a21+this.a21*t.a22+this.a31*t.a23,this.a11*t.a31+this.a21*t.a32+this.a31*t.a33,this.a12*t.a11+this.a22*t.a12+this.a32*t.a13,this.a12*t.a21+this.a22*t.a22+this.a32*t.a23,this.a12*t.a31+this.a22*t.a32+this.a32*t.a33,this.a13*t.a11+this.a23*t.a12+this.a33*t.a13,this.a13*t.a21+this.a23*t.a22+this.a33*t.a23,this.a13*t.a31+this.a23*t.a32+this.a33*t.a33)},e}(),KE=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),qE=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return KE(t,e),t.prototype.sampleGrid=function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){var y=GE.quadrilateralToQuadrilateral(r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v);return this.sampleGridWithTransform(e,t,n,y)},t.prototype.sampleGridWithTransform=function(e,t,n,r){if(t<=0||n<=0)throw new Y;for(var i=new aE(t,n),a=new Float32Array(2*t),o=0;o<n;o++){for(var s=a.length,c=o+.5,l=0;l<s;l+=2)a[l]=l/2+.5,a[l+1]=c;r.transformPoints(a),WE.checkAndNudgePoints(e,a);try{for(l=0;l<s;l+=2)e.get(Math.floor(a[l]),Math.floor(a[l+1]))&&i.set(l/2,o)}catch{throw new Y}}return i},t}(WE),JE=function(){function e(){}return e.setGridSampler=function(t){e.gridSampler=t},e.getInstance=function(){return e.gridSampler},e.gridSampler=new qE,e}(),YE=function(){function e(e,t){this.x=e,this.y=t}return e.prototype.toResultPoint=function(){return new Z(this.getX(),this.getY())},e.prototype.getX=function(){return this.x},e.prototype.getY=function(){return this.y},e}(),XE=function(){function e(e){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]),this.image=e}return e.prototype.detect=function(){return this.detectMirror(!1)},e.prototype.detectMirror=function(e){var t=this.getMatrixCenter(),n=this.getBullsEyeCorners(t);if(e){var r=n[0];n[0]=n[2],n[2]=r}return this.extractParameters(n),new HE(this.sampleGrid(this.image,n[this.shift%4],n[(this.shift+1)%4],n[(this.shift+2)%4],n[(this.shift+3)%4]),this.getMatrixCornerPoints(n),this.compact,this.nbDataBlocks,this.nbLayers)},e.prototype.extractParameters=function(e){if(!(this.isValidPoint(e[0])&&this.isValidPoint(e[1])&&this.isValidPoint(e[2])&&this.isValidPoint(e[3])))throw new Y;var t=2*this.nbCenterLayers,n=new Int32Array([this.sampleLine(e[0],e[1],t),this.sampleLine(e[1],e[2],t),this.sampleLine(e[2],e[3],t),this.sampleLine(e[3],e[0],t)]);this.shift=this.getRotation(n,t);for(var r=0,i=0;i<4;i++){var a=n[(this.shift+i)%4];this.compact?(r<<=7,r+=a>>1&127):(r<<=10,r+=(a>>2&992)+(a>>1&31))}var o=this.getCorrectedParameterData(r,this.compact);this.compact?(this.nbLayers=1+(o>>6),this.nbDataBlocks=1+(63&o)):(this.nbLayers=1+(o>>11),this.nbDataBlocks=1+(2047&o))},e.prototype.getRotation=function(e,t){var n=0;e.forEach((function(e,r,i){n=(n<<3)+((e>>t-2<<1)+(1&e))})),n=((1&n)<<11)+(n>>1);for(var r=0;r<4;r++)if(KT.bitCount(n^this.EXPECTED_CORNER_BITS[r])<=2)return r;throw new Y},e.prototype.getCorrectedParameterData=function(e,t){var n,r;t?(n=7,r=2):(n=10,r=4);for(var i=n-r,a=new Int32Array(n),o=n-1;o>=0;--o)a[o]=15&e,e>>=4;try{new IE(jE.AZTEC_PARAM).decode(a,i)}catch{throw new Y}var s=0;for(o=0;o<r;o++)s=(s<<4)+a[o];return s},e.prototype.getBullsEyeCorners=function(e){var t=e,n=e,r=e,i=e,a=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){var o=this.getFirstDifferent(t,a,1,-1),s=this.getFirstDifferent(n,a,1,1),c=this.getFirstDifferent(r,a,-1,1),l=this.getFirstDifferent(i,a,-1,-1);if(this.nbCenterLayers>2){var u=this.distancePoint(l,o)*this.nbCenterLayers/(this.distancePoint(i,t)*(this.nbCenterLayers+2));if(u<.75||u>1.25||!this.isWhiteOrBlackRectangle(o,s,c,l))break}t=o,n=s,r=c,i=l,a=!a}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new Y;this.compact=this.nbCenterLayers===5;var d=new Z(t.getX()+.5,t.getY()-.5),f=new Z(n.getX()+.5,n.getY()+.5),p=new Z(r.getX()-.5,r.getY()+.5),m=new Z(i.getX()-.5,i.getY()-.5);return this.expandSquare([d,f,p,m],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},e.prototype.getMatrixCenter=function(){var e,t,n,r;try{e=(c=new UE(this.image).detect())[0],t=c[1],n=c[2],r=c[3]}catch{var i=this.image.getWidth()/2,a=this.image.getHeight()/2;e=this.getFirstDifferent(new YE(i+7,a-7),!1,1,-1).toResultPoint(),t=this.getFirstDifferent(new YE(i+7,a+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new YE(i-7,a+7),!1,-1,1).toResultPoint(),r=this.getFirstDifferent(new YE(i-7,a-7),!1,-1,-1).toResultPoint()}var o=RE.round((e.getX()+r.getX()+t.getX()+n.getX())/4),s=RE.round((e.getY()+r.getY()+t.getY()+n.getY())/4);try{var c;e=(c=new UE(this.image,15,o,s).detect())[0],t=c[1],n=c[2],r=c[3]}catch{e=this.getFirstDifferent(new YE(o+7,s-7),!1,1,-1).toResultPoint(),t=this.getFirstDifferent(new YE(o+7,s+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new YE(o-7,s+7),!1,-1,1).toResultPoint(),r=this.getFirstDifferent(new YE(o-7,s-7),!1,-1,-1).toResultPoint()}return o=RE.round((e.getX()+r.getX()+t.getX()+n.getX())/4),s=RE.round((e.getY()+r.getY()+t.getY()+n.getY())/4),new YE(o,s)},e.prototype.getMatrixCornerPoints=function(e){return this.expandSquare(e,2*this.nbCenterLayers,this.getDimension())},e.prototype.sampleGrid=function(e,t,n,r,i){var a=JE.getInstance(),o=this.getDimension(),s=o/2-this.nbCenterLayers,c=o/2+this.nbCenterLayers;return a.sampleGrid(e,o,o,s,s,c,s,c,c,s,c,t.getX(),t.getY(),n.getX(),n.getY(),r.getX(),r.getY(),i.getX(),i.getY())},e.prototype.sampleLine=function(e,t,n){for(var r=0,i=this.distanceResultPoint(e,t),a=i/n,o=e.getX(),s=e.getY(),c=a*(t.getX()-e.getX())/i,l=a*(t.getY()-e.getY())/i,u=0;u<n;u++)this.image.get(RE.round(o+u*c),RE.round(s+u*l))&&(r|=1<<n-u-1);return r},e.prototype.isWhiteOrBlackRectangle=function(e,t,n,r){e=new YE(e.getX()-3,e.getY()+3),t=new YE(t.getX()-3,t.getY()-3),n=new YE(n.getX()+3,n.getY()-3),r=new YE(r.getX()+3,r.getY()+3);var i=this.getColor(r,e);if(i===0)return!1;var a=this.getColor(e,t);return a===i&&(a=this.getColor(t,n))===i&&(a=this.getColor(n,r))===i},e.prototype.getColor=function(e,t){for(var n=this.distancePoint(e,t),r=(t.getX()-e.getX())/n,i=(t.getY()-e.getY())/n,a=0,o=e.getX(),s=e.getY(),c=this.image.get(e.getX(),e.getY()),l=Math.ceil(n),u=0;u<l;u++)o+=r,s+=i,this.image.get(RE.round(o),RE.round(s))!==c&&a++;var d=a/n;return d>.1&&d<.9?0:d<=.1===c?1:-1},e.prototype.getFirstDifferent=function(e,t,n,r){for(var i=e.getX()+n,a=e.getY()+r;this.isValid(i,a)&&this.image.get(i,a)===t;)i+=n,a+=r;for(i-=n,a-=r;this.isValid(i,a)&&this.image.get(i,a)===t;)i+=n;for(i-=n;this.isValid(i,a)&&this.image.get(i,a)===t;)a+=r;return new YE(i,a-=r)},e.prototype.expandSquare=function(e,t,n){var r=n/(2*t),i=e[0].getX()-e[2].getX(),a=e[0].getY()-e[2].getY(),o=(e[0].getX()+e[2].getX())/2,s=(e[0].getY()+e[2].getY())/2,c=new Z(o+r*i,s+r*a),l=new Z(o-r*i,s-r*a);return i=e[1].getX()-e[3].getX(),a=e[1].getY()-e[3].getY(),o=(e[1].getX()+e[3].getX())/2,s=(e[1].getY()+e[3].getY())/2,[c,new Z(o+r*i,s+r*a),l,new Z(o-r*i,s-r*a)]},e.prototype.isValid=function(e,t){return e>=0&&e<this.image.getWidth()&&t>0&&t<this.image.getHeight()},e.prototype.isValidPoint=function(e){var t=RE.round(e.getX()),n=RE.round(e.getY());return this.isValid(t,n)},e.prototype.distancePoint=function(e,t){return RE.distance(e.getX(),e.getY(),t.getX(),t.getY())},e.prototype.distanceResultPoint=function(e,t){return RE.distance(e.getX(),e.getY(),t.getX(),t.getY())},e.prototype.getDimension=function(){return this.compact?4*this.nbLayers+11:this.nbLayers<=4?4*this.nbLayers+15:4*this.nbLayers+2*(KT.truncDivision(this.nbLayers-4,8)+1)+15},e}(),ZE=function(){function e(){}return e.prototype.decode=function(e,t){t===void 0&&(t=null);var n=null,r=new XE(e.getBlackMatrix()),i=null,a=null;try{i=(o=r.detectMirror(!1)).getPoints(),this.reportFoundResultPoints(t,i),a=new LE().decode(o)}catch(e){n=e}if(a==null)try{var o;i=(o=r.detectMirror(!0)).getPoints(),this.reportFoundResultPoints(t,i),a=new LE().decode(o)}catch(e){throw n??e}var s=new xE(a.getText(),a.getRawBytes(),a.getNumBits(),i,X.AZTEC,zT.currentTimeMillis()),c=a.getByteSegments();c!=null&&s.putMetadata(wE.BYTE_SEGMENTS,c);var l=a.getECLevel();return l!=null&&s.putMetadata(wE.ERROR_CORRECTION_LEVEL,l),s},e.prototype.reportFoundResultPoints=function(e,t){if(e!=null){var n=e.get(YT.NEED_RESULT_POINT_CALLBACK);n!=null&&t.forEach((function(e,t,r){n.foundPossibleResultPoint(e)}))}},e.prototype.reset=function(){},e}(),QE=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(t){return t===void 0&&(t=500),e.call(this,new ZE,t)||this}QE(t,e)})(bE);var $E=function(){function e(){}return e.prototype.decode=function(e,t){try{return this.doDecode(e,t)}catch{if(t&&!0===t.get(YT.TRY_HARDER)&&e.isRotateSupported()){var n=e.rotateCounterClockwise(),r=this.doDecode(n,t),i=r.getResultMetadata(),a=270;i!==null&&!0===i.get(wE.ORIENTATION)&&(a+=i.get(wE.ORIENTATION)%360),r.putMetadata(wE.ORIENTATION,a);var o=r.getResultPoints();if(o!==null)for(var s=n.getHeight(),c=0;c<o.length;c++)o[c]=new Z(s-o[c].getY()-1,o[c].getX());return r}throw new Y}},e.prototype.reset=function(){},e.prototype.doDecode=function(e,t){var n,r=e.getWidth(),i=e.getHeight(),a=new qT(r),o=t&&!0===t.get(YT.TRY_HARDER),s=Math.max(1,i>>(o?8:5));n=o?i:15;for(var c=Math.trunc(i/2),l=0;l<n;l++){var u=Math.trunc((l+1)/2),d=c+s*(1&l?-u:u);if(d<0||d>=i)break;try{a=e.getBlackRow(d,a)}catch{continue}for(var f=function(e){if(e===1&&(a.reverse(),t&&!0===t.get(YT.NEED_RESULT_POINT_CALLBACK))){var n=new Map;t.forEach((function(e,t){return n.set(t,e)})),n.delete(YT.NEED_RESULT_POINT_CALLBACK),t=n}try{var i=p.decodeRow(d,a,t);if(e===1){i.putMetadata(wE.ORIENTATION,180);var o=i.getResultPoints();o!==null&&(o[0]=new Z(r-o[0].getX()-1,o[0].getY()),o[1]=new Z(r-o[1].getX()-1,o[1].getY()))}return{value:i}}catch{}},p=this,m=0;m<2;m++){var h=f(m);if(typeof h==`object`)return h.value}}throw new Y},e.recordPattern=function(e,t,n){for(var r=n.length,i=0;i<r;i++)n[i]=0;var a=e.getSize();if(t>=a)throw new Y;for(var o=!e.get(t),s=0,c=t;c<a;){if(e.get(c)!==o)n[s]++;else{if(++s===r)break;n[s]=1,o=!o}c++}if(s!==r&&(s!==r-1||c!==a))throw new Y},e.recordPatternInReverse=function(t,n,r){for(var i=r.length,a=t.get(n);n>0&&i>=0;)t.get(--n)!==a&&(i--,a=!a);if(i>=0)throw new Y;e.recordPattern(t,n+1,r)},e.patternMatchVariance=function(e,t,n){for(var r=e.length,i=0,a=0,o=0;o<r;o++)i+=e[o],a+=t[o];if(i<a)return 1/0;var s=i/a;n*=s;for(var c=0,l=0;l<r;l++){var u=e[l],d=t[l]*s,f=u>d?u-d:d-u;if(f>n)return 1/0;c+=f}return c/i},e}(),eD=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),tD=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return eD(t,e),t.findStartPattern=function(e){for(var n=e.getSize(),r=e.getNextSet(0),i=0,a=Int32Array.from([0,0,0,0,0,0]),o=r,s=!1,c=r;c<n;c++)if(e.get(c)!==s)a[i]++;else{if(i===5){for(var l=t.MAX_AVG_VARIANCE,u=-1,d=t.CODE_START_A;d<=t.CODE_START_C;d++){var f=$E.patternMatchVariance(a,t.CODE_PATTERNS[d],t.MAX_INDIVIDUAL_VARIANCE);f<l&&(l=f,u=d)}if(u>=0&&e.isRange(Math.max(0,o-(c-o)/2),o,!1))return Int32Array.from([o,c,u]);o+=a[0]+a[1],(a=a.slice(2,a.length-1))[i-1]=0,a[i]=0,i--}else i++;a[i]=1,s=!s}throw new Y},t.decodeCode=function(e,n,r){$E.recordPattern(e,r,n);for(var i=t.MAX_AVG_VARIANCE,a=-1,o=0;o<t.CODE_PATTERNS.length;o++){var s=t.CODE_PATTERNS[o],c=this.patternMatchVariance(n,s,t.MAX_INDIVIDUAL_VARIANCE);c<i&&(i=c,a=o)}if(a>=0)return a;throw new Y},t.prototype.decodeRow=function(e,n,r){var i,a=r&&!0===r.get(YT.ASSUME_GS1),o=t.findStartPattern(n),s=o[2],c=0,l=new Uint8Array(20);switch(l[c++]=s,s){case t.CODE_START_A:i=t.CODE_CODE_A;break;case t.CODE_START_B:i=t.CODE_CODE_B;break;case t.CODE_START_C:i=t.CODE_CODE_C;break;default:throw new J}for(var u=!1,d=!1,f=``,p=o[0],m=o[1],h=Int32Array.from([0,0,0,0,0,0]),g=0,_=0,v=s,y=0,b=!0,x=!1,S=!1;!u;){var C=d;switch(d=!1,g=_,_=t.decodeCode(n,h,m),l[c++]=_,_!==t.CODE_STOP&&(b=!0),_!==t.CODE_STOP&&(v+=++y*_),p=m,m+=h.reduce((function(e,t){return e+t}),0),_){case t.CODE_START_A:case t.CODE_START_B:case t.CODE_START_C:throw new J}switch(i){case t.CODE_CODE_A:if(_<64)f+=S===x?String.fromCharCode(32+_):String.fromCharCode(32+_+128),S=!1;else if(_<96)f+=S===x?String.fromCharCode(_-64):String.fromCharCode(_+64),S=!1;else switch(_!==t.CODE_STOP&&(b=!1),_){case t.CODE_FNC_1:a&&(f.length===0?f+=`]C1`:f+=``);break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_A:!x&&S?(x=!0,S=!1):x&&S?(x=!1,S=!1):S=!0;break;case t.CODE_SHIFT:d=!0,i=t.CODE_CODE_B;break;case t.CODE_CODE_B:i=t.CODE_CODE_B;break;case t.CODE_CODE_C:i=t.CODE_CODE_C;break;case t.CODE_STOP:u=!0}break;case t.CODE_CODE_B:if(_<96)f+=S===x?String.fromCharCode(32+_):String.fromCharCode(32+_+128),S=!1;else switch(_!==t.CODE_STOP&&(b=!1),_){case t.CODE_FNC_1:a&&(f.length===0?f+=`]C1`:f+=``);break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_B:!x&&S?(x=!0,S=!1):x&&S?(x=!1,S=!1):S=!0;break;case t.CODE_SHIFT:d=!0,i=t.CODE_CODE_A;break;case t.CODE_CODE_A:i=t.CODE_CODE_A;break;case t.CODE_CODE_C:i=t.CODE_CODE_C;break;case t.CODE_STOP:u=!0}break;case t.CODE_CODE_C:if(_<100)_<10&&(f+=`0`),f+=_;else switch(_!==t.CODE_STOP&&(b=!1),_){case t.CODE_FNC_1:a&&(f.length===0?f+=`]C1`:f+=``);break;case t.CODE_CODE_A:i=t.CODE_CODE_A;break;case t.CODE_CODE_B:i=t.CODE_CODE_B;break;case t.CODE_STOP:u=!0}}C&&(i=i===t.CODE_CODE_A?t.CODE_CODE_B:t.CODE_CODE_A)}var w=m-p;if(m=n.getNextUnset(m),!n.isRange(m,Math.min(n.getSize(),m+(m-p)/2),!1))throw new Y;if((v-=y*g)%103!==g)throw new LT;var T=f.length;if(T===0)throw new Y;T>0&&b&&(f=i===t.CODE_CODE_C?f.substring(0,T-2):f.substring(0,T-1));for(var E=(o[1]+o[0])/2,D=p+w/2,O=l.length,k=new Uint8Array(O),A=0;A<O;A++)k[A]=l[A];var j=[new Z(E,e),new Z(D,e)];return new xE(f,k,0,j,X.CODE_128,new Date().getTime())},t.CODE_PATTERNS=[Int32Array.from([2,1,2,2,2,2]),Int32Array.from([2,2,2,1,2,2]),Int32Array.from([2,2,2,2,2,1]),Int32Array.from([1,2,1,2,2,3]),Int32Array.from([1,2,1,3,2,2]),Int32Array.from([1,3,1,2,2,2]),Int32Array.from([1,2,2,2,1,3]),Int32Array.from([1,2,2,3,1,2]),Int32Array.from([1,3,2,2,1,2]),Int32Array.from([2,2,1,2,1,3]),Int32Array.from([2,2,1,3,1,2]),Int32Array.from([2,3,1,2,1,2]),Int32Array.from([1,1,2,2,3,2]),Int32Array.from([1,2,2,1,3,2]),Int32Array.from([1,2,2,2,3,1]),Int32Array.from([1,1,3,2,2,2]),Int32Array.from([1,2,3,1,2,2]),Int32Array.from([1,2,3,2,2,1]),Int32Array.from([2,2,3,2,1,1]),Int32Array.from([2,2,1,1,3,2]),Int32Array.from([2,2,1,2,3,1]),Int32Array.from([2,1,3,2,1,2]),Int32Array.from([2,2,3,1,1,2]),Int32Array.from([3,1,2,1,3,1]),Int32Array.from([3,1,1,2,2,2]),Int32Array.from([3,2,1,1,2,2]),Int32Array.from([3,2,1,2,2,1]),Int32Array.from([3,1,2,2,1,2]),Int32Array.from([3,2,2,1,1,2]),Int32Array.from([3,2,2,2,1,1]),Int32Array.from([2,1,2,1,2,3]),Int32Array.from([2,1,2,3,2,1]),Int32Array.from([2,3,2,1,2,1]),Int32Array.from([1,1,1,3,2,3]),Int32Array.from([1,3,1,1,2,3]),Int32Array.from([1,3,1,3,2,1]),Int32Array.from([1,1,2,3,1,3]),Int32Array.from([1,3,2,1,1,3]),Int32Array.from([1,3,2,3,1,1]),Int32Array.from([2,1,1,3,1,3]),Int32Array.from([2,3,1,1,1,3]),Int32Array.from([2,3,1,3,1,1]),Int32Array.from([1,1,2,1,3,3]),Int32Array.from([1,1,2,3,3,1]),Int32Array.from([1,3,2,1,3,1]),Int32Array.from([1,1,3,1,2,3]),Int32Array.from([1,1,3,3,2,1]),Int32Array.from([1,3,3,1,2,1]),Int32Array.from([3,1,3,1,2,1]),Int32Array.from([2,1,1,3,3,1]),Int32Array.from([2,3,1,1,3,1]),Int32Array.from([2,1,3,1,1,3]),Int32Array.from([2,1,3,3,1,1]),Int32Array.from([2,1,3,1,3,1]),Int32Array.from([3,1,1,1,2,3]),Int32Array.from([3,1,1,3,2,1]),Int32Array.from([3,3,1,1,2,1]),Int32Array.from([3,1,2,1,1,3]),Int32Array.from([3,1,2,3,1,1]),Int32Array.from([3,3,2,1,1,1]),Int32Array.from([3,1,4,1,1,1]),Int32Array.from([2,2,1,4,1,1]),Int32Array.from([4,3,1,1,1,1]),Int32Array.from([1,1,1,2,2,4]),Int32Array.from([1,1,1,4,2,2]),Int32Array.from([1,2,1,1,2,4]),Int32Array.from([1,2,1,4,2,1]),Int32Array.from([1,4,1,1,2,2]),Int32Array.from([1,4,1,2,2,1]),Int32Array.from([1,1,2,2,1,4]),Int32Array.from([1,1,2,4,1,2]),Int32Array.from([1,2,2,1,1,4]),Int32Array.from([1,2,2,4,1,1]),Int32Array.from([1,4,2,1,1,2]),Int32Array.from([1,4,2,2,1,1]),Int32Array.from([2,4,1,2,1,1]),Int32Array.from([2,2,1,1,1,4]),Int32Array.from([4,1,3,1,1,1]),Int32Array.from([2,4,1,1,1,2]),Int32Array.from([1,3,4,1,1,1]),Int32Array.from([1,1,1,2,4,2]),Int32Array.from([1,2,1,1,4,2]),Int32Array.from([1,2,1,2,4,1]),Int32Array.from([1,1,4,2,1,2]),Int32Array.from([1,2,4,1,1,2]),Int32Array.from([1,2,4,2,1,1]),Int32Array.from([4,1,1,2,1,2]),Int32Array.from([4,2,1,1,1,2]),Int32Array.from([4,2,1,2,1,1]),Int32Array.from([2,1,2,1,4,1]),Int32Array.from([2,1,4,1,2,1]),Int32Array.from([4,1,2,1,2,1]),Int32Array.from([1,1,1,1,4,3]),Int32Array.from([1,1,1,3,4,1]),Int32Array.from([1,3,1,1,4,1]),Int32Array.from([1,1,4,1,1,3]),Int32Array.from([1,1,4,3,1,1]),Int32Array.from([4,1,1,1,1,3]),Int32Array.from([4,1,1,3,1,1]),Int32Array.from([1,1,3,1,4,1]),Int32Array.from([1,1,4,1,3,1]),Int32Array.from([3,1,1,1,4,1]),Int32Array.from([4,1,1,1,3,1]),Int32Array.from([2,1,1,4,1,2]),Int32Array.from([2,1,1,2,1,4]),Int32Array.from([2,1,1,2,3,2]),Int32Array.from([2,3,3,1,1,1,2])],t.MAX_AVG_VARIANCE=.25,t.MAX_INDIVIDUAL_VARIANCE=.7,t.CODE_SHIFT=98,t.CODE_CODE_C=99,t.CODE_CODE_B=100,t.CODE_CODE_A=101,t.CODE_FNC_1=102,t.CODE_FNC_2=97,t.CODE_FNC_3=96,t.CODE_FNC_4_A=101,t.CODE_FNC_4_B=100,t.CODE_START_A=103,t.CODE_START_B=104,t.CODE_START_C=105,t.CODE_STOP=106,t}($E),nD=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),rD=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},iD=function(e){function t(t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.call(this)||this;return r.usingCheckDigit=t,r.extendedMode=n,r.decodeRowResult=``,r.counters=new Int32Array(9),r}return nD(t,e),t.prototype.decodeRow=function(e,n,r){var i,a,o,s,c=this.counters;c.fill(0),this.decodeRowResult=``;var l,u,d=t.findAsteriskPattern(n,c),f=n.getNextSet(d[1]),p=n.getSize();do{t.recordPattern(n,f,c);var m=t.toNarrowWidePattern(c);if(m<0)throw new Y;l=t.patternToChar(m),this.decodeRowResult+=l,u=f;try{for(var h=(i=void 0,rD(c)),g=h.next();!g.done;g=h.next())f+=g.value}catch(e){i={error:e}}finally{try{g&&!g.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}f=n.getNextSet(f)}while(l!==`*`);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var _,v=0;try{for(var y=rD(c),b=y.next();!b.done;b=y.next())v+=b.value}catch(e){o={error:e}}finally{try{b&&!b.done&&(s=y.return)&&s.call(y)}finally{if(o)throw o.error}}if(f!==p&&2*(f-u-v)<v)throw new Y;if(this.usingCheckDigit){for(var x=this.decodeRowResult.length-1,S=0,C=0;C<x;C++)S+=t.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(C));if(this.decodeRowResult.charAt(x)!==t.ALPHABET_STRING.charAt(S%43))throw new LT;this.decodeRowResult=this.decodeRowResult.substring(0,x)}if(this.decodeRowResult.length===0)throw new Y;_=this.extendedMode?t.decodeExtended(this.decodeRowResult):this.decodeRowResult;var w=(d[1]+d[0])/2,T=u+v/2;return new xE(_,null,0,[new Z(w,e),new Z(T,e)],X.CODE_39,new Date().getTime())},t.findAsteriskPattern=function(e,n){for(var r=e.getSize(),i=e.getNextSet(0),a=0,o=i,s=!1,c=n.length,l=i;l<r;l++)if(e.get(l)!==s)n[a]++;else{if(a===c-1){if(this.toNarrowWidePattern(n)===t.ASTERISK_ENCODING&&e.isRange(Math.max(0,o-Math.floor((l-o)/2)),o,!1))return[o,l];o+=n[0]+n[1],n.copyWithin(0,2,2+a-1),n[a-1]=0,n[a]=0,a--}else a++;n[a]=1,s=!s}throw new Y},t.toNarrowWidePattern=function(e){var t,n,r,i=e.length,a=0;do{var o=2147483647;try{for(var s=(t=void 0,rD(e)),c=s.next();!c.done;c=s.next())(f=c.value)<o&&f>a&&(o=f)}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}a=o,r=0;for(var l=0,u=0,d=0;d<i;d++)(f=e[d])>a&&(u|=1<<i-1-d,r++,l+=f);if(r===3){for(d=0;d<i&&r>0;d++){var f;if((f=e[d])>a&&(r--,2*f>=l))return-1}return u}}while(r>3);return-1},t.patternToChar=function(e){for(var n=0;n<t.CHARACTER_ENCODINGS.length;n++)if(t.CHARACTER_ENCODINGS[n]===e)return t.ALPHABET_STRING.charAt(n);if(e===t.ASTERISK_ENCODING)return`*`;throw new Y},t.decodeExtended=function(e){for(var t=e.length,n=``,r=0;r<t;r++){var i=e.charAt(r);if(i===`+`||i===`$`||i===`%`||i===`/`){var a=e.charAt(r+1),o=`\0`;switch(i){case`+`:if(!(a>=`A`&&a<=`Z`))throw new J;o=String.fromCharCode(a.charCodeAt(0)+32);break;case`$`:if(!(a>=`A`&&a<=`Z`))throw new J;o=String.fromCharCode(a.charCodeAt(0)-64);break;case`%`:if(a>=`A`&&a<=`E`)o=String.fromCharCode(a.charCodeAt(0)-38);else if(a>=`F`&&a<=`J`)o=String.fromCharCode(a.charCodeAt(0)-11);else if(a>=`K`&&a<=`O`)o=String.fromCharCode(a.charCodeAt(0)+16);else if(a>=`P`&&a<=`T`)o=String.fromCharCode(a.charCodeAt(0)+43);else if(a===`U`)o=`\0`;else if(a===`V`)o=`@`;else if(a===`W`)o="`";else{if(a!==`X`&&a!==`Y`&&a!==`Z`)throw new J;o=``}break;case`/`:if(a>=`A`&&a<=`O`)o=String.fromCharCode(a.charCodeAt(0)-32);else{if(a!==`Z`)throw new J;o=`:`}}n+=o,r++}else n+=i}return n},t.ALPHABET_STRING=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%`,t.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],t.ASTERISK_ENCODING=148,t}($E),aD=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),oD=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},sD=function(e){function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.narrowLineWidth=-1,t}return aD(t,e),t.prototype.decodeRow=function(e,n,r){var i,a,o=this.decodeStart(n),s=this.decodeEnd(n),c=new iE;t.decodeMiddle(n,o[1],s[0],c);var l=c.toString(),u=null;r!=null&&(u=r.get(YT.ALLOWED_LENGTHS)),u??=t.DEFAULT_ALLOWED_LENGTHS;var d=l.length,f=!1,p=0;try{for(var m=oD(u),h=m.next();!h.done;h=m.next()){var g=h.value;if(d===g){f=!0;break}g>p&&(p=g)}}catch(e){i={error:e}}finally{try{h&&!h.done&&(a=m.return)&&a.call(m)}finally{if(i)throw i.error}}if(!f&&d>p&&(f=!0),!f)throw new J;return new xE(l,null,0,[new Z(o[1],e),new Z(s[0],e)],X.ITF,new Date().getTime())},t.decodeMiddle=function(e,n,r,i){var a=new Int32Array(10),o=new Int32Array(5),s=new Int32Array(5);for(a.fill(0),o.fill(0),s.fill(0);n<r;){$E.recordPattern(e,n,a);for(var c=0;c<5;c++){var l=2*c;o[c]=a[l],s[c]=a[l+1]}var u=t.decodeDigit(o);i.append(u.toString()),u=this.decodeDigit(s),i.append(u.toString()),a.forEach((function(e){n+=e}))}},t.prototype.decodeStart=function(e){var n=t.skipWhiteSpace(e),r=t.findGuardPattern(e,n,t.START_PATTERN);return this.narrowLineWidth=(r[1]-r[0])/4,this.validateQuietZone(e,r[0]),r},t.prototype.validateQuietZone=function(e,t){var n=10*this.narrowLineWidth;n=n<t?n:t;for(var r=t-1;n>0&&r>=0&&!e.get(r);r--)n--;if(n!==0)throw new Y},t.skipWhiteSpace=function(e){var t=e.getSize(),n=e.getNextSet(0);if(n===t)throw new Y;return n},t.prototype.decodeEnd=function(e){e.reverse();try{var n=t.skipWhiteSpace(e),r=void 0;try{r=t.findGuardPattern(e,n,t.END_PATTERN_REVERSED[0])}catch(i){i instanceof Y&&(r=t.findGuardPattern(e,n,t.END_PATTERN_REVERSED[1]))}this.validateQuietZone(e,r[0]);var i=r[0];return r[0]=e.getSize()-r[1],r[1]=e.getSize()-i,r}finally{e.reverse()}},t.findGuardPattern=function(e,n,r){var i=r.length,a=new Int32Array(i),o=e.getSize(),s=!1,c=0,l=n;a.fill(0);for(var u=n;u<o;u++)if(e.get(u)!==s)a[c]++;else{if(c===i-1){if($E.patternMatchVariance(a,r,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return[l,u];l+=a[0]+a[1],zT.arraycopy(a,2,a,0,c-1),a[c-1]=0,a[c]=0,c--}else c++;a[c]=1,s=!s}throw new Y},t.decodeDigit=function(e){for(var n=t.MAX_AVG_VARIANCE,r=-1,i=t.PATTERNS.length,a=0;a<i;a++){var o=t.PATTERNS[a],s=$E.patternMatchVariance(e,o,t.MAX_INDIVIDUAL_VARIANCE);s<n?(n=s,r=a):s===n&&(r=-1)}if(r>=0)return r%10;throw new Y},t.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],t.MAX_AVG_VARIANCE=.38,t.MAX_INDIVIDUAL_VARIANCE=.5,t.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],t.START_PATTERN=Int32Array.from([1,1,1,1]),t.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])],t}($E),cD=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),lD=function(e){function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.decodeRowStringBuffer=``,t}return cD(t,e),t.findStartGuardPattern=function(e){for(var n,r=!1,i=0,a=Int32Array.from([0,0,0]);!r;){a=Int32Array.from([0,0,0]);var o=(n=t.findGuardPattern(e,i,!1,this.START_END_PATTERN,a))[0],s=o-((i=n[1])-o);s>=0&&(r=e.isRange(s,o,!1))}return n},t.checkChecksum=function(e){return t.checkStandardUPCEANChecksum(e)},t.checkStandardUPCEANChecksum=function(e){var n=e.length;if(n===0)return!1;var r=parseInt(e.charAt(n-1),10);return t.getStandardUPCEANChecksum(e.substring(0,n-1))===r},t.getStandardUPCEANChecksum=function(e){for(var t=e.length,n=0,r=t-1;r>=0;r-=2){if((i=e.charAt(r).charCodeAt(0)-48)<0||i>9)throw new J;n+=i}for(n*=3,r=t-2;r>=0;r-=2){var i;if((i=e.charAt(r).charCodeAt(0)-48)<0||i>9)throw new J;n+=i}return(1e3-n)%10},t.decodeEnd=function(e,n){return t.findGuardPattern(e,n,!1,t.START_END_PATTERN,new Int32Array(t.START_END_PATTERN.length).fill(0))},t.findGuardPatternWithoutCounters=function(e,t,n,r){return this.findGuardPattern(e,t,n,r,new Int32Array(r.length))},t.findGuardPattern=function(e,n,r,i,a){for(var o=e.getSize(),s=0,c=n=r?e.getNextUnset(n):e.getNextSet(n),l=i.length,u=r,d=n;d<o;d++)if(e.get(d)!==u)a[s]++;else{if(s===l-1){if($E.patternMatchVariance(a,i,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return Int32Array.from([c,d]);c+=a[0]+a[1];for(var f=a.slice(2,a.length-1),p=0;p<s-1;p++)a[p]=f[p];a[s-1]=0,a[s]=0,s--}else s++;a[s]=1,u=!u}throw new Y},t.decodeDigit=function(e,n,r,i){this.recordPattern(e,r,n);for(var a=this.MAX_AVG_VARIANCE,o=-1,s=i.length,c=0;c<s;c++){var l=i[c],u=$E.patternMatchVariance(n,l,t.MAX_INDIVIDUAL_VARIANCE);u<a&&(a=u,o=c)}if(o>=0)return o;throw new Y},t.MAX_AVG_VARIANCE=.48,t.MAX_INDIVIDUAL_VARIANCE=.7,t.START_END_PATTERN=Int32Array.from([1,1,1]),t.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),t.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),t.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])],t}($E),uD=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},dD=function(){function e(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=``}return e.prototype.decodeRow=function(t,n,r){var i=this.decodeRowStringBuffer,a=this.decodeMiddle(n,r,i),o=i.toString(),s=e.parseExtensionString(o),c=new xE(o,null,0,[new Z((r[0]+r[1])/2,t),new Z(a,t)],X.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&c.putAllMetadata(s),c},e.prototype.decodeMiddle=function(t,n,r){var i,a,o=this.decodeMiddleCounters;o[0]=0,o[1]=0,o[2]=0,o[3]=0;for(var s=t.getSize(),c=n[1],l=0,u=0;u<5&&c<s;u++){var d=lD.decodeDigit(t,o,c,lD.L_AND_G_PATTERNS);r+=String.fromCharCode(48+d%10);try{for(var f=(i=void 0,uD(o)),p=f.next();!p.done;p=f.next())c+=p.value}catch(e){i={error:e}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}d>=10&&(l|=1<<4-u),u!==4&&(c=t.getNextSet(c),c=t.getNextUnset(c))}if(r.length!==5)throw new Y;var m=this.determineCheckDigit(l);if(e.extensionChecksum(r.toString())!==m)throw new Y;return c},e.extensionChecksum=function(e){for(var t=e.length,n=0,r=t-2;r>=0;r-=2)n+=e.charAt(r).charCodeAt(0)-48;for(n*=3,r=t-1;r>=0;r-=2)n+=e.charAt(r).charCodeAt(0)-48;return(n*=3)%10},e.prototype.determineCheckDigit=function(e){for(var t=0;t<10;t++)if(e===this.CHECK_DIGIT_ENCODINGS[t])return t;throw new Y},e.parseExtensionString=function(t){if(t.length!==5)return null;var n=e.parseExtension5String(t);return n==null?null:new Map([[wE.SUGGESTED_PRICE,n]])},e.parseExtension5String=function(e){var t;switch(e.charAt(0)){case`0`:t=`£`;break;case`5`:t=`$`;break;case`9`:switch(e){case`90000`:return null;case`99991`:return`0.00`;case`99990`:return`Used`}t=``;break;default:t=``}var n=parseInt(e.substring(1)),r=n%100;return t+(n/100).toString()+`.`+(r<10?`0`+r:r.toString())},e}(),fD=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},pD=function(){function e(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=``}return e.prototype.decodeRow=function(t,n,r){var i=this.decodeRowStringBuffer,a=this.decodeMiddle(n,r,i),o=i.toString(),s=e.parseExtensionString(o),c=new xE(o,null,0,[new Z((r[0]+r[1])/2,t),new Z(a,t)],X.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&c.putAllMetadata(s),c},e.prototype.decodeMiddle=function(e,t,n){var r,i,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var o=e.getSize(),s=t[1],c=0,l=0;l<2&&s<o;l++){var u=lD.decodeDigit(e,a,s,lD.L_AND_G_PATTERNS);n+=String.fromCharCode(48+u%10);try{for(var d=(r=void 0,fD(a)),f=d.next();!f.done;f=d.next())s+=f.value}catch(e){r={error:e}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}u>=10&&(c|=1<<1-l),l!==1&&(s=e.getNextSet(s),s=e.getNextUnset(s))}if(n.length!==2||parseInt(n.toString())%4!==c)throw new Y;return s},e.parseExtensionString=function(e){return e.length===2?new Map([[wE.ISSUE_NUMBER,parseInt(e)]]):null},e}(),mD=function(){function e(){}return e.decodeRow=function(e,t,n){var r=lD.findGuardPattern(t,n,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return new dD().decodeRow(e,t,r)}catch{return new pD().decodeRow(e,t,r)}},e.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),e}(),hD=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),gD=function(e){function t(){var n=e.call(this)||this;n.decodeRowStringBuffer=``,t.L_AND_G_PATTERNS=t.L_PATTERNS.map((function(e){return Int32Array.from(e)}));for(var r=10;r<20;r++){for(var i=t.L_PATTERNS[r-10],a=new Int32Array(i.length),o=0;o<i.length;o++)a[o]=i[i.length-o-1];t.L_AND_G_PATTERNS[r]=a}return n}return hD(t,e),t.prototype.decodeRow=function(e,n,r){var i=t.findStartGuardPattern(n),a=r==null?null:r.get(YT.NEED_RESULT_POINT_CALLBACK);if(a!=null){var o=new Z((i[0]+i[1])/2,e);a.foundPossibleResultPoint(o)}var s=this.decodeMiddle(n,i,this.decodeRowStringBuffer),c=s.rowOffset,l=s.resultString;if(a!=null){var u=new Z(c,e);a.foundPossibleResultPoint(u)}var d=t.decodeEnd(n,c);if(a!=null){var f=new Z((d[0]+d[1])/2,e);a.foundPossibleResultPoint(f)}var p=d[1],m=p+(p-d[0]);if(m>=n.getSize()||!n.isRange(p,m,!1))throw new Y;var h=l.toString();if(h.length<8)throw new J;if(!t.checkChecksum(h))throw new LT;var g=(i[1]+i[0])/2,_=(d[1]+d[0])/2,v=this.getBarcodeFormat(),y=new xE(h,null,0,[new Z(g,e),new Z(_,e)],v,new Date().getTime()),b=0;try{var x=mD.decodeRow(e,n,d[1]);y.putMetadata(wE.UPC_EAN_EXTENSION,x.getText()),y.putAllMetadata(x.getResultMetadata()),y.addResultPoints(x.getResultPoints()),b=x.getText().length}catch{}var S=r==null?null:r.get(YT.ALLOWED_EAN_EXTENSIONS);if(S!=null){var C=!1;for(var w in S)if(b.toString()===w){C=!0;break}if(!C)throw new Y}return v===X.EAN_13||X.UPC_A,y},t.checkChecksum=function(e){return t.checkStandardUPCEANChecksum(e)},t.checkStandardUPCEANChecksum=function(e){var n=e.length;if(n===0)return!1;var r=parseInt(e.charAt(n-1),10);return t.getStandardUPCEANChecksum(e.substring(0,n-1))===r},t.getStandardUPCEANChecksum=function(e){for(var t=e.length,n=0,r=t-1;r>=0;r-=2){if((i=e.charAt(r).charCodeAt(0)-48)<0||i>9)throw new J;n+=i}for(n*=3,r=t-2;r>=0;r-=2){var i;if((i=e.charAt(r).charCodeAt(0)-48)<0||i>9)throw new J;n+=i}return(1e3-n)%10},t.decodeEnd=function(e,n){return t.findGuardPattern(e,n,!1,t.START_END_PATTERN,new Int32Array(t.START_END_PATTERN.length).fill(0))},t}(lD),_D=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),vD=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},yD=function(e){function t(){var t=e.call(this)||this;return t.decodeMiddleCounters=Int32Array.from([0,0,0,0]),t}return _D(t,e),t.prototype.decodeMiddle=function(e,n,r){var i,a,o,s,c=this.decodeMiddleCounters;c[0]=0,c[1]=0,c[2]=0,c[3]=0;for(var l=e.getSize(),u=n[1],d=0,f=0;f<6&&u<l;f++){var p=gD.decodeDigit(e,c,u,gD.L_AND_G_PATTERNS);r+=String.fromCharCode(48+p%10);try{for(var m=(i=void 0,vD(c)),h=m.next();!h.done;h=m.next())u+=h.value}catch(e){i={error:e}}finally{try{h&&!h.done&&(a=m.return)&&a.call(m)}finally{if(i)throw i.error}}p>=10&&(d|=1<<5-f)}for(r=t.determineFirstDigit(r,d),u=gD.findGuardPattern(e,u,!0,gD.MIDDLE_PATTERN,new Int32Array(gD.MIDDLE_PATTERN.length).fill(0))[1],f=0;f<6&&u<l;f++){p=gD.decodeDigit(e,c,u,gD.L_PATTERNS),r+=String.fromCharCode(48+p);try{for(var g=(o=void 0,vD(c)),_=g.next();!_.done;_=g.next())u+=_.value}catch(e){o={error:e}}finally{try{_&&!_.done&&(s=g.return)&&s.call(g)}finally{if(o)throw o.error}}}return{rowOffset:u,resultString:r}},t.prototype.getBarcodeFormat=function(){return X.EAN_13},t.determineFirstDigit=function(e,t){for(var n=0;n<10;n++)if(t===this.FIRST_DIGIT_ENCODINGS[n])return e=String.fromCharCode(48+n)+e;throw new Y},t.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26],t}(gD),bD=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),xD=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},SD=function(e){function t(){var t=e.call(this)||this;return t.decodeMiddleCounters=Int32Array.from([0,0,0,0]),t}return bD(t,e),t.prototype.decodeMiddle=function(e,t,n){var r,i,a,o,s=this.decodeMiddleCounters;s[0]=0,s[1]=0,s[2]=0,s[3]=0;for(var c=e.getSize(),l=t[1],u=0;u<4&&l<c;u++){var d=gD.decodeDigit(e,s,l,gD.L_PATTERNS);n+=String.fromCharCode(48+d);try{for(var f=(r=void 0,xD(s)),p=f.next();!p.done;p=f.next())l+=p.value}catch(e){r={error:e}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}for(l=gD.findGuardPattern(e,l,!0,gD.MIDDLE_PATTERN,new Int32Array(gD.MIDDLE_PATTERN.length).fill(0))[1],u=0;u<4&&l<c;u++){d=gD.decodeDigit(e,s,l,gD.L_PATTERNS),n+=String.fromCharCode(48+d);try{for(var m=(a=void 0,xD(s)),h=m.next();!h.done;h=m.next())l+=h.value}catch(e){a={error:e}}finally{try{h&&!h.done&&(o=m.return)&&o.call(m)}finally{if(a)throw a.error}}}return{rowOffset:l,resultString:n}},t.prototype.getBarcodeFormat=function(){return X.EAN_8},t}(gD),CD=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),wD=function(e){function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.ean13Reader=new yD,t}return CD(t,e),t.prototype.getBarcodeFormat=function(){return X.UPC_A},t.prototype.decode=function(e,t){return this.maybeReturnResult(this.ean13Reader.decode(e))},t.prototype.decodeRow=function(e,t,n){return this.maybeReturnResult(this.ean13Reader.decodeRow(e,t,n))},t.prototype.decodeMiddle=function(e,t,n){return this.ean13Reader.decodeMiddle(e,t,n)},t.prototype.maybeReturnResult=function(e){var t=e.getText();if(t.charAt(0)===`0`){var n=new xE(t.substring(1),null,null,e.getResultPoints(),X.UPC_A);return e.getResultMetadata()!=null&&n.putAllMetadata(e.getResultMetadata()),n}throw new Y},t.prototype.reset=function(){this.ean13Reader.reset()},t}(gD),TD=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ED=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},DD=function(e){function t(){var t=e.call(this)||this;return t.decodeMiddleCounters=new Int32Array(4),t}return TD(t,e),t.prototype.decodeMiddle=function(e,n,r){var i,a,o=this.decodeMiddleCounters.map((function(e){return e}));o[0]=0,o[1]=0,o[2]=0,o[3]=0;for(var s=e.getSize(),c=n[1],l=0,u=0;u<6&&c<s;u++){var d=t.decodeDigit(e,o,c,t.L_AND_G_PATTERNS);r+=String.fromCharCode(48+d%10);try{for(var f=(i=void 0,ED(o)),p=f.next();!p.done;p=f.next())c+=p.value}catch(e){i={error:e}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}d>=10&&(l|=1<<5-u)}return t.determineNumSysAndCheckDigit(new iE(r),l),c},t.prototype.decodeEnd=function(e,n){return t.findGuardPatternWithoutCounters(e,n,!0,t.MIDDLE_END_PATTERN)},t.prototype.checkChecksum=function(e){return gD.checkChecksum(t.convertUPCEtoUPCA(e))},t.determineNumSysAndCheckDigit=function(e,t){for(var n=0;n<=1;n++)for(var r=0;r<10;r++)if(t===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[n][r])return e.insert(0,`0`+n),void e.append(`0`+r);throw Y.getNotFoundInstance()},t.prototype.getBarcodeFormat=function(){return X.UPC_E},t.convertUPCEtoUPCA=function(e){var t=e.slice(1,7).split(``).map((function(e){return e.charCodeAt(0)})),n=new iE;n.append(e.charAt(0));var r=t[5];switch(r){case 0:case 1:case 2:n.appendChars(t,0,2),n.append(r),n.append(`0000`),n.appendChars(t,2,3);break;case 3:n.appendChars(t,0,3),n.append(`00000`),n.appendChars(t,3,2);break;case 4:n.appendChars(t,0,4),n.append(`00000`),n.append(t[4]);break;default:n.appendChars(t,0,5),n.append(`0000`),n.append(r)}return e.length>=8&&n.append(e.charAt(7)),n.toString()},t.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),t.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])],t}(gD),OD=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),kD=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},AD=function(e){function t(t){var n=e.call(this)||this,r=t==null?null:t.get(YT.POSSIBLE_FORMATS),i=[];return r!=null&&(r.indexOf(X.EAN_13)>-1?i.push(new yD):r.indexOf(X.UPC_A)>-1&&i.push(new wD),r.indexOf(X.EAN_8)>-1&&i.push(new SD),r.indexOf(X.UPC_E)>-1&&i.push(new DD)),i.length===0&&(i.push(new yD),i.push(new SD),i.push(new DD)),n.readers=i,n}return OD(t,e),t.prototype.decodeRow=function(e,t,n){var r,i;try{for(var a=kD(this.readers),o=a.next();!o.done;o=a.next()){var s=o.value;try{var c=s.decodeRow(e,t,n),l=c.getBarcodeFormat()===X.EAN_13&&c.getText().charAt(0)===`0`,u=n==null?null:n.get(YT.POSSIBLE_FORMATS),d=u==null||u.includes(X.UPC_A);if(l&&d){var f=c.getRawBytes(),p=new xE(c.getText().substring(1),f,f.length,c.getResultPoints(),X.UPC_A);return p.putAllMetadata(c.getResultMetadata()),p}return c}catch{}}}catch(e){r={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}throw new Y},t.prototype.reset=function(){var e,t;try{for(var n=kD(this.readers),r=n.next();!r.done;r=n.next())r.value.reset()}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},t}($E),jD=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),MD=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},ND=function(e){function t(){var t=e.call(this)||this;return t.decodeFinderCounters=new Int32Array(4),t.dataCharacterCounters=new Int32Array(8),t.oddRoundingErrors=[,,,,],t.evenRoundingErrors=[,,,,],t.oddCounts=Array(t.dataCharacterCounters.length/2),t.evenCounts=Array(t.dataCharacterCounters.length/2),t}return jD(t,e),t.prototype.getDecodeFinderCounters=function(){return this.decodeFinderCounters},t.prototype.getDataCharacterCounters=function(){return this.dataCharacterCounters},t.prototype.getOddRoundingErrors=function(){return this.oddRoundingErrors},t.prototype.getEvenRoundingErrors=function(){return this.evenRoundingErrors},t.prototype.getOddCounts=function(){return this.oddCounts},t.prototype.getEvenCounts=function(){return this.evenCounts},t.prototype.parseFinderValue=function(e,n){for(var r=0;r<n.length;r++)if($E.patternMatchVariance(e,n[r],t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return r;throw new Y},t.count=function(e){return RE.sum(new Int32Array(e))},t.increment=function(e,t){for(var n=0,r=t[0],i=1;i<e.length;i++)t[i]>r&&(r=t[i],n=i);e[n]++},t.decrement=function(e,t){for(var n=0,r=t[0],i=1;i<e.length;i++)t[i]<r&&(r=t[i],n=i);e[n]--},t.isFinderPattern=function(e){var n,r,i=e[0]+e[1],a=i/(i+e[2]+e[3]);if(a>=t.MIN_FINDER_PATTERN_RATIO&&a<=t.MAX_FINDER_PATTERN_RATIO){var o=2**53-1,s=-(2**53-1);try{for(var c=MD(e),l=c.next();!l.done;l=c.next()){var u=l.value;u>s&&(s=u),u<o&&(o=u)}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return s<10*o}return!1},t.MAX_AVG_VARIANCE=.2,t.MAX_INDIVIDUAL_VARIANCE=.45,t.MIN_FINDER_PATTERN_RATIO=9.5/12,t.MAX_FINDER_PATTERN_RATIO=12.5/14,t}($E),PD=function(){function e(e,t){this.value=e,this.checksumPortion=t}return e.prototype.getValue=function(){return this.value},e.prototype.getChecksumPortion=function(){return this.checksumPortion},e.prototype.toString=function(){return this.value+`(`+this.checksumPortion+`)`},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.value===n.value&&this.checksumPortion===n.checksumPortion},e.prototype.hashCode=function(){return this.value^this.checksumPortion},e}(),FD=function(){function e(e,t,n,r,i){this.value=e,this.startEnd=t,this.value=e,this.startEnd=t,this.resultPoints=[],this.resultPoints.push(new Z(n,i)),this.resultPoints.push(new Z(r,i))}return e.prototype.getValue=function(){return this.value},e.prototype.getStartEnd=function(){return this.startEnd},e.prototype.getResultPoints=function(){return this.resultPoints},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.value===n.value},e.prototype.hashCode=function(){return this.value},e}(),ID=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},LD=function(){function e(){}return e.getRSSvalue=function(t,n,r){var i,a,o=0;try{for(var s=ID(t),c=s.next();!c.done;c=s.next())o+=c.value}catch(e){i={error:e}}finally{try{c&&!c.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}for(var l=0,u=0,d=t.length,f=0;f<d-1;f++){var p=void 0;for(p=1,u|=1<<f;p<t[f];p++,u&=~(1<<f)){var m=e.combins(o-p-1,d-f-2);if(r&&u===0&&o-p-(d-f-1)>=d-f-1&&(m-=e.combins(o-p-(d-f),d-f-2)),d-f-1>1){for(var h=0,g=o-p-(d-f-2);g>n;g--)h+=e.combins(o-p-g-1,d-f-3);m-=h*(d-1-f)}else o-p>n&&m--;l+=m}o-=p}return l},e.combins=function(e,t){var n,r;e-t>t?(r=t,n=e-t):(r=e-t,n=t);for(var i=1,a=1,o=e;o>n;o--)i*=o,a<=r&&(i/=a,a++);for(;a<=r;)i/=a,a++;return i},e}(),RD=function(){function e(){}return e.buildBitArray=function(e){var t=2*e.length-1;e[e.length-1].getRightChar()??--t;for(var n=new qT(12*t),r=0,i=e[0].getRightChar().getValue(),a=11;a>=0;--a)i&1<<a&&n.set(r),r++;for(a=1;a<e.length;++a){for(var o=e[a],s=o.getLeftChar().getValue(),c=11;c>=0;--c)s&1<<c&&n.set(r),r++;if(o.getRightChar()!=null){var l=o.getRightChar().getValue();for(c=11;c>=0;--c)l&1<<c&&n.set(r),r++}}return n},e}(),zD=function(){function e(e,t){t?this.decodedInformation=null:(this.finished=e,this.decodedInformation=t)}return e.prototype.getDecodedInformation=function(){return this.decodedInformation},e.prototype.isFinished=function(){return this.finished},e}(),BD=function(){function e(e){this.newPosition=e}return e.prototype.getNewPosition=function(){return this.newPosition},e}(),VD=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),HD=function(e){function t(t,n){var r=e.call(this,t)||this;return r.value=n,r}return VD(t,e),t.prototype.getValue=function(){return this.value},t.prototype.isFNC1=function(){return this.value===t.FNC1},t.FNC1=`$`,t}(BD),UD=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),WD=function(e){function t(t,n,r){var i=e.call(this,t)||this;return r?(i.remaining=!0,i.remainingValue=i.remainingValue):(i.remaining=!1,i.remainingValue=0),i.newString=n,i}return UD(t,e),t.prototype.getNewString=function(){return this.newString},t.prototype.isRemaining=function(){return this.remaining},t.prototype.getRemainingValue=function(){return this.remainingValue},t}(BD),GD=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),KD=function(e){function t(t,n,r){var i=e.call(this,t)||this;if(n<0||n>10||r<0||r>10)throw new J;return i.firstDigit=n,i.secondDigit=r,i}return GD(t,e),t.prototype.getFirstDigit=function(){return this.firstDigit},t.prototype.getSecondDigit=function(){return this.secondDigit},t.prototype.getValue=function(){return 10*this.firstDigit+this.secondDigit},t.prototype.isFirstDigitFNC1=function(){return this.firstDigit===t.FNC1},t.prototype.isSecondDigitFNC1=function(){return this.secondDigit===t.FNC1},t.prototype.isAnyFNC1=function(){return this.firstDigit===t.FNC1||this.secondDigit===t.FNC1},t.FNC1=10,t}(BD),qD=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},JD=function(){function e(){}return e.parseFieldsInGeneralPurpose=function(t){var n,r,i,a,o,s,c,l;if(!t)return null;if(t.length<2)throw new Y;var u=t.substring(0,2);try{for(var d=qD(e.TWO_DIGIT_DATA_LENGTH),f=d.next();!f.done;f=d.next())if((x=f.value)[0]===u)return x[1]===e.VARIABLE_LENGTH?e.processVariableAI(2,x[2],t):e.processFixedAI(2,x[1],t)}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}if(t.length<3)throw new Y;var p=t.substring(0,3);try{for(var m=qD(e.THREE_DIGIT_DATA_LENGTH),h=m.next();!h.done;h=m.next())if((x=h.value)[0]===p)return x[1]===e.VARIABLE_LENGTH?e.processVariableAI(3,x[2],t):e.processFixedAI(3,x[1],t)}catch(e){i={error:e}}finally{try{h&&!h.done&&(a=m.return)&&a.call(m)}finally{if(i)throw i.error}}try{for(var g=qD(e.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),_=g.next();!_.done;_=g.next())if((x=_.value)[0]===p)return x[1]===e.VARIABLE_LENGTH?e.processVariableAI(4,x[2],t):e.processFixedAI(4,x[1],t)}catch(e){o={error:e}}finally{try{_&&!_.done&&(s=g.return)&&s.call(g)}finally{if(o)throw o.error}}if(t.length<4)throw new Y;var v=t.substring(0,4);try{for(var y=qD(e.FOUR_DIGIT_DATA_LENGTH),b=y.next();!b.done;b=y.next()){var x;if((x=b.value)[0]===v)return x[1]===e.VARIABLE_LENGTH?e.processVariableAI(4,x[2],t):e.processFixedAI(4,x[1],t)}}catch(e){c={error:e}}finally{try{b&&!b.done&&(l=y.return)&&l.call(y)}finally{if(c)throw c.error}}throw new Y},e.processFixedAI=function(t,n,r){if(r.length<t)throw new Y;var i=r.substring(0,t);if(r.length<t+n)throw new Y;var a=r.substring(t,t+n),o=r.substring(t+n),s=`(`+i+`)`+a,c=e.parseFieldsInGeneralPurpose(o);return c==null?s:s+c},e.processVariableAI=function(t,n,r){var i,a=r.substring(0,t);i=r.length<t+n?r.length:t+n;var o=r.substring(t,i),s=r.substring(i),c=`(`+a+`)`+o,l=e.parseFieldsInGeneralPurpose(s);return l==null?c:c+l},e.VARIABLE_LENGTH=[],e.TWO_DIGIT_DATA_LENGTH=[[`00`,18],[`01`,14],[`02`,14],[`10`,e.VARIABLE_LENGTH,20],[`11`,6],[`12`,6],[`13`,6],[`15`,6],[`17`,6],[`20`,2],[`21`,e.VARIABLE_LENGTH,20],[`22`,e.VARIABLE_LENGTH,29],[`30`,e.VARIABLE_LENGTH,8],[`37`,e.VARIABLE_LENGTH,8],[`90`,e.VARIABLE_LENGTH,30],[`91`,e.VARIABLE_LENGTH,30],[`92`,e.VARIABLE_LENGTH,30],[`93`,e.VARIABLE_LENGTH,30],[`94`,e.VARIABLE_LENGTH,30],[`95`,e.VARIABLE_LENGTH,30],[`96`,e.VARIABLE_LENGTH,30],[`97`,e.VARIABLE_LENGTH,3],[`98`,e.VARIABLE_LENGTH,30],[`99`,e.VARIABLE_LENGTH,30]],e.THREE_DIGIT_DATA_LENGTH=[[`240`,e.VARIABLE_LENGTH,30],[`241`,e.VARIABLE_LENGTH,30],[`242`,e.VARIABLE_LENGTH,6],[`250`,e.VARIABLE_LENGTH,30],[`251`,e.VARIABLE_LENGTH,30],[`253`,e.VARIABLE_LENGTH,17],[`254`,e.VARIABLE_LENGTH,20],[`400`,e.VARIABLE_LENGTH,30],[`401`,e.VARIABLE_LENGTH,30],[`402`,17],[`403`,e.VARIABLE_LENGTH,30],[`410`,13],[`411`,13],[`412`,13],[`413`,13],[`414`,13],[`420`,e.VARIABLE_LENGTH,20],[`421`,e.VARIABLE_LENGTH,15],[`422`,3],[`423`,e.VARIABLE_LENGTH,15],[`424`,3],[`425`,3],[`426`,3]],e.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH=[[`310`,6],[`311`,6],[`312`,6],[`313`,6],[`314`,6],[`315`,6],[`316`,6],[`320`,6],[`321`,6],[`322`,6],[`323`,6],[`324`,6],[`325`,6],[`326`,6],[`327`,6],[`328`,6],[`329`,6],[`330`,6],[`331`,6],[`332`,6],[`333`,6],[`334`,6],[`335`,6],[`336`,6],[`340`,6],[`341`,6],[`342`,6],[`343`,6],[`344`,6],[`345`,6],[`346`,6],[`347`,6],[`348`,6],[`349`,6],[`350`,6],[`351`,6],[`352`,6],[`353`,6],[`354`,6],[`355`,6],[`356`,6],[`357`,6],[`360`,6],[`361`,6],[`362`,6],[`363`,6],[`364`,6],[`365`,6],[`366`,6],[`367`,6],[`368`,6],[`369`,6],[`390`,e.VARIABLE_LENGTH,15],[`391`,e.VARIABLE_LENGTH,18],[`392`,e.VARIABLE_LENGTH,15],[`393`,e.VARIABLE_LENGTH,18],[`703`,e.VARIABLE_LENGTH,30]],e.FOUR_DIGIT_DATA_LENGTH=[[`7001`,13],[`7002`,e.VARIABLE_LENGTH,30],[`7003`,10],[`8001`,14],[`8002`,e.VARIABLE_LENGTH,20],[`8003`,e.VARIABLE_LENGTH,30],[`8004`,e.VARIABLE_LENGTH,30],[`8005`,6],[`8006`,18],[`8007`,e.VARIABLE_LENGTH,30],[`8008`,e.VARIABLE_LENGTH,12],[`8018`,18],[`8020`,e.VARIABLE_LENGTH,25],[`8100`,6],[`8101`,10],[`8102`,2],[`8110`,e.VARIABLE_LENGTH,70],[`8200`,e.VARIABLE_LENGTH,70]],e}(),YD=function(){function e(e){this.buffer=new iE,this.information=e}return e.prototype.decodeAllCodes=function(e,t){for(var n=t,r=null;;){var i=this.decodeGeneralPurposeField(n,r),a=JD.parseFieldsInGeneralPurpose(i.getNewString());if(a!=null&&e.append(a),r=i.isRemaining()?``+i.getRemainingValue():null,n===i.getNewPosition())break;n=i.getNewPosition()}return e.toString()},e.prototype.isStillNumeric=function(e){if(e+7>this.information.getSize())return e+4<=this.information.getSize();for(var t=e;t<e+3;++t)if(this.information.get(t))return!0;return this.information.get(e+3)},e.prototype.decodeNumeric=function(e){if(e+7>this.information.getSize()){var t=this.extractNumericValueFromBitArray(e,4);return new KD(this.information.getSize(),t===0?KD.FNC1:t-1,KD.FNC1)}var n=this.extractNumericValueFromBitArray(e,7);return new KD(e+7,(n-8)/11,(n-8)%11)},e.prototype.extractNumericValueFromBitArray=function(t,n){return e.extractNumericValueFromBitArray(this.information,t,n)},e.extractNumericValueFromBitArray=function(e,t,n){for(var r=0,i=0;i<n;++i)e.get(t+i)&&(r|=1<<n-i-1);return r},e.prototype.decodeGeneralPurposeField=function(e,t){this.buffer.setLengthToZero(),t!=null&&this.buffer.append(t),this.current.setPosition(e);var n=this.parseBlocks();return n!=null&&n.isRemaining()?new WD(this.current.getPosition(),this.buffer.toString(),n.getRemainingValue()):new WD(this.current.getPosition(),this.buffer.toString())},e.prototype.parseBlocks=function(){var e,t;do{var n=this.current.getPosition();if(e=this.current.isAlpha()?(t=this.parseAlphaBlock()).isFinished():this.current.isIsoIec646()?(t=this.parseIsoIec646Block()).isFinished():(t=this.parseNumericBlock()).isFinished(),n===this.current.getPosition()&&!e)break}while(!e);return t.getDecodedInformation()},e.prototype.parseNumericBlock=function(){for(;this.isStillNumeric(this.current.getPosition());){var e=this.decodeNumeric(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFirstDigitFNC1()){var t=void 0;return t=e.isSecondDigitFNC1()?new WD(this.current.getPosition(),this.buffer.toString()):new WD(this.current.getPosition(),this.buffer.toString(),e.getSecondDigit()),new zD(!0,t)}if(this.buffer.append(e.getFirstDigit()),e.isSecondDigitFNC1())return t=new WD(this.current.getPosition(),this.buffer.toString()),new zD(!0,t);this.buffer.append(e.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new zD(!1)},e.prototype.parseIsoIec646Block=function(){for(;this.isStillIsoIec646(this.current.getPosition());){var e=this.decodeIsoIec646(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFNC1())return new zD(!0,new WD(this.current.getPosition(),this.buffer.toString()));this.buffer.append(e.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setAlpha()),new zD(!1)},e.prototype.parseAlphaBlock=function(){for(;this.isStillAlpha(this.current.getPosition());){var e=this.decodeAlphanumeric(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFNC1())return new zD(!0,new WD(this.current.getPosition(),this.buffer.toString()));this.buffer.append(e.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setIsoIec646()),new zD(!1)},e.prototype.isStillIsoIec646=function(e){if(e+5>this.information.getSize())return!1;var t=this.extractNumericValueFromBitArray(e,5);if(t>=5&&t<16)return!0;if(e+7>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(e,7);if(n>=64&&n<116)return!0;if(e+8>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(e,8);return r>=232&&r<253},e.prototype.decodeIsoIec646=function(e){var t=this.extractNumericValueFromBitArray(e,5);if(t===15)return new HD(e+5,HD.FNC1);if(t>=5&&t<15)return new HD(e+5,`0`+(t-5));var n,r=this.extractNumericValueFromBitArray(e,7);if(r>=64&&r<90)return new HD(e+7,``+(r+1));if(r>=90&&r<116)return new HD(e+7,``+(r+7));switch(this.extractNumericValueFromBitArray(e,8)){case 232:n=`!`;break;case 233:n=`"`;break;case 234:n=`%`;break;case 235:n=`&`;break;case 236:n=`'`;break;case 237:n=`(`;break;case 238:n=`)`;break;case 239:n=`*`;break;case 240:n=`+`;break;case 241:n=`,`;break;case 242:n=`-`;break;case 243:n=`.`;break;case 244:n=`/`;break;case 245:n=`:`;break;case 246:n=`;`;break;case 247:n=`<`;break;case 248:n=`=`;break;case 249:n=`>`;break;case 250:n=`?`;break;case 251:n=`_`;break;case 252:n=` `;break;default:throw new J}return new HD(e+8,n)},e.prototype.isStillAlpha=function(e){if(e+5>this.information.getSize())return!1;var t=this.extractNumericValueFromBitArray(e,5);if(t>=5&&t<16)return!0;if(e+6>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(e,6);return n>=16&&n<63},e.prototype.decodeAlphanumeric=function(e){var t=this.extractNumericValueFromBitArray(e,5);if(t===15)return new HD(e+5,HD.FNC1);if(t>=5&&t<15)return new HD(e+5,`0`+(t-5));var n,r=this.extractNumericValueFromBitArray(e,6);if(r>=32&&r<58)return new HD(e+6,``+(r+33));switch(r){case 58:n=`*`;break;case 59:n=`,`;break;case 60:n=`-`;break;case 61:n=`.`;break;case 62:n=`/`;break;default:throw new FE(`Decoding invalid alphanumeric value: `+r)}return new HD(e+6,n)},e.prototype.isAlphaTo646ToAlphaLatch=function(e){if(e+1>this.information.getSize())return!1;for(var t=0;t<5&&t+e<this.information.getSize();++t)if(t===2){if(!this.information.get(e+2))return!1}else if(this.information.get(e+t))return!1;return!0},e.prototype.isAlphaOr646ToNumericLatch=function(e){if(e+3>this.information.getSize())return!1;for(var t=e;t<e+3;++t)if(this.information.get(t))return!1;return!0},e.prototype.isNumericToAlphaNumericLatch=function(e){if(e+1>this.information.getSize())return!1;for(var t=0;t<4&&t+e<this.information.getSize();++t)if(this.information.get(e+t))return!1;return!0},e}(),XD=function(){function e(e){this.information=e,this.generalDecoder=new YD(e)}return e.prototype.getInformation=function(){return this.information},e.prototype.getGeneralDecoder=function(){return this.generalDecoder},e}(),ZD=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),QD=function(e){function t(t){return e.call(this,t)||this}return ZD(t,e),t.prototype.encodeCompressedGtin=function(e,t){e.append(`(01)`);var n=e.length();e.append(`9`),this.encodeCompressedGtinWithoutAI(e,t,n)},t.prototype.encodeCompressedGtinWithoutAI=function(e,n,r){for(var i=0;i<4;++i){var a=this.getGeneralDecoder().extractNumericValueFromBitArray(n+10*i,10);a/100==0&&e.append(`0`),a/10==0&&e.append(`0`),e.append(a)}t.appendCheckDigit(e,r)},t.appendCheckDigit=function(e,t){for(var n=0,r=0;r<13;r++){var i=e.charAt(r+t).charCodeAt(0)-48;n+=1&r?i:3*i}(n=10-n%10)==10&&(n=0),e.append(n)},t.GTIN_SIZE=40,t}(XD),$D=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),eO=function(e){function t(t){return e.call(this,t)||this}return $D(t,e),t.prototype.parseInformation=function(){var e=new iE;e.append(`(01)`);var n=e.length(),r=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE,4);return e.append(r),this.encodeCompressedGtinWithoutAI(e,t.HEADER_SIZE+4,n),this.getGeneralDecoder().decodeAllCodes(e,t.HEADER_SIZE+44)},t.HEADER_SIZE=4,t}(QD),tO=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),nO=function(e){function t(t){return e.call(this,t)||this}return tO(t,e),t.prototype.parseInformation=function(){var e=new iE;return this.getGeneralDecoder().decodeAllCodes(e,t.HEADER_SIZE)},t.HEADER_SIZE=5,t}(XD),rO=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),iO=function(e){function t(t){return e.call(this,t)||this}return rO(t,e),t.prototype.encodeCompressedWeight=function(e,t,n){var r=this.getGeneralDecoder().extractNumericValueFromBitArray(t,n);this.addWeightCode(e,r);for(var i=this.checkWeight(r),a=1e5,o=0;o<5;++o)i/a==0&&e.append(`0`),a/=10;e.append(i)},t}(QD),aO=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),oO=function(e){function t(t){return e.call(this,t)||this}return aO(t,e),t.prototype.parseInformation=function(){if(this.getInformation().getSize()!=t.HEADER_SIZE+iO.GTIN_SIZE+t.WEIGHT_SIZE)throw new Y;var e=new iE;return this.encodeCompressedGtin(e,t.HEADER_SIZE),this.encodeCompressedWeight(e,t.HEADER_SIZE+iO.GTIN_SIZE,t.WEIGHT_SIZE),e.toString()},t.HEADER_SIZE=5,t.WEIGHT_SIZE=15,t}(iO),sO=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),cO=function(e){function t(t){return e.call(this,t)||this}return sO(t,e),t.prototype.addWeightCode=function(e,t){e.append(`(3103)`)},t.prototype.checkWeight=function(e){return e},t}(oO),lO=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),uO=function(e){function t(t){return e.call(this,t)||this}return lO(t,e),t.prototype.addWeightCode=function(e,t){t<1e4?e.append(`(3202)`):e.append(`(3203)`)},t.prototype.checkWeight=function(e){return e<1e4?e:e-1e4},t}(oO),dO=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),fO=function(e){function t(t){return e.call(this,t)||this}return dO(t,e),t.prototype.parseInformation=function(){if(this.getInformation().getSize()<t.HEADER_SIZE+QD.GTIN_SIZE)throw new Y;var e=new iE;this.encodeCompressedGtin(e,t.HEADER_SIZE);var n=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+QD.GTIN_SIZE,t.LAST_DIGIT_SIZE);e.append(`(392`),e.append(n),e.append(`)`);var r=this.getGeneralDecoder().decodeGeneralPurposeField(t.HEADER_SIZE+QD.GTIN_SIZE+t.LAST_DIGIT_SIZE,null);return e.append(r.getNewString()),e.toString()},t.HEADER_SIZE=8,t.LAST_DIGIT_SIZE=2,t}(QD),pO=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),mO=function(e){function t(t){return e.call(this,t)||this}return pO(t,e),t.prototype.parseInformation=function(){if(this.getInformation().getSize()<t.HEADER_SIZE+QD.GTIN_SIZE)throw new Y;var e=new iE;this.encodeCompressedGtin(e,t.HEADER_SIZE);var n=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+QD.GTIN_SIZE,t.LAST_DIGIT_SIZE);e.append(`(393`),e.append(n),e.append(`)`);var r=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+QD.GTIN_SIZE+t.LAST_DIGIT_SIZE,t.FIRST_THREE_DIGITS_SIZE);r/100==0&&e.append(`0`),r/10==0&&e.append(`0`),e.append(r);var i=this.getGeneralDecoder().decodeGeneralPurposeField(t.HEADER_SIZE+QD.GTIN_SIZE+t.LAST_DIGIT_SIZE+t.FIRST_THREE_DIGITS_SIZE,null);return e.append(i.getNewString()),e.toString()},t.HEADER_SIZE=8,t.LAST_DIGIT_SIZE=2,t.FIRST_THREE_DIGITS_SIZE=10,t}(QD),hO=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),gO=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.dateCode=r,i.firstAIdigits=n,i}return hO(t,e),t.prototype.parseInformation=function(){if(this.getInformation().getSize()!=t.HEADER_SIZE+t.GTIN_SIZE+t.WEIGHT_SIZE+t.DATE_SIZE)throw new Y;var e=new iE;return this.encodeCompressedGtin(e,t.HEADER_SIZE),this.encodeCompressedWeight(e,t.HEADER_SIZE+t.GTIN_SIZE,t.WEIGHT_SIZE),this.encodeCompressedDate(e,t.HEADER_SIZE+t.GTIN_SIZE+t.WEIGHT_SIZE),e.toString()},t.prototype.encodeCompressedDate=function(e,n){var r=this.getGeneralDecoder().extractNumericValueFromBitArray(n,t.DATE_SIZE);if(r!=38400){e.append(`(`),e.append(this.dateCode),e.append(`)`);var i=r%32,a=(r/=32)%12+1,o=r/=12;o/10==0&&e.append(`0`),e.append(o),a/10==0&&e.append(`0`),e.append(a),i/10==0&&e.append(`0`),e.append(i)}},t.prototype.addWeightCode=function(e,t){e.append(`(`),e.append(this.firstAIdigits),e.append(t/1e5),e.append(`)`)},t.prototype.checkWeight=function(e){return e%1e5},t.HEADER_SIZE=8,t.WEIGHT_SIZE=20,t.DATE_SIZE=16,t}(iO),_O=function(){function e(e,t,n,r){this.leftchar=e,this.rightchar=t,this.finderpattern=n,this.maybeLast=r}return e.prototype.mayBeLast=function(){return this.maybeLast},e.prototype.getLeftChar=function(){return this.leftchar},e.prototype.getRightChar=function(){return this.rightchar},e.prototype.getFinderPattern=function(){return this.finderpattern},e.prototype.mustBeLast=function(){return this.rightchar==null},e.prototype.toString=function(){return`[ `+this.leftchar+`, `+this.rightchar+` : `+(this.finderpattern==null?`null`:this.finderpattern.getValue())+` ]`},e.equals=function(t,n){return t instanceof e&&e.equalsOrNull(t.leftchar,n.leftchar)&&e.equalsOrNull(t.rightchar,n.rightchar)&&e.equalsOrNull(t.finderpattern,n.finderpattern)},e.equalsOrNull=function(t,n){return t===null?n===null:e.equals(t,n)},e.prototype.hashCode=function(){return this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue()},e}(),vO=function(){function e(e,t,n){this.pairs=e,this.rowNumber=t,this.wasReversed=n}return e.prototype.getPairs=function(){return this.pairs},e.prototype.getRowNumber=function(){return this.rowNumber},e.prototype.isReversed=function(){return this.wasReversed},e.prototype.isEquivalent=function(e){return this.checkEqualitity(this,e)},e.prototype.toString=function(){return`{ `+this.pairs+` }`},e.prototype.equals=function(t,n){return t instanceof e&&this.checkEqualitity(t,n)&&t.wasReversed===n.wasReversed},e.prototype.checkEqualitity=function(e,t){var n;if(e&&t)return e.forEach((function(e,r){t.forEach((function(t){e.getLeftChar().getValue()===t.getLeftChar().getValue()&&e.getRightChar().getValue()===t.getRightChar().getValue()&&e.getFinderPatter().getValue()===t.getFinderPatter().getValue()&&(n=!0)}))})),n},e}(),yO=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),bO=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},xO=function(e){function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.pairs=Array(t.MAX_PAIRS),n.rows=[],n.startEnd=[2],n}return yO(t,e),t.prototype.decodeRow=function(e,n,r){this.pairs.length=0,this.startFromEven=!1;try{return t.constructResult(this.decodeRow2pairs(e,n))}catch{}return this.pairs.length=0,this.startFromEven=!0,t.constructResult(this.decodeRow2pairs(e,n))},t.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},t.prototype.decodeRow2pairs=function(e,t){for(var n,r=!1;!r;)try{this.pairs.push(this.retrieveNextPair(t,this.pairs,e))}catch(e){if(e instanceof Y){if(!this.pairs.length)throw new Y;r=!0}}if(this.checkChecksum())return this.pairs;if(n=!!this.rows.length,this.storeRow(e,!1),n){var i=this.checkRowsBoolean(!1);if(i!=null||(i=this.checkRowsBoolean(!0))!=null)return i}throw new Y},t.prototype.checkRowsBoolean=function(e){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,e&&(this.rows=this.rows.reverse());var t=null;try{t=this.checkRows([],0)}catch(e){console.log(e)}return e&&(this.rows=this.rows.reverse()),t},t.prototype.checkRows=function(e,n){for(var r,i,a=n;a<this.rows.length;a++){var o=this.rows[a];this.pairs.length=0;try{for(var s=(r=void 0,bO(e)),c=s.next();!c.done;c=s.next()){var l=c.value;this.pairs.push(l.getPairs())}}catch(e){r={error:e}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}if(this.pairs.push(o.getPairs()),t.isValidSequence(this.pairs)){if(this.checkChecksum())return this.pairs;var u=Array(e);u.push(o);try{return this.checkRows(u,a+1)}catch(e){console.log(e)}}}throw new Y},t.isValidSequence=function(e){var n,r;try{for(var i=bO(t.FINDER_PATTERN_SEQUENCES),a=i.next();!a.done;a=i.next()){var o=a.value;if(!(e.length>o.length)){for(var s=!0,c=0;c<e.length;c++)if(e[c].getFinderPattern().getValue()!=o[c]){s=!1;break}if(s)return!0}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!1},t.prototype.storeRow=function(e,n){for(var r=0,i=!1,a=!1;r<this.rows.length;){var o=this.rows[r];if(o.getRowNumber()>e){a=o.isEquivalent(this.pairs);break}i=o.isEquivalent(this.pairs),r++}a||i||t.isPartialRow(this.pairs,this.rows)||(this.rows.push(r,new vO(this.pairs,e,n)),this.removePartialRows(this.pairs,this.rows))},t.prototype.removePartialRows=function(e,t){var n,r,i,a,o,s;try{for(var c=bO(t),l=c.next();!l.done;l=c.next()){var u=l.value;if(u.getPairs().length!==e.length)try{for(var d=(i=void 0,bO(u.getPairs())),f=d.next();!f.done;f=d.next()){var p=f.value;try{for(var m=(o=void 0,bO(e)),h=m.next();!h.done;h=m.next()){var g=h.value;if(_O.equals(p,g))break}}catch(e){o={error:e}}finally{try{h&&!h.done&&(s=m.return)&&s.call(m)}finally{if(o)throw o.error}}}}catch(e){i={error:e}}finally{try{f&&!f.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}},t.isPartialRow=function(e,t){var n,r,i,a,o,s;try{for(var c=bO(t),l=c.next();!l.done;l=c.next()){var u=l.value,d=!0;try{for(var f=(i=void 0,bO(e)),p=f.next();!p.done;p=f.next()){var m=p.value,h=!1;try{for(var g=(o=void 0,bO(u.getPairs())),_=g.next();!_.done;_=g.next()){var v=_.value;if(m.equals(v)){h=!0;break}}}catch(e){o={error:e}}finally{try{_&&!_.done&&(s=g.return)&&s.call(g)}finally{if(o)throw o.error}}if(!h){d=!1;break}}}catch(e){i={error:e}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}if(d)return!0}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return!1},t.prototype.getRows=function(){return this.rows},t.constructResult=function(e){var t=function(e){try{if(e.get(1))return new eO(e);if(!e.get(2))return new nO(e);switch(YD.extractNumericValueFromBitArray(e,1,4)){case 4:return new cO(e);case 5:return new uO(e)}switch(YD.extractNumericValueFromBitArray(e,1,5)){case 12:return new fO(e);case 13:return new mO(e)}switch(YD.extractNumericValueFromBitArray(e,1,7)){case 56:return new gO(e,`310`,`11`);case 57:return new gO(e,`320`,`11`);case 58:return new gO(e,`310`,`13`);case 59:return new gO(e,`320`,`13`);case 60:return new gO(e,`310`,`15`);case 61:return new gO(e,`320`,`15`);case 62:return new gO(e,`310`,`17`);case 63:return new gO(e,`320`,`17`)}}catch(t){throw console.log(t),new FE(`unknown decoder: `+e)}}(RD.buildBitArray(e)).parseInformation(),n=e[0].getFinderPattern().getResultPoints(),r=e[e.length-1].getFinderPattern().getResultPoints();return new xE(t,null,null,[n[0],n[1],r[0],r[1]],X.RSS_EXPANDED,null)},t.prototype.checkChecksum=function(){var e=this.pairs.get(0),t=e.getLeftChar(),n=e.getRightChar();if(n==null)return!1;for(var r=n.getChecksumPortion(),i=2,a=1;a<this.pairs.size();++a){var o=this.pairs.get(a);r+=o.getLeftChar().getChecksumPortion(),i++;var s=o.getRightChar();s!=null&&(r+=s.getChecksumPortion(),i++)}return 211*(i-4)+(r%=211)==t.getValue()},t.getNextSecondBar=function(e,t){var n;return e.get(t)?(n=e.getNextUnset(t),n=e.getNextSet(n)):(n=e.getNextSet(t),n=e.getNextUnset(n)),n},t.prototype.retrieveNextPair=function(e,n,r){var i,a=n.length%2==0;this.startFromEven&&(a=!a);var o=!0,s=-1;do this.findNextPair(e,n,s),(i=this.parseFoundFinderPattern(e,r,a))==null?s=t.getNextSecondBar(e,this.startEnd[0]):o=!1;while(o);var c,l=this.decodeDataCharacter(e,i,a,!0);if(!this.isEmptyPair(n)&&n[n.length-1].mustBeLast())throw new Y;try{c=this.decodeDataCharacter(e,i,a,!1)}catch(e){c=null,console.log(e)}return new _O(l,c,i,!0)},t.prototype.isEmptyPair=function(e){return e.length===0},t.prototype.findNextPair=function(e,n,r){var i=this.getDecodeFinderCounters();i[0]=0,i[1]=0,i[2]=0,i[3]=0;var a,o=e.getSize();a=r>=0?r:this.isEmptyPair(n)?0:n[n.length-1].getFinderPattern().getStartEnd()[1];var s=n.length%2!=0;this.startFromEven&&(s=!s);for(var c=!1;a<o&&(c=!e.get(a));)a++;for(var l=0,u=a,d=a;d<o;d++)if(e.get(d)!=c)i[l]++;else{if(l==3){if(s&&t.reverseCounters(i),t.isFinderPattern(i))return this.startEnd[0]=u,void(this.startEnd[1]=d);s&&t.reverseCounters(i),u+=i[0]+i[1],i[0]=i[2],i[1]=i[3],i[2]=0,i[3]=0,l--}else l++;i[l]=1,c=!c}throw new Y},t.reverseCounters=function(e){for(var t=e.length,n=0;n<t/2;++n){var r=e[n];e[n]=e[t-n-1],e[t-n-1]=r}},t.prototype.parseFoundFinderPattern=function(e,n,r){var i,a,o;if(r){for(var s=this.startEnd[0]-1;s>=0&&!e.get(s);)s--;s++,i=this.startEnd[0]-s,a=s,o=this.startEnd[1]}else a=this.startEnd[0],i=(o=e.getNextUnset(this.startEnd[1]+1))-this.startEnd[1];var c,l=this.getDecodeFinderCounters();zT.arraycopy(l,0,l,1,l.length-1),l[0]=i;try{c=this.parseFinderValue(l,t.FINDER_PATTERNS)}catch{return null}return new FD(c,[a,o],a,o,n)},t.prototype.decodeDataCharacter=function(e,n,r,i){for(var a=this.getDataCharacterCounters(),o=0;o<a.length;o++)a[o]=0;if(i)t.recordPatternInReverse(e,n.getStartEnd()[0],a);else{t.recordPattern(e,n.getStartEnd()[1],a);for(var s=0,c=a.length-1;s<c;s++,c--){var l=a[s];a[s]=a[c],a[c]=l}}var u=RE.sum(new Int32Array(a))/17,d=(n.getStartEnd()[1]-n.getStartEnd()[0])/15;if(Math.abs(u-d)/d>.3)throw new Y;var f=this.getOddCounts(),p=this.getEvenCounts(),m=this.getOddRoundingErrors(),h=this.getEvenRoundingErrors();for(s=0;s<a.length;s++){var g=1*a[s]/u,_=g+.5;if(_<1){if(g<.3)throw new Y;_=1}else if(_>8){if(g>8.7)throw new Y;_=8}var v=s/2;1&s?(p[v]=_,h[v]=g-_):(f[v]=_,m[v]=g-_)}this.adjustOddEvenCounts(17);var y=4*n.getValue()+(r?0:2)+ +!i-1,b=0,x=0;for(s=f.length-1;s>=0;s--){if(t.isNotA1left(n,r,i)){var S=t.WEIGHTS[y][2*s];x+=f[s]*S}b+=f[s]}var C=0;for(s=p.length-1;s>=0;s--)t.isNotA1left(n,r,i)&&(S=t.WEIGHTS[y][2*s+1],C+=p[s]*S);var w=x+C;if(1&b||b>13||b<4)throw new Y;var T=(13-b)/2,E=t.SYMBOL_WIDEST[T],D=9-E,O=LD.getRSSvalue(f,E,!0),k=LD.getRSSvalue(p,D,!1),A=t.EVEN_TOTAL_SUBSET[T],j=t.GSUM[T];return new PD(O*A+k+j,w)},t.isNotA1left=function(e,t,n){return!(e.getValue()==0&&t&&n)},t.prototype.adjustOddEvenCounts=function(e){var n=RE.sum(new Int32Array(this.getOddCounts())),r=RE.sum(new Int32Array(this.getEvenCounts())),i=!1,a=!1;n>13?a=!0:n<4&&(i=!0);var o=!1,s=!1;r>13?s=!0:r<4&&(o=!0);var c=n+r-e,l=(1&n)==1,u=(1&r)==0;if(c==1)if(l){if(u)throw new Y;a=!0}else{if(!u)throw new Y;s=!0}else if(c==-1)if(l){if(u)throw new Y;i=!0}else{if(!u)throw new Y;o=!0}else{if(c!=0)throw new Y;if(l){if(!u)throw new Y;n<r?(i=!0,s=!0):(a=!0,o=!0)}else if(u)throw new Y}if(i){if(a)throw new Y;t.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(a&&t.decrement(this.getOddCounts(),this.getOddRoundingErrors()),o){if(s)throw new Y;t.increment(this.getEvenCounts(),this.getOddRoundingErrors())}s&&t.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},t.SYMBOL_WIDEST=[7,5,4,3,1],t.EVEN_TOTAL_SUBSET=[4,20,52,104,204],t.GSUM=[0,348,1388,2948,3988],t.FINDER_PATTERNS=[Int32Array.from([1,8,4,1]),Int32Array.from([3,6,4,1]),Int32Array.from([3,4,6,1]),Int32Array.from([3,2,8,1]),Int32Array.from([2,6,5,1]),Int32Array.from([2,2,9,1])],t.WEIGHTS=[[1,3,9,27,81,32,96,77],[20,60,180,118,143,7,21,63],[189,145,13,39,117,140,209,205],[193,157,49,147,19,57,171,91],[62,186,136,197,169,85,44,132],[185,133,188,142,4,12,36,108],[113,128,173,97,80,29,87,50],[150,28,84,41,123,158,52,156],[46,138,203,187,139,206,196,166],[76,17,51,153,37,111,122,155],[43,129,176,106,107,110,119,146],[16,48,144,10,30,90,59,177],[109,116,137,200,178,112,125,164],[70,210,208,202,184,130,179,115],[134,191,151,31,93,68,204,190],[148,22,66,198,172,94,71,2],[6,18,54,162,64,192,154,40],[120,149,25,75,14,42,126,167],[79,26,78,23,69,207,199,175],[103,98,83,38,114,131,182,124],[161,61,183,127,170,88,53,159],[55,165,73,8,24,72,5,15],[45,135,194,160,58,174,100,89]],t.FINDER_PAT_A=0,t.FINDER_PAT_B=1,t.FINDER_PAT_C=2,t.FINDER_PAT_D=3,t.FINDER_PAT_E=4,t.FINDER_PAT_F=5,t.FINDER_PATTERN_SEQUENCES=[[t.FINDER_PAT_A,t.FINDER_PAT_A],[t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B],[t.FINDER_PAT_A,t.FINDER_PAT_C,t.FINDER_PAT_B,t.FINDER_PAT_D],[t.FINDER_PAT_A,t.FINDER_PAT_E,t.FINDER_PAT_B,t.FINDER_PAT_D,t.FINDER_PAT_C],[t.FINDER_PAT_A,t.FINDER_PAT_E,t.FINDER_PAT_B,t.FINDER_PAT_D,t.FINDER_PAT_D,t.FINDER_PAT_F],[t.FINDER_PAT_A,t.FINDER_PAT_E,t.FINDER_PAT_B,t.FINDER_PAT_D,t.FINDER_PAT_E,t.FINDER_PAT_F,t.FINDER_PAT_F],[t.FINDER_PAT_A,t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B,t.FINDER_PAT_C,t.FINDER_PAT_C,t.FINDER_PAT_D,t.FINDER_PAT_D],[t.FINDER_PAT_A,t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B,t.FINDER_PAT_C,t.FINDER_PAT_C,t.FINDER_PAT_D,t.FINDER_PAT_E,t.FINDER_PAT_E],[t.FINDER_PAT_A,t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B,t.FINDER_PAT_C,t.FINDER_PAT_C,t.FINDER_PAT_D,t.FINDER_PAT_E,t.FINDER_PAT_F,t.FINDER_PAT_F],[t.FINDER_PAT_A,t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B,t.FINDER_PAT_C,t.FINDER_PAT_D,t.FINDER_PAT_D,t.FINDER_PAT_E,t.FINDER_PAT_E,t.FINDER_PAT_F,t.FINDER_PAT_F]],t.MAX_PAIRS=11,t}(ND),SO=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),CO=function(e){function t(t,n,r){var i=e.call(this,t,n)||this;return i.count=0,i.finderPattern=r,i}return SO(t,e),t.prototype.getFinderPattern=function(){return this.finderPattern},t.prototype.getCount=function(){return this.count},t.prototype.incrementCount=function(){this.count++},t}(PD),wO=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),TO=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},EO=function(e){function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.possibleLeftPairs=[],t.possibleRightPairs=[],t}return wO(t,e),t.prototype.decodeRow=function(e,n,r){var i,a,o,s,c=this.decodePair(n,!1,e,r);t.addOrTally(this.possibleLeftPairs,c),n.reverse();var l=this.decodePair(n,!0,e,r);t.addOrTally(this.possibleRightPairs,l),n.reverse();try{for(var u=TO(this.possibleLeftPairs),d=u.next();!d.done;d=u.next()){var f=d.value;if(f.getCount()>1)try{for(var p=(o=void 0,TO(this.possibleRightPairs)),m=p.next();!m.done;m=p.next()){var h=m.value;if(h.getCount()>1&&t.checkChecksum(f,h))return t.constructResult(f,h)}}catch(e){o={error:e}}finally{try{m&&!m.done&&(s=p.return)&&s.call(p)}finally{if(o)throw o.error}}}}catch(e){i={error:e}}finally{try{d&&!d.done&&(a=u.return)&&a.call(u)}finally{if(i)throw i.error}}throw new Y},t.addOrTally=function(e,t){var n,r;if(t!=null){var i=!1;try{for(var a=TO(e),o=a.next();!o.done;o=a.next()){var s=o.value;if(s.getValue()===t.getValue()){s.incrementCount(),i=!0;break}}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}i||e.push(t)}},t.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},t.constructResult=function(e,t){for(var n=4537077*e.getValue()+t.getValue(),r=new String(n).toString(),i=new iE,a=13-r.length;a>0;a--)i.append(`0`);i.append(r);var o=0;for(a=0;a<13;a++){var s=i.charAt(a).charCodeAt(0)-48;o+=1&a?s:3*s}(o=10-o%10)==10&&(o=0),i.append(o.toString());var c=e.getFinderPattern().getResultPoints(),l=t.getFinderPattern().getResultPoints();return new xE(i.toString(),null,0,[c[0],c[1],l[0],l[1]],X.RSS_14,new Date().getTime())},t.checkChecksum=function(e,t){var n=(e.getChecksumPortion()+16*t.getChecksumPortion())%79,r=9*e.getFinderPattern().getValue()+t.getFinderPattern().getValue();return r>72&&r--,r>8&&r--,n===r},t.prototype.decodePair=function(e,t,n,r){try{var i=this.findFinderPattern(e,t),a=this.parseFoundFinderPattern(e,n,t,i),o=r==null?null:r.get(YT.NEED_RESULT_POINT_CALLBACK);if(o!=null){var s=(i[0]+i[1])/2;t&&(s=e.getSize()-1-s),o.foundPossibleResultPoint(new Z(s,n))}var c=this.decodeDataCharacter(e,a,!0),l=this.decodeDataCharacter(e,a,!1);return new CO(1597*c.getValue()+l.getValue(),c.getChecksumPortion()+4*l.getChecksumPortion(),a)}catch{return null}},t.prototype.decodeDataCharacter=function(e,n,r){for(var i=this.getDataCharacterCounters(),a=0;a<i.length;a++)i[a]=0;if(r)$E.recordPatternInReverse(e,n.getStartEnd()[0],i);else{$E.recordPattern(e,n.getStartEnd()[1]+1,i);for(var o=0,s=i.length-1;o<s;o++,s--){var c=i[o];i[o]=i[s],i[s]=c}}var l=r?16:15,u=RE.sum(new Int32Array(i))/l,d=this.getOddCounts(),f=this.getEvenCounts(),p=this.getOddRoundingErrors(),m=this.getEvenRoundingErrors();for(o=0;o<i.length;o++){var h=i[o]/u,g=Math.floor(h+.5);g<1?g=1:g>8&&(g=8);var _=Math.floor(o/2);1&o?(f[_]=g,m[_]=h-g):(d[_]=g,p[_]=h-g)}this.adjustOddEvenCounts(r,l);var v=0,y=0;for(o=d.length-1;o>=0;o--)y*=9,y+=d[o],v+=d[o];var b=0,x=0;for(o=f.length-1;o>=0;o--)b*=9,b+=f[o],x+=f[o];var S=y+3*b;if(r){if(1&v||v>12||v<4)throw new Y;var C=(12-v)/2,w=9-(k=t.OUTSIDE_ODD_WIDEST[C]),T=LD.getRSSvalue(d,k,!1),E=LD.getRSSvalue(f,w,!0),D=t.OUTSIDE_EVEN_TOTAL_SUBSET[C],O=t.OUTSIDE_GSUM[C];return new PD(T*D+E+O,S)}if(1&x||x>10||x<4)throw new Y;C=(10-x)/2,w=9-(k=t.INSIDE_ODD_WIDEST[C]),T=LD.getRSSvalue(d,k,!0),E=LD.getRSSvalue(f,w,!1);var k,A=t.INSIDE_ODD_TOTAL_SUBSET[C];return O=t.INSIDE_GSUM[C],new PD(E*A+T+O,S)},t.prototype.findFinderPattern=function(e,t){var n=this.getDecodeFinderCounters();n[0]=0,n[1]=0,n[2]=0,n[3]=0;for(var r=e.getSize(),i=!1,a=0;a<r&&t!==(i=!e.get(a));)a++;for(var o=0,s=a,c=a;c<r;c++)if(e.get(c)!==i)n[o]++;else{if(o===3){if(ND.isFinderPattern(n))return[s,c];s+=n[0]+n[1],n[0]=n[2],n[1]=n[3],n[2]=0,n[3]=0,o--}else o++;n[o]=1,i=!i}throw new Y},t.prototype.parseFoundFinderPattern=function(e,n,r,i){for(var a=e.get(i[0]),o=i[0]-1;o>=0&&a!==e.get(o);)o--;o++;var s=i[0]-o,c=this.getDecodeFinderCounters(),l=new Int32Array(c.length);zT.arraycopy(c,0,l,1,c.length-1),l[0]=s;var u=this.parseFinderValue(l,t.FINDER_PATTERNS),d=o,f=i[1];return r&&(d=e.getSize()-1-d,f=e.getSize()-1-f),new FD(u,[o,i[1]],d,f,n)},t.prototype.adjustOddEvenCounts=function(e,t){var n=RE.sum(new Int32Array(this.getOddCounts())),r=RE.sum(new Int32Array(this.getEvenCounts())),i=!1,a=!1,o=!1,s=!1;e?(n>12?a=!0:n<4&&(i=!0),r>12?s=!0:r<4&&(o=!0)):(n>11?a=!0:n<5&&(i=!0),r>10?s=!0:r<4&&(o=!0));var c=n+r-t,l=(1&n)==+!!e,u=(1&r)==1;if(c===1)if(l){if(u)throw new Y;a=!0}else{if(!u)throw new Y;s=!0}else if(c===-1)if(l){if(u)throw new Y;i=!0}else{if(!u)throw new Y;o=!0}else{if(c!==0)throw new Y;if(l){if(!u)throw new Y;n<r?(i=!0,s=!0):(a=!0,o=!0)}else if(u)throw new Y}if(i){if(a)throw new Y;ND.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(a&&ND.decrement(this.getOddCounts(),this.getOddRoundingErrors()),o){if(s)throw new Y;ND.increment(this.getEvenCounts(),this.getOddRoundingErrors())}s&&ND.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},t.OUTSIDE_EVEN_TOTAL_SUBSET=[1,10,34,70,126],t.INSIDE_ODD_TOTAL_SUBSET=[4,20,48,81],t.OUTSIDE_GSUM=[0,161,961,2015,2715],t.INSIDE_GSUM=[0,336,1036,1516],t.OUTSIDE_ODD_WIDEST=[8,6,4,3,1],t.INSIDE_ODD_WIDEST=[2,4,6,8],t.FINDER_PATTERNS=[Int32Array.from([3,8,2,1]),Int32Array.from([3,5,5,1]),Int32Array.from([3,3,7,1]),Int32Array.from([3,1,9,1]),Int32Array.from([2,7,4,1]),Int32Array.from([2,5,6,1]),Int32Array.from([2,3,8,1]),Int32Array.from([1,5,7,1]),Int32Array.from([1,3,9,1])],t}(ND),DO=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),OO=function(e){function t(t){var n=e.call(this)||this;n.readers=[];var r=t?t.get(YT.POSSIBLE_FORMATS):null,i=t&&t.get(YT.ASSUME_CODE_39_CHECK_DIGIT)!==void 0;return r&&((r.includes(X.EAN_13)||r.includes(X.UPC_A)||r.includes(X.EAN_8)||r.includes(X.UPC_E))&&n.readers.push(new AD(t)),r.includes(X.CODE_39)&&n.readers.push(new iD(i)),r.includes(X.CODE_128)&&n.readers.push(new tD),r.includes(X.ITF)&&n.readers.push(new sD),r.includes(X.RSS_14)&&n.readers.push(new EO),r.includes(X.RSS_EXPANDED)&&(console.warn(`RSS Expanded reader IS NOT ready for production yet! use at your own risk.`),n.readers.push(new xO))),n.readers.length===0&&(n.readers.push(new AD(t)),n.readers.push(new iD),n.readers.push(new AD(t)),n.readers.push(new tD),n.readers.push(new sD),n.readers.push(new EO)),n}return DO(t,e),t.prototype.decodeRow=function(e,t,n){for(var r=0;r<this.readers.length;r++)try{return this.readers[r].decodeRow(e,t,n)}catch{}throw new Y},t.prototype.reset=function(){this.readers.forEach((function(e){return e.reset()}))},t}($E),kO=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(t,n){return t===void 0&&(t=500),e.call(this,new OO(n),t,n)||this}kO(t,e)})(bE);var AO,jO=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},MO=function(){function e(e,t,n){this.ecCodewords=e,this.ecBlocks=[t],n&&this.ecBlocks.push(n)}return e.prototype.getECCodewords=function(){return this.ecCodewords},e.prototype.getECBlocks=function(){return this.ecBlocks},e}(),NO=function(){function e(e,t){this.count=e,this.dataCodewords=t}return e.prototype.getCount=function(){return this.count},e.prototype.getDataCodewords=function(){return this.dataCodewords},e}(),PO=function(){function e(e,t,n,r,i,a){var o,s;this.versionNumber=e,this.symbolSizeRows=t,this.symbolSizeColumns=n,this.dataRegionSizeRows=r,this.dataRegionSizeColumns=i,this.ecBlocks=a;var c=0,l=a.getECCodewords(),u=a.getECBlocks();try{for(var d=jO(u),f=d.next();!f.done;f=d.next()){var p=f.value;c+=p.getCount()*(p.getDataCodewords()+l)}}catch(e){o={error:e}}finally{try{f&&!f.done&&(s=d.return)&&s.call(d)}finally{if(o)throw o.error}}this.totalCodewords=c}return e.prototype.getVersionNumber=function(){return this.versionNumber},e.prototype.getSymbolSizeRows=function(){return this.symbolSizeRows},e.prototype.getSymbolSizeColumns=function(){return this.symbolSizeColumns},e.prototype.getDataRegionSizeRows=function(){return this.dataRegionSizeRows},e.prototype.getDataRegionSizeColumns=function(){return this.dataRegionSizeColumns},e.prototype.getTotalCodewords=function(){return this.totalCodewords},e.prototype.getECBlocks=function(){return this.ecBlocks},e.getVersionForDimensions=function(t,n){var r,i;if(1&t||1&n)throw new J;try{for(var a=jO(e.VERSIONS),o=a.next();!o.done;o=a.next()){var s=o.value;if(s.symbolSizeRows===t&&s.symbolSizeColumns===n)return s}}catch(e){r={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}throw new J},e.prototype.toString=function(){return``+this.versionNumber},e.buildVersions=function(){return[new e(1,10,10,8,8,new MO(5,new NO(1,3))),new e(2,12,12,10,10,new MO(7,new NO(1,5))),new e(3,14,14,12,12,new MO(10,new NO(1,8))),new e(4,16,16,14,14,new MO(12,new NO(1,12))),new e(5,18,18,16,16,new MO(14,new NO(1,18))),new e(6,20,20,18,18,new MO(18,new NO(1,22))),new e(7,22,22,20,20,new MO(20,new NO(1,30))),new e(8,24,24,22,22,new MO(24,new NO(1,36))),new e(9,26,26,24,24,new MO(28,new NO(1,44))),new e(10,32,32,14,14,new MO(36,new NO(1,62))),new e(11,36,36,16,16,new MO(42,new NO(1,86))),new e(12,40,40,18,18,new MO(48,new NO(1,114))),new e(13,44,44,20,20,new MO(56,new NO(1,144))),new e(14,48,48,22,22,new MO(68,new NO(1,174))),new e(15,52,52,24,24,new MO(42,new NO(2,102))),new e(16,64,64,14,14,new MO(56,new NO(2,140))),new e(17,72,72,16,16,new MO(36,new NO(4,92))),new e(18,80,80,18,18,new MO(48,new NO(4,114))),new e(19,88,88,20,20,new MO(56,new NO(4,144))),new e(20,96,96,22,22,new MO(68,new NO(4,174))),new e(21,104,104,24,24,new MO(56,new NO(6,136))),new e(22,120,120,18,18,new MO(68,new NO(6,175))),new e(23,132,132,20,20,new MO(62,new NO(8,163))),new e(24,144,144,22,22,new MO(62,new NO(8,156),new NO(2,155))),new e(25,8,18,6,16,new MO(7,new NO(1,5))),new e(26,8,32,6,14,new MO(11,new NO(1,10))),new e(27,12,26,10,24,new MO(14,new NO(1,16))),new e(28,12,36,10,16,new MO(18,new NO(1,22))),new e(29,16,36,14,16,new MO(24,new NO(1,32))),new e(30,16,48,14,22,new MO(28,new NO(1,49)))]},e.VERSIONS=e.buildVersions(),e}(),FO=function(){function e(t){var n=t.getHeight();if(n<8||n>144||1&n)throw new J;this.version=e.readVersion(t),this.mappingBitMatrix=this.extractDataRegion(t),this.readMappingMatrix=new aE(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return e.prototype.getVersion=function(){return this.version},e.readVersion=function(e){var t=e.getHeight(),n=e.getWidth();return PO.getVersionForDimensions(t,n)},e.prototype.readCodewords=function(){var e=new Int8Array(this.version.getTotalCodewords()),t=0,n=4,r=0,i=this.mappingBitMatrix.getHeight(),a=this.mappingBitMatrix.getWidth(),o=!1,s=!1,c=!1,l=!1;do if(n!==i||r!==0||o)if(n!==i-2||r!==0||!(3&a)||s)if(n!==i+4||r!==2||7&a||c)if(n!==i-2||r!==0||(7&a)!=4||l){do n<i&&r>=0&&!this.readMappingMatrix.get(r,n)&&(e[t++]=255&this.readUtah(n,r,i,a)),n-=2,r+=2;while(n>=0&&r<a);n+=1,r+=3;do n>=0&&r<a&&!this.readMappingMatrix.get(r,n)&&(e[t++]=255&this.readUtah(n,r,i,a)),n+=2,r-=2;while(n<i&&r>=0);n+=3,r+=1}else e[t++]=255&this.readCorner4(i,a),n-=2,r+=2,l=!0;else e[t++]=255&this.readCorner3(i,a),n-=2,r+=2,c=!0;else e[t++]=255&this.readCorner2(i,a),n-=2,r+=2,s=!0;else e[t++]=255&this.readCorner1(i,a),n-=2,r+=2,o=!0;while(n<i||r<a);if(t!==this.version.getTotalCodewords())throw new J;return e},e.prototype.readModule=function(e,t,n,r){return e<0&&(e+=n,t+=4-(n+4&7)),t<0&&(t+=r,e+=4-(r+4&7)),this.readMappingMatrix.set(t,e),this.mappingBitMatrix.get(t,e)},e.prototype.readUtah=function(e,t,n,r){var i=0;return this.readModule(e-2,t-2,n,r)&&(i|=1),i<<=1,this.readModule(e-2,t-1,n,r)&&(i|=1),i<<=1,this.readModule(e-1,t-2,n,r)&&(i|=1),i<<=1,this.readModule(e-1,t-1,n,r)&&(i|=1),i<<=1,this.readModule(e-1,t,n,r)&&(i|=1),i<<=1,this.readModule(e,t-2,n,r)&&(i|=1),i<<=1,this.readModule(e,t-1,n,r)&&(i|=1),i<<=1,this.readModule(e,t,n,r)&&(i|=1),i},e.prototype.readCorner1=function(e,t){var n=0;return this.readModule(e-1,0,e,t)&&(n|=1),n<<=1,this.readModule(e-1,1,e,t)&&(n|=1),n<<=1,this.readModule(e-1,2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-1,e,t)&&(n|=1),n<<=1,this.readModule(1,t-1,e,t)&&(n|=1),n<<=1,this.readModule(2,t-1,e,t)&&(n|=1),n<<=1,this.readModule(3,t-1,e,t)&&(n|=1),n},e.prototype.readCorner2=function(e,t){var n=0;return this.readModule(e-3,0,e,t)&&(n|=1),n<<=1,this.readModule(e-2,0,e,t)&&(n|=1),n<<=1,this.readModule(e-1,0,e,t)&&(n|=1),n<<=1,this.readModule(0,t-4,e,t)&&(n|=1),n<<=1,this.readModule(0,t-3,e,t)&&(n|=1),n<<=1,this.readModule(0,t-2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-1,e,t)&&(n|=1),n<<=1,this.readModule(1,t-1,e,t)&&(n|=1),n},e.prototype.readCorner3=function(e,t){var n=0;return this.readModule(e-1,0,e,t)&&(n|=1),n<<=1,this.readModule(e-1,t-1,e,t)&&(n|=1),n<<=1,this.readModule(0,t-3,e,t)&&(n|=1),n<<=1,this.readModule(0,t-2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-1,e,t)&&(n|=1),n<<=1,this.readModule(1,t-3,e,t)&&(n|=1),n<<=1,this.readModule(1,t-2,e,t)&&(n|=1),n<<=1,this.readModule(1,t-1,e,t)&&(n|=1),n},e.prototype.readCorner4=function(e,t){var n=0;return this.readModule(e-3,0,e,t)&&(n|=1),n<<=1,this.readModule(e-2,0,e,t)&&(n|=1),n<<=1,this.readModule(e-1,0,e,t)&&(n|=1),n<<=1,this.readModule(0,t-2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-1,e,t)&&(n|=1),n<<=1,this.readModule(1,t-1,e,t)&&(n|=1),n<<=1,this.readModule(2,t-1,e,t)&&(n|=1),n<<=1,this.readModule(3,t-1,e,t)&&(n|=1),n},e.prototype.extractDataRegion=function(e){var t=this.version.getSymbolSizeRows(),n=this.version.getSymbolSizeColumns();if(e.getHeight()!==t)throw new q(`Dimension of bitMatrix must match the version size`);for(var r=this.version.getDataRegionSizeRows(),i=this.version.getDataRegionSizeColumns(),a=t/r|0,o=n/i|0,s=new aE(o*i,a*r),c=0;c<a;++c)for(var l=c*r,u=0;u<o;++u)for(var d=u*i,f=0;f<r;++f)for(var p=c*(r+2)+1+f,m=l+f,h=0;h<i;++h){var g=u*(i+2)+1+h;if(e.get(g,p)){var _=d+h;s.set(_,m)}}return s},e}(),IO=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},LO=function(){function e(e,t){this.numDataCodewords=e,this.codewords=t}return e.getDataBlocks=function(t,n){var r,i,a,o,s=n.getECBlocks(),c=0,l=s.getECBlocks();try{for(var u=IO(l),d=u.next();!d.done;d=u.next())c+=(g=d.value).getCount()}catch(e){r={error:e}}finally{try{d&&!d.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}var f=Array(c),p=0;try{for(var m=IO(l),h=m.next();!h.done;h=m.next())for(var g=h.value,_=0;_<g.getCount();_++){var v=g.getDataCodewords(),y=s.getECCodewords()+v;f[p++]=new e(v,new Uint8Array(y))}}catch(e){a={error:e}}finally{try{h&&!h.done&&(o=m.return)&&o.call(m)}finally{if(a)throw a.error}}var b=f[0].codewords.length-s.getECCodewords(),x=b-1,S=0;for(_=0;_<x;_++)for(var C=0;C<p;C++)f[C].codewords[_]=t[S++];var w=n.getVersionNumber()===24,T=w?8:p;for(C=0;C<T;C++)f[C].codewords[b-1]=t[S++];var E=f[0].codewords.length;for(_=b;_<E;_++)for(C=0;C<p;C++){var D=w?(C+8)%p:C,O=w&&D>7?_-1:_;f[D].codewords[O]=t[S++]}if(S!==t.length)throw new q;return f},e.prototype.getNumDataCodewords=function(){return this.numDataCodewords},e.prototype.getCodewords=function(){return this.codewords},e}(),RO=function(){function e(e){this.bytes=e,this.byteOffset=0,this.bitOffset=0}return e.prototype.getBitOffset=function(){return this.bitOffset},e.prototype.getByteOffset=function(){return this.byteOffset},e.prototype.readBits=function(e){if(e<1||e>32||e>this.available())throw new q(``+e);var t=0,n=this.bitOffset,r=this.byteOffset,i=this.bytes;if(n>0){var a=8-n,o=e<a?e:a,s=255>>8-o<<(c=a-o);t=(i[r]&s)>>c,e-=o,(n+=o)===8&&(n=0,r++)}if(e>0){for(;e>=8;)t=t<<8|255&i[r],r++,e-=8;if(e>0){var c;s=255>>(c=8-e)<<c,t=t<<e|(i[r]&s)>>c,n+=e}}return this.bitOffset=n,this.byteOffset=r,t},e.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},e}();(function(e){e[e.PAD_ENCODE=0]=`PAD_ENCODE`,e[e.ASCII_ENCODE=1]=`ASCII_ENCODE`,e[e.C40_ENCODE=2]=`C40_ENCODE`,e[e.TEXT_ENCODE=3]=`TEXT_ENCODE`,e[e.ANSIX12_ENCODE=4]=`ANSIX12_ENCODE`,e[e.EDIFACT_ENCODE=5]=`EDIFACT_ENCODE`,e[e.BASE256_ENCODE=6]=`BASE256_ENCODE`})(AO||={});var zO,BO=function(){function e(){}return e.decode=function(e){var t=new RO(e),n=new iE,r=new iE,i=[],a=AO.ASCII_ENCODE;do if(a===AO.ASCII_ENCODE)a=this.decodeAsciiSegment(t,n,r);else{switch(a){case AO.C40_ENCODE:this.decodeC40Segment(t,n);break;case AO.TEXT_ENCODE:this.decodeTextSegment(t,n);break;case AO.ANSIX12_ENCODE:this.decodeAnsiX12Segment(t,n);break;case AO.EDIFACT_ENCODE:this.decodeEdifactSegment(t,n);break;case AO.BASE256_ENCODE:this.decodeBase256Segment(t,n,i);break;default:throw new J}a=AO.ASCII_ENCODE}while(a!==AO.PAD_ENCODE&&t.available()>0);return r.length()>0&&n.append(r.toString()),new TE(e,n.toString(),i.length===0?null:i,null)},e.decodeAsciiSegment=function(e,t,n){var r=!1;do{var i=e.readBits(8);if(i===0)throw new J;if(i<=128)return r&&(i+=128),t.append(String.fromCharCode(i-1)),AO.ASCII_ENCODE;if(i===129)return AO.PAD_ENCODE;if(i<=229){var a=i-130;a<10&&t.append(`0`),t.append(``+a)}else switch(i){case 230:return AO.C40_ENCODE;case 231:return AO.BASE256_ENCODE;case 232:t.append(``);break;case 233:case 234:case 241:break;case 235:r=!0;break;case 236:t.append(`[)>05`),n.insert(0,``);break;case 237:t.append(`[)>06`),n.insert(0,``);break;case 238:return AO.ANSIX12_ENCODE;case 239:return AO.TEXT_ENCODE;case 240:return AO.EDIFACT_ENCODE;default:if(i!==254||e.available()!==0)throw new J}}while(e.available()>0);return AO.ASCII_ENCODE},e.decodeC40Segment=function(e,t){var n=!1,r=[],i=0;do{if(e.available()===8)return;var a=e.readBits(8);if(a===254)return;this.parseTwoBytes(a,e.readBits(8),r);for(var o=0;o<3;o++){var s=r[o];switch(i){case 0:if(s<3)i=s+1;else{if(!(s<this.C40_BASIC_SET_CHARS.length))throw new J;var c=this.C40_BASIC_SET_CHARS[s];n?(t.append(String.fromCharCode(c.charCodeAt(0)+128)),n=!1):t.append(c)}break;case 1:n?(t.append(String.fromCharCode(s+128)),n=!1):t.append(String.fromCharCode(s)),i=0;break;case 2:if(s<this.C40_SHIFT2_SET_CHARS.length)c=this.C40_SHIFT2_SET_CHARS[s],n?(t.append(String.fromCharCode(c.charCodeAt(0)+128)),n=!1):t.append(c);else switch(s){case 27:t.append(``);break;case 30:n=!0;break;default:throw new J}i=0;break;case 3:n?(t.append(String.fromCharCode(s+224)),n=!1):t.append(String.fromCharCode(s+96)),i=0;break;default:throw new J}}}while(e.available()>0)},e.decodeTextSegment=function(e,t){var n=!1,r=[],i=0;do{if(e.available()===8)return;var a=e.readBits(8);if(a===254)return;this.parseTwoBytes(a,e.readBits(8),r);for(var o=0;o<3;o++){var s=r[o];switch(i){case 0:if(s<3)i=s+1;else{if(!(s<this.TEXT_BASIC_SET_CHARS.length))throw new J;var c=this.TEXT_BASIC_SET_CHARS[s];n?(t.append(String.fromCharCode(c.charCodeAt(0)+128)),n=!1):t.append(c)}break;case 1:n?(t.append(String.fromCharCode(s+128)),n=!1):t.append(String.fromCharCode(s)),i=0;break;case 2:if(s<this.TEXT_SHIFT2_SET_CHARS.length)c=this.TEXT_SHIFT2_SET_CHARS[s],n?(t.append(String.fromCharCode(c.charCodeAt(0)+128)),n=!1):t.append(c);else switch(s){case 27:t.append(``);break;case 30:n=!0;break;default:throw new J}i=0;break;case 3:if(!(s<this.TEXT_SHIFT3_SET_CHARS.length))throw new J;c=this.TEXT_SHIFT3_SET_CHARS[s],n?(t.append(String.fromCharCode(c.charCodeAt(0)+128)),n=!1):t.append(c),i=0;break;default:throw new J}}}while(e.available()>0)},e.decodeAnsiX12Segment=function(e,t){var n=[];do{if(e.available()===8)return;var r=e.readBits(8);if(r===254)return;this.parseTwoBytes(r,e.readBits(8),n);for(var i=0;i<3;i++){var a=n[i];switch(a){case 0:t.append(`\r`);break;case 1:t.append(`*`);break;case 2:t.append(`>`);break;case 3:t.append(` `);break;default:if(a<14)t.append(String.fromCharCode(a+44));else{if(!(a<40))throw new J;t.append(String.fromCharCode(a+51))}}}}while(e.available()>0)},e.parseTwoBytes=function(e,t,n){var r=(e<<8)+t-1,i=Math.floor(r/1600);n[0]=i,r-=1600*i,i=Math.floor(r/40),n[1]=i,n[2]=r-40*i},e.decodeEdifactSegment=function(e,t){do{if(e.available()<=16)return;for(var n=0;n<4;n++){var r=e.readBits(6);if(r===31){var i=8-e.getBitOffset();i!==8&&e.readBits(i);return}!(32&r)&&(r|=64),t.append(String.fromCharCode(r))}}while(e.available()>0)},e.decodeBase256Segment=function(e,t,n){var r,i=1+e.getByteOffset(),a=this.unrandomize255State(e.readBits(8),i++);if((r=a===0?e.available()/8|0:a<250?a:250*(a-249)+this.unrandomize255State(e.readBits(8),i++))<0)throw new J;for(var o=new Uint8Array(r),s=0;s<r;s++){if(e.available()<8)throw new J;o[s]=this.unrandomize255State(e.readBits(8),i++)}n.push(o);try{t.append(nE.decode(o,rE.ISO88591))}catch(e){throw new FE(`Platform does not support required encoding: `+e.message)}},e.unrandomize255State=function(e,t){var n=e-(149*t%255+1);return n>=0?n:n+256},e.C40_BASIC_SET_CHARS=`*** 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ`.split(``),e.C40_SHIFT2_SET_CHARS=`!"#$%&'()*+,-./:;<=>?@[\\]^_`.split(``),e.TEXT_BASIC_SET_CHARS=`*** 0123456789abcdefghijklmnopqrstuvwxyz`.split(``),e.TEXT_SHIFT2_SET_CHARS=e.C40_SHIFT2_SET_CHARS,e.TEXT_SHIFT3_SET_CHARS="`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~".split(``),e}(),VO=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},HO=function(){function e(){this.rsDecoder=new IE(jE.DATA_MATRIX_FIELD_256)}return e.prototype.decode=function(e){var t,n,r=new FO(e),i=r.getVersion(),a=r.readCodewords(),o=LO.getDataBlocks(a,i),s=0;try{for(var c=VO(o),l=c.next();!l.done;l=c.next())s+=l.value.getNumDataCodewords()}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}for(var u=new Uint8Array(s),d=o.length,f=0;f<d;f++){var p=o[f],m=p.getCodewords(),h=p.getNumDataCodewords();this.correctErrors(m,h);for(var g=0;g<h;g++)u[g*d+f]=m[g]}return BO.decode(u)},e.prototype.correctErrors=function(e,t){var n=new Int32Array(e);try{this.rsDecoder.decode(n,e.length-t)}catch{throw new LT}for(var r=0;r<t;r++)e[r]=n[r]},e}(),UO=function(){function e(e){this.image=e,this.rectangleDetector=new UE(this.image)}return e.prototype.detect=function(){var t=this.rectangleDetector.detect(),n=this.detectSolid1(t);if((n=this.detectSolid2(n))[3]=this.correctTopRight(n),!n[3])throw new Y;var r=(n=this.shiftToModuleCenter(n))[0],i=n[1],a=n[2],o=n[3],s=this.transitionsBetween(r,o)+1,c=this.transitionsBetween(a,o)+1;return(1&s)==1&&(s+=1),(1&c)==1&&(c+=1),4*s<7*c&&4*c<7*s&&(s=c=Math.max(s,c)),new BE(e.sampleGrid(this.image,r,i,a,o,s,c),[r,i,a,o])},e.shiftPoint=function(e,t,n){var r=(t.getX()-e.getX())/(n+1),i=(t.getY()-e.getY())/(n+1);return new Z(e.getX()+r,e.getY()+i)},e.moveAway=function(e,t,n){var r=e.getX(),i=e.getY();return r<t?--r:r+=1,i<n?--i:i+=1,new Z(r,i)},e.prototype.detectSolid1=function(e){var t=e[0],n=e[1],r=e[3],i=e[2],a=this.transitionsBetween(t,n),o=this.transitionsBetween(n,r),s=this.transitionsBetween(r,i),c=this.transitionsBetween(i,t),l=a,u=[i,t,n,r];return l>o&&(l=o,u[0]=t,u[1]=n,u[2]=r,u[3]=i),l>s&&(l=s,u[0]=n,u[1]=r,u[2]=i,u[3]=t),l>c&&(u[0]=r,u[1]=i,u[2]=t,u[3]=n),u},e.prototype.detectSolid2=function(t){var n=t[0],r=t[1],i=t[2],a=t[3],o=this.transitionsBetween(n,a),s=e.shiftPoint(r,i,4*(o+1)),c=e.shiftPoint(i,r,4*(o+1));return this.transitionsBetween(s,n)<this.transitionsBetween(c,a)?(t[0]=n,t[1]=r,t[2]=i,t[3]=a):(t[0]=r,t[1]=i,t[2]=a,t[3]=n),t},e.prototype.correctTopRight=function(t){var n=t[0],r=t[1],i=t[2],a=t[3],o=this.transitionsBetween(n,a),s=this.transitionsBetween(r,a),c=e.shiftPoint(n,r,4*(s+1)),l=e.shiftPoint(i,r,4*(o+1));o=this.transitionsBetween(c,a),s=this.transitionsBetween(l,a);var u=new Z(a.getX()+(i.getX()-r.getX())/(o+1),a.getY()+(i.getY()-r.getY())/(o+1)),d=new Z(a.getX()+(n.getX()-r.getX())/(s+1),a.getY()+(n.getY()-r.getY())/(s+1));return this.isValid(u)?this.isValid(d)?this.transitionsBetween(c,u)+this.transitionsBetween(l,u)>this.transitionsBetween(c,d)+this.transitionsBetween(l,d)?u:d:u:this.isValid(d)?d:null},e.prototype.shiftToModuleCenter=function(t){var n=t[0],r=t[1],i=t[2],a=t[3],o=this.transitionsBetween(n,a)+1,s=this.transitionsBetween(i,a)+1,c=e.shiftPoint(n,r,4*s),l=e.shiftPoint(i,r,4*o);(1&(o=this.transitionsBetween(c,a)+1))==1&&(o+=1),(1&(s=this.transitionsBetween(l,a)+1))==1&&(s+=1);var u,d,f=(n.getX()+r.getX()+i.getX()+a.getX())/4,p=(n.getY()+r.getY()+i.getY()+a.getY())/4;return n=e.moveAway(n,f,p),r=e.moveAway(r,f,p),i=e.moveAway(i,f,p),a=e.moveAway(a,f,p),c=e.shiftPoint(n,r,4*s),c=e.shiftPoint(c,a,4*o),u=e.shiftPoint(r,n,4*s),u=e.shiftPoint(u,i,4*o),l=e.shiftPoint(i,a,4*s),l=e.shiftPoint(l,r,4*o),d=e.shiftPoint(a,i,4*s),[c,u,l,d=e.shiftPoint(d,n,4*o)]},e.prototype.isValid=function(e){return e.getX()>=0&&e.getX()<this.image.getWidth()&&e.getY()>0&&e.getY()<this.image.getHeight()},e.sampleGrid=function(e,t,n,r,i,a,o){return JE.getInstance().sampleGrid(e,a,o,.5,.5,a-.5,.5,a-.5,o-.5,.5,o-.5,t.getX(),t.getY(),i.getX(),i.getY(),r.getX(),r.getY(),n.getX(),n.getY())},e.prototype.transitionsBetween=function(e,t){var n=Math.trunc(e.getX()),r=Math.trunc(e.getY()),i=Math.trunc(t.getX()),a=Math.trunc(t.getY()),o=Math.abs(a-r)>Math.abs(i-n);if(o){var s=n;n=r,r=s,s=i,i=a,a=s}for(var c=Math.abs(i-n),l=Math.abs(a-r),u=-c/2,d=r<a?1:-1,f=n<i?1:-1,p=0,m=this.image.get(o?r:n,o?n:r),h=n,g=r;h!==i;h+=f){var _=this.image.get(o?g:h,o?h:g);if(_!==m&&(p++,m=_),(u+=l)>0){if(g===a)break;g+=d,u-=c}}return p},e}(),WO=function(){function e(){this.decoder=new HO}return e.prototype.decode=function(t,n){var r,i;if(n===void 0&&(n=null),n!=null&&n.has(YT.PURE_BARCODE)){var a=e.extractPureBits(t.getBlackMatrix());r=this.decoder.decode(a),i=e.NO_POINTS}else{var o=new UO(t.getBlackMatrix()).detect();r=this.decoder.decode(o.getBits()),i=o.getPoints()}var s=r.getRawBytes(),c=new xE(r.getText(),s,8*s.length,i,X.DATA_MATRIX,zT.currentTimeMillis()),l=r.getByteSegments();l!=null&&c.putMetadata(wE.BYTE_SEGMENTS,l);var u=r.getECLevel();return u!=null&&c.putMetadata(wE.ERROR_CORRECTION_LEVEL,u),c},e.prototype.reset=function(){},e.extractPureBits=function(e){var t=e.getTopLeftOnBit(),n=e.getBottomRightOnBit();if(t==null||n==null)throw new Y;var r=this.moduleSize(t,e),i=t[1],a=n[1],o=t[0],s=(n[0]-o+1)/r,c=(a-i+1)/r;if(s<=0||c<=0)throw new Y;var l=r/2;i+=l,o+=l;for(var u=new aE(s,c),d=0;d<c;d++)for(var f=i+d*r,p=0;p<s;p++)e.get(o+p*r,f)&&u.set(p,d);return u},e.moduleSize=function(e,t){for(var n=t.getWidth(),r=e[0],i=e[1];r<n&&t.get(r,i);)r++;if(r===n)throw new Y;var a=r-e[0];if(a===0)throw new Y;return a},e.NO_POINTS=[],e}(),GO=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(t){return t===void 0&&(t=500),e.call(this,new WO,t)||this}GO(t,e)})(bE),function(e){e[e.L=0]=`L`,e[e.M=1]=`M`,e[e.Q=2]=`Q`,e[e.H=3]=`H`}(zO||={});var KO,qO=function(){function e(t,n,r){this.value=t,this.stringValue=n,this.bits=r,e.FOR_BITS.set(r,this),e.FOR_VALUE.set(t,this)}return e.prototype.getValue=function(){return this.value},e.prototype.getBits=function(){return this.bits},e.fromString=function(t){switch(t){case`L`:return e.L;case`M`:return e.M;case`Q`:return e.Q;case`H`:return e.H;default:throw new NT(t+`not available`)}},e.prototype.toString=function(){return this.stringValue},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.value===n.value},e.forBits=function(t){if(t<0||t>=e.FOR_BITS.size)throw new q;return e.FOR_BITS.get(t)},e.FOR_BITS=new Map,e.FOR_VALUE=new Map,e.L=new e(zO.L,`L`,1),e.M=new e(zO.M,`M`,0),e.Q=new e(zO.Q,`Q`,3),e.H=new e(zO.H,`H`,2),e}(),JO=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},YO=function(){function e(e){this.errorCorrectionLevel=qO.forBits(e>>3&3),this.dataMask=7&e}return e.numBitsDiffering=function(e,t){return KT.bitCount(e^t)},e.decodeFormatInformation=function(t,n){var r=e.doDecodeFormatInformation(t,n);return r===null?e.doDecodeFormatInformation(t^e.FORMAT_INFO_MASK_QR,n^e.FORMAT_INFO_MASK_QR):r},e.doDecodeFormatInformation=function(t,n){var r,i,a=2**53-1,o=0;try{for(var s=JO(e.FORMAT_INFO_DECODE_LOOKUP),c=s.next();!c.done;c=s.next()){var l=c.value,u=l[0];if(u===t||u===n)return new e(l[1]);var d=e.numBitsDiffering(t,u);d<a&&(o=l[1],a=d),t!==n&&(d=e.numBitsDiffering(n,u))<a&&(o=l[1],a=d)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return a<=3?new e(o):null},e.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},e.prototype.getDataMask=function(){return this.dataMask},e.prototype.hashCode=function(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.errorCorrectionLevel===n.errorCorrectionLevel&&this.dataMask===n.dataMask},e.FORMAT_INFO_MASK_QR=21522,e.FORMAT_INFO_DECODE_LOOKUP=[Int32Array.from([21522,0]),Int32Array.from([20773,1]),Int32Array.from([24188,2]),Int32Array.from([23371,3]),Int32Array.from([17913,4]),Int32Array.from([16590,5]),Int32Array.from([20375,6]),Int32Array.from([19104,7]),Int32Array.from([30660,8]),Int32Array.from([29427,9]),Int32Array.from([32170,10]),Int32Array.from([30877,11]),Int32Array.from([26159,12]),Int32Array.from([25368,13]),Int32Array.from([27713,14]),Int32Array.from([26998,15]),Int32Array.from([5769,16]),Int32Array.from([5054,17]),Int32Array.from([7399,18]),Int32Array.from([6608,19]),Int32Array.from([1890,20]),Int32Array.from([597,21]),Int32Array.from([3340,22]),Int32Array.from([2107,23]),Int32Array.from([13663,24]),Int32Array.from([12392,25]),Int32Array.from([16177,26]),Int32Array.from([14854,27]),Int32Array.from([9396,28]),Int32Array.from([8579,29]),Int32Array.from([11994,30]),Int32Array.from([11245,31])],e}(),XO=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Q=function(){function e(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.ecCodewordsPerBlock=e,this.ecBlocks=t}return e.prototype.getECCodewordsPerBlock=function(){return this.ecCodewordsPerBlock},e.prototype.getNumBlocks=function(){var e,t,n=0,r=this.ecBlocks;try{for(var i=XO(r),a=i.next();!a.done;a=i.next())n+=a.value.getCount()}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return n},e.prototype.getTotalECCodewords=function(){return this.ecCodewordsPerBlock*this.getNumBlocks()},e.prototype.getECBlocks=function(){return this.ecBlocks},e}(),$=function(){function e(e,t){this.count=e,this.dataCodewords=t}return e.prototype.getCount=function(){return this.count},e.prototype.getDataCodewords=function(){return this.dataCodewords},e}(),ZO=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},QO=function(){function e(e,t){for(var n,r,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];this.versionNumber=e,this.alignmentPatternCenters=t,this.ecBlocks=i;var o=0,s=i[0].getECCodewordsPerBlock(),c=i[0].getECBlocks();try{for(var l=ZO(c),u=l.next();!u.done;u=l.next()){var d=u.value;o+=d.getCount()*(d.getDataCodewords()+s)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}this.totalCodewords=o}return e.prototype.getVersionNumber=function(){return this.versionNumber},e.prototype.getAlignmentPatternCenters=function(){return this.alignmentPatternCenters},e.prototype.getTotalCodewords=function(){return this.totalCodewords},e.prototype.getDimensionForVersion=function(){return 17+4*this.versionNumber},e.prototype.getECBlocksForLevel=function(e){return this.ecBlocks[e.getValue()]},e.getProvisionalVersionForDimension=function(e){if(e%4!=1)throw new J;try{return this.getVersionForNumber((e-17)/4)}catch{throw new J}},e.getVersionForNumber=function(t){if(t<1||t>40)throw new q;return e.VERSIONS[t-1]},e.decodeVersionInformation=function(t){for(var n=2**53-1,r=0,i=0;i<e.VERSION_DECODE_INFO.length;i++){var a=e.VERSION_DECODE_INFO[i];if(a===t)return e.getVersionForNumber(i+7);var o=YO.numBitsDiffering(t,a);o<n&&(r=i+7,n=o)}return n<=3?e.getVersionForNumber(r):null},e.prototype.buildFunctionPattern=function(){var e=this.getDimensionForVersion(),t=new aE(e);t.setRegion(0,0,9,9),t.setRegion(e-8,0,8,9),t.setRegion(0,e-8,9,8);for(var n=this.alignmentPatternCenters.length,r=0;r<n;r++)for(var i=this.alignmentPatternCenters[r]-2,a=0;a<n;a++)r===0&&(a===0||a===n-1)||r===n-1&&a===0||t.setRegion(this.alignmentPatternCenters[a]-2,i,5,5);return t.setRegion(6,9,1,e-17),t.setRegion(9,6,e-17,1),this.versionNumber>6&&(t.setRegion(e-11,0,3,6),t.setRegion(0,e-11,6,3)),t},e.prototype.toString=function(){return``+this.versionNumber},e.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),e.VERSIONS=[new e(1,new Int32Array,new Q(7,new $(1,19)),new Q(10,new $(1,16)),new Q(13,new $(1,13)),new Q(17,new $(1,9))),new e(2,Int32Array.from([6,18]),new Q(10,new $(1,34)),new Q(16,new $(1,28)),new Q(22,new $(1,22)),new Q(28,new $(1,16))),new e(3,Int32Array.from([6,22]),new Q(15,new $(1,55)),new Q(26,new $(1,44)),new Q(18,new $(2,17)),new Q(22,new $(2,13))),new e(4,Int32Array.from([6,26]),new Q(20,new $(1,80)),new Q(18,new $(2,32)),new Q(26,new $(2,24)),new Q(16,new $(4,9))),new e(5,Int32Array.from([6,30]),new Q(26,new $(1,108)),new Q(24,new $(2,43)),new Q(18,new $(2,15),new $(2,16)),new Q(22,new $(2,11),new $(2,12))),new e(6,Int32Array.from([6,34]),new Q(18,new $(2,68)),new Q(16,new $(4,27)),new Q(24,new $(4,19)),new Q(28,new $(4,15))),new e(7,Int32Array.from([6,22,38]),new Q(20,new $(2,78)),new Q(18,new $(4,31)),new Q(18,new $(2,14),new $(4,15)),new Q(26,new $(4,13),new $(1,14))),new e(8,Int32Array.from([6,24,42]),new Q(24,new $(2,97)),new Q(22,new $(2,38),new $(2,39)),new Q(22,new $(4,18),new $(2,19)),new Q(26,new $(4,14),new $(2,15))),new e(9,Int32Array.from([6,26,46]),new Q(30,new $(2,116)),new Q(22,new $(3,36),new $(2,37)),new Q(20,new $(4,16),new $(4,17)),new Q(24,new $(4,12),new $(4,13))),new e(10,Int32Array.from([6,28,50]),new Q(18,new $(2,68),new $(2,69)),new Q(26,new $(4,43),new $(1,44)),new Q(24,new $(6,19),new $(2,20)),new Q(28,new $(6,15),new $(2,16))),new e(11,Int32Array.from([6,30,54]),new Q(20,new $(4,81)),new Q(30,new $(1,50),new $(4,51)),new Q(28,new $(4,22),new $(4,23)),new Q(24,new $(3,12),new $(8,13))),new e(12,Int32Array.from([6,32,58]),new Q(24,new $(2,92),new $(2,93)),new Q(22,new $(6,36),new $(2,37)),new Q(26,new $(4,20),new $(6,21)),new Q(28,new $(7,14),new $(4,15))),new e(13,Int32Array.from([6,34,62]),new Q(26,new $(4,107)),new Q(22,new $(8,37),new $(1,38)),new Q(24,new $(8,20),new $(4,21)),new Q(22,new $(12,11),new $(4,12))),new e(14,Int32Array.from([6,26,46,66]),new Q(30,new $(3,115),new $(1,116)),new Q(24,new $(4,40),new $(5,41)),new Q(20,new $(11,16),new $(5,17)),new Q(24,new $(11,12),new $(5,13))),new e(15,Int32Array.from([6,26,48,70]),new Q(22,new $(5,87),new $(1,88)),new Q(24,new $(5,41),new $(5,42)),new Q(30,new $(5,24),new $(7,25)),new Q(24,new $(11,12),new $(7,13))),new e(16,Int32Array.from([6,26,50,74]),new Q(24,new $(5,98),new $(1,99)),new Q(28,new $(7,45),new $(3,46)),new Q(24,new $(15,19),new $(2,20)),new Q(30,new $(3,15),new $(13,16))),new e(17,Int32Array.from([6,30,54,78]),new Q(28,new $(1,107),new $(5,108)),new Q(28,new $(10,46),new $(1,47)),new Q(28,new $(1,22),new $(15,23)),new Q(28,new $(2,14),new $(17,15))),new e(18,Int32Array.from([6,30,56,82]),new Q(30,new $(5,120),new $(1,121)),new Q(26,new $(9,43),new $(4,44)),new Q(28,new $(17,22),new $(1,23)),new Q(28,new $(2,14),new $(19,15))),new e(19,Int32Array.from([6,30,58,86]),new Q(28,new $(3,113),new $(4,114)),new Q(26,new $(3,44),new $(11,45)),new Q(26,new $(17,21),new $(4,22)),new Q(26,new $(9,13),new $(16,14))),new e(20,Int32Array.from([6,34,62,90]),new Q(28,new $(3,107),new $(5,108)),new Q(26,new $(3,41),new $(13,42)),new Q(30,new $(15,24),new $(5,25)),new Q(28,new $(15,15),new $(10,16))),new e(21,Int32Array.from([6,28,50,72,94]),new Q(28,new $(4,116),new $(4,117)),new Q(26,new $(17,42)),new Q(28,new $(17,22),new $(6,23)),new Q(30,new $(19,16),new $(6,17))),new e(22,Int32Array.from([6,26,50,74,98]),new Q(28,new $(2,111),new $(7,112)),new Q(28,new $(17,46)),new Q(30,new $(7,24),new $(16,25)),new Q(24,new $(34,13))),new e(23,Int32Array.from([6,30,54,78,102]),new Q(30,new $(4,121),new $(5,122)),new Q(28,new $(4,47),new $(14,48)),new Q(30,new $(11,24),new $(14,25)),new Q(30,new $(16,15),new $(14,16))),new e(24,Int32Array.from([6,28,54,80,106]),new Q(30,new $(6,117),new $(4,118)),new Q(28,new $(6,45),new $(14,46)),new Q(30,new $(11,24),new $(16,25)),new Q(30,new $(30,16),new $(2,17))),new e(25,Int32Array.from([6,32,58,84,110]),new Q(26,new $(8,106),new $(4,107)),new Q(28,new $(8,47),new $(13,48)),new Q(30,new $(7,24),new $(22,25)),new Q(30,new $(22,15),new $(13,16))),new e(26,Int32Array.from([6,30,58,86,114]),new Q(28,new $(10,114),new $(2,115)),new Q(28,new $(19,46),new $(4,47)),new Q(28,new $(28,22),new $(6,23)),new Q(30,new $(33,16),new $(4,17))),new e(27,Int32Array.from([6,34,62,90,118]),new Q(30,new $(8,122),new $(4,123)),new Q(28,new $(22,45),new $(3,46)),new Q(30,new $(8,23),new $(26,24)),new Q(30,new $(12,15),new $(28,16))),new e(28,Int32Array.from([6,26,50,74,98,122]),new Q(30,new $(3,117),new $(10,118)),new Q(28,new $(3,45),new $(23,46)),new Q(30,new $(4,24),new $(31,25)),new Q(30,new $(11,15),new $(31,16))),new e(29,Int32Array.from([6,30,54,78,102,126]),new Q(30,new $(7,116),new $(7,117)),new Q(28,new $(21,45),new $(7,46)),new Q(30,new $(1,23),new $(37,24)),new Q(30,new $(19,15),new $(26,16))),new e(30,Int32Array.from([6,26,52,78,104,130]),new Q(30,new $(5,115),new $(10,116)),new Q(28,new $(19,47),new $(10,48)),new Q(30,new $(15,24),new $(25,25)),new Q(30,new $(23,15),new $(25,16))),new e(31,Int32Array.from([6,30,56,82,108,134]),new Q(30,new $(13,115),new $(3,116)),new Q(28,new $(2,46),new $(29,47)),new Q(30,new $(42,24),new $(1,25)),new Q(30,new $(23,15),new $(28,16))),new e(32,Int32Array.from([6,34,60,86,112,138]),new Q(30,new $(17,115)),new Q(28,new $(10,46),new $(23,47)),new Q(30,new $(10,24),new $(35,25)),new Q(30,new $(19,15),new $(35,16))),new e(33,Int32Array.from([6,30,58,86,114,142]),new Q(30,new $(17,115),new $(1,116)),new Q(28,new $(14,46),new $(21,47)),new Q(30,new $(29,24),new $(19,25)),new Q(30,new $(11,15),new $(46,16))),new e(34,Int32Array.from([6,34,62,90,118,146]),new Q(30,new $(13,115),new $(6,116)),new Q(28,new $(14,46),new $(23,47)),new Q(30,new $(44,24),new $(7,25)),new Q(30,new $(59,16),new $(1,17))),new e(35,Int32Array.from([6,30,54,78,102,126,150]),new Q(30,new $(12,121),new $(7,122)),new Q(28,new $(12,47),new $(26,48)),new Q(30,new $(39,24),new $(14,25)),new Q(30,new $(22,15),new $(41,16))),new e(36,Int32Array.from([6,24,50,76,102,128,154]),new Q(30,new $(6,121),new $(14,122)),new Q(28,new $(6,47),new $(34,48)),new Q(30,new $(46,24),new $(10,25)),new Q(30,new $(2,15),new $(64,16))),new e(37,Int32Array.from([6,28,54,80,106,132,158]),new Q(30,new $(17,122),new $(4,123)),new Q(28,new $(29,46),new $(14,47)),new Q(30,new $(49,24),new $(10,25)),new Q(30,new $(24,15),new $(46,16))),new e(38,Int32Array.from([6,32,58,84,110,136,162]),new Q(30,new $(4,122),new $(18,123)),new Q(28,new $(13,46),new $(32,47)),new Q(30,new $(48,24),new $(14,25)),new Q(30,new $(42,15),new $(32,16))),new e(39,Int32Array.from([6,26,54,82,110,138,166]),new Q(30,new $(20,117),new $(4,118)),new Q(28,new $(40,47),new $(7,48)),new Q(30,new $(43,24),new $(22,25)),new Q(30,new $(10,15),new $(67,16))),new e(40,Int32Array.from([6,30,58,86,114,142,170]),new Q(30,new $(19,118),new $(6,119)),new Q(28,new $(18,47),new $(31,48)),new Q(30,new $(34,24),new $(34,25)),new Q(30,new $(20,15),new $(61,16)))],e}();(function(e){e[e.DATA_MASK_000=0]=`DATA_MASK_000`,e[e.DATA_MASK_001=1]=`DATA_MASK_001`,e[e.DATA_MASK_010=2]=`DATA_MASK_010`,e[e.DATA_MASK_011=3]=`DATA_MASK_011`,e[e.DATA_MASK_100=4]=`DATA_MASK_100`,e[e.DATA_MASK_101=5]=`DATA_MASK_101`,e[e.DATA_MASK_110=6]=`DATA_MASK_110`,e[e.DATA_MASK_111=7]=`DATA_MASK_111`})(KO||={});var $O,ek=function(){function e(e,t){this.value=e,this.isMasked=t}return e.prototype.unmaskBitMatrix=function(e,t){for(var n=0;n<t;n++)for(var r=0;r<t;r++)this.isMasked(n,r)&&e.flip(r,n)},e.values=new Map([[KO.DATA_MASK_000,new e(KO.DATA_MASK_000,(function(e,t){return(e+t&1)==0}))],[KO.DATA_MASK_001,new e(KO.DATA_MASK_001,(function(e,t){return(1&e)==0}))],[KO.DATA_MASK_010,new e(KO.DATA_MASK_010,(function(e,t){return t%3==0}))],[KO.DATA_MASK_011,new e(KO.DATA_MASK_011,(function(e,t){return(e+t)%3==0}))],[KO.DATA_MASK_100,new e(KO.DATA_MASK_100,(function(e,t){return(Math.floor(e/2)+Math.floor(t/3)&1)==0}))],[KO.DATA_MASK_101,new e(KO.DATA_MASK_101,(function(e,t){return e*t%6==0}))],[KO.DATA_MASK_110,new e(KO.DATA_MASK_110,(function(e,t){return e*t%6<3}))],[KO.DATA_MASK_111,new e(KO.DATA_MASK_111,(function(e,t){return(e+t+e*t%3&1)==0}))]]),e}(),tk=function(){function e(e){var t=e.getHeight();if(t<21||(3&t)!=1)throw new J;this.bitMatrix=e}return e.prototype.readFormatInformation=function(){if(this.parsedFormatInfo!==null&&this.parsedFormatInfo!==void 0)return this.parsedFormatInfo;for(var e=0,t=0;t<6;t++)e=this.copyBit(t,8,e);e=this.copyBit(7,8,e),e=this.copyBit(8,8,e),e=this.copyBit(8,7,e);for(var n=5;n>=0;n--)e=this.copyBit(8,n,e);var r=this.bitMatrix.getHeight(),i=0,a=r-7;for(n=r-1;n>=a;n--)i=this.copyBit(8,n,i);for(t=r-8;t<r;t++)i=this.copyBit(t,8,i);if(this.parsedFormatInfo=YO.decodeFormatInformation(e,i),this.parsedFormatInfo!==null)return this.parsedFormatInfo;throw new J},e.prototype.readVersion=function(){if(this.parsedVersion!==null&&this.parsedVersion!==void 0)return this.parsedVersion;var e=this.bitMatrix.getHeight(),t=Math.floor((e-17)/4);if(t<=6)return QO.getVersionForNumber(t);for(var n=0,r=e-11,i=5;i>=0;i--)for(var a=e-9;a>=r;a--)n=this.copyBit(a,i,n);var o=QO.decodeVersionInformation(n);if(o!==null&&o.getDimensionForVersion()===e)return this.parsedVersion=o,o;for(n=0,a=5;a>=0;a--)for(i=e-9;i>=r;i--)n=this.copyBit(a,i,n);if((o=QO.decodeVersionInformation(n))!==null&&o.getDimensionForVersion()===e)return this.parsedVersion=o,o;throw new J},e.prototype.copyBit=function(e,t,n){return(this.isMirror?this.bitMatrix.get(t,e):this.bitMatrix.get(e,t))?n<<1|1:n<<1},e.prototype.readCodewords=function(){var e=this.readFormatInformation(),t=this.readVersion(),n=ek.values.get(e.getDataMask()),r=this.bitMatrix.getHeight();n.unmaskBitMatrix(this.bitMatrix,r);for(var i=t.buildFunctionPattern(),a=!0,o=new Uint8Array(t.getTotalCodewords()),s=0,c=0,l=0,u=r-1;u>0;u-=2){u===6&&u--;for(var d=0;d<r;d++)for(var f=a?r-1-d:d,p=0;p<2;p++)i.get(u-p,f)||(l++,c<<=1,this.bitMatrix.get(u-p,f)&&(c|=1),l===8&&(o[s++]=c,l=0,c=0));a=!a}if(s!==t.getTotalCodewords())throw new J;return o},e.prototype.remask=function(){if(this.parsedFormatInfo!==null){var e=ek.values[this.parsedFormatInfo.getDataMask()],t=this.bitMatrix.getHeight();e.unmaskBitMatrix(this.bitMatrix,t)}},e.prototype.setMirror=function(e){this.parsedVersion=null,this.parsedFormatInfo=null,this.isMirror=e},e.prototype.mirror=function(){for(var e=this.bitMatrix,t=0,n=e.getWidth();t<n;t++)for(var r=t+1,i=e.getHeight();r<i;r++)e.get(t,r)!==e.get(r,t)&&(e.flip(r,t),e.flip(t,r))},e}(),nk=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},rk=function(){function e(e,t){this.numDataCodewords=e,this.codewords=t}return e.getDataBlocks=function(t,n,r){var i,a,o,s;if(t.length!==n.getTotalCodewords())throw new q;var c=n.getECBlocksForLevel(r),l=0,u=c.getECBlocks();try{for(var d=nk(u),f=d.next();!f.done;f=d.next())l+=(_=f.value).getCount()}catch(e){i={error:e}}finally{try{f&&!f.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}var p=Array(l),m=0;try{for(var h=nk(u),g=h.next();!g.done;g=h.next())for(var _=g.value,v=0;v<_.getCount();v++){var y=_.getDataCodewords(),b=c.getECCodewordsPerBlock()+y;p[m++]=new e(y,new Uint8Array(b))}}catch(e){o={error:e}}finally{try{g&&!g.done&&(s=h.return)&&s.call(h)}finally{if(o)throw o.error}}for(var x=p[0].codewords.length,S=p.length-1;S>=0&&p[S].codewords.length!==x;)S--;S++;var C=x-c.getECCodewordsPerBlock(),w=0;for(v=0;v<C;v++)for(var T=0;T<m;T++)p[T].codewords[v]=t[w++];for(T=S;T<m;T++)p[T].codewords[C]=t[w++];var E=p[0].codewords.length;for(v=C;v<E;v++)for(T=0;T<m;T++){var D=T<S?v:v+1;p[T].codewords[D]=t[w++]}return p},e.prototype.getNumDataCodewords=function(){return this.numDataCodewords},e.prototype.getCodewords=function(){return this.codewords},e}();(function(e){e[e.TERMINATOR=0]=`TERMINATOR`,e[e.NUMERIC=1]=`NUMERIC`,e[e.ALPHANUMERIC=2]=`ALPHANUMERIC`,e[e.STRUCTURED_APPEND=3]=`STRUCTURED_APPEND`,e[e.BYTE=4]=`BYTE`,e[e.ECI=5]=`ECI`,e[e.KANJI=6]=`KANJI`,e[e.FNC1_FIRST_POSITION=7]=`FNC1_FIRST_POSITION`,e[e.FNC1_SECOND_POSITION=8]=`FNC1_SECOND_POSITION`,e[e.HANZI=9]=`HANZI`})($O||={});var ik,ak,ok=function(){function e(t,n,r,i){this.value=t,this.stringValue=n,this.characterCountBitsForVersions=r,this.bits=i,e.FOR_BITS.set(i,this),e.FOR_VALUE.set(t,this)}return e.forBits=function(t){var n=e.FOR_BITS.get(t);if(n===void 0)throw new q;return n},e.prototype.getCharacterCountBits=function(e){var t,n=e.getVersionNumber();return t=n<=9?0:n<=26?1:2,this.characterCountBitsForVersions[t]},e.prototype.getValue=function(){return this.value},e.prototype.getBits=function(){return this.bits},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.value===n.value},e.prototype.toString=function(){return this.stringValue},e.FOR_BITS=new Map,e.FOR_VALUE=new Map,e.TERMINATOR=new e($O.TERMINATOR,`TERMINATOR`,Int32Array.from([0,0,0]),0),e.NUMERIC=new e($O.NUMERIC,`NUMERIC`,Int32Array.from([10,12,14]),1),e.ALPHANUMERIC=new e($O.ALPHANUMERIC,`ALPHANUMERIC`,Int32Array.from([9,11,13]),2),e.STRUCTURED_APPEND=new e($O.STRUCTURED_APPEND,`STRUCTURED_APPEND`,Int32Array.from([0,0,0]),3),e.BYTE=new e($O.BYTE,`BYTE`,Int32Array.from([8,16,16]),4),e.ECI=new e($O.ECI,`ECI`,Int32Array.from([0,0,0]),7),e.KANJI=new e($O.KANJI,`KANJI`,Int32Array.from([8,10,12]),8),e.FNC1_FIRST_POSITION=new e($O.FNC1_FIRST_POSITION,`FNC1_FIRST_POSITION`,Int32Array.from([0,0,0]),5),e.FNC1_SECOND_POSITION=new e($O.FNC1_SECOND_POSITION,`FNC1_SECOND_POSITION`,Int32Array.from([0,0,0]),9),e.HANZI=new e($O.HANZI,`HANZI`,Int32Array.from([8,10,12]),13),e}(),sk=function(){function e(){}return e.decode=function(t,n,r,i){var a=new RO(t),o=new iE,s=[],c=-1,l=-1;try{var u=null,d=!1,f=void 0;do{if(a.available()<4)f=ok.TERMINATOR;else{var p=a.readBits(4);f=ok.forBits(p)}switch(f){case ok.TERMINATOR:break;case ok.FNC1_FIRST_POSITION:case ok.FNC1_SECOND_POSITION:d=!0;break;case ok.STRUCTURED_APPEND:if(a.available()<16)throw new J;c=a.readBits(8),l=a.readBits(8);break;case ok.ECI:var m=e.parseECIValue(a);if((u=$T.getCharacterSetECIByValue(m))===null)throw new J;break;case ok.HANZI:var h=a.readBits(4),g=a.readBits(f.getCharacterCountBits(n));h===e.GB2312_SUBSET&&e.decodeHanziSegment(a,o,g);break;default:var _=a.readBits(f.getCharacterCountBits(n));switch(f){case ok.NUMERIC:e.decodeNumericSegment(a,o,_);break;case ok.ALPHANUMERIC:e.decodeAlphanumericSegment(a,o,_,d);break;case ok.BYTE:e.decodeByteSegment(a,o,_,u,s,i);break;case ok.KANJI:e.decodeKanjiSegment(a,o,_);break;default:throw new J}}}while(f!==ok.TERMINATOR)}catch{throw new J}return new TE(t,o.toString(),s.length===0?null:s,r===null?null:r.toString(),c,l)},e.decodeHanziSegment=function(e,t,n){if(13*n>e.available())throw new J;for(var r=new Uint8Array(2*n),i=0;n>0;){var a=e.readBits(13),o=a/96<<8&4294967295|a%96;o+=o<959?41377:42657,r[i]=o>>8&255,r[i+1]=255&o,i+=2,n--}try{t.append(nE.decode(r,rE.GB2312))}catch(e){throw new J(e)}},e.decodeKanjiSegment=function(e,t,n){if(13*n>e.available())throw new J;for(var r=new Uint8Array(2*n),i=0;n>0;){var a=e.readBits(13),o=a/192<<8&4294967295|a%192;o+=o<7936?33088:49472,r[i]=o>>8,r[i+1]=o,i+=2,n--}try{t.append(nE.decode(r,rE.SHIFT_JIS))}catch(e){throw new J(e)}},e.decodeByteSegment=function(e,t,n,r,i,a){if(8*n>e.available())throw new J;for(var o,s=new Uint8Array(n),c=0;c<n;c++)s[c]=e.readBits(8);o=r===null?rE.guessEncoding(s,a):r.getName();try{t.append(nE.decode(s,o))}catch(e){throw new J(e)}i.push(s)},e.toAlphaNumericChar=function(t){if(t>=e.ALPHANUMERIC_CHARS.length)throw new J;return e.ALPHANUMERIC_CHARS[t]},e.decodeAlphanumericSegment=function(t,n,r,i){for(var a=n.length();r>1;){if(t.available()<11)throw new J;var o=t.readBits(11);n.append(e.toAlphaNumericChar(Math.floor(o/45))),n.append(e.toAlphaNumericChar(o%45)),r-=2}if(r===1){if(t.available()<6)throw new J;n.append(e.toAlphaNumericChar(t.readBits(6)))}if(i)for(var s=a;s<n.length();s++)n.charAt(s)===`%`&&(s<n.length()-1&&n.charAt(s+1)===`%`?n.deleteCharAt(s+1):n.setCharAt(s,``))},e.decodeNumericSegment=function(t,n,r){for(;r>=3;){if(t.available()<10)throw new J;var i=t.readBits(10);if(i>=1e3)throw new J;n.append(e.toAlphaNumericChar(Math.floor(i/100))),n.append(e.toAlphaNumericChar(Math.floor(i/10)%10)),n.append(e.toAlphaNumericChar(i%10)),r-=3}if(r===2){if(t.available()<7)throw new J;var a=t.readBits(7);if(a>=100)throw new J;n.append(e.toAlphaNumericChar(Math.floor(a/10))),n.append(e.toAlphaNumericChar(a%10))}else if(r===1){if(t.available()<4)throw new J;var o=t.readBits(4);if(o>=10)throw new J;n.append(e.toAlphaNumericChar(o))}},e.parseECIValue=function(e){var t=e.readBits(8);if(!(128&t))return 127&t;if((192&t)==128)return(63&t)<<8&4294967295|e.readBits(8);if((224&t)==192)return(31&t)<<16&4294967295|e.readBits(16);throw new J},e.ALPHANUMERIC_CHARS=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`,e.GB2312_SUBSET=1,e}(),ck=function(){function e(e){this.mirrored=e}return e.prototype.isMirrored=function(){return this.mirrored},e.prototype.applyMirroredCorrection=function(e){if(this.mirrored&&e!==null&&!(e.length<3)){var t=e[0];e[0]=e[2],e[2]=t}},e}(),lk=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},uk=function(){function e(){this.rsDecoder=new IE(jE.QR_CODE_FIELD_256)}return e.prototype.decodeBooleanArray=function(e,t){return this.decodeBitMatrix(aE.parseFromBooleanArray(e),t)},e.prototype.decodeBitMatrix=function(e,t){var n=new tk(e),r=null;try{return this.decodeBitMatrixParser(n,t)}catch(e){r=e}try{n.remask(),n.setMirror(!0),n.readVersion(),n.readFormatInformation(),n.mirror();var i=this.decodeBitMatrixParser(n,t);return i.setOther(new ck(!0)),i}catch(e){throw r===null?e:r}},e.prototype.decodeBitMatrixParser=function(e,t){var n,r,i,a,o=e.readVersion(),s=e.readFormatInformation().getErrorCorrectionLevel(),c=e.readCodewords(),l=rk.getDataBlocks(c,o,s),u=0;try{for(var d=lk(l),f=d.next();!f.done;f=d.next())u+=(_=f.value).getNumDataCodewords()}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}var p=new Uint8Array(u),m=0;try{for(var h=lk(l),g=h.next();!g.done;g=h.next()){var _,v=(_=g.value).getCodewords(),y=_.getNumDataCodewords();this.correctErrors(v,y);for(var b=0;b<y;b++)p[m++]=v[b]}}catch(e){i={error:e}}finally{try{g&&!g.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}return sk.decode(p,o,s,t)},e.prototype.correctErrors=function(e,t){var n=new Int32Array(e);try{this.rsDecoder.decode(n,e.length-t)}catch{throw new LT}for(var r=0;r<t;r++)e[r]=n[r]},e}(),dk=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),fk=function(e){function t(t,n,r){var i=e.call(this,t,n)||this;return i.estimatedModuleSize=r,i}return dk(t,e),t.prototype.aboutEquals=function(e,t,n){if(Math.abs(t-this.getY())<=e&&Math.abs(n-this.getX())<=e){var r=Math.abs(e-this.estimatedModuleSize);return r<=1||r<=this.estimatedModuleSize}return!1},t.prototype.combineEstimate=function(e,n,r){return new t((this.getX()+n)/2,(this.getY()+e)/2,(this.estimatedModuleSize+r)/2)},t}(Z),pk=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},mk=function(){function e(e,t,n,r,i,a,o){this.image=e,this.startX=t,this.startY=n,this.width=r,this.height=i,this.moduleSize=a,this.resultPointCallback=o,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}return e.prototype.find=function(){for(var e=this.startX,t=this.height,n=e+this.width,r=this.startY+t/2,i=new Int32Array(3),a=this.image,o=0;o<t;o++){var s=r+(1&o?-Math.floor((o+1)/2):Math.floor((o+1)/2));i[0]=0,i[1]=0,i[2]=0;for(var c=e;c<n&&!a.get(c,s);)c++;for(var l=0;c<n;){if(a.get(c,s))if(l===1)i[1]++;else if(l===2){var u;if(this.foundPatternCross(i)&&(u=this.handlePossibleCenter(i,s,c))!==null)return u;i[0]=i[2],i[1]=1,i[2]=0,l=1}else i[++l]++;else l===1&&l++,i[l]++;c++}if(this.foundPatternCross(i)&&(u=this.handlePossibleCenter(i,s,n))!==null)return u}if(this.possibleCenters.length!==0)return this.possibleCenters[0];throw new Y},e.centerFromEnd=function(e,t){return t-e[2]-e[1]/2},e.prototype.foundPatternCross=function(e){for(var t=this.moduleSize,n=t/2,r=0;r<3;r++)if(Math.abs(t-e[r])>=n)return!1;return!0},e.prototype.crossCheckVertical=function(t,n,r,i){var a=this.image,o=a.getHeight(),s=this.crossCheckStateCount;s[0]=0,s[1]=0,s[2]=0;for(var c=t;c>=0&&a.get(n,c)&&s[1]<=r;)s[1]++,c--;if(c<0||s[1]>r)return NaN;for(;c>=0&&!a.get(n,c)&&s[0]<=r;)s[0]++,c--;if(s[0]>r)return NaN;for(c=t+1;c<o&&a.get(n,c)&&s[1]<=r;)s[1]++,c++;if(c===o||s[1]>r)return NaN;for(;c<o&&!a.get(n,c)&&s[2]<=r;)s[2]++,c++;if(s[2]>r)return NaN;var l=s[0]+s[1]+s[2];return 5*Math.abs(l-i)>=2*i?NaN:this.foundPatternCross(s)?e.centerFromEnd(s,c):NaN},e.prototype.handlePossibleCenter=function(t,n,r){var i,a,o=t[0]+t[1]+t[2],s=e.centerFromEnd(t,r),c=this.crossCheckVertical(n,s,2*t[1],o);if(!isNaN(c)){var l=(t[0]+t[1]+t[2])/3;try{for(var u=pk(this.possibleCenters),d=u.next();!d.done;d=u.next()){var f=d.value;if(f.aboutEquals(l,c,s))return f.combineEstimate(c,s,l)}}catch(e){i={error:e}}finally{try{d&&!d.done&&(a=u.return)&&a.call(u)}finally{if(i)throw i.error}}var p=new fk(s,c,l);this.possibleCenters.push(p),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(p)}return null},e}(),hk=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),gk=function(e){function t(t,n,r,i){var a=e.call(this,t,n)||this;return a.estimatedModuleSize=r,a.count=i,i===void 0&&(a.count=1),a}return hk(t,e),t.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},t.prototype.getCount=function(){return this.count},t.prototype.aboutEquals=function(e,t,n){if(Math.abs(t-this.getY())<=e&&Math.abs(n-this.getX())<=e){var r=Math.abs(e-this.estimatedModuleSize);return r<=1||r<=this.estimatedModuleSize}return!1},t.prototype.combineEstimate=function(e,n,r){var i=this.count+1;return new t((this.count*this.getX()+n)/i,(this.count*this.getY()+e)/i,(this.count*this.estimatedModuleSize+r)/i,i)},t}(Z),_k=function(){function e(e){this.bottomLeft=e[0],this.topLeft=e[1],this.topRight=e[2]}return e.prototype.getBottomLeft=function(){return this.bottomLeft},e.prototype.getTopLeft=function(){return this.topLeft},e.prototype.getTopRight=function(){return this.topRight},e}(),vk=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},yk=function(){function e(e,t){this.image=e,this.resultPointCallback=t,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=t}return e.prototype.getImage=function(){return this.image},e.prototype.getPossibleCenters=function(){return this.possibleCenters},e.prototype.find=function(t){var n=t!=null&&t.get(YT.TRY_HARDER)!==void 0,r=t!=null&&t.get(YT.PURE_BARCODE)!==void 0,i=this.image,a=i.getHeight(),o=i.getWidth(),s=Math.floor(3*a/(4*e.MAX_MODULES));(s<e.MIN_SKIP||n)&&(s=e.MIN_SKIP);for(var c=!1,l=new Int32Array(5),u=s-1;u<a&&!c;u+=s){l[0]=0,l[1]=0,l[2]=0,l[3]=0,l[4]=0;for(var d=0,f=0;f<o;f++)if(i.get(f,u))(1&d)==1&&d++,l[d]++;else if(1&d)l[d]++;else if(d===4)if(e.foundPatternCross(l)){if(!0!==this.handlePossibleCenter(l,u,f,r)){l[0]=l[2],l[1]=l[3],l[2]=l[4],l[3]=1,l[4]=0,d=3;continue}if(s=2,!0===this.hasSkipped)c=this.haveMultiplyConfirmedCenters();else{var p=this.findRowSkip();p>l[2]&&(u+=p-l[2]-s,f=o-1)}d=0,l[0]=0,l[1]=0,l[2]=0,l[3]=0,l[4]=0}else l[0]=l[2],l[1]=l[3],l[2]=l[4],l[3]=1,l[4]=0,d=3;else l[++d]++;e.foundPatternCross(l)&&!0===this.handlePossibleCenter(l,u,o,r)&&(s=l[0],this.hasSkipped&&(c=this.haveMultiplyConfirmedCenters()))}var m=this.selectBestPatterns();return Z.orderBestPatterns(m),new _k(m)},e.centerFromEnd=function(e,t){return t-e[4]-e[3]-e[2]/2},e.foundPatternCross=function(e){for(var t=0,n=0;n<5;n++){var r=e[n];if(r===0)return!1;t+=r}if(t<7)return!1;var i=t/7,a=i/2;return Math.abs(i-e[0])<a&&Math.abs(i-e[1])<a&&Math.abs(3*i-e[2])<3*a&&Math.abs(i-e[3])<a&&Math.abs(i-e[4])<a},e.prototype.getCrossCheckStateCount=function(){var e=this.crossCheckStateCount;return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e},e.prototype.crossCheckDiagonal=function(t,n,r,i){for(var a=this.getCrossCheckStateCount(),o=0,s=this.image;t>=o&&n>=o&&s.get(n-o,t-o);)a[2]++,o++;if(t<o||n<o)return!1;for(;t>=o&&n>=o&&!s.get(n-o,t-o)&&a[1]<=r;)a[1]++,o++;if(t<o||n<o||a[1]>r)return!1;for(;t>=o&&n>=o&&s.get(n-o,t-o)&&a[0]<=r;)a[0]++,o++;if(a[0]>r)return!1;var c=s.getHeight(),l=s.getWidth();for(o=1;t+o<c&&n+o<l&&s.get(n+o,t+o);)a[2]++,o++;if(t+o>=c||n+o>=l)return!1;for(;t+o<c&&n+o<l&&!s.get(n+o,t+o)&&a[3]<r;)a[3]++,o++;if(t+o>=c||n+o>=l||a[3]>=r)return!1;for(;t+o<c&&n+o<l&&s.get(n+o,t+o)&&a[4]<r;)a[4]++,o++;if(a[4]>=r)return!1;var u=a[0]+a[1]+a[2]+a[3]+a[4];return Math.abs(u-i)<2*i&&e.foundPatternCross(a)},e.prototype.crossCheckVertical=function(t,n,r,i){for(var a=this.image,o=a.getHeight(),s=this.getCrossCheckStateCount(),c=t;c>=0&&a.get(n,c);)s[2]++,c--;if(c<0)return NaN;for(;c>=0&&!a.get(n,c)&&s[1]<=r;)s[1]++,c--;if(c<0||s[1]>r)return NaN;for(;c>=0&&a.get(n,c)&&s[0]<=r;)s[0]++,c--;if(s[0]>r)return NaN;for(c=t+1;c<o&&a.get(n,c);)s[2]++,c++;if(c===o)return NaN;for(;c<o&&!a.get(n,c)&&s[3]<r;)s[3]++,c++;if(c===o||s[3]>=r)return NaN;for(;c<o&&a.get(n,c)&&s[4]<r;)s[4]++,c++;if(s[4]>=r)return NaN;var l=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(l-i)>=2*i?NaN:e.foundPatternCross(s)?e.centerFromEnd(s,c):NaN},e.prototype.crossCheckHorizontal=function(t,n,r,i){for(var a=this.image,o=a.getWidth(),s=this.getCrossCheckStateCount(),c=t;c>=0&&a.get(c,n);)s[2]++,c--;if(c<0)return NaN;for(;c>=0&&!a.get(c,n)&&s[1]<=r;)s[1]++,c--;if(c<0||s[1]>r)return NaN;for(;c>=0&&a.get(c,n)&&s[0]<=r;)s[0]++,c--;if(s[0]>r)return NaN;for(c=t+1;c<o&&a.get(c,n);)s[2]++,c++;if(c===o)return NaN;for(;c<o&&!a.get(c,n)&&s[3]<r;)s[3]++,c++;if(c===o||s[3]>=r)return NaN;for(;c<o&&a.get(c,n)&&s[4]<r;)s[4]++,c++;if(s[4]>=r)return NaN;var l=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(l-i)>=i?NaN:e.foundPatternCross(s)?e.centerFromEnd(s,c):NaN},e.prototype.handlePossibleCenter=function(t,n,r,i){var a=t[0]+t[1]+t[2]+t[3]+t[4],o=e.centerFromEnd(t,r),s=this.crossCheckVertical(n,Math.floor(o),t[2],a);if(!isNaN(s)&&(o=this.crossCheckHorizontal(Math.floor(o),Math.floor(s),t[2],a),!isNaN(o)&&(!i||this.crossCheckDiagonal(Math.floor(s),Math.floor(o),t[2],a)))){for(var c=a/7,l=!1,u=this.possibleCenters,d=0,f=u.length;d<f;d++){var p=u[d];if(p.aboutEquals(c,s,o)){u[d]=p.combineEstimate(s,o,c),l=!0;break}}if(!l){var m=new gk(o,s,c);u.push(m),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(m)}return!0}return!1},e.prototype.findRowSkip=function(){var t,n;if(this.possibleCenters.length<=1)return 0;var r=null;try{for(var i=vk(this.possibleCenters),a=i.next();!a.done;a=i.next()){var o=a.value;if(o.getCount()>=e.CENTER_QUORUM){if(r!=null)return this.hasSkipped=!0,Math.floor((Math.abs(r.getX()-o.getX())-Math.abs(r.getY()-o.getY()))/2);r=o}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return 0},e.prototype.haveMultiplyConfirmedCenters=function(){var t,n,r,i,a=0,o=0,s=this.possibleCenters.length;try{for(var c=vk(this.possibleCenters),l=c.next();!l.done;l=c.next())(m=l.value).getCount()>=e.CENTER_QUORUM&&(a++,o+=m.getEstimatedModuleSize())}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}if(a<3)return!1;var u=o/s,d=0;try{for(var f=vk(this.possibleCenters),p=f.next();!p.done;p=f.next()){var m=p.value;d+=Math.abs(m.getEstimatedModuleSize()-u)}}catch(e){r={error:e}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}return d<=.05*o},e.prototype.selectBestPatterns=function(){var e,t,n,r,i=this.possibleCenters.length;if(i<3)throw new Y;var a,o=this.possibleCenters;if(i>3){var s=0,c=0;try{for(var l=vk(this.possibleCenters),u=l.next();!u.done;u=l.next()){var d=u.value.getEstimatedModuleSize();s+=d,c+=d*d}}catch(t){e={error:t}}finally{try{u&&!u.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}a=s/i;var f=Math.sqrt(c/i-a*a);o.sort((function(e,t){var n=Math.abs(t.getEstimatedModuleSize()-a),r=Math.abs(e.getEstimatedModuleSize()-a);return n<r?-1:+(n>r)}));for(var p=Math.max(.2*a,f),m=0;m<o.length&&o.length>3;m++){var h=o[m];Math.abs(h.getEstimatedModuleSize()-a)>p&&(o.splice(m,1),m--)}}if(o.length>3){s=0;try{for(var g=vk(o),_=g.next();!_.done;_=g.next())s+=_.value.getEstimatedModuleSize()}catch(e){n={error:e}}finally{try{_&&!_.done&&(r=g.return)&&r.call(g)}finally{if(n)throw n.error}}a=s/o.length,o.sort((function(e,t){if(t.getCount()===e.getCount()){var n=Math.abs(t.getEstimatedModuleSize()-a),r=Math.abs(e.getEstimatedModuleSize()-a);return n<r?1:n>r?-1:0}return t.getCount()-e.getCount()})),o.splice(3)}return[o[0],o[1],o[2]]},e.CENTER_QUORUM=2,e.MIN_SKIP=3,e.MAX_MODULES=57,e}(),bk=function(){function e(e){this.image=e}return e.prototype.getImage=function(){return this.image},e.prototype.getResultPointCallback=function(){return this.resultPointCallback},e.prototype.detect=function(e){this.resultPointCallback=e==null?null:e.get(YT.NEED_RESULT_POINT_CALLBACK);var t=new yk(this.image,this.resultPointCallback).find(e);return this.processFinderPatternInfo(t)},e.prototype.processFinderPatternInfo=function(t){var n=t.getTopLeft(),r=t.getTopRight(),i=t.getBottomLeft(),a=this.calculateModuleSize(n,r,i);if(a<1)throw new Y(`No pattern found in proccess finder.`);var o=e.computeDimension(n,r,i,a),s=QO.getProvisionalVersionForDimension(o),c=s.getDimensionForVersion()-7,l=null;if(s.getAlignmentPatternCenters().length>0)for(var u=r.getX()-n.getX()+i.getX(),d=r.getY()-n.getY()+i.getY(),f=1-3/c,p=Math.floor(n.getX()+f*(u-n.getX())),m=Math.floor(n.getY()+f*(d-n.getY())),h=4;h<=16;h<<=1)try{l=this.findAlignmentInRegion(a,p,m,h);break}catch(e){if(!(e instanceof Y))throw e}var g=e.createTransform(n,r,i,l,o);return new BE(e.sampleGrid(this.image,g,o),l===null?[i,n,r]:[i,n,r,l])},e.createTransform=function(e,t,n,r,i){var a,o,s,c,l=i-3.5;return r===null?(a=t.getX()-e.getX()+n.getX(),o=t.getY()-e.getY()+n.getY(),s=l,c=l):(a=r.getX(),o=r.getY(),c=s=l-3),GE.quadrilateralToQuadrilateral(3.5,3.5,l,3.5,s,c,3.5,l,e.getX(),e.getY(),t.getX(),t.getY(),a,o,n.getX(),n.getY())},e.sampleGrid=function(e,t,n){return JE.getInstance().sampleGridWithTransform(e,n,n,t)},e.computeDimension=function(e,t,n,r){var i=RE.round(Z.distance(e,t)/r),a=RE.round(Z.distance(e,n)/r),o=Math.floor((i+a)/2)+7;switch(3&o){case 0:o++;break;case 2:o--;break;case 3:throw new Y(`Dimensions could be not found.`)}return o},e.prototype.calculateModuleSize=function(e,t,n){return(this.calculateModuleSizeOneWay(e,t)+this.calculateModuleSizeOneWay(e,n))/2},e.prototype.calculateModuleSizeOneWay=function(e,t){var n=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY())),r=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(e.getX()),Math.floor(e.getY()));return isNaN(n)?r/7:isNaN(r)?n/7:(n+r)/14},e.prototype.sizeOfBlackWhiteBlackRunBothWays=function(e,t,n,r){var i=this.sizeOfBlackWhiteBlackRun(e,t,n,r),a=1,o=e-(n-e);o<0?(a=e/(e-o),o=0):o>=this.image.getWidth()&&(a=(this.image.getWidth()-1-e)/(o-e),o=this.image.getWidth()-1);var s=Math.floor(t-(r-t)*a);return a=1,s<0?(a=t/(t-s),s=0):s>=this.image.getHeight()&&(a=(this.image.getHeight()-1-t)/(s-t),s=this.image.getHeight()-1),o=Math.floor(e+(o-e)*a),(i+=this.sizeOfBlackWhiteBlackRun(e,t,o,s))-1},e.prototype.sizeOfBlackWhiteBlackRun=function(e,t,n,r){var i=Math.abs(r-t)>Math.abs(n-e);if(i){var a=e;e=t,t=a,a=n,n=r,r=a}for(var o=Math.abs(n-e),s=Math.abs(r-t),c=-o/2,l=e<n?1:-1,u=t<r?1:-1,d=0,f=n+l,p=e,m=t;p!==f;p+=l){var h=i?m:p,g=i?p:m;if(d===1===this.image.get(h,g)){if(d===2)return RE.distance(p,m,e,t);d++}if((c+=s)>0){if(m===r)break;m+=u,c-=o}}return d===2?RE.distance(n+l,r,e,t):NaN},e.prototype.findAlignmentInRegion=function(e,t,n,r){var i=Math.floor(r*e),a=Math.max(0,t-i),o=Math.min(this.image.getWidth()-1,t+i);if(o-a<3*e)throw new Y(`Alignment top exceeds estimated module size.`);var s=Math.max(0,n-i),c=Math.min(this.image.getHeight()-1,n+i);if(c-s<3*e)throw new Y(`Alignment bottom exceeds estimated module size.`);return new mk(this.image,a,s,o-a,c-s,e,this.resultPointCallback).find()},e}(),xk=function(){function e(){this.decoder=new uk}return e.prototype.getDecoder=function(){return this.decoder},e.prototype.decode=function(t,n){var r,i;if(n!=null&&n.get(YT.PURE_BARCODE)!==void 0){var a=e.extractPureBits(t.getBlackMatrix());r=this.decoder.decodeBitMatrix(a,n),i=e.NO_POINTS}else{var o=new bk(t.getBlackMatrix()).detect(n);r=this.decoder.decodeBitMatrix(o.getBits(),n),i=o.getPoints()}r.getOther()instanceof ck&&r.getOther().applyMirroredCorrection(i);var s=new xE(r.getText(),r.getRawBytes(),void 0,i,X.QR_CODE,void 0),c=r.getByteSegments();c!==null&&s.putMetadata(wE.BYTE_SEGMENTS,c);var l=r.getECLevel();return l!==null&&s.putMetadata(wE.ERROR_CORRECTION_LEVEL,l),r.hasStructuredAppend()&&(s.putMetadata(wE.STRUCTURED_APPEND_SEQUENCE,r.getStructuredAppendSequenceNumber()),s.putMetadata(wE.STRUCTURED_APPEND_PARITY,r.getStructuredAppendParity())),s},e.prototype.reset=function(){},e.extractPureBits=function(e){var t=e.getTopLeftOnBit(),n=e.getBottomRightOnBit();if(t===null||n===null)throw new Y;var r=this.moduleSize(t,e),i=t[1],a=n[1],o=t[0],s=n[0];if(o>=s||i>=a||a-i!=s-o&&(s=o+(a-i))>=e.getWidth())throw new Y;var c=Math.round((s-o+1)/r),l=Math.round((a-i+1)/r);if(c<=0||l<=0||l!==c)throw new Y;var u=Math.floor(r/2);i+=u;var d=(o+=u)+Math.floor((c-1)*r)-s;if(d>0){if(d>u)throw new Y;o-=d}var f=i+Math.floor((l-1)*r)-a;if(f>0){if(f>u)throw new Y;i-=f}for(var p=new aE(c,l),m=0;m<l;m++)for(var h=i+Math.floor(m*r),g=0;g<c;g++)e.get(o+Math.floor(g*r),h)&&p.set(g,m);return p},e.moduleSize=function(e,t){for(var n=t.getHeight(),r=t.getWidth(),i=e[0],a=e[1],o=!0,s=0;i<r&&a<n;){if(o!==t.get(i,a)){if(++s==5)break;o=!o}i++,a++}if(i===r||a===n)throw new Y;return(i-e[0])/7},e.NO_POINTS=[],e}(),Sk=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Ck=function(){function e(){}return e.prototype.PDF417Common=function(){},e.getBitCountSum=function(e){return RE.sum(e)},e.toIntArray=function(t){var n,r;if(t==null||!t.length)return e.EMPTY_INT_ARRAY;var i=new Int32Array(t.length),a=0;try{for(var o=Sk(t),s=o.next();!s.done;s=o.next()){var c=s.value;i[a++]=c}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},e.getCodeword=function(t){var n=GT.binarySearch(e.SYMBOL_TABLE,262143&t);return n<0?-1:(e.CODEWORD_TABLE[n]-1)%e.NUMBER_OF_CODEWORDS},e.NUMBER_OF_CODEWORDS=929,e.MAX_CODEWORDS_IN_BARCODE=e.NUMBER_OF_CODEWORDS-1,e.MIN_ROWS_IN_BARCODE=3,e.MAX_ROWS_IN_BARCODE=90,e.MODULES_IN_CODEWORD=17,e.MODULES_IN_STOP_PATTERN=18,e.BARS_IN_MODULE=8,e.EMPTY_INT_ARRAY=new Int32Array([]),e.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),e.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]),e}(),wk=function(){function e(e,t){this.bits=e,this.points=t}return e.prototype.getBits=function(){return this.bits},e.prototype.getPoints=function(){return this.points},e}(),Tk=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Ek=function(){function e(){}return e.detectMultiple=function(t,n,r){var i=t.getBlackMatrix(),a=e.detect(r,i);return a.length||((i=i.clone()).rotate180(),a=e.detect(r,i)),new wk(i,a)},e.detect=function(t,n){for(var r,i,a=[],o=0,s=0,c=!1;o<n.getHeight();){var l=e.findVertices(n,o,s);if(l[0]!=null||l[3]!=null){if(c=!0,a.push(l),!t)break;l[2]==null?(s=Math.trunc(l[4].getX()),o=Math.trunc(l[4].getY())):(s=Math.trunc(l[2].getX()),o=Math.trunc(l[2].getY()))}else{if(!c)break;c=!1,s=0;try{for(var u=(r=void 0,Tk(a)),d=u.next();!d.done;d=u.next()){var f=d.value;f[1]!=null&&(o=Math.trunc(Math.max(o,f[1].getY()))),f[3]!=null&&(o=Math.max(o,Math.trunc(f[3].getY())))}}catch(e){r={error:e}}finally{try{d&&!d.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}o+=e.ROW_STEP}}return a},e.findVertices=function(t,n,r){var i=t.getHeight(),a=t.getWidth(),o=Array(8);return e.copyToResult(o,e.findRowsWithPattern(t,i,a,n,r,e.START_PATTERN),e.INDEXES_START_PATTERN),o[4]!=null&&(r=Math.trunc(o[4].getX()),n=Math.trunc(o[4].getY())),e.copyToResult(o,e.findRowsWithPattern(t,i,a,n,r,e.STOP_PATTERN),e.INDEXES_STOP_PATTERN),o},e.copyToResult=function(e,t,n){for(var r=0;r<n.length;r++)e[n[r]]=t[r]},e.findRowsWithPattern=function(t,n,r,i,a,o){for(var s=[,,,,],c=!1,l=new Int32Array(o.length);i<n;i+=e.ROW_STEP)if((p=e.findGuardPattern(t,a,i,r,!1,o,l))!=null){for(;i>0;){if((f=e.findGuardPattern(t,a,--i,r,!1,o,l))==null){i++;break}p=f}s[0]=new Z(p[0],i),s[1]=new Z(p[1],i),c=!0;break}var u=i+1;if(c){for(var d=0,f=Int32Array.from([Math.trunc(s[0].getX()),Math.trunc(s[1].getX())]);u<n;u++){var p;if((p=e.findGuardPattern(t,f[0],u,r,!1,o,l))!=null&&Math.abs(f[0]-p[0])<e.MAX_PATTERN_DRIFT&&Math.abs(f[1]-p[1])<e.MAX_PATTERN_DRIFT)f=p,d=0;else{if(d>e.SKIPPED_ROW_COUNT_MAX)break;d++}}u-=d+1,s[2]=new Z(f[0],u),s[3]=new Z(f[1],u)}return u-i<e.BARCODE_MIN_HEIGHT&>.fill(s,null),s},e.findGuardPattern=function(t,n,r,i,a,o,s){GT.fillWithin(s,0,s.length,0);for(var c=n,l=0;t.get(c,r)&&c>0&&l++<e.MAX_PIXEL_DRIFT;)c--;for(var u=c,d=0,f=o.length,p=a;u<i;u++)if(t.get(u,r)!==p)s[d]++;else{if(d===f-1){if(e.patternMatchVariance(s,o,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return new Int32Array([c,u]);c+=s[0]+s[1],zT.arraycopy(s,2,s,0,d-1),s[d-1]=0,s[d]=0,d--}else d++;s[d]=1,p=!p}return d===f-1&&e.patternMatchVariance(s,o,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE?new Int32Array([c,u-1]):null},e.patternMatchVariance=function(e,t,n){for(var r=e.length,i=0,a=0,o=0;o<r;o++)i+=e[o],a+=t[o];if(i<a)return 1/0;var s=i/a;n*=s;for(var c=0,l=0;l<r;l++){var u=e[l],d=t[l]*s,f=u>d?u-d:d-u;if(f>n)return 1/0;c+=f}return c/i},e.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),e.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),e.MAX_AVG_VARIANCE=.42,e.MAX_INDIVIDUAL_VARIANCE=.8,e.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),e.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),e.MAX_PIXEL_DRIFT=3,e.MAX_PATTERN_DRIFT=5,e.SKIPPED_ROW_COUNT_MAX=25,e.ROW_STEP=5,e.BARCODE_MIN_HEIGHT=10,e}(),Dk=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Ok=function(){function e(e,t){if(t.length===0)throw new q;this.field=e;var n=t.length;if(n>1&&t[0]===0){for(var r=1;r<n&&t[r]===0;)r++;r===n?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(n-r),zT.arraycopy(t,r,this.coefficients,0,this.coefficients.length))}else this.coefficients=t}return e.prototype.getCoefficients=function(){return this.coefficients},e.prototype.getDegree=function(){return this.coefficients.length-1},e.prototype.isZero=function(){return this.coefficients[0]===0},e.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},e.prototype.evaluateAt=function(e){var t,n;if(e===0)return this.getCoefficient(0);if(e===1){var r=0;try{for(var i=Dk(this.coefficients),a=i.next();!a.done;a=i.next()){var o=a.value;r=this.field.add(r,o)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}for(var s=this.coefficients[0],c=this.coefficients.length,l=1;l<c;l++)s=this.field.add(this.field.multiply(e,s),this.coefficients[l]);return s},e.prototype.add=function(t){if(!this.field.equals(t.field))throw new q(`ModulusPolys do not have same ModulusGF field`);if(this.isZero())return t;if(t.isZero())return this;var n=this.coefficients,r=t.coefficients;if(n.length>r.length){var i=n;n=r,r=i}var a=new Int32Array(r.length),o=r.length-n.length;zT.arraycopy(r,0,a,0,o);for(var s=o;s<r.length;s++)a[s]=this.field.add(n[s-o],r[s]);return new e(this.field,a)},e.prototype.subtract=function(e){if(!this.field.equals(e.field))throw new q(`ModulusPolys do not have same ModulusGF field`);return e.isZero()?this:this.add(e.negative())},e.prototype.multiply=function(t){return t instanceof e?this.multiplyOther(t):this.multiplyScalar(t)},e.prototype.multiplyOther=function(t){if(!this.field.equals(t.field))throw new q(`ModulusPolys do not have same ModulusGF field`);if(this.isZero()||t.isZero())return new e(this.field,new Int32Array([0]));for(var n=this.coefficients,r=n.length,i=t.coefficients,a=i.length,o=new Int32Array(r+a-1),s=0;s<r;s++)for(var c=n[s],l=0;l<a;l++)o[s+l]=this.field.add(o[s+l],this.field.multiply(c,i[l]));return new e(this.field,o)},e.prototype.negative=function(){for(var t=this.coefficients.length,n=new Int32Array(t),r=0;r<t;r++)n[r]=this.field.subtract(0,this.coefficients[r]);return new e(this.field,n)},e.prototype.multiplyScalar=function(t){if(t===0)return new e(this.field,new Int32Array([0]));if(t===1)return this;for(var n=this.coefficients.length,r=new Int32Array(n),i=0;i<n;i++)r[i]=this.field.multiply(this.coefficients[i],t);return new e(this.field,r)},e.prototype.multiplyByMonomial=function(t,n){if(t<0)throw new q;if(n===0)return new e(this.field,new Int32Array([0]));for(var r=this.coefficients.length,i=new Int32Array(r+t),a=0;a<r;a++)i[a]=this.field.multiply(this.coefficients[a],n);return new e(this.field,i)},e.prototype.toString=function(){for(var e=new iE,t=this.getDegree();t>=0;t--){var n=this.getCoefficient(t);n!==0&&(n<0?(e.append(` - `),n=-n):e.length()>0&&e.append(` + `),t!==0&&n===1||e.append(n),t!==0&&(t===1?e.append(`x`):(e.append(`x^`),e.append(t))))}return e.toString()},e}(),kk=function(){function e(){}return e.prototype.add=function(e,t){return(e+t)%this.modulus},e.prototype.subtract=function(e,t){return(this.modulus+e-t)%this.modulus},e.prototype.exp=function(e){return this.expTable[e]},e.prototype.log=function(e){if(e===0)throw new q;return this.logTable[e]},e.prototype.inverse=function(e){if(e===0)throw new kE;return this.expTable[this.modulus-this.logTable[e]-1]},e.prototype.multiply=function(e,t){return e===0||t===0?0:this.expTable[(this.logTable[e]+this.logTable[t])%(this.modulus-1)]},e.prototype.getSize=function(){return this.modulus},e.prototype.equals=function(e){return e===this},e}(),Ak=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),jk=function(e){function t(t,n){var r=e.call(this)||this;r.modulus=t,r.expTable=new Int32Array(t),r.logTable=new Int32Array(t);for(var i=1,a=0;a<t;a++)r.expTable[a]=i,i=i*n%t;for(a=0;a<t-1;a++)r.logTable[r.expTable[a]]=a;return r.zero=new Ok(r,new Int32Array([0])),r.one=new Ok(r,new Int32Array([1])),r}return Ak(t,e),t.prototype.getZero=function(){return this.zero},t.prototype.getOne=function(){return this.one},t.prototype.buildMonomial=function(e,t){if(e<0)throw new q;if(t===0)return this.zero;var n=new Int32Array(e+1);return n[0]=t,new Ok(this,n)},t.PDF417_GF=new t(Ck.NUMBER_OF_CODEWORDS,3),t}(kk),Mk=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Nk=function(){function e(){this.field=jk.PDF417_GF}return e.prototype.decode=function(e,t,n){for(var r,i,a=new Ok(this.field,e),o=new Int32Array(t),s=!1,c=t;c>0;c--){var l=a.evaluateAt(this.field.exp(c));o[t-c]=l,l!==0&&(s=!0)}if(!s)return 0;var u=this.field.getOne();if(n!=null)try{for(var d=Mk(n),f=d.next();!f.done;f=d.next()){var p=f.value,m=this.field.exp(e.length-1-p),h=new Ok(this.field,new Int32Array([this.field.subtract(0,m),1]));u=u.multiply(h)}}catch(e){r={error:e}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}var g=new Ok(this.field,o),_=this.runEuclideanAlgorithm(this.field.buildMonomial(t,1),g,t),v=_[0],y=_[1],b=this.findErrorLocations(v),x=this.findErrorMagnitudes(y,v,b);for(c=0;c<b.length;c++){var S=e.length-1-this.field.log(b[c]);if(S<0)throw LT.getChecksumInstance();e[S]=this.field.subtract(e[S],x[c])}return b.length},e.prototype.runEuclideanAlgorithm=function(e,t,n){if(e.getDegree()<t.getDegree()){var r=e;e=t,t=r}for(var i=e,a=t,o=this.field.getZero(),s=this.field.getOne();a.getDegree()>=Math.round(n/2);){var c=i,l=o;if(o=s,(i=a).isZero())throw LT.getChecksumInstance();a=c;for(var u=this.field.getZero(),d=i.getCoefficient(i.getDegree()),f=this.field.inverse(d);a.getDegree()>=i.getDegree()&&!a.isZero();){var p=a.getDegree()-i.getDegree(),m=this.field.multiply(a.getCoefficient(a.getDegree()),f);u=u.add(this.field.buildMonomial(p,m)),a=a.subtract(i.multiplyByMonomial(p,m))}s=u.multiply(o).subtract(l).negative()}var h=s.getCoefficient(0);if(h===0)throw LT.getChecksumInstance();var g=this.field.inverse(h);return[s.multiply(g),a.multiply(g)]},e.prototype.findErrorLocations=function(e){for(var t=e.getDegree(),n=new Int32Array(t),r=0,i=1;i<this.field.getSize()&&r<t;i++)e.evaluateAt(i)===0&&(n[r]=this.field.inverse(i),r++);if(r!==t)throw LT.getChecksumInstance();return n},e.prototype.findErrorMagnitudes=function(e,t,n){for(var r=t.getDegree(),i=new Int32Array(r),a=1;a<=r;a++)i[r-a]=this.field.multiply(a,t.getCoefficient(a));var o=new Ok(this.field,i),s=n.length,c=new Int32Array(s);for(a=0;a<s;a++){var l=this.field.inverse(n[a]),u=this.field.subtract(0,e.evaluateAt(l)),d=this.field.inverse(o.evaluateAt(l));c[a]=this.field.multiply(u,d)}return c},e}(),Pk=function(){function e(t,n,r,i,a){t instanceof e?this.constructor_2(t):this.constructor_1(t,n,r,i,a)}return e.prototype.constructor_1=function(e,t,n,r,i){var a=t==null||n==null,o=r==null||i==null;if(a&&o)throw new Y;a?(t=new Z(0,r.getY()),n=new Z(0,i.getY())):o&&(r=new Z(e.getWidth()-1,t.getY()),i=new Z(e.getWidth()-1,n.getY())),this.image=e,this.topLeft=t,this.bottomLeft=n,this.topRight=r,this.bottomRight=i,this.minX=Math.trunc(Math.min(t.getX(),n.getX())),this.maxX=Math.trunc(Math.max(r.getX(),i.getX())),this.minY=Math.trunc(Math.min(t.getY(),r.getY())),this.maxY=Math.trunc(Math.max(n.getY(),i.getY()))},e.prototype.constructor_2=function(e){this.image=e.image,this.topLeft=e.getTopLeft(),this.bottomLeft=e.getBottomLeft(),this.topRight=e.getTopRight(),this.bottomRight=e.getBottomRight(),this.minX=e.getMinX(),this.maxX=e.getMaxX(),this.minY=e.getMinY(),this.maxY=e.getMaxY()},e.merge=function(t,n){return t==null?n:n==null?t:new e(t.image,t.topLeft,t.bottomLeft,n.topRight,n.bottomRight)},e.prototype.addMissingRows=function(t,n,r){var i=this.topLeft,a=this.bottomLeft,o=this.topRight,s=this.bottomRight;if(t>0){var c=r?this.topLeft:this.topRight,l=Math.trunc(c.getY()-t);l<0&&(l=0);var u=new Z(c.getX(),l);r?i=u:o=u}if(n>0){var d=r?this.bottomLeft:this.bottomRight,f=Math.trunc(d.getY()+n);f>=this.image.getHeight()&&(f=this.image.getHeight()-1);var p=new Z(d.getX(),f);r?a=p:s=p}return new e(this.image,i,a,o,s)},e.prototype.getMinX=function(){return this.minX},e.prototype.getMaxX=function(){return this.maxX},e.prototype.getMinY=function(){return this.minY},e.prototype.getMaxY=function(){return this.maxY},e.prototype.getTopLeft=function(){return this.topLeft},e.prototype.getTopRight=function(){return this.topRight},e.prototype.getBottomLeft=function(){return this.bottomLeft},e.prototype.getBottomRight=function(){return this.bottomRight},e}(),Fk=function(){function e(e,t,n,r){this.columnCount=e,this.errorCorrectionLevel=r,this.rowCountUpperPart=t,this.rowCountLowerPart=n,this.rowCount=t+n}return e.prototype.getColumnCount=function(){return this.columnCount},e.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},e.prototype.getRowCount=function(){return this.rowCount},e.prototype.getRowCountUpperPart=function(){return this.rowCountUpperPart},e.prototype.getRowCountLowerPart=function(){return this.rowCountLowerPart},e}(),Ik=function(){function e(){this.buffer=``}return e.form=function(e,t){var n=-1;return e.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,(function(e,r,i,a,o,s){if(e===`%%`)return`%`;if(t[++n]!==void 0){e=a?parseInt(a.substr(1)):void 0;var c,l=o?parseInt(o.substr(1)):void 0;switch(s){case`s`:c=t[n];break;case`c`:c=t[n][0];break;case`f`:c=parseFloat(t[n]).toFixed(e);break;case`p`:c=parseFloat(t[n]).toPrecision(e);break;case`e`:c=parseFloat(t[n]).toExponential(e);break;case`x`:c=parseInt(t[n]).toString(l||16);break;case`d`:c=parseFloat(parseInt(t[n],l||10).toPrecision(e)).toFixed(0)}c=typeof c==`object`?JSON.stringify(c):(+c).toString(l);for(var u=parseInt(i),d=i&&i[0]+``==`0`?`0`:` `;c.length<u;)c=r===void 0?d+c:c+d;return c}}))},e.prototype.format=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.buffer+=e.form(t,n)},e.prototype.toString=function(){return this.buffer},e}(),Lk=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Rk=function(){function e(e){this.boundingBox=new Pk(e),this.codewords=Array(e.getMaxY()-e.getMinY()+1)}return e.prototype.getCodewordNearby=function(t){var n=this.getCodeword(t);if(n!=null)return n;for(var r=1;r<e.MAX_NEARBY_DISTANCE;r++){var i=this.imageRowToCodewordIndex(t)-r;if(i>=0&&(n=this.codewords[i])!=null||(i=this.imageRowToCodewordIndex(t)+r)<this.codewords.length&&(n=this.codewords[i])!=null)return n}return null},e.prototype.imageRowToCodewordIndex=function(e){return e-this.boundingBox.getMinY()},e.prototype.setCodeword=function(e,t){this.codewords[this.imageRowToCodewordIndex(e)]=t},e.prototype.getCodeword=function(e){return this.codewords[this.imageRowToCodewordIndex(e)]},e.prototype.getBoundingBox=function(){return this.boundingBox},e.prototype.getCodewords=function(){return this.codewords},e.prototype.toString=function(){var e,t,n=new Ik,r=0;try{for(var i=Lk(this.codewords),a=i.next();!a.done;a=i.next()){var o=a.value;o==null?n.format(`%3d: | %n`,r++):n.format(`%3d: %3d|%3d%n`,r++,o.getRowNumber(),o.getValue())}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return n.toString()},e.MAX_NEARBY_DISTANCE=5,e}(),zk=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Bk=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(t===void 0||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},Vk=function(){function e(){this.values=new Map}return e.prototype.setValue=function(e){e=Math.trunc(e);var t=this.values.get(e);t??=0,t++,this.values.set(e,t)},e.prototype.getValue=function(){var e,t,n=-1,r=[],i=function(e,t){var i=function(){return e},a=function(){return t};a()>n?(n=a(),(r=[]).push(i())):a()===n&&r.push(i())};try{for(var a=zk(this.values.entries()),o=a.next();!o.done;o=a.next()){var s=Bk(o.value,2);i(s[0],s[1])}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return Ck.toIntArray(r)},e.prototype.getConfidence=function(e){return this.values.get(e)},e}(),Hk=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Uk=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Wk=function(e){function t(t,n){var r=e.call(this,t)||this;return r._isLeft=n,r}return Hk(t,e),t.prototype.setRowNumbers=function(){var e,t;try{for(var n=Uk(this.getCodewords()),r=n.next();!r.done;r=n.next())r.value?.setRowNumberAsRowIndicatorColumn()}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},t.prototype.adjustCompleteIndicatorColumnRowNumbers=function(e){var t=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(t,e);for(var n=this.getBoundingBox(),r=this._isLeft?n.getTopLeft():n.getTopRight(),i=this._isLeft?n.getBottomLeft():n.getBottomRight(),a=this.imageRowToCodewordIndex(Math.trunc(r.getY())),o=this.imageRowToCodewordIndex(Math.trunc(i.getY())),s=-1,c=1,l=0,u=a;u<o;u++)if(t[u]!=null){var d=t[u],f=d.getRowNumber()-s;if(f===0)l++;else if(f===1)c=Math.max(c,l),l=1,s=d.getRowNumber();else if(f<0||d.getRowNumber()>=e.getRowCount()||f>u)t[u]=null;else{for(var p=void 0,m=(p=c>2?(c-2)*f:f)>=u,h=1;h<=p&&!m;h++)m=t[u-h]!=null;m?t[u]=null:(s=d.getRowNumber(),l=1)}}},t.prototype.getRowHeights=function(){var e,t,n=this.getBarcodeMetadata();if(n==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(n);var r=new Int32Array(n.getRowCount());try{for(var i=Uk(this.getCodewords()),a=i.next();!a.done;a=i.next()){var o=a.value;if(o!=null){var s=o.getRowNumber();if(s>=r.length)continue;r[s]++}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return r},t.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(e){for(var t=this.getBoundingBox(),n=this._isLeft?t.getTopLeft():t.getTopRight(),r=this._isLeft?t.getBottomLeft():t.getBottomRight(),i=this.imageRowToCodewordIndex(Math.trunc(n.getY())),a=this.imageRowToCodewordIndex(Math.trunc(r.getY())),o=this.getCodewords(),s=-1,c=i;c<a;c++)if(o[c]!=null){var l=o[c];l.setRowNumberAsRowIndicatorColumn();var u=l.getRowNumber()-s;u===0||(u===1?s=l.getRowNumber():l.getRowNumber()>=e.getRowCount()?o[c]=null:s=l.getRowNumber())}},t.prototype.getBarcodeMetadata=function(){var e,t,n=this.getCodewords(),r=new Vk,i=new Vk,a=new Vk,o=new Vk;try{for(var s=Uk(n),c=s.next();!c.done;c=s.next()){var l=c.value;if(l!=null){l.setRowNumberAsRowIndicatorColumn();var u=l.getValue()%30,d=l.getRowNumber();switch(this._isLeft||(d+=2),d%3){case 0:i.setValue(3*u+1);break;case 1:o.setValue(u/3),a.setValue(u%3);break;case 2:r.setValue(u+1)}}}}catch(t){e={error:t}}finally{try{c&&!c.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}if(r.getValue().length===0||i.getValue().length===0||a.getValue().length===0||o.getValue().length===0||r.getValue()[0]<1||i.getValue()[0]+a.getValue()[0]<Ck.MIN_ROWS_IN_BARCODE||i.getValue()[0]+a.getValue()[0]>Ck.MAX_ROWS_IN_BARCODE)return null;var f=new Fk(r.getValue()[0],i.getValue()[0],a.getValue()[0],o.getValue()[0]);return this.removeIncorrectCodewords(n,f),f},t.prototype.removeIncorrectCodewords=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(e[n]!=null){var i=r.getValue()%30,a=r.getRowNumber();if(a>t.getRowCount())e[n]=null;else switch(this._isLeft||(a+=2),a%3){case 0:3*i+1!==t.getRowCountUpperPart()&&(e[n]=null);break;case 1:Math.trunc(i/3)===t.getErrorCorrectionLevel()&&i%3===t.getRowCountLowerPart()||(e[n]=null);break;case 2:i+1!==t.getColumnCount()&&(e[n]=null)}}}},t.prototype.isLeft=function(){return this._isLeft},t.prototype.toString=function(){return`IsLeft: `+this._isLeft+`
|
|
126
|
+
`+e.prototype.toString.call(this)},t}(Rk),Gk=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Kk=function(){function e(e,t){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=e,this.barcodeColumnCount=e.getColumnCount(),this.boundingBox=t,this.detectionResultColumns=Array(this.barcodeColumnCount+2)}return e.prototype.getDetectionResultColumns=function(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);var e,t=Ck.MAX_CODEWORDS_IN_BARCODE;do e=t,t=this.adjustRowNumbersAndGetCount();while(t>0&&t<e);return this.detectionResultColumns},e.prototype.adjustIndicatorColumnRowNumbers=function(e){e?.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)},e.prototype.adjustRowNumbersAndGetCount=function(){var e=this.adjustRowNumbersByRow();if(e===0)return 0;for(var t=1;t<this.barcodeColumnCount+1;t++)for(var n=this.detectionResultColumns[t].getCodewords(),r=0;r<n.length;r++)n[r]!=null&&(n[r].hasValidRowNumber()||this.adjustRowNumbers(t,r,n));return e},e.prototype.adjustRowNumbersByRow=function(){return this.adjustRowNumbersFromBothRI(),this.adjustRowNumbersFromLRI()+this.adjustRowNumbersFromRRI()},e.prototype.adjustRowNumbersFromBothRI=function(){if(this.detectionResultColumns[0]!=null&&this.detectionResultColumns[this.barcodeColumnCount+1]!=null){for(var e=this.detectionResultColumns[0].getCodewords(),t=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),n=0;n<e.length;n++)if(e[n]!=null&&t[n]!=null&&e[n].getRowNumber()===t[n].getRowNumber())for(var r=1;r<=this.barcodeColumnCount;r++){var i=this.detectionResultColumns[r].getCodewords()[n];i!=null&&(i.setRowNumber(e[n].getRowNumber()),i.hasValidRowNumber()||(this.detectionResultColumns[r].getCodewords()[n]=null))}}},e.prototype.adjustRowNumbersFromRRI=function(){if(this.detectionResultColumns[this.barcodeColumnCount+1]==null)return 0;for(var t=0,n=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),r=0;r<n.length;r++)if(n[r]!=null)for(var i=n[r].getRowNumber(),a=0,o=this.barcodeColumnCount+1;o>0&&a<this.ADJUST_ROW_NUMBER_SKIP;o--){var s=this.detectionResultColumns[o].getCodewords()[r];s!=null&&(a=e.adjustRowNumberIfValid(i,a,s),s.hasValidRowNumber()||t++)}return t},e.prototype.adjustRowNumbersFromLRI=function(){if(this.detectionResultColumns[0]==null)return 0;for(var t=0,n=this.detectionResultColumns[0].getCodewords(),r=0;r<n.length;r++)if(n[r]!=null)for(var i=n[r].getRowNumber(),a=0,o=1;o<this.barcodeColumnCount+1&&a<this.ADJUST_ROW_NUMBER_SKIP;o++){var s=this.detectionResultColumns[o].getCodewords()[r];s!=null&&(a=e.adjustRowNumberIfValid(i,a,s),s.hasValidRowNumber()||t++)}return t},e.adjustRowNumberIfValid=function(e,t,n){return n==null||n.hasValidRowNumber()||(n.isValidRowNumber(e)?(n.setRowNumber(e),t=0):++t),t},e.prototype.adjustRowNumbers=function(t,n,r){var i,a,o=r[n],s=this.detectionResultColumns[t-1].getCodewords(),c=s;this.detectionResultColumns[t+1]!=null&&(c=this.detectionResultColumns[t+1].getCodewords());var l=Array(14);l[2]=s[n],l[3]=c[n],n>0&&(l[0]=r[n-1],l[4]=s[n-1],l[5]=c[n-1]),n>1&&(l[8]=r[n-2],l[10]=s[n-2],l[11]=c[n-2]),n<r.length-1&&(l[1]=r[n+1],l[6]=s[n+1],l[7]=c[n+1]),n<r.length-2&&(l[9]=r[n+2],l[12]=s[n+2],l[13]=c[n+2]);try{for(var u=Gk(l),d=u.next();!d.done;d=u.next()){var f=d.value;if(e.adjustRowNumber(o,f))return}}catch(e){i={error:e}}finally{try{d&&!d.done&&(a=u.return)&&a.call(u)}finally{if(i)throw i.error}}},e.adjustRowNumber=function(e,t){return t!=null&&!(!t.hasValidRowNumber()||t.getBucket()!==e.getBucket())&&(e.setRowNumber(t.getRowNumber()),!0)},e.prototype.getBarcodeColumnCount=function(){return this.barcodeColumnCount},e.prototype.getBarcodeRowCount=function(){return this.barcodeMetadata.getRowCount()},e.prototype.getBarcodeECLevel=function(){return this.barcodeMetadata.getErrorCorrectionLevel()},e.prototype.setBoundingBox=function(e){this.boundingBox=e},e.prototype.getBoundingBox=function(){return this.boundingBox},e.prototype.setDetectionResultColumn=function(e,t){this.detectionResultColumns[e]=t},e.prototype.getDetectionResultColumn=function(e){return this.detectionResultColumns[e]},e.prototype.toString=function(){var e=this.detectionResultColumns[0];e??=this.detectionResultColumns[this.barcodeColumnCount+1];for(var t=new Ik,n=0;n<e.getCodewords().length;n++){t.format(`CW %3d:`,n);for(var r=0;r<this.barcodeColumnCount+2;r++)if(this.detectionResultColumns[r]!=null){var i=this.detectionResultColumns[r].getCodewords()[n];i==null?t.format(` | `):t.format(` %3d|%3d`,i.getRowNumber(),i.getValue())}else t.format(` | `);t.format(`%n`)}return t.toString()},e}(),qk=function(){function e(t,n,r,i){this.rowNumber=e.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(t),this.endX=Math.trunc(n),this.bucket=Math.trunc(r),this.value=Math.trunc(i)}return e.prototype.hasValidRowNumber=function(){return this.isValidRowNumber(this.rowNumber)},e.prototype.isValidRowNumber=function(t){return t!==e.BARCODE_ROW_UNKNOWN&&this.bucket===t%3*3},e.prototype.setRowNumberAsRowIndicatorColumn=function(){this.rowNumber=Math.trunc(3*Math.trunc(this.value/30)+Math.trunc(this.bucket/3))},e.prototype.getWidth=function(){return this.endX-this.startX},e.prototype.getStartX=function(){return this.startX},e.prototype.getEndX=function(){return this.endX},e.prototype.getBucket=function(){return this.bucket},e.prototype.getValue=function(){return this.value},e.prototype.getRowNumber=function(){return this.rowNumber},e.prototype.setRowNumber=function(e){this.rowNumber=e},e.prototype.toString=function(){return this.rowNumber+`|`+this.value},e.BARCODE_ROW_UNKNOWN=-1,e}(),Jk=function(){function e(){}return e.initialize=function(){for(var t=0;t<Ck.SYMBOL_TABLE.length;t++)for(var n=Ck.SYMBOL_TABLE[t],r=1&n,i=0;i<Ck.BARS_IN_MODULE;i++){for(var a=0;(1&n)===r;)a+=1,n>>=1;r=1&n,e.RATIOS_TABLE[t]||(e.RATIOS_TABLE[t]=Array(Ck.BARS_IN_MODULE)),e.RATIOS_TABLE[t][Ck.BARS_IN_MODULE-i-1]=Math.fround(a/Ck.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},e.getDecodedValue=function(t){var n=e.getDecodedCodewordValue(e.sampleBitCounts(t));return n===-1?e.getClosestDecodedValue(t):n},e.sampleBitCounts=function(e){for(var t=RE.sum(e),n=new Int32Array(Ck.BARS_IN_MODULE),r=0,i=0,a=0;a<Ck.MODULES_IN_CODEWORD;a++){var o=t/(2*Ck.MODULES_IN_CODEWORD)+a*t/Ck.MODULES_IN_CODEWORD;i+e[r]<=o&&(i+=e[r],r++),n[r]++}return n},e.getDecodedCodewordValue=function(t){var n=e.getBitValue(t);return Ck.getCodeword(n)===-1?-1:n},e.getBitValue=function(e){for(var t=0,n=0;n<e.length;n++)for(var r=0;r<e[n];r++)t=t<<1|n%2==0;return Math.trunc(t)},e.getClosestDecodedValue=function(t){var n=RE.sum(t),r=Array(Ck.BARS_IN_MODULE);if(n>1)for(var i=0;i<r.length;i++)r[i]=Math.fround(t[i]/n);var a=zE.MAX_VALUE,o=-1;this.bSymbolTableReady||e.initialize();for(var s=0;s<e.RATIOS_TABLE.length;s++){for(var c=0,l=e.RATIOS_TABLE[s],u=0;u<Ck.BARS_IN_MODULE;u++){var d=Math.fround(l[u]-r[u]);if((c+=Math.fround(d*d))>=a)break}c<a&&(a=c,o=Ck.SYMBOL_TABLE[s])}return o},e.bSymbolTableReady=!1,e.RATIOS_TABLE=Array(Ck.SYMBOL_TABLE.length).map((function(e){return Array(Ck.BARS_IN_MODULE)})),e}(),Yk=function(){function e(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}return e.prototype.getSegmentIndex=function(){return this.segmentIndex},e.prototype.setSegmentIndex=function(e){this.segmentIndex=e},e.prototype.getFileId=function(){return this.fileId},e.prototype.setFileId=function(e){this.fileId=e},e.prototype.getOptionalData=function(){return this.optionalData},e.prototype.setOptionalData=function(e){this.optionalData=e},e.prototype.isLastSegment=function(){return this.lastSegment},e.prototype.setLastSegment=function(e){this.lastSegment=e},e.prototype.getSegmentCount=function(){return this.segmentCount},e.prototype.setSegmentCount=function(e){this.segmentCount=e},e.prototype.getSender=function(){return this.sender||null},e.prototype.setSender=function(e){this.sender=e},e.prototype.getAddressee=function(){return this.addressee||null},e.prototype.setAddressee=function(e){this.addressee=e},e.prototype.getFileName=function(){return this.fileName},e.prototype.setFileName=function(e){this.fileName=e},e.prototype.getFileSize=function(){return this.fileSize},e.prototype.setFileSize=function(e){this.fileSize=e},e.prototype.getChecksum=function(){return this.checksum},e.prototype.setChecksum=function(e){this.checksum=e},e.prototype.getTimestamp=function(){return this.timestamp},e.prototype.setTimestamp=function(e){this.timestamp=e},e}(),Xk=function(){function e(){}return e.parseLong=function(e,t){return t===void 0&&(t=void 0),parseInt(e,t)},e}(),Zk=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qk=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return Zk(t,e),t.kind=`NullPointerException`,t}(jT),$k=function(){function e(){}return e.prototype.writeBytes=function(e){this.writeBytesOffset(e,0,e.length)},e.prototype.writeBytesOffset=function(e,t,n){if(e==null)throw new Qk;if(t<0||t>e.length||n<0||t+n>e.length||t+n<0)throw new VT;if(n!==0)for(var r=0;r<n;r++)this.write(e[t+r])},e.prototype.flush=function(){},e.prototype.close=function(){},e}(),eA=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),tA=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return eA(t,e),t}(jT),nA=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),rA=function(e){function t(t){t===void 0&&(t=32);var n=e.call(this)||this;if(n.count=0,t<0)throw new q(`Negative initial size: `+t);return n.buf=new Uint8Array(t),n}return nA(t,e),t.prototype.ensureCapacity=function(e){e-this.buf.length>0&&this.grow(e)},t.prototype.grow=function(e){var t=this.buf.length<<1;if(t-e<0&&(t=e),t<0){if(e<0)throw new tA;t=KT.MAX_VALUE}this.buf=GT.copyOfUint8Array(this.buf,t)},t.prototype.write=function(e){this.ensureCapacity(this.count+1),this.buf[this.count]=e,this.count+=1},t.prototype.writeBytesOffset=function(e,t,n){if(t<0||t>e.length||n<0||t+n-e.length>0)throw new VT;this.ensureCapacity(this.count+n),zT.arraycopy(e,t,this.buf,this.count,n),this.count+=n},t.prototype.writeTo=function(e){e.writeBytesOffset(this.buf,0,this.count)},t.prototype.reset=function(){this.count=0},t.prototype.toByteArray=function(){return GT.copyOfUint8Array(this.buf,this.count)},t.prototype.size=function(){return this.count},t.prototype.toString=function(e){return e?typeof e==`string`?this.toString_string(e):this.toString_number(e):this.toString_void()},t.prototype.toString_void=function(){return new String(this.buf).toString()},t.prototype.toString_string=function(e){return new String(this.buf).toString()},t.prototype.toString_number=function(e){return new String(this.buf).toString()},t.prototype.close=function(){},t}($k);function iA(){if(typeof window<`u`)return window.BigInt||null;if(typeof global<`u`)return global.BigInt||null;if(typeof self<`u`)return self.BigInt||null;throw Error(`Can't search globals for BigInt!`)}function aA(e){if(ak===void 0&&(ak=iA()),ak===null)throw Error(`BigInt is not supported!`);return ak(e)}(function(e){e[e.ALPHA=0]=`ALPHA`,e[e.LOWER=1]=`LOWER`,e[e.MIXED=2]=`MIXED`,e[e.PUNCT=3]=`PUNCT`,e[e.ALPHA_SHIFT=4]=`ALPHA_SHIFT`,e[e.PUNCT_SHIFT=5]=`PUNCT_SHIFT`})(ik||={});var oA=function(){function e(){}return e.decode=function(t,n){var r=new iE(``),i=$T.ISO8859_1;r.enableDecoding(i);for(var a=1,o=t[a++],s=new Yk;a<t[0];){switch(o){case e.TEXT_COMPACTION_MODE_LATCH:a=e.textCompaction(t,a,r);break;case e.BYTE_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH_6:a=e.byteCompaction(o,t,i,a,r);break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(t[a++]);break;case e.NUMERIC_COMPACTION_MODE_LATCH:a=e.numericCompaction(t,a,r);break;case e.ECI_CHARSET:$T.getCharacterSetECIByValue(t[a++]);break;case e.ECI_GENERAL_PURPOSE:a+=2;break;case e.ECI_USER_DEFINED:a++;break;case e.BEGIN_MACRO_PDF417_CONTROL_BLOCK:a=e.decodeMacroBlock(t,a,s);break;case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case e.MACRO_PDF417_TERMINATOR:throw new J;default:a--,a=e.textCompaction(t,a,r)}if(!(a<t.length))throw J.getFormatInstance();o=t[a++]}if(r.length()===0)throw J.getFormatInstance();var c=new TE(null,r.toString(),null,n);return c.setOther(s),c},e.decodeMacroBlock=function(t,n,r){if(n+e.NUMBER_OF_SEQUENCE_CODEWORDS>t[0])throw J.getFormatInstance();for(var i=new Int32Array(e.NUMBER_OF_SEQUENCE_CODEWORDS),a=0;a<e.NUMBER_OF_SEQUENCE_CODEWORDS;a++,n++)i[a]=t[n];r.setSegmentIndex(KT.parseInt(e.decodeBase900toBase10(i,e.NUMBER_OF_SEQUENCE_CODEWORDS)));var o=new iE;n=e.textCompaction(t,n,o),r.setFileId(o.toString());var s=-1;for(t[n]===e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(s=n+1);n<t[0];)switch(t[n]){case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(t[++n]){case e.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:var c=new iE;n=e.textCompaction(t,n+1,c),r.setFileName(c.toString());break;case e.MACRO_PDF417_OPTIONAL_FIELD_SENDER:var l=new iE;n=e.textCompaction(t,n+1,l),r.setSender(l.toString());break;case e.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:var u=new iE;n=e.textCompaction(t,n+1,u),r.setAddressee(u.toString());break;case e.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:var d=new iE;n=e.numericCompaction(t,n+1,d),r.setSegmentCount(KT.parseInt(d.toString()));break;case e.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:var f=new iE;n=e.numericCompaction(t,n+1,f),r.setTimestamp(Xk.parseLong(f.toString()));break;case e.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:var p=new iE;n=e.numericCompaction(t,n+1,p),r.setChecksum(KT.parseInt(p.toString()));break;case e.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:var m=new iE;n=e.numericCompaction(t,n+1,m),r.setFileSize(Xk.parseLong(m.toString()));break;default:throw J.getFormatInstance()}break;case e.MACRO_PDF417_TERMINATOR:n++,r.setLastSegment(!0);break;default:throw J.getFormatInstance()}if(s!==-1){var h=n-s;r.isLastSegment()&&h--,r.setOptionalData(GT.copyOfRange(t,s,s+h))}return n},e.textCompaction=function(t,n,r){for(var i=new Int32Array(2*(t[0]-n)),a=new Int32Array(2*(t[0]-n)),o=0,s=!1;n<t[0]&&!s;){var c=t[n++];if(c<e.TEXT_COMPACTION_MODE_LATCH)i[o]=c/30,i[o+1]=c%30,o+=2;else switch(c){case e.TEXT_COMPACTION_MODE_LATCH:i[o++]=e.TEXT_COMPACTION_MODE_LATCH;break;case e.BYTE_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH_6:case e.NUMERIC_COMPACTION_MODE_LATCH:case e.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case e.MACRO_PDF417_TERMINATOR:n--,s=!0;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i[o]=e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,c=t[n++],a[o]=c,o++}}return e.decodeTextCompaction(i,a,o,r),n},e.decodeTextCompaction=function(t,n,r,i){for(var a=ik.ALPHA,o=ik.ALPHA,s=0;s<r;){var c=t[s],l=``;switch(a){case ik.ALPHA:if(c<26)l=String.fromCharCode(65+c);else switch(c){case 26:l=` `;break;case e.LL:a=ik.LOWER;break;case e.ML:a=ik.MIXED;break;case e.PS:o=a,a=ik.PUNCT_SHIFT;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(n[s]);break;case e.TEXT_COMPACTION_MODE_LATCH:a=ik.ALPHA}break;case ik.LOWER:if(c<26)l=String.fromCharCode(97+c);else switch(c){case 26:l=` `;break;case e.AS:o=a,a=ik.ALPHA_SHIFT;break;case e.ML:a=ik.MIXED;break;case e.PS:o=a,a=ik.PUNCT_SHIFT;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(n[s]);break;case e.TEXT_COMPACTION_MODE_LATCH:a=ik.ALPHA}break;case ik.MIXED:if(c<e.PL)l=e.MIXED_CHARS[c];else switch(c){case e.PL:a=ik.PUNCT;break;case 26:l=` `;break;case e.LL:a=ik.LOWER;break;case e.AL:a=ik.ALPHA;break;case e.PS:o=a,a=ik.PUNCT_SHIFT;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(n[s]);break;case e.TEXT_COMPACTION_MODE_LATCH:a=ik.ALPHA}break;case ik.PUNCT:if(c<e.PAL)l=e.PUNCT_CHARS[c];else switch(c){case e.PAL:a=ik.ALPHA;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(n[s]);break;case e.TEXT_COMPACTION_MODE_LATCH:a=ik.ALPHA}break;case ik.ALPHA_SHIFT:if(a=o,c<26)l=String.fromCharCode(65+c);else switch(c){case 26:l=` `;break;case e.TEXT_COMPACTION_MODE_LATCH:a=ik.ALPHA}break;case ik.PUNCT_SHIFT:if(a=o,c<e.PAL)l=e.PUNCT_CHARS[c];else switch(c){case e.PAL:a=ik.ALPHA;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(n[s]);break;case e.TEXT_COMPACTION_MODE_LATCH:a=ik.ALPHA}}l!==``&&i.append(l),s++}},e.byteCompaction=function(t,n,r,i,a){var o=new rA,s=0,c=0,l=!1;switch(t){case e.BYTE_COMPACTION_MODE_LATCH:for(var u=new Int32Array(6),d=n[i++];i<n[0]&&!l;)switch(u[s++]=d,c=900*c+d,d=n[i++]){case e.TEXT_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH:case e.NUMERIC_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH_6:case e.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case e.MACRO_PDF417_TERMINATOR:i--,l=!0;break;default:if(s%5==0&&s>0){for(var f=0;f<6;++f)o.write(Number(aA(c)>>aA(8*(5-f))));c=0,s=0}}i===n[0]&&d<e.TEXT_COMPACTION_MODE_LATCH&&(u[s++]=d);for(var p=0;p<s;p++)o.write(u[p]);break;case e.BYTE_COMPACTION_MODE_LATCH_6:for(;i<n[0]&&!l;){var m=n[i++];if(m<e.TEXT_COMPACTION_MODE_LATCH)s++,c=900*c+m;else switch(m){case e.TEXT_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH:case e.NUMERIC_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH_6:case e.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case e.MACRO_PDF417_TERMINATOR:i--,l=!0}if(s%5==0&&s>0){for(f=0;f<6;++f)o.write(Number(aA(c)>>aA(8*(5-f))));c=0,s=0}}}return a.append(nE.decode(o.toByteArray(),r)),i},e.numericCompaction=function(t,n,r){for(var i=0,a=!1,o=new Int32Array(e.MAX_NUMERIC_CODEWORDS);n<t[0]&&!a;){var s=t[n++];if(n===t[0]&&(a=!0),s<e.TEXT_COMPACTION_MODE_LATCH)o[i]=s,i++;else switch(s){case e.TEXT_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH_6:case e.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case e.MACRO_PDF417_TERMINATOR:n--,a=!0}(i%e.MAX_NUMERIC_CODEWORDS==0||s===e.NUMERIC_COMPACTION_MODE_LATCH||a)&&i>0&&(r.append(e.decodeBase900toBase10(o,i)),i=0)}return n},e.decodeBase900toBase10=function(t,n){for(var r=aA(0),i=0;i<n;i++)r+=e.EXP900[n-i-1]*aA(t[i]);var a=r.toString();if(a.charAt(0)!==`1`)throw new J;return a.substring(1)},e.TEXT_COMPACTION_MODE_LATCH=900,e.BYTE_COMPACTION_MODE_LATCH=901,e.NUMERIC_COMPACTION_MODE_LATCH=902,e.BYTE_COMPACTION_MODE_LATCH_6=924,e.ECI_USER_DEFINED=925,e.ECI_GENERAL_PURPOSE=926,e.ECI_CHARSET=927,e.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928,e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923,e.MACRO_PDF417_TERMINATOR=922,e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913,e.MAX_NUMERIC_CODEWORDS=15,e.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0,e.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1,e.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2,e.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3,e.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4,e.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5,e.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6,e.PL=25,e.LL=27,e.AS=27,e.ML=28,e.AL=28,e.PS=29,e.PAL=29,e.PUNCT_CHARS=`;<>@[\\]_\`~!\r ,:
|
|
127
|
+
-.$/"|*()?{}'`,e.MIXED_CHARS=`0123456789&\r ,:#-.$/+%*=^`,e.EXP900=iA()?function(){var e=[];e[0]=aA(1);var t=aA(900);e[1]=t;for(var n=2;n<16;n++)e[n]=e[n-1]*t;return e}():[],e.NUMBER_OF_SEQUENCE_CODEWORDS=2,e}(),sA=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},cA=function(){function e(){}return e.decode=function(t,n,r,i,a,o,s){for(var c,l=new Pk(t,n,r,i,a),u=null,d=null,f=!0;;f=!1){if(n!=null&&(u=e.getRowIndicatorColumn(t,l,n,!0,o,s)),i!=null&&(d=e.getRowIndicatorColumn(t,l,i,!1,o,s)),(c=e.merge(u,d))==null)throw Y.getNotFoundInstance();var p=c.getBoundingBox();if(!f||p==null||!(p.getMinY()<l.getMinY()||p.getMaxY()>l.getMaxY()))break;l=p}c.setBoundingBox(l);var m=c.getBarcodeColumnCount()+1;c.setDetectionResultColumn(0,u),c.setDetectionResultColumn(m,d);for(var h=u!=null,g=1;g<=m;g++){var _=h?g:m-g;if(c.getDetectionResultColumn(_)===void 0){var v=void 0;v=_===0||_===m?new Wk(l,_===0):new Rk(l),c.setDetectionResultColumn(_,v);for(var y=-1,b=y,x=l.getMinY();x<=l.getMaxY();x++){if((y=e.getStartColumn(c,_,x,h))<0||y>l.getMaxX()){if(b===-1)continue;y=b}var S=e.detectCodeword(t,l.getMinX(),l.getMaxX(),h,y,x,o,s);S!=null&&(v.setCodeword(x,S),b=y,o=Math.min(o,S.getWidth()),s=Math.max(s,S.getWidth()))}}}return e.createDecoderResult(c)},e.merge=function(t,n){if(t==null&&n==null)return null;var r=e.getBarcodeMetadata(t,n);return r==null?null:new Kk(r,Pk.merge(e.adjustBoundingBox(t),e.adjustBoundingBox(n)))},e.adjustBoundingBox=function(t){var n,r;if(t==null)return null;var i=t.getRowHeights();if(i==null)return null;var a=e.getMax(i),o=0;try{for(var s=sA(i),c=s.next();!c.done;c=s.next()){var l=c.value;if(o+=a-l,l>0)break}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}for(var u=t.getCodewords(),d=0;o>0&&u[d]==null;d++)o--;var f=0;for(d=i.length-1;d>=0&&(f+=a-i[d],!(i[d]>0));d--);for(d=u.length-1;f>0&&u[d]==null;d--)f--;return t.getBoundingBox().addMissingRows(o,f,t.isLeft())},e.getMax=function(e){var t,n,r=-1;try{for(var i=sA(e),a=i.next();!a.done;a=i.next()){var o=a.value;r=Math.max(r,o)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},e.getBarcodeMetadata=function(e,t){var n,r;return e==null||(n=e.getBarcodeMetadata())==null?t==null?null:t.getBarcodeMetadata():t==null||(r=t.getBarcodeMetadata())==null?n:n.getColumnCount()!==r.getColumnCount()&&n.getErrorCorrectionLevel()!==r.getErrorCorrectionLevel()&&n.getRowCount()!==r.getRowCount()?null:n},e.getRowIndicatorColumn=function(t,n,r,i,a,o){for(var s=new Wk(n,i),c=0;c<2;c++)for(var l=c===0?1:-1,u=Math.trunc(Math.trunc(r.getX())),d=Math.trunc(Math.trunc(r.getY()));d<=n.getMaxY()&&d>=n.getMinY();d+=l){var f=e.detectCodeword(t,0,t.getWidth(),i,u,d,a,o);f!=null&&(s.setCodeword(d,f),u=i?f.getStartX():f.getEndX())}return s},e.adjustCodewordCount=function(t,n){var r=n[0][1],i=r.getValue(),a=t.getBarcodeColumnCount()*t.getBarcodeRowCount()-e.getNumberOfECCodeWords(t.getBarcodeECLevel());if(i.length===0){if(a<1||a>Ck.MAX_CODEWORDS_IN_BARCODE)throw Y.getNotFoundInstance();r.setValue(a)}else i[0]!==a&&r.setValue(a)},e.createDecoderResult=function(t){var n=e.createBarcodeMatrix(t);e.adjustCodewordCount(t,n);for(var r=[],i=new Int32Array(t.getBarcodeRowCount()*t.getBarcodeColumnCount()),a=[],o=[],s=0;s<t.getBarcodeRowCount();s++)for(var c=0;c<t.getBarcodeColumnCount();c++){var l=n[s][c+1].getValue(),u=s*t.getBarcodeColumnCount()+c;l.length===0?r.push(u):l.length===1?i[u]=l[0]:(o.push(u),a.push(l))}for(var d=Array(a.length),f=0;f<d.length;f++)d[f]=a[f];return e.createDecoderResultFromAmbiguousValues(t.getBarcodeECLevel(),i,Ck.toIntArray(r),Ck.toIntArray(o),d)},e.createDecoderResultFromAmbiguousValues=function(t,n,r,i,a){for(var o=new Int32Array(i.length),s=100;s-- >0;){for(var c=0;c<o.length;c++)n[i[c]]=a[c][o[c]];try{return e.decodeCodewords(n,t,r)}catch(e){if(!(e instanceof LT))throw e}if(o.length===0)throw LT.getChecksumInstance();for(c=0;c<o.length;c++){if(o[c]<a[c].length-1){o[c]++;break}if(o[c]=0,c===o.length-1)throw LT.getChecksumInstance()}}throw LT.getChecksumInstance()},e.createBarcodeMatrix=function(e){for(var t,n,r,i,a=Array.from({length:e.getBarcodeRowCount()},(function(){return Array(e.getBarcodeColumnCount()+2)})),o=0;o<a.length;o++)for(var s=0;s<a[o].length;s++)a[o][s]=new Vk;var c=0;try{for(var l=sA(e.getDetectionResultColumns()),u=l.next();!u.done;u=l.next()){var d=u.value;if(d!=null)try{for(var f=(r=void 0,sA(d.getCodewords())),p=f.next();!p.done;p=f.next()){var m=p.value;if(m!=null){var h=m.getRowNumber();if(h>=0){if(h>=a.length)continue;a[h][c].setValue(m.getValue())}}}}catch(e){r={error:e}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}c++}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return a},e.isValidBarcodeColumn=function(e,t){return t>=0&&t<=e.getBarcodeColumnCount()+1},e.getStartColumn=function(t,n,r,i){var a,o,s=i?1:-1,c=null;if(e.isValidBarcodeColumn(t,n-s)&&(c=t.getDetectionResultColumn(n-s).getCodeword(r)),c!=null)return i?c.getEndX():c.getStartX();if((c=t.getDetectionResultColumn(n).getCodewordNearby(r))!=null)return i?c.getStartX():c.getEndX();if(e.isValidBarcodeColumn(t,n-s)&&(c=t.getDetectionResultColumn(n-s).getCodewordNearby(r)),c!=null)return i?c.getEndX():c.getStartX();for(var l=0;e.isValidBarcodeColumn(t,n-s);){n-=s;try{for(var u=(a=void 0,sA(t.getDetectionResultColumn(n).getCodewords())),d=u.next();!d.done;d=u.next()){var f=d.value;if(f!=null)return(i?f.getEndX():f.getStartX())+s*l*(f.getEndX()-f.getStartX())}}catch(e){a={error:e}}finally{try{d&&!d.done&&(o=u.return)&&o.call(u)}finally{if(a)throw a.error}}l++}return i?t.getBoundingBox().getMinX():t.getBoundingBox().getMaxX()},e.detectCodeword=function(t,n,r,i,a,o,s,c){a=e.adjustCodewordStartColumn(t,n,r,i,a,o);var l,u=e.getModuleBitCount(t,n,r,i,a,o);if(u==null)return null;var d=RE.sum(u);if(i)l=a+d;else{for(var f=0;f<u.length/2;f++){var p=u[f];u[f]=u[u.length-1-f],u[u.length-1-f]=p}a=(l=a)-d}if(!e.checkCodewordSkew(d,s,c))return null;var m=Jk.getDecodedValue(u),h=Ck.getCodeword(m);return h===-1?null:new qk(a,l,e.getCodewordBucketNumber(m),h)},e.getModuleBitCount=function(e,t,n,r,i,a){for(var o=i,s=new Int32Array(8),c=0,l=r?1:-1,u=r;(r?o<n:o>=t)&&c<s.length;)e.get(o,a)===u?(s[c]++,o+=l):(c++,u=!u);return c===s.length||o===(r?n:t)&&c===s.length-1?s:null},e.getNumberOfECCodeWords=function(e){return 2<<e},e.adjustCodewordStartColumn=function(t,n,r,i,a,o){for(var s=a,c=i?-1:1,l=0;l<2;l++){for(;(i?s>=n:s<r)&&i===t.get(s,o);){if(Math.abs(a-s)>e.CODEWORD_SKEW_SIZE)return a;s+=c}c=-c,i=!i}return s},e.checkCodewordSkew=function(t,n,r){return n-e.CODEWORD_SKEW_SIZE<=t&&t<=r+e.CODEWORD_SKEW_SIZE},e.decodeCodewords=function(t,n,r){if(t.length===0)throw J.getFormatInstance();var i=1<<n+1,a=e.correctErrors(t,r,i);e.verifyCodewordCount(t,i);var o=oA.decode(t,``+n);return o.setErrorsCorrected(a),o.setErasures(r.length),o},e.correctErrors=function(t,n,r){if(n!=null&&n.length>r/2+e.MAX_ERRORS||r<0||r>e.MAX_EC_CODEWORDS)throw LT.getChecksumInstance();return e.errorCorrection.decode(t,r,n)},e.verifyCodewordCount=function(e,t){if(e.length<4)throw J.getFormatInstance();var n=e[0];if(n>e.length)throw J.getFormatInstance();if(n===0){if(!(t<e.length))throw J.getFormatInstance();e[0]=e.length-t}},e.getBitCountForCodeword=function(e){for(var t=new Int32Array(8),n=0,r=t.length-1;!((1&e)!==n&&(n=1&e,--r<0));)t[r]++,e>>=1;return t},e.getCodewordBucketNumber=function(e){return e instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(e):this.getCodewordBucketNumber_number(e)},e.getCodewordBucketNumber_number=function(t){return e.getCodewordBucketNumber(e.getBitCountForCodeword(t))},e.getCodewordBucketNumber_Int32Array=function(e){return(e[0]-e[2]+e[4]-e[6]+9)%9},e.toString=function(e){for(var t=new Ik,n=0;n<e.length;n++){t.format(`Row %2d: `,n);for(var r=0;r<e[n].length;r++){var i=e[n][r];i.getValue().length===0?t.format(` `,null):t.format(`%4d(%2d)`,i.getValue()[0],i.getConfidence(i.getValue()[0]))}t.format(`%n`)}return t.toString()},e.CODEWORD_SKEW_SIZE=2,e.MAX_ERRORS=3,e.MAX_EC_CODEWORDS=512,e.errorCorrection=new Nk,e}(),lA=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},uA=function(){function e(){}return e.prototype.decode=function(t,n){n===void 0&&(n=null);var r=e.decode(t,n,!1);if(r==null||r.length===0||r[0]==null)throw Y.getNotFoundInstance();return r[0]},e.prototype.decodeMultiple=function(t,n){n===void 0&&(n=null);try{return e.decode(t,n,!0)}catch(e){throw e instanceof J||e instanceof LT?Y.getNotFoundInstance():e}},e.decode=function(t,n,r){var i,a,o=[],s=Ek.detectMultiple(t,n,r);try{for(var c=lA(s.getPoints()),l=c.next();!l.done;l=c.next()){var u=l.value,d=cA.decode(s.getBits(),u[4],u[5],u[6],u[7],e.getMinCodewordWidth(u),e.getMaxCodewordWidth(u)),f=new xE(d.getText(),d.getRawBytes(),void 0,u,X.PDF_417);f.putMetadata(wE.ERROR_CORRECTION_LEVEL,d.getECLevel());var p=d.getOther();p!=null&&f.putMetadata(wE.PDF417_EXTRA_METADATA,p),o.push(f)}}catch(e){i={error:e}}finally{try{l&&!l.done&&(a=c.return)&&a.call(c)}finally{if(i)throw i.error}}return o.map((function(e){return e}))},e.getMaxWidth=function(e,t){return e==null||t==null?0:Math.trunc(Math.abs(e.getX()-t.getX()))},e.getMinWidth=function(e,t){return e==null||t==null?KT.MAX_VALUE:Math.trunc(Math.abs(e.getX()-t.getX()))},e.getMaxCodewordWidth=function(t){return Math.floor(Math.max(Math.max(e.getMaxWidth(t[0],t[4]),e.getMaxWidth(t[6],t[2])*Ck.MODULES_IN_CODEWORD/Ck.MODULES_IN_STOP_PATTERN),Math.max(e.getMaxWidth(t[1],t[5]),e.getMaxWidth(t[7],t[3])*Ck.MODULES_IN_CODEWORD/Ck.MODULES_IN_STOP_PATTERN)))},e.getMinCodewordWidth=function(t){return Math.floor(Math.min(Math.min(e.getMinWidth(t[0],t[4]),e.getMinWidth(t[6],t[2])*Ck.MODULES_IN_CODEWORD/Ck.MODULES_IN_STOP_PATTERN),Math.min(e.getMinWidth(t[1],t[5]),e.getMinWidth(t[7],t[3])*Ck.MODULES_IN_CODEWORD/Ck.MODULES_IN_STOP_PATTERN)))},e.prototype.reset=function(){},e}(),dA=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),fA=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return dA(t,e),t.kind=`ReaderException`,t}(jT),pA=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},mA=function(){function e(){}return e.prototype.decode=function(e,t){return this.setHints(t),this.decodeInternal(e)},e.prototype.decodeWithState=function(e){return this.readers!==null&&this.readers!==void 0||this.setHints(null),this.decodeInternal(e)},e.prototype.setHints=function(e){this.hints=e;var t=e!=null&&e.get(YT.TRY_HARDER)!==void 0,n=e==null?null:e.get(YT.POSSIBLE_FORMATS),r=[];if(n!=null){var i=n.some((function(e){return e===X.UPC_A||e===X.UPC_E||e===X.EAN_13||e===X.EAN_8||e===X.CODABAR||e===X.CODE_39||e===X.CODE_93||e===X.CODE_128||e===X.ITF||e===X.RSS_14||e===X.RSS_EXPANDED}));i&&!t&&r.push(new OO(e)),n.includes(X.QR_CODE)&&r.push(new xk),n.includes(X.DATA_MATRIX)&&r.push(new WO),n.includes(X.AZTEC)&&r.push(new ZE),n.includes(X.PDF_417)&&r.push(new uA),i&&t&&r.push(new OO(e))}r.length===0&&(t||r.push(new OO(e)),r.push(new xk),r.push(new WO),r.push(new ZE),r.push(new uA),t&&r.push(new OO(e))),this.readers=r},e.prototype.reset=function(){var e,t;if(this.readers!==null)try{for(var n=pA(this.readers),r=n.next();!r.done;r=n.next())r.value.reset()}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},e.prototype.decodeInternal=function(e){var t,n;if(this.readers===null)throw new fA(`No readers where selected, nothing can be read.`);try{for(var r=pA(this.readers),i=r.next();!i.done;i=r.next()){var a=i.value;try{return a.decode(e,this.hints)}catch(e){if(e instanceof fA)continue}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}throw new Y(`No MultiFormat Readers were able to detect the code.`)},e}(),hA=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(t,n){t===void 0&&(t=null),n===void 0&&(n=500);var r=new mA;return r.setHints(t),e.call(this,r,n)||this}hA(t,e),t.prototype.decodeBitmap=function(e){return this.reader.decodeWithState(e)}})(bE);var gA=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(t){return t===void 0&&(t=500),e.call(this,new uA,t)||this}gA(t,e)})(bE);var _A,vA=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(t){return t===void 0&&(t=500),e.call(this,new xk,t)||this}vA(t,e)})(bE),function(e){e[e.ERROR_CORRECTION=0]=`ERROR_CORRECTION`,e[e.CHARACTER_SET=1]=`CHARACTER_SET`,e[e.DATA_MATRIX_SHAPE=2]=`DATA_MATRIX_SHAPE`,e[e.MIN_SIZE=3]=`MIN_SIZE`,e[e.MAX_SIZE=4]=`MAX_SIZE`,e[e.MARGIN=5]=`MARGIN`,e[e.PDF417_COMPACT=6]=`PDF417_COMPACT`,e[e.PDF417_COMPACTION=7]=`PDF417_COMPACTION`,e[e.PDF417_DIMENSIONS=8]=`PDF417_DIMENSIONS`,e[e.AZTEC_LAYERS=9]=`AZTEC_LAYERS`,e[e.QR_VERSION=10]=`QR_VERSION`}(_A||={});var yA=_A,bA=function(){function e(e){this.field=e,this.cachedGenerators=[],this.cachedGenerators.push(new DE(e,Int32Array.from([1])))}return e.prototype.buildGenerator=function(e){var t=this.cachedGenerators;if(e>=t.length)for(var n=t[t.length-1],r=this.field,i=t.length;i<=e;i++){var a=n.multiply(new DE(r,Int32Array.from([1,r.exp(i-1+r.getGeneratorBase())])));t.push(a),n=a}return t[e]},e.prototype.encode=function(e,t){if(t===0)throw new q(`No error correction bytes`);var n=e.length-t;if(n<=0)throw new q(`No data bytes provided`);var r=this.buildGenerator(t),i=new Int32Array(n);zT.arraycopy(e,0,i,0,n);for(var a=new DE(this.field,i),o=(a=a.multiplyByMonomial(t,1)).divide(r)[1].getCoefficients(),s=t-o.length,c=0;c<s;c++)e[n+c]=0;zT.arraycopy(o,0,e,n+s,o.length)},e}(),xA=function(){function e(){}return e.applyMaskPenaltyRule1=function(t){return e.applyMaskPenaltyRule1Internal(t,!0)+e.applyMaskPenaltyRule1Internal(t,!1)},e.applyMaskPenaltyRule2=function(t){for(var n=0,r=t.getArray(),i=t.getWidth(),a=t.getHeight(),o=0;o<a-1;o++)for(var s=r[o],c=0;c<i-1;c++){var l=s[c];l===s[c+1]&&l===r[o+1][c]&&l===r[o+1][c+1]&&n++}return e.N2*n},e.applyMaskPenaltyRule3=function(t){for(var n=0,r=t.getArray(),i=t.getWidth(),a=t.getHeight(),o=0;o<a;o++)for(var s=0;s<i;s++){var c=r[o];s+6<i&&c[s]===1&&c[s+1]===0&&c[s+2]===1&&c[s+3]===1&&c[s+4]===1&&c[s+5]===0&&c[s+6]===1&&(e.isWhiteHorizontal(c,s-4,s)||e.isWhiteHorizontal(c,s+7,s+11))&&n++,o+6<a&&r[o][s]===1&&r[o+1][s]===0&&r[o+2][s]===1&&r[o+3][s]===1&&r[o+4][s]===1&&r[o+5][s]===0&&r[o+6][s]===1&&(e.isWhiteVertical(r,s,o-4,o)||e.isWhiteVertical(r,s,o+7,o+11))&&n++}return n*e.N3},e.isWhiteHorizontal=function(e,t,n){t=Math.max(t,0),n=Math.min(n,e.length);for(var r=t;r<n;r++)if(e[r]===1)return!1;return!0},e.isWhiteVertical=function(e,t,n,r){n=Math.max(n,0),r=Math.min(r,e.length);for(var i=n;i<r;i++)if(e[i][t]===1)return!1;return!0},e.applyMaskPenaltyRule4=function(t){for(var n=0,r=t.getArray(),i=t.getWidth(),a=t.getHeight(),o=0;o<a;o++)for(var s=r[o],c=0;c<i;c++)s[c]===1&&n++;var l=t.getHeight()*t.getWidth();return Math.floor(10*Math.abs(2*n-l)/l)*e.N4},e.getDataMaskBit=function(e,t,n){var r,i;switch(e){case 0:r=n+t&1;break;case 1:r=1&n;break;case 2:r=t%3;break;case 3:r=(n+t)%3;break;case 4:r=Math.floor(n/2)+Math.floor(t/3)&1;break;case 5:r=(1&(i=n*t))+i%3;break;case 6:r=(1&(i=n*t))+i%3&1;break;case 7:r=(i=n*t)%3+(n+t&1)&1;break;default:throw new q(`Invalid mask pattern: `+e)}return r===0},e.applyMaskPenaltyRule1Internal=function(t,n){for(var r=0,i=n?t.getHeight():t.getWidth(),a=n?t.getWidth():t.getHeight(),o=t.getArray(),s=0;s<i;s++){for(var c=0,l=-1,u=0;u<a;u++){var d=n?o[s][u]:o[u][s];d===l?c++:(c>=5&&(r+=e.N1+(c-5)),c=1,l=d)}c>=5&&(r+=e.N1+(c-5))}return r},e.N1=3,e.N2=3,e.N3=40,e.N4=10,e}(),SA=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},CA=function(){function e(e,t){this.width=e,this.height=t;for(var n=Array(t),r=0;r!==t;r++)n[r]=new Uint8Array(e);this.bytes=n}return e.prototype.getHeight=function(){return this.height},e.prototype.getWidth=function(){return this.width},e.prototype.get=function(e,t){return this.bytes[t][e]},e.prototype.getArray=function(){return this.bytes},e.prototype.setNumber=function(e,t,n){this.bytes[t][e]=n},e.prototype.setBoolean=function(e,t,n){this.bytes[t][e]=+!!n},e.prototype.clear=function(e){var t,n;try{for(var r=SA(this.bytes),i=r.next();!i.done;i=r.next()){var a=i.value;GT.fill(a,e)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;if(this.width!==n.width||this.height!==n.height)return!1;for(var r=0,i=this.height;r<i;++r)for(var a=this.bytes[r],o=n.bytes[r],s=0,c=this.width;s<c;++s)if(a[s]!==o[s])return!1;return!0},e.prototype.toString=function(){for(var e=new iE,t=0,n=this.height;t<n;++t){for(var r=this.bytes[t],i=0,a=this.width;i<a;++i)switch(r[i]){case 0:e.append(` 0`);break;case 1:e.append(` 1`);break;default:e.append(` `)}e.append(`
|
|
128
|
+
`)}return e.toString()},e}(),wA=function(){function e(){this.maskPattern=-1}return e.prototype.getMode=function(){return this.mode},e.prototype.getECLevel=function(){return this.ecLevel},e.prototype.getVersion=function(){return this.version},e.prototype.getMaskPattern=function(){return this.maskPattern},e.prototype.getMatrix=function(){return this.matrix},e.prototype.toString=function(){var e=new iE;return e.append(`<<
|
|
129
|
+
`),e.append(` mode: `),e.append(this.mode?this.mode.toString():`null`),e.append(`
|
|
130
|
+
ecLevel: `),e.append(this.ecLevel?this.ecLevel.toString():`null`),e.append(`
|
|
131
|
+
version: `),e.append(this.version?this.version.toString():`null`),e.append(`
|
|
132
|
+
maskPattern: `),e.append(this.maskPattern.toString()),this.matrix?(e.append(`
|
|
133
|
+
matrix:
|
|
134
|
+
`),e.append(this.matrix.toString())):e.append(`
|
|
135
|
+
matrix: null
|
|
136
|
+
`),e.append(`>>
|
|
137
|
+
`),e.toString()},e.prototype.setMode=function(e){this.mode=e},e.prototype.setECLevel=function(e){this.ecLevel=e},e.prototype.setVersion=function(e){this.version=e},e.prototype.setMaskPattern=function(e){this.maskPattern=e},e.prototype.setMatrix=function(e){this.matrix=e},e.isValidMaskPattern=function(t){return t>=0&&t<e.NUM_MASK_PATTERNS},e.NUM_MASK_PATTERNS=8,e}(),TA=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),EA=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return TA(t,e),t.kind=`WriterException`,t}(jT),DA=function(){function e(){}return e.clearMatrix=function(e){e.clear(255)},e.buildMatrix=function(t,n,r,i,a){e.clearMatrix(a),e.embedBasicPatterns(r,a),e.embedTypeInfo(n,i,a),e.maybeEmbedVersionInfo(r,a),e.embedDataBits(t,i,a)},e.embedBasicPatterns=function(t,n){e.embedPositionDetectionPatternsAndSeparators(n),e.embedDarkDotAtLeftBottomCorner(n),e.maybeEmbedPositionAdjustmentPatterns(t,n),e.embedTimingPatterns(n)},e.embedTypeInfo=function(t,n,r){var i=new qT;e.makeTypeInfoBits(t,n,i);for(var a=0,o=i.getSize();a<o;++a){var s=i.get(i.getSize()-1-a),c=e.TYPE_INFO_COORDINATES[a],l=c[0],u=c[1];if(r.setBoolean(l,u,s),a<8){var d=r.getWidth()-a-1,f=8;r.setBoolean(d,f,s)}else d=8,f=r.getHeight()-7+(a-8),r.setBoolean(d,f,s)}},e.maybeEmbedVersionInfo=function(t,n){if(!(t.getVersionNumber()<7)){var r=new qT;e.makeVersionInfoBits(t,r);for(var i=17,a=0;a<6;++a)for(var o=0;o<3;++o){var s=r.get(i);i--,n.setBoolean(a,n.getHeight()-11+o,s),n.setBoolean(n.getHeight()-11+o,a,s)}}},e.embedDataBits=function(t,n,r){for(var i=0,a=-1,o=r.getWidth()-1,s=r.getHeight()-1;o>0;){for(o===6&&--o;s>=0&&s<r.getHeight();){for(var c=0;c<2;++c){var l=o-c;if(e.isEmpty(r.get(l,s))){var u=void 0;i<t.getSize()?(u=t.get(i),++i):u=!1,n!==255&&xA.getDataMaskBit(n,l,s)&&(u=!u),r.setBoolean(l,s,u)}}s+=a}s+=a=-a,o-=2}if(i!==t.getSize())throw new EA(`Not all bits consumed: `+i+`/`+t.getSize())},e.findMSBSet=function(e){return 32-KT.numberOfLeadingZeros(e)},e.calculateBCHCode=function(t,n){if(n===0)throw new q(`0 polynomial`);var r=e.findMSBSet(n);for(t<<=r-1;e.findMSBSet(t)>=r;)t^=n<<e.findMSBSet(t)-r;return t},e.makeTypeInfoBits=function(t,n,r){if(!wA.isValidMaskPattern(n))throw new EA(`Invalid mask pattern`);var i=t.getBits()<<3|n;r.appendBits(i,5);var a=e.calculateBCHCode(i,e.TYPE_INFO_POLY);r.appendBits(a,10);var o=new qT;if(o.appendBits(e.TYPE_INFO_MASK_PATTERN,15),r.xor(o),r.getSize()!==15)throw new EA(`should not happen but we got: `+r.getSize())},e.makeVersionInfoBits=function(t,n){n.appendBits(t.getVersionNumber(),6);var r=e.calculateBCHCode(t.getVersionNumber(),e.VERSION_INFO_POLY);if(n.appendBits(r,12),n.getSize()!==18)throw new EA(`should not happen but we got: `+n.getSize())},e.isEmpty=function(e){return e===255},e.embedTimingPatterns=function(t){for(var n=8;n<t.getWidth()-8;++n){var r=(n+1)%2;e.isEmpty(t.get(n,6))&&t.setNumber(n,6,r),e.isEmpty(t.get(6,n))&&t.setNumber(6,n,r)}},e.embedDarkDotAtLeftBottomCorner=function(e){if(e.get(8,e.getHeight()-8)===0)throw new EA;e.setNumber(8,e.getHeight()-8,1)},e.embedHorizontalSeparationPattern=function(t,n,r){for(var i=0;i<8;++i){if(!e.isEmpty(r.get(t+i,n)))throw new EA;r.setNumber(t+i,n,0)}},e.embedVerticalSeparationPattern=function(t,n,r){for(var i=0;i<7;++i){if(!e.isEmpty(r.get(t,n+i)))throw new EA;r.setNumber(t,n+i,0)}},e.embedPositionAdjustmentPattern=function(t,n,r){for(var i=0;i<5;++i)for(var a=e.POSITION_ADJUSTMENT_PATTERN[i],o=0;o<5;++o)r.setNumber(t+o,n+i,a[o])},e.embedPositionDetectionPattern=function(t,n,r){for(var i=0;i<7;++i)for(var a=e.POSITION_DETECTION_PATTERN[i],o=0;o<7;++o)r.setNumber(t+o,n+i,a[o])},e.embedPositionDetectionPatternsAndSeparators=function(t){var n=e.POSITION_DETECTION_PATTERN[0].length;e.embedPositionDetectionPattern(0,0,t),e.embedPositionDetectionPattern(t.getWidth()-n,0,t),e.embedPositionDetectionPattern(0,t.getWidth()-n,t),e.embedHorizontalSeparationPattern(0,7,t),e.embedHorizontalSeparationPattern(t.getWidth()-8,7,t),e.embedHorizontalSeparationPattern(0,t.getWidth()-8,t),e.embedVerticalSeparationPattern(7,0,t),e.embedVerticalSeparationPattern(t.getHeight()-7-1,0,t),e.embedVerticalSeparationPattern(7,t.getHeight()-7,t)},e.maybeEmbedPositionAdjustmentPatterns=function(t,n){if(!(t.getVersionNumber()<2))for(var r=t.getVersionNumber()-1,i=e.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[r],a=0,o=i.length;a!==o;a++){var s=i[a];if(s>=0)for(var c=0;c!==o;c++){var l=i[c];l>=0&&e.isEmpty(n.get(l,s))&&e.embedPositionAdjustmentPattern(l-2,s-2,n)}}},e.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),e.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),e.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),e.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),e.VERSION_INFO_POLY=7973,e.TYPE_INFO_POLY=1335,e.TYPE_INFO_MASK_PATTERN=21522,e}(),OA=function(){function e(e,t){this.dataBytes=e,this.errorCorrectionBytes=t}return e.prototype.getDataBytes=function(){return this.dataBytes},e.prototype.getErrorCorrectionBytes=function(){return this.errorCorrectionBytes},e}(),kA=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};(function(){function e(){}e.calculateMaskPenalty=function(e){return xA.applyMaskPenaltyRule1(e)+xA.applyMaskPenaltyRule2(e)+xA.applyMaskPenaltyRule3(e)+xA.applyMaskPenaltyRule4(e)},e.encode=function(t,n,r){r===void 0&&(r=null);var i=e.DEFAULT_BYTE_MODE_ENCODING,a=r!==null&&r.get(yA.CHARACTER_SET)!==void 0;a&&(i=r.get(yA.CHARACTER_SET).toString());var o=this.chooseMode(t,i),s=new qT;if(o===ok.BYTE&&(a||e.DEFAULT_BYTE_MODE_ENCODING!==i)){var c=$T.getCharacterSetECIByName(i);c!==void 0&&this.appendECI(c,s)}this.appendModeInfo(o,s);var l,u=new qT;if(this.appendBytes(t,o,u,i),r!==null&&r.get(yA.QR_VERSION)!==void 0){var d=Number.parseInt(r.get(yA.QR_VERSION).toString(),10);l=QO.getVersionForNumber(d);var f=this.calculateBitsNeeded(o,s,u,l);if(!this.willFit(f,l,n))throw new EA(`Data too big for requested version`)}else l=this.recommendVersion(n,o,s,u);var p=new qT;p.appendBitArray(s);var m=o===ok.BYTE?u.getSizeInBytes():t.length;this.appendLengthInfo(m,l,o,p),p.appendBitArray(u);var h=l.getECBlocksForLevel(n),g=l.getTotalCodewords()-h.getTotalECCodewords();this.terminateBits(g,p);var _=this.interleaveWithECBytes(p,l.getTotalCodewords(),g,h.getNumBlocks()),v=new wA;v.setECLevel(n),v.setMode(o),v.setVersion(l);var y=l.getDimensionForVersion(),b=new CA(y,y),x=this.chooseMaskPattern(_,n,l,b);return v.setMaskPattern(x),DA.buildMatrix(_,n,l,x,b),v.setMatrix(b),v},e.recommendVersion=function(e,t,n,r){var i=this.calculateBitsNeeded(t,n,r,QO.getVersionForNumber(1)),a=this.chooseVersion(i,e),o=this.calculateBitsNeeded(t,n,r,a);return this.chooseVersion(o,e)},e.calculateBitsNeeded=function(e,t,n,r){return t.getSize()+e.getCharacterCountBits(r)+n.getSize()},e.getAlphanumericCode=function(t){return t<e.ALPHANUMERIC_TABLE.length?e.ALPHANUMERIC_TABLE[t]:-1},e.chooseMode=function(t,n){if(n===void 0&&(n=null),$T.SJIS.getName()===n&&this.isOnlyDoubleByteKanji(t))return ok.KANJI;for(var r=!1,i=!1,a=0,o=t.length;a<o;++a){var s=t.charAt(a);if(e.isDigit(s))r=!0;else{if(this.getAlphanumericCode(s.charCodeAt(0))===-1)return ok.BYTE;i=!0}}return i?ok.ALPHANUMERIC:r?ok.NUMERIC:ok.BYTE},e.isOnlyDoubleByteKanji=function(e){var t;try{t=nE.encode(e,$T.SJIS)}catch{return!1}var n=t.length;if(n%2!=0)return!1;for(var r=0;r<n;r+=2){var i=255&t[r];if((i<129||i>159)&&(i<224||i>235))return!1}return!0},e.chooseMaskPattern=function(e,t,n,r){for(var i=2**53-1,a=-1,o=0;o<wA.NUM_MASK_PATTERNS;o++){DA.buildMatrix(e,t,n,o,r);var s=this.calculateMaskPenalty(r);s<i&&(i=s,a=o)}return a},e.chooseVersion=function(t,n){for(var r=1;r<=40;r++){var i=QO.getVersionForNumber(r);if(e.willFit(t,i,n))return i}throw new EA(`Data too big`)},e.willFit=function(e,t,n){return t.getTotalCodewords()-t.getECBlocksForLevel(n).getTotalECCodewords()>=(e+7)/8},e.terminateBits=function(e,t){var n=8*e;if(t.getSize()>n)throw new EA(`data bits cannot fit in the QR Code`+t.getSize()+` > `+n);for(var r=0;r<4&&t.getSize()<n;++r)t.appendBit(!1);var i=7&t.getSize();if(i>0)for(r=i;r<8;r++)t.appendBit(!1);var a=e-t.getSizeInBytes();for(r=0;r<a;++r)t.appendBits(1&r?17:236,8);if(t.getSize()!==n)throw new EA(`Bits size does not equal capacity`)},e.getNumDataBytesAndNumECBytesForBlockID=function(e,t,n,r,i,a){if(r>=n)throw new EA(`Block ID too large`);var o=e%n,s=n-o,c=Math.floor(e/n),l=c+1,u=Math.floor(t/n),d=u+1,f=c-u,p=l-d;if(f!==p)throw new EA(`EC bytes mismatch`);if(n!==s+o)throw new EA(`RS blocks mismatch`);if(e!==(u+f)*s+(d+p)*o)throw new EA(`Total bytes mismatch`);r<s?(i[0]=u,a[0]=f):(i[0]=d,a[0]=p)},e.interleaveWithECBytes=function(t,n,r,i){var a,o,s,c;if(t.getSizeInBytes()!==r)throw new EA(`Number of bits and data bytes does not match`);for(var l=0,u=0,d=0,f=[],p=0;p<i;++p){var m=new Int32Array(1),h=new Int32Array(1);e.getNumDataBytesAndNumECBytesForBlockID(n,r,i,p,m,h);var g=m[0],_=new Uint8Array(g);t.toBytes(8*l,_,0,g);var v=e.generateECBytes(_,h[0]);f.push(new OA(_,v)),u=Math.max(u,g),d=Math.max(d,v.length),l+=m[0]}if(r!==l)throw new EA(`Data bytes does not match offset`);var y=new qT;for(p=0;p<u;++p)try{for(var b=(a=void 0,kA(f)),x=b.next();!x.done;x=b.next())p<(_=x.value.getDataBytes()).length&&y.appendBits(_[p],8)}catch(e){a={error:e}}finally{try{x&&!x.done&&(o=b.return)&&o.call(b)}finally{if(a)throw a.error}}for(p=0;p<d;++p)try{for(var S=(s=void 0,kA(f)),C=S.next();!C.done;C=S.next())p<(v=C.value.getErrorCorrectionBytes()).length&&y.appendBits(v[p],8)}catch(e){s={error:e}}finally{try{C&&!C.done&&(c=S.return)&&c.call(S)}finally{if(s)throw s.error}}if(n!==y.getSizeInBytes())throw new EA(`Interleaving error: `+n+` and `+y.getSizeInBytes()+` differ.`);return y},e.generateECBytes=function(e,t){for(var n=e.length,r=new Int32Array(n+t),i=0;i<n;i++)r[i]=255&e[i];new bA(jE.QR_CODE_FIELD_256).encode(r,t);var a=new Uint8Array(t);for(i=0;i<t;i++)a[i]=r[n+i];return a},e.appendModeInfo=function(e,t){t.appendBits(e.getBits(),4)},e.appendLengthInfo=function(e,t,n,r){var i=n.getCharacterCountBits(t);if(e>=1<<i)throw new EA(e+` is bigger than `+((1<<i)-1));r.appendBits(e,i)},e.appendBytes=function(t,n,r,i){switch(n){case ok.NUMERIC:e.appendNumericBytes(t,r);break;case ok.ALPHANUMERIC:e.appendAlphanumericBytes(t,r);break;case ok.BYTE:e.append8BitBytes(t,r,i);break;case ok.KANJI:e.appendKanjiBytes(t,r);break;default:throw new EA(`Invalid mode: `+n)}},e.getDigit=function(e){return e.charCodeAt(0)-48},e.isDigit=function(t){var n=e.getDigit(t);return n>=0&&n<=9},e.appendNumericBytes=function(t,n){for(var r=t.length,i=0;i<r;){var a=e.getDigit(t.charAt(i));if(i+2<r){var o=e.getDigit(t.charAt(i+1)),s=e.getDigit(t.charAt(i+2));n.appendBits(100*a+10*o+s,10),i+=3}else i+1<r?(o=e.getDigit(t.charAt(i+1)),n.appendBits(10*a+o,7),i+=2):(n.appendBits(a,4),i++)}},e.appendAlphanumericBytes=function(t,n){for(var r=t.length,i=0;i<r;){var a=e.getAlphanumericCode(t.charCodeAt(i));if(a===-1)throw new EA;if(i+1<r){var o=e.getAlphanumericCode(t.charCodeAt(i+1));if(o===-1)throw new EA;n.appendBits(45*a+o,11),i+=2}else n.appendBits(a,6),i++}},e.append8BitBytes=function(e,t,n){var r;try{r=nE.encode(e,n)}catch(e){throw new EA(e)}for(var i=0,a=r.length;i!==a;i++){var o=r[i];t.appendBits(o,8)}},e.appendKanjiBytes=function(e,t){var n;try{n=nE.encode(e,$T.SJIS)}catch(e){throw new EA(e)}for(var r=n.length,i=0;i<r;i+=2){var a=(255&n[i])<<8&4294967295|255&n[i+1],o=-1;if(a>=33088&&a<=40956?o=a-33088:a>=57408&&a<=60351&&(o=a-49472),o===-1)throw new EA(`Invalid byte sequence`);var s=192*(o>>8)+(255&o);t.appendBits(s,13)}},e.appendECI=function(e,t){t.appendBits(ok.ECI.getBits(),4),t.appendBits(e.getValue(),8)},e.ALPHANUMERIC_TABLE=Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),e.DEFAULT_BYTE_MODE_ENCODING=$T.UTF8.getName()})();var AA=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(t,n,r,i,a,o,s,c){var l=e.call(this,o,s)||this;if(l.yuvData=t,l.dataWidth=n,l.dataHeight=r,l.left=i,l.top=a,i+o>n||a+s>r)throw new q(`Crop rectangle does not fit within image data.`);return c&&l.reverseHorizontal(o,s),l}AA(t,e),t.prototype.getRow=function(e,t){if(e<0||e>=this.getHeight())throw new q(`Requested row is outside the image: `+e);var n=this.getWidth();(t==null||t.length<n)&&(t=new Uint8ClampedArray(n));var r=(e+this.top)*this.dataWidth+this.left;return zT.arraycopy(this.yuvData,r,t,0,n),t},t.prototype.getMatrix=function(){var e=this.getWidth(),t=this.getHeight();if(e===this.dataWidth&&t===this.dataHeight)return this.yuvData;var n=e*t,r=new Uint8ClampedArray(n),i=this.top*this.dataWidth+this.left;if(e===this.dataWidth)return zT.arraycopy(this.yuvData,i,r,0,n),r;for(var a=0;a<t;a++){var o=a*e;zT.arraycopy(this.yuvData,i,r,o,e),i+=this.dataWidth}return r},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(e,n,r,i){return new t(this.yuvData,this.dataWidth,this.dataHeight,this.left+e,this.top+n,r,i,!1)},t.prototype.renderThumbnail=function(){for(var e=this.getWidth()/t.THUMBNAIL_SCALE_FACTOR,n=this.getHeight()/t.THUMBNAIL_SCALE_FACTOR,r=new Int32Array(e*n),i=this.yuvData,a=this.top*this.dataWidth+this.left,o=0;o<n;o++){for(var s=o*e,c=0;c<e;c++){var l=255&i[a+c*t.THUMBNAIL_SCALE_FACTOR];r[s+c]=4278190080|65793*l}a+=this.dataWidth*t.THUMBNAIL_SCALE_FACTOR}return r},t.prototype.getThumbnailWidth=function(){return this.getWidth()/t.THUMBNAIL_SCALE_FACTOR},t.prototype.getThumbnailHeight=function(){return this.getHeight()/t.THUMBNAIL_SCALE_FACTOR},t.prototype.reverseHorizontal=function(e,t){for(var n=this.yuvData,r=0,i=this.top*this.dataWidth+this.left;r<t;r++,i+=this.dataWidth)for(var a=i+e/2,o=i,s=i+e-1;o<a;o++,s--){var c=n[o];n[o]=n[s],n[s]=c}},t.prototype.invert=function(){return new pE(this)},t.THUMBNAIL_SCALE_FACTOR=2})(dE);var jA=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(t,n,r,i,a,o,s){var c=e.call(this,n,r)||this;if(c.dataWidth=i,c.dataHeight=a,c.left=o,c.top=s,t.BYTES_PER_ELEMENT===4){for(var l=n*r,u=new Uint8ClampedArray(l),d=0;d<l;d++){var f=t[d],p=f>>16&255,m=f>>7&510,h=255&f;u[d]=(p+m+h)/4&255}c.luminances=u}else c.luminances=t;if(i===void 0&&(c.dataWidth=n),a===void 0&&(c.dataHeight=r),o===void 0&&(c.left=0),s===void 0&&(c.top=0),c.left+n>c.dataWidth||c.top+r>c.dataHeight)throw new q(`Crop rectangle does not fit within image data.`);return c}jA(t,e),t.prototype.getRow=function(e,t){if(e<0||e>=this.getHeight())throw new q(`Requested row is outside the image: `+e);var n=this.getWidth();(t==null||t.length<n)&&(t=new Uint8ClampedArray(n));var r=(e+this.top)*this.dataWidth+this.left;return zT.arraycopy(this.luminances,r,t,0,n),t},t.prototype.getMatrix=function(){var e=this.getWidth(),t=this.getHeight();if(e===this.dataWidth&&t===this.dataHeight)return this.luminances;var n=e*t,r=new Uint8ClampedArray(n),i=this.top*this.dataWidth+this.left;if(e===this.dataWidth)return zT.arraycopy(this.luminances,i,r,0,n),r;for(var a=0;a<t;a++){var o=a*e;zT.arraycopy(this.luminances,i,r,o,e),i+=this.dataWidth}return r},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(e,n,r,i){return new t(this.luminances,r,i,this.dataWidth,this.dataHeight,this.left+e,this.top+n)},t.prototype.invert=function(){return new pE(this)}})(dE);var MA=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(){return e!==null&&e.apply(this,arguments)||this}MA(t,e),t.forName=function(e){return this.getCharacterSetECIByName(e)}})($T);var NA=function(){function e(e){this.previous=e}return e.prototype.getPrevious=function(){return this.previous},e}(),PA=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),FA=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.value=n,i.bitCount=r,i}return PA(t,e),t.prototype.appendTo=function(e,t){e.appendBits(this.value,this.bitCount)},t.prototype.add=function(e,n){return new t(this,e,n)},t.prototype.addBinaryShift=function(e,n){return console.warn(`addBinaryShift on SimpleToken, this simply returns a copy of this token`),new t(this,e,n)},t.prototype.toString=function(){var e=this.value&(1<<this.bitCount)-1;return e|=1<<this.bitCount,`<`+KT.toBinaryString(e|1<<this.bitCount).substring(1)+`>`},t}(NA),IA=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(t,n,r){var i=e.call(this,t,0,0)||this;return i.binaryShiftStart=n,i.binaryShiftByteCount=r,i}IA(t,e),t.prototype.appendTo=function(e,t){for(var n=0;n<this.binaryShiftByteCount;n++)(n===0||n===31&&this.binaryShiftByteCount<=62)&&(e.appendBits(31,5),this.binaryShiftByteCount>62?e.appendBits(this.binaryShiftByteCount-31,16):n===0?e.appendBits(Math.min(this.binaryShiftByteCount,31),5):e.appendBits(this.binaryShiftByteCount-31,5)),e.appendBits(t[this.binaryShiftStart+n],8)},t.prototype.addBinaryShift=function(e,n){return new t(this,e,n)},t.prototype.toString=function(){return`<`+this.binaryShiftStart+`::`+(this.binaryShiftStart+this.binaryShiftByteCount-1)+`>`}})(FA),new FA(null,0,0);var LA=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};(function(e){var t,n;try{for(var r=LA(e),i=r.next();!i.done;i=r.next()){var a=i.value;GT.fill(a,-1)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}e[0][4]=0,e[1][4]=0,e[1][0]=28,e[3][4]=0,e[2][4]=0,e[2][0]=15})(GT.createInt32Array(6,6)),function(e){var t=rE.getCharCode(` `),n=rE.getCharCode(`.`),r=rE.getCharCode(`,`);e[0][t]=1;for(var i=rE.getCharCode(`Z`),a=rE.getCharCode(`A`),o=a;o<=i;o++)e[0][o]=o-a+2;e[1][t]=1;var s=rE.getCharCode(`z`),c=rE.getCharCode(`a`);for(o=c;o<=s;o++)e[1][o]=o-c+2;e[2][t]=1;var l=rE.getCharCode(`9`),u=rE.getCharCode(`0`);for(o=u;o<=l;o++)e[2][o]=o-u+2;e[2][r]=12,e[2][n]=13;for(var d=`\0 \x07\b
|
|
138
|
+
\v\f\r\x1B@\\^_\`|~`.split(``),f=0;f<d.length;f++)e[3][rE.getCharCode(d[f])]=f;var p=`\0\r\0\0\0\0!'#$%&'()*+,-./:;<=>?[]{}`.split(``);for(f=0;f<p.length;f++)rE.getCharCode(p[f])>0&&(e[4][rE.getCharCode(p[f])]=f)}(GT.createInt32Array(5,256));var RA=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),zA=function(e){function t(n){var r=e.call(this,n.width,n.height)||this;return r.canvas=n,r.buffer=t.makeBufferFromCanvasImageData(n),r}return RA(t,e),t.makeBufferFromCanvasImageData=function(e){var n=e.getContext(`2d`);if(!n)throw Error(`Couldn't get canvas context.`);var r=n.getImageData(0,0,e.width,e.height);return t.toGrayscaleBuffer(r.data,e.width,e.height)},t.toGrayscaleBuffer=function(e,t,n){for(var r=new Uint8ClampedArray(t*n),i=0,a=0,o=e.length;i<o;i+=4,a++){var s=void 0;s=e[i+3]===0?255:306*e[i]+601*e[i+1]+117*e[i+2]+512>>10,r[a]=s}return r},t.prototype.getRow=function(e,t){if(e<0||e>=this.getHeight())throw new q(`Requested row is outside the image: `+e);var n=this.getWidth(),r=e*n;return t===null?t=this.buffer.slice(r,r+n):(t.length<n&&(t=new Uint8ClampedArray(n)),t.set(this.buffer.slice(r,r+n))),t},t.prototype.getMatrix=function(){return this.buffer},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(t,n,r,i){return e.prototype.crop.call(this,t,n,r,i),this},t.prototype.isRotateSupported=function(){return!0},t.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},t.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},t.prototype.invert=function(){return new pE(this)},t.prototype.getTempCanvasElement=function(){if(this.tempCanvasElement===null){var e=this.canvas.ownerDocument.createElement(`canvas`);e.width=this.canvas.width,e.height=this.canvas.height,this.tempCanvasElement=e}return this.tempCanvasElement},t.prototype.rotate=function(e){var n=this.getTempCanvasElement();if(!n)throw Error(`Could not create a Canvas element.`);var r=e*t.DEGREE_TO_RADIANS,i=this.canvas.width,a=this.canvas.height,o=Math.ceil(Math.abs(Math.cos(r))*i+Math.abs(Math.sin(r))*a),s=Math.ceil(Math.abs(Math.sin(r))*i+Math.abs(Math.cos(r))*a);n.width=o,n.height=s;var c=n.getContext(`2d`);if(!c)throw Error(`Could not create a Convas Context element.`);return c.translate(o/2,s/2),c.rotate(r),c.drawImage(this.canvas,i/-2,a/-2),this.buffer=t.makeBufferFromCanvasImageData(n),this},t.DEGREE_TO_RADIANS=Math.PI/180,t}(dE);function BA(){return typeof navigator<`u`}function VA(){return!!(BA()&&navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices)}var HA=function(){return HA=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},HA.apply(this,arguments)},UA=function(e,t,n,r){return new(n||=Promise)((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},WA=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw TypeError(`Generator is already executing.`);for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!((i=i.length>0&&i[i.length-1])||a[0]!==6&&a[0]!==2)){o=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(a[0]===6&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},GA=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},KA={delayBetweenScanAttempts:500,delayBetweenScanSuccess:500,tryPlayVideoTimeout:5e3},qA=function(){function e(e,t,n){t===void 0&&(t=new Map),n===void 0&&(n={}),this.reader=e,this.hints=t,this.options=HA(HA({},KA),n)}return Object.defineProperty(e.prototype,"possibleFormats",{set:function(e){this.hints.set(YT.POSSIBLE_FORMATS,e)},enumerable:!1,configurable:!0}),e.addVideoSource=function(e,t){try{e.srcObject=t}catch{e.src=URL.createObjectURL(t)}},e.mediaStreamSetTorch=function(e,t){return UA(this,void 0,void 0,(function(){return WA(this,(function(n){switch(n.label){case 0:return[4,e.applyConstraints({advanced:[{fillLightMode:t?`flash`:`off`,torch:!!t}]})];case 1:return n.sent(),[2]}}))}))},e.mediaStreamIsTorchCompatible=function(t){var n,r,i=t.getVideoTracks();try{for(var a=GA(i),o=a.next();!o.done;o=a.next()){var s=o.value;if(e.mediaStreamIsTorchCompatibleTrack(s))return!0}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return!1},e.mediaStreamIsTorchCompatibleTrack=function(e){try{return`torch`in e.getCapabilities()}catch(e){return console.error(e),console.warn(`Your browser may be not fully compatible with WebRTC and/or ImageCapture specs. Torch will not be available.`),!1}},e.isVideoPlaying=function(e){return e.currentTime>0&&!e.paused&&e.readyState>2},e.getMediaElement=function(e,t){var n=document.getElementById(e);if(!n)throw new NT(`element with id '`+e+`' not found`);if(n.nodeName.toLowerCase()!==t.toLowerCase())throw new NT(`element with id '`+e+`' must be an `+t+` element`);return n},e.createVideoElement=function(t){if(t instanceof HTMLVideoElement)return t;if(typeof t==`string`)return e.getMediaElement(t,`video`);if(!t&&typeof document<`u`){var n=document.createElement(`video`);return n.width=200,n.height=200,n}throw Error(`Couldn't get videoElement from videoSource!`)},e.prepareImageElement=function(t){if(t instanceof HTMLImageElement)return t;if(typeof t==`string`)return e.getMediaElement(t,`img`);if(t===void 0){var n=document.createElement(`img`);return n.width=200,n.height=200,n}throw Error(`Couldn't get imageElement from imageSource!`)},e.prepareVideoElement=function(t){var n=e.createVideoElement(t);return n.setAttribute(`autoplay`,`true`),n.setAttribute(`muted`,`true`),n.setAttribute(`playsinline`,`true`),n},e.isImageLoaded=function(e){return!!e.complete&&e.naturalWidth!==0},e.createBinaryBitmapFromCanvas=function(e){return new FT(new uE(new zA(e)))},e.drawImageOnCanvas=function(e,t){e.drawImage(t,0,0)},e.getMediaElementDimensions=function(e){if(e instanceof HTMLVideoElement)return{height:e.videoHeight,width:e.videoWidth};if(e instanceof HTMLImageElement)return{height:e.naturalHeight||e.height,width:e.naturalWidth||e.width};throw Error(`Couldn't find the Source's dimentions!`)},e.createCaptureCanvas=function(t){if(!t)throw new NT(`Cannot create a capture canvas without a media element.`);if(typeof document>`u`)throw Error(`The page "Document" is undefined, make sure you're running in a browser.`);var n=document.createElement(`canvas`),r=e.getMediaElementDimensions(t),i=r.width,a=r.height;return n.style.width=i+`px`,n.style.height=a+`px`,n.width=i,n.height=a,n},e.tryPlayVideo=function(t){return UA(this,void 0,void 0,(function(){var n;return WA(this,(function(r){switch(r.label){case 0:if(t?.ended)return console.error(`Trying to play video that has ended.`),[2,!1];if(e.isVideoPlaying(t))return console.warn(`Trying to play video that is already playing.`),[2,!0];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,t.play()];case 2:return r.sent(),[2,!0];case 3:return n=r.sent(),console.warn(`It was not possible to play the video.`,n),[2,!1];case 4:return[2]}}))}))},e.createCanvasFromMediaElement=function(t){var n=e.createCaptureCanvas(t),r=n.getContext(`2d`);if(!r)throw Error(`Couldn't find Canvas 2D Context.`);return e.drawImageOnCanvas(r,t),n},e.createBinaryBitmapFromMediaElem=function(t){var n=e.createCanvasFromMediaElement(t);return e.createBinaryBitmapFromCanvas(n)},e.destroyImageElement=function(e){e.src=``,e.removeAttribute(`src`),e=void 0},e.listVideoInputDevices=function(){return UA(this,void 0,void 0,(function(){var e,t,n,r,i,a,o,s,c,l,u,d;return WA(this,(function(f){switch(f.label){case 0:if(!BA())throw Error(`Can't enumerate devices, navigator is not present.`);if(!VA())throw Error(`Can't enumerate devices, method not supported.`);return[4,navigator.mediaDevices.enumerateDevices()];case 1:e=f.sent(),t=[];try{for(n=GA(e),r=n.next();!r.done;r=n.next())i=r.value,(a=i.kind===`video`?`videoinput`:i.kind)===`videoinput`&&(o=i.deviceId||i.id,s=i.label||`Video device `+(t.length+1),c=i.groupId,l={deviceId:o,label:s,kind:a,groupId:c},t.push(l))}catch(e){u={error:e}}finally{try{r&&!r.done&&(d=n.return)&&d.call(n)}finally{if(u)throw u.error}}return[2,t]}}))}))},e.findDeviceById=function(t){return UA(this,void 0,void 0,(function(){var n;return WA(this,(function(r){switch(r.label){case 0:return[4,e.listVideoInputDevices()];case 1:return(n=r.sent())?[2,n.find((function(e){return e.deviceId===t}))]:[2]}}))}))},e.cleanVideoSource=function(e){if(e){try{e.srcObject=null}catch{e.src=``}e&&e.removeAttribute(`src`)}},e.playVideoOnLoadAsync=function(t,n){return UA(this,void 0,void 0,(function(){return WA(this,(function(r){switch(r.label){case 0:return[4,e.tryPlayVideo(t)];case 1:return r.sent()?[2,!0]:[2,new Promise((function(r,i){var a=setTimeout((function(){e.isVideoPlaying(t)||(i(!1),t.removeEventListener(`canplay`,o))}),n),o=function(){e.tryPlayVideo(t).then((function(e){clearTimeout(a),t.removeEventListener(`canplay`,o),r(e)}))};t.addEventListener(`canplay`,o)}))]}}))}))},e.attachStreamToVideo=function(t,n,r){return r===void 0&&(r=5e3),UA(this,void 0,void 0,(function(){var i;return WA(this,(function(a){switch(a.label){case 0:return i=e.prepareVideoElement(n),e.addVideoSource(i,t),[4,e.playVideoOnLoadAsync(i,r)];case 1:return a.sent(),[2,i]}}))}))},e._waitImageLoad=function(t){return new Promise((function(n,r){var i=setTimeout((function(){e.isImageLoaded(t)||(t.removeEventListener(`load`,a),r())}),1e4),a=function(){clearTimeout(i),t.removeEventListener(`load`,a),n()};t.addEventListener(`load`,a)}))},e.checkCallbackFnOrThrow=function(e){if(!e)throw new NT("`callbackFn` is a required parameter, you cannot capture results without it.")},e.disposeMediaStream=function(e){e.getVideoTracks().forEach((function(e){return e.stop()})),e=void 0},e.prototype.decode=function(t){var n=e.createCanvasFromMediaElement(t);return this.decodeFromCanvas(n)},e.prototype.decodeBitmap=function(e){return this.reader.decode(e,this.hints)},e.prototype.decodeFromCanvas=function(t){var n=e.createBinaryBitmapFromCanvas(t);return this.decodeBitmap(n)},e.prototype.decodeFromImageElement=function(t){return UA(this,void 0,void 0,(function(){var n;return WA(this,(function(r){switch(r.label){case 0:if(!t)throw new NT(`An image element must be provided.`);return n=e.prepareImageElement(t),[4,this._decodeOnLoadImage(n)];case 1:return[2,r.sent()]}}))}))},e.prototype.decodeFromImageUrl=function(t){return UA(this,void 0,void 0,(function(){var n;return WA(this,(function(r){switch(r.label){case 0:if(!t)throw new NT(`An URL must be provided.`);(n=e.prepareImageElement()).src=t,r.label=1;case 1:return r.trys.push([1,,3,4]),[4,this.decodeFromImageElement(n)];case 2:return[2,r.sent()];case 3:return e.destroyImageElement(n),[7];case 4:return[2]}}))}))},e.prototype.decodeFromConstraints=function(t,n,r){return UA(this,void 0,void 0,(function(){var i,a;return WA(this,(function(o){switch(o.label){case 0:return e.checkCallbackFnOrThrow(r),[4,navigator.mediaDevices.getUserMedia(t)];case 1:i=o.sent(),o.label=2;case 2:return o.trys.push([2,4,,5]),[4,this.decodeFromStream(i,n,r)];case 3:return[2,o.sent()];case 4:throw a=o.sent(),e.disposeMediaStream(i),a;case 5:return[2]}}))}))},e.prototype.decodeFromStream=function(t,n,r){return UA(this,void 0,void 0,(function(){var i,a,o,s,c,l,u,d,f,p,m=this;return WA(this,(function(h){switch(h.label){case 0:return e.checkCallbackFnOrThrow(r),i=this.options.tryPlayVideoTimeout,[4,e.attachStreamToVideo(t,n,i)];case 1:return a=h.sent(),o=function(){var e,n;try{for(var r=GA(t.getVideoTracks()),i=r.next();!i.done;i=r.next())i.value.stop()}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}t=void 0},s=function(){o(),e.cleanVideoSource(a)},c=this.scan(a,r,s),l=t.getVideoTracks(),u=HA(HA({},c),{stop:function(){c.stop()},streamVideoConstraintsApply:function(e,t){return UA(this,void 0,void 0,(function(){var n,r,i,a,o,s;return WA(this,(function(c){switch(c.label){case 0:n=t?l.filter(t):l,c.label=1;case 1:c.trys.push([1,6,7,8]),r=GA(n),i=r.next(),c.label=2;case 2:return i.done?[3,5]:[4,i.value.applyConstraints(e)];case 3:c.sent(),c.label=4;case 4:return i=r.next(),[3,2];case 5:return[3,8];case 6:return a=c.sent(),o={error:a},[3,8];case 7:try{i&&!i.done&&(s=r.return)&&s.call(r)}finally{if(o)throw o.error}return[7];case 8:return[2]}}))}))},streamVideoConstraintsGet:function(e){return l.find(e).getConstraints()},streamVideoSettingsGet:function(e){return l.find(e).getSettings()},streamVideoCapabilitiesGet:function(e){return l.find(e).getCapabilities()}}),e.mediaStreamIsTorchCompatible(t)&&(d=l?.find((function(t){return e.mediaStreamIsTorchCompatibleTrack(t)})),f=function(t){return UA(m,void 0,void 0,(function(){return WA(this,(function(n){switch(n.label){case 0:return[4,e.mediaStreamSetTorch(d,t)];case 1:return n.sent(),[2]}}))}))},u.switchTorch=f,p=function(){c.stop(),f(!1)},u.stop=p),[2,u]}}))}))},e.prototype.decodeFromVideoDevice=function(t,n,r){return UA(this,void 0,void 0,(function(){var i;return WA(this,(function(a){switch(a.label){case 0:return e.checkCallbackFnOrThrow(r),i={video:t?{deviceId:{exact:t}}:{facingMode:`environment`}},[4,this.decodeFromConstraints(i,n,r)];case 1:return[2,a.sent()]}}))}))},e.prototype.decodeFromVideoElement=function(t,n){return UA(this,void 0,void 0,(function(){var r,i;return WA(this,(function(a){switch(a.label){case 0:if(e.checkCallbackFnOrThrow(n),!t)throw new NT(`A video element must be provided.`);return r=e.prepareVideoElement(t),i=this.options.tryPlayVideoTimeout,[4,e.playVideoOnLoadAsync(r,i)];case 1:return a.sent(),[2,this.scan(r,n)]}}))}))},e.prototype.decodeFromVideoUrl=function(t,n){return UA(this,void 0,void 0,(function(){var r,i,a;return WA(this,(function(o){switch(o.label){case 0:if(e.checkCallbackFnOrThrow(n),!t)throw new NT(`An URL must be provided.`);return(r=e.prepareVideoElement()).src=t,i=function(){e.cleanVideoSource(r)},a=this.options.tryPlayVideoTimeout,[4,e.playVideoOnLoadAsync(r,a)];case 1:return o.sent(),[2,this.scan(r,n,i)]}}))}))},e.prototype.decodeOnceFromConstraints=function(e,t){return UA(this,void 0,void 0,(function(){var n;return WA(this,(function(r){switch(r.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return n=r.sent(),[4,this.decodeOnceFromStream(n,t)];case 2:return[2,r.sent()]}}))}))},e.prototype.decodeOnceFromStream=function(t,n){return UA(this,void 0,void 0,(function(){var r,i;return WA(this,(function(a){switch(a.label){case 0:return r=!!n,[4,e.attachStreamToVideo(t,n)];case 1:i=a.sent(),a.label=2;case 2:return a.trys.push([2,,4,5]),[4,this.scanOneResult(i)];case 3:return[2,a.sent()];case 4:return r||e.cleanVideoSource(i),[7];case 5:return[2]}}))}))},e.prototype.decodeOnceFromVideoDevice=function(e,t){return UA(this,void 0,void 0,(function(){var n;return WA(this,(function(r){switch(r.label){case 0:return n={video:e?{deviceId:{exact:e}}:{facingMode:`environment`}},[4,this.decodeOnceFromConstraints(n,t)];case 1:return[2,r.sent()]}}))}))},e.prototype.decodeOnceFromVideoElement=function(t){return UA(this,void 0,void 0,(function(){var n,r;return WA(this,(function(i){switch(i.label){case 0:if(!t)throw new NT(`A video element must be provided.`);return n=e.prepareVideoElement(t),r=this.options.tryPlayVideoTimeout,[4,e.playVideoOnLoadAsync(n,r)];case 1:return i.sent(),[4,this.scanOneResult(n)];case 2:return[2,i.sent()]}}))}))},e.prototype.decodeOnceFromVideoUrl=function(t){return UA(this,void 0,void 0,(function(){var n,r;return WA(this,(function(i){switch(i.label){case 0:if(!t)throw new NT(`An URL must be provided.`);(n=e.prepareVideoElement()).src=t,r=this.decodeOnceFromVideoElement(n),i.label=1;case 1:return i.trys.push([1,,3,4]),[4,r];case 2:return[2,i.sent()];case 3:return e.cleanVideoSource(n),[7];case 4:return[2]}}))}))},e.prototype.scanOneResult=function(e,t,n,r){var i=this;return t===void 0&&(t=!0),n===void 0&&(n=!0),r===void 0&&(r=!0),new Promise((function(a,o){i.scan(e,(function(e,i,s){if(e)return a(e),void s.stop();if(i){if(i instanceof Y&&t||i instanceof LT&&n||i instanceof J&&r)return;s.stop(),o(i)}}))}))},e.prototype.scan=function(t,n,r){var i=this;e.checkCallbackFnOrThrow(n);var a=e.createCaptureCanvas(t),o=a.getContext(`2d`);if(!o)throw Error(`Couldn't create canvas for visual element scan.`);var s,c=function(){o=void 0,a=void 0},l=!1,u={stop:function(){l=!0,clearTimeout(s),c(),r&&r()}},d=function(){if(!l)try{e.drawImageOnCanvas(o,t),n(i.decodeFromCanvas(a),void 0,u),s=setTimeout(d,i.options.delayBetweenScanSuccess)}catch(e){if(n(void 0,e,u),e instanceof LT||e instanceof J||e instanceof Y)return void(s=setTimeout(d,i.options.delayBetweenScanAttempts));c(),r&&r(e)}};return d(),u},e.prototype._decodeOnLoadImage=function(t){return UA(this,void 0,void 0,(function(){return WA(this,(function(n){switch(n.label){case 0:return e.isImageLoaded(t)?[3,2]:[4,e._waitImageLoad(t)];case 1:n.sent(),n.label=2;case 2:return[2,this.decode(t)]}}))}))},e}(),JA=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(t,n){return e.call(this,new ZE,t,n)||this}JA(t,e)})(qA);var YA=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(t,n){return e.call(this,new OO(t),t,n)||this}YA(t,e)})(qA);var XA=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(t,n){return e.call(this,new WO,t,n)||this}XA(t,e)})(qA);var ZA=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(t,n){var r=this,i=new mA;return i.setHints(t),(r=e.call(this,i,t,n)||this).reader=i,r}ZA(t,e),Object.defineProperty(t.prototype,"possibleFormats",{set:function(e){this.hints.set(YT.POSSIBLE_FORMATS,e),this.reader.setHints(this.hints)},enumerable:!1,configurable:!0}),t.prototype.decodeBitmap=function(e){return this.reader.decodeWithState(e)},t.prototype.setHints=function(e){this.hints=e,this.reader.setHints(this.hints)}})(qA);var QA=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(e){function t(t,n){return e.call(this,new uA,t,n)||this}QA(t,e)})(qA);var $A=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ej=function(e){function t(t,n){return e.call(this,new xk,t,n)||this}return $A(t,e),t}(qA),tj=function(e,t,n){var r=typeof e===n;return r||console.warn(`[ReactQrReader]: Expected "${t}" to be a of type "${n}".`),r},nj=function(e){var n=e.scanDelay,r=e.constraints,i=e.onResult,a=e.videoId,o=(0,t.useRef)(null);(0,t.useEffect)((function(){var e=new ej(null,{delayBetweenScanAttempts:n});return!function(){var e=typeof navigator<`u`&&!!navigator.mediaDevices;return e||console.warn(`[ReactQrReader]: MediaDevices API has no support for your browser. You can fix this by running "npm i webrtc-adapter"`),e}()&&tj(i,`onResult`,`function`)&&i(null,Error(`MediaDevices API has no support for your browser. You can fix this by running "npm i webrtc-adapter"`),e),tj(r,`constraints`,`object`)&&e.decodeFromConstraints({video:r},a,(function(t,n){tj(i,`onResult`,`function`)&&i(t,n,e)})).then((function(e){return o.current=e})).catch((function(t){tj(i,`onResult`,`function`)&&i(null,t,e)})),function(){var e;(e=o.current)==null||e.stop()}}),[])},rj=function(){return rj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},rj.apply(this,arguments)},ij={container:{width:`100%`,paddingTop:`100%`,overflow:`hidden`,position:`relative`},video:{top:0,left:0,width:`100%`,height:`100%`,display:`block`,overflow:`hidden`,position:`absolute`,transform:void 0}},aj=function(e){var n=e.videoContainerStyle,r=e.containerStyle,i=e.videoStyle,a=e.constraints,o=e.ViewFinder,s=e.scanDelay,c=e.className,l=e.onResult,u=e.videoId;return nj({constraints:a,scanDelay:s,onResult:l,videoId:u}),t.createElement(`section`,{className:c,style:r},t.createElement(`div`,{style:rj(rj({},ij.container),n)},!!o&&t.createElement(o,null),t.createElement(`video`,{muted:!0,id:u,style:rj(rj(rj({},ij.video),i),{transform:a?.facingMode===`user`&&`scaleX(-1)`})})))};aj.displayName=`QrReader`,aj.defaultProps={constraints:{facingMode:`user`},videoId:`video`,scanDelay:500};function oj({onScan:e}){let{t}=U(),{cameraFacingMode:r}=wo(),[i,a]=(0,h.useState)(r??b.USER),[o,s]=(0,h.useState)(!(wT.isMobile&&!wT.isTablet));return o?(0,n.jsxs)(`div`,{className:`relative w-full`,children:[(0,n.jsx)(aj,{onResult:t=>{t&&e(t.getText())},constraints:{facingMode:i},videoStyle:{maxHeight:`calc(100vh-381px)`,minHeight:267,borderRadius:`0.25rem`,objectFit:`cover`},videoContainerStyle:{maxHeight:`calc(100vh-381px)`,minHeight:267,borderRadius:`0.25rem`}}),(0,n.jsx)(`div`,{className:`absolute top-2 right-2 flex h-10 w-10 cursor-pointer items-center justify-center rounded-sm bg-white shadow-overlay`,onClick:()=>i===b.USER?a(b.ENVIRONMENT):a(b.USER),children:(0,n.jsx)(`img`,{src:vT,alt:`camera-switch`})})]}):(0,n.jsx)(`div`,{className:`flex max-h-[calc(100vh-381px)] min-h-[267px] items-center justify-center`,children:(0,n.jsx)(Mx,{disabled:o,onClick:()=>s(!0),children:t(`enableCamera`)})})}function sj({onScan:e}){let{t}=U(),{cameraFacingMode:r}=wo(),[i,a]=(0,h.useState)(r),o=(0,h.useRef)(null),s=(0,h.useRef)(null),[c,l]=(0,h.useState)(!1),u=t=>{e(t?.data)},d=e=>{};return(0,h.useEffect)(()=>()=>{s?.current||o?.current?.stop()}),(0,n.jsxs)(`div`,{className:`relative`,children:[(0,n.jsx)(`video`,{className:`max-h-[calc(100vh-381px)] min-h-[370px] rounded-sm object-cover`,ref:s,autoPlay:!0,muted:!0,playsInline:!0}),c?(0,n.jsx)(`div`,{className:`absolute top-2 right-2 flex h-10 w-10 cursor-pointer items-center justify-center rounded-sm bg-white shadow-overlay`,onClick:()=>{let e=i===b.USER?b.ENVIRONMENT:b.USER;a(e),o?.current?.setCamera(e)},children:(0,n.jsx)(`img`,{src:vT,alt:`camera-switch`})}):(0,n.jsx)(`div`,{className:`absolute top-1/2 right-1/2 left-1/2 flex items-center justify-center`,children:(0,n.jsx)(Mx,{disabled:c,onClick:()=>{s?.current&&!o.current&&(o.current=new ST(s?.current,u,{onDecodeError:d,preferredCamera:i}),o?.current?.start().then(()=>l(!0)).catch(e=>{e&&l(!1)}))},children:t(`enableCamera`)})})]})}var cj=[[`All`,`*`,`*`,` `,0,`All`],[`AllReadable`,`*`,`r`,` `,0,`All Readable`],[`AllCreatable`,`*`,`w`,` `,0,`All Creatable`],[`AllLinear`,`*`,`l`,` `,0,`All Linear`],[`AllMatrix`,`*`,`m`,` `,0,`All Matrix`],[`AllGS1`,`*`,`G`,` `,0,`All GS1`],[`AllRetail`,`*`,`R`,` `,0,`All Retail`],[`AllIndustrial`,`*`,`I`,` `,0,`All Industrial`],[`Codabar`,`F`,` `,`lrw `,18,`Codabar`],[`Code39`,`A`,` `,`lrw I`,8,`Code 39`],[`Code39Std`,`A`,`s`,`lrw I`,8,`Code 39 Standard`],[`Code39Ext`,`A`,`e`,`lr I`,9,`Code 39 Extended`],[`Code32`,`A`,`2`,`lr I`,129,`Code 32`],[`PZN`,`A`,`p`,`lr I`,52,`Pharmazentralnummer`],[`Code93`,`G`,` `,`lrw I`,25,`Code 93`],[`Code128`,`C`,` `,`lrwGI`,20,`Code 128`],[`ITF`,`I`,` `,`lrw I`,3,`ITF`],[`ITF14`,`I`,`4`,`lr I`,89,`ITF-14`],[`DataBar`,`e`,` `,`lr GR`,29,`DataBar`],[`DataBarOmni`,`e`,`o`,`lr GR`,29,`DataBar Omni`],[`DataBarStk`,`e`,`s`,`lr GR`,79,`DataBar Stacked`],[`DataBarStkOmni`,`e`,`O`,`lr GR`,80,`DataBar Stacked Omni`],[`DataBarLtd`,`e`,`l`,`lr GR`,30,`DataBar Limited`],[`DataBarExp`,`e`,`e`,`lr GR`,31,`DataBar Expanded`],[`DataBarExpStk`,`e`,`E`,`lr GR`,81,`DataBar Expanded Stacked`],[`EANUPC`,`E`,` `,`lr R`,15,`EAN/UPC`],[`EAN13`,`E`,`1`,`lrw R`,15,`EAN-13`],[`EAN8`,`E`,`8`,`lrw R`,10,`EAN-8`],[`EAN5`,`E`,`5`,`l R`,12,`EAN-5`],[`EAN2`,`E`,`2`,`l R`,11,`EAN-2`],[`ISBN`,`E`,`i`,`lr R`,69,`ISBN`],[`UPCA`,`E`,`a`,`lrw R`,34,`UPC-A`],[`UPCE`,`E`,`e`,`lrw R`,37,`UPC-E`],[`OtherBarcode`,`X`,` `,` r `,0,`Other barcode`],[`DXFilmEdge`,`X`,`x`,`lr `,147,`DX Film Edge`],[`PDF417`,`L`,` `,`mrw `,55,`PDF417`],[`CompactPDF417`,`L`,`c`,`mr `,56,`Compact PDF417`],[`MicroPDF417`,`L`,`m`,`m `,84,`MicroPDF417`],[`Aztec`,`z`,` `,`mr G `,92,`Aztec`],[`AztecCode`,`z`,`c`,`mrwG `,92,`Aztec Code`],[`AztecRune`,`z`,`r`,`mr `,128,`Aztec Rune`],[`QRCode`,`Q`,` `,`mrwG `,58,`QR Code`],[`QRCodeModel1`,`Q`,`1`,`mr `,0,`QR Code Model 1`],[`QRCodeModel2`,`Q`,`2`,`mr `,58,`QR Code Model 2`],[`MicroQRCode`,`Q`,`m`,`mr `,97,`Micro QR Code`],[`RMQRCode`,`Q`,`r`,`mr G `,145,`rMQR Code`],[`DataMatrix`,`d`,` `,`mrwG `,71,`Data Matrix`],[`MaxiCode`,`U`,` `,`mr `,57,`MaxiCode`]],lj={DataBarExpanded:`DataBarExp`,DataBarLimited:`DataBarLtd`,"Linear-Codes":`AllLinear`,"Matrix-Codes":`AllMatrix`,Any:`All`,rMQRCode:`RMQRCode`};cj.map(e=>e[5]),cj.filter(e=>e[1]===`*`).map(e=>e[0]),cj.filter(e=>e[1]!==`*`).map(e=>e[0]),cj.filter(e=>e[2]===` `).map(e=>e[0]),cj.filter(e=>e[3][0]===`l`).map(e=>e[0]),cj.filter(e=>e[3][0]===`m`).map(e=>e[0]),cj.filter(e=>e[3][1]===`r`).map(e=>e[0]),cj.filter(e=>e[3][2]===`w`||e[4]!==0).map(e=>e[0]),cj.filter(e=>e[3][3]===`G`).map(e=>e[0]),cj.filter(e=>e[3][4]===`R`).map(e=>e[0]),cj.filter(e=>e[3][4]===`I`).map(e=>e[0]);function uj(e){return lj[e]??e}function dj(e){return e.map(uj).join(`,`)}var fj=[`LocalAverage`,`GlobalHistogram`,`FixedThreshold`,`BoolCast`];function pj(e){return fj.indexOf(e)}var mj=`Unknown.ASCII.ISO8859_1.ISO8859_2.ISO8859_3.ISO8859_4.ISO8859_5.ISO8859_6.ISO8859_7.ISO8859_8.ISO8859_9.ISO8859_10.ISO8859_11.ISO8859_13.ISO8859_14.ISO8859_15.ISO8859_16.Cp437.Cp1250.Cp1251.Cp1252.Cp1256.Shift_JIS.Big5.GB2312.GB18030.EUC_JP.EUC_KR.UTF16BE.UTF8.UTF16LE.UTF32BE.UTF32LE.BINARY`.split(`.`);function hj(e){return e===`UnicodeBig`?mj.indexOf(`UTF16BE`):mj.indexOf(e)}var gj=[`Text`,`Binary`,`Mixed`,`GS1`,`ISO15434`,`UnknownECI`];function _j(e){return gj[e]}var vj=[`Ignore`,`Read`,`Require`];function yj(e){return vj.indexOf(e)}var bj=[`Plain`,`ECI`,`HRI`,`Escaped`,`Hex`,`HexECI`];function xj(e){return bj.indexOf(e)}var Sj={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,tryDenoise:!1,binarizer:`LocalAverage`,isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,validateOptionalChecksum:!1,returnErrors:!1,eanAddOnSymbol:`Ignore`,textMode:`HRI`,characterSet:`Unknown`,tryCode39ExtendedMode:!0};function Cj(e){return{...e,formats:dj(e.formats),binarizer:pj(e.binarizer),eanAddOnSymbol:yj(e.eanAddOnSymbol),textMode:xj(e.textMode),characterSet:hj(e.characterSet),tryCode39ExtendedMode:e.tryCode39ExtendedMode??!0}}function wj(e){return{...e,format:e.format,symbology:e.symbology,contentType:_j(e.contentType)}}var Tj={format:`QRCode`,readerInit:!1,forceSquareDataMatrix:!1,ecLevel:``,scale:1,sizeHint:0,rotate:0,invert:!1,withHRT:!1,withQuietZones:!0,addHRT:!1,addQuietZones:!0,options:``},Ej={locateFile:(e,t)=>{let n=e.match(/_(.+?)\.wasm$/);return n?`https://fastly.jsdelivr.net/npm/zxing-wasm@3.0.3/dist/${n[1]}/${e}`:t+e}},Dj=new WeakMap;function Oj(e,t){return Object.is(e,t)||Object.keys(e).length===Object.keys(t).length&&Object.keys(e).every(n=>Object.hasOwn(t,n)&&e[n]===t[n])}function kj(e,{overrides:t,equalityFn:n=Oj,fireImmediately:r=!1}={}){let[i,a]=Dj.get(e)??[Ej],o=t??i,s;if(r){if(a&&(s=n(i,o)))return a;let t=e({...o});return Dj.set(e,[o,t]),t}(s??n(i,o))||Dj.set(e,[o])}function Aj(e){let t=e.byteLength>>2,n=new Uint8Array(t);for(let r=0;r<t;r++){let t=r<<2;n[r]=306*e[t]+601*e[t+1]+117*e[t+2]+512>>10}return n}async function jj(e,t,n=Sj){let r={...Sj,...n},i=await kj(e,{fireImmediately:!0}),a,o;if(`width`in t&&`height`in t&&`data`in t){let{data:e,width:n,height:s}=t,c=Aj(e),l=c.byteLength;if(o=i._malloc(l),!o)throw Error(`Failed to allocate ${l} bytes in WASM memory`);try{i.HEAPU8.set(c,o),a=i.readBarcodesFromPixmap(o,n,s,Cj(r))}finally{i._free(o)}}else{let e,n;if(`buffer`in t)[e,n]=[t.byteLength,t];else if(`byteLength`in t)[e,n]=[t.byteLength,new Uint8Array(t)];else if(`size`in t)[e,n]=[t.size,new Uint8Array(await t.arrayBuffer())];else throw TypeError(`Invalid input type`);if(o=i._malloc(e),!o)throw Error(`Failed to allocate ${e} bytes in WASM memory`);try{i.HEAPU8.set(n,o),a=i.readBarcodesFromImage(o,e,Cj(r))}finally{i._free(o)}}let s=[];for(let e=0;e<a.size();++e)s.push(wj(a.get(e)));return s}({...Sj}),[...Sj.formats],{...Tj};async function Mj(e={}){var t,n,r,i=e,a=!!globalThis.window,o=typeof Bun<`u`,s=!!globalThis.WorkerGlobalScope;!((n=globalThis.process)==null||(n=n.versions)==null)&&n.node&&((r=globalThis.process)==null||r.type);var c=`./this.program`,l,u=``;function d(e){return i.locateFile?i.locateFile(e,u):u+e}var f,p;if(a||s||o){try{u=new URL(`.`,l).href}catch{}s&&(p=e=>{var t=new XMLHttpRequest;return t.open(`GET`,e,!1),t.responseType=`arraybuffer`,t.send(null),new Uint8Array(t.response)}),f=async e=>{var t=await fetch(e,{credentials:`same-origin`});if(t.ok)return t.arrayBuffer();throw Error(t.status+` : `+t.url)}}var m=console.log.bind(console),h=console.error.bind(console),g,_=!1,v,y,b=!1;function x(){var e=cr.buffer;te=new Int8Array(e),ee=new Int16Array(e),i.HEAPU8=ae=new Uint8Array(e),ie=new Uint16Array(e),P=new Int32Array(e),F=new Uint32Array(e),ne=new Float32Array(e),re=new Float64Array(e)}function S(){if(i.preRun)for(typeof i.preRun==`function`&&(i.preRun=[i.preRun]);i.preRun.length;)ue(i.preRun.shift());oe(le)}function C(){b=!0,Zr.Ba()}function w(){if(i.postRun)for(typeof i.postRun==`function`&&(i.postRun=[i.postRun]);i.postRun.length;)ce(i.postRun.shift());oe(se)}function T(e){var t,n;(t=i.onAbort)==null||t.call(i,e),e=`Aborted(`+e+`)`,h(e),_=!0,e+=`. Build with -sASSERTIONS for more info.`;var r=new WebAssembly.RuntimeError(e);throw(n=y)==null||n(r),r}var E;function D(){return d(`zxing_reader.wasm`)}function O(e){if(e==E&&g)return new Uint8Array(g);if(p)return p(e);throw`both async and sync fetching of the wasm failed`}async function k(e){if(!g)try{var t=await f(e);return new Uint8Array(t)}catch{}return O(e)}async function A(e,t){try{var n=await k(e);return await WebAssembly.instantiate(n,t)}catch(e){h(`failed to asynchronously prepare wasm: ${e}`),T(e)}}async function j(e,t,n){if(!e&&WebAssembly.instantiateStreaming)try{var r=fetch(t,{credentials:`same-origin`});return await WebAssembly.instantiateStreaming(r,n)}catch(e){h(`wasm streaming compile failed: ${e}`),h(`falling back to ArrayBuffer instantiation`)}return A(t,n)}function M(){return{a:dr}}async function N(){function e(e,t){return Zr=e.exports,ur(Zr),x(),Zr}function t(t){return e(t.instance)}var n=M();return i.instantiateWasm?new Promise((t,r)=>{i.instantiateWasm(n,(n,r)=>{t(e(n,r))})}):(E??=D(),t(await j(g,E,n)))}var ee,P,te,ne,re,ie,F,ae,oe=e=>{for(;e.length>0;)e.shift()(i)},se=[],ce=e=>se.push(e),le=[],ue=e=>le.push(e),I=e=>er(e),L=()=>tr(),de=[],fe=0,pe=e=>{var t=new ge(e);return t.get_caught()||(t.set_caught(!0),fe--),t.set_rethrown(!1),de.push(t),Qn(e)},me=0,he=()=>{V(0,0);var e=de.pop();nr(e.excPtr),me=0};class ge{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){F[this.ptr+4>>2]=e}get_type(){return F[this.ptr+4>>2]}set_destructor(e){F[this.ptr+8>>2]=e}get_destructor(){return F[this.ptr+8>>2]}set_caught(e){e=+!!e,te[this.ptr+12]=e}get_caught(){return te[this.ptr+12]!=0}set_rethrown(e){e=+!!e,te[this.ptr+13]=e}get_rethrown(){return te[this.ptr+13]!=0}init(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)}set_adjusted_ptr(e){F[this.ptr+16>>2]=e}get_adjusted_ptr(){return F[this.ptr+16>>2]}}var _e=e=>$n(e),ve=e=>{var t=me;if(!t)return _e(0),0;var n=new ge(t);n.set_adjusted_ptr(t);var r=n.get_type();if(!r)return _e(0),t;for(var i of e){if(i===0||i===r)break;var a=n.ptr+16;if(ir(i,r,a))return _e(i),t}return _e(r),t},ye=()=>ve([]),be=e=>ve([e]),xe=(e,t)=>ve([e,t]),Se=()=>{var e=de.pop();e||T(`no exception to throw`);var t=e.excPtr;throw e.get_rethrown()||(de.push(e),e.set_rethrown(!0),e.set_caught(!1),fe++),rr(t),me=t,me},Ce=(e,t,n)=>{throw new ge(e).init(t,n),rr(e),me=e,fe++,me},we=()=>fe,Te=e=>{throw me||=e,me},Ee=()=>T(``),De={},Oe=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function ke(e){return this.fromWireType(F[e>>2])}var Ae={},je={},Me={},Ne=class extends Error{constructor(e){super(e),this.name=`InternalError`}},Pe=e=>{throw new Ne(e)},Fe=(e,t,n)=>{e.forEach(e=>Me[e]=t);function r(t){var r=n(t);r.length!==e.length&&Pe(`Mismatched type converter count`);for(var i=0;i<e.length;++i)He(e[i],r[i])}var i=Array(t.length),a=[],o=0;{let e=t;for(let t=0;t<e.length;++t){let n=e[t];je.hasOwnProperty(n)?i[t]=je[n]:(a.push(n),Ae.hasOwnProperty(n)||(Ae[n]=[]),Ae[n].push(()=>{i[t]=je[n],++o,o===a.length&&r(i)}))}}a.length===0&&r(i)},Ie=e=>{var t=De[e];delete De[e];var n=t.rawConstructor,r=t.rawDestructor,i=t.fields,a=i.map(e=>e.getterReturnType).concat(i.map(e=>e.setterArgumentType));Fe([e],a,e=>{var a={};{let t=i;for(let n=0;n<t.length;++n){let r=t[n],o=e[n],s=r.getter,c=r.getterContext,l=e[n+i.length],u=r.setter,d=r.setterContext;a[r.fieldName]={read:e=>o.fromWireType(s(c,e)),write:(e,t)=>{var n=[];u(d,e,l.toWireType(n,t)),Oe(n)},optional:o.optional}}}return[{name:t.name,fromWireType:e=>{var t={};for(var n in a)t[n]=a[n].read(e);return r(e),t},toWireType:(e,t)=>{for(var i in a)if(!(i in t)&&!a[i].optional)throw TypeError(`Missing field: "${i}"`);var o=n();for(i in a)a[i].write(o,t[i]);return e!==null&&e.push(r,o),o},readValueFromPointer:ke,destructorFunction:r}]})},Le=(e,t,n,r,i)=>{},Re=e=>{for(var t=``;;){var n=ae[e++];if(!n)return t;t+=String.fromCharCode(n)}},ze=class extends Error{constructor(e){super(e),this.name=`BindingError`}},Be=e=>{throw new ze(e)};function Ve(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=t.name;if(e||Be(`type "${r}" must have a positive integer typeid pointer`),je.hasOwnProperty(e)){if(n.ignoreDuplicateRegistrations)return;Be(`Cannot register type '${r}' twice`)}if(je[e]=t,delete Me[e],Ae.hasOwnProperty(e)){var i=Ae[e];delete Ae[e],i.forEach(e=>e())}}function He(e,t){return Ve(e,t,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{})}var Ue=(e,t,n,r)=>{t=Re(t),He(e,{name:t,fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:r},readValueFromPointer:function(e){return this.fromWireType(ae[e])},destructorFunction:null})},We=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),Ge=e=>{function t(e){return e.$$.ptrType.registeredClass.name}Be(t(e)+` instance already deleted`)},Ke=!1,qe=e=>{},R=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},Je=e=>{--e.count.value,e.count.value===0&&R(e)},Ye=e=>globalThis.FinalizationRegistry?(Ke=new FinalizationRegistry(e=>{Je(e.$$)}),Ye=e=>{var t=e.$$;if(t.smartPtr){var n={$$:t};Ke.register(e,n,e)}return e},qe=e=>Ke.unregister(e),Ye(e)):(Ye=e=>e,e),Xe=[],Ze=()=>{for(;Xe.length;){var e=Xe.pop();e.$$.deleteScheduled=!1,e.delete()}},Qe,$e=()=>{let e=et.prototype;Object.assign(e,{isAliasOf(e){if(!(this instanceof et)||!(e instanceof et))return!1;var t=this.$$.ptrType.registeredClass,n=this.$$.ptr;e.$$=e.$$;for(var r=e.$$.ptrType.registeredClass,i=e.$$.ptr;t.baseClass;)n=t.upcast(n),t=t.baseClass;for(;r.baseClass;)i=r.upcast(i),r=r.baseClass;return t===r&&n===i},clone(){if(this.$$.ptr||Ge(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=Ye(Object.create(Object.getPrototypeOf(this),{$$:{value:We(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||Ge(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Be(`Object already scheduled for deletion`),qe(this),Je(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Ge(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Be(`Object already scheduled for deletion`),Xe.push(this),Xe.length===1&&Qe&&Qe(Ze),this.$$.deleteScheduled=!0,this}});let t=Symbol.dispose;t&&(e[t]=e.delete)};function et(){}var tt=(e,t)=>Object.defineProperty(t,"name",{value:e}),nt={},rt=(e,t,n)=>{if(e[t].overloadTable===void 0){var r=e[t];e[t]=function(){var r=[...arguments];return e[t].overloadTable.hasOwnProperty(r.length)||Be(`Function '${n}' called with an invalid number of arguments (${r.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[r.length].apply(this,r)},e[t].overloadTable=[],e[t].overloadTable[r.argCount]=r}},it=(e,t,n)=>{i.hasOwnProperty(e)?((n===void 0||i[e].overloadTable!==void 0&&i[e].overloadTable[n]!==void 0)&&Be(`Cannot register public name '${e}' twice`),rt(i,e,e),i[e].overloadTable.hasOwnProperty(n)&&Be(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`),i[e].overloadTable[n]=t):(i[e]=t,i[e].argCount=n)},at=48,ot=57,st=e=>{e=e.replace(/[^a-zA-Z0-9_]/g,`$`);var t=e.charCodeAt(0);return t>=at&&t<=ot?`_${e}`:e};function ct(e,t,n,r,i,a,o,s){this.name=e,this.constructor=t,this.instancePrototype=n,this.rawDestructor=r,this.baseClass=i,this.getActualType=a,this.upcast=o,this.downcast=s,this.pureVirtualFunctions=[]}var lt=(e,t,n)=>{for(;t!==n;)t.upcast||Be(`Expected null or instance of ${n.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e},ut=e=>{if(e===null)return`null`;var t=typeof e;return t===`object`||t===`array`||t===`function`?e.toString():``+e};function dt(e,t){if(t===null)return this.isReference&&Be(`null is not a valid ${this.name}`),0;t.$$||Be(`Cannot pass "${ut(t)}" as a ${this.name}`),t.$$.ptr||Be(`Cannot pass deleted object as a pointer of type ${this.name}`);var n=t.$$.ptrType.registeredClass;return lt(t.$$.ptr,n,this.registeredClass)}function ft(e,t){var n;if(t===null)return this.isReference&&Be(`null is not a valid ${this.name}`),this.isSmartPointer?(n=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,n),n):0;(!t||!t.$$)&&Be(`Cannot pass "${ut(t)}" as a ${this.name}`),t.$$.ptr||Be(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&Be(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;if(n=lt(t.$$.ptr,r,this.registeredClass),this.isSmartPointer)switch(t.$$.smartPtr===void 0&&Be(`Passing raw pointer to smart pointer is illegal`),this.sharingPolicy){case 0:t.$$.smartPtrType===this?n=t.$$.smartPtr:Be(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:n=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)n=t.$$.smartPtr;else{var i=t.clone();n=this.rawShare(n,Vt.toHandle(()=>i.delete())),e!==null&&e.push(this.rawDestructor,n)}break;default:Be(`Unsupported sharing policy`)}return n}function pt(e,t){if(t===null)return this.isReference&&Be(`null is not a valid ${this.name}`),0;t.$$||Be(`Cannot pass "${ut(t)}" as a ${this.name}`),t.$$.ptr||Be(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&Be(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;return lt(t.$$.ptr,n,this.registeredClass)}var mt=(e,t,n)=>{if(t===n)return e;if(n.baseClass===void 0)return null;var r=mt(e,t,n.baseClass);return r===null?null:n.downcast(r)},z={},ht=(e,t)=>{for(t===void 0&&Be(`ptr should not be undefined`);e.baseClass;)t=e.upcast(t),e=e.baseClass;return t},gt=(e,t)=>(t=ht(e,t),z[t]),_t=(e,t)=>((!t.ptrType||!t.ptr)&&Pe(`makeClassHandle requires ptr and ptrType`),!!t.smartPtrType!=!!t.smartPtr&&Pe(`Both smartPtrType and smartPtr must be specified`),t.count={value:1},Ye(Object.create(e,{$$:{value:t,writable:!0}})));function vt(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var n=gt(this.registeredClass,t);if(n!==void 0){if(n.$$.count.value===0)return n.$$.ptr=t,n.$$.smartPtr=e,n.clone();var r=n.clone();return this.destructor(e),r}function i(){return this.isSmartPointer?_t(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):_t(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a=nt[this.registeredClass.getActualType(t)];if(!a)return i.call(this);var o=this.isConst?a.constPointerType:a.pointerType,s=mt(t,this.registeredClass,o.registeredClass);return s===null?i.call(this):this.isSmartPointer?_t(o.registeredClass.instancePrototype,{ptrType:o,ptr:s,smartPtrType:this,smartPtr:e}):_t(o.registeredClass.instancePrototype,{ptrType:o,ptr:s})}var yt=()=>{Object.assign(bt.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){var t;(t=this.rawDestructor)==null||t.call(this,e)},readValueFromPointer:ke,fromWireType:vt})};function bt(e,t,n,r,i,a,o,s,c,l,u){this.name=e,this.registeredClass=t,this.isReference=n,this.isConst=r,this.isSmartPointer=i,this.pointeeType=a,this.sharingPolicy=o,this.rawGetPointee=s,this.rawConstructor=c,this.rawShare=l,this.rawDestructor=u,!i&&t.baseClass===void 0?r?(this.toWireType=dt,this.destructorFunction=null):(this.toWireType=pt,this.destructorFunction=null):this.toWireType=ft}var xt=(e,t,n)=>{i.hasOwnProperty(e)||Pe(`Replacing nonexistent public symbol`),i[e].overloadTable!==void 0&&n!==void 0?i[e].overloadTable[n]=t:(i[e]=t,i[e].argCount=n)},St={},Ct=(e,t,n)=>{e=e.replace(/p/g,`i`);var r=St[e];return r(t,...n)},wt=[],B=e=>{var t=wt[e];return t||(wt[e]=t=lr.get(e)),t},Tt=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(arguments.length>3&&arguments[3]!==void 0&&arguments[3],e.includes(`j`))return Ct(e,t,n);var r=B(t)(...n);function i(e){return e}return i(r)},Et=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return function(){return Tt(e,t,[...arguments],n)}},Dt=function(e,t){arguments.length>2&&arguments[2]!==void 0&&arguments[2],e=Re(e);function n(){return e.includes(`j`)?Et(e,t):B(t)}var r=n();return typeof r!=`function`&&Be(`unknown function pointer with signature ${e}: ${t}`),r};class Ot extends Error{}var kt=e=>{var t=Yn(e),n=Re(t);return Xn(t),n},At=(e,t)=>{var n=[],r={};function i(e){if(!r[e]&&!je[e]){if(Me[e]){Me[e].forEach(i);return}n.push(e),r[e]=!0}}throw t.forEach(i),new Ot(`${e}: `+n.map(kt).join([`, `]))},jt=(e,t,n,r,i,a,o,s,c,l,u,d,f)=>{u=Re(u),a=Dt(i,a),s&&=Dt(o,s),l&&=Dt(c,l),f=Dt(d,f);var p=st(u);it(p,function(){At(`Cannot construct ${u} due to unbound types`,[r])}),Fe([e,t,n],r?[r]:[],t=>{t=t[0];var n,i;r?(n=t.registeredClass,i=n.instancePrototype):i=et.prototype;var o=tt(u,function(){if(Object.getPrototypeOf(this)!==c)throw new ze(`Use 'new' to construct ${u}`);if(d.constructor_body===void 0)throw new ze(`${u} has no accessible constructor`);var e=[...arguments],t=d.constructor_body[e.length];if(t===void 0)throw new ze(`Tried to invoke ctor of ${u} with invalid number of parameters (${e.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return t.apply(this,e)}),c=Object.create(i,{constructor:{value:o}});o.prototype=c;var d=new ct(u,o,c,f,n,a,s,l);if(d.baseClass){var m;(m=d.baseClass).__derivedClasses??(m.__derivedClasses=[]),d.baseClass.__derivedClasses.push(d)}var h=new bt(u,d,!0,!1,!1),g=new bt(u+`*`,d,!1,!1,!1),_=new bt(u+` const*`,d,!1,!0,!1);return nt[e]={pointerType:g,constPointerType:_},xt(p,o),[h,g,_]})},Mt=(e,t)=>{for(var n=[],r=0;r<e;r++)n.push(F[t+r*4>>2]);return n};function Nt(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].destructorFunction===void 0)return!0;return!1}function Pt(e,t,n,r,i,a){var o=t.length;o<2&&Be(`argTypes array size mismatch! Must at least get return value and 'this' types!`);var s=t[1]!==null&&n!==null,c=Nt(t),l=!t[0].isVoid,u=o-2,d=Array(u),f=[],p=[];return tt(e,function(){p.length=0;var e;f.length=s?2:1,f[0]=i,s&&(e=t[1].toWireType(p,this),f[1]=e);for(var n=0;n<u;++n)d[n]=t[n+2].toWireType(p,n<0||arguments.length<=n?void 0:arguments[n]),f.push(d[n]);var a=r(...f);function o(n){if(c)Oe(p);else for(var r=s?1:2;r<t.length;r++){var i=r===1?e:d[r-2];t[r].destructorFunction!==null&&t[r].destructorFunction(i)}if(l)return t[0].fromWireType(n)}return o(a)})}var Ft=(e,t,n,r,i,a)=>{var o=Mt(t,n);i=Dt(r,i),Fe([],[e],e=>{e=e[0];var n=`constructor ${e.name}`;if(e.registeredClass.constructor_body===void 0&&(e.registeredClass.constructor_body=[]),e.registeredClass.constructor_body[t-1]!==void 0)throw new ze(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[t-1]=()=>{At(`Cannot construct ${e.name} due to unbound types`,o)},Fe([],o,r=>(r.splice(1,0,null),e.registeredClass.constructor_body[t-1]=Pt(n,r,null,i,a),[])),[]})},It=e=>{e=e.trim();let t=e.indexOf(`(`);return t===-1?e:e.slice(0,t)},Lt=(e,t,n,r,i,a,o,s,c,l)=>{var u=Mt(n,r);t=Re(t),t=It(t),a=Dt(i,a,c),Fe([],[e],e=>{e=e[0];var r=`${e.name}.${t}`;t.startsWith(`@@`)&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);function i(){At(`Cannot call ${r} due to unbound types`,u)}var l=e.registeredClass.instancePrototype,d=l[t];return d===void 0||d.overloadTable===void 0&&d.className!==e.name&&d.argCount===n-2?(i.argCount=n-2,i.className=e.name,l[t]=i):(rt(l,t,r),l[t].overloadTable[n-2]=i),Fe([],u,i=>{var s=Pt(r,i,e,a,o,c);return l[t].overloadTable===void 0?(s.argCount=n-2,l[t]=s):l[t].overloadTable[n-2]=s,[]}),[]})},Rt=[],zt=[0,1,,1,null,1,!0,1,!1,1],Bt=e=>{e>9&&--zt[e+1]===0&&(zt[e]=void 0,Rt.push(e))},Vt={toValue:e=>(e||Be(`Cannot use deleted val. handle = ${e}`),zt[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{let t=Rt.pop()||zt.length;return zt[t]=e,zt[t+1]=1,t}}}},Ht={name:`emscripten::val`,fromWireType:e=>{var t=Vt.toValue(e);return Bt(e),t},toWireType:(e,t)=>Vt.toHandle(t),readValueFromPointer:ke,destructorFunction:null},Ut=e=>He(e,Ht),Wt=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(ne[e>>2])};case 8:return function(e){return this.fromWireType(re[e>>3])};default:throw TypeError(`invalid float width (${t}): ${e}`)}},Gt=(e,t,n)=>{t=Re(t),He(e,{name:t,fromWireType:e=>e,toWireType:(e,t)=>t,readValueFromPointer:Wt(t,n),destructorFunction:null})},Kt=(e,t,n,r,i,a,o,s)=>{var c=Mt(t,n);e=Re(e),e=It(e),i=Dt(r,i,o),it(e,function(){At(`Cannot call ${e} due to unbound types`,c)},t-1),Fe([],c,n=>{var r=[n[0],null].concat(n.slice(1));return xt(e,Pt(e,r,null,i,a,o),t-1),[]})},qt=(e,t,n)=>{switch(t){case 1:return n?e=>te[e]:e=>ae[e];case 2:return n?e=>ee[e>>1]:e=>ie[e>>1];case 4:return n?e=>P[e>>2]:e=>F[e>>2];default:throw TypeError(`invalid integer width (${t}): ${e}`)}},Jt=(e,t,n,r,i)=>{t=Re(t);let a=r===0,o=e=>e;if(a){var s=32-8*n;o=e=>e<<s>>>s,i=o(i)}He(e,{name:t,fromWireType:o,toWireType:(e,t)=>t,readValueFromPointer:qt(t,n,r!==0),destructorFunction:null})},Yt=(e,t,n)=>{let r=(e,t)=>{let n=0;return{next(){if(n>=e)return{done:!0};let r=n;return n++,{value:t(r),done:!1}},[Symbol.iterator](){return this}}};e[Symbol.iterator]||(e[Symbol.iterator]=function(){return r(this[t](),e=>this[n](e))})},Xt=(e,t,n,r)=>{n=Re(n),r=Re(r),Fe([],[e,t],e=>{let t=e[0];return Yt(t.registeredClass.instancePrototype,n,r),[]})},Zt=(e,t,n)=>{var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function i(e){var t=F[e>>2],n=F[e+4>>2];return new r(te.buffer,n,t)}n=Re(n),He(e,{name:n,fromWireType:i,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},Qt=Object.assign({optional:!0},Ht),$t=(e,t)=>{He(e,Qt)},en=(e,t,n,r)=>{if(!(r>0))return 0;for(var i=n,a=n+r-1,o=0;o<e.length;++o){var s=e.codePointAt(o);if(s<=127){if(n>=a)break;t[n++]=s}else if(s<=2047){if(n+1>=a)break;t[n++]=192|s>>6,t[n++]=128|s&63}else if(s<=65535){if(n+2>=a)break;t[n++]=224|s>>12,t[n++]=128|s>>6&63,t[n++]=128|s&63}else{if(n+3>=a)break;t[n++]=240|s>>18,t[n++]=128|s>>12&63,t[n++]=128|s>>6&63,t[n++]=128|s&63,o++}}return t[n]=0,n-i},tn=(e,t,n)=>en(e,ae,t,n),nn=e=>{for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r<=127?t++:r<=2047?t+=2:r>=55296&&r<=57343?(t+=4,++n):t+=3}return t},rn=globalThis.TextDecoder&&new TextDecoder,an=(e,t,n,r)=>{var i=t+n;if(r)return i;for(;e[t]&&!(t>=i);)++t;return t},on=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;var i=an(e,t,n,r);if(i-t>16&&e.buffer&&rn)return rn.decode(e.subarray(t,i));for(var a=``;t<i;){var o=e[t++];if(!(o&128)){a+=String.fromCharCode(o);continue}var s=e[t++]&63;if((o&224)==192){a+=String.fromCharCode((o&31)<<6|s);continue}var c=e[t++]&63;if(o=(o&240)==224?(o&15)<<12|s<<6|c:(o&7)<<18|s<<12|c<<6|e[t++]&63,o<65536)a+=String.fromCharCode(o);else{var l=o-65536;a+=String.fromCharCode(55296|l>>10,56320|l&1023)}}return a},sn=(e,t,n)=>e?on(ae,e,t,n):``,cn=(e,t)=>{t=Re(t);var n=!0;He(e,{name:t,fromWireType(e){var t=F[e>>2],r=e+4,i;if(n)i=sn(r,t,!0);else{i=``;for(var a=0;a<t;++a)i+=String.fromCharCode(ae[r+a])}return Xn(e),i},toWireType(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var r,i=typeof t==`string`;i||ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT==1||Be(`Cannot pass non-string to std::string`),r=n&&i?nn(t):t.length;var a=Zn(4+r+1),o=a+4;if(F[a>>2]=r,i)if(n)tn(t,o,r+1);else for(var s=0;s<r;++s){var c=t.charCodeAt(s);c>255&&(Xn(a),Be(`String has UTF-16 code units that do not fit in 8 bits`)),ae[o+s]=c}else ae.set(t,o);return e!==null&&e.push(Xn,a),a},readValueFromPointer:ke,destructorFunction(e){Xn(e)}})},ln=globalThis.TextDecoder?new TextDecoder(`utf-16le`):void 0,un=(e,t,n)=>{var r=e>>1,i=an(ie,r,t/2,n);if(i-r>16&&ln)return ln.decode(ie.subarray(r,i));for(var a=``,o=r;o<i;++o){var s=ie[o];a+=String.fromCharCode(s)}return a},dn=(e,t,n)=>{if(n??=2147483647,n<2)return 0;n-=2;for(var r=t,i=n<e.length*2?n/2:e.length,a=0;a<i;++a){var o=e.charCodeAt(a);ee[t>>1]=o,t+=2}return ee[t>>1]=0,t-r},fn=e=>e.length*2,pn=(e,t,n)=>{for(var r=``,i=e>>2,a=0;!(a>=t/4);a++){var o=F[i+a];if(!o&&!n)break;r+=String.fromCodePoint(o)}return r},mn=(e,t,n)=>{if(n??=2147483647,n<4)return 0;for(var r=t,i=r+n-4,a=0;a<e.length;++a){var o=e.codePointAt(a);if(o>65535&&a++,P[t>>2]=o,t+=4,t+4>i)break}return P[t>>2]=0,t-r},hn=e=>{for(var t=0,n=0;n<e.length;++n)e.codePointAt(n)>65535&&n++,t+=4;return t},gn=(e,t,n)=>{n=Re(n);var r,i,a;t===2?(r=un,i=dn,a=fn):(r=pn,i=mn,a=hn),He(e,{name:n,fromWireType:e=>{var n=F[e>>2],i=r(e+4,n*t,!0);return Xn(e),i},toWireType:(e,r)=>{typeof r!=`string`&&Be(`Cannot pass non-string to C++ string type ${n}`);var o=a(r),s=Zn(4+o+t);return F[s>>2]=o/t,i(r,s+4,o+t),e!==null&&e.push(Xn,s),s},readValueFromPointer:ke,destructorFunction(e){Xn(e)}})},_n=(e,t,n,r,i,a)=>{De[e]={name:Re(t),rawConstructor:Dt(n,r),rawDestructor:Dt(i,a),fields:[]}},vn=(e,t,n,r,i,a,o,s,c,l)=>{De[e].fields.push({fieldName:Re(t),getterReturnType:n,getter:Dt(r,i),getterContext:a,setterArgumentType:o,setter:Dt(s,c),setterContext:l})},yn=(e,t)=>{t=Re(t),He(e,{isVoid:!0,name:t,fromWireType:()=>void 0,toWireType:(e,t)=>void 0})},bn=[],xn=e=>{var t=bn.length;return bn.push(e),t},Sn=(e,t)=>{var n=je[e];return n===void 0&&Be(`${t} has unknown type ${kt(e)}`),n},Cn=(e,t)=>{for(var n=Array(e),r=0;r<e;++r)n[r]=Sn(F[t+r*4>>2],`parameter ${r}`);return n},wn=(e,t,n)=>{var r=[],i=e(r,n);return r.length&&(F[t>>2]=Vt.toHandle(r)),i},Tn={},En=e=>{var t=Tn[e];return t===void 0?Re(e):t},Dn=(e,t,n)=>{var r=8,[i,...a]=Cn(e,t),o=i.toWireType.bind(i),s=a.map(e=>e.readValueFromPointer.bind(e));e--;var c=Array(e);return xn(tt(`methodCaller<(${a.map(e=>e.name)}) => ${i.name}>`,(t,i,a,l)=>{for(var u=0,d=0;d<e;++d)c[d]=s[d](l+u),u+=r;var f;switch(n){case 0:f=Vt.toValue(t).apply(null,c);break;case 2:f=Reflect.construct(Vt.toValue(t),c);break;case 3:f=c[0];break;case 1:f=Vt.toValue(t)[En(i)](...c);break}return wn(o,a,f)}))},On=e=>e?(e=En(e),Vt.toHandle(globalThis[e])):Vt.toHandle(globalThis),kn=e=>{e>9&&(zt[e+1]+=1)},An=(e,t,n,r,i)=>bn[e](t,n,r,i),jn=e=>{Oe(Vt.toValue(e)),Bt(e)},Mn=(e,t,n,r)=>{var i=new Date().getFullYear(),a=new Date(i,0,1),o=new Date(i,6,1),s=a.getTimezoneOffset(),c=o.getTimezoneOffset(),l=Math.max(s,c);F[e>>2]=l*60,P[t>>2]=Number(s!=c);var u=e=>{var t=e>=0?`-`:`+`,n=Math.abs(e);return`UTC${t}${String(Math.floor(n/60)).padStart(2,`0`)}${String(n%60).padStart(2,`0`)}`},d=u(s),f=u(c);c<s?(tn(d,n,17),tn(f,r,17)):(tn(d,r,17),tn(f,n,17))},Nn=()=>2147483648,Pn=(e,t)=>Math.ceil(e/t)*t,Fn=e=>{var t=(e-cr.buffer.byteLength+65535)/65536|0;try{return cr.grow(t),x(),1}catch{}},In=e=>{var t=ae.length;e>>>=0;var n=Nn();if(e>n)return!1;for(var r=1;r<=4;r*=2){var i=t*(1+.2/r);if(i=Math.min(i,e+100663296),Fn(Math.min(n,Pn(Math.max(e,i),65536))))return!0}return!1},Ln={},Rn=()=>c||`./this.program`,zn=()=>{if(!zn.strings){var e={USER:`web_user`,LOGNAME:`web_user`,PATH:`/`,PWD:`/`,HOME:`/home/web_user`,LANG:(globalThis.navigator?.language??`C`).replace(`-`,`_`)+`.UTF-8`,_:Rn()};for(var t in Ln)Ln[t]===void 0?delete e[t]:e[t]=Ln[t];var n=[];for(var t in e)n.push(`${t}=${e[t]}`);zn.strings=n}return zn.strings},Bn=(e,t)=>{var n=0,r=0;for(var i of zn()){var a=t+n;F[e+r>>2]=a,n+=tn(i,a,1/0)+1,r+=4}return 0},Vn=(e,t)=>{var n=zn();F[e>>2]=n.length;var r=0;for(var i of n)r+=nn(i)+1;return F[t>>2]=r,0},Hn=e=>52,Un=(e,t)=>t+2097152>>>0<4194305-!!e?(e>>>0)+t*4294967296:NaN;function Wn(e,t,n,r,i){return Un(t,n),70}var Gn=[null,[],[]],Kn=(e,t)=>{var n=Gn[e];t===0||t===10?((e===1?m:h)(on(n)),n.length=0):n.push(t)},qn=(e,t,n,r)=>{for(var i=0,a=0;a<n;a++){var o=F[t>>2],s=F[t+4>>2];t+=8;for(var c=0;c<s;c++)Kn(e,ae[o+c]);i+=s}return F[r>>2]=i,0},Jn=e=>e;if($e(),yt(),i.noExitRuntime&&i.noExitRuntime,i.print&&(m=i.print),i.printErr&&(h=i.printErr),i.wasmBinary&&(g=i.wasmBinary),i.arguments&&i.arguments,i.thisProgram&&(c=i.thisProgram),i.preInit)for(typeof i.preInit==`function`&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.shift()();var Yn,Xn,Zn,Qn,V,$n,er,tr,nr,rr,ir,ar,or,sr,cr,lr;function ur(e){Yn=e.Ca,Xn=i._free=e.Da,Zn=i._malloc=e.Fa,Qn=e.Ga,V=e.Ha,$n=e.Ia,er=e.Ja,tr=e.Ka,nr=e.La,rr=e.Ma,ir=e.Na,St.viijii=e.Oa,ar=St.viijjijjjjjj=e.Pa,or=St.iiijj=e.Qa,St.jiji=e.Ra,sr=St.jiiii=e.Sa,St.iiiiij=e.Ta,St.iiiiijj=e.Ua,St.iiiiiijj=e.Va,cr=e.Aa,lr=e.Ea}var dr={s:pe,x:he,a:ye,i:be,m:xe,R:Se,p:Ce,ga:we,d:Te,ca:Ee,xa:Ie,ba:Le,ra:Ue,va:jt,ua:Ft,H:Lt,pa:Ut,X:Gt,Y:Kt,A:Jt,ta:Xt,u:Zt,wa:$t,qa:cn,S:gn,I:_n,ya:vn,sa:yn,O:Dn,za:Bt,E:On,T:kn,N:An,la:jn,da:Mn,ha:In,ea:Bn,fa:Vn,ia:Hn,_:Wn,V:qn,na:Nr,M:Ir,C:Hr,P:yr,U:Wr,q:Mr,b:mr,F:Fr,ka:Br,c:gr,ja:Vr,g:vr,j:Tr,r:Dr,Q:Pr,t:kr,G:Ar,B:jr,K:Gr,$:Jr,Z:Yr,f:br,l:fr,e:hr,W:Lr,h:_r,L:Ur,k:pr,ma:Rr,o:Or,y:Sr,v:Er,D:wr,w:zr,n:xr,J:Kr,oa:Cr,aa:qr,z:Jn};function fr(e,t){var n=L();try{B(e)(t)}catch(e){if(I(n),e!==e+0)throw e;V(1,0)}}function pr(e,t,n,r,i){var a=L();try{B(e)(t,n,r,i)}catch(e){if(I(a),e!==e+0)throw e;V(1,0)}}function mr(e,t){var n=L();try{return B(e)(t)}catch(e){if(I(n),e!==e+0)throw e;V(1,0)}}function hr(e,t,n){var r=L();try{B(e)(t,n)}catch(e){if(I(r),e!==e+0)throw e;V(1,0)}}function gr(e,t,n){var r=L();try{return B(e)(t,n)}catch(e){if(I(r),e!==e+0)throw e;V(1,0)}}function _r(e,t,n,r){var i=L();try{B(e)(t,n,r)}catch(e){if(I(i),e!==e+0)throw e;V(1,0)}}function vr(e,t,n,r){var i=L();try{return B(e)(t,n,r)}catch(e){if(I(i),e!==e+0)throw e;V(1,0)}}function yr(e,t,n,r,i,a){var o=L();try{return B(e)(t,n,r,i,a)}catch(e){if(I(o),e!==e+0)throw e;V(1,0)}}function br(e){var t=L();try{B(e)()}catch(e){if(I(t),e!==e+0)throw e;V(1,0)}}function xr(e,t,n,r,i,a,o,s,c,l,u){var d=L();try{B(e)(t,n,r,i,a,o,s,c,l,u)}catch(e){if(I(d),e!==e+0)throw e;V(1,0)}}function Sr(e,t,n,r,i,a,o){var s=L();try{B(e)(t,n,r,i,a,o)}catch(e){if(I(s),e!==e+0)throw e;V(1,0)}}function Cr(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g){var _=L();try{B(e)(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g)}catch(e){if(I(_),e!==e+0)throw e;V(1,0)}}function wr(e,t,n,r,i,a,o,s,c){var l=L();try{B(e)(t,n,r,i,a,o,s,c)}catch(e){if(I(l),e!==e+0)throw e;V(1,0)}}function Tr(e,t,n,r,i){var a=L();try{return B(e)(t,n,r,i)}catch(e){if(I(a),e!==e+0)throw e;V(1,0)}}function Er(e,t,n,r,i,a,o,s){var c=L();try{B(e)(t,n,r,i,a,o,s)}catch(e){if(I(c),e!==e+0)throw e;V(1,0)}}function Dr(e,t,n,r,i,a){var o=L();try{return B(e)(t,n,r,i,a)}catch(e){if(I(o),e!==e+0)throw e;V(1,0)}}function Or(e,t,n,r,i,a){var o=L();try{B(e)(t,n,r,i,a)}catch(e){if(I(o),e!==e+0)throw e;V(1,0)}}function kr(e,t,n,r,i,a,o){var s=L();try{return B(e)(t,n,r,i,a,o)}catch(e){if(I(s),e!==e+0)throw e;V(1,0)}}function Ar(e,t,n,r,i,a,o,s){var c=L();try{return B(e)(t,n,r,i,a,o,s)}catch(e){if(I(c),e!==e+0)throw e;V(1,0)}}function jr(e,t,n,r,i,a,o,s,c){var l=L();try{return B(e)(t,n,r,i,a,o,s,c)}catch(e){if(I(l),e!==e+0)throw e;V(1,0)}}function Mr(e){var t=L();try{return B(e)()}catch(e){if(I(t),e!==e+0)throw e;V(1,0)}}function Nr(e,t,n){var r=L();try{return B(e)(t,n)}catch(e){if(I(r),e!==e+0)throw e;V(1,0)}}function Pr(e,t,n,r,i,a,o){var s=L();try{return B(e)(t,n,r,i,a,o)}catch(e){if(I(s),e!==e+0)throw e;V(1,0)}}function Fr(e,t,n,r){var i=L();try{return B(e)(t,n,r)}catch(e){if(I(i),e!==e+0)throw e;V(1,0)}}function Ir(e,t,n,r){var i=L();try{return B(e)(t,n,r)}catch(e){if(I(i),e!==e+0)throw e;V(1,0)}}function Lr(e,t,n,r,i,a,o,s,c){var l=L();try{B(e)(t,n,r,i,a,o,s,c)}catch(e){if(I(l),e!==e+0)throw e;V(1,0)}}function Rr(e,t,n,r,i,a,o,s){var c=L();try{B(e)(t,n,r,i,a,o,s)}catch(e){if(I(c),e!==e+0)throw e;V(1,0)}}function zr(e,t,n,r,i,a,o,s,c,l){var u=L();try{B(e)(t,n,r,i,a,o,s,c,l)}catch(e){if(I(u),e!==e+0)throw e;V(1,0)}}function Br(e,t,n){var r=L();try{return B(e)(t,n)}catch(e){if(I(r),e!==e+0)throw e;V(1,0)}}function Vr(e,t,n,r,i){var a=L();try{return B(e)(t,n,r,i)}catch(e){if(I(a),e!==e+0)throw e;V(1,0)}}function Hr(e,t,n,r,i,a){var o=L();try{return B(e)(t,n,r,i,a)}catch(e){if(I(o),e!==e+0)throw e;V(1,0)}}function Ur(e,t,n,r,i,a,o){var s=L();try{B(e)(t,n,r,i,a,o)}catch(e){if(I(s),e!==e+0)throw e;V(1,0)}}function Wr(e,t,n,r){var i=L();try{return B(e)(t,n,r)}catch(e){if(I(i),e!==e+0)throw e;V(1,0)}}function Gr(e,t,n,r,i,a,o,s,c,l,u,d){var f=L();try{return B(e)(t,n,r,i,a,o,s,c,l,u,d)}catch(e){if(I(f),e!==e+0)throw e;V(1,0)}}function Kr(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){var g=L();try{B(e)(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h)}catch(e){if(I(g),e!==e+0)throw e;V(1,0)}}function qr(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y){var b=L();try{ar(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y)}catch(e){if(I(b),e!==e+0)throw e;V(1,0)}}function Jr(e,t,n,r,i,a,o){var s=L();try{return or(e,t,n,r,i,a,o)}catch(e){if(I(s),e!==e+0)throw e;V(1,0)}}function Yr(e,t,n,r,i){var a=L();try{return sr(e,t,n,r,i)}catch(e){if(I(a),e!==e+0)throw e;V(1,0)}}function Xr(){S();function e(){var e,t;i.calledRun=!0,!_&&(C(),(e=v)==null||e(i),(t=i.onRuntimeInitialized)==null||t.call(i),w())}i.setStatus?(i.setStatus(`Running...`),setTimeout(()=>{setTimeout(()=>i.setStatus(``),1),e()},1)):e()}var Zr=await N();return Xr(),t=b?i:new Promise((e,t)=>{v=e,y=t}),t}function Nj(e){return kj(Mj,e)}async function Pj(e,t){return jj(Mj,e,t)}var Fj=[[`aztec`,`Aztec`],[`aztec_code`,`AztecCode`],[`aztec_rune`,`AztecRune`],[`code_128`,`Code128`],[`code_39`,`Code39`],[`code_39_standard`,`Code39Std`],[`code_39_extended`,`Code39Ext`],[`code_32`,`Code32`],[`pzn`,`PZN`],[`code_93`,`Code93`],[`codabar`,`Codabar`],[`databar`,`DataBar`],[`databar_omni`,`DataBarOmni`],[`databar_stacked`,`DataBarStk`],[`databar_stacked_omni`,`DataBarStkOmni`],[`databar_expanded`,`DataBarExp`],[`databar_expanded_stacked`,`DataBarExpStk`],[`databar_limited`,`DataBarLtd`],[`data_matrix`,`DataMatrix`],[`dx_film_edge`,`DXFilmEdge`],[`ean_13`,`EAN13`],[`ean_upc`,`EANUPC`],[`isbn`,`ISBN`],[`ean_8`,`EAN8`],[`itf`,`ITF`],[`itf_14`,`ITF14`],[`maxi_code`,`MaxiCode`],[`micro_qr_code`,`MicroQRCode`],[`pdf417`,`PDF417`],[`compact_pdf417`,`CompactPDF417`],[`qr_code`,`QRCode`],[`qr_code_model_1`,`QRCodeModel1`],[`qr_code_model_2`,`QRCodeModel2`],[`rm_qr_code`,`RMQRCode`],[`upc_a`,`UPCA`],[`upc_e`,`UPCE`],[`other_barcode`,`OtherBarcode`],[`linear_codes`,`AllLinear`],[`matrix_codes`,`AllMatrix`],[`gs1_codes`,`AllGS1`],[`retail_codes`,`AllRetail`],[`industrial_codes`,`AllIndustrial`],[`any`,`All`]],Ij=[...Fj,[`unknown`]].map(e=>e[0]),Lj=new Map(Fj);function Rj(e){for(let[t,n]of Lj)if(e===n)return t;return`unknown`}function zj(e){if(Bj(e))return{width:e.naturalWidth,height:e.naturalHeight};if(Vj(e))return{width:e.width.baseVal.value,height:e.height.baseVal.value};if(Hj(e))return{width:e.videoWidth,height:e.videoHeight};if(Wj(e))return{width:e.width,height:e.height};if(Kj(e))return{width:e.displayWidth,height:e.displayHeight};if(Uj(e)||Gj(e))return{width:e.width,height:e.height};throw TypeError(`The provided value is not of type '(Blob or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or ImageData or OffscreenCanvas or SVGImageElement or VideoFrame)'.`)}function Bj(e){try{var t;return e instanceof(e==null||(t=e.ownerDocument)==null||(t=t.defaultView)==null?void 0:t.HTMLImageElement)}catch{return!1}}function Vj(e){try{var t;return e instanceof(e==null||(t=e.ownerDocument)==null||(t=t.defaultView)==null?void 0:t.SVGImageElement)}catch{return!1}}function Hj(e){try{var t;return e instanceof(e==null||(t=e.ownerDocument)==null||(t=t.defaultView)==null?void 0:t.HTMLVideoElement)}catch{return!1}}function Uj(e){try{var t;return e instanceof(e==null||(t=e.ownerDocument)==null||(t=t.defaultView)==null?void 0:t.HTMLCanvasElement)}catch{return!1}}function Wj(e){try{return e instanceof ImageBitmap||Object.prototype.toString.call(e)===`[object ImageBitmap]`}catch{return!1}}function Gj(e){try{return e instanceof OffscreenCanvas||Object.prototype.toString.call(e)===`[object OffscreenCanvas]`}catch{return!1}}function Kj(e){try{return e instanceof VideoFrame||Object.prototype.toString.call(e)===`[object VideoFrame]`}catch{return!1}}function qj(e){try{return e instanceof Blob||Object.prototype.toString.call(e)===`[object Blob]`}catch{return!1}}function Jj(e){try{return e instanceof ImageData||Object.prototype.toString.call(e)===`[object ImageData]`}catch{return!1}}function Yj(e,t){try{let n=new OffscreenCanvas(e,t);if(n.getContext(`2d`)instanceof OffscreenCanvasRenderingContext2D)return n;throw void 0}catch{let n=document.createElement(`canvas`);return n.width=e,n.height=t,n}}async function Xj(e){if(Bj(e)&&!await eM(e))throw new DOMException(`Failed to load or decode HTMLImageElement.`,`InvalidStateError`);if(Vj(e)&&!await tM(e))throw new DOMException(`Failed to load or decode SVGImageElement.`,`InvalidStateError`);if(Kj(e)&&nM(e))throw new DOMException(`VideoFrame is closed.`,`InvalidStateError`);if(Hj(e)&&(e.readyState===0||e.readyState===1))throw new DOMException(`Invalid element or state.`,`InvalidStateError`);if(Wj(e)&&iM(e))throw new DOMException(`The image source is detached.`,`InvalidStateError`);let{width:t,height:n}=zj(e);if(t===0||n===0)return null;let r=Yj(t,n).getContext(`2d`);r.drawImage(e,0,0);try{return r.getImageData(0,0,t,n)}catch{throw new DOMException(`Source would taint origin.`,`SecurityError`)}}async function Zj(e){let t;try{t=await createImageBitmap(e)}catch{try{if(globalThis.Image){t=new Image;let n=``;try{n=URL.createObjectURL(e),t.src=n,await t.decode()}finally{URL.revokeObjectURL(n)}}else return e}catch{throw new DOMException(`Failed to load or decode Blob.`,`InvalidStateError`)}}return await Xj(t)}function Qj(e){let{width:t,height:n}=e;if(t===0||n===0)return null;let r=e.getContext(`2d`);try{return r.getImageData(0,0,t,n)}catch{throw new DOMException(`Source would taint origin.`,`SecurityError`)}}async function $j(e){if(qj(e))return await Zj(e);if(Jj(e)){if(rM(e))throw new DOMException(`The image data has been detached.`,`InvalidStateError`);return e}return Uj(e)||Gj(e)?Qj(e):await Xj(e)}async function eM(e){try{return await e.decode(),!0}catch{return!1}}async function tM(e){try{return await e.decode?.call(e),!0}catch{return!1}}function nM(e){return e.format===null}function rM(e){return e.data.buffer.byteLength===0}function iM(e){return e.width===0&&e.height===0}function aM(e,t){return oM(e)?new DOMException(`${t}: ${e.message}`,e.name):sM(e)?new e.constructor(`${t}: ${e.message}`):Error(`${t}: ${e}`)}function oM(e){return e instanceof DOMException||Object.prototype.toString.call(e)===`[object DOMException]`}function sM(e){return e instanceof Error||Object.prototype.toString.call(e)===`[object Error]`}function cM(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function lM(e,t,n){cM(e,t),t.set(e,n)}function uM(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function dM(e,t,n){return e.set(uM(e,t),n),n}function fM(e,t){return e.get(uM(e,t))}var pM=new WeakMap,mM=class{constructor(e={}){lM(this,pM,void 0);try{var t;let n=e==null||(t=e.formats)==null?void 0:t.filter(e=>e!==`unknown`);if(n?.length===0)throw TypeError(`Hint option provided, but is empty.`);for(let e of n??[])if(!Lj.has(e))throw TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${e}' is not a valid enum value of type BarcodeFormat.`);dM(pM,this,n??[]),Nj({fireImmediately:!0}).catch(()=>{})}catch(e){throw aM(e,`Failed to construct 'BarcodeDetector'`)}}static async getSupportedFormats(){return Ij.filter(e=>e!==`unknown`)}async detect(e){try{let t=await $j(e);if(t===null)return[];let n,r={textMode:`Plain`,formats:fM(pM,this).map(e=>Lj.get(e))};try{n=await Pj(t,r)}catch(e){throw console.error(e),new DOMException(`Barcode detection service unavailable.`,`NotSupportedError`)}return n.map(e=>{let{topLeft:{x:t,y:n},topRight:{x:r,y:i},bottomLeft:{x:a,y:o},bottomRight:{x:s,y:c}}=e.position,l=Math.min(t,r,a,s),u=Math.min(n,i,o,c),d=Math.max(t,r,a,s),f=Math.max(n,i,o,c);return{boundingBox:new DOMRectReadOnly(l,u,d-l,f-u),rawValue:e.text,format:Rj(e.format),cornerPoints:[{x:t,y:n},{x:r,y:i},{x:s,y:c},{x:a,y:o}]}})}catch(e){throw aM(e,`Failed to execute 'detect' on 'BarcodeDetector'`)}}},hM=!0,gM=!0;function _M(e,t,n){let r=e.match(t);return r&&r.length>=n&&parseFloat(r[n],10)}function vM(e,t,n){if(!e.RTCPeerConnection)return;if(!Object.getOwnPropertyDescriptor(EventTarget.prototype,`addEventListener`).writable){xM(`Unable to polyfill events`);return}let r=e.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(e,r){if(e!==t)return i.apply(this,arguments);let a=e=>{let t=n(e);t&&(r.handleEvent?r.handleEvent(t):r(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(r,a),i.apply(this,[e,a])};let a=r.removeEventListener;r.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[t]||!this._eventMap[t].has(n))return a.apply(this,arguments);let r=this._eventMap[t].get(n);return this._eventMap[t].delete(n),this._eventMap[t].size===0&&delete this._eventMap[t],Object.keys(this._eventMap).length===0&&delete this._eventMap,a.apply(this,[e,r])},Object.defineProperty(r,`on`+t,{get(){return this[`_on`+t]},set(e){this[`_on`+t]&&(this.removeEventListener(t,this[`_on`+t]),delete this[`_on`+t]),e&&this.addEventListener(t,this[`_on`+t]=e)},enumerable:!0,configurable:!0})}function yM(e){return typeof e==`boolean`?(hM=e,e?`adapter.js logging disabled`:`adapter.js logging enabled`):Error(`Argument type: `+typeof e+`. Please use a boolean.`)}function bM(e){return typeof e==`boolean`?(gM=!e,`adapter.js deprecation warnings `+(e?`disabled`:`enabled`)):Error(`Argument type: `+typeof e+`. Please use a boolean.`)}function xM(){if(typeof window==`object`){if(hM)return;typeof console<`u`&&typeof console.log==`function`&&console.log.apply(console,arguments)}}function SM(e,t){gM&&console.warn(e+` is deprecated, please use `+t+` instead.`)}function CM(e){let t={browser:null,version:null};if(e===void 0||!e.navigator||!e.navigator.userAgent)return t.browser=`Not a browser.`,t;let{navigator:n}=e;if(n.userAgentData&&n.userAgentData.brands){let e=n.userAgentData.brands.find(e=>e.brand===`Chromium`);if(e)return{browser:`chrome`,version:parseInt(e.version,10)}}if(n.mozGetUserMedia)t.browser=`firefox`,t.version=parseInt(_M(n.userAgent,/Firefox\/(\d+)\./,1));else if(n.webkitGetUserMedia||e.isSecureContext===!1&&e.webkitRTCPeerConnection)t.browser=`chrome`,t.version=parseInt(_M(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2))||null;else if(e.RTCPeerConnection&&n.userAgent.match(/AppleWebKit\/(\d+)\./))t.browser=`safari`,t.version=parseInt(_M(n.userAgent,/AppleWebKit\/(\d+)\./,1)),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&`currentDirection`in e.RTCRtpTransceiver.prototype,t._safariVersion=_M(n.userAgent,/Version\/(\d+(\.?\d+))/,1);else return t.browser=`Not a supported browser.`,t;return t}function wM(e){return Object.prototype.toString.call(e)===`[object Object]`}function TM(e){return wM(e)?Object.keys(e).reduce(function(t,n){let r=wM(e[n]),i=r?TM(e[n]):e[n],a=r&&!Object.keys(i).length;return i===void 0||a?t:Object.assign(t,{[n]:i})},{}):e}function EM(e,t,n){!t||n.has(t.id)||(n.set(t.id,t),Object.keys(t).forEach(r=>{r.endsWith(`Id`)?EM(e,e.get(t[r]),n):r.endsWith(`Ids`)&&t[r].forEach(t=>{EM(e,e.get(t),n)})}))}function DM(e,t,n){let r=n?`outbound-rtp`:`inbound-rtp`,i=new Map;if(t===null)return i;let a=[];return e.forEach(e=>{e.type===`track`&&e.trackIdentifier===t.id&&a.push(e)}),a.forEach(t=>{e.forEach(n=>{n.type===r&&n.trackId===t.id&&EM(e,n,i)})}),i}var OM=xM;function kM(e,t){let n=e&&e.navigator;if(!n.mediaDevices)return;let r=function(e){if(typeof e!=`object`||e.mandatory||e.optional)return e;let t={};return Object.keys(e).forEach(n=>{if(n===`require`||n===`advanced`||n===`mediaSource`)return;let r=typeof e[n]==`object`?e[n]:{ideal:e[n]};r.exact!==void 0&&typeof r.exact==`number`&&(r.min=r.max=r.exact);let i=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):t===`deviceId`?`sourceId`:t};if(r.ideal!==void 0){t.optional=t.optional||[];let e={};typeof r.ideal==`number`?(e[i(`min`,n)]=r.ideal,t.optional.push(e),e={},e[i(`max`,n)]=r.ideal,t.optional.push(e)):(e[i(``,n)]=r.ideal,t.optional.push(e))}r.exact!==void 0&&typeof r.exact!=`number`?(t.mandatory=t.mandatory||{},t.mandatory[i(``,n)]=r.exact):[`min`,`max`].forEach(e=>{r[e]!==void 0&&(t.mandatory=t.mandatory||{},t.mandatory[i(e,n)]=r[e])})}),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},i=function(e,i){if(t.version>=61)return i(e);if(e=JSON.parse(JSON.stringify(e)),e&&typeof e.audio==`object`){let t=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};e=JSON.parse(JSON.stringify(e)),t(e.audio,`autoGainControl`,`googAutoGainControl`),t(e.audio,`noiseSuppression`,`googNoiseSuppression`),e.audio=r(e.audio)}if(e&&typeof e.video==`object`){let a=e.video.facingMode;a&&=typeof a==`object`?a:{ideal:a};let o=t.version<66;if(a&&(a.exact===`user`||a.exact===`environment`||a.ideal===`user`||a.ideal===`environment`)&&!(n.mediaDevices.getSupportedConstraints&&n.mediaDevices.getSupportedConstraints().facingMode&&!o)){delete e.video.facingMode;let t;if(a.exact===`environment`||a.ideal===`environment`?t=[`back`,`rear`]:(a.exact===`user`||a.ideal===`user`)&&(t=[`front`]),t)return n.mediaDevices.enumerateDevices().then(n=>{n=n.filter(e=>e.kind===`videoinput`);let o=n.find(e=>t.some(t=>e.label.toLowerCase().includes(t)));return!o&&n.length&&t.includes(`back`)&&(o=n[n.length-1]),o&&(e.video.deviceId=a.exact?{exact:o.deviceId}:{ideal:o.deviceId}),e.video=r(e.video),OM(`chrome: `+JSON.stringify(e)),i(e)})}e.video=r(e.video)}return OM(`chrome: `+JSON.stringify(e)),i(e)},a=function(e){return t.version>=64?e:{name:{PermissionDeniedError:`NotAllowedError`,PermissionDismissedError:`NotAllowedError`,InvalidStateError:`NotAllowedError`,DevicesNotFoundError:`NotFoundError`,ConstraintNotSatisfiedError:`OverconstrainedError`,TrackStartError:`NotReadableError`,MediaDeviceFailedDueToShutdown:`NotAllowedError`,MediaDeviceKillSwitchOn:`NotAllowedError`,TabCaptureError:`AbortError`,ScreenCaptureError:`AbortError`,DeviceCaptureError:`AbortError`}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString(){return this.name+(this.message&&`: `)+this.message}}};if(n.getUserMedia=function(e,t,r){i(e,e=>{n.webkitGetUserMedia(e,t,e=>{r&&r(a(e))})})}.bind(n),n.mediaDevices.getUserMedia){let e=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(t){return i(t,t=>e(t).then(e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEach(e=>{e.stop()}),new DOMException(``,`NotFoundError`);return e},e=>Promise.reject(a(e))))}}}var AM=f({fixNegotiationNeeded:()=>RM,shimAddTrackRemoveTrack:()=>IM,shimAddTrackRemoveTrackWithNative:()=>FM,shimGetSendersWithDtmf:()=>NM,shimGetUserMedia:()=>kM,shimMediaStream:()=>jM,shimOnTrack:()=>MM,shimPeerConnection:()=>LM,shimSenderReceiverGetStats:()=>PM});function jM(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function MM(e,t){if(!(t.version>102))if(typeof e==`object`&&e.RTCPeerConnection&&!(`ontrack`in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener(`track`,this._ontrack),this.addEventListener(`track`,this._ontrack=e)},enumerable:!0,configurable:!0});let t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener(`addtrack`,n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(e=>e.track&&e.track.id===n.track.id):{track:n.track};let i=new Event(`track`);i.track=n.track,i.receiver=r,i.transceiver={receiver:r},i.streams=[t.stream],this.dispatchEvent(i)}),t.stream.getTracks().forEach(n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(e=>e.track&&e.track.id===n.id):{track:n};let i=new Event(`track`);i.track=n,i.receiver=r,i.transceiver={receiver:r},i.streams=[t.stream],this.dispatchEvent(i)})},this.addEventListener(`addstream`,this._ontrackpoly)),t.apply(this,arguments)}}else vM(e,`track`,e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}function NM(e){if(typeof e==`object`&&e.RTCPeerConnection&&!(`getSenders`in e.RTCPeerConnection.prototype)&&`createDTMFSender`in e.RTCPeerConnection.prototype){let t=function(e,t){return{track:t,get dtmf(){return this._dtmf===void 0&&(t.kind===`audio`?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};let n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){let i=n.apply(this,arguments);return i||(i=t(this,e),this._senders.push(i)),i};let r=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){r.apply(this,arguments);let t=this._senders.indexOf(e);t!==-1&&this._senders.splice(t,1)}}let n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach(e=>{this._senders.push(t(this,e))})};let r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],r.apply(this,[e]),e.getTracks().forEach(e=>{let t=this._senders.find(t=>t.track===e);t&&this._senders.splice(this._senders.indexOf(t),1)})}}else if(typeof e==`object`&&e.RTCPeerConnection&&`getSenders`in e.RTCPeerConnection.prototype&&`createDTMFSender`in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!(`dtmf`in e.RTCRtpSender.prototype)){let t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){let e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind===`audio`?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function PM(e,t){if(t.version>=67||!(typeof e==`object`&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!(`getStats`in e.RTCRtpSender.prototype)){let t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){let e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e});let n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){let e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){let e=this;return this._pc.getStats().then(t=>DM(t,e.track,!0))}}if(!(`getStats`in e.RTCRtpReceiver.prototype)){let t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){let e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e}),vM(e,`track`,e=>(e.receiver._pc=e.srcElement,e)),e.RTCRtpReceiver.prototype.getStats=function(){let e=this;return this._pc.getStats().then(t=>DM(t,e.track,!1))}}if(!(`getStats`in e.RTCRtpSender.prototype&&`getStats`in e.RTCRtpReceiver.prototype))return;let n=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){let e=arguments[0],t,n,r;return this.getSenders().forEach(n=>{n.track===e&&(t?r=!0:t=n)}),this.getReceivers().forEach(t=>(t.track===e&&(n?r=!0:n=t),t.track===e)),r||t&&n?Promise.reject(new DOMException(`There are more than one sender or receiver for the track.`,`InvalidAccessError`)):t?t.getStats():n?n.getStats():Promise.reject(new DOMException(`There is no sender or receiver for the track.`,`InvalidAccessError`))}return n.apply(this,arguments)}}function FM(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(e=>this._shimmedLocalStreams[e][0])};let t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};let r=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?this._shimmedLocalStreams[n.id].indexOf(r)===-1&&this._shimmedLocalStreams[n.id].push(r):this._shimmedLocalStreams[n.id]=[n,r],r};let n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach(e=>{if(this.getSenders().find(t=>t.track===e))throw new DOMException(`Track already exists.`,`InvalidAccessError`)});let t=this.getSenders();n.apply(this,arguments);let r=this.getSenders().filter(e=>t.indexOf(e)===-1);this._shimmedLocalStreams[e.id]=[e].concat(r)};let r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],r.apply(this,arguments)};let i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach(t=>{let n=this._shimmedLocalStreams[t].indexOf(e);n!==-1&&this._shimmedLocalStreams[t].splice(n,1),this._shimmedLocalStreams[t].length===1&&delete this._shimmedLocalStreams[t]}),i.apply(this,arguments)}}function IM(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return FM(e);let n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){let e=n.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map(e=>this._reverseStreams[e.id])};let r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach(e=>{if(this.getSenders().find(t=>t.track===e))throw new DOMException(`Track already exists.`,`InvalidAccessError`)}),!this._reverseStreams[t.id]){let n=new e.MediaStream(t.getTracks());this._streams[t.id]=n,this._reverseStreams[n.id]=t,t=n}r.apply(this,[t])};let i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,n){if(this.signalingState===`closed`)throw new DOMException(`The RTCPeerConnection's signalingState is 'closed'.`,`InvalidStateError`);let r=[].slice.call(arguments,1);if(r.length!==1||!r[0].getTracks().find(e=>e===t))throw new DOMException(`The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.`,`NotSupportedError`);if(this.getSenders().find(e=>e.track===t))throw new DOMException(`Track already exists.`,`InvalidAccessError`);this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};let i=this._streams[n.id];if(i)i.addTrack(t),Promise.resolve().then(()=>{this.dispatchEvent(new Event(`negotiationneeded`))});else{let r=new e.MediaStream([t]);this._streams[n.id]=r,this._reverseStreams[r.id]=n,this.addStream(r)}return this.getSenders().find(e=>e.track===t)};function a(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(t=>{let r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(i.id,`g`),r.id)}),new RTCSessionDescription({type:t.type,sdp:n})}function o(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(t=>{let r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(r.id,`g`),i.id)}),new RTCSessionDescription({type:t.type,sdp:n})}[`createOffer`,`createAnswer`].forEach(function(t){let n=e.RTCPeerConnection.prototype[t],r={[t](){let e=arguments;return arguments.length&&typeof arguments[0]==`function`?n.apply(this,[t=>{let n=a(this,t);e[0].apply(null,[n])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):n.apply(this,arguments).then(e=>a(this,e))}};e.RTCPeerConnection.prototype[t]=r[t]});let s=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type||(arguments[0]=o(this,arguments[0])),s.apply(this,arguments)};let c=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,`localDescription`);Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){let e=c.get.apply(this);return e.type===``?e:a(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){if(this.signalingState===`closed`)throw new DOMException(`The RTCPeerConnection's signalingState is 'closed'.`,`InvalidStateError`);if(!e._pc)throw new DOMException(`Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.`,`TypeError`);if(e._pc!==this)throw new DOMException(`Sender was not created by this connection.`,`InvalidAccessError`);this._streams=this._streams||{};let t;Object.keys(this._streams).forEach(n=>{this._streams[n].getTracks().find(t=>e.track===t)&&(t=this._streams[n])}),t&&(t.getTracks().length===1?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event(`negotiationneeded`)))}}function LM(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&[`setLocalDescription`,`setRemoteDescription`,`addIceCandidate`].forEach(function(t){let n=e.RTCPeerConnection.prototype[t],r={[t](){return arguments[0]=new(t===`addIceCandidate`?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]})}function RM(e,t){t.version>102||vM(e,`negotiationneeded`,e=>{let n=e.target;if(!((t.version<72||n.getConfiguration&&n.getConfiguration().sdpSemantics===`plan-b`)&&n.signalingState!==`stable`))return e})}function zM(e,t){let n=e&&e.navigator,r=e&&e.MediaStreamTrack;if(n.getUserMedia=function(e,t,r){SM(`navigator.getUserMedia`,`navigator.mediaDevices.getUserMedia`),n.mediaDevices.getUserMedia(e).then(t,r)},!(t.version>55&&`autoGainControl`in n.mediaDevices.getSupportedConstraints())){let e=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},t=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(n){return typeof n==`object`&&typeof n.audio==`object`&&(n=JSON.parse(JSON.stringify(n)),e(n.audio,`autoGainControl`,`mozAutoGainControl`),e(n.audio,`noiseSuppression`,`mozNoiseSuppression`)),t(n)},r&&r.prototype.getSettings){let t=r.prototype.getSettings;r.prototype.getSettings=function(){let n=t.apply(this,arguments);return e(n,`mozAutoGainControl`,`autoGainControl`),e(n,`mozNoiseSuppression`,`noiseSuppression`),n}}if(r&&r.prototype.applyConstraints){let t=r.prototype.applyConstraints;r.prototype.applyConstraints=function(n){return this.kind===`audio`&&typeof n==`object`&&(n=JSON.parse(JSON.stringify(n)),e(n,`autoGainControl`,`mozAutoGainControl`),e(n,`noiseSuppression`,`mozNoiseSuppression`)),t.apply(this,[n])}}}}function BM(e,t){e.navigator.mediaDevices&&`getDisplayMedia`in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(n){if(!(n&&n.video)){let e=new DOMException(`getDisplayMedia without video constraints is undefined`);return e.name=`NotFoundError`,e.code=8,Promise.reject(e)}return n.video===!0?n.video={mediaSource:t}:n.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(n)})}var VM=f({shimAddTransceiver:()=>YM,shimCreateAnswer:()=>QM,shimCreateOffer:()=>ZM,shimGetDisplayMedia:()=>BM,shimGetParameters:()=>XM,shimGetStats:()=>WM,shimGetUserMedia:()=>zM,shimOnTrack:()=>HM,shimPeerConnection:()=>UM,shimRTCDataChannel:()=>JM,shimReceiverGetStats:()=>KM,shimRemoveStream:()=>qM,shimSenderGetStats:()=>GM});function HM(e){typeof e==`object`&&e.RTCTrackEvent&&`receiver`in e.RTCTrackEvent.prototype&&!(`transceiver`in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function UM(e,t){typeof e!=`object`||!(e.RTCPeerConnection||e.mozRTCPeerConnection)||(!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&[`setLocalDescription`,`setRemoteDescription`,`addIceCandidate`].forEach(function(t){let n=e.RTCPeerConnection.prototype[t],r={[t](){return arguments[0]=new(t===`addIceCandidate`?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]}))}function WM(e,t){if(typeof e!=`object`||!(e.RTCPeerConnection||e.mozRTCPeerConnection)||t.version>=151)return;let n={inboundrtp:`inbound-rtp`,outboundrtp:`outbound-rtp`,candidatepair:`candidate-pair`,localcandidate:`local-candidate`,remotecandidate:`remote-candidate`},r=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){let[e,i,a]=arguments;return this.signalingState===`closed`?Promise.resolve(new Map):r.apply(this,[e||null]).then(e=>{if(t.version<53&&!i)try{e.forEach(e=>{e.type=n[e.type]||e.type})}catch(t){if(t.name!==`TypeError`)throw t;e.forEach((t,r)=>{e.set(r,Object.assign({},t,{type:n[t.type]||t.type}))})}return e}).then(i,a)}}function GM(e){if(!(typeof e==`object`&&e.RTCPeerConnection&&e.RTCRtpSender)||e.RTCRtpSender&&`getStats`in e.RTCRtpSender.prototype)return;let t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){let e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e});let n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){let e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function KM(e){if(!(typeof e==`object`&&e.RTCPeerConnection&&e.RTCRtpSender)||e.RTCRtpSender&&`getStats`in e.RTCRtpReceiver.prototype)return;let t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){let e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e}),vM(e,`track`,e=>(e.receiver._pc=e.srcElement,e)),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function qM(e){!e.RTCPeerConnection||`removeStream`in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){SM(`removeStream`,`removeTrack`),this.getSenders().forEach(t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)})})}function JM(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function YM(e){if(!(typeof e==`object`&&e.RTCPeerConnection))return;let t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let e=arguments[1]&&arguments[1].sendEncodings;e===void 0&&(e=[]),e=[...e];let n=e.length>0;n&&e.forEach(e=>{if(`rid`in e&&!/^[a-z0-9]{0,16}$/i.test(e.rid))throw TypeError(`Invalid RID value provided.`);if(`scaleResolutionDownBy`in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw RangeError(`scale_resolution_down_by must be >= 1.0`);if(`maxFramerate`in e&&!(parseFloat(e.maxFramerate)>=0))throw RangeError(`max_framerate must be >= 0.0`)});let r=t.apply(this,arguments);if(n){let{sender:t}=r,n=t.getParameters();(!(`encodings`in n)||n.encodings.length===1&&Object.keys(n.encodings[0]).length===0)&&(n.encodings=e,t.sendEncodings=e,this.setParametersPromises.push(t.setParameters(n).then(()=>{delete t.sendEncodings}).catch(()=>{delete t.sendEncodings})))}return r})}function XM(e){if(!(typeof e==`object`&&e.RTCRtpSender))return;let t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){let e=t.apply(this,arguments);return`encodings`in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}function ZM(e){if(!(typeof e==`object`&&e.RTCPeerConnection))return;let t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>t.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):t.apply(this,arguments)}}function QM(e){if(!(typeof e==`object`&&e.RTCPeerConnection))return;let t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>t.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):t.apply(this,arguments)}}var $M=f({shimAudioContext:()=>cN,shimCallbacksAPI:()=>nN,shimConstraints:()=>iN,shimCreateOfferLegacy:()=>sN,shimGetUserMedia:()=>rN,shimLocalStreamsAPI:()=>eN,shimRTCIceServerUrls:()=>aN,shimRemoteStreamsAPI:()=>tN,shimTrackEventTransceiver:()=>oN});function eN(e){if(!(typeof e!=`object`||!e.RTCPeerConnection)){if(`getLocalStreams`in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||=[],this._localStreams}),!(`addStream`in e.RTCPeerConnection.prototype)){let t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||=[],this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach(n=>t.call(this,n,e)),e.getVideoTracks().forEach(n=>t.call(this,n,e))},e.RTCPeerConnection.prototype.addTrack=function(e,...n){return n&&n.forEach(e=>{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]}),t.apply(this,arguments)}}`removeStream`in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||=[];let t=this._localStreams.indexOf(e);if(t===-1)return;this._localStreams.splice(t,1);let n=e.getTracks();this.getSenders().forEach(e=>{n.includes(e.track)&&this.removeTrack(e)})})}}function tN(e){if(!(typeof e!=`object`||!e.RTCPeerConnection)&&(`getRemoteStreams`in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!(`onaddstream`in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener(`addstream`,this._onaddstream),this.removeEventListener(`track`,this._onaddstreampoly)),this.addEventListener(`addstream`,this._onaddstream=e),this.addEventListener(`track`,this._onaddstreampoly=e=>{e.streams.forEach(e=>{if(this._remoteStreams||=[],this._remoteStreams.includes(e))return;this._remoteStreams.push(e);let t=new Event(`addstream`);t.stream=e,this.dispatchEvent(t)})})}});let t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){let e=this;return this._onaddstreampoly||this.addEventListener(`track`,this._onaddstreampoly=function(t){t.streams.forEach(t=>{if(e._remoteStreams||=[],e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);let n=new Event(`addstream`);n.stream=t,e.dispatchEvent(n)})}),t.apply(e,arguments)}}}function nN(e){if(typeof e!=`object`||!e.RTCPeerConnection)return;let t=e.RTCPeerConnection.prototype,n=t.createOffer,r=t.createAnswer,i=t.setLocalDescription,a=t.setRemoteDescription,o=t.addIceCandidate;t.createOffer=function(e,t){let r=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[r]);return t?(i.then(e,t),Promise.resolve()):i},t.createAnswer=function(e,t){let n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return t?(i.then(e,t),Promise.resolve()):i};let s=function(e,t,n){let r=i.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r};t.setLocalDescription=s,s=function(e,t,n){let r=a.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.setRemoteDescription=s,s=function(e,t,n){let r=o.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.addIceCandidate=s}function rN(e){let t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){let e=t.mediaDevices,n=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>n(iN(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,r){t.mediaDevices.getUserMedia(e).then(n,r)}.bind(t))}function iN(e){return e&&e.video!==void 0?Object.assign({},e,{video:TM(e.video)}):e}function aN(e){if(!e.RTCPeerConnection)return;let t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){let t=[];for(let n=0;n<e.iceServers.length;n++){let r=e.iceServers[n];r.urls===void 0&&r.url?(SM(`RTCIceServer.url`,`RTCIceServer.urls`),r=JSON.parse(JSON.stringify(r)),r.urls=r.url,delete r.url,t.push(r)):t.push(e.iceServers[n])}e.iceServers=t}return new t(e,n)},e.RTCPeerConnection.prototype=t.prototype,`generateCertificate`in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get(){return t.generateCertificate}})}function oN(e){typeof e==`object`&&e.RTCTrackEvent&&`receiver`in e.RTCTrackEvent.prototype&&!(`transceiver`in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function sN(e){let t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){e.offerToReceiveAudio!==void 0&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);let t=this.getTransceivers().find(e=>e.receiver.track.kind===`audio`);e.offerToReceiveAudio===!1&&t?t.direction===`sendrecv`?t.setDirection?t.setDirection(`sendonly`):t.direction=`sendonly`:t.direction===`recvonly`&&(t.setDirection?t.setDirection(`inactive`):t.direction=`inactive`):e.offerToReceiveAudio===!0&&!t&&this.addTransceiver(`audio`,{direction:`recvonly`}),e.offerToReceiveVideo!==void 0&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);let n=this.getTransceivers().find(e=>e.receiver.track.kind===`video`);e.offerToReceiveVideo===!1&&n?n.direction===`sendrecv`?n.setDirection?n.setDirection(`sendonly`):n.direction=`sendonly`:n.direction===`recvonly`&&(n.setDirection?n.setDirection(`inactive`):n.direction=`inactive`):e.offerToReceiveVideo===!0&&!n&&this.addTransceiver(`video`,{direction:`recvonly`})}return t.apply(this,arguments)}}function cN(e){typeof e!=`object`||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var lN=d(((e,t)=>{var n={};n.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},n.localCName=n.generateIdentifier(),n.splitLines=function(e){return e.trim().split(`
|
|
139
|
+
`).map(e=>e.trim())},n.splitSections=function(e){return e.split(`
|
|
140
|
+
m=`).map((e,t)=>(t>0?`m=`+e:e).trim()+`\r
|
|
141
|
+
`)},n.getDescription=function(e){let t=n.splitSections(e);return t&&t[0]},n.getMediaSections=function(e){let t=n.splitSections(e);return t.shift(),t},n.matchPrefix=function(e,t){return n.splitLines(e).filter(e=>e.indexOf(t)===0)},n.parseCandidate=function(e){let t;t=e.indexOf(`a=candidate:`)===0?e.substring(12).split(` `):e.substring(10).split(` `);let n={foundation:t[0],component:{1:`rtp`,2:`rtcp`}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]};for(let e=8;e<t.length;e+=2)switch(t[e]){case`raddr`:n.relatedAddress=t[e+1];break;case`rport`:n.relatedPort=parseInt(t[e+1],10);break;case`tcptype`:n.tcpType=t[e+1];break;case`ufrag`:n.ufrag=t[e+1],n.usernameFragment=t[e+1];break;default:n[t[e]]===void 0&&(n[t[e]]=t[e+1]);break}return n},n.writeCandidate=function(e){let t=[];t.push(e.foundation);let n=e.component;n===`rtp`?t.push(1):n===`rtcp`?t.push(2):t.push(n),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);let r=e.type;return t.push(`typ`),t.push(r),r!==`host`&&e.relatedAddress&&e.relatedPort!==void 0&&(t.push(`raddr`),t.push(e.relatedAddress),t.push(`rport`),t.push(e.relatedPort)),e.tcpType&&e.protocol.toLowerCase()===`tcp`&&(t.push(`tcptype`),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push(`ufrag`),t.push(e.usernameFragment||e.ufrag)),`candidate:`+t.join(` `)},n.parseIceOptions=function(e){return e.substring(14).split(` `)},n.parseRtpMap=function(e){let t=e.substring(9).split(` `),n={payloadType:parseInt(t.shift(),10)};return t=t[0].split(`/`),n.name=t[0],n.clockRate=parseInt(t[1],10),n.channels=t.length===3?parseInt(t[2],10):1,n.numChannels=n.channels,n},n.writeRtpMap=function(e){let t=e.payloadType;e.preferredPayloadType!==void 0&&(t=e.preferredPayloadType);let n=e.channels||e.numChannels||1;return`a=rtpmap:`+t+` `+e.name+`/`+e.clockRate+(n===1?``:`/`+n)+`\r
|
|
142
|
+
`},n.parseExtmap=function(e){let t=e.substring(9).split(` `);return{id:parseInt(t[0],10),direction:t[0].indexOf(`/`)>0?t[0].split(`/`)[1]:`sendrecv`,uri:t[1],attributes:t.slice(2).join(` `)}},n.writeExtmap=function(e){return`a=extmap:`+(e.id||e.preferredId)+(e.direction&&e.direction!==`sendrecv`?`/`+e.direction:``)+` `+e.uri+(e.attributes?` `+e.attributes:``)+`\r
|
|
143
|
+
`},n.parseFmtp=function(e){let t={},n,r=e.substring(e.indexOf(` `)+1).split(`;`);for(let e=0;e<r.length;e++)n=r[e].trim().split(`=`),t[n[0].trim()]=n[1];return t},n.writeFmtp=function(e){let t=``,n=e.payloadType;if(e.preferredPayloadType!==void 0&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){let r=[];Object.keys(e.parameters).forEach(t=>{e.parameters[t]===void 0?r.push(t):r.push(t+`=`+e.parameters[t])}),t+=`a=fmtp:`+n+` `+r.join(`;`)+`\r
|
|
144
|
+
`}return t},n.parseRtcpFb=function(e){let t=e.substring(e.indexOf(` `)+1).split(` `);return{type:t.shift(),parameter:t.join(` `)}},n.writeRtcpFb=function(e){let t=``,n=e.payloadType;return e.preferredPayloadType!==void 0&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach(e=>{t+=`a=rtcp-fb:`+n+` `+e.type+(e.parameter&&e.parameter.length?` `+e.parameter:``)+`\r
|
|
145
|
+
`}),t},n.parseSsrcMedia=function(e){let t=e.indexOf(` `),n={ssrc:parseInt(e.substring(7,t),10)},r=e.indexOf(`:`,t);return r>-1?(n.attribute=e.substring(t+1,r),n.value=e.substring(r+1)):n.attribute=e.substring(t+1),n},n.parseSsrcGroup=function(e){let t=e.substring(13).split(` `);return{semantics:t.shift(),ssrcs:t.map(e=>parseInt(e,10))}},n.getMid=function(e){let t=n.matchPrefix(e,`a=mid:`)[0];if(t)return t.substring(6)},n.parseFingerprint=function(e){let t=e.substring(14).split(` `);return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},n.getDtlsParameters=function(e,t){return{role:`auto`,fingerprints:n.matchPrefix(e+t,`a=fingerprint:`).map(n.parseFingerprint)}},n.writeDtlsParameters=function(e,t){let n=`a=setup:`+t+`\r
|
|
146
|
+
`;return e.fingerprints.forEach(e=>{n+=`a=fingerprint:`+e.algorithm+` `+e.value+`\r
|
|
147
|
+
`}),n},n.parseCryptoLine=function(e){let t=e.substring(9).split(` `);return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},n.writeCryptoLine=function(e){return`a=crypto:`+e.tag+` `+e.cryptoSuite+` `+(typeof e.keyParams==`object`?n.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?` `+e.sessionParams.join(` `):``)+`\r
|
|
148
|
+
`},n.parseCryptoKeyParams=function(e){if(e.indexOf(`inline:`)!==0)return null;let t=e.substring(7).split(`|`);return{keyMethod:`inline`,keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(`:`)[0]:void 0,mkiLength:t[2]?t[2].split(`:`)[1]:void 0}},n.writeCryptoKeyParams=function(e){return e.keyMethod+`:`+e.keySalt+(e.lifeTime?`|`+e.lifeTime:``)+(e.mkiValue&&e.mkiLength?`|`+e.mkiValue+`:`+e.mkiLength:``)},n.getCryptoParameters=function(e,t){return n.matchPrefix(e+t,`a=crypto:`).map(n.parseCryptoLine)},n.getIceParameters=function(e,t){let r=n.matchPrefix(e+t,`a=ice-ufrag:`)[0],i=n.matchPrefix(e+t,`a=ice-pwd:`)[0];return r&&i?{usernameFragment:r.substring(12),password:i.substring(10)}:null},n.writeIceParameters=function(e){let t=`a=ice-ufrag:`+e.usernameFragment+`\r
|
|
149
|
+
a=ice-pwd:`+e.password+`\r
|
|
150
|
+
`;return e.iceLite&&(t+=`a=ice-lite\r
|
|
151
|
+
`),t},n.parseRtpParameters=function(e){let t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},r=n.splitLines(e)[0].split(` `);t.profile=r[2];for(let i=3;i<r.length;i++){let a=r[i],o=n.matchPrefix(e,`a=rtpmap:`+a+` `)[0];if(o){let r=n.parseRtpMap(o),i=n.matchPrefix(e,`a=fmtp:`+a+` `);switch(r.parameters=i.length?n.parseFmtp(i[0]):{},r.rtcpFeedback=n.matchPrefix(e,`a=rtcp-fb:`+a+` `).map(n.parseRtcpFb),t.codecs.push(r),r.name.toUpperCase()){case`RED`:case`ULPFEC`:t.fecMechanisms.push(r.name.toUpperCase());break;default:break}}}n.matchPrefix(e,`a=extmap:`).forEach(e=>{t.headerExtensions.push(n.parseExtmap(e))});let i=n.matchPrefix(e,`a=rtcp-fb:* `).map(n.parseRtcpFb);return t.codecs.forEach(e=>{i.forEach(t=>{e.rtcpFeedback.find(e=>e.type===t.type&&e.parameter===t.parameter)||e.rtcpFeedback.push(t)})}),t},n.writeRtpDescription=function(e,t){let r=``;r+=`m=`+e+` `,r+=t.codecs.length>0?`9`:`0`,r+=` `+(t.profile||`UDP/TLS/RTP/SAVPF`)+` `,r+=t.codecs.map(e=>e.preferredPayloadType===void 0?e.payloadType:e.preferredPayloadType).join(` `)+`\r
|
|
152
|
+
`,r+=`c=IN IP4 0.0.0.0\r
|
|
153
|
+
`,r+=`a=rtcp:9 IN IP4 0.0.0.0\r
|
|
154
|
+
`,t.codecs.forEach(e=>{r+=n.writeRtpMap(e),r+=n.writeFmtp(e),r+=n.writeRtcpFb(e)});let i=0;return t.codecs.forEach(e=>{e.maxptime>i&&(i=e.maxptime)}),i>0&&(r+=`a=maxptime:`+i+`\r
|
|
155
|
+
`),t.headerExtensions&&t.headerExtensions.forEach(e=>{r+=n.writeExtmap(e)}),r},n.parseRtpEncodingParameters=function(e){let t=[],r=n.parseRtpParameters(e),i=r.fecMechanisms.indexOf(`RED`)!==-1,a=r.fecMechanisms.indexOf(`ULPFEC`)!==-1,o=n.matchPrefix(e,`a=ssrc:`).map(e=>n.parseSsrcMedia(e)).filter(e=>e.attribute===`cname`),s=o.length>0&&o[0].ssrc,c,l=n.matchPrefix(e,`a=ssrc-group:FID`).map(e=>e.substring(17).split(` `).map(e=>parseInt(e,10)));l.length>0&&l[0].length>1&&l[0][0]===s&&(c=l[0][1]),r.codecs.forEach(e=>{if(e.name.toUpperCase()===`RTX`&&e.parameters.apt){let n={ssrc:s,codecPayloadType:parseInt(e.parameters.apt,10)};s&&c&&(n.rtx={ssrc:c}),t.push(n),i&&(n=JSON.parse(JSON.stringify(n)),n.fec={ssrc:s,mechanism:a?`red+ulpfec`:`red`},t.push(n))}}),t.length===0&&s&&t.push({ssrc:s});let u=n.matchPrefix(e,`b=`);return u.length&&(u=u[0].indexOf(`b=TIAS:`)===0?parseInt(u[0].substring(7),10):u[0].indexOf(`b=AS:`)===0?parseInt(u[0].substring(5),10)*1e3*.95-2e3*8:void 0,t.forEach(e=>{e.maxBitrate=u})),t},n.parseRtcpParameters=function(e){let t={},r=n.matchPrefix(e,`a=ssrc:`).map(e=>n.parseSsrcMedia(e)).filter(e=>e.attribute===`cname`)[0];r&&(t.cname=r.value,t.ssrc=r.ssrc);let i=n.matchPrefix(e,`a=rtcp-rsize`);return t.reducedSize=i.length>0,t.compound=i.length===0,t.mux=n.matchPrefix(e,`a=rtcp-mux`).length>0,t},n.writeRtcpParameters=function(e){let t=``;return e.reducedSize&&(t+=`a=rtcp-rsize\r
|
|
156
|
+
`),e.mux&&(t+=`a=rtcp-mux\r
|
|
157
|
+
`),e.ssrc!==void 0&&e.cname&&(t+=`a=ssrc:`+e.ssrc+` cname:`+e.cname+`\r
|
|
158
|
+
`),t},n.parseMsid=function(e){let t,r=n.matchPrefix(e,`a=msid:`);if(r.length===1)return t=r[0].substring(7).split(` `),{stream:t[0],track:t[1]};let i=n.matchPrefix(e,`a=ssrc:`).map(e=>n.parseSsrcMedia(e)).filter(e=>e.attribute===`msid`);if(i.length>0)return t=i[0].value.split(` `),{stream:t[0],track:t[1]}},n.parseSctpDescription=function(e){let t=n.parseMLine(e),r=n.matchPrefix(e,`a=max-message-size:`),i;r.length>0&&(i=parseInt(r[0].substring(19),10)),isNaN(i)&&(i=65536);let a=n.matchPrefix(e,`a=sctp-port:`);if(a.length>0)return{port:parseInt(a[0].substring(12),10),protocol:t.fmt,maxMessageSize:i};let o=n.matchPrefix(e,`a=sctpmap:`);if(o.length>0){let e=o[0].substring(10).split(` `);return{port:parseInt(e[0],10),protocol:e[1],maxMessageSize:i}}},n.writeSctpDescription=function(e,t){let n=[];return n=e.protocol===`DTLS/SCTP`?[`m=`+e.kind+` 9 `+e.protocol+` `+t.port+`\r
|
|
159
|
+
`,`c=IN IP4 0.0.0.0\r
|
|
160
|
+
`,`a=sctpmap:`+t.port+` `+t.protocol+` 65535\r
|
|
161
|
+
`]:[`m=`+e.kind+` 9 `+e.protocol+` `+t.protocol+`\r
|
|
162
|
+
`,`c=IN IP4 0.0.0.0\r
|
|
163
|
+
`,`a=sctp-port:`+t.port+`\r
|
|
164
|
+
`],t.maxMessageSize!==void 0&&n.push(`a=max-message-size:`+t.maxMessageSize+`\r
|
|
165
|
+
`),n.join(``)},n.generateSessionId=function(){return Math.random().toString().substr(2,22)},n.writeSessionBoilerplate=function(e,t,r){let i,a=t===void 0?2:t;return i=e||n.generateSessionId(),`v=0\r
|
|
166
|
+
o=`+(r||`thisisadapterortc`)+` `+i+` `+a+` IN IP4 127.0.0.1\r
|
|
167
|
+
s=-\r
|
|
168
|
+
t=0 0\r
|
|
169
|
+
`},n.getDirection=function(e,t){let r=n.splitLines(e);for(let e=0;e<r.length;e++)switch(r[e]){case`a=sendrecv`:case`a=sendonly`:case`a=recvonly`:case`a=inactive`:return r[e].substring(2);default:}return t?n.getDirection(t):`sendrecv`},n.getKind=function(e){return n.splitLines(e)[0].split(` `)[0].substring(2)},n.isRejected=function(e){return e.split(` `,2)[1]===`0`},n.parseMLine=function(e){let t=n.splitLines(e)[0].substring(2).split(` `);return{kind:t[0],port:parseInt(t[1],10),protocol:t[2],fmt:t.slice(3).join(` `)}},n.parseOLine=function(e){let t=n.matchPrefix(e,`o=`)[0].substring(2).split(` `);return{username:t[0],sessionId:t[1],sessionVersion:parseInt(t[2],10),netType:t[3],addressType:t[4],address:t[5]}},n.isValidSDP=function(e){if(typeof e!=`string`||e.length===0)return!1;let t=n.splitLines(e);for(let e=0;e<t.length;e++)if(t[e].length<2||t[e].charAt(1)!==`=`)return!1;return!0},typeof t==`object`&&(t.exports=n)})),uN=f({removeExtmapAllowMixed:()=>_N,shimAddIceCandidateNullOrEmpty:()=>vN,shimConnectionState:()=>gN,shimMaxMessageSize:()=>mN,shimParameterlessSetLocalDescription:()=>yN,shimRTCIceCandidate:()=>fN,shimRTCIceCandidateRelayProtocol:()=>pN,shimSendThrowTypeError:()=>hN}),dN=m(lN());function fN(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&`foundation`in e.RTCIceCandidate.prototype)return;let t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if(typeof e==`object`&&e.candidate&&e.candidate.indexOf(`a=`)===0&&(e=JSON.parse(JSON.stringify(e)),e.candidate=e.candidate.substring(2)),e.candidate&&e.candidate.length){let n=new t(e),r=dN.default.parseCandidate(e.candidate);for(let e in r)e in n||Object.defineProperty(n,e,{value:r[e]});return n.toJSON=function(){return{candidate:n.candidate,sdpMid:n.sdpMid,sdpMLineIndex:n.sdpMLineIndex,usernameFragment:n.usernameFragment}},n}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,vM(e,`icecandidate`,t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:`false`}),t))}function pN(e){!e.RTCIceCandidate||e.RTCIceCandidate&&`relayProtocol`in e.RTCIceCandidate.prototype||vM(e,`icecandidate`,e=>{if(e.candidate){let t=dN.default.parseCandidate(e.candidate.candidate);t.type===`relay`&&(e.candidate.relayProtocol={0:`tls`,1:`tcp`,2:`udp`}[t.priority>>24])}return e})}function mN(e,t){if(!e.RTCPeerConnection)return;`sctp`in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return this._sctp===void 0?null:this._sctp}});let n=function(e){if(!e||!e.sdp)return!1;let t=dN.default.splitSections(e.sdp);return t.shift(),t.some(e=>{let t=dN.default.parseMLine(e);return t&&t.kind===`application`&&t.protocol.indexOf(`SCTP`)!==-1})},r=function(e){let t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(t===null||t.length<2)return-1;let n=parseInt(t[1],10);return n===n?n:-1},i=function(e){let n=65536;return t.browser===`firefox`&&(n=t.version<57?e===-1?16384:2147483637:t.version<60?t.version===57?65535:65536:2147483637),n},a=function(e,n){let r=65536;t.browser===`firefox`&&t.version===57&&(r=65535);let i=dN.default.matchPrefix(e.sdp,`a=max-message-size:`);return i.length>0?r=parseInt(i[0].substring(19),10):t.browser===`firefox`&&n!==-1&&(r=2147483637),r},o=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,t.browser===`chrome`&&t.version>=76){let{sdpSemantics:e}=this.getConfiguration();e===`plan-b`&&Object.defineProperty(this,"sctp",{get(){return this._sctp===void 0?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){let e=r(arguments[0]),t=i(e),n=a(arguments[0],e),o;o=t===0&&n===0?1/0:t===0||n===0?Math.max(t,n):Math.min(t,n);let s={};Object.defineProperty(s,"maxMessageSize",{get(){return o}}),this._sctp=s}return o.apply(this,arguments)}}function hN(e,t){if(!(e.RTCPeerConnection&&`createDataChannel`in e.RTCPeerConnection.prototype)||t.browser===`chrome`&&t.version>149||t.browser===`firefox`&&t.version>60)return;function n(e,t){let n=e.send;e.send=function(){let r=arguments[0],i=r.length||r.size||r.byteLength;if(e.readyState===`open`&&t.sctp&&i>t.sctp.maxMessageSize)throw TypeError(`Message too large (can send a maximum of `+t.sctp.maxMessageSize+` bytes)`);return n.apply(e,arguments)}}let r=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){let e=r.apply(this,arguments);return n(e,this),e},vM(e,`datachannel`,e=>(n(e.channel,e.target),e))}function gN(e){if(!e.RTCPeerConnection||`connectionState`in e.RTCPeerConnection.prototype)return;let t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:`connected`,checking:`connecting`}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(e){this._onconnectionstatechange&&(this.removeEventListener(`connectionstatechange`,this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener(`connectionstatechange`,this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),[`setLocalDescription`,`setRemoteDescription`].forEach(e=>{let n=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=e=>{let t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;let n=new Event(`connectionstatechange`,e);t.dispatchEvent(n)}return e},this.addEventListener(`iceconnectionstatechange`,this._connectionstatechangepoly)),n.apply(this,arguments)}})}function _N(e,t){if(!e.RTCPeerConnection||t.browser===`chrome`&&t.version>=71||t.browser===`safari`&&t._safariVersion>=13.1)return;let n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&t.sdp.indexOf(`
|
|
170
|
+
a=extmap-allow-mixed`)!==-1){let n=t.sdp.split(`
|
|
171
|
+
`).filter(e=>e.trim()!==`a=extmap-allow-mixed`).join(`
|
|
172
|
+
`);e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:n}):t.sdp=n}return n.apply(this,arguments)}}function vN(e,t){if(!(e.RTCPeerConnection&&e.RTCPeerConnection.prototype))return;let n=e.RTCPeerConnection.prototype.addIceCandidate;!n||n.length===0||(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?(t.browser===`chrome`&&t.version<78||t.browser===`firefox`&&t.version<68||t.browser===`safari`)&&arguments[0]&&arguments[0].candidate===``?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function yN(e,t){if(!(e.RTCPeerConnection&&e.RTCPeerConnection.prototype))return;let n=e.RTCPeerConnection.prototype.setLocalDescription;!n||n.length===0||(e.RTCPeerConnection.prototype.setLocalDescription=function(){let e=arguments[0]||{};if(typeof e!=`object`||e.type&&e.sdp)return n.apply(this,arguments);if(e={type:e.type,sdp:e.sdp},!e.type)switch(this.signalingState){case`stable`:case`have-local-offer`:case`have-remote-pranswer`:e.type=`offer`;break;default:e.type=`answer`;break}return e.sdp||e.type!==`offer`&&e.type!==`answer`?n.apply(this,[e]):(e.type===`offer`?this.createOffer:this.createAnswer).apply(this).then(e=>n.apply(this,[e]))})}function bN({window:e}={},t={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){let n=xM,r=CM(e),i={browserDetails:r,commonShim:uN,extractVersion:_M,disableLog:yM,disableWarnings:bM,sdp:dN};switch(r.browser){case`chrome`:if(!AM||!LM||!t.shimChrome)return n(`Chrome shim is not included in this adapter release.`),i;if(r.version===null)return n(`Chrome shim can not determine version, not shimming.`),i;n(`adapter.js shimming chrome.`),i.browserShim=AM,vN(e,r),yN(e,r),kM(e,r),jM(e,r),LM(e,r),MM(e,r),IM(e,r),NM(e,r),PM(e,r),RM(e,r),fN(e,r),pN(e,r),gN(e,r),mN(e,r),hN(e,r),_N(e,r);break;case`firefox`:if(!VM||!UM||!t.shimFirefox)return n(`Firefox shim is not included in this adapter release.`),i;n(`adapter.js shimming firefox.`),i.browserShim=VM,vN(e,r),yN(e,r),zM(e,r),UM(e,r),WM(e,r),HM(e,r),qM(e,r),GM(e,r),KM(e,r),JM(e,r),YM(e,r),XM(e,r),ZM(e,r),QM(e,r),fN(e,r),gN(e,r),mN(e,r),hN(e,r);break;case`safari`:if(!$M||!t.shimSafari)return n(`Safari shim is not included in this adapter release.`),i;n(`adapter.js shimming safari.`),i.browserShim=$M,vN(e,r),yN(e,r),aN(e,r),sN(e,r),nN(e,r),eN(e,r),tN(e,r),oN(e,r),rN(e,r),cN(e,r),fN(e,r),pN(e,r),mN(e,r),hN(e,r),_N(e,r);break;default:n(`Unsupported browser!`);break}return i}bN({window:typeof window>`u`?void 0:window}),typeof window<`u`&&`BarcodeDetector`in window;var xN=3e3,SN=500;function CN(e={}){let{startTimeoutMs:t=xN,settleDelayMs:n=SN}=e,r=(0,h.useRef)(Promise.resolve({type:`stop`,data:{}})),i=(0,h.useRef)(null),a=(0,h.useRef)(null),[o,s]=(0,h.useState)({}),[c,l]=(0,h.useState)({}),u=(0,h.useCallback)(async(e,r)=>{if(!window.isSecureContext)throw Error(`camera access is only permitted in secure context. Use HTTPS or localhost rather than HTTP.`);if(navigator?.mediaDevices?.getUserMedia===void 0)throw Error(`this browser has no Stream API support`);let o=await navigator.mediaDevices.getUserMedia({audio:!1,video:r});e.srcObject=o;let c;try{await Promise.race([e.play(),new Promise((e,n)=>{c=setTimeout(()=>n(Error(`Loading camera stream timed out after ${t} ms.`)),t)})])}finally{c!==void 0&&clearTimeout(c)}n>0&&await new Promise(e=>setTimeout(e,n));let[u]=o.getVideoTracks();return l(u.getSettings()),s(u.getCapabilities?.()??{}),i.current=o,a.current=u,{type:`start`,data:{videoEl:e,stream:o,constraints:r}}},[t,n]),d=(0,h.useCallback)(async(e,t)=>{e.srcObject=null,e.removeAttribute(`src`),e.load();for(let e of t.getTracks())t.removeTrack(e),e.stop();return i.current=null,a.current=null,l({}),{type:`stop`,data:{}}},[]),f=(0,h.useCallback)(async(e,{constraints:t,restart:n=!1})=>{let i=null;r.current=r.current.then(r=>{if(r.type===`start`){let{data:{videoEl:i,stream:a,constraints:o}}=r;return!n&&e===i&&t===o?r:d(i,a).then(()=>u(e,t))}return u(e,t)}).catch(e=>(i=e,{type:`stop`,data:{}}));let a=await r.current;if(i)throw i;if(a.type===`stop`)throw Error(`Something went wrong with the camera task queue (start task).`)},[u,d]),p=(0,h.useCallback)(async()=>{if(r.current=r.current.then(e=>{if(e.type===`stop`)return e;let{data:{videoEl:t,stream:n}}=e;return d(t,n)}),(await r.current).type===`start`)throw Error(`Something went wrong with the camera task queue (stop task).`)},[d]),m=(0,h.useCallback)(async e=>{let t=null;if(r.current=r.current.then(async n=>{let r=a.current;if(!r||n.type!==`start`)return t=Error(`No active video track found.`),n;try{e.advanced?.[0]?.zoom&&r.getCapabilities().torch&&(await r.applyConstraints({advanced:[{torch:!1}]}),l(r.getSettings())),await r.applyConstraints(e),s(r.getCapabilities()),l(r.getSettings())}catch(e){t=e}return n}),await r.current,t)throw t},[]),g=(0,h.useCallback)(async()=>{try{await r.current}catch{}},[]);return(0,h.useEffect)(()=>()=>{p()},[p]),{capabilities:o,settings:c,startCamera:f,stopCamera:p,updateConstraints:m,flush:g,getStream:()=>i.current}}var wN=`data:audio/mp3;base64,//PkZAAhghE0AKToAJra/n0FQygAAAGIkYJgmCYXBMAAGCTJz3zhCEM//z//1hz//8MMMMN08ssV6e5DDWIQreAgCvFKy8bXgIKMkUDDBgzJwIBtkRMQAocxIFdxghQGKDoEziAzQxOBOdH92i/iGi+zDCAEIX46a73HrSybZw1x3JZjXp7dSNy/P68rjcbt7p7fakMP5LVMyzCaj1pjvejYYAIDgDGzECjEAk1Jl3559HIon8hzlfPVTCvGJZzfcKSxXfyMWM88//9VKSxXdtnb9vomOuuRyiWVYbf+X8zp6fKGHIdycuWMMMMMMKSnp+6wsYc/9f/7z7rPPWHN556p6fP8MMMP///PPP/7+GHK9PT6p7f/unldP2np7YeHjweiYA4GLNAgAiI7u57n5//oc5/yfk6znOcPhwOBwggHCMpA4HA4KEyHOc5znO+hPIc5//+fqJh8XQPh90JU5xQinOf//87/zvP+ggAYuhCKHxdA+Hxd0EA4KKHA4ciB3kOXfXB/gmf8p/B96lAMKAgAADU+BujARHgwdisgHMfAUHAiceBg4ASBgZBiBIBH4ZaHOJsLhf8R+HYEciIgYSwj/+Bi7EqBh+AcBn5P6Bh4TuBmrAMBiZH7gaLEWgew//PkZFMlyek60MpYAShzqqZhm6gCUWeEUWAewEWYGN4X4GDEPwGE8S4GDoOIGAYKgIQOkz//gGARAUB+CwGxTwMAACAEgyAwdAlAxKhzAxXiZ///AxcEwAwJjDAziCAAwQgdAwRgdAsJQDAmAcGzYDwAhZIAKAcIQB4GT9TQMJ9/4Gi1Fv/AcAYUqKBAwGgNAwVBAAwGhwAwdBlAxFg1AwlgzAwNBuAkJQDBgEEDEqGECgChFgBgL//CIswYYH//+HKCpk4K0C9AaKKCAOBeMcR4X9C44BwABCgGAsGYCgTwHAcAwXAiAwSAQV///CJP9lwMBQAwAAAWGo5lVLCcaeneVhJAVGai3//ioaUEf//gaTAYGCj8BnEwfrIqDcsIQb/vmhU/8fAs0G8YGGwKST8Igj4GCATipksVzY8p//90FWJwh45AkX//4fCF9wMEgkL3uQc+gbGJ8t4MBAMBP/hEXf9FRuWBcAfIFjYzQdoLCBwh7IWVlxaX/w8oMCP/+EQT5poGB1Ir90DhiV6af/jFYBpT2BgoQyyt2M0ToBdEaZyzt8nTo3xdNDCTSd//o6F06CjooxRr4jVF/0bOKD6OMUNDRxiMUVFR0FFQPhGXRjDpr4MAEA4wIQUhYOIw//PkZE4nrg08sOx4ACQ0CopD2aAAlwTTBxQeMcwd8w8gZTAgABXwGABOkzpI0wAQAExnWfP4x8ZjKunWdZ1o1Qe6lFGKCNULORQCELAAPnRUf/GIx/0FHGfo3SdZ0qP2cukXKLlRtBKFgAQwCkwJgFRYBEEATmDsLSY2QiQYCEnEra+UZo6F1aKMRr6GhoaP/+j//ov+i+hjLqBgMkYoqChoo1GqCjoY06TpRqjjLOYzRRmMuizmgdKhdF8kjTAAAPMCwGswzglgwAJfzqxmioKH/////////////+ijLOAwFmN0f/////////Q///8ZjP/9DGYyFwIDBeB3MA4AlBWidKM5spykAUAQOCakK+udGqN8VDYjTRuN//0bVX//6Kio4xQFv//nf//kKOoAEIB6SY6hcxenp85///4/DEPf/84Xvl4vF4dwtxfEJgCYQHMSgKCROp4+fn////L4tQf0unz89OecLxeL0ul09y6enzp4dIhKAQFA5hKfLu1nU7/Wr71rRKJUBQSUVt////l08GUPVWgAAYAeNKsxbQNAAhQx3/oKGMM6dZ1Yy6sajMbfKio7lNcv0sScZ47lNcw32ekVFMP9fp/f+mklI6at6u/dBMQuW6y+C5BcgwAA//PkZEomGg1HYGe0riWsCqbEwiY0BJFJMxrCcxGgQ2VK8xxCF1wsABgQBBgQBAYAFCkYCgALkK4fJ00E5ctJN1Uxy5au3XoGcM4dSN0EYZwzhW0WCh1PZwzhnFFQxtnbO2d0Kt6CdXbruggkTEX5Rs4TEQUVsdVXaCcuWXIBQUGmwmgoAGcJiM4dSioHQdBnEY+hjcbov//jcb/43G43G/jCRibfxugdBnDqULO2duvQumztncbo4xGKKNxugooxGIxQULoOgFgUMTA/jbrxiMDmETL+eLhcPThzOeeOZfL5fIcBYuXD/OHv8t//LJFxjxQYHHKDGFkZMtlmKM0RgQfbVtxFIHbQBDRuzRguEI1c9XZ/rWmrZfVU3Oc/9utNNygRQkCoHlAYstNN6DJ1IINpoINppv+WG/+g2mmnUmmmpBAoJIJhnwB5xkymn606Df/t000xhU03UXC5Ol8uFyXy+Xy/l8v5w4cLk4XAvwAYUvl/QL5fTdlKZkEEEEGumaKaX00zIOemf6CH///ywI3LKpiQ2Ef4xYWMSDyI0XwzikpL0ajVHZ3j9DGIjeuXcNfjn96/S/TUz/X/vX////5K/r+v7Jn+LlAoGZOIQIwMKBQM/yppKYURmhGZkR2b//PkZE0mHg1HEG8wyiD7mlwAyDU8nJHi5htakZmZGNiRcpkJhBmUmZYQcM1VDEEBggNDV/ASEZRYKFZIhkXKLlKmk7IVTKmZNJ5KhiqVUqpX+k7+qlVKyV/ZIqZDFDWTJlFyi5TJpKhiXKBQyZzIS5JhBoayV/AQWVpGWkcYTV5O/rIVSv8/0nkr+v6/vyR/X9f1/ZN8kf5/n99/n+f5/lTKmf9/mRP8yFUqpWSv4yJUqpX9kj/MmZNJ5K/z/P9J5P/v6yFUz/CEoywgUMqZkz/FssECIsVq0aPRrRRatFFFykQZJ2Ukl///5KjmksOaA7ALROJLDnEsLbq3GTMVrwb/0dGzmM0DlfBlHQOmrdR0MYi92TX6b/cmDHLclyUVYO/4O8sFTKFTKFf8yhUyhUyhXzKlDKlCsr/+ZUoVlSsr/+ZQqZUoZUoceMfcoZUoZUoVlfOPGcmDHKcpynKg9yXJcr3JclyXJclyYO+DXJclyfgxFZVb3KcqD/g2MxzsY72L9LubPR0dCyf5K5NNd+Tv9GXRdV0XJclyfcl/n+k8kf6SX/iVynvXf///4Mg/1OkxguYzmM5jMcLHMxwwGhgNCwXMLAcwMXTLi1MD7w7tmTdBvMmE0xQFzCwHMDAd//PkZGMpigkmAGOUvCfTgcgAuC+ITswMFzC4oMLhYMByn0xvU+p9Tr0xUxf/0xv///1PBYDhgNTFTFTGTGTGTGTGTGTGTGC4GTFMDAcLAdMVMVMULAcMBpgYDhcDGFwsYXFBikLGFwMGA4MBxgcDKfTEMUoAx2BisD+mKp5Tv1OkxkxkxkxkxkxkxkxlO0xVPJi/6nv////U7CwHTFTFTGTGTGTGU+p71PpjJipihYDpipi/6n1Ov//C4GC4GTGTGTGTFU8WBSZdLhWB//yKlotyLZFiLf8tyyRUipFSKkVGRBZQMiWC3yx//wxUGKsSvDFQGHUAL3QMsHDFIYpCYy2Bmagy6BjLgy6Bh3od58DCLAizBgRb+EQiyEQiwGBFuDAi3/////20QqSBJf/qcumv/////wMZdGXAYMu1gYy6MuBEZdBgy4BjLgy6BjLgy6BjLgy6BjLQy6DBlz2cJDLgRGXAMZdGXAYMuhMZcCIy6sJGaoGMuppwNRl3WBjLgy63wiEWAwIt/+EQi0IhFsDCLAi0GBFkGBFgMJCqaqYAgAYIhBBvwf7kwcqRq7V3IctacvlN6NxqgooxRRuNRiijEZjMGRuMvz9FGozQ+1X2qe1T1S//+VhaWAtKwtML//PkZEIkbgcaAHc1xCJrjeAAtfuUAtLAWf///mWePH95ZFgsyssvM88+jzO6K+z7OM48sH+WDiweZx5YOK+zxWLGJWsa6xadAv02fTZLSpsFpvLSga0tMgWgUgWmwgUmyWl8tMgWWmLSoFJsoFlpSwsmyBg4HhEdgwHAYPBwGDgeBg8HwMHg4DB4PBgOAwcOwMHLwDn5lAwcDgiDgYDwMHA/4MB3//+EQeDAdwiDwYLPhEWQYLODBYERZBgt8Ii34GLBaB5pfAZ0FvEAQ/UfwxULlx+IXx+8f5CELH8fxKhAIDFoHBEDRc3////gwHgaRXgMHYMB2EU/gwZ/gYbw3gY3QbgYNgbgYiAbgwN3/+EQbBEG4MBuDAbAwG4RBtAwbg2////+B9B6F//////////hEdD//////////8DRahEQGCInMNg3LBElgNjDciCwG/lgNiwGxWG///mG4bf/+WA3Kw3KyIMNw2Kw3MNg3MNg3MNiIMiQ2OK0xMiA3KyJLAEZgRARmBEDEYFwBBgEgEeomowol5YAJKwCDAIAJ8sAE+gGBgCJYAQUZ/13LubMu5dyiYOAhKwEFGf9AOoz/g4CFAIol/lgAjysAgsAElYBP////lgJksBM//lgRUxF//PkZGApggsIAHt2wiNLoggAqCz8RFSwIqYioipkjEjHCCSN/+WJg5iYOYmPK5krmTmZk5mZ8sTJYmf8yJiNiIisi/ywRmRkZkZGZGRmRERkREZERGRERkREZERGxEf///hETIMEyBiZEyBiZEzwiJgDEwU4DV2gQGFOBgmP8GAiAwRAiBgIgYCIGAi/4MBHAwRgjAwRgjwMEQIgMcgY8DBGCMDBGCMDEyJn///+BiYQIBlObj4eYLIwsjAOBGFkYBoEQ84eULIw88LIA88PKHnw8sPKFkeHlANAiAaFUDAiMYPIHmDzBZBhZB///8GBOA1sH/Awni7AwnhPCITwYE/CKzBgt8Ig8GA4Ig6EQdww4Yb+F1sIgtwYCwGAsAwWAsBgLAYCwDBYCwDBaHUDF+VEDKgC2BgtBaDAWgYLQW////gYLAWQMFgLAMFoLcGAt////4RMABmBSj4NgwMOGHBsHhdcLrwbB4XXC6+F14YcLrww4Ng8MOGHBsHww4Ng8AUC4AoMQMC4fgw3wutV4QIsAgFYIBWCCVgHeVgHeWABCwAIVgH+YBwB5aRAstKgV6Ba1oMg9avtUVN/qdLWciD/cqD3Jg6DFPuTB/////lYAn//mC8C+YLwL5gvgvGC//PkZFEpLgMKYXt2xB5LogAArbdc+C8VgvlYL/mC8C+YLwL5YBfMNgNkwXixDWoHPMc4VUxVA2TBeDZPYXzXl815fK14sLxYXvK1//NeXzXl815fMtdDLSw3UsMtLCstMtLDLSwsFhWWlgt//8sFhW6f/////+WF7zXl8sL5ry+Vrxry+WF/wMLwX4MC+EQv/AwvBfAxsjYAyqpKA0lpLAwvBfBgXv///4RA2DANAYGgNgYGgNgYGwN+EQvf/BgXwYF//8DC+F4Dd6NgGBf4AgFwbB0MMF1wuuDYMBsGwusDYOBsHA2Dvg2DQuuDYOhdcMMF14YYDGYDEGwfhhgbB0MN///4RBaEQWgZByoYRWYMFvwiDsGwaF1gbB34GDwdC64XW/w1aKxDVgatir4YcLrQbBwNg7////////////+ESfgZPyff/////////4MFmBvvMAERZ8CC5adNj02E2S0qbCBSBZaYtN///oFlpU2QMXIFAYuQK9AtAo7IxLTpsIFJs/5aZRxQawaxGfIg9CsrI+PUqkWdOHp7ODsOl6cOHZ4dsulfLI9/8BAAgMBACsBLACVgBjoAWAE5OTM6WDAR0zodMdHCsJLASWAjzCQgsBJhASWAjysI8wkJMICU//PkZFkeqgcaYDd1th6DogAAqCuIxQwtDA5MdMULgyY6YqnXqdep5TpMdMVRNRL/UT9AN6jCiSjKAZRNRhAMomgFQDfCIJwYCQiCAiCMGAkGAgDBJUA3eVAMEgj////8SrDFIYqh5g8kPMHkDzB5OFkYeYPJ+HlDzB5+AYVQDibCyIPLLEZIsjIliWS0WywWyyWuWCyWJaLZbLJYDHgLAItFvy3///4eYPKBlQTh5QYEODBb//hhoNg7/C62DYPFUKwKsVgNWBq8VkVcVkVUVYrH//hGff/8Iz8GT7//////wiX4ML3gwvgwvf4ML3gZeqoHVGyBl4vgZfL2F1oNg4Lrg2DcLrg2DQw0Lrhh8Lr4YcMNBsGhdcGBcMOGGAFGAGMQsF1guuGG4XXV/4uQXOLmF1kL/8lCXkuSk4O8/FzHzuP0hIucf/CIFAMCgFPgYFAKAwCgGBQCgGHYO4GBVM4GgQI4RCMEQKQOtQjUI1CNcI14MqDKwDIAGQDzh5wsjDyw8uHmDzYeUPN+DEYRRhFEIowYgDQgIhWDApgwKAwKQYFAYFQMKkYDOxHAzsRgMKBUGBX/h5v+Hm4ecPNh5A8wBwjhZHhZAHlDzBZAFkAeQPKHnCyILIAsih5QsgDz//PkZLQgIgsMAFp1xCGLogAAA2rkB5w8oeYLIQ8kPMHkCyGHnAMKoGmAgFkUPMHmDYAtfHPHNkr/JYl8c8lCWHPHMkqSo5onMAkBDnfJX//8IgDBgBhEdAaxSQMHUGAEIgAV4risCcipBOMVRVBO////hEvAxsAwvf////8MPDDww4XWC64XXDDww4YcMPC6wYb/wYGgiGwMplMDYhTCIaCIaBga/////8GA+EQdgYPB4MB4GDwdhEH8Ig8Ig8GA6EQcEQf8DBxlBjoAweDuFwgCQXiL//iLiKCKCL4XCiKRFwEgoRT4iqpMQU1FMy4xMDCqqqqqqqr////xuDd8fv/DVwrArEIg6EQdhEHAYPBwMB+ERYBi0WAwWAZ0FoGLYOB+JfgZ0FoGdBaDBYbn+WHm9xW7/Nzzc83PLDzc8reWlA7S0oHamx//6BflpU2C0qbBaf/8yk/ysn+VkMhTKQrKVk8yE8rIVkKyYsAn/5WC+YICmCApWCGTkxtKMcVWlgFMEBTBAX////0C0C0C/////////LTFpvTZLTlpv/0Ci0xaYtOgWmymyWkAxcWmTZTYTY8tMmygUWmLTIFpsFpv9NnywLmLCx2RgWmQKTZ98UjnzZ1/++D4M6/////3//PkZOgjIg8IAFcbxCaTogAAoCuIzfJ8vfJ8Wcs5fBnD5//++L5f////////6nCKv//+o0o0FUYwqDNGCwgUMKC0VVGkVv//4Yf8LrxVCriqDVoasDVuKsNWw1bisBqwVkVkVX//gy/4YYMMGGhhgwwNg4LrhdcLrAYWGAA0zBsH4Ng3C6/////4MAoGBQIDAKBgUCAwCgYEAsDAoEAwKBAYBYMAoGBQIBgUCYGBQIBgUCwiBAYBYMAoRAgRAoGBBMBooCAYFAkIgTEUxFv/EWxFxFhFoi0LhQuFiLCL/EWqTEFNRTMuMTAwqqqq//////8TWJriV/hERAwRgYiEYGIhGBmIRgYiEYMEQMEcDMSiA1GYwMR+UDMTkA7KIgMRGIGGM0SIrRGjRlhEV4jxov8rR/5YRFhEdQSViCsR5iRJWIKxPlgQYgSViSsR5WJMQJLC78IiKERF4REeERGEREERHwMRGOBmIRhERhERAwRAYiEQGIhGBmIRAajkgG5TEEREDBHwYIwYI4REXCIV/4MCmDArgwKAYUO/gYVCkGBUGBTgYUCsGBUIhUDCoUCIVBgVBgVBgUhEKQMKhUDCoUBgVAwoFAYFcGBQDI6oA5+qQiFAMjBUGBXCyEPIFkOH//PkZPMj6gr6AFdVwifkBdwAoC2Ilh5/8PPh5Qsih5IeUA0TAZrE8PP////wMRiIIqID8piAxEIwMxCMDEQjCIj//BiIDRo8Iogii/4MKwYVhEoESkDEiIGJEgYlfBgmDBIMEAYgSBiBIREAwSERH/8I7wPfuCO4I7v/8GBvAw3Bv/////gwN34RBuBg2BuBg2BuBg2BuEQbhEG+EQbAwG4MBtwiDaDAbhEGwMBuDAbAwG4GDYG8DBsDcDBuNwDRWDcIg2AwbA34RBv///CINvCINgMRIN/////wiG4DDeG+TEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq/zB4OLAP8rBxWDisHlYOKxb5WLTFgsMWiw18LDOnjPxZoxadDOgsLAtLAbKymVhsrDZWG/LAb8w2GywGysNlgNFgNGFwuBQuWnTZLToFFpisLJsFp0Cy0voFAQLFZkMCAQwIBCsC/5WBCwBCwBCwBCsCeVgUwIBCwBDEwEMCAQrAhgUClgCFgTlgCGJgJ5gQTGJwKWAKYFApgQTGBQL5kY0HMjQYnAhWJvKwIWAIVgQrApYAhWBPBgECIEBgE/8IgXhECQiBAMCkcDEwEwMCAQGAQIhoIhsGBsIhvgwN//PkZN4irgr2AAOVqiUThegAnCtMgwNwiG/8IhuDA1hENhENgYbKYHb2IBhoNhENAwN////8IhsDKZS////8IhuBhspgc0KQRDWEQ3///CNf4GAIMDAwgAwAAwhAwAwYAIgwiHBgAMAYGAAGHv///CIBqBqESDEIgRYGoGHBiDEIgGoGgMAYgxgwgxCIETwYFYMCoMCuDApBgU8DCoU//gY3G//wYFOBhUKBEKQYFfBgV8IhSEQoBkYK8IhT/wMKhXBgUCIU4RCoRCvgYVCsDCp3A1SqAYFAiFP////gY3G1TEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVgwCAwCBEC///////8IgUIgWEQIBgUCAwTQMCAQDAoEhECAYFIwGaRMBotWAasdwH/KqBmhFgaKI4GRgKVpjCBTCBPMJHNMFMIFKwnlgJ5hUxhUwGWlpAMuMuWLTFpvQKQLQKLTIFJsoFIFFZb/8woQwoT///MIF8rC+WAphAphAppgpYClgsmwBC6bHoFFpUCi0wGXFguWCwFLgUsgX6BZaVNj0Ci03//+EQKEQKEQLCIFAxMBcDAgFAwIBQYBODAKBgUCAYEAuDAKBgUCAYFAgRAngwCgwCwiBIRAmE//PkZN4iogj2AFdVxiUrhewAhOkwQIBgQ0gbOI4GRhOBiYCgYEAv////CIFAyMBQYBf///CIF8IgUDAgFBgEAwIRwMCCcDEwFAwIBf///CIEQGMDGEXCKBpCIDCEQDCAsYInDFQMMAuYSoTQMVfBlf//+DKfBgAiGDAQMIMIgCIQYADAEGAgwP////8ItgNu2/8DAAAiABgHhECBgQGEQARA8GAeEQIMABECEQIMAwYBBgCDAARA4GAAgYACDAARAwiAgwDhED4RABEBCIGBgDoH2dgZwCBgAP//BhX/+DCiTEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqF1ww////////hdeGGDDBhwjeF102E2fTYAowMLjE0zTDfyyMYjEDJTwMLSwFi0/gQLoFIFpsegWmyBQsWlQL9ApNgtIWn8tMgX6BaBX+WmQL9Nn02f9NktIgUgWmwWl9Avy06bCBSbJaUtImyWkQKLTIFgYWoFFpAKFwMLzZgwAwvLTIFlpU2fQLQK///4Yf4YaF1sLrg2DAuuDYNDDQw4NgwLrhh4XXC64Ng3C60MNwbB4XWC64YcMODYPCJYDlMQBlwRLg2DOF1v/////PkZM0eKgz0AE+UuCnLFfAAk3Fsg2DAYX/ww//4YaGGDDhdbDDACFwMuXA2DADlygusDYOBsGhhv//wNU/CKQusF1oXX+F1wuuGGC6wXWDDBdbC6wXXhHv//4AHIFgC0BZAA4Ba4FkADwFsC3AtQAOcC0BYAtgAcAA9+BYAsgW4FvgWOABwC1oq+it4RT0VVG0VFGkVywo1/RWU4U59TlFb1GvRX////QK9Nj/9AtNn02fTY9NhNlAr/QK//TYTZLSJsIFemx///oF/5aZNj02U2C0yBaBfoFAS6bKBfoFVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVQiA8GAO/4RAf//////wYA4GAO+EQHAwB4GDoB4GA4HQRB0BhlDIBpEAcBgPDIBgPAeDAHIFAYuLTpspsJsFpi0haRApAtAstIYKClgF/ysF/ysE/ysF//LAJ6plTlYC1ZUypmqtWVK1VqyplSFgBaqqcwAAVIqcrEBAAKmMBERCQhwD5iICIQEyABMAABBVGXF4gIA4DLAAWAEQgLVSsBaq1ZUv+YKClgELAJ////5YBP//LAL5WC+Vgn+WAX/LT+gW//PkZMIhLgrsAFt1yiD7FiB6A9qwmwViybCbCbCBSBabCBSBabPpsegWmwWn9ApApApNgCGBmEwWlLSpsf////hEHgYOB3////4GDkiBxMHhEdgYOB4GDwcBg4HW23gooFYHd/+BnAz8O8Vv//FaBm4rBWh38es2zbAtD1m2PVBqBrBqBrAF7AF3/5el84MkuHTgyy+dL0dRnEajMIyOn8RsZ5HGG/kbIpHIkYUiD0y2WctlZaWSwrKx6FZbxnL54ul04eLhw9Ol84dl86cOHT3Ipb5Z8qKpVx6/j0EkLctVTEFNRTMuMTAwgWQLQAHgLf/////4Fn+EQESEcIgInCIRW9TkrCzH0YIjjWtI+YeCD0woLCBQwsKRWUaRVCBZFZRtRtFRTlTlThRtAr0C0C//02E2fTZQK/0Ck2f9TlFRTlTlFT/9TlFVFRFb/9ThThynIQbWkAREue5S11rKdlkDEVABh61ExYPU+tOD4MQgcn4iwigivxFRFoXDcRQLhoiwioXCeAkFBcNiL8RURQBIKEVEWiLBcKIqIpEXC4QReIoIpCIKAQMxFAFAsIuIr/4YYLr//ww4XWBgwC64XX/hhgw3hhwuv8MNhhguvhdcAUYgaYTAAoWDDg2DQbBg//PkZPYe6gzuADd1uDKsBhBAe89cYYdGjtDT2hDmlD2leaOv9oX0OX/0NNLplNf8ewakNWGrTfTRpphNJtfaeh7T1/tStdtTpqN532lpX/1/kmQ5eaf2hoaV9paGleJAvd0rer2pWu1ar2vk56vVrV5Hj1Nop+/lfv5Zpkem5kX/2vtata2rq783nbvtbW6VjW6a2rq13+rO6VysV58K7tbp0ru6Vrtqa1a67tr6sau1ulYrnfa2v927Vrt21NSuN5X927/D4diAQANh4gEIfxB+IQG/D/4gDw/iGIRD+HRATEFNRTMuMTAwqqqqqqqqqqqqqqqqqiIEK/ititFX///8VcVuK38VsVhXBOQTpq/qm8QCAcBmIxgdfFZCHECpxFBFAuFEUC4cLhsRTEVEUDVoDQD+KrFYirFX+KwKoVgVUVUVeKwGrhWRWBViqFYDV4rMViKyGroauBg/A0YThVgNAEVQqw1fisis4quKxxWYrAatxWIqoqg1dFYxVxWIrAavAaAArIrAqoqhWYrIqvxWMVYrARCADhcKoVYavDVgqhV4qorIrHFWKuKxFViscVUVYasAaAfFY/4YcMNhdfwuuGGC64YfDDA2DwusANygbBwAxhAECwNg8MOF1hD4//PkZOkc4g7yBjd1sDNkDhgqYwtcYoUyiQ0NCkxQ0NCQkSIbGKIyRGEo5mUaNEhGKEHMmaGhI0UokORvMmZmZSZSiMZQkRnKKZkzRoSNCQpQ0NEZoaNFJkhh3KOUJEhIcoSJCQkIzlDlEjMDMyMpQ0JCQzNCRGaNCRISEZoZihoaIwlEHKNGiMzFEjRmSIwlHMyZmcyiGyMxRyhIkIxRSZokSEYGBkiRojAPESNGjQxvKHMmMoSKTJCQkIwlFKLDYWGhoZhYWAAUGBsAwsMDYUAcK4XDPhQVwwLAH/DfgHC6TEFNRaqqBgjwYI//wYI/8GCL///+DBFhERgwRcIiPAzGYgMRKIDcskBgjAxEIwYI4GiRwNEjhFH4MRwYjA0aOEUf8Io/BiLgxGEUYRRQij/BiKDEYMR+DBGBiMRQiIgYIwiIwYIgiIgMRGIDUSjhEReEREBiIRAwR/wYI/8IiP4MEcGCIIiOERH8GCIIiMIiIIiODBHBgjBgjwiIoREcIiOEREDBFCKiAxHJcIiMGCMGCLwYI8IiPhERgwRAwRAYjEUIiIGCP/AxGIgiIsGCL//4REYMEXhERBERhExhExAzyAZiEWDBGERGeKsVsVRVFcVwTnFcVxVgnYqipFUV//PkZPkcfgzeAFaVxDgUBgAgatvIYrgnYqgnQJyK4riqK4rwTsVor4rQAjABAgnQritFSKoqQTsE5C1haxfF7F4XQtULSFqC1i4LwWkXIWkXRdF+LwqAnME4iqCdwToVuK+HAERWAkAlgJB0OB3Doc8OYc8VCsVgIB3DuHAERUAkAkHMOBwOAIisO4dwEAEAEg6AkAl4CeHA4AkKhXioBIOiv8OB3F+LgWkXxeF8XouxcF0XBeF8XBdF8XhdAdouC8AEsXYWsXOKsVBU/FaKmK/FTxXFbFUVPiv/8VfxXitVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVAXX/8MN/wwwYf//DDBh4Yf/+DYODDfCIFAwKBQiaANFgUDAgFAwIBcADwFuBY/At8C1wLfgAdAtwLGBawLcC3AsgWeBYwLX4XW8LrBhgiFgMlhYLrhh4XWhdb8MOGGhdcMP4YaF1gw8LrwuvhhoYYLrYXWDDBdcGwfC60MN/ww8GwZ4XXC64GZQsF1wbBnDD4XXg2DcLrBdaDYPhhgusF1uGGC64YfhhoNg0LrQwwYcMNC62F1/g2DYXW4XXC6+GH8DTIW4YeB/wR/wjwR+DP/y06bJaRAtAtAtAs//PkZNwY2grqBFW1xDhTRegABLBstL6BRaVAstN5aYtN/psIFf5aQtIgWgUWk8tImyWkQL9Avy0qbKbKbJaf02f/0CkCy05adAsC3K7+mx5aVAv0C/TZ8tOmymwB2pspsFpPLSlpy0qbCBSBXlpk2E2E2C0paUtP6Bfpslp0CkCy0ibJaZAosWQLLTJsemwgUmz6BZaYtOgUWmLTpsJsoFJslpPLT+mwmz//6Bfpsf6BSBSbCBXoFeWk9NhNhAr0Cy0/+WnTZ8tJ/oFf6bP+myWn//8tMmz/lpf//////8sPTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVBgJwiCYMBP//gwE//////wiCAMEgkIggIqIDKpUCIIgwE8IzA4j+EYhGAZMIyDJA5gGRhGcIyDIhEQiIGAgwIRDwiAGAAwYMHBghGAZMGRCMhGYRgGRA5gIyDIwZPBk/wZIRmEY/gyOBxIMgIzCMgcTgwRBgjwYJBgngwTwYJhEQBiBGERMIrwOouAxAgGCQYIhERhEQDBGDBAREgwTCIgGCQYJgwSDBHwiI4MEAwSBiRHCIkGCYGJEQiI/Bgn4REYREeBiBIH6XhERhETwogoy04mpZibFmJuWYmx8n//PkZN4ZrgrkAFZUyDcjofgAA9qc0HafZ8HwNrjaG3xtjaDtJwTo+D55Ow7fxNRNSyLPlqJsAr/lmA/FmWYm5acTQVgTkVQTnBOQTgVxVBOBVFWK4J3FUE7gBABOwToVQTsVhUFcVRXBOhUBORWiuKkVYrCqK+KoqgnQrAnEV+K8E7FQE5xWBOQToVQTsVRW8V4qRUFYVgTsVhXioKgrCqKwqAnYqCtBOhUioK+CcisK8VRUFSKnirFQVBVFcE6FcVoJwKoqCrFXFUE7gnAqiuCcQTsE7xU8VP8VYrgnYrCuTEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqn3/l/J/8vHL5f/BhwCETgGpIDOATgEIOFoDcHzgEIDgC+pG7eve1S/6tat7rXupDXSStWoIpGS4TSMQNIySMwpIyAaRkkZ8GJGdBtbwYkZ63tCKRkoIpGWDEjLCKRmEkjOvsEUjJOsIpGa6bOrgxIzsEkjIGJGYUkZVKCKRmqoDkgEjMJJGSYMSMAikZJ3qhp0dq9ru3X1I36FujPbXuxwKbr//waABfg0AC6DUDUDXBqBoAmQawJiGrhqDUGoN//PkZL8USgKcAAblrroTgfQAbhtQAag1QawaYNIAuQa12Lv9si7F2NnXa2Vsi7i/DZl2tlL9l+vL8tlUTUTUTUYQDIBlGUAyifqJKJqJ+p5Mf/U7TETEU7CxkxVO1PKdqeU8u4vq2ddnrsbM2Zs/tl9s67V2NlbIu5sgaA1Q14ExAmAaA0BrDVDXhpgTPDQGuBMA0gTKGgCYgTHDQGrDUGgNcNQaw1hoAmcNIaRIAtALVEgC1gteI8FpBaBIAtcRwkAWgFpBaILVBaIkAWgRwjhIiPEeDXwa/4NUGr+DRwaKBgX/8IhP//wiF8GBMGBP/wYEhEKEQmEQuDAoGFTAwLgwLhG/4MvCM8GSDJCNwZQOXg2DwbB8MPDDhhuGGBsHhh8Lrf4MCQYFCIUGJgiE8GBQMIFhELDDhdaGHhdYGwaGGDDhhuDYMBsHg2D8MMGHBsH8GwYDYMhEKEQgMCeDAsIhAiFBgQIhAYFhEKDAkGBMIhYGEC4GFCBELgYUKDAuEQsGBQMKEwiEBgUGBcIhQYFwYFAwgWDAoRC8GBAYE4RCgwKEQvhEJgYUIBhQkIhAiECIUGBIMC4RCgwJCIUGBAiFgaYLwiEA5cGXCNhGBGwZAw4Ng0MPBkqNqcoqorlh//PkZP8cygrkAFI0wjo7lfAAjhq4SnPor//psoFemygWmwWm/0C0Ci05adApNn/TZQLU5RU9FRFVFdTn1OFG1Gywv/UbUa9Ff0VoFgCwBbAtQLUCzAtgAchHAN8ImAbgBvwDd4RwjQDeAN8I0ImEQEQAbwRgiQjBHhHAN0A3vgG6Ab/CIhEgG5AN6EQESAbmEYI4RABvYRoRABuYRgDehEQiAiIRABvcA3QiQDfwjwDfCICPCJCJCJ4RwiYRwjBEwDehEYRgDfCNCOEQEQEcI+BagAd4FrAscCxAswLfwLAFgC1wLNVMQU1FMy4xMDBVVVVVVVVVBlBkwO3wZAZMIz//////+DJwO0IwI0DsA7cGUI34Rn4RgMuEZgywZQjAZP/hGAcmDKEYDIB28GQGQGXhGgcgRoMgRoHYBywZAZYMmBygyQYFCIUDChQYE4MCgaYJ/gwKEQsGBAiEBgXAwgQLrhdcGwcGHBsGA2Dgw4YYGwZC6/hdYMMF14YcLrYYcMPDDhdYGweF1oYb4MCwYEwYEgwJBgTCIQGBIRC/BgQDCBcIhAMKFhEKDAsGBQYFAwgTgwKDAoMCQiEgwIBhAnCIUGBQiFwiEBicIhAiFhEIgIoBooGieDPA+4GeDPCP//PkZOobXgrkAEY0jjazieQgBKKIBGgyBGhGhGgyAdoMmEaDIB2gyhGwZYMsI0GSDIEaDKB2QOWEaDKB2hGgygcoHYBygdkDtgygcngyAyhG4MgMgRgRmDJCNBkA7QjAZIRoRoMuByhGgyAyAyhGwZYHKByAcgMgRoHIEbCNCNA7fCNA7AZAO0GSEYEaDLA7cDthGgyAyAyQjAOwGUIyDKEYEaEYEYEaEbA5AZQZAZAZIMgRkGXBlBkCMgyAyQZYMngcmEb8GUGQIyDIBywZAZOEZhGBGwO2EbwjcI3hGYMqTEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqquDqz8GMDQIvBj///+DGDEGAMAifBj8IuEThFCIEQGPCLwiQYBFCKESDCETBhhGAZGEZ4MjgcSEY4GoRQigxCIEQGPCKBiBrgxwiBEwMIRAY4MQNMIkImDEGIRYMIRYRAYhFBjwYwNQYgwBgBh4GAMQiwYgxA0gahFBgBjgYBFhFhFCKEWBgEWEUGEIgMQYQMYRAMQigxhFBh4GkIgRIRYRAY4RIMQYgYhFA18IoMQYQihFhEgwhFCIDEGIRQieBiEUIoRQYhEwYDAFwGrBog0waAaQawacGsGiDQp9MZMVT3piJjJjK//PkZOYZBgjoaUJQ0DprofQgbhq0dep71PqeU69TpMdMVT6n1OlPKdJjpiKdFZkxlPKdJiJj+mKp/0xFPBoAmYaw0BpwJhDSBMQ1BqAmIEzDSGgNXDRDRhp+GsNMNAEyAmYagJkBMA1BpDXAmECZhoDXhqAmYawJjgTICZBrDSGsNAExDVDQGqGgNHDWBMIaQ0BrAmcCYgTHAmIEzDWGgNYaOBMw0BqDSBMYaA04aA1hqwJhw0ATKGqBM8NYEz4aQJkGoNMNIag1+GsCY+BMQJlDVw0cCYfDXw1ho4aQ0gTCTEFNRTMuMTAwqqoD37wjuhHf/////hGf////hHf/gycEZwRn4MnYMncIzsGTwOdOA507A507hGeEZ8GTuDJ4Rn4HPn4Mn4RnhGcDJwM3YM3gzdBm6DNwR3QjvA927Bm//Bm7Bm/Bm8GbgZvBm4GboR3gzeEd+DN8GbvBm6EZ+Bzp4Mn4HOnBGfA588IzsDnTgZPCM8Iz+EZ/CM4DnTgOdPBk8Iz4RJwGTidBi7AycTgiT4RJ8GE6ESdhEngZPJwGTieDCcESfwYToMJ3AycTwiTsDJ5OhEnwibwYb+ETdwibwibvCJuwYb/4RN/Btf/jYGyNv8bHLUtSzE0/LQBW//PkZPQcHgjQAFKVrjfDmgAge1eMLITcshNy1LX8si0LUTQtCyLQTUteWQmvLItSz4mgmnTJops0umEymDSPsnR9HwfB8k7Pvn0fAvwtcLXF/F+L4vQtQWuFoC0BaReF7AeBfwtcXBdF4XheFwXAtAui9C1haRdi6LwvirgnUE6FcVBVisKgrCvioK+KoqiqAhh3AQFXhwVYrFYCWHMOioVAI4dFWHPDgCAdDgdDmHcBIBEO+HRWAiKsBMO4dFQCAdATw6HBWHBWAgHBUHMOf/gICsOCoV4qw7+KxWHA6KhVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVC11Fz1+NP+/Xkqpr9OfuhQ6lZNWf+XsZc/si+KNoOj/Ntai9j7IISgZAklTqQhjToNTeQoreRdaSDODWvYAVFaWWkQmVuZPP8bRUzq896vc+XS6mm5gnnW7JLnV4z9N5XnW4k86x+uyHyxnWkmdborzraff2SvOtvljOtjd/5XRW8MivOsry/K3gUzrFPS1eFTOttTsul1+lLGdbV3c53h51mdbK7xPOr1SpnWlM63kedZnV4XPK86onnW7myrnWTmRTOqascoabXd/L+yuzS95dv1efjhl92ntYyTuIb6wuWRZFmWRa//PkZOcb/gqMACDf1LTLofggA9qc/gKRZiblqWYm3E24moSQnR9BJj6JwfBaFqWZZFoWvLUshNPxNuWn6bTZHgozRTSaNAY5oGjFQVgTkE6FUVorioK8VBXBO8VRUioAhxVioK4qAnIrYrCqKsVRVBORXBORVFcVcVwTgVBUBORUisK4rCoKwrxXFYE4FYVATjFcVhX4rcVBVFQV4rxVFSKwqCpFcV+K8VhXFYV4qivFUE4FaCdivBORUBOfBOgToE6FUVYqisKgqCtxWFbFQVxXisKgqRU4qioKuKwqCvxVBkH/4Mgf4Rg4RgfgxZBizhFYEVuDFvhFbBi3CKyEVsGLf/4MgAxaDFoGsWYMWgaxYBrFngxaDFnCKwIrAYswNas+DFgRWYGtWYMWBFZgxbgaxbgxZCKwGLIRWgxZCK2EVmDFmDFgMW4GtW8IrAYtBi3Bi0GLAYsCK0IrQit4MWeEVgRW+DFsI9cDW9AYtgxZhFaBrVgMWgxaDFvCKwIrIGtWhFaBrFuEVvBi3hFZA1i0IrYMWYMWAxaEVkGLAisCKzBizCK0DWrIRg+EYIRgQjABkHwODABkDhGDwODBgyAEYIRoRvww4YcKILYKILfhRg5htjY4OQbQ2hNAH8su//PkZP8cRgjWAFAUYjwDofQAi9pcJry1E1LUsuWvE2E0LQTcB+E2LMTctQFEEcWnFYVwTkAI4rRWFYE6BOhWwToBBAQgnIrisETANwIiAb/COEQEbgG+EcA38A3wjhGCMEeEaEeKoJwK4J2KoARBVBOIJ1FWKoJ0CcCuCdRWFcV4rioK4rAnYJ2K0V8VYr8E4xWFUVBVFQE6FXBORWFSKorxVFcVwToE5wTvBOoqwToVIJziuKwJxAQgnUVBUgnAqQCaCdxWirFaKwrRWFcE7FfFeK4rgnIrAnYrCoKoqgnAqCrip4qgnCr/////8Iu8BjvP4Ry5/8Izggc4Zw4RnD/hGcP8GThBk4eDJwgycIMnDwjOD4MnBA3eu9hF3kGO8gx3vBjvAN3jvMGO8CLvAY72DHeAbvXe+DHehF3kGO8gbvHeBF3oG713gG713vgx3oMd5BjvAi7wGO9A3eu8BjvMDd470Iu9wN3jvQY7wGO9wN3jvIRd4Bu9d6Bu9d6DHeAbvHewi7yEXecGO9BjvQN3rvIG7zykGO9A3eO9CLvYMd6EXegx3gG7x3kDd470Dd472DHewY7yDHeAKomwmhZFkAof8tCy4m5aCbcTUswFYsy0/LQTX9NBqBgJgYaY//PkZPcaTdCuAFgWlkI0DfQAe9r8Jxz6CShr8++JsArgjxNBNC0LQsyyLMsgRxallyyLIsi0LUTUtS0AVwFPia8si0LMTXiacsxNizLMTYTcsi1LMsy0E2LUsuJqJvxNyy/E1LMteWgm4mpZlkJuWRZFmWnLQTfgncVATkVcVQTsVIqQToVxWFeK4rwTmATCsCcAnQJyKoriqKwrxWiqKoqwToVRWBORWBOBVFSKgq4qAnAqAnArRVgnIJ3FYVQAgCriqK4qYqivBOsVoJwKgJ3FYVBWFfBOIqCoCcivipxUFSCd4qRV4rCvFaCc/BOhW8VxWFUVhX4r1eX/+DHgaYMOEX/CJgwwYQY8GODH/wYf4RAiQiAxCKBj4GAMYRQiwYcGEGMIoMfhECIBgEXAwCJhEA1BjhF+BhCIDEGARYGoRAYgxCLwYeESEUGMDEIoGAMAiAwBiBrCJ8GMGGEWEUGIRYMAYAxCKBiBgBqDDA1wiBEBiDAIsGIMANANMIoMAYhEBh4GMGMGARfAxBj8GAMANYRAYBFAwCIBhgYhEwNQMYGIRAMAiwNYRQi4RQYwYgahEBiBqBgESEUIqa6Z6bTBpGkmUwmkwaZpJlNCkifmkaaaBymgm0wmRPxSDTTa//PkZOYYTgboZUAQIkCEFgAAe898YTZpJtMJhNilphNdMJhMGgmemDSNJNmkaX6aNJN9MJhMc0E2mzSNJMpg0umU2mDS5oJlNJtNJnpg0DSTBoml0wmzTE8TRpGgm00mkzzRNNMJg0jQTSb/NFNdNGl02KTzRTfTPTSbTKZNLphNJpNmgmUymkwaaaTKZ/TSYTBoJr/ifptMpr9MJlNptMpg0kymumEwmf+mEwmOmkymTT5ppv80eaHTCYTHTSaNBNJtN80/0yaBoJo0k2aPTPNA0OaSaTJoplMJv9MgBAB4MBUGwbwVwUBkFAYDAU4NBoMBqhAELk//h/y1/vz6/6zMnEglwqnIsVSHBzAMMIqXiLgxS8ucoLCKl7VwipeupwYpeAxS8Z22hSl4U+qE1L2goKUva1GUJqXqwkpeAxS81IQpS8smBqXql6E1LyEVLxdEJqXoSUvAmpeJhFS8rpH3CKl6EVLxPWFKXgDUvVL1LCal4kuDFL2EVLxFlPClLyEVL2FKXhdwYpeswGpeqXkGKXqLAxS8wYpeqWk8KUvATUvQYpehJS9Bil6yoUpegipeZT2x1vN5NR2X3KrRuXjFmaS0AUCyE1BHflmWZacTYsvy05ZgAIs+WQCqJoWZ//PkZOwZ+gaYBgbm6EQMAfQAe9r8ZCbiaFkWv5ZibialoArlryyDtCSnyfR8hrE7PpNmiaIxDTGKafTJalqJoJoWQm4mnLUtSzE1LUsxNyy4mpZlqJpy14mgD8WpagKvLIEcJuWnLItBNhNhNxNgH8tSyLMTflmA/iaCaFqJqWf4mxZFmCdCvFWKwqivgnQJzFfwToAIwqgnOKgqCoK4J2KwqisKwJwKwqCqKgJwK4rYqirgnIJ2K8VhVwTmKorYrioK4JwKwrRWFQE5FUE6BOwTgV4qYqiuCdAnYqAnMVBVFUVATkVBVirioKoqCviuK8VwTjxWFfivFUVxXBOcVuKvFaKoqiuCdeEW3Bjb/gxvhFvCLYGN8GNwi3CLf8DbtuEW//CM7+DG+EW+DG8DbNgi3CLfA2zYItwY3gbZuDG8GT/Bk+DJ+DJ/hGdCM+EZwMnQZP8GT8GToRngc6dBk4IzwZOBk8GTvhGdBk+DG8Dbt8DbtgY2CLbBjYGNwi2A2zYDbN4RbhFtA2zcDbNwNu3CLaEW4RbeEW2DG8DbNwY3BjYDbNgY3A2zYItwi3CLbgbdvA27YGN/CLaDG4RbgxsDG4Rb8ItsI7oR3cGb00m0wmTT6aTZoJgUpMc0kwaa//PkZNcYqeLUAAAUHjw8DgQAe88cYTXTXNBpXiQdfLVpLJoaCSJs0TQNAbRpJpDWleaGlDmlfQ9fQ7tBZoa0IeOw3Ccq44TcHgrufDVzQNA0Om0wmDTNE0EymkymumU2mU0aSY6ZE8NFMmiaaYNDptMGn+aJpdNptNps0OmU0J50wNtMGmmEz/zQTJpppNplMJlM9M8FAYCoKAAApgqDIMACwAQbBsAMGQAQaCkGg0GgyCkGeCgNABwAAUgrwA+CoAQNAeHCAOAeAyIQHBwgDg4QYDAGgMEEOEAeA0Q4DxAHh0PEMGYMBsFQYDPgoDMGQV4NBqryAZfhGfwjMDl4Rv/wjcGT/4R/CPBH//hH4H3gzv4M7A+/gzoR4GdBnAf+DPBnwj4M7BnwivA1QIpCKcIpgaqDFgaqBogMWBqgGqgxQinA0XBi8IqEUCKBFcD7/CPwj0I+DPA/8GfBnQZ8I+EeCPwZ4R6EfhGcI0GSDIDJCNCMBkgdsIwGQDkBk4HIEZgy4RoHZwZQjcDtCMgcoRgRoRgHKDJBl4RgHIDKDIEYEaEZgyYMoRsIwGQGQIwGUGUI3A5AZMI2EaDLBlwjQZQjAjAZQoqIqqN+pypx/qNIqoqqNKNKcqchwGrCAPqN//PkZOsaCgjiBUZRnkhEBfAgw9tw+iu1RUqp2qNUNalOVG1GkV/U58sLU48sLLCiwFU4hAYA+qQQgasVhVIYQNWKwmAKpvasNoHIDm4OQHIDlGwNgbH4D+JuWQm4mhZFoJsWgm4I4TcbA2xtA5ODnGyNoHJ+NgHKDl/LMBXLUtS04mvLQteAqCaCbFoWQmha8bQ2Acg2ht8bI2RsjaGyNrjYGwNvjbByja/GxFYE4ipBOIrwTiK4J2KuK8BAK4rAnAJwKkE4FYE7FUVgEIqgIRVBO4qRXFQVBVBOMVwCcE5itBOoqAnQqCpBOIrxVBOoJ0KwJxgnQrCuKsVBXioCcCqCdAnYJyKsVYqipBOgjwiAj/8InhH4RMIkIioAC4RiJCMRP////CNk//Blkv4M6F8I9C/8GWT/8I2SwjZOEbJQZZIGWShGyYMsnwj0P///CPQ/hGyQRsn8I2SCNkgOyVkoMsnhGyQMslCNkoMsl4MsnhGyXCNk4MsmEbJ/wZZP8I2SA7JWTgyyQMiKDIieEYiAcRIihGIkIxFwZEUIxEA4iREgcRYihGIoHESIkDiJEUIxFwjEQIxEwZEWDIihGIoRiKEYiHcYJRIr9kzDmO5cIaApXE/NA0TTTKZGym/0//PkZMQWjdCsAwAWCsQ8Cfwoe89cyaXTKZACgKxsmybQFQCyPQPUbRtA9x6QAoegHKmRtClpk0RSkwaCYE/GyaaZ6ZFJTaaTCbTabTBomgmk2mxS0x0waSaTI2gcgOcT0T5MiedM9M9NCfCeGgNhMJlNJoT1MdNJhMjaNPptNGkmhtpnmgmv+KQmRSE0aaY6ZTKZTRoJg0U0aBopg0emU1/xPzTTaa5o80DRTZoJs0TRNEUhMikJs0P0x0wmkwmUymkwaKb5pppNJg0OaInhpGgmeaSbTBp9N/ptNJo0DTNAbOCkGAwGABgA4NgwAAAMAPBgAQKAyDAZgoCkFINAABWAEDAUBTAABgMBTgqACDcGAAQYDAUqLUlVt///+Bj4MIRcGH/hE//hEwY/wi8GPBj8GH8IgRcIv4RYMQi+DAIsIsIn8GHCLCJCJ/BhBgBpgwwifhFhEhF/gwCIDAGIMIMAMQYBFhFBgDH4GAMQiQNAYAwwYBECIAMIAMAAiHBgAMIAiAIg4MABgABhADAhEAGAARCBhCEQhEIMABh6EQAwIMABgCEQwMAQYD4MDCIcGACIQiHwYGDAhEOEQ4MAENB8hJD7PsnXJ0fZ98+D6LItQR3PgnZHmgPYYRopk0xj//PkZMkU/gLsKkITrkL0CfzIetvgJtNdNGkmkwCPLITf8s+WpaFmApAjgFUsyz49jSTCaGMmkyaRZlkJsWpaiagKBZlmWomh8c+CdcnROj4Pk+Akh9E6DsJ0fJ8c+OTs+idk4J2Tg+j7Pr8nB9nwfAa59k7598+D74Sk+eEkFQdDmKsOhwBEVYCeAiAmAiHcBEV4CYCIWmCHF6FqC0haRcF4XYvxfF2LwvC+FqC0xcC0C/FwLSFoF0XBfi7C0xei8LwvcLQLoWoXheC0BaIWoXBdiNiMY6cZ8RkZxnjqOojAz4zx0HUdBGozjoMw6iMjpxdi+L4uC5F/xd/haIui/bZ/+DGBp4RYMQYgw8Ivgw/CJ4RfBh/hECKBgEUGODH8InhFwY4GoMcIgRIMcInCIBrBhCIESESBp+DEGARfhEA1gxBjBj4RAYQYgxgYwiYRcIgMAiAwBjCJgYAawYYRQMQMAYhFgagYhEA0AxA1A1CJBhBgEXwMQNAihFhFAxwYAwgaYMPCJA1hEBiBrwYQiwYwiBFwYhFgxgawihFCLA0gYAwCKESBoBpCJ4MIRcGOEVB9ALR8BJj7/PonB9HyEoJwfZ9E4Dt5OeTnlqJtxNAH7nwfHPonJ8E759E6PoJI//PkZOAWKgjoZUAQYka0Ffgge9VcfZOCdE7J0To+Cc8JWTo+D7J0EqPoO0+T5PsJSfJ9n0TkJUfJOeTknPPo+z6J2Ts+ycE759/k7Pg+z5J2TonBOeTkJUTg+T5DtJ0Tvk5Pjk5DXPg+idH2HYfR9E6PgnR9k5JyfZ9cnR9cNYJSfROidE6Ps+Cdn0fB8E6DtPs+CdHwfH5OAlR8nyfB98+SdE4J0ff5OidH2TknfPkJMfYSg+Cd8+D6PsnP/JwTk++fYSQO0+D5J0fZ8HwTjn2AWDgdAL8ApALQCkO8GACwMgyAVBiAVhzwY4BeDIMgFMOh0ArDgc4BeAV4cgFsOhz/wP225HGw7wCsO4M8AqHP/+DEGQ7/8OgzgFoM4Bf4MhwO4BT4cDmHcGfDnw78GcVhUFTFXFeKoqYJ3isKuKkVgTsVoqCsKwrCoKsVQTqKorYWoXhfxeF/xdi58XOL4WmLnFYVQToE4FXiuK0VwTnFQVRVFcVhU4JzFfDgdhzBnDuHfALgyDAMQZBgGQCgBUAoDAMh3BkAsDMGcGAYgxBn+HAC0ArwCwMAS5adAry0yBSBfoFBVaKqKwVUVrRXUa9FUOEqVUjV3ySPLkvkzlNlNn02E2S06pvVKWACECpW//PkZN8VDgj+zymq5krb1ewAxJvkqe1XysDVFSqlVIo2o0ispyFVoqKNIrKcqNKcKcFhSjaKiKyKhYWiv6nCnCKijajSnPorKNKcKcqcIrqNoqKNqcKNoqKNKNqNKcIqKN//orf6BSbKbKBSBXlp0CvQKTYTZ/0C/LTxFxFoigioigCLC4cRYRWItEXC4cRcI0IoFwwXCiKwjQXC8LhRFcRcRQRSFwoikRcLhxFRFguHiKRF8E7FYVhVBOgCYVRUACKKgqgE0E6ACJFYVoJ0CcgnQrAnMVwTgE6ioKoRwDdhHhG4RARgDcCMEaEYIiAbwRIRuESEcIwRwiYRwjQjBEgWoFuBa4FngWkIQQigwhEwigx/CL/4RfCKEQGP/wYiEUwYHwYGDAwYAGA4RCEQBEGB0rCNcGU4RrBlcIsGGDCESBiEWDCBhCIEWBiDAGHCKEUGEGEGMIgMAiwigxCIDADQGIRfCIEQDXgYYRfBgBoESEXwY/CJCKEQIsGIRODEGIRQYgw8IgRYMMGAGGDEDGDAIoMcDQIkGMGGBrgwCKDAIsIkDUDWDGDDA1hE4RQMQYgwBhhFBhBh4MAMYRMIoRAiAxBjhF4mhZFpxNBNy0LQTUTXhKglR9FqWpaAP5Zi//PkZNYXkgTkGEJwlkXcDfQAe9r8bCa/k5JwTriacsizBHE6CSH1w7efHLPgjuJqWnLITYTX8tRNAH/ialqJuJuWZaFkCO4m5aE7J2TonB8E559nyEnJyfB8FmJrxNxNhNS1E3LT8sxNC0E0LTlqJuWQm3E15ZiaFqWRZiaCagP5aCblkKoqCsCdioKoqwToE6FcVwAhRWBOIrCpFbgnEVRVFUVIJ2K4rAnIqioKgrcV4riuK0E4FcVQTsVxUBOoJ3FUE7itFYE7FYVRXFUVwTkVoqAnYJxBO4rReF4XYWsLWLoui4LwuC9AdsLQL0LQA9C8Lgvi6LguBahfFwXAtIvQQ4vCqKwrxX/8E5xXit4JwKzBnwj+DF+F1guvBiQYkDRIR8I/gz8Gd4R/wYsGLBi8I8DPBneDPBnwZ/8I8DP8I8B/0Gd+DPA+8I/+Ef+DOgzvwj4R/hHoM+Ee4M4D74M+Ef/A/7gfcDPBn4R7BnfCPgz4M7Bngf8DPwjwR6B/3CPwj0Gfgz+EfBnhH8GfwioRQGIBqgRUDVAYoGiBFcIoBqoMWEUA1UDRYRUIqEUA1WBooGiAaqBogRUGJwigM8I/gz+DOCPwj/Bnwj3BnBHgZ4M4I+DOhHhNCz5aiaCb//PkZM0YugrgAAASBEUEBfQAe9rclmWompZ8shNyzLMsy1LMBUAfhNxNicBJCcE5J0JpyyLMTcBVLXloCO5aCagKACiAqflqWYmvE3E3BHlmArFnxNRNC1LUBS5aFoWhZFmWR8k5CTnxz4PonZ8E5Pg+j4LUshNQH4TYtSzLMshNBNhNSyAViyE0FQE4FYVoJ0CcRUgnYqisKoJxFWAhiuKgrCtFUE7FQE5iqKgqRVFWKorwTsVxVFYE7FTFTBOxVgnAqRXBOPisK4BOK0VoriuK0E5BOxUivFcE5FYE5FQVBXFQE6FQVBVFYVxWioCcCoLovi4LoWiL0LSL+LouBaIvBahdi6LoWgEMFoC1hacXxdC14uipiqKn8VPFbiqKsVb//Bm/+EXgx4RdhFb///hE1/8GLP//CKwIrQjoGa/wPewZqEdYM1wZqDNAetgzWEd8GagzYM2DN4M1wjoI7Bm+DNhHcD3rA9awZuEdwZvCOwjsGaA964M1A978I7hHQR0DNge98I6hHYR1wZrBmwPWgPWwZsI7wjqB63COvgzQR3BmwZsGaget8D3rCOgZoGa4R1gzYM0EdwZsI6CO+DN4R1wZsD3oGaBmwjqEdAzXCO/4R0DNAzYR0WgI8TQT//PkZL4XFgTcAE6Tekf8EfQAe9t8YTXiagKwCsJuWXLMTUtC1LMTT8TYTUJP+fAdomomoD8JuWoCgWoI7iaFkJqJqfZ8hrk4CSE5Pk+Cdk5PgnBOT7JwTg+uWZaiaCbcsgFAsy0LPlmJsWYmom5ZFmWpaibiaAjy15ZFkWQm5Zll+JsJqJvy1E0CThJz65OQlJ8H2TknZOT759k6J3z4PgTQTcsy0LITflmWfLUsiyLITYTcTT8syzLQsi0LMEcWZa8tSyE1LTibibFqWYI/8shNCyE1LQsy1LUTUBTLLloWXLUsiyLUtBN+JqJvy1E05Z8TcsxNeWn/LTnxydHwfZ9n1ydk4PsnHJyfR9E4JwTgnB8k4588nB9cnR8c+D7PjxV4q4r8VsVgTgE4/itFShX/xV4rirxVFWKoq4qfxX8E6xVxUBOYrCtwTvwTj/xV8E5/irBOsVuKwqRXFTFQVorCrFf/xWioKwrCtioCcxUFUVAToE4FUVxWFQVhUBO4rgnUVIJyKkVgToE4ipFUVoq4qisKsE64qCoCdxUFUVxXFUE78VxWFQV4qiuKgqiuK4CCK2KoqirBOATsE4FWK4qxVFUVhVFYE4gnIriuCcQTiK4rCoCdCtirBORUiqK2//PkZLAWsgzuADQNNkZj/fjIe9r8K/FXFUVwSE5aiaAKgmhaFpxNQkp8n3z5PsJOGsffLQsyyE1LItS1E1Af+CPLMTUTfibFmJoWQmxanzydHwTsnASknBaCalqWom5ZcsxNyc8nASsnHDt59BrhJgkpOicBKg7D7JyfZ8E5Pk+Cd8EeWXE0LQsiyLQtSyLIsi0LUTYsy0E3LITQshNiyLUsiy4I78shNy0LMVcE6ipgnArRVgncE4wTsVIrCqCcCtBOYrwTgE7iuKwqCoKwrcE7BOQTqKgqiqFpBEC1gPYD3F0X4WoLTF0Xxei6FqC0BaAtQWgXxdwtWFqC0haBW/FQVRUBOBUFcE6ioCcAnEVRX4rYrxWFUVBViuLsXgtAuC6FoBDBaYvi7F8XxexdF8XhcFyI//gx//CJBhgxhEwY/+EXwYgx8ImDH8GPhE8GPhEwigwhFwNQNQNfhE+DGDAGHCIBrhEhEBh4RQMAY/gYBFBhhEAxCIDCEUDEDHBiEUIoRQY+DCBp4McGEIgGgMcGIGMGIGIGgRQYgxCKBiBjBgDGESDADWBgEUDEIuDADWBpBiEUDEDDgYgwBgDEDQDUGIGgRAYQYAxCKBhCKEThEBgBiEUGIRQMQiQiwNAY//PkZKwWNgjoZUAQREakFfQAe9t8YMfwi4GBaFoJsWpaFlyyBHctCzE25ZiaFoAocsy1E24Sk+idk6LMTYTYTQsyyLUtCyLQTUswFYJMGuTg+CdHwErPotAFAsuJtxNCz4m4mvBHiafloWZZ8YppBqzTNI0jTNBMpg0jTTZZFqWfE3Af/xNf+WomhZ8suWZZCb8tC1LQtS14m/LQtBNhNOfR8hKCc8nHJ2EqCUE5CSHxydk6Pg+D7Ps+Sdk6LUTQTcTcTctSz4mwmha8TXlmJvyy5ZiaFl+WpZFoWZa8TQshNCz4mhalmJsWfLQsuWRactBNRNC1E1LLlly0E2PgJWfR8h2H2fJOSdnx+fXPs+T5PgNbnzz6Po+T7JwTk+z4PonROglJ84qCvxXxUirFX4q4qeCd1f8InCI/4R/CP//4RMI/CMEYI4RAR8I8IjCJ4REI/gG8ESEfCOERCP4R/+EaERCPCNCNCI4BvQjYRMHINobIOfjZBzDZG3xtja42gcw2PwcvG2Nng5+NgbY2wcn42htDYGwNrjYGwNsbX42vxscbI2gc3Bzg5Qcg2uNvjaGwNgbI2+Dl4OUbI2Qc42RsjbBy//g5eAboR4RwjQDeCP+EcI8IwBuwjwjBEBEA//PkZKoZMgrqADXt9EV8FfQAe9scG+EThEBGCMESESEbhEQjwjwjwjBHCIwiQDcCNCI/hHE0/LQBSLITf/lqWoSvk7LT8BWLMtRNAk58E7Po+CyLQTcsyyLUsi0Afi1LUTUTUtBNS05aFkWpZHzwkoSgnB9HwfQSsTYsizLQtRNRNgFf/8NcJWEmAWCdn0To+T4CUHyGtxNiyLT/lmJqJqJqWgmpZFqJsWgmwmwmwmv5ZiaibiactBNv/yyLTiaFkWZagKgCmJqWQmgmom3E0LTibAKfE0LLiuKgrYqipBO4JzFUE5BORXBOhVioKwqRWBOYJyKkE6BOIrYqCqCcxVxVFUV8E4FSCdcVgAgCuKkLTBDC6CHi+LwuRfha4uC+FpF8XQtAWgB2wtAWoXBchaBfwtQWnFSCdxVxXFUVhUFYV4rgnOK3wTiKir//1eDCsf//7/+wOYd///ei/f6lmiqGXpyOlCSRm+yP3UtDhFIzqBhwCFHAGFHABYGcAnAAMOAAYcAAw4BYKOAIROANgicAQYcABE4AAzgE4B+1wmcAwYcAK+sDOADgFLCJwAlWBnABwABnABwDWraETgEDOADgDBiRkgoJpGaP+64RSMoRSMGBiRkkwMSMlq7AxIy4//PkZJUYEgieBFw3fkL8FgAied8AROAAicA8DOATgAGHAAROAFwM4BOAGBhwADDgAGHANQUcAgicAYROAfgw4AIkbPNNNpo0TSNBNJgUs0l7lomEwmRSOaRp80zQFK4nvTInnTEGgwGwAwYmOmkyaInppJpMJg0k1+KUaaaTCb42U0mBsGiaSaNNNpo0OaKZNE0jTTSY5oGmaZpJrphM9MGkmDQTCZBzpg0OKR+mBtdMJobfTSbTfG2KSaBpGgaZomiaBomn02mOmkwmjSNPpjmmaKZNA0zSNFNCeClJkT40DTTCY5oJk0kyaJpdMppMdMdN80TR6ZTXTfNJNmimumem+aKZTKaTaaTRops0kwaZppk0+aSa6ZTKYTfTfTPTHTKa5omgmEyaJo9NmkaRp/pnmmaf6aNNMplMplMdMpv8TxMJlNplNJn9MdM1OM6hWa/EjiRiRiO/xIcSP+GgCZQ1+GvDRDV//4aP///4I8EwTwTBLwS/4AHgnBHBHgiwR4JgAgS4IwAYPA8ADg+AAAAFwfB4L4WADC2AGAGFwsFwuD2FgAcAPC+F/B8L4X/B7B4L4WwuD+AGDwXACAAC2D2AEFgfCwAAAAXB8LhcLeDwXCwPYPA+ACACD+AH4XwA//PkZJMVIgb2ejVLxkBMEgTIe898vwv4X/ACB/C4WwtgBg/gA4PA9gBeFhLRTXTRomkmP0yJ6J+mPy0NA0OvibNDQmfzTNNMjaFKNATxMiemiaRoGkmE2mkwmTRTHNBMGiaCZTSZTZomh0PaV9fX2hoX14kzSmOaCY5pJr80U0aPTfNFMps0jSNJMmiaSaTKb6aTKYNLphMpg0eaJoGkJ8aBoppMppMJg00xzTTabNFNJpNJpNpnpg0DT6bTRoppoJMWrSh/690NQ5paV5D2le/LND2hoQxDF/rzR1/r/aWhfaWleQxfXmheaevNDS0tLQ0ryGoch/X15D+vLy+0oc0ry/19DUOXuvIc0oav9oXkNX1/r3X18QCGHQGQHB8PiAPAaHgPDsBgcH+Hqv//+DJ0GNuEW4MbQY2wZO4Rn///4R34R3Qjv//8Gbv//8GbgZuwZvCO4GbsD37+Ed3A586DJ4Rn8DnToRn8GTsGT8GToRn4HOngyf4HOnBGeDJ0IzgjOCM8DnTwjOgydwOdP4RnYMncDbtwY2A27cItgNs3CLeDGwMbwY3CLaEWwRbQi3A27eDG0GN4G2bBFvA2zcItgY3A27YGN4G2bAxtA58/gc6eDJwHOnAyfCM7A588//PkZLMYngTSAFAUhEYcDfggw9V8DnzwOdOBk8IzuEZ4MnAyfgychsy7F3oE13Nl9sy7myrsL6qqOU5anCqkHqNDI3KVUTEU8GNU7U6gxyHKchyVV/Xa2Zspfds3rubK2VsjZmztk9djZi/TZV2NnXYu0vsm0yaBoDZNEbA2k0aKZNjmwbH/Nvm2bRtGyBVArD1G0bQPUevg9h6/+PRzZNkCrzZNgesegesermyPQPXzbHpNvm0PQPUPSbJs82TaHqAtj082h6DaNn8eo2DbHrHpNjj1m1zYHqNo2jYNnmwbPNgek2ja5sj0D1m0bJs80xtJlMdMCeps0U0meaaa6b5p/mmmU3zRTfNFN/pgHPzQNPmkaaaTXTKbTRoJk0zS6b/NBNdNJlNGj02aH6Z4IgAEEYJ4I+CMEQJcEUEXBOpHDX/w1Q0Q1Q1cNWGvw0Q0/hp/AmIaA0cCYhow0w1/w0hoDRhpw1w1BrgTLDXw1BrhrDQGgNQEzAmOGuGiGgNfgTHDQGoCZw1w0BrDWBMIEzDVDTDUGgNfAFwGjBrg1A1YNcGsAXAaQaABcBqg1g1QagaINYaoEyw1Bow1YaA1hoDSBMw1gTICYQJkGrDQGoNGGmGsNcNQawJkGuBM4aIa//PkZKAYngTsATQNQkKMFgDifh7AYagJkGsCZ+GkNWGiGsNAaYaOGgCYgTENQaw0Yaw1Q1Q0/hqw1BkAfmkaCb6ZTCY6bNBNLwmqGA5fzSTCb/lgwXOmMmMmTQ5pmkmUwmkymfzRTaZFJ6aNM002NrppMpg0kwKQmE2m0yKUaKaE95o9MJj9N9NJk0UymOaSaE/TabNNNmmmk2mU2aHTKZTCaNDjaTJoGimkyNvpk0TRTHTf6bTRopg001+mU0aXNBMjYNA0k2mjR5pfps0U100mUz0ym02mDRTHTaaTRpplMc0kz0ySA000mDSTKbNI002mzQTHTaYTf//NA0zQTBodNJk0UyKSaaZNJMprmkaP5oGmKUmEymUyaCbTHNBMJlN80DRNBMmkm/00mUwaZpprplNpvmiaJo80+aSa//TaY/6ZaH//wY4ReEX4RIMfwiAxBh/BhCJ/+ESDDwYcIn+EQIoMAiQYAw8IsGIGGETBj4MP4MQiAxhEAwAxAxBjBiEUIgMIMcDCDAGIMcGMDEGGBgEUDTwNfAx4MAiwiQYgwBgEUIgMIRAiQYhFwYAwBhA1CKDEIoGoGgMQi4MeDADGEQIkIgGMDCDAIoMAiQiAYwYYMQNQigwCJBiDEGAR//PkZJwV+gzoZUAQRkZsCfQAe9tcQYgx8GEGIMQiwMAY4MANAMcIoMSyE1E1/LMTUtCz5OD5PkJJz5Pk+uA/FqWRaib8TUTUTQtC05alqWYm4momgI8TYsxNCzE3LUtQFEsgFM+z6J0fB8nz+TsNcnB9BK+Tk+g7CdhJT6LTiaFqWYI7lqWoCvy05ZlnxNy0/LUshNBNvwR4moCj+Wv5ZlkJqWpalkCOE1E1LQsiyLITUBULLlqWZZlmJsWhZcsi1/4CiWpalkJqJuWvLXlkJsJpyy4mwm5ZlmJuWXLUTQteWgmgmwCsJoWfE3LMsiyLP8TTlkJuAolqJryzE1LTibCbloJuWhZFoWYmxZ8TcXIvxeC0i+FrF0B2i4L8LSL4uBaIDyCHF8XRfF6FqgiwtIuYWoXIrYqAncVvxVip8VIqCvUxPqtFbFf/4q/8V/8V/iririr8VATjxXipxWgnYq+KwqfFTFQVoq+KsVBW8VhUisKuK0VRXivFYE4FTBOhVFcVRV4riuCdCuCdCtwTiCcCqCcgnYqxWFcVIJwKsVxWisK8VxVgnArYqRWFeK0V4qgnQrgnYrfBOoqAnAq4J0CciqKviuK3BOoJyKsE4FUVoqisK2KwrAnArgBAFSK4//PkZJ0VagjyJgGtbkOkFfwAbh4AqRViuK4J0KgrCrFUVxVjOEeDQgjlcT4T40xtjaNI0uaI2QciGNJIl4kJZtCGIaSckIm6GL3TQ2zRTY2UwmjSNE0fxS02aY2BsJs0/+mzSE8TQpHTKZTaaG0aQpApZp/mmm+aHTfTCZGwNgUk0E0aRp/ilJlNJgT5MmkJ9zQNA0TQTH6ZG2mk0mk0mk3zQTKY/G3zQTHTabTBpGgmU0aKaTJpJpNJtMphNjYTfNE0emkymE2mEyaCbNBNfmkaJpdNJnpg0k0mDTTCbTaZTBp80k2aCbTfNE00yaCb6bTZoplMmmaKZTKaTJpmiaHTXNJNdMDbTab6Y6Z6ZNNMJhMJhN9NJrmim02m0ymU300aPTSa6Y//5pJpNdN/9NppxWxU4Jx/xWxU/xU4qcV/ipiuKwqxWFbioK/8VIqivFTwTkVgTkVor4JxFXxX8VcVxUFQE4FaCcwTvBOIqwToVuKwqCtFUVYqxXxWFeK0E7FQVYrwTnwTsV4rCqCcfFaCcRVFQE5gnAr4JyK4r4Jz4J0Koqip4rCvisKoJ3xWBOME7iuKgriuKgrAnAqgnArxXiqCcgnYJzFQVQTmAEIVYrwToAIYrwTiKkVQTkE5//PkZK4XGgzsADQNAkIcCfwAe898FXFTFYVxXxUFQVkzzS5oilg5TTTY2kyaJpJtNGgJ8aKaTQ2k2aCaNI0eaSYNJM/tKHEiQxfJG09MmgaSYTRppg0TRNNMJlMptMCfppNprmiaA2jQNLmmaRppk0jRFLNP9NJhMGmaQpZpJhNCkGkmE0J+mxSk0m0x02mjRTKbTCZ42EwaQpJpptNprmgaRpmim00J4mzSNM0kymkyKWmE0muaKYGwNjmgafTPNE0U0mUwJ7+mem01+J8mhSk2mjRTSb6aTCbNBM9MpjpjppMpk0E2mE2mE2mjSTfTaZ6YNFMcT1MpnprptNmim0wmE100aSaTRo9MGjzTTHTaaTfTSaNLpoFMAAFYNBQGwAvwAYM4NgqqkjaAN3d3d3etERNK5CZ/3Ctf8AaiAc/u7vaIn/+8XPv//+GDKv8W1/+AC8K4Yw+94xe940jgceOBwOcRaxGwH4EuNIjBfxazB8HhkwVjIAII/vDkjG/wAcJPeF5e98hNgSYLWMFvhZ73pX06aoehpmh01hMJtM9K3TKY9E10x+memvlIpZM9MUTCbShbUrtM+n5ophNZuXK+0wmemumMCemkmvc0Uwm/lJJlLe5oJZI0SyW6R0mE//PkZLcXlgrzECFvrEmMEfgAfh7k2aORpbTYUo9SBNsekGYNVKgqg6hrUXK4Q42DOwPWbILEzBSumEgkWJPU8S72G5wUuGDwguEKa1Q0UykS3Bn7FJNgg5qoEgpsGabBtGabZt7NrKCNgLYes1idmabBtm2bZsBRm0PQbF9mwPSPUBbMwzB6QojYM42ePTzbMwzR6TaNs1eBVNv81yDUJ2QYhJtD0m0PVe+x6T2M8HsbFwsh6B6D7HpugT2uZhO6HqZhmE7ISZhhkFNcghtmybBnnsD1Ho49ZtG2bZs5PVBc2EEepCaEHNjj1EJHq5smabZtmwbNEEPR+bJse9z2PY2T1SN0rdNJq6yXI06COvNJj9MGmkkGmUj7pI0TToNGlEsNEnCW10ymi5FtNFKpvps0kz0uW3aaTF00mTSzdNJu0KFYz1KjaGAhyoQCFGM//zFARgIUZ/oZpdCttay6M5drW1joSj6Ekk1b7J7R7aoQNlPrWBKLTTzOsGT5yYxLrtHTy2iUxEkES0HIBVD066VjGj31odPkkSjJtbWs6OIjKmlXHR9K5MTv5pdZolE10kk2lly74TFx5KTXeTGLrS6ExiucvJSSDUdXZm3NLn1rtYBCUEoRj77WOhCPc+g5//PkZJ8XPgzoAABMTrz8BfQyY9ONGxJULutaa1TE5LHxWEo+XecmMa3p0kqBCR6qOFaFUGpNJIIjqVi0ylBqJIkiSJIkmJj605EkSRJPetWAyVacmodBUVhGfrAZPF0AUrgRLNiqDU4VHo8h6HRObJJNdqlRBMFT0qdNE0WZhmay2tCuOY6oieWieianCnVSbzjd7SGhrLi6eUSeLcZTWqdML5PM50uOGJms9VqtYU6hrgrm4V0frUzTvYsiegR2FOkqUxSKdVCpmRCSkIAUZ4VPhqEKgFDU2VhUiIhUaIg0RAkTBYEjYBUbBMuCJgLAkCUBUinABgBE3/9EQqFRM0s0qzktk9ZFqqFC6RULE11JVDkd8Y1vVFOx9oUIpZ8Vnq5klkxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq`,TN={NotAllowedError:`permission-denied`,PermissionDeniedError:`permission-denied`,NotFoundError:`no-camera`,DevicesNotFoundError:`no-camera`,NotReadableError:`in-use`,TrackStartError:`in-use`,OverconstrainedError:`overconstrained`,ConstraintNotSatisfiedError:`overconstrained`,AbortError:`aborted`,SecurityError:`security`,TypeError:`type-error`};function EN(e){if(e instanceof DOMException||e instanceof Error){let t=e.name??``,n=e.message??String(e);return n.includes(`secure context`)?{kind:`insecure-context`,message:n,cause:e}:n.includes(`Stream API`)?{kind:`unsupported`,message:n,cause:e}:{kind:TN[t]??`unknown`,message:n,cause:e}}return{kind:`unknown`,message:typeof e==`string`?e:`Unknown scanner error`,cause:e}}var DN=[];function ON(e){let{videoElementRef:t,onScan:n,onFound:r,onError:i,retryDelay:a=100,scanDelay:o=0,formats:s=DN,allowMultiple:c=!1,sound:l=!0}=e,u=(0,h.useMemo)(()=>[...s].sort().join(`|`),[s]),d=(0,h.useRef)(null),f=(0,h.useRef)(null),p=(0,h.useRef)(null);typeof window<`u`&&d.current===null&&(d.current=new mM({formats:s})),(0,h.useEffect)(()=>{typeof window>`u`||(d.current=new mM({formats:s}))},[u]),(0,h.useEffect)(()=>{if(typeof window>`u`||!l){f.current=null;return}return f.current=new Audio(typeof l==`string`?l:wN),()=>{f.current?.pause(),f.current=null}},[l]);let m=(0,h.useCallback)(e=>async s=>{let u=d.current;if(t.current===null||t.current.readyState<=1||u===null)return;let{lastScan:h,contentBefore:g,lastScanHadContent:_}=e;if(s-h<a){p.current=window.requestAnimationFrame(m(e));return}let v;try{v=await u.detect(t.current)}catch(e){i?.(EN(e));return}let y=v.some(e=>!g.has(e.rawValue)),b=v.length>0,x=e.lastOnScan,S=s-x>=o;(y||c&&b&&S)&&(l&&f.current?.paused&&f.current.play().catch(e=>console.error(`Error playing the sound`,e)),x=s,n(v)),(b||_)&&r(v);let C=y?new Set(v.map(e=>e.rawValue)):g,w={lastScan:s,lastOnScan:x,lastScanHadContent:b,contentBefore:C};p.current=window.requestAnimationFrame(m(w))},[n,r,i,a,c,o,l]);return{startScanning:(0,h.useCallback)(()=>{if(typeof window>`u`)return;let e=performance.now(),t={lastScan:e,lastOnScan:e,contentBefore:new Set,lastScanHadContent:!1};p.current=window.requestAnimationFrame(m(t))},[m]),stopScanning:(0,h.useCallback)(()=>{p.current!==null&&(window.cancelAnimationFrame(p.current),p.current=null)},[])}}var kN={finder:!0,torch:!0,tracker:void 0,onOff:!1,zoom:!1},AN={facingMode:`environment`,width:{min:640,ideal:720,max:1920},height:{min:640,ideal:720,max:1080}},jN={container:{width:`100%`,height:`100%`,position:`relative`,display:`flex`,alignItems:`center`,justifyContent:`center`,overflow:`hidden`,aspectRatio:`1/1`},video:{width:`100%`,height:`100%`,objectFit:`cover`,overflow:`hidden`}},MN=e=>e instanceof Date,NN=e=>e==null,PN=e=>typeof e==`object`,FN=e=>!NN(e)&&!Array.isArray(e)&&PN(e)&&!MN(e),IN=e=>NN(e)||!PN(e);function LN(e,t){if(IN(e)||IN(t))return e===t;if(MN(e)&&MN(t))return e.getTime()===t.getTime();if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!LN(e[n],t[n]))return!1;return!0}if(!FN(e)||!FN(t))return!1;let n=e,r=t,i=Object.keys(n),a=Object.keys(r);if(i.length!==a.length)return!1;let o=new Set(a);for(let e of i){if(!o.has(e))return!1;if(e===`ref`)continue;let t=n[e],i=r[e],a=FN(t)&&FN(i),s=Array.isArray(t)&&Array.isArray(i),c=MN(t)&&MN(i);if(a||s||c){if(!LN(t,i))return!1}else if(t!==i)return!1}return!0}function RN(e){let{disabled:t=!1,className:r,style:i}=e;return(0,n.jsx)(`svg`,{"aria-hidden":`true`,focusable:`false`,className:r,style:{stroke:t?`grey`:`yellow`,fill:`none`,strokeLinejoin:`round`,strokeLinecap:`round`,strokeWidth:1.5,...i},width:`28px`,height:`28px`,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,children:(0,n.jsx)(`path`,{d:`M3 3L6.00007 6.00007M21 21L19.8455 19.8221M9.74194 4.06811C9.83646 4.04279 9.93334 4.02428 10.0319 4.01299C10.1453 4 10.2683 4 10.5141 4H13.5327C13.7786 4 13.9015 4 14.015 4.01299C14.6068 4.08078 15.1375 4.40882 15.4628 4.90782C15.5252 5.00345 15.5802 5.11345 15.6901 5.33333C15.7451 5.44329 15.7726 5.49827 15.8037 5.54609C15.9664 5.79559 16.2318 5.95961 16.5277 5.9935C16.5844 6 16.6459 6 16.7688 6H17.8234C18.9435 6 19.5036 6 19.9314 6.21799C20.3077 6.40973 20.6137 6.71569 20.8055 7.09202C21.0234 7.51984 21.0234 8.0799 21.0234 9.2V15.3496M19.8455 19.8221C19.4278 20 18.8702 20 17.8234 20H6.22344C5.10333 20 4.54328 20 4.11546 19.782C3.73913 19.5903 3.43317 19.2843 3.24142 18.908C3.02344 18.4802 3.02344 17.9201 3.02344 16.8V9.2C3.02344 8.0799 3.02344 7.51984 3.24142 7.09202C3.43317 6.71569 3.73913 6.40973 4.11546 6.21799C4.51385 6.015 5.0269 6.00103 6.00007 6.00007M19.8455 19.8221L14.5619 14.5619M14.5619 14.5619C14.0349 15.4243 13.0847 16 12 16C10.3431 16 9 14.6569 9 13C9 11.9153 9.57566 10.9651 10.4381 10.4381M14.5619 14.5619L10.4381 10.4381M10.4381 10.4381L6.00007 6.00007`})})}function zN(e){let{disabled:t=!1,className:r,style:i}=e;return(0,n.jsxs)(`svg`,{"aria-hidden":`true`,focusable:`false`,className:r,style:{stroke:t?`grey`:`yellow`,fill:`none`,strokeLinejoin:`round`,strokeLinecap:`round`,strokeWidth:1.5,...i},width:`28px`,height:`28px`,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,n.jsx)(`path`,{d:`M12 16C13.6569 16 15 14.6569 15 13C15 11.3431 13.6569 10 12 10C10.3431 10 9 11.3431 9 13C9 14.6569 10.3431 16 12 16Z`}),(0,n.jsx)(`path`,{d:`M3 16.8V9.2C3 8.0799 3 7.51984 3.21799 7.09202C3.40973 6.71569 3.71569 6.40973 4.09202 6.21799C4.51984 6 5.0799 6 6.2 6H7.25464C7.37758 6 7.43905 6 7.49576 5.9935C7.79166 5.95961 8.05705 5.79559 8.21969 5.54609C8.25086 5.49827 8.27836 5.44328 8.33333 5.33333C8.44329 5.11342 8.49827 5.00346 8.56062 4.90782C8.8859 4.40882 9.41668 4.08078 10.0085 4.01299C10.1219 4 10.2448 4 10.4907 4H13.5093C13.7552 4 13.8781 4 13.9915 4.01299C14.5833 4.08078 15.1141 4.40882 15.4394 4.90782C15.5017 5.00345 15.5567 5.11345 15.6667 5.33333C15.7216 5.44329 15.7491 5.49827 15.7803 5.54609C15.943 5.79559 16.2083 5.95961 16.5042 5.9935C16.561 6 16.6224 6 16.7454 6H17.8C18.9201 6 19.4802 6 19.908 6.21799C20.2843 6.40973 20.5903 6.71569 20.782 7.09202C21 7.51984 21 8.0799 21 9.2V16.8C21 17.9201 21 18.4802 20.782 18.908C20.5903 19.2843 20.2843 19.5903 19.908 19.782C19.4802 20 18.9201 20 17.8 20H6.2C5.0799 20 4.51984 20 4.09202 19.782C3.71569 19.5903 3.40973 19.2843 3.21799 18.908C3 18.4802 3 17.9201 3 16.8Z`})]})}var BN={bottom:85,right:8,position:`absolute`,zIndex:2,background:`transparent`,border:0,padding:4,margin:0,display:`inline-flex`,alignItems:`center`,justifyContent:`center`};function VN(e){let{scanning:t,startScanning:r,stopScanning:i}=e,[a,o]=(0,h.useState)(!1),s=(0,h.useRef)(null);(0,h.useEffect)(()=>()=>{s.current!==null&&clearTimeout(s.current)},[]);function c(){a||(o(!0),t?i():r(),s.current!==null&&clearTimeout(s.current),s.current=setTimeout(()=>{o(!1),s.current=null},1e3))}return(0,n.jsx)(`button`,{type:`button`,"aria-label":t?`Turn camera off`:`Turn camera on`,"aria-pressed":t,disabled:a,onClick:c,style:{...BN,cursor:a?`default`:`pointer`},children:t?(0,n.jsx)(RN,{disabled:a}):(0,n.jsx)(zN,{disabled:a})})}function HN(e){let{className:t,style:r}=e;return(0,n.jsx)(`svg`,{"aria-hidden":`true`,focusable:`false`,width:`30px`,height:`30px`,viewBox:`0 0 24 24`,className:t,style:r,xmlns:`http://www.w3.org/2000/svg`,children:(0,n.jsx)(`path`,{strokeWidth:.2,stroke:`yellow`,fill:`yellow`,d:`M14.516 15.158l.714.714-4.595 6.14-.75-.364L12.337 13H6.978L8.22 8.861l.803.803L8.322 12h3.036l1.793 1.792-1.475 5.16zm5.984 4.05L4.793 3.5l.707-.707 3.492 3.492L10.278 2h7.972l-5.025 7h7.149l-3.71 4.957 4.543 4.543zM12.707 10l3.243 3.243L18.376 10zM9.795 7.088l2.079 2.079L16.3 3h-5.278z`})})}function UN(e){let{className:t,style:r}=e;return(0,n.jsx)(`svg`,{"aria-hidden":`true`,focusable:`false`,width:`30px`,height:`30px`,viewBox:`0 0 24 24`,className:t,style:r,xmlns:`http://www.w3.org/2000/svg`,children:(0,n.jsx)(`path`,{strokeWidth:.2,stroke:`yellow`,fill:`yellow`,d:`M13.225 9l5.025-7h-7.972l-3.3 11h5.359l-2.452 8.648.75.364L20.374 9zm.438 3H8.322l2.7-9H16.3l-5.025 7h7.101l-6.7 8.953z`})})}var WN={bottom:35,right:8,position:`absolute`,zIndex:2,background:`transparent`,border:0,padding:4,margin:0,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`};function GN(e){let{status:t,scanning:r,torchToggle:i}=e;return r?(0,n.jsx)(`button`,{type:`button`,"aria-label":t?`Turn flashlight off`:`Turn flashlight on`,"aria-pressed":t,onClick:()=>i(!t),style:WN,children:t?(0,n.jsx)(HN,{}):(0,n.jsx)(UN,{})}):null}function KN(e){let{className:t,disabled:r=!1,style:i}=e;return(0,n.jsx)(`svg`,{"aria-hidden":`true`,focusable:`false`,width:`30px`,height:`30px`,viewBox:`0 0 24 24`,className:t,style:{stroke:r?`grey`:`yellow`,fill:r?`grey`:`yellow`,...i},xmlns:`http://www.w3.org/2000/svg`,children:(0,n.jsx)(`path`,{strokeWidth:.3,d:`M16.279,17.039c-1.396,1.209 -3.216,1.941 -5.206,1.941c-4.393,0 -7.96,-3.567 -7.96,-7.96c-0,-4.393 3.567,-7.96 7.96,-7.96c4.393,0 7.96,3.567 7.96,7.96c-0,2.044 -0.772,3.909 -2.04,5.319l0.165,0.165c1.194,1.194 2.388,2.388 3.583,3.582c0.455,0.456 -0.252,1.163 -0.707,0.708l-3.755,-3.755Zm1.754,-6.019c-0,-3.841 -3.119,-6.96 -6.96,-6.96c-3.842,0 -6.96,3.119 -6.96,6.96c-0,3.841 3.118,6.96 6.96,6.96c3.841,0 6.96,-3.119 6.96,-6.96Zm-7.46,0.5l-1.5,0c-0.645,0 -0.643,-1 -0,-1l1.5,0l-0,-1.5c-0,-0.645 1,-0.643 1,0l-0,1.5l1.5,0c0.645,0 0.643,1 -0,1l-1.5,0l-0,1.5c-0,0.645 -1,0.643 -1,0l-0,-1.5Z`})})}function qN(e){let{className:t,disabled:r=!1,style:i}=e;return(0,n.jsx)(`svg`,{"aria-hidden":`true`,focusable:`false`,width:`30px`,height:`30px`,viewBox:`0 0 24 24`,className:t,style:{stroke:r?`grey`:`yellow`,fill:r?`grey`:`yellow`,...i},xmlns:`http://www.w3.org/2000/svg`,children:(0,n.jsx)(`path`,{strokeWidth:.3,d:`M16.279,17.039c-1.396,1.209 -3.216,1.941 -5.206,1.941c-4.393,0 -7.96,-3.567 -7.96,-7.96c-0,-4.393 3.567,-7.96 7.96,-7.96c4.393,0 7.96,3.567 7.96,7.96c-0,2.044 -0.772,3.909 -2.04,5.319l0.165,0.165c1.194,1.194 2.388,2.388 3.583,3.582c0.455,0.456 -0.252,1.163 -0.707,0.708l-3.755,-3.755Zm1.754,-6.019c-0,-3.841 -3.119,-6.96 -6.96,-6.96c-3.842,0 -6.96,3.119 -6.96,6.96c-0,3.841 3.118,6.96 6.96,6.96c3.841,0 6.96,-3.119 6.96,-6.96Zm-4.96,-0.5c0.645,0 0.643,1 -0,1l-4,0c-0.645,0 -0.643,-1 -0,-1l4,0Z`})})}var JN={bottom:130,right:8,position:`absolute`,zIndex:2,background:`transparent`,border:0,padding:4,margin:0,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`},YN={...JN,bottom:180};function XN(e){let{scanning:t,capabilities:r,onZoom:i,value:a}=e;if(!t)return null;let o=r.step>0?r.step:1;function s(){i(Math.min(a+o,r.max))}function c(){i(Math.max(a-o,r.min))}let l=a<=r.min,u=a>=r.max;return(0,n.jsxs)(h.Fragment,{children:[(0,n.jsx)(`button`,{type:`button`,"aria-label":`Zoom out`,disabled:l,onClick:c,style:{...JN,cursor:l?`default`:`pointer`},children:(0,n.jsx)(qN,{disabled:l})}),(0,n.jsx)(`button`,{type:`button`,"aria-label":`Zoom in`,disabled:u,onClick:s,style:{...YN,cursor:u?`default`:`pointer`},children:(0,n.jsx)(KN,{disabled:u})})]})}var ZN={fullContainer:{width:`100%`,height:`100%`,position:`relative`,display:`flex`,alignItems:`center`,justifyContent:`center`,overflow:`hidden`},innerContainer:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,position:`relative`},overlay:{position:`absolute`,top:0,right:0,bottom:0,left:0,pointerEvents:`none`,display:`flex`,alignItems:`center`,justifyContent:`center`},borderBox:{position:`relative`,width:`70%`,aspectRatio:`1 / 1`,border:`2px dashed rgba(239, 68, 68, 0.4)`,borderRadius:`0.5rem`},cornerTopLeft:{position:`absolute`,width:`15%`,height:`15%`,border:`4px solid #ef4444`,top:0,left:0,borderBottomColor:`transparent`,borderRightColor:`transparent`,borderTopLeftRadius:`0.5rem`},cornerTopRight:{position:`absolute`,width:`15%`,height:`15%`,border:`4px solid #ef4444`,top:0,right:0,borderBottomColor:`transparent`,borderLeftColor:`transparent`,borderTopRightRadius:`0.5rem`},cornerBottomLeft:{position:`absolute`,width:`15%`,height:`15%`,border:`4px solid #ef4444`,bottom:0,left:0,borderTopColor:`transparent`,borderRightColor:`transparent`,borderBottomLeftRadius:`0.5rem`},cornerBottomRight:{position:`absolute`,width:`15%`,height:`15%`,border:`4px solid #ef4444`,bottom:0,right:0,borderTopColor:`transparent`,borderLeftColor:`transparent`,borderBottomRightRadius:`0.5rem`}};function QN(e){let{scanning:t,capabilities:r,onOff:i,torch:a,zoom:o,startScanning:s,stopScanning:c}=e;return(0,n.jsx)(`div`,{style:ZN.fullContainer,children:(0,n.jsxs)(`div`,{style:ZN.innerContainer,children:[(0,n.jsx)(`div`,{style:ZN.overlay,children:(0,n.jsxs)(`div`,{style:ZN.borderBox,children:[(0,n.jsx)(`div`,{style:ZN.cornerTopLeft}),(0,n.jsx)(`div`,{style:ZN.cornerTopRight}),(0,n.jsx)(`div`,{style:ZN.cornerBottomLeft}),(0,n.jsx)(`div`,{style:ZN.cornerBottomRight})]})}),i&&(0,n.jsx)(VN,{scanning:t,startScanning:s,stopScanning:c}),a&&r.torch&&(0,n.jsx)(GN,{scanning:t,status:a.status,torchToggle:a.toggle}),o&&r.zoom&&(0,n.jsx)(XN,{scanning:t,capabilities:r.zoom,value:o.value,onZoom:o.onChange})]})})}var $N={position:`absolute`,width:`100%`,height:`100%`},eP={position:`absolute`,width:`100%`,height:`100%`},tP={position:`absolute`,width:`100%`,height:`100%`};function nP(e){if(e===null)return;let t=e.getContext(`2d`);t!==null&&t.clearRect(0,0,e.width,e.height)}function rP(e,t,n,r){if(n===null||t===null)return;if(e.length===0||r===void 0){nP(n);return}let i=t.offsetWidth,a=t.offsetHeight,o=t.videoWidth,s=t.videoHeight;if(o===0||s===0){nP(n);return}let c=Math.max(i/o,a/s),l=o*c,u=s*c,d=l/o,f=u/s,p=(i-l)/2,m=(a-u)/2,h=({x:e,y:t})=>({x:Math.floor(e*d),y:Math.floor(t*f)}),g=({x:e,y:t})=>({x:Math.floor(e+p),y:Math.floor(t+m)}),_=e.map(e=>{let{boundingBox:t,cornerPoints:n}=e,{x:r,y:i}=g(h({x:t.x,y:t.y})),{x:a,y:o}=h({x:t.width,y:t.height});return{...e,cornerPoints:n.map(e=>g(h(e))),boundingBox:DOMRectReadOnly.fromRect({x:r,y:i,width:a,height:o})}});n.width=i,n.height=a;let v=n.getContext(`2d`);v!==null&&r(_,v)}var iP=(0,h.forwardRef)(function(e,t){let{onScan:r,constraints:i,formats:a=[`any`],paused:o=!1,components:s,tracker:c,children:l,styles:u,classNames:d,allowMultiple:f,scanDelay:p,retryDelay:m,onError:g,sound:_,startTimeoutMs:v,settleDelayMs:y}=e,b=(0,h.useRef)(null),x=(0,h.useRef)(null),S=(0,h.useRef)(null),C=(0,h.useMemo)(()=>{let e={...AN,...i};return i?.deviceId&&delete e.facingMode,e},[i]),w=(0,h.useMemo)(()=>({...kN,...s}),[s]),T=c??w.tracker,[E,D]=(0,h.useState)(!1),[O,k]=(0,h.useState)(!1),[A,j]=(0,h.useState)(C),M=CN({startTimeoutMs:v,settleDelayMs:y}),N=(0,h.useRef)(M),ee=(0,h.useRef)(r),P=(0,h.useRef)(g),te=(0,h.useRef)(T);(0,h.useEffect)(()=>{N.current=M},[M]),(0,h.useEffect)(()=>{ee.current=r},[r]),(0,h.useEffect)(()=>{P.current=g},[g]),(0,h.useEffect)(()=>{te.current=T},[T]);let ne=(0,h.useCallback)(e=>{ee.current?.(e)},[]),re=(0,h.useCallback)(e=>{P.current?.(e)},[]),{startScanning:ie,stopScanning:F}=ON({videoElementRef:b,onScan:ne,onFound:(0,h.useCallback)(e=>{rP(e,b.current,S.current,te.current)},[]),onError:re,formats:a,retryDelay:m??(T===void 0?500:33),scanDelay:p,allowMultiple:f,sound:_});(0,h.useEffect)(()=>(D(!0),()=>{D(!1)}),[]),(0,h.useEffect)(()=>{LN(C,A)||j(C)},[C,A]);let ae=(0,h.useMemo)(()=>({constraints:A,shouldStream:E&&!o}),[A,E,o]),oe=(0,h.useCallback)(async()=>{let e=b.current,t=x.current;if(e===null||t===null)return;let n=t.getContext(`2d`);if(n!==null)try{ae.shouldStream?(await N.current.stopCamera(),k(!1),await N.current.startCamera(e,{constraints:ae.constraints}),k(!0)):(e.videoWidth>0&&e.videoHeight>0&&(t.width=e.videoWidth,t.height=e.videoHeight,n.drawImage(e,0,0,e.videoWidth,e.videoHeight)),await N.current.stopCamera(),k(!1))}catch(e){k(!1),P.current?.(EN(e))}},[ae]);(0,h.useEffect)(()=>{oe()},[oe]);let se=(0,h.useMemo)(()=>ae.shouldStream&&O,[ae.shouldStream,O]);(0,h.useEffect)(()=>(se&&(nP(x.current),nP(S.current),ie()),()=>{F()}),[se,ie,F]),(0,h.useImperativeHandle)(t,()=>({getVideoElement:()=>b.current,getStream:()=>N.current.getStream()}),[]);let ce=(0,h.useMemo)(()=>({...jN.container,...u?.container}),[u?.container]),le=(0,h.useMemo)(()=>({...jN.video,...u?.video,visibility:o?`hidden`:`visible`}),[u?.video,o]),ue=(0,h.useMemo)(()=>({...eP,display:o?`block`:`none`}),[o]);return(0,n.jsxs)(`div`,{style:ce,className:d?.container,children:[(0,n.jsx)(`video`,{ref:b,style:le,className:d?.video,autoPlay:!0,muted:!0,playsInline:!0}),(0,n.jsx)(`canvas`,{ref:x,style:ue}),(0,n.jsx)(`canvas`,{ref:S,style:tP}),(0,n.jsxs)(`div`,{style:$N,children:[w.finder&&(0,n.jsx)(QN,{scanning:O,capabilities:M.capabilities,onOff:w.onOff,zoom:w.zoom&&M.settings.zoom?{value:M.settings.zoom,onChange:async e=>{try{await M.updateConstraints({...A,advanced:[{zoom:e}]})}catch(e){P.current?.(EN(e))}}}:void 0,torch:w.torch?{status:M.settings.torch??!1,toggle:async e=>{try{await M.updateConstraints({...A,advanced:[{torch:e}]})}catch(e){P.current?.(EN(e))}}}:void 0,startScanning:async()=>await oe(),stopScanning:async()=>{try{await M.stopCamera(),nP(S.current),k(!1)}catch(e){P.current?.(EN(e))}}}),l]})]})});function aP({onScan:e}){let{t}=U(),{cameraFacingMode:r}=wo(),[i,a]=(0,h.useState)(r??b.USER),[o,s]=(0,h.useState)(!(wT.isMobile&&!wT.isTablet));return o?(0,n.jsxs)(`div`,{className:`relative w-full`,children:[(0,n.jsx)(`div`,{className:`scale-x-[-1]`,children:(0,n.jsx)(iP,{components:{finder:!1},onScan:t=>e(t[0].rawValue),constraints:{facingMode:i},allowMultiple:!0,classNames:{video:`rounded-sm`,container:`max-h-[calc(100vh-381px)] min-h-[267px] overflow-hidden rounded-sm`},onError:e=>{console.log(e),If(e)}})}),(0,n.jsx)(`div`,{className:`absolute top-2 right-2 flex h-10 w-10 cursor-pointer items-center justify-center rounded-sm bg-white shadow-overlay`,onClick:()=>i===b.USER?a(b.ENVIRONMENT):a(b.USER),children:(0,n.jsx)(`img`,{src:vT,alt:`camera-switch`})})]}):(0,n.jsx)(`div`,{className:`flex max-h-[calc(100vh-381px)] min-h-[267px] items-center justify-center`,children:(0,n.jsx)(Mx,{disabled:o,onClick:()=>s(!0),children:t(`enableCamera`)})})}function oP({value:e,onInputChange:t,onScannerChange:r,placeholder:i,label:a=``}){let o=(0,h.useRef)(null),[s,c]=_T()??[0,0],{subscribe:l,unsubscribe:u}=No(),{cameraService:d}=wo();return(0,h.useEffect)(()=>{c&&c<=332&&o.current?.scrollIntoView({behavior:`smooth`,block:`end`})},[c]),(0,h.useEffect)(()=>{let e=e=>{r(e.detail.code)};return l(`onCodeScan`,e),()=>{u(`onCodeScan`,e)}},[]),(0,n.jsxs)(`div`,{ref:o,children:[(0,n.jsxs)(`div`,{className:`mb-4 flex flex-col gap-4`,children:[(()=>{switch(+d){case 1:return(0,n.jsx)(aP,{onScan:r});case 2:return(0,n.jsx)(TT,{onScan:r});case 3:return(0,n.jsx)(oj,{onScan:r});case 4:return(0,n.jsx)(sj,{onScan:r});default:return(0,n.jsx)(aP,{onScan:r})}})(),(0,n.jsx)(`hr`,{})]}),(0,n.jsx)(nT,{label:a,value:e,autoFocus:!0,placeholder:i??`CDE2341S`,onChange:e=>t(e.target.value)})]})}var sP={contactOverview:`/portal/contact/data`};function cP(){let{t:e}=U(),{errorToast:t,successToast:r}=ca(),{portalSession:i}=H(),[a,o]=(0,h.useState)(``),[s,c]=(0,h.useState)(!1),[l,u]=(0,h.useState)(null),[d,f]=(0,h.useState)(!1),p=zw(),m=XS(),g=e=>{c(!0),p.post(`${i.uuid}/check-code`,{code:e}).then(e=>{let t=e.data.data;if(t.type===`voucher`){r(),m(`/voucher/${t.id}`);return}if(t.type===`giftcard`){r(),m(`/giftcard/${t.id}`);return}if(t.type===`identifier`){r(),u(t.id);return}console.error(`Unsupported code type:`,t)}).catch(t).finally(()=>c(!1))};return l===null?d?(0,n.jsx)(sT,{onCancel:()=>f(!1),onSuccess:async()=>m(sP.contactOverview)}):(0,n.jsx)(qw,{children:(0,n.jsxs)(Bw,{id:Fo,children:[(0,n.jsxs)(Uw,{children:[(0,n.jsx)(Gw,{children:e(`scanOrEnterX`,{x:`code`})}),(0,n.jsx)(Ww,{children:`Accepts codes from vouchers, giftcards and identifiers`}),(0,n.jsx)(Ww,{children:`Type: ${i.type}`})]}),(0,n.jsx)(Vw,{children:(0,n.jsxs)(Kw,{onSubmit:()=>g(a),children:[(0,n.jsx)(oP,{value:a,onInputChange:o,onScannerChange:e=>{o(e),g(e)},placeholder:`ABC-123-XYZ`,label:e(`code`)}),(0,n.jsx)(Mx,{type:`submit`,className:`w-full`,pending:s,disabled:!a,children:e(`continue`)})]})}),(0,n.jsx)(Hw,{children:i.input_data.enable_email_identification&&(0,n.jsx)(Mx,{className:`w-full`,variant:`secondary`,onClick:()=>f(!0),children:e(`useEmail`)})})]})}):(0,n.jsx)(mT,{id:l,onSuccess:async()=>m(sP.contactOverview),onCancel:()=>u(null)})}var lP=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),uP=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),dP=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),fP=e=>{let t=dP(e);return t.charAt(0).toUpperCase()+t.slice(1)},pP={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},mP=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},hP=(0,t.createContext)({}),gP=()=>(0,t.useContext)(hP),_P=(0,t.forwardRef)(({color:e,size:n,strokeWidth:r,absoluteStrokeWidth:i,className:a=``,children:o,iconNode:s,...c},l)=>{let{size:u=24,strokeWidth:d=2,absoluteStrokeWidth:f=!1,color:p=`currentColor`,className:m=``}=gP()??{},h=i??f?Number(r??d)*24/Number(n??u):r??d;return(0,t.createElement)(`svg`,{ref:l,...pP,width:n??u??pP.width,height:n??u??pP.height,stroke:e??p,strokeWidth:h,className:lP(`lucide`,m,a),...!o&&!mP(c)&&{"aria-hidden":`true`},...c},[...s.map(([e,n])=>(0,t.createElement)(e,n)),...Array.isArray(o)?o:[o]])}),vP=(e,n)=>{let r=(0,t.forwardRef)(({className:r,...i},a)=>(0,t.createElement)(_P,{ref:a,iconNode:n,className:lP(`lucide-${uP(fP(e))}`,`lucide-${e}`,r),...i}));return r.displayName=fP(e),r},yP=vP(`arrow-down-right`,[[`path`,{d:`m7 7 10 10`,key:`1fmybs`}],[`path`,{d:`M17 7v10H7`,key:`6fjiku`}]]),bP=vP(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),xP=vP(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),SP=vP(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),CP=vP(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),wP=vP(`coins`,[[`path`,{d:`M13.744 17.736a6 6 0 1 1-7.48-7.48`,key:`bq4yh3`}],[`path`,{d:`M15 6h1v4`,key:`11y1tn`}],[`path`,{d:`m6.134 14.768.866-.5 2 3.464`,key:`17snzx`}],[`circle`,{cx:`16`,cy:`8`,r:`6`,key:`14bfc9`}]]),TP=vP(`gift`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M20 11v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8`,key:`1sqzm4`}],[`path`,{d:`M7.5 7a1 1 0 0 1 0-5A4.8 8 0 0 1 12 7a4.8 8 0 0 1 4.5-5 1 1 0 0 1 0 5`,key:`kc0143`}],[`rect`,{x:`3`,y:`7`,width:`18`,height:`4`,rx:`1`,key:`1hberx`}]]),EP=vP(`mail-check`,[[`path`,{d:`M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8`,key:`12jkf8`}],[`path`,{d:`m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7`,key:`1ocrg3`}],[`path`,{d:`m16 19 2 2 4-4`,key:`1b14m6`}]]),DP=vP(`shopping-bag`,[[`path`,{d:`M16 10a4 4 0 0 1-8 0`,key:`1ltviw`}],[`path`,{d:`M3.103 6.034h17.794`,key:`awc11p`}],[`path`,{d:`M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z`,key:`o988cm`}]]),OP=vP(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),kP=vP(`ticket-check`,[[`path`,{d:`M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z`,key:`qn84l0`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),AP=vP(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),jP=vP(`wallet`,[[`path`,{d:`M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1`,key:`18etb6`}],[`path`,{d:`M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4`,key:`xoc0q4`}]]),MP=vP(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function NP(){let e=XS(),{t}=U();return(0,n.jsxs)(Mx,{size:`md`,className:`mb-4 pl-0 text-core-gray-600`,onClick:()=>e(-1),variant:`link-gray`,children:[(0,n.jsx)(SP,{className:`size-4 transition-transform duration-200 group-hover:-translate-x-0.5`}),t(`back`)]})}function PP({value:e,valueSetter:t,enabled:r,maxValue:i}){let[a,o]=(0,h.useState)(!1),s=(0,h.useRef)(null),c=(0,h.useRef)(null);(0,h.useEffect)(()=>{p(e?e.toString():``)},[]);let l=e=>{let n=f(e?parseInt(e,10):0);t(n),p(n?n.toString():``)},u=n=>{let{key:r}=n;if([`Backspace`,`Tab`,`ArrowLeft`,`ArrowRight`].includes(r)&&r!==`Backspace`)return;if(e===0&&!/^[1-9]$/.test(r)||e!==0&&!/^[0-9]$/.test(r)&&r!==`Backspace`){n.preventDefault();return}n.preventDefault();let i;if(r!==`Backspace`)i=parseInt(e===0?r:`${e}${r}`,10);else{let t=e.toString().slice(0,-1);i=t.length?parseInt(t,10):0}let a=f(i);t(a),p(a?a.toString():``)},d=e=>{e.preventDefault();let n=e.clipboardData.getData(`text`);if(!/^[0-9]+$/.test(n))return;let r=f(parseInt(n,10));t(r),p(r?r.toString():``)},f=e=>i===void 0?e:Math.min(e,i),p=e=>{c?.current&&(e?c.current.style.width=`${Math.max(e.length,3)*3}rem`:c.current.style.width=`calc(3rem + 14px)`)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`input`,{ref:c,className:`h-full w-[65px] rounded-sm border-gray-200 border-transparent text-5xl [appearance:textfield] focus:border-transparent focus:ring-0 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none`,type:`number`,pattern:`[0-9]*`,inputMode:`numeric`,placeholder:`0`,value:e?(e/100).toFixed(2):``,onKeyDown:u,onPaste:d,onChange:()=>void 0,onFocus:()=>o(!0),onBlur:()=>o(!1)}),r&&(0,n.jsx)(`div`,{className:`right-2 bottom-2 left-2 z-50 mx-auto mobile:hidden w-[98vw] max-w-[1200px] ${!a&&`hidden`} absolute`,children:(0,n.jsx)(Mo,{keyboardRef:s,layout:{default:[`1 2 3`,`4 5 6`,`7 8 9`,`00 0 {bksp}`]},theme:`hg-theme-default hg-layout-numeric numeric-theme`,onChange:l})})]})}var FP=`en-GB`;function IP(e){if($r(e))return FP;let t=e.replace(/_/g,`-`),n=Intl.NumberFormat.supportedLocalesOf([t]);return n.length>0?n[0]:FP}function LP(){let{i18n:e}=U(),{portalSession:t}=H();return{formatAmountInCents:n=>{if($r(n))return``;let r=IP(e.language);return new Intl.NumberFormat(r,{style:`currency`,currency:t.currency||`EUR`,minimumFractionDigits:2}).format(n/100)},getSymbol:t=>0 .toLocaleString(e.language,{style:`currency`,currency:t??`EUR`,minimumFractionDigits:0,maximumFractionDigits:0}).replace(/\d/g,``).trim()}}function RP(){let{mutate:e}=H();return{get:()=>e().then(e=>e.data.data.events),post:()=>{e().then(e=>{Yr(e.data.data.events)})}}}var zP=1e5;function BP(){let{t:e}=U(),{id:t}=eC(),{errorToast:r,successToast:i}=ca(),[a,o]=(0,h.useState)(!1),{portalSession:s,mutate:c}=H(),l=zw(),{formatAmountInCents:u,getSymbol:d}=LP(),{onUseGiftcard:f}=wo(),[p,m]=(0,h.useState)(0),[g,_]=(0,h.useState)(null),{post:y}=RP(),[b,x]=(0,h.useState)(null),S=cT({url:`${s.uuid}/giftcards/${t}`,dataSetter:_}),C=g?.amount_in_cents??0,w=b===`redeem`?Math.min(zP,C):zP,T=b===`redeem`,E=T?-p:p,D=!!b&&p>0&&p<=w&&!a,O=e=>{x(e),m(t=>Math.min(t,e===`redeem`?Math.min(zP,C):zP))},k=()=>{!g||!D||(o(!0),l.post(`${s.uuid}/giftcards/${g.id}/transaction`,{amount_in_cents:E}).then(t=>{S.mutate(),c(),y(),f?.(t.data.data),m(0),x(null),i(`${e(`transactionSuccessful`)}. ${e(`amount`)}: ${Jr(E,s.currency)}`)}).catch(r).finally(()=>o(!1)))};return(0,n.jsx)(qw,{children:(0,n.jsxs)(Bw,{children:[(0,n.jsxs)(Uw,{children:[(0,n.jsx)(NP,{}),(0,n.jsx)(Gw,{children:e(`giftcard`)}),(0,n.jsx)(Ww,{children:g?.hash})]}),(0,n.jsx)(Vw,{children:(0,n.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,n.jsxs)(`div`,{className:`rounded-2xl border border-core-primary-100 bg-core-primary-50 p-5`,children:[(0,n.jsx)(`p`,{className:`font-medium text-gray-500 text-sm`,children:e(`balance`)}),(0,n.jsx)(`p`,{className:`mt-1 font-bold text-4xl text-core-primary-700`,children:u(C)})]}),b!==null&&(0,n.jsxs)(`div`,{className:`rounded-2xl border p-5 ${T?`border-core-red-200 bg-core-red-50`:`border-core-primary-100 bg-core-primary-50`}`,children:[(0,n.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-3`,children:[(0,n.jsxs)(`div`,{children:[(0,n.jsx)(`p`,{className:`font-semibold text-sm ${T?`text-core-red-700`:`text-core-primary-700`}`,children:e(T?`redeem`:`topUp`)}),(0,n.jsxs)(`p`,{className:`text-gray-500 text-sm`,children:[`Max `,u(w)]})]}),(0,n.jsxs)(`div`,{className:`rounded-full px-3 py-1 font-bold text-sm ${T?`bg-core-red-100 text-core-red-700`:`bg-core-primary-100 text-core-primary-700`}`,children:[T?`-`:`+`,u(p)]})]}),(0,n.jsxs)(`div`,{className:`flex items-center justify-center gap-1 rounded-xl bg-core-white-900 p-4 font-bold text-5xl shadow-sm`,children:[(0,n.jsxs)(`p`,{className:T?`text-core-red-600`:``,children:[T&&`-`,d(s.currency)]}),(0,n.jsx)(PP,{value:p,valueSetter:m,enabled:s.input_data.enable_on_screen_keyboard,maxValue:w})]})]})]})}),(0,n.jsx)(Hw,{children:(0,n.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,n.jsxs)(`div`,{className:`flex flex-row gap-2`,children:[(s.type===v.GIFTCARD||s.type===v.TOP_UP_GIFTCARD)&&(0,n.jsx)(Mx,{className:`grow`,onClick:()=>{b==`top_up`?k():O(`top_up`)},pending:a,disabled:b===`top_up`&&!D,children:b===`top_up`?e(`confirmAndPay`,{amount:u(p)}):e(`topUp`)}),(s.type===v.GIFTCARD||s.type===v.REDEEM_GIFTCARD)&&(0,n.jsx)(Mx,{className:`grow`,onClick:()=>{b==`redeem`?k():O(`redeem`)},pending:a,disabled:C===0||b===`redeem`&&!D,variant:b===`redeem`?`destructive`:`destructive-outline`,children:b===`redeem`?`${e(`redeem`)} -${u(p)}`:e(`redeem`)})]}),b!==null&&(0,n.jsx)(Mx,{className:`grow`,variant:`secondary`,pending:a,onClick:()=>{x(null),m(0)},children:e(`cancel`)})]})})]})})}function VP(){let{t:e}=U(),{errorToast:t,successToast:r}=ca(),[i,a]=(0,h.useState)(!1),{portalSession:o}=H(),s=zw(),[c,l]=(0,h.useState)(``),u=XS(),d=e=>{a(!0),s.get(`${o.uuid}/giftcards/find-by-hash`,{hash:e}).then(e=>{r(),u(`/giftcard/${e.data.data.id}`)}).catch(t).finally(()=>a(!1))};return(0,n.jsx)(qw,{children:(0,n.jsxs)(Bw,{id:Fo,children:[(0,n.jsxs)(Uw,{children:[(0,n.jsx)(Gw,{children:e(`scanOrEnterX`,{x:`code`})}),(0,n.jsx)(Ww,{children:`Accepts giftcard codes`}),(0,n.jsx)(Ww,{children:`Type: ${o.type}`})]}),(0,n.jsx)(Vw,{children:(0,n.jsxs)(Kw,{onSubmit:()=>d(c),children:[(0,n.jsx)(oP,{value:c,onInputChange:l,onScannerChange:e=>{l(e),d(e)},placeholder:`ABC-123-XYZ`,label:e(`hash`)}),(0,n.jsx)(Mx,{type:`submit`,className:`w-full`,pending:i,disabled:!c,children:e(`continue`)})]})})]})})}function HP(e){return e.first_name&&e.last_name?`${e.first_name} ${e.last_name}`:e.first_name?e.first_name:e.email||``}function UP(){let{t:e}=U(),{errorToast:t}=ca(),[r,i]=(0,h.useState)(!1),{uuid:a,portalSession:o,setPortalSession:s,mutate:c}=H(),l=qn();return(0,n.jsx)(qw,{children:(0,n.jsxs)(Bw,{children:[(0,n.jsxs)(Uw,{children:[(0,n.jsx)(Gw,{children:e(`createTransaction`)}),(0,n.jsx)(Ww,{children:e(`forContactX`,{contact:HP(o.contact)})})]}),o.status===_.COMPLETED?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Vw,{children:(0,n.jsx)(`p`,{children:`This portal sessions has been completed`})}),(0,n.jsx)(Hw,{children:(0,n.jsx)(Mx,{className:`w-full`,onClick:()=>s(null),pending:r,children:e(`close`)})})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(Vw,{children:[(0,n.jsx)(`p`,{children:e(`details`)}),(0,n.jsxs)(`p`,{children:[`Unit Value: `,o.input_data.unit_value]})]}),(0,n.jsx)(Hw,{children:(0,n.jsx)(Mx,{className:`w-full`,onClick:()=>{i(!0),l.post(`${a}/credit-receptions/create`,{unit_value:o.input_data.unit_value}).then(()=>{c()}).catch(t).finally(()=>i(!1))},pending:r,children:e(`create`)})})]})]})})}var WP=1e5;function GP(){let{t:e}=U(),{errorToast:t,successToast:r}=ca(),[i,a]=(0,h.useState)(!1),{portalSession:o,mutate:s}=H(),c=zw(),{formatAmountInCents:l,getSymbol:u}=LP(),[d,f]=(0,h.useState)(0),{post:p}=RP(),[m,g]=(0,h.useState)(null),_=o.contact?.prepaid_balance.balance_in_cents??0,y=m===`redeem`?Math.min(WP,_):WP,b=m===`redeem`,x=b?-d:d,S=!!m&&d>0&&d<=y&&!i,C=e=>{g(e),f(t=>Math.min(t,e===`redeem`?Math.min(WP,_):WP))},w=()=>{S&&(a(!0),c.post(`${o.uuid}/prepaid-transactions`,{amount_in_cents:x}).then(t=>{s(),p(),f(0),g(null),r(`${e(`transactionSuccessful`)}! ${e(`totalUpgradedAmount`)}: ${Jr(x,o.currency)}`)}).catch(t).finally(()=>a(!1)))};return(0,n.jsx)(qw,{children:(0,n.jsxs)(Bw,{children:[(0,n.jsxs)(Uw,{children:[(0,n.jsx)(Gw,{children:e(`prepaid`)}),(0,n.jsx)(Ww,{children:`Type: ${o.type}`})]}),(0,n.jsx)(Vw,{children:(0,n.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,n.jsxs)(`div`,{className:`rounded-2xl border border-core-primary-100 bg-core-primary-50 p-5`,children:[(0,n.jsx)(`p`,{className:`font-medium text-gray-500 text-sm`,children:e(`balance`)}),(0,n.jsx)(`p`,{className:`mt-1 font-bold text-4xl text-core-primary-700`,children:l(_)})]}),m!==null&&(0,n.jsxs)(`div`,{className:`rounded-2xl border p-5 ${b?`border-core-red-200 bg-core-red-50`:`border-core-primary-100 bg-core-primary-50`}`,children:[(0,n.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-3`,children:[(0,n.jsxs)(`div`,{children:[(0,n.jsx)(`p`,{className:`font-semibold text-sm ${b?`text-core-red-700`:`text-core-primary-700`}`,children:e(b?`redeem`:`topUp`)}),(0,n.jsxs)(`p`,{className:`text-gray-500 text-sm`,children:[`Max `,l(y)]})]}),(0,n.jsxs)(`div`,{className:`rounded-full px-3 py-1 font-bold text-sm ${b?`bg-core-red-100 text-core-red-700`:`bg-core-primary-100 text-core-primary-700`}`,children:[b?`-`:`+`,l(d)]})]}),(0,n.jsxs)(`div`,{className:`flex items-center justify-center gap-1 rounded-xl bg-core-white-900 p-4 font-bold text-5xl shadow-sm`,children:[(0,n.jsxs)(`p`,{className:b?`text-core-red-600`:``,children:[b&&`-`,u(o.currency)]}),(0,n.jsx)(PP,{value:d,valueSetter:f,enabled:o.input_data.enable_on_screen_keyboard,maxValue:y})]})]})]})}),(0,n.jsx)(Hw,{children:(0,n.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,n.jsxs)(`div`,{className:`flex flex-row gap-2`,children:[(o.type===v.PREPAID||o.type===v.TOP_UP_PREPAID)&&(0,n.jsx)(Mx,{className:`grow`,onClick:()=>{m==`top_up`?w():C(`top_up`)},pending:i,disabled:m===`top_up`&&!S,children:m===`top_up`?e(`confirmAndPay`,{amount:l(d)}):e(`topUp`)}),(o.type===v.PREPAID||o.type===v.PAY_PREPAID)&&(0,n.jsx)(Mx,{className:`grow`,onClick:()=>{m==`redeem`?w():C(`redeem`)},pending:i,disabled:_===0||m===`redeem`&&!S,variant:m===`redeem`?`destructive`:`destructive-outline`,children:m===`redeem`?`${e(`redeem`)} -${l(d)}`:e(`redeem`)})]}),m!==null&&(0,n.jsx)(Mx,{className:`grow`,variant:`secondary`,pending:i,onClick:()=>{g(null),f(0)},children:e(`cancel`)})]})})]})})}function KP(){let{portalSession:e}=H(),t=e.type;return t===v.GIFTCARD||t===v.REDEEM_GIFTCARD||t===v.TOP_UP_GIFTCARD?(0,n.jsx)(TC,{to:`/giftcard`}):t===v.PREPAID||t===v.PAY_PREPAID||t===v.TOP_UP_PREPAID?(0,n.jsx)(TC,{to:`/prepaid`}):t===v.VOUCHER?(0,n.jsx)(TC,{to:`/voucher`}):t===v.PORTAL?(0,n.jsx)(TC,{to:`/portal`}):t===v.GENERIC?(0,n.jsx)(TC,{to:`/generic`}):t===v.POINTS_TRANSACTION?(0,n.jsx)(TC,{to:`/points-transaction`}):(0,n.jsxs)(`p`,{children:[`Unknown portal type: `,t]})}var qP=function(e){return e.INACTIVE=`INACTIVE`,e.ACTIVE=`ACTIVE`,e.EXPIRED=`EXPIRED`,e.LOCKED=`LOCKED`,e.REDEEMED=`REDEEMED`,e.DEACTIVATED=`DEACTIVATED`,e}({});function JP(){let{t:e}=U(),{id:t}=eC(),{errorToast:r,successToast:i}=ca(),[a,o]=(0,h.useState)(!1),{portalSession:s,mutate:c}=H(),l=zw(),{onRedeemVoucher:u}=wo(),{post:d}=RP(),{findOrCreateContact:f}=aT(),{linkContactToSession:p}=oT(),[m,g]=(0,h.useState)(!0),[v,y]=(0,h.useState)(null),[b,x]=(0,h.useState)(``),S=cT({url:`${s.uuid}/vouchers/${t}`,dataSetter:y}),C=async(t,n)=>{await l.post(`${s.uuid}/vouchers/${t.id}/link-to-contact/${n.id}`).then(t=>(i(e(`voucherWasLinked`)),t))},w=async t=>{o(!0);try{await p(t),await l.post(`${s.uuid}/vouchers/${v.id}/redeem`).then(t=>{u?.(t.data.data),d(),c(),i(e(`voucherWasRedeemed`))}).catch(r),await S.mutate()}catch(e){r(e)}finally{o(!1)}},T=async()=>{if(v){o(!0);try{let e=await f({email:b,createIfNotFound:m});await C(v,e),await p(e),await S.mutate()}catch(e){r(e)}finally{o(!1)}}},E=v?.contact;return(0,n.jsx)(qw,{children:(0,n.jsxs)(Bw,{children:[(0,n.jsxs)(Uw,{children:[(0,n.jsx)(NP,{}),(0,n.jsx)(Gw,{children:e(`voucher`)}),(0,n.jsx)(Ww,{children:v?.code})]}),(0,n.jsx)(Vw,{children:E?(0,n.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,n.jsx)(fT,{variant:`success`,children:e(`thisVoucherIsLinkedToContact`,{contact:E.email})}),(0,n.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-xl border p-3 text-sm shadow-sm ${v.status===qP.REDEEMED?`border-core-primary-100 bg-core-primary-50`:`border-core-gray-100 bg-white`}`,children:[(0,n.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,n.jsx)(`img`,{src:v.promotion.image_url??`https://static.piggy.nl/images/fallback_image.png`,alt:`voucher_image`,className:`h-12 w-12 shrink-0 rounded-lg object-cover object-center`}),(0,n.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,n.jsx)(`p`,{className:`truncate font-semibold text-core-gray-900`,children:v.name}),v.status===qP.REDEEMED?(0,n.jsx)(`p`,{className:`text-core-gray-500`,children:e(`redeemed`)}):(0,n.jsx)(`p`,{className:`text-core-primary-500`,children:v.expiration_date?`Valid until ${new Date(v.expiration_date).toLocaleDateString()}`:e(`nonExpiring`)})]})]}),(0,n.jsx)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg bg-white/70 px-3 py-2`,children:(0,n.jsxs)(`p`,{className:`truncate text-right font-semibold text-core-${v.status===qP.REDEEMED?`gray`:`primary`}-500`,children:[`Code: `,(0,n.jsx)(`span`,{className:`font-semibold`,children:v.code})]})})]})]}):(0,n.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,n.jsx)(fT,{children:e(`thisVoucherIsNotLinkedToAContact`)}),(0,n.jsx)(nT,{value:b,placeholder:`john.doe@example.com`,label:e(`emailAddress`),onChange:e=>x(e.target.value),beforeIcon:`mail`}),(0,n.jsx)(tT,{required:!0,label:e(`createContactIfNotFound`),defaultChecked:m,onChange:e=>g(e)})]})}),(0,n.jsx)(Hw,{children:E?(0,n.jsx)(`div`,{className:`flex flex-col gap-2`,children:(0,n.jsx)(Mx,{className:`w-full`,disabled:v.status!==qP.ACTIVE||a||s.status!==_.ACTIVE,onClick:()=>w(E),pending:a,children:e(`redeemVoucher`)})}):(0,n.jsx)(`div`,{className:`flex flex-col gap-2`,children:(0,n.jsx)(Mx,{className:`w-full`,onClick:T,pending:a,disabled:!b,children:e(m?`createContactAndLink`:`findContactAndLink`)})})})]})})}function YP(){let{t:e}=U(),{errorToast:t,successToast:r}=ca(),[i,a]=(0,h.useState)(!1),{portalSession:o}=H(),s=zw(),[c,l]=(0,h.useState)(``),u=XS(),d=e=>{a(!0),s.get(`${o.uuid}/vouchers/find-by-code`,{hash:e}).then(e=>{r(),u(`/voucher/${e.data.data.id}`)}).catch(t).finally(()=>a(!1))};return(0,n.jsx)(qw,{children:(0,n.jsxs)(Bw,{id:Fo,children:[(0,n.jsxs)(Uw,{children:[(0,n.jsx)(Gw,{children:e(`scanOrEnterX`,{x:`code`})}),(0,n.jsx)(Ww,{children:`Accepts voucher codes`}),(0,n.jsx)(Ww,{children:`Type: ${o.type}`})]}),(0,n.jsx)(Vw,{children:(0,n.jsxs)(Kw,{onSubmit:()=>d(c),children:[(0,n.jsx)(oP,{value:c,onInputChange:l,onScannerChange:e=>{l(e),d(e)},placeholder:`ABC-123-XYZ`,label:e(`code`)}),(0,n.jsx)(Mx,{type:`submit`,className:`w-full`,pending:i,disabled:!c,children:e(`continue`)})]})})]})})}function XP(e){let{t}=U(),{errorToast:r,successToast:i}=ca(),[a,o]=(0,h.useState)(!1),{portalSession:s,mutate:c}=H(),l=zw(),[u,d]=(0,h.useState)(null),[f,p]=(0,h.useState)(``),m=e=>{o(!0),l.get(`${s.uuid}/contact-identifiers/find-by-value`,{value:e}).then(e=>{i(),d(e.data.data.id)}).catch(r).finally(()=>o(!1))};return u===null?(0,n.jsx)(qw,{children:(0,n.jsxs)(Bw,{children:[(0,n.jsx)(Uw,{children:(0,n.jsx)(Gw,{children:t(`authenticateViaContactIdentifier`)})}),(0,n.jsx)(Vw,{children:(0,n.jsxs)(Kw,{onSubmit:()=>m(f),children:[(0,n.jsx)(oP,{value:f,onInputChange:p,onScannerChange:e=>{p(e),m(e)},placeholder:`ABC-123-XYZ`,label:t(`code`)}),(0,n.jsx)(Mx,{type:`submit`,className:`w-full`,pending:a,disabled:!f,children:t(`continue`)})]})}),(0,n.jsx)(Hw,{children:(0,n.jsx)(Mx,{className:`w-full`,variant:`secondary`,onClick:()=>e.onCancel(),children:t(`useEmail`)})})]})}):(0,n.jsx)(mT,{id:u,onCancel:()=>d(null),onSuccess:c})}function ZP(){let{portalSession:e,mutate:t}=H(),[r,i]=(0,h.useState)(e.input_data.primary_identification_method===g.EMAIL);return r?(0,n.jsx)(sT,{onCancel:()=>i(!1),onSuccess:t}):(0,n.jsx)(XP,{onCancel:()=>i(!0),onSuccess:t})}function QP(e){let{portalSession:t}=H();return t.contact?e.element:(0,n.jsx)(ZP,{})}var $P=Tb(`inline-flex items-center rounded-lg px-2 py-1 antialiased`,{variants:{color:{primary:`text-core-primary-700 outline-core-primary-200 bg-core-primary-50`,gray:`text-core-gray-700 outline-core-gray-200 bg-core-gray-50`},size:{sm:`text-xs leading-4 `,md:`text-sm leading-5 `},stroke:{true:`outline-solid outline-1`,false:``}},defaultVariants:{color:`primary`,size:`sm`,stroke:!1}}),eF=({label:e,color:t=`primary`,size:r=`sm`,stroke:i=!1})=>(0,n.jsx)(`span`,{className:$P({color:t,size:r,stroke:i}),children:e});eF.displayName=`Badge`;function tF({children:e,className:t=``}){return(0,n.jsx)(`div`,{className:`group relative flex h-full grow flex-col overflow-hidden rounded-2xl border border-core-gray-100 bg-white p-5 shadow-sm transition-all duration-200 hover:border-core-gray-200 hover:shadow-md ${t}`,children:e})}function nF(){let{t:e}=U(),{portalSession:t}=H(),r=t.contact;return(0,n.jsxs)(`div`,{className:`flex gap-3 lg:flex-col`,children:[(0,n.jsxs)(tF,{className:`border-core-primary-100! bg-linear-to-br! from-core-primary-50! via-white! to-white!`,children:[(0,n.jsx)(`div`,{className:`pointer-events-none absolute -top-10 -right-10 h-32 w-32 rounded-full bg-core-primary-100/50 blur-2xl`}),(0,n.jsxs)(`div`,{className:`relative flex h-full flex-col justify-between gap-4`,children:[(0,n.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,n.jsx)(`p`,{className:`font-medium text-core-gray-500 text-xs uppercase tracking-wide`,children:t.loyalty_program.custom_credit_name}),(0,n.jsx)(`div`,{className:`flex size-8 items-center justify-center rounded-full bg-core-primary-100 text-core-primary-600`,children:(0,n.jsx)(wP,{className:`size-4`})})]}),(0,n.jsx)(`p`,{className:`font-semibold text-3xl text-core-gray-900 leading-9 tracking-tight`,children:r.credit_balance.balance.toLocaleString()})]})]}),(0,n.jsx)(tF,{children:(0,n.jsxs)(`div`,{className:`relative flex h-full flex-col justify-between gap-4`,children:[(0,n.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,n.jsx)(`p`,{className:`font-medium text-core-gray-500 text-xs uppercase tracking-wide`,children:e(`prepaidCredit`)}),(0,n.jsx)(`div`,{className:`flex size-8 items-center justify-center rounded-full bg-core-gray-100 text-core-gray-600`,children:(0,n.jsx)(jP,{className:`size-4`})})]}),(0,n.jsx)(`p`,{className:`font-semibold text-3xl text-core-gray-900 leading-9 tracking-tight`,children:Jr(r.prepaid_balance.balance_in_cents,t.currency)})]})})]})}function rF({message:e=``}){return(0,n.jsxs)(`div`,{className:`flex items-center justify-center gap-4 text-core-primary-500`,children:[(0,n.jsx)(Yn,{className:`h-[32px] w-[32px]`}),e&&(0,n.jsx)(`p`,{className:`text-sm`,children:e})]})}var iF=function(e){return e[e.CREDIT_RECEPTION=1]=`CREDIT_RECEPTION`,e[e.PHYSICAL_REWARD_RECEPTION=2]=`PHYSICAL_REWARD_RECEPTION`,e[e.DIGITAL_REWARD_RECEPTION=3]=`DIGITAL_REWARD_RECEPTION`,e}({});function aF(){let{uuid:e}=H(),[t,n]=(0,h.useState)([]),{pending:r,mutate:i}=cT({url:`${e}/loyalty-transactions`,dataSetter:n});return{loyaltyTransactions:t,pending:r,mutate:i}}var oF=e=>new Date(e).toLocaleString(qr.language,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`});function sF(){let{t:e}=U(),{loyaltyTransactions:t,pending:r}=aF();return r?(0,n.jsx)(tF,{children:(0,n.jsx)(rF,{})}):(0,n.jsx)(tF,{children:(0,n.jsxs)(`div`,{className:`flex h-full flex-col justify-between gap-4`,children:[(0,n.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,n.jsx)(`p`,{className:`font-semibold text-base text-core-gray-900 leading-6 tracking-tight`,children:e(`activities`)}),t?.length?(0,n.jsx)(`div`,{className:`flex flex-col gap-2.5`,children:t.slice(0,5).map(t=>{let r=t.type===iF.CREDIT_RECEPTION;return(0,n.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,n.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,n.jsx)(`div`,{className:`flex size-7 shrink-0 items-center justify-center rounded-full ${r?`bg-emerald-50 text-emerald-600`:`bg-rose-50 text-rose-600`}`,children:r?(0,n.jsx)(bP,{className:`size-3.5`}):(0,n.jsx)(yP,{className:`size-3.5`})}),(0,n.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,n.jsx)(`p`,{className:`truncate text-core-gray-700 text-xs`,children:r?e(`transaction`):`${e(`isRedeemed`)} '${t.data.title}'`}),(0,n.jsx)(`p`,{className:`text-[11px] text-core-gray-400 leading-4`,children:oF(t.created_at)})]})]}),(0,n.jsx)(`p`,{className:`shrink-0 font-semibold text-xs ${t.credits>0?`text-emerald-600`:`text-core-gray-700`}`,children:t.credits>0?`+${t.credits}`:t.credits})]},t.uuid)})}):(0,n.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-6 text-center`,children:[(0,n.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-full bg-core-gray-50 text-core-gray-400`,children:(0,n.jsx)(OP,{className:`size-5`})}),(0,n.jsx)(`p`,{className:`text-core-gray-500 text-sm`,children:e(`noActivity`)})]})]}),t?.length>5&&(0,n.jsx)(Iw,{variant:`secondary`,to:`activity`,children:`${e(`all`)} ${e(`activities`).toLowerCase()}`})]})})}function cF(){let{t:e}=U(),{portalSession:t}=H(),r=t.contact,i=(t,n)=>Qr(t,n)?`${Qr(t,n)} ${e(`yearsAgo`)}`:Zr(t,n)?`${Zr(t,n)} ${e(`weeksAgo`)}`:Xr(t,n)?`${Xr(t,n)} ${e(`daysAgo`)}`:e(`today`);return(0,n.jsx)(tF,{children:(0,n.jsxs)(`div`,{className:`flex h-full flex-col gap-4`,children:[(0,n.jsx)(`p`,{className:`font-semibold text-base text-core-gray-900 leading-6 tracking-tight`,children:e(`stats`)}),(0,n.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,n.jsx)(lF,{icon:(0,n.jsx)(xP,{className:`size-4`}),label:e(`firstVisit`),value:r.credit_balance?.first_transaction?.created_at?i(new Date,new Date(r.credit_balance.first_transaction.created_at)):`—`}),(0,n.jsx)(lF,{icon:(0,n.jsx)(CP,{className:`size-4`}),label:e(`lastVisit`),value:r.credit_balance?.last_transaction?.created_at?i(new Date,new Date(r.credit_balance.last_transaction.created_at)):`—`}),(0,n.jsx)(lF,{icon:(0,n.jsx)(DP,{className:`size-4`}),label:e(`totalVisits`),value:`${r.credit_balance.transactions.toLocaleString()} ${e(`visits`)}`}),(0,n.jsx)(lF,{icon:(0,n.jsx)(wP,{className:`size-4`}),label:e(`accumulatedPoints`),value:`${r.credit_balance.points.toLocaleString()} ${t.loyalty_program.custom_credit_name}`})]})]})})}function lF({icon:e,label:t,value:r}){return(0,n.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,n.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-core-gray-50 text-core-gray-600`,children:e}),(0,n.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,n.jsx)(`p`,{className:`truncate font-semibold text-core-gray-900 text-sm leading-5`,children:r}),(0,n.jsx)(`p`,{className:`text-core-gray-500 text-xs`,children:t})]})]})}function uF(){let{uuid:e}=H(),[t,n]=(0,h.useState)(),{pending:r,mutate:i}=xo({url:`${e}/subscriptions/contact`,dataSetter:n});return{subscriptions:t,pending:r,mutate:i}}function dF(){let{t:e}=U(),{subscriptions:t}=uF();return t?(0,n.jsx)(tF,{children:(0,n.jsxs)(`div`,{className:`flex h-full flex-col justify-between gap-4`,children:[(0,n.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,n.jsx)(`p`,{className:`font-semibold text-base text-core-gray-900 leading-6 tracking-tight`,children:e(`subscriptions`)}),t.length?(0,n.jsx)(`div`,{className:`flex flex-col gap-2.5`,children:t.map(t=>(0,n.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,n.jsx)(`p`,{className:`truncate font-medium text-core-gray-800 text-xs`,children:t.subscription_type.name}),(0,n.jsx)(eF,{label:e(t.status.toLowerCase()),size:`sm`,color:t.is_subscribed?`primary`:`gray`})]},t.subscription_type.uuid))}):(0,n.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-6 text-center`,children:[(0,n.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-full bg-core-gray-50 text-core-gray-400`,children:(0,n.jsx)(EP,{className:`size-5`})}),(0,n.jsx)(`p`,{className:`text-core-gray-500 text-sm`,children:e(`subscriptions`)})]})]}),(0,n.jsx)(Iw,{variant:`secondary`,to:`subscriptions`,children:e(`change`)})]})}):(0,n.jsx)(tF,{children:(0,n.jsx)(rF,{})})}function fF(){let{portalSession:e}=H(),t=e.contact,{t:r}=U();return(0,n.jsxs)(Bw,{children:[(0,n.jsx)(Uw,{children:(0,n.jsxs)(`div`,{className:`relative w-full overflow-hidden rounded-2xl border border-core-gray-100 bg-linear-to-br from-core-primary-50 via-white to-core-gray-50 p-6`,children:[(0,n.jsx)(`div`,{className:`pointer-events-none absolute -top-16 -right-16 h-48 w-48 rounded-full bg-core-primary-100/40 blur-3xl`}),(0,n.jsxs)(`div`,{className:`relative inline-grid w-full items-center gap-6 lg:grid-cols-2`,children:[(0,n.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,n.jsx)(`div`,{className:`rounded-full bg-white p-1 shadow-sm ring-1 ring-core-gray-100`,children:(0,n.jsx)(`img`,{src:t.avatar_url??`https://static.piggy.nl/images/fallback_image.png`,alt:`avatar`,className:`aspect-square size-16 w-full grow rounded-full bg-core-white-900 object-cover object-center`})}),(0,n.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,n.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,n.jsx)(`p`,{className:`font-semibold text-core-gray-900 text-xl leading-7 tracking-tight`,children:HP(t)}),t.current_tier&&(0,n.jsx)(eF,{label:t.current_tier.name,size:`sm`,stroke:!0})]}),t.email!==HP(t)&&(0,n.jsx)(`p`,{className:`text-core-gray-500 text-sm`,children:(0,n.jsxs)(`span`,{children:[`Email: `,t.email]})}),(0,n.jsx)(`p`,{className:`text-core-gray-500 text-sm`,children:r(`joinedAtDate`,{date:new Date(t.created_at).toLocaleDateString(qr.language,{month:`long`,year:`numeric`})})})]})]}),(0,n.jsxs)(`div`,{className:`inline-grid gap-2 lg:ml-auto lg:grid-cols-2`,children:[(0,n.jsx)(Iw,{variant:`secondary`,size:`md`,to:`contact-identifiers`,children:r(`goToX`,{x:`identifiers`})}),(0,n.jsx)(Iw,{variant:`secondary`,size:`md`,to:`contact-attributes`,children:r(`editProfile`)})]})]})]})}),(0,n.jsx)(Vw,{children:(0,n.jsxs)(`div`,{className:`grid grid-cols-1 items-stretch gap-4 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,n.jsx)(nF,{}),(0,n.jsx)(cF,{}),(0,n.jsx)(sF,{}),(0,n.jsx)(dF,{})]})})]})}var pF=e=>{let t=new Date(e),n=t.getFullYear()!==new Date().getFullYear();return t.toLocaleString(qr.language,{month:`short`,day:`numeric`,year:n?`numeric`:void 0,hour:`2-digit`,minute:`2-digit`})};function mF(){let{t:e}=U(),{loyaltyTransactions:t}=aF(),{portalSession:r}=H(),i=r.contact;return(0,n.jsxs)(Bw,{className:`md:mx-auto md:max-w-105`,children:[(0,n.jsxs)(Uw,{children:[(0,n.jsx)(NP,{}),(0,n.jsx)(Gw,{children:e(`allActivities`)}),(0,n.jsx)(Ww,{children:e(`checkOutAllActivitiesOfName`,{name:HP(i)})})]}),(0,n.jsx)(Vw,{className:`md:max-h-132`,children:t.length?(0,n.jsx)(`div`,{className:`flex flex-col gap-2.5 overflow-auto`,children:t.map(t=>{let r=t.type===iF.CREDIT_RECEPTION;return(0,n.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl border border-core-gray-100 bg-white p-3 transition-all duration-200 hover:border-core-gray-200 hover:shadow-sm`,children:[(0,n.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,n.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full ${r?`bg-emerald-50 text-emerald-600`:`bg-rose-50 text-rose-600`}`,children:r?(0,n.jsx)(bP,{className:`size-4`}):(0,n.jsx)(yP,{className:`size-4`})}),(0,n.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,n.jsx)(`p`,{className:`truncate text-core-gray-700 text-sm`,children:r?e(`transaction`):`${e(`isRedeemed`)} '${t.data.title}'`}),(0,n.jsx)(`p`,{className:`text-core-gray-400 text-xs leading-4`,children:pF(t.created_at)})]})]}),(0,n.jsx)(`p`,{className:`shrink-0 font-semibold text-sm ${t.credits>0?`text-emerald-600`:`text-core-gray-700`}`,children:t.credits>0?`+${t.credits}`:t.credits})]},t.uuid)})}):(0,n.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-10 text-center`,children:[(0,n.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-full bg-core-gray-50 text-core-gray-400`,children:(0,n.jsx)(OP,{className:`size-6`})}),(0,n.jsx)(`p`,{className:`text-core-gray-500 text-sm`,children:e(`noActivity`)})]})})]})}function hF(e,t){(0,h.useEffect)(()=>{let n=n=>{e.current&&!e.current.contains(n.target)&&t(!1)},r=e=>{e.key===`Escape`&&t(!1)};return document.addEventListener(`mousedown`,n),document.addEventListener(`keydown`,r),()=>{document.removeEventListener(`mousedown`,n),document.removeEventListener(`keydown`,r)}},[])}function gF({option:{label:e},checked:t,onChange:r}){return(0,n.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2 text-sm hover:bg-core-gray-50`,children:[(0,n.jsx)(tT,{defaultChecked:t,onChange:r}),(0,n.jsx)(`p`,{children:e})]})}function _F(e){let{t}=U(),r=(0,h.useRef)(null),[i,a]=(0,h.useState)(!1);hF(r,a);let[o,s]=(0,h.useState)(``),c=e.value?.split(`;`)??[],{name:l,onChange:u}=e,d=(e,t)=>{let n=[];n=e?[...c,t]:c.filter(e=>e!==t),u?.(l??``,n.join(`;`))};return(0,n.jsxs)(`div`,{ref:r,className:`flex flex-col gap-2 antialiased`,children:[(0,n.jsx)(Xw,{htmlFor:e.id,disabled:e.disabled,required:e.required,children:e.label}),(0,n.jsxs)(`div`,{className:`relative`,children:[(0,n.jsxs)(`div`,{className:`flex h-10 items-center justify-between rounded-sm border p-2 ${e.disabled?`pointer-events-none bg-core-gray-50 shadow-none outline-core-gray-200`:`bg-core-white-900 hover:border hover:border-core-gray-300 hover:shadow-none`}`,onClick:()=>!e.disabled&&a(!i),children:[(0,n.jsx)(`div`,{className:`flex gap-1 overflow-hidden text-sm ${e.disabled?`text-core-gray-300`:`text-core-gray-800`}`,children:c?.map(t=>{let r=e.options?.find(e=>e.value===t)?.label;return(0,n.jsxs)(`div`,{className:`pointer-events-none flex items-center overflow-hidden rounded-sm bg-core-gray-100 px-1.5 py-0.5`,children:[(0,n.jsx)(`p`,{className:`truncate`,children:r}),(0,n.jsx)(`span`,{className:`pointer-events-auto cursor-pointer`,onClick:()=>d(!1,t),children:(0,n.jsx)(Dx,{icon:`close`})})]},t)})}),(0,n.jsx)(`span`,{className:`ml-2 text-core-gray-500`,children:i?`▴`:`▾`})]}),(0,n.jsxs)(`div`,{className:`absolute top-11 right-0 left-0 z-50 rounded-sm border bg-core-white-900 shadow-xl ${!i&&`hidden`} py-2`,children:[e.options.length>6&&(0,n.jsx)(`div`,{className:`px-4`,children:(0,n.jsx)(nT,{placeholder:`${t(`search`)}...`,onChange:e=>s(e.target.value)})}),e.options.map(t=>o&&!t.label.toLowerCase().includes(o.toLowerCase())?null:(0,n.jsx)(gF,{option:t,checked:c.includes(t.value),onChange:e=>d(e,t.value)},e.name+t.value))]})]})]})}function vF({label:e,children:t}){return(0,n.jsxs)(`div`,{className:`not-last:mb-2`,children:[(0,n.jsx)(`p`,{className:`mb-2 px-4 text-xs text-core-gray-500`,children:e}),t]})}function yF(e){return(0,n.jsx)(`div`,{className:`px-4 py-2 text-sm hover:bg-core-gray-50`,children:e.label})}function bF({value:e,placeholder:t,open:r,setOpen:i,disabled:a}){return(0,n.jsxs)(`div`,{className:`flex items-center justify-between rounded-sm border p-2 ${a?`pointer-events-none bg-core-gray-50 shadow-none outline-core-gray-200`:`bg-core-white-900 hover:border hover:border-core-gray-300 hover:shadow-none`}`,onClick:()=>!a&&i(!r),children:[(0,n.jsx)(`span`,{className:`text-sm ${a?`text-core-gray-300`:`text-core-gray-800`}`,children:e||t}),(0,n.jsx)(`span`,{className:`ml-2 text-core-gray-500`,children:r?`▴`:`▾`})]})}function xF(e){let t=(0,h.useRef)(null),[r,i]=(0,h.useState)(!1),[a,o]=(0,h.useState)(e.value??``);hF(t,i);let s=(t,n)=>{o(t),i(!1),e.onChange?.(n)},c=h.Children.map(e.children,e=>{if((0,h.isValidElement)(e)){if(e.type===yF){let t=e.props;return(0,n.jsx)(`div`,{onClick:()=>s(t.label,t.value),children:e})}if(e.type===vF){let t=e.props;return(0,h.cloneElement)(e,{},...h.Children.map(t.children,e=>{if((0,h.isValidElement)(e)&&e.type===yF)return(0,n.jsx)(`div`,{onClick:()=>s(e.props.label,e.props.value),children:e})}))}}});return(0,n.jsxs)(`div`,{ref:t,className:`flex flex-col gap-2 antialiased`,children:[(0,n.jsx)(Xw,{description:e.description,disabled:e.disabled,htmlFor:e.id,required:e.required,children:e.label}),(0,n.jsx)(`div`,{children:(0,n.jsxs)(`div`,{className:`relative`,children:[(0,n.jsx)(bF,{value:a,placeholder:e.placeholder,open:r,setOpen:i,disabled:e.disabled}),e.children&&(0,n.jsx)(`div`,{className:`absolute top-11 right-0 left-0 z-50 rounded-sm border bg-core-white-900 shadow-xl ${!r&&`hidden`} py-2`,children:c})]})}),(0,n.jsx)(Xw.Helper,{helperText:e.helperText})]})}function SF(e){let{rows:t}=e;return(0,n.jsxs)(`div`,{className:`flex w-full animate-pulse flex-col items-start space-y-3`,children:[[...Array(t)].map((e,t)=>(0,n.jsx)(`div`,{className:`h-10 w-full rounded-lg bg-gray-100 p-5`},`skeleton_rows_${t}`)),(0,n.jsx)(`span`,{className:`sr-only`,children:`Loading...`})]})}function CF(){let{t:e}=U(),{errorToast:t,successToast:r}=ca(),{uuid:i}=H(),{portalSession:a,mutate:o}=H(),s=a.contact,[c,l]=(0,h.useState)(),[u,d]=(0,h.useState)(!1),[f,p]=(0,h.useState)({}),m=qn();xo({url:`${i}/contact-attributes`,dataSetter:e=>l(e.new_elements)});let g=Object.keys(f).length===0,_=e=>{p({...f,[e.target.name]:e.target.value})},v=(e,t)=>{p({...f,[e]:t})},y=async()=>{d(!0),m.put(`${i}/contact-attributes`,f).then(()=>{o(),p({}),r()}).catch(t).finally(()=>d(!1))},b=e=>Object.hasOwn(f,e)?f[e]:s.custom_attribute_values[e]??``;return(0,n.jsxs)(Bw,{className:`md:mx-auto md:max-w-105`,children:[(0,n.jsxs)(Uw,{children:[(0,n.jsx)(NP,{}),(0,n.jsxs)(`div`,{className:`flex flex-row items-center gap-4 px-1`,children:[(0,n.jsx)(`div`,{className:`rounded-full bg-white p-1 shadow-sm ring-1 ring-core-gray-100`,children:(0,n.jsx)(`img`,{src:s.avatar_url??`https://static.piggy.nl/images/fallback_image.png`,alt:`avatar`,className:`aspect-square size-16 w-full grow rounded-full bg-core-white-900 object-cover object-center`})}),(0,n.jsxs)(`div`,{children:[(0,n.jsx)(`div`,{className:`flex flex-row items-center gap-2`,children:(0,n.jsxs)(`h1`,{className:`text-core-gray-900 text-lg`,children:[s.first_name,` `,s.last_name]})}),(0,n.jsx)(`p`,{className:`text-core-gray-500 text-sm`,children:s.email})]})]})]}),(0,n.jsx)(Vw,{className:`md:max-h-132`,children:c?c.map(e=>e.type===`media_upload`||e.type===`email`?null:e.type===`select`?(0,n.jsx)(xF,{name:e.name,label:e.label,value:b(e.name),onChange:t=>v(e.name,t),disabled:e.disabled,children:e.options.map(e=>(0,n.jsx)(yF,{label:e.label,value:e.value},e.value))},e.name):e.type===`multi_select`?(0,n.jsx)(_F,{name:e.name,value:b(e.name),label:e.label,onChange:v,disabled:e.disabled,options:e.options},e.name):e.type===`birth_date`||e.type===`date_time`?(0,n.jsx)(iT,{id:e.name,name:e.name,label:e.label,type:e.type===`date_time`?`date_time`:`date`,value:b(e.name),disabled:e.disabled,onChange:_},e.name):(0,n.jsx)(nT,{disabled:e.disabled,label:e.label,name:e.name,value:b(e.name),onChange:_},e.name)):(0,n.jsx)(SF,{rows:10})}),(0,n.jsx)(Hw,{children:g?null:(0,n.jsxs)(`div`,{className:`flex gap-2`,children:[(0,n.jsx)(Mx,{onClick:y,disabled:!f,pending:u,children:e(`saveChanges`)}),(0,n.jsx)(Mx,{variant:`secondary`,onClick:()=>p({}),disabled:!f,pending:u,children:e(`cancel`)})]})})]})}function wF({title:e,isOpen:t,onClose:r,primaryAction:i,secondaryAction:a,children:o}){let[s,c]=(0,h.useState)(t),l=(0,h.useRef)(null);(0,h.useEffect)(()=>{c(t)},[t]),(0,h.useEffect)(()=>{let e=l.current;e&&(s?e.show():e.close())},[s]);let u=()=>{r&&r(),c(!1)};return(0,n.jsx)(`div`,{className:`fixed inset-0 z-40 min-h-screen items-center justify-center bg-gray-500 bg-opacity-25 p-4 ${s?`flex`:`hidden`}`,children:(0,n.jsx)(`dialog`,{ref:l,onKeyDown:e=>{e.key===`Escape`&&u()},className:`scrollbar-hide static m-0 max-h-[calc(100vh-2rem)] overflow-auto rounded-lg drop-shadow-md`,children:(0,n.jsxs)(`div`,{className:`rounded-lg bg-white md:min-w-105`,children:[(0,n.jsx)(Uw,{children:(0,n.jsx)(`div`,{className:`flex h-16 items-center`,children:(0,n.jsx)(`p`,{children:e})})}),(0,n.jsx)(Vw,{children:o}),(0,n.jsx)(Hw,{children:(0,n.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[i&&(0,n.jsx)(Mx,{onClick:i.action,disabled:i.disabled,pending:i.loading,children:i.label??``}),a&&(0,n.jsx)(Mx,{onClick:a.action,disabled:a.disabled,pending:a.loading,variant:`secondary`,children:a.label??``})]})})]})})})}function TF(){let{uuid:e}=H(),[t,n]=(0,h.useState)([]),{pending:r,mutate:i}=xo({url:`${e}/contact-identifiers`,dataSetter:n});return{contactIdentifiers:t,pending:r,mutate:i}}function EF(){let{t:e}=U(),{errorToast:t}=ca(),{uuid:r}=H(),{contactIdentifiers:i,pending:a,mutate:o}=TF(),[s,c]=(0,h.useState)(``),[l,u]=(0,h.useState)(!1),d=qn(),f=e=>{c(e),u(!0)},p=async()=>{d.destroy(`${r}/contact-identifiers`,{value:s}).then(()=>o()).catch(t).finally(()=>u(!1))},m=e=>e.name?e.name!==e.value:!1;return(0,n.jsxs)(Bw,{className:`md:mx-auto md:max-w-105`,children:[(0,n.jsxs)(Uw,{children:[(0,n.jsx)(NP,{}),(0,n.jsx)(Gw,{children:e(`contactIdentifiers`)}),(0,n.jsx)(Ww,{children:e(`contactIdentifierDescription`)})]}),(0,n.jsx)(Vw,{className:`md:max-h-132`,children:(0,n.jsx)(`div`,{className:`flex flex-col gap-2`,children:a?(0,n.jsx)(SF,{rows:5}):i.map(e=>(0,n.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border text-xs`,children:[(0,n.jsxs)(`div`,{className:`flex-col pl-4`,children:[(0,n.jsx)(`p`,{className:`font-semibold`,children:e.value}),m(e)&&(0,n.jsx)(`p`,{className:`text-core-gray-500`,children:e.name})]}),(0,n.jsx)(`div`,{className:`h-full border-l p-4 hover:cursor-pointer hover:bg-core-gray-50`,onClick:()=>f?.(e.value),children:(0,n.jsx)(MP,{className:`size-4`})})]},e.value))})}),(0,n.jsx)(Hw,{children:(0,n.jsx)(Iw,{to:`create`,className:`w-full`,variant:`secondary`,children:e(`addIdentifier`)})}),(0,n.jsx)(wF,{title:e(`confirmClearContactIdentifier`),isOpen:l,primaryAction:{label:e(`confirm`),action:p},secondaryAction:{label:e(`cancel`),action:()=>u(!1)},onClose:()=>u(!1),children:(0,n.jsx)(`p`,{children:e(`clearContactIdentifier`,{value:s})})})]})}function DF(){let{t:e}=U(),{errorToast:t}=ca(),{uuid:r}=H(),{portalSession:i}=H(),a=i.contact,{mutate:o}=TF(),[s,c]=(0,h.useState)(``),[l,u]=(0,h.useState)(!1),d=XS(),f=qn(),p=e=>{u(!0),f.post(`${r}/contacts/link-identifier`,{contact_identifier_value:e,email:a.email}).then(()=>{o(),d(`../profile/contact-identifiers`)}).catch(e=>{t(e),u(!1)})};return(0,n.jsxs)(Bw,{id:Fo,className:`md:mx-auto md:max-w-105`,children:[(0,n.jsxs)(Uw,{children:[(0,n.jsx)(NP,{}),(0,n.jsx)(Gw,{children:e(`addIdentifier`)})]}),(0,n.jsxs)(Kw,{onSubmit:()=>p(s),children:[(0,n.jsx)(Vw,{children:(0,n.jsx)(oP,{value:s,onInputChange:c,onScannerChange:e=>{c(e),p(e)},label:e(`contactIdentifier`)})}),(0,n.jsx)(Hw,{children:(0,n.jsx)(Mx,{className:`w-full`,type:`submit`,pending:l,disabled:!s,children:e(`addIdentifier`)})})]})]})}var OF=Tb(`flex shrink bg-white rounded-full transform transition-transform ease-out`,{variants:{size:{md:`w-3 h-3`,lg:`w-7 h-7`}}}),kF=Tb(``,{variants:{size:{md:`pr-4`,lg:`pr-6`}}}),AF=({id:e,disabled:t,onChange:r,defaultChecked:i=!1,size:a=`md`})=>{let o=t,[s,c]=h.default.useState(i),[l,u]=h.default.useState(!1),d=()=>{o||(c(!s),r&&r())},f=()=>{t||u(!0)},p=()=>{u(!1)},m=(0,Jn.default)(`relative py-0.5 pl-0.5 rounded-full`,{"ring-2 ring-core-white-900 outline-core-primary-500 outline-solid outline-2 outline-offset-2":l,"bg-core-primary-500 hover:bg-core-primary-600":s&&!t,"bg-core-gray-200 hover:bg-core-gray-300":!s&&!t,"bg-core-gray-100":t},kF({size:a})),g=a===`lg`?`translate-x-5.5 ease-out`:`translate-x-3.5 ease-out`;return(0,n.jsxs)(`div`,{className:`inline-flex items-center py-1 ${o?`pointer-events-none`:`cursor-pointer `}`,onClick:d,onFocus:f,children:[(0,n.jsx)(`input`,{className:`sr-only `,id:e,type:`checkbox`,checked:s,disabled:o,onBlur:p,onChange:d,onFocus:f}),(0,n.jsx)(`div`,{className:m,children:(0,n.jsx)(`div`,{className:(0,Jn.default)(OF({size:a}),`${s?g:``} ${o?`shadow-none`:`shadow-xs`}`)})})]})},jF=({id:e,children:t,size:r=`md`,description:i,toggleLeft:a=!0,disabled:o,helperText:s,defaultChecked:c=!1,label:l,required:u=!1,tooltip:d,onChange:f})=>{let p=h.default.useId(),m=e??p;return(0,n.jsxs)(`div`,{className:`flex ${a?`flex-row`:`flex-row-reverse`} items-start gap-3`,children:[(0,n.jsx)(AF,{disabled:o,defaultChecked:c,id:m,size:r,onChange:f}),t||(l||i||d||s)&&(0,n.jsxs)(`div`,{className:`inline-flex w-full flex-col self-center`,children:[(0,n.jsx)(Xw,{className:(0,Jn.default)(`font-normal`),description:i,required:u,tooltip:d,htmlFor:m,disabled:o,children:l}),(0,n.jsx)(Xw.Helper,{disabled:o,helperText:s})]})]})};jF.displayName=`Switch`;var MF=h.default.createContext(null);function NF(e=!1){let t=h.default.useContext(MF);if(!t&&!e)throw Error(`Switch.Item must be used within a SwitchGroup or SwitchGroup.Root`);return t}var PF=h.default.forwardRef(({toggleLeft:e=!1,size:t=`md`,children:r,description:i,disabled:a,helperText:o,id:s,label:c,required:l,tooltip:u},d)=>{let f=h.default.useId(),p=s??f,m=c??i??u??o?(0,n.jsxs)(`div`,{className:`inline-flex flex-col`,children:[(0,n.jsx)(Xw,{className:`cursor-default`,description:i,required:l,tooltip:u,htmlFor:p,disabled:a,children:c}),(0,n.jsx)(Xw.Helper,{disabled:a,helperText:o})]}):null;return(0,n.jsx)(MF.Provider,{value:{disabled:a,toggleLeft:e,size:t},children:(0,n.jsxs)(`div`,{ref:d,"aria-describedby":o?`${p}__describer`:void 0,"aria-labelledby":c?`${p}__label`:void 0,className:`flex flex-col gap-4`,role:`group`,children:[c??o??i??u?(0,n.jsx)(`div`,{className:`flex flex-col`,children:m}):null,r?(0,n.jsx)(`div`,{className:(0,Jn.default)(`flex flex-col gap-2`),children:r}):null]})})});PF.displayName=`SwitchGroup`,Object.assign(PF,{Item:({disabled:e,label:t,defaultChecked:r})=>{let{disabled:i,size:a,toggleLeft:o}=NF()??{};return(0,n.jsx)(jF,{toggleLeft:o,disabled:e??i,label:t,defaultChecked:r,size:a})}});var FF=function(e){return e.OPT_OUT=`OPT_OUT`,e.OPT_IN=`OPT_IN`,e.DOUBLE_OPT_IN=`DOUBLE_OPT_IN`,e.FUNCTIONAL=`FUNCTIONAL`,e}({});function IF(){let{t:e}=U(),{errorToast:t}=ca(),{uuid:r}=H(),{subscriptions:i,mutate:a}=uF(),[o,s]=(0,h.useState)({}),[c,l]=(0,h.useState)(!1),u=qn();(0,h.useEffect)(()=>{i&&!Object.keys(o).length&&s(i.reduce((e,t)=>(e[t.subscription_type.name]=t.is_subscribed,e),{}))},[i]);let d=e=>{s(Object.hasOwn(o,e)?{...o,[e]:!o[e]}:{...o,[e]:!0})};return i?(0,n.jsxs)(Bw,{className:`md:mx-auto md:max-w-105`,children:[(0,n.jsxs)(Uw,{children:[(0,n.jsx)(NP,{}),(0,n.jsx)(Gw,{children:e(`subscriptions`)}),(0,n.jsx)(Ww,{children:e(`manageEmailPreferences`)})]}),(0,n.jsx)(Vw,{className:`md:max-h-132`,children:i.map(e=>(0,n.jsxs)(`div`,{className:`mb-2 flex justify-between`,children:[(0,n.jsx)(`p`,{className:`font-semibold text-xs`,children:e.subscription_type.name}),(0,n.jsx)(jF,{defaultChecked:e.is_subscribed,disabled:e.subscription_type.strategy===FF.FUNCTIONAL,onChange:()=>d(e.subscription_type.name)})]},e.subscription_type.uuid))}),(0,n.jsx)(Hw,{children:(0,n.jsx)(Mx,{className:`w-full`,onClick:()=>{l(!0),u.put(`${r}/subscriptions`,{values:o}).then(()=>a()).catch(t).finally(()=>l(!1))},pending:c,disabled:!i?.some(e=>o[e.subscription_type.name]!==e.is_subscribed)||c,children:e(`saveChanges`)})})]}):(0,n.jsx)(rF,{})}function LF({children:e,offset:t,max:r=4,initialCollapsed:i=!0}){let a=(0,h.useRef)(null),[o,s]=(0,h.useState)(0),[c,l]=(0,h.useState)(i),u=c&&h.Children.count(e)>r?r:h.Children.count(e);(0,h.useEffect)(()=>{a.current&&(o?c?a.current.style.marginBottom=`-${o-(o/u+(u-1)*(t??o/u/7.5))}px`:a.current.style.marginBottom=`unset`:s(a.current.offsetHeight))},[c,o]);let d=e=>(100-(u-1-e))/100,f=e=>e*(o/u-(t??o/u/7.5));return(0,n.jsx)(`div`,{ref:a,className:`hover:cursor-pointer`,onClick:()=>u>1&&l(!c),children:h.Children.map(h.Children.toArray(e).slice(-1*u),(e,t)=>(0,n.jsx)(`div`,{className:`${!c&&`not-last:mb-1`} h-full w-full transition-all duration-300 ease-in-out`,style:{transform:c&&u>1?`scaleX(${d(t)}) translateY(-${f(t)}px)`:void 0},children:e}))})}function RF(){let{uuid:e}=H(),[t,n]=(0,h.useState)([]),{pending:r,mutate:i}=xo({url:`${e}/rewards`,dataSetter:n});return{rewards:t,pending:r,mutate:i}}function zF({value:e,max:t,label:r}){return(0,n.jsxs)(`div`,{children:[(0,n.jsx)(`div`,{className:`mb-1 text-right font-sm text-core-gray-500`,children:r}),(0,n.jsx)(`div`,{className:`h-1 w-full rounded-full bg-core-gray-200`,children:(0,n.jsx)(`div`,{className:`h-1 rounded-full bg-core-primary-500`,style:{width:`${Math.min(e/t*100,100)}%`}})})]})}function BF({reward:e,selected:t,setSelected:r,disabled:i,readOnly:a}){let{portalSession:o}=H(),s=o.contact;return(0,n.jsxs)(`div`,{className:`max-h-12 rounded-lg border ${i?`pointer-events-none opacity-40`:!a&&`cursor-pointer`}`,children:[(0,n.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg text-xs ${i?`px-2 pt-2`:`p-2`}`,onClick:a?void 0:()=>t?.uuid===e.uuid?r(void 0):r(e),children:[(0,n.jsxs)(`div`,{className:`mr-4 flex items-center gap-4 overflow-hidden`,children:[(0,n.jsx)(`img`,{src:e.media?.value?e.media.value:`https://static.piggy.nl/images/fallback_image.png`,alt:`reward_image`,className:`h-8 w-8 rounded-sm object-cover object-center`}),(0,n.jsx)(`p`,{className:`truncate`,children:e.title??e.description})]}),(0,n.jsx)(`p`,{className:`whitespace-nowrap text-core-primary-500`,children:(e=>`${Number(e.required_credits).toLocaleString()} ${o.loyalty_program.custom_credit_name}`)(e)})]}),e.required_credits-s.credit_balance.balance>0&&(0,n.jsx)(zF,{value:s.credit_balance.balance,max:e.required_credits})]})}function VF({selected:e,setSelected:t}){let{t:r}=U(),{portalSession:i}=H(),a=i.contact,{rewards:o,pending:s}=RF(),c=o?.filter(e=>e.required_credits<=a.credit_balance.balance),l=o?.filter(e=>e.required_credits>a.credit_balance.balance);return(0,n.jsx)(n.Fragment,{children:s?(0,n.jsx)(SF,{rows:10}):(0,n.jsxs)(`div`,{className:`flex flex-col gap-3 md:max-h-132`,children:[(0,n.jsx)(`div`,{className:`flex flex-col gap-1`,children:c?.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`p`,{className:`font-light text-core-gray-500 text-sm`,children:r(`redeemableRewards`)}),c.map(r=>(0,n.jsx)(BF,{reward:r,selected:e,setSelected:t},r.uuid))]})}),(0,n.jsx)(`div`,{className:`flex flex-col gap-1`,children:l?.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`p`,{className:`font-light text-core-gray-500 text-sm`,children:r(`saveABitMore`)}),l.map(r=>(0,n.jsx)(BF,{reward:r,selected:e,setSelected:t,disabled:!0},r.uuid))]})})]})})}function HF(){let{t:e}=U(),{errorToast:t,successToast:r}=ca(),{portalSession:i,mutate:a}=H(),o=i.contact,{onClaimReward:s}=wo(),[c,l]=(0,h.useState)(),[u,d]=(0,h.useState)(!1),[f,p]=(0,h.useState)(!1),{post:m}=RP(),{rewards:g}=RF(),_=qn();(0,h.useEffect)(()=>{c&&p(!0)},[c]);let v=e=>{a().then(t=>{let n=t.data.data.events.filter(e=>e.type===y.REWARD_RECEPTION&&e.data.reward.uuid===c.uuid).reduce((e,t)=>new Date(e.created_at)>new Date(t.created_at)?e:t);s?.(e,n.data.uuid)})},b=()=>{d(!0),_.post(`${i.uuid}/rewards/claim`,{uuid:c.uuid}).then(t=>{v(t.data.data),m(),a(),r(e(`rewardClaimed`,{name:t.data.data.title}))}).catch(t).finally(()=>{p(!1),l(void 0),d(!1)})},x=(0,h.useMemo)(()=>g.length==0?[]:i.events.filter(e=>e.type===y.REWARD_RECEPTION).map(e=>g.find(t=>t.uuid===e.data.reward.uuid)).filter(e=>e),[g,i.events]);return(0,n.jsxs)(`div`,{className:`h-full md:mx-auto md:max-w-105`,children:[(0,n.jsxs)(Bw,{children:[(0,n.jsx)(Uw,{children:(0,n.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,n.jsx)(Gw,{children:e(`rewards`)}),(0,n.jsxs)(`div`,{className:`flex flex-col items-center justify-center`,children:[(0,n.jsx)(`p`,{className:`text-sm`,children:o.credit_balance.balance.toLocaleString()}),(0,n.jsx)(`p`,{className:`text-core-gray-500 text-xs`,children:i.loyalty_program.custom_credit_name})]})]})}),(0,n.jsx)(Vw,{children:(0,n.jsx)(VF,{selected:c,setSelected:l})}),(0,n.jsx)(Hw,{children:(0,n.jsx)(LF,{children:x.map((e,t)=>(0,n.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-core-primary-100 bg-core-primary-50 p-2 text-xs`,children:[(0,n.jsxs)(`div`,{className:`mr-4 flex items-center gap-4 overflow-hidden`,children:[(0,n.jsx)(`img`,{src:e.media?.value?e.media.value:`https://static.piggy.nl/images/fallback_image.png`,alt:`voucher_image`,className:`h-8 w-8 rounded-sm object-cover object-center`}),(0,n.jsx)(`p`,{className:`truncate`,children:e.title??e.description})]}),(0,n.jsxs)(`p`,{className:`text-core-primary-500`,children:[e.required_credits,` `,i.loyalty_program.custom_credit_name]})]},`${t}-${e.uuid}`))},x.length)})]}),(0,n.jsx)(wF,{title:e(`confirmRewardRedemption`),isOpen:f,primaryAction:{label:e(`confirm`),action:b,loading:u},secondaryAction:{label:e(`cancel`),action:()=>p(!1)},onClose:()=>p(!1),children:(0,n.jsx)(`div`,{className:`flex flex-col gap-4`,children:c&&(0,n.jsx)(BF,{reward:c,selected:c,setSelected:l,readOnly:!0})})})]})}function UF(){let{uuid:e}=H(),[t,n]=(0,h.useState)([]),{pending:r,mutate:i}=xo({url:`${e}/vouchers`,dataSetter:n});return{vouchers:t,pending:r,mutate:i}}function WF({voucher:e,selected:t,setSelected:r}){let{t:i}=U();return(0,n.jsxs)(`div`,{className:`flex cursor-pointer items-center justify-between gap-4 rounded-lg ${e.status===qP.REDEEMED?`border border-core-primary-100 bg-core-primary-50`:`border bg-white`} p-2 text-xs`,onClick:()=>t?.code===e.code?r(null):r(e),children:[(0,n.jsxs)(`div`,{className:`mr-4 flex items-center gap-4 overflow-hidden`,children:[(0,n.jsx)(`img`,{src:e.promotion.image_url??`https://static.piggy.nl/images/fallback_image.png`,alt:`voucher_image`,className:`h-8 w-8 rounded-sm object-cover object-center`}),(0,n.jsxs)(`div`,{className:`overflow-hidden text-ellipsis`,children:[(0,n.jsx)(`p`,{className:`font-semibold`,children:e.name}),e.status===qP.REDEEMED?(0,n.jsx)(`p`,{className:`text-core-gray-500`,children:i(`redeemed`)}):(0,n.jsx)(`p`,{className:`text-core-primary-500`,children:e.expiration_date?`Valid until ${new Date(e.expiration_date).toLocaleDateString()}`:i(`nonExpiring`)})]})]}),(0,n.jsx)(`p`,{className:`text-core-${e.status===qP.REDEEMED?`gray`:`primary`}-500`,children:e.code})]})}function GF(){let{t:e}=U(),{errorToast:t,successToast:r}=ca(),{portalSession:i}=H(),{onRedeemVoucher:a}=wo(),{post:o}=RP(),{mutate:s}=UF(),[c,l]=(0,h.useState)(),[u,d]=(0,h.useState)(!1),[f,p]=(0,h.useState)(!1),{vouchers:m,pending:g}=UF(),_=qn();(0,h.useEffect)(()=>{c&&p(!0)},[c]);let v=()=>{d(!0),_.post(`${i.uuid}/vouchers/redeem`,{code:c.code}).then(t=>{o(),a?.(t.data.data),r(e(`voucherSuccessfullyRedeemed`)),s()}).catch(t).finally(()=>{b(),d(!1)})},b=()=>{p(!1),l(void 0)},x=()=>i.events.filter(e=>e.type===y.VOUCHER_REDEEMED);return(0,n.jsxs)(`div`,{className:`h-full md:mx-auto md:max-w-105`,children:[(0,n.jsxs)(Bw,{children:[(0,n.jsx)(Uw,{children:(0,n.jsx)(Gw,{children:e(`vouchers`)})}),(0,n.jsx)(Vw,{children:g?(0,n.jsx)(SF,{rows:5}):(0,n.jsx)(`div`,{className:`flex flex-col gap-1 md:max-h-132`,children:(0,n.jsx)(`div`,{className:`flex flex-col gap-1 md:max-h-132`,children:m.length>0?m.map(e=>(0,n.jsx)(WF,{voucher:e,selected:c,setSelected:l},e.code)):(0,n.jsx)(`p`,{className:`text-center text-core-gray-500 text-sm`,children:e(`vouchersEmptyState`)})})})}),(0,n.jsx)(Hw,{children:(0,n.jsx)(LF,{children:x().map((t,r)=>(0,n.jsx)(`div`,{className:`flex items-center gap-2 rounded-lg border border-core-primary-100 bg-core-primary-50 p-2`,children:(0,n.jsx)(`div`,{className:`flex h-full flex-col justify-between text-xs`,children:(0,n.jsxs)(`div`,{className:`overflow-hidden`,children:[(0,n.jsx)(`p`,{className:`font-semibold`,children:t.data.name}),(0,n.jsxs)(`p`,{className:`text-ellipsis text-core-gray-500`,children:[t.data.code,` - `,e(`applied`)]})]})})},`${r}-${t.data.uuid}`))},x().length)})]}),(0,n.jsx)(wF,{title:e(`confirmVoucherRedemption`),isOpen:f,primaryAction:{label:e(`confirm`),action:v,loading:u},secondaryAction:{label:e(`cancel`),action:b},onClose:b,children:(0,n.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,n.jsx)(`p`,{children:e(`redeemTitle`,{title:c?.name})}),c&&(0,n.jsx)(WF,{voucher:c,setSelected:l})]})})]})}function KF(){let{t:e}=U(),t=KS(),r=e=>t.pathname.includes(e);return(0,n.jsxs)(`div`,{className:`relative h-full w-full select-none overflow-auto bg-core-gray-50`,children:[(0,n.jsx)(`div`,{className:`fixed bottom-0 z-10 flex h-17.5 w-full justify-center border-core-gray-200 border-t bg-white/90 px-2 backdrop-blur-md lg:top-3 lg:bottom-auto lg:h-auto lg:border-0 lg:bg-transparent lg:px-0 lg:pt-1`,children:(0,n.jsx)(`div`,{className:`flex w-full items-center gap-1 lg:w-auto lg:gap-0 lg:rounded-full lg:border lg:border-core-gray-200 lg:bg-white/90 lg:p-1 lg:shadow-sm lg:backdrop-blur-md`,children:[{label:e(`contact`),Icon:AP,pathname:`data`},{label:e(`rewards`),Icon:TP,pathname:`rewards`},{label:e(`vouchers`),Icon:kP,pathname:`vouchers`}].map(e=>{let t=r(e.pathname),i=e.Icon;return(0,n.jsxs)(yw,{to:e.pathname,type:`button`,className:`group relative flex flex-1 flex-col items-center justify-center gap-1 rounded-xl px-3 py-2 font-medium text-xs transition-all duration-200 ease-out focus:outline-hidden lg:flex-none lg:flex-row lg:gap-2 lg:rounded-full lg:px-4 lg:py-1.5 lg:text-sm ${t?`text-core-primary-600 lg:bg-core-primary-500 lg:text-white lg:shadow-sm`:`text-core-gray-500 hover:text-core-gray-900 lg:hover:bg-core-gray-100`}`,children:[(0,n.jsx)(`span`,{className:`flex h-8 w-8 items-center justify-center rounded-full transition-colors duration-200 ease-out lg:h-auto lg:w-auto lg:rounded-none ${t?`bg-core-primary-50 lg:bg-transparent`:``}`,children:(0,n.jsx)(i,{"aria-hidden":`true`,className:`h-5 w-5 fill-none stroke-[1.75] stroke-current lg:h-4 lg:w-4`})}),e.label]},e.pathname)})})}),(0,n.jsx)(`div`,{className:`h-screen w-screen pb-17.5 md:px-4 md:pt-4 md:pb-21.5 lg:pt-16.5 lg:pb-4`,children:(0,n.jsx)(`div`,{className:`mx-auto h-full max-h-full max-w-6xl`,children:(0,n.jsx)(EC,{})})})]})}function qF(){return(0,n.jsx)(kC,{children:(0,n.jsxs)(DC,{path:`/contact`,element:(0,n.jsx)(KF,{}),children:[(0,n.jsx)(DC,{path:`data`,element:(0,n.jsx)(fF,{})}),(0,n.jsx)(DC,{path:`data/activity`,element:(0,n.jsx)(mF,{})}),(0,n.jsx)(DC,{path:`data/subscriptions`,element:(0,n.jsx)(IF,{})}),(0,n.jsx)(DC,{path:`data/contact-identifiers`,element:(0,n.jsx)(EF,{})}),(0,n.jsx)(DC,{path:`data/contact-identifiers/create`,element:(0,n.jsx)(DF,{})}),(0,n.jsx)(DC,{path:`data/contact-attributes`,element:(0,n.jsx)(CF,{})}),(0,n.jsx)(DC,{path:`rewards/*`,element:(0,n.jsx)(HF,{})}),(0,n.jsx)(DC,{path:`vouchers/*`,element:(0,n.jsx)(GF,{})})]})})}function JF(){return(0,n.jsxs)(kC,{children:[(0,n.jsx)(DC,{path:`/`,element:(0,n.jsx)(KP,{})}),(0,n.jsx)(DC,{path:`generic`,element:(0,n.jsx)(cP,{})}),(0,n.jsx)(DC,{path:`giftcard`,element:(0,n.jsx)(VP,{})}),(0,n.jsx)(DC,{path:`giftcard/:id`,element:(0,n.jsx)(BP,{})}),(0,n.jsx)(DC,{path:`voucher`,element:(0,n.jsx)(YP,{})}),(0,n.jsx)(DC,{path:`voucher/:id`,element:(0,n.jsx)(JP,{})}),(0,n.jsx)(DC,{path:`portal/*`,element:(0,n.jsx)(QP,{element:(0,n.jsx)(qF,{})})}),(0,n.jsx)(DC,{path:`prepaid`,element:(0,n.jsx)(QP,{element:(0,n.jsx)(GP,{})})}),(0,n.jsx)(DC,{path:`points-transaction`,element:(0,n.jsx)(QP,{element:(0,n.jsx)(UP,{})})})]})}var{slice:YF,forEach:XF}=[];function ZF(e){return XF.call(YF.call(arguments,1),t=>{if(t)for(let n in t)e[n]===void 0&&(e[n]=t[n])}),e}function QF(e){return typeof e==`string`?[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(t=>t.test(e)):!1}var $F=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,eI=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:`/`},r=`${e}=${encodeURIComponent(t)}`;if(n.maxAge>0){let e=n.maxAge-0;if(Number.isNaN(e))throw Error(`maxAge should be a Number`);r+=`; Max-Age=${Math.floor(e)}`}if(n.domain){if(!$F.test(n.domain))throw TypeError(`option domain is invalid`);r+=`; Domain=${n.domain}`}if(n.path){if(!$F.test(n.path))throw TypeError(`option path is invalid`);r+=`; Path=${n.path}`}if(n.expires){if(typeof n.expires.toUTCString!=`function`)throw TypeError(`option expires is invalid`);r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+=`; HttpOnly`),n.secure&&(r+=`; Secure`),n.sameSite)switch(typeof n.sameSite==`string`?n.sameSite.toLowerCase():n.sameSite){case!0:r+=`; SameSite=Strict`;break;case`lax`:r+=`; SameSite=Lax`;break;case`strict`:r+=`; SameSite=Strict`;break;case`none`:r+=`; SameSite=None`;break;default:throw TypeError(`option sameSite is invalid`)}return n.partitioned&&(r+=`; Partitioned`),r},tI={create(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:`/`,sameSite:`strict`};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+n*60*1e3)),r&&(i.domain=r),document.cookie=eI(e,t,i)},read(e){let t=`${e}=`,n=document.cookie.split(`;`);for(let e=0;e<n.length;e++){let r=n[e];for(;r.charAt(0)===` `;)r=r.substring(1,r.length);if(r.indexOf(t)===0)return r.substring(t.length,r.length)}return null},remove(e,t){this.create(e,``,-1,t)}},nI={name:`cookie`,lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<`u`)return tI.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:i,cookieOptions:a}=t;n&&typeof document<`u`&&tI.create(n,e,r,i,a)}},rI={name:`querystring`,lookup(e){let{lookupQuerystring:t}=e,n;if(typeof window<`u`){let{search:e}=window.location;!window.location.search&&window.location.hash?.indexOf(`?`)>-1&&(e=window.location.hash.substring(window.location.hash.indexOf(`?`)));let r=e.substring(1).split(`&`);for(let e=0;e<r.length;e++){let i=r[e].indexOf(`=`);i>0&&r[e].substring(0,i)===t&&(n=r[e].substring(i+1))}}return n}},iI={name:`hash`,lookup(e){let{lookupHash:t,lookupFromHashIndex:n}=e,r;if(typeof window<`u`){let{hash:e}=window.location;if(e&&e.length>2){let i=e.substring(1);if(t){let e=i.split(`&`);for(let n=0;n<e.length;n++){let i=e[n].indexOf(`=`);i>0&&e[n].substring(0,i)===t&&(r=e[n].substring(i+1))}}if(r)return r;if(!r&&n>-1){let t=e.match(/\/([a-zA-Z-]*)/g);return Array.isArray(t)?t[typeof n==`number`?n:0]?.replace(`/`,``):void 0}}}return r}},aI=null,oI=()=>{if(aI!==null)return aI;try{if(aI=typeof window<`u`&&window.localStorage!==null,!aI)return!1;let e=`i18next.translate.boo`;window.localStorage.setItem(e,`foo`),window.localStorage.removeItem(e)}catch{aI=!1}return aI},sI={name:`localStorage`,lookup(e){let{lookupLocalStorage:t}=e;if(t&&oI())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&oI()&&window.localStorage.setItem(n,e)}},cI=null,lI=()=>{if(cI!==null)return cI;try{if(cI=typeof window<`u`&&window.sessionStorage!==null,!cI)return!1;let e=`i18next.translate.boo`;window.sessionStorage.setItem(e,`foo`),window.sessionStorage.removeItem(e)}catch{cI=!1}return cI},uI={name:`sessionStorage`,lookup(e){let{lookupSessionStorage:t}=e;if(t&&lI())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&lI()&&window.sessionStorage.setItem(n,e)}},dI={name:`navigator`,lookup(e){let t=[];if(typeof navigator<`u`){let{languages:e,userLanguage:n,language:r}=navigator;if(e)for(let n=0;n<e.length;n++)t.push(e[n]);n&&t.push(n),r&&t.push(r)}return t.length>0?t:void 0}},fI={name:`htmlTag`,lookup(e){let{htmlTag:t}=e,n,r=t||(typeof document<`u`?document.documentElement:null);return r&&typeof r.getAttribute==`function`&&(n=r.getAttribute(`lang`)),n}},pI={name:`path`,lookup(e){let{lookupFromPathIndex:t}=e;if(typeof window>`u`)return;let n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(Array.isArray(n))return n[typeof t==`number`?t:0]?.replace(`/`,``)}},mI={name:`subdomain`,lookup(e){let{lookupFromSubdomainIndex:t}=e,n=typeof t==`number`?t+1:1,r=typeof window<`u`&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}},hI=!1;try{document.cookie,hI=!0}catch{}var gI=[`querystring`,`cookie`,`localStorage`,`sessionStorage`,`navigator`,`htmlTag`];hI||gI.splice(1,1);var _I=()=>({order:gI,lookupQuerystring:`lng`,lookupCookie:`i18next`,lookupLocalStorage:`i18nextLng`,lookupSessionStorage:`i18nextLng`,caches:[`localStorage`],excludeCacheFor:[`cimode`],convertDetectedLanguage:e=>e}),vI=class{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type=`languageDetector`,this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=ZF(t,this.options||{},_I()),typeof this.options.convertDetectedLanguage==`string`&&this.options.convertDetectedLanguage.indexOf(`15897`)>-1&&(this.options.convertDetectedLanguage=e=>e.replace(`-`,`_`)),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(nI),this.addDetector(rI),this.addDetector(sI),this.addDetector(uI),this.addDetector(dI),this.addDetector(fI),this.addDetector(pI),this.addDetector(mI),this.addDetector(iI)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,t=[];return e.forEach(e=>{if(this.detectors[e]){let n=this.detectors[e].lookup(this.options);n&&typeof n==`string`&&(n=[n]),n&&(t=t.concat(n))}}),t=t.filter(e=>e!=null&&!QF(e)).map(e=>this.options.convertDetectedLanguage(e)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(t=>{this.detectors[t]&&this.detectors[t].cacheUserLanguage(e,this.options)}))}};vI.type=`languageDetector`;var yI=[];yI.forEach,yI.slice;var bI=[`__proto__`,`constructor`,`prototype`];function xI(e){return!(typeof e!=`string`||e.length===0||e.length>128||bI.indexOf(e)>-1||e.indexOf(`..`)>-1||e.indexOf(`\\`)>-1||/[?#%\s@]/.test(e)||/[\x00-\x1F\x7F]/.test(e))}function SI(e){return!(!xI(e)||e.indexOf(`/`)>-1)}function CI(e){return xI(e)}var wI={lng:SI,ns:CI};function TI(e){return typeof e==`string`?e.replace(/[\r\n\x00-\x1F\x7F]/g,` `):e}function EI(e){if(typeof e!=`string`||e.length===0)return e;try{let t=new URL(e);return t.username||t.password?(t.username=``,t.password=``,t.toString()):e}catch{return e.replace(/(\/\/)[^/@\s]+@/g,`$1`)}}function DI(){return typeof XMLHttpRequest==`function`||typeof XMLHttpRequest==`object`}function OI(e){return!!e&&typeof e.then==`function`}function kI(e){return OI(e)?e:Promise.resolve(e)}var AI=/\{\{(.+?)\}\}/g;function jI(e,t){let n=!1,r=e.replace(AI,(e,r)=>{let i=r.trim();if(bI.indexOf(i)>-1)return e;let a=t[i];if(a==null)return e;let o=wI[i]||SI,s=String(a).split(`+`);for(let t of s)if(!o(t))return n=!0,e;return s.join(`+`)});return n?null:r}var MI=typeof globalThis<`u`?globalThis:typeof global<`u`?global:typeof window<`u`?window:void 0,NI;typeof fetch==`function`?NI=fetch:MI&&typeof MI.fetch==`function`&&(NI=MI.fetch);var PI=DI()&&MI?MI.XMLHttpRequest:void 0,FI=typeof ActiveXObject==`function`&&MI?MI.ActiveXObject:void 0,II=[`__proto__`,`constructor`,`prototype`],LI=(e,t)=>{if(t&&typeof t==`object`){let n=``;for(let e of Object.keys(t))II.indexOf(e)>-1||(n+=`&`+encodeURIComponent(e)+`=`+encodeURIComponent(t[e]));if(!n)return e;e=e+(e.indexOf(`?`)===-1?`?`:`&`)+n.slice(1)}return e},RI=(e,t,n,r)=>{let i=e=>{if(!e.ok)return n(e.statusText||`Error`,{status:e.status});e.text().then(t=>{n(null,{status:e.status,data:t})}).catch(n)};if(r){let a=r(e,t);if(a instanceof Promise){a.then(i).catch(n);return}}typeof fetch==`function`?fetch(e,t).then(i).catch(n):NI(e,t).then(i).catch(n)},zI=(e,t,n,r)=>{e.queryStringParams&&(t=LI(t,e.queryStringParams));let i={...typeof e.customHeaders==`function`?e.customHeaders():e.customHeaders};typeof window>`u`&&typeof global<`u`&&global.process!==void 0&&global.process.versions&&global.process.versions.node&&(i[`User-Agent`]=`i18next-http-backend (node/${global.process.version}; ${global.process.platform} ${global.process.arch})`),n&&(i[`Content-Type`]=`application/json`);let a=typeof e.requestOptions==`function`?e.requestOptions(n):e.requestOptions,o={method:n?`POST`:`GET`,body:n?e.stringify(n):void 0,headers:i,...e._omitFetchOptions?{}:a},s=typeof e.alternateFetch==`function`&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{RI(t,o,r,s)}catch(n){if(!a||Object.keys(a).length===0||!n.message||n.message.indexOf(`not implemented`)<0)return r(n);try{Object.keys(a).forEach(e=>{delete o[e]}),RI(t,o,r,s),e._omitFetchOptions=!0}catch(e){r(e)}}},BI=(e,t,n,r)=>{n&&typeof n==`object`&&(n=LI(``,n).slice(1)),e.queryStringParams&&(t=LI(t,e.queryStringParams));try{let i=PI?new PI:new FI(`MSXML2.XMLHTTP.3.0`);i.open(n?`POST`:`GET`,t,1),e.crossDomain||i.setRequestHeader(`X-Requested-With`,`XMLHttpRequest`),i.withCredentials=!!e.withCredentials,n&&i.setRequestHeader(`Content-Type`,`application/x-www-form-urlencoded`),i.overrideMimeType&&i.overrideMimeType(`application/json`);let a=e.customHeaders;if(a=typeof a==`function`?a():a,a)for(let e of Object.keys(a))II.indexOf(e)>-1||i.setRequestHeader(e,a[e]);i.onreadystatechange=()=>{i.readyState>3&&r(i.status>=400?i.statusText:null,{status:i.status,data:i.responseText})},i.send(n)}catch(e){console&&console.log(e)}},VI=(e,t,n,r)=>{if(typeof n==`function`&&(r=n,n=void 0),r||=(()=>{}),NI&&t.indexOf(`file:`)!==0)return zI(e,t,n,r);if(DI()||typeof ActiveXObject==`function`)return BI(e,t,n,r);r(Error(`No fetch and no xhr implementation found!`))},HI=()=>({loadPath:`/locales/{{lng}}/{{ns}}.json`,addPath:`/locales/add/{{lng}}/{{ns}}`,parse:e=>JSON.parse(e),stringify:JSON.stringify,parsePayload:(e,t,n)=>({[t]:n||``}),parseLoadPayload:(e,t)=>void 0,request:VI,reloadInterval:typeof window<`u`?!1:3600*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:`cors`,credentials:`same-origin`,cache:`default`}}),UI=class{constructor(e,t={},n={}){this.services=e,this.options=t,this.allOptions=n,this.type=`backend`,this.init(e,t,n)}init(e,t={},n={}){if(this.services=e,this.options={...HI(),...this.options||{},...t},this.allOptions=n,this.services&&this.options.reloadInterval){let e=setInterval(()=>this.reload(),this.options.reloadInterval);typeof e==`object`&&typeof e.unref==`function`&&e.unref()}}readMulti(e,t,n){this._readAny(e,e,t,t,n)}read(e,t,n){this._readAny([e],e,[t],t,n)}_readAny(e,t,n,r,i){let a=this.options.loadPath;typeof this.options.loadPath==`function`&&(a=this.options.loadPath(e,n)),a=kI(a),a.then(a=>{if(!a)return i(null,{});let o=jI(a,{lng:e.join(`+`),ns:n.join(`+`)});if(o==null){let t=e.map(TI).join(`, `),r=n.map(TI).join(`, `);return i(Error(`i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=[`+t+`] namespaces=[`+r+`]`),!1)}this.loadUrl(o,i,t,r)})}loadUrl(e,t,n,r){let i=typeof n==`string`?[n]:n,a=typeof r==`string`?[r]:r,o=this.options.parseLoadPayload(i,a),s=TI(EI(e));this.options.request(this.options,e,o,(e,i)=>{if(i&&(i.status>=500&&i.status<600||!i.status))return t(`failed loading `+s+`; status code: `+i.status,!0);if(i&&i.status>=400&&i.status<500)return t(`failed loading `+s+`; status code: `+i.status,!1);if(!i&&e&&e.message){let n=e.message.toLowerCase();if([`failed`,`fetch`,`network`,`load`].find(e=>n.indexOf(e)>-1))return t(`failed loading `+s+`: `+TI(e.message),!0)}if(e)return t(e,!1);let a,o;try{a=typeof i.data==`string`?this.options.parse(i.data,n,r):i.data}catch{o=`failed parsing `+s+` to json`}if(o)return t(o,!1);t(null,a)})}create(e,t,n,r,i){if(!this.options.addPath)return;typeof e==`string`&&(e=[e]);let a=this.options.parsePayload(t,n,r),o=0,s=[],c=[];e.forEach(n=>{let r=this.options.addPath;typeof this.options.addPath==`function`&&(r=this.options.addPath(n,t));let l=jI(r,{lng:n,ns:t});if(l==null){o+=1,i&&o===e.length&&i(s,c);return}this.options.request(this.options,l,a,(t,n)=>{o+=1,s.push(t),c.push(n),o===e.length&&typeof i==`function`&&i(s,c)})})}reload(){let{backendConnector:e,languageUtils:t,logger:n}=this.services,r=e.language;if(r&&r.toLowerCase()===`cimode`)return;let i=[],a=e=>{t.toResolveHierarchy(e).forEach(e=>{i.indexOf(e)<0&&i.push(e)})};a(r),this.allOptions.preload&&this.allOptions.preload.forEach(e=>a(e)),i.forEach(t=>{this.allOptions.ns.forEach(r=>{e.read(t,r,`read`,null,null,(i,a)=>{i&&n.warn(`loading namespace ${r} for language ${t} failed`,i),!i&&a&&n.log(`loaded namespace ${r} for language ${t}`,a),e.loaded(`${t}|${r}`,i,a)})})})}};UI.type=`backend`,qr.use(UI).use(vI).use(ea).init({fallbackLng:`en`,lng:navigator.language?.substring(0,2),interpolation:{escapeValue:!1},backend:{loadPath:`https://translations.piggy.eu/portal-sessions/{{lng}}.json`}});function WI(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=i-a,s=(i+a)/2,c=0;o!==0&&(c=o/(1-Math.abs(2*s-1)));let l=0;return o!==0&&(l=i===t?((n-r)/o+(n<r?6:0))*60:i===n?((r-t)/o+2)*60:((t-n)/o+4)*60),{hue:l,saturation:c,lightness:s}}function GI(e,t,n){let r=(1-Math.abs(2*n-1))*t,i=r*(1-Math.abs(e/60%2-1)),a=n-r/2,o=0,s=0,c=0;return e<60?(o=r,s=i,c=0):e<120?(o=i,s=r,c=0):e<180?(o=0,s=r,c=i):e<240?(o=0,s=i,c=r):e<300?(o=i,s=0,c=r):(o=r,s=0,c=i),o=Math.round((o+a)*255),s=Math.round((s+a)*255),c=Math.round((c+a)*255),`#${o.toString(16).padStart(2,`0`)}${s.toString(16).padStart(2,`0`)}${c.toString(16).padStart(2,`0`)}`}function KI(e){let{hue:t,saturation:n,lightness:r}=WI(e),i=[{key:`50`,min:97,max:99},{key:`100`,min:92,max:96},{key:`200`,min:85,max:91},{key:`300`,min:74,max:84},{key:`400`,min:58,max:73},{key:`500`,min:51,max:61},{key:`600`,min:36,max:50},{key:`700`,min:29,max:40},{key:`800`,min:24,max:33},{key:`900`,min:20,max:28},{key:`950`,min:0,max:19}],a={},o={},s={},c={};i.forEach(e=>{let r=(e.min+e.max)/2/100;a[e.key]=GI(t,n,r),s[e.key]=GI(0,n,r),c[e.key]=GI(120,n,r),o[e.key]=GI(t,.04,r)});for(let t of i)if(r*100>=t.min&&r*100<=t.max){a[t.key]=e;break}return{primaryPalette:a,redPalette:s,greenPalette:c,grayPalette:o}}var qI=e=>{let t={primary:e.primary_color,secondary:e.secondary_color,tertiary:e.tertiary_color,quaternary:e.quarternary_color},n=document.querySelector(`:root`);for(let e in t)if(t[e]){let{primaryPalette:r}=KI(t[e]);for(let t in r)n.style.setProperty(`--${e}-${t}`,r[t])}if(t.primary){let{grayPalette:e,redPalette:r,greenPalette:i}=KI(t.primary);for(let t in e)n.style.setProperty(`--gray-${t}`,e[t]);for(let e in r)n.style.setProperty(`--red-${e}`,r[e]);for(let e in i)n.style.setProperty(`--green-${e}`,i[e])}},JI=`portal-sessions-sdk:router-state`;function YI(){let e=KS(),t=qS();return(0,h.useEffect)(()=>{let n={source:`portal-sessions-sdk`,type:JI,payload:{hash:e.hash,key:e.key,navigationType:t,pathname:e.pathname,search:e.search,state:e.state}};window.parent.postMessage(n,window.location.origin)},[e,t]),null}function XI(){let{uuid:e,portalSession:t}=H(),{debug:r}=wo(),i=new URLSearchParams(window.location.search).get(`debugRouterState`)===`true`;return xo({url:`${e}/brand-kit`,dataSetter:e=>qI(e)}),(0,n.jsx)(h.StrictMode,{children:(0,n.jsxs)(Rw,{children:[r&&(0,n.jsx)(Ao,{}),(0,n.jsxs)(wC,{children:[i&&(0,n.jsx)(YI,{}),(0,n.jsx)(JF,{})]}),(0,n.jsx)(Io,{enabled:t.input_data.enable_on_screen_keyboard}),(0,n.jsx)(Mi,{className:`lg:top-14`,position:`top-right`})]},e)})}function ZI(e){let{errorToast:t}=ca(),[r,i]=(0,h.useState)(null),a=qn(),o=()=>{let t={type:e.type??v.PORTAL,api_key:e.apiKey,shop_uuid:e.shopUuid,contact_uuid:e.contactUuid};return e.cameraService&&(t.camera_service=e.cameraService),e.cameraFacingMode&&(t.facing_mode=e.cameraFacingMode),e.amountInCents&&(t.amount_in_cents=e.amountInCents),e.allowMultipleGiftcards&&(t.allow_multiple_giftcards=e.allowMultipleGiftcards),e.enableRegistration&&(t.enable_registration=e.enableRegistration),e.enableEmailIdentification&&(t.enable_email_identification=e.enableEmailIdentification),e.enableOnScreenKeyboard&&(t.enable_on_screen_keyboard=e.enableOnScreenKeyboard),e.primaryIdentificationMethod&&(t.primary_identification_method=e.primaryIdentificationMethod),e.enableMarketingPreferences&&(t.enable_marketing_preferences=e.enableMarketingPreferences),t},s=()=>{a.post(`/`,o(),{baseURL:`${e.host}/api/v1/portal-sessions`,headers:{Authorization:`Bearer ${e.apiKey}`}}).then(e=>{i(e.data.data)}).catch(t)};return(0,h.useEffect)(()=>s(),[]),r?(0,n.jsx)(Un.Provider,{value:{apiKey:e.apiKey,host:e.host},children:(0,n.jsx)(Co,{uuid:r.uuid,children:(0,n.jsx)(ni,{...e,children:(0,n.jsx)(XI,{})})})}):(0,n.jsx)(Qn,{})}function QI({uuid:e,host:t,debug:r}){return e?(0,n.jsx)(Un.Provider,{value:{host:t},children:(0,n.jsx)(Co,{uuid:e,children:(0,n.jsx)(ni,{debug:r,children:(0,n.jsx)(XI,{})})})}):(0,n.jsx)(So,{message:`No uuid provided.`})}e.FacingMode=b,e.PortalSession=ZI,e.PortalType=v,e.PrimaryIdentificationMethod=g,e.UuidSession=QI});
|
|
173
|
+
//# sourceMappingURL=portal-sessions.umd.js.map
|