@transmitsecurity/platform-web-sdk 1.16.2 → 1.17.1
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/CHANGELOG.md +23 -2
- package/README.md +69 -48
- package/dist/web-sdk-drs+idv+webauthn+ido.js +2 -2
- package/dist/web-sdk.d.ts +4 -16
- package/package.json +12 -13
- package/build/drs-entry.d.ts +0 -20
- package/build/drs-entry.js +0 -19
- package/build/drs-only.d.ts +0 -22
- package/build/drs-only.js +0 -25
- package/build/drs.d.ts +0 -28
- package/build/drs.js +0 -45
- package/build/ido/idoImpl.d.ts +0 -2
- package/build/ido/idoImpl.js +0 -4
- package/build/ido/index.d.ts +0 -7
- package/build/ido/index.js +0 -9
- package/build/ido-entry.d.ts +0 -17
- package/build/ido-entry.js +0 -19
- package/build/ido.d.ts +0 -18
- package/build/ido.js +0 -27
- package/build/idv-entry.d.ts +0 -17
- package/build/idv-entry.js +0 -19
- package/build/idv.d.ts +0 -18
- package/build/idv.js +0 -27
- package/build/initialize-only.d.ts +0 -7
- package/build/initialize-only.js +0 -40
- package/build/initialize.d.ts +0 -1
- package/build/initialize.js +0 -2
- package/build/mainExport.d.ts +0 -16
- package/build/mainExport.js +0 -43
- package/build/sdk-factory.d.ts +0 -109
- package/build/sdk-factory.js +0 -108
- package/build/shared-state.d.ts +0 -4
- package/build/shared-state.js +0 -32
- package/build/webauthn-entry.d.ts +0 -19
- package/build/webauthn-entry.js +0 -19
- package/build/webauthn.d.ts +0 -24
- package/build/webauthn.js +0 -44
- package/bundler-config.json +0 -14
- package/dist/docs/.nojekyll +0 -1
- package/dist/docs/README.md +0 -72
- package/dist/docs/enums/ErrorCode.md +0 -113
- package/dist/docs/interfaces/ActionEventOptions.md +0 -44
- package/dist/docs/interfaces/ActionResponse.md +0 -9
- package/dist/docs/interfaces/AuthenticationAutofillActivateHandlers.md +0 -61
- package/dist/docs/interfaces/AutofillHandlers.md +0 -50
- package/dist/docs/interfaces/CrossDeviceController.md +0 -27
- package/dist/docs/interfaces/SdkError.md +0 -28
- package/dist/docs/interfaces/WebauthnApis.md +0 -73
- package/dist/docs/interfaces/WebauthnAuthenticationFlows.md +0 -52
- package/dist/docs/interfaces/WebauthnCrossDeviceFlows.md +0 -107
- package/dist/docs/interfaces/WebauthnCrossDeviceRegistrationOptions.md +0 -23
- package/dist/docs/interfaces/WebauthnRegistrationOptions.md +0 -55
- package/dist/docs/interfaces/initConfigParams.md +0 -7
- package/dist/docs/modules/drs.md +0 -92
- package/dist/docs/modules/idv.md +0 -106
- package/dist/docs/modules/webauthn.md +0 -197
- package/dist/docs/modules.md +0 -146
- package/dist/drs.cjs +0 -1
- package/dist/drs.d.ts +0 -248
- package/dist/drs.js +0 -1
- package/dist/ido.cjs +0 -3
- package/dist/ido.d.ts +0 -57
- package/dist/ido.js +0 -3
- package/dist/idv.cjs +0 -1
- package/dist/idv.d.ts +0 -69
- package/dist/idv.js +0 -1
- package/dist/index.cjs +0 -3
- package/dist/index.esm.js +0 -3
- package/dist/index.umd.js +0 -3
- package/dist/ts-platform-websdk.js +0 -3
- package/dist/webauthn.cjs +0 -1
- package/dist/webauthn.d.ts +0 -463
- package/dist/webauthn.js +0 -1
- package/scripts/make-semver-aliases.sh +0 -11
- package/scripts/upload-dist.sh +0 -9
- package/src/mainExport.ts +0 -75
- package/src/tsconfig.json +0 -14
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"undefined"==typeof globalThis&&("undefined"!=typeof window?(window.globalThis=window,window.global=window):"undefined"!=typeof self&&(self.globalThis=self,self.global=self));var tsPlatform=function(e){"use strict";function t(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,r)}return i}function i(e){for(var i=1;i<arguments.length;i++){var r=null!=arguments[i]?arguments[i]:{};i%2?t(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function r(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function n(e,t,i){return(t=r(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function a(e,t){if(null==e)return{};var i,r,n=function(e,t){if(null==e)return{};var i,r,n={},a=Object.keys(e);for(r=0;r<a.length;r++)i=a[r],t.indexOf(i)>=0||(n[i]=e[i]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)i=a[r],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function o(e,t){return Object.entries(t).reduce(((t,r)=>{let[n,a]=r;return i(i({},t),{},{[n]:s.isPrototypeOf(a)?new a(e.slug):"function"==typeof a?a.bind(e):"object"==typeof a&&!Array.isArray(a)&&a?o(e,a):a})}),{})}class s{constructor(e){this.slug=e}static create(e){return class extends s{constructor(t){super(t),Object.assign(this,o(this,e(this)))}}}}var c=Object.freeze({__proto__:null,Agent:s});const d=new Map;function u(e,t){var i,r;null===(i=d.get(e))||void 0===i||i.forEach((r=e=>e(t),function(){try{return r(...arguments)}catch(e){console.log(e)}}))}const l=Symbol("MODULE_INITIALIZED");var h=Object.freeze({__proto__:null,MODULE_INITIALIZED:l,emit:u,off:function(e,t){const i=d.get(e);if(!i)return;const r=i.indexOf(t);-1!==r&&i.splice(r,1)},on:function(e,t){var i;d.has(e)?null===(i=d.get(e))||void 0===i||i.push(t):d.set(e,[t])}});let f=null;function p(e){f=e}var g=Object.freeze({__proto__:null,getInitConfig:function(){return f},get initConfig(){return f},setInitConfig:p});function m(e){p(e),u(l,void 0)}var b=Object.freeze({__proto__:null,initialize:m});function v(e,t){const i=!e||"object"!=typeof e||Array.isArray(e)?{}:e;return[t.reduce(((e,t)=>{if(t in e){const i=e[t];if(null!==i&&"object"==typeof i&&!Array.isArray(i))return i}const i={};return e[t]=i,i}),i),i]}function y(e,t){let i=e;return t.every((e=>!(!i||"object"!=typeof i||Array.isArray(i)||!(e in i))&&(i=i[e],!0)),e)}const _="tsec",w="general";function x(e){return e?w:f.clientId}function A(e){return function(e){if(!e)return{};try{return JSON.parse(e)}catch(e){return{}}}((e?sessionStorage:localStorage).getItem(_))}function E(e,t){const i=e?sessionStorage:localStorage,r=t(A(e));i.setItem(_,JSON.stringify(r))}var S=Object.freeze({__proto__:null,COMMON_STORAGE_KEY:_,GENERAL_ID_KEY:w,getValue:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=x(!!t.isGeneral),r=A(!!t.sessionOnly),[n]=v(r,[this.slug.toString(),i]);return n[e]},hasValue:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=x(!!t.isGeneral),r=A(!!t.sessionOnly);return y(r,[this.slug.toString(),i,e])},removeValue:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=x(!!t.isGeneral);E(!!t.sessionOnly,(t=>{const[r,n]=v(t,[this.slug.toString(),i]);return delete r[e],n}))},setValue:function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=x(!!i.isGeneral);E(!!i.sessionOnly,(i=>{const[n,a]=v(i,[this.slug.toString(),r]);return n[e]=t,a}))}});const k="RSA-PSS",M=async(e,t)=>await window.crypto.subtle.generateKey({name:e,modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:"SHA-256"},!1,t),C=async()=>await M("RSA-OAEP",["encrypt","decrypt"]),I=async()=>await M(k,["sign"]),D=async(e,t)=>{const i=(new TextEncoder).encode(t);return await window.crypto.subtle.sign({name:k,saltLength:32},e,i)};class T{constructor(e,t,i){this.slug=e,this.dbName=t,this.dbVersion=i}queryObjectStore(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB||window.shimIndexedDB).open(`${this.slug}:${this.dbName}`,this.dbVersion||1);r.onupgradeneeded=()=>{var t;const i=r.result;(null===(t=null==i?void 0:i.objectStoreNames)||void 0===t?void 0:t.contains)&&!i.objectStoreNames.contains(e)&&i.createObjectStore(e,{keyPath:"key"})},r.onsuccess=()=>{const n=r.result,a=n.transaction(e,(null==i?void 0:i.operation)||"readwrite"),o=a.objectStore(e);t(o),a.oncomplete=()=>{n.close()}}}put(e,t,i){return new Promise(((r,n)=>{this.queryObjectStore(e,(e=>{const a=e.put({key:t,value:i});a.onsuccess=()=>{r(a.result)},a.onerror=e=>{n("Failed adding item to objectStore, err: "+e)}}))}))}add(e,t,i){return new Promise(((r,n)=>{this.queryObjectStore(e,(e=>{const a=e.add({key:t,value:i});a.onsuccess=()=>{r(a.result)},a.onerror=e=>{const t=e.target.error;n(t)}}))}))}get(e,t){return new Promise(((i,r)=>{this.queryObjectStore(e,(e=>{const n=e.get(t);n.onsuccess=()=>{var e;n.result?i(null===(e=n.result)||void 0===e?void 0:e.value):i(void 0)},n.onerror=e=>{r("Failed adding item to objectStore, err: "+e)}}))}))}getAll(e,t){return new Promise(((i,r)=>{this.queryObjectStore(e,(e=>{const n=e.getAll(null,t);n.onsuccess=()=>{if(n.result){const e=n.result;(null==e?void 0:e.length)?i(e.map((e=>null==e?void 0:e.value))):i(e)}else i([])},n.onerror=e=>{r("Failed getting items, err: "+e)}}))}))}delete(e,t){return new Promise(((i,r)=>{this.queryObjectStore(e,(e=>{const n=e.delete(t);n.onsuccess=()=>{i()},n.onerror=e=>{r(`Failed deleting key: '${t}' from objectStore, err: `+e)}}))}))}clear(e){return new Promise(((t,i)=>{this.queryObjectStore(e,(e=>{const r=e.clear();r.onsuccess=()=>{t()},r.onerror=e=>{i("Failed clearing objectStore, err: "+e)}}))}))}}const R="platform",z="init",B="completed",P="RSA2048",O=[z,B];class F{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"sign",i=arguments.length>2?arguments[2]:void 0;var r,n,a,o;this.agent=e,this.keysType=t,this.options=i,this._extractingKeysPromise=null;const s=!(null===(r=this.options)||void 0===r?void 0:r.productScope);this.keysDatabaseName=s||!(null===(n=this.options)||void 0===n?void 0:n.indexedDBName)?"ts_crypto_binding":this.options.indexedDBName,this.dbVersion=s?1:(null===(a=this.options)||void 0===a?void 0:a.dbVersion)||1,this.keysStoreName=s||!(null===(o=this.options)||void 0===o?void 0:o.keysStoreName)?"identifiers_store":this.options.keysStoreName,this.indexedDBClient=new T(s?R:e.slug,this.keysDatabaseName,this.dbVersion),this.indexedDBClientFallback=new T((s?R:e.slug)+`:${f.clientId}`,this.keysDatabaseName,this.dbVersion)}getKeysRecordKey(){return`${this.keysType}_keys`}getRotatedKeysRecordKey(){return`rotated_${this.keysType}_keys`}getRotatedKeysRecordKeyPending(){return`rotated_pending_${this.keysType}_keys`}arrayBufferToBase64(e){return window.btoa(String.fromCharCode(...new Uint8Array(e)))}async getPKRepresentations(e){const t=await crypto.subtle.exportKey("spki",e);return{arrayBufferKey:t,base64Key:this.arrayBufferToBase64(t)}}async generateKeyPair(){return"sign"==this.keysType?await I():await C()}async calcKeyIdentifier(e){const t=await crypto.subtle.digest("SHA-256",e);return Array.from(new Uint8Array(t)).map((e=>e.toString(16).padStart(2,"0"))).join("")}async extractKeysData(){if(this._extractingKeysPromise)return this._extractingKeysPromise;this._extractingKeysPromise=(async()=>{var e,t;const i=(null===(t=null===(e=this.options)||void 0===e?void 0:e.keyRotation)||void 0===t?void 0:t.isEnabled)?await this.getRotatedKeysData():await this.getKeysData(),{base64Key:r}=await this.getPKRepresentations(i.publicKey);return this.publicKeyBase64=r,this.keyIdentifier=i.keyIdentifier,i})();try{return await this._extractingKeysPromise}finally{this._extractingKeysPromise=null}}async generateKeyPairData(e){const t=await this.generateKeyPair(),{arrayBufferKey:r}=await this.getPKRepresentations(t.publicKey),n=e||await this.calcKeyIdentifier(r);return i(i({},t),{},{keyIdentifier:n,createdDate:Date.now()})}shouldKeyBeRotated(e){var t;const i=null===(t=this.options)||void 0===t?void 0:t.keyRotation;if(!(null==i?void 0:i.isEnabled)||!i.expiryDays||void 0===i.startedAt)return!1;const r=24*i.expiryDays*60*60*1e3,n=e.createdDate&&e.createdDate>=i.startedAt?e.createdDate:i.startedAt;return Date.now()-n>r-2592e6}async extractMainKeysData(){return await this.indexedDBClient.get(this.keysStoreName,this.getKeysRecordKey())}async extractFallbackMainKeysData(){return await this.indexedDBClientFallback.get(this.keysStoreName,this.getKeysRecordKey())}async extractRotatedKeysData(){return await this.indexedDBClient.get(this.keysStoreName,this.getRotatedKeysRecordKey())}async extractPendingRotatedKeysData(){return await this.indexedDBClient.get(this.keysStoreName,this.getRotatedKeysRecordKeyPending())}async saveKeyData(e,t){try{return await this.indexedDBClient.add(this.keysStoreName,e,t),t}catch(t){if(t instanceof DOMException&&"ConstraintError"===t.name){const t=await this.indexedDBClient.get(this.keysStoreName,e);if(t)return t}throw t}}async getKeysData(){const e=this.getKeysRecordKey();let t=await this.extractMainKeysData();if(t)return t;if(t=await this.extractFallbackMainKeysData(),t)return this.saveKeyData(e,t);const i=await this.generateKeyPairData();return this.saveKeyData(e,i)}async getOrCreateRotatedKeys(){let e=await this.extractRotatedKeysData();if(!e){const t=this.getRotatedKeysRecordKey(),r=await this.getKeysData(),n=i(i({},r),{},{createdDate:r.createdDate||Date.now()});e=await this.saveKeyData(t,n)}return e}async getRotatedKeysData(){const e=await this.getOrCreateRotatedKeys();if(this.shouldKeyBeRotated(e)){if(!await this.extractPendingRotatedKeysData()){const t=this.getRotatedKeysRecordKeyPending(),i=await this.generateKeyPairData(e.keyIdentifier);await this.saveKeyData(t,i)}}return e}async getPublicData(){return this.publicKeyBase64&&this.keyIdentifier||await this.extractKeysData(),{publicKey:this.publicKeyBase64,keyIdentifier:this.keyIdentifier}}async sign(e){if("sign"==this.keysType){const{privateKey:t}=await this.extractKeysData(),i=await D(t,e);return this.arrayBufferToBase64(i)}throw new Error("keysType must be 'sign' in order to use sign keys")}async clearKeys(){const e=this.getKeysRecordKey();await this.indexedDBClient.delete(this.keysStoreName,e)}getBaseRotationPayload(){return{keyIdentifier:this.keyIdentifier,slot:this.getRotatedKeysRecordKey(),publicKey:this.publicKeyBase64,publicKeyType:P,tenantId:this.options.keyRotation.tenantId}}async getRotationData(){var e,t;if(!(null===(t=null===(e=this.options)||void 0===e?void 0:e.keyRotation)||void 0===t?void 0:t.isEnabled))return;this.publicKeyBase64&&this.keyIdentifier||await this.extractKeysData();const r=await this.extractPendingRotatedKeysData();if(r){const{base64Key:e}=await this.getPKRepresentations(r.publicKey),{privateKey:t}=await this.extractKeysData(),n=i(i({},this.getBaseRotationPayload()),{},{newPublicKey:e,createdDate:r.createdDate,newPublicKeyType:P}),a=JSON.stringify(n);return{data:a,signature:await this.signPayload(a,t)}}const n=await this.extractRotatedKeysData();if(n&&!1===n.confirmed){await this.extractKeysData();const e=JSON.stringify(this.getBaseRotationPayload());return{data:e,signature:await this.signPayload(e,n.privateKey)}}}async signPayload(e,t){const i=await D(t,e);return this.arrayBufferToBase64(i)}async handleRotateResponse(e){if(O.includes(e))if(e===z){const e=await this.extractPendingRotatedKeysData();if(e){await this.indexedDBClient.delete(this.keysStoreName,this.getRotatedKeysRecordKey());const t=i(i({},e),{},{confirmed:!1});await this.indexedDBClient.put(this.keysStoreName,this.getRotatedKeysRecordKey(),t),await this.indexedDBClient.delete(this.keysStoreName,this.getRotatedKeysRecordKeyPending());const{base64Key:r}=await this.getPKRepresentations(e.publicKey);this.publicKeyBase64=r,this.keyIdentifier=e.keyIdentifier}}else if(e===B){const e=await this.extractRotatedKeysData();e&&!1===e.confirmed&&await this.indexedDBClient.put(this.keysStoreName,this.getRotatedKeysRecordKey(),i(i({},e),{},{confirmed:!0}))}}}var N=Object.freeze({__proto__:null,createCryptoBinding:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"sign",t=arguments.length>1?arguments[1]:void 0;return new F(this,e,t)},generateRSAKeyPair:C,generateRSASignKeyPair:I,signAssymetric:D,verifyAssymetric:async(e,t,i)=>{const r=(new TextEncoder).encode(t);return await window.crypto.subtle.verify(k,e,i,r)}}),L=Object.freeze({__proto__:null});const j=s.create((e=>{class t extends Error{constructor(t,i){super(`${e.slug}-${t} ${i}`)}}return{TsError:t,TsInternalError:class extends t{constructor(e){super(e,"Internal error")}}}}));var U=s.create((()=>i({exceptions:j},c)));class q{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.agent=e,this.middlewares=t,this.logs=[]}info(e,t){this.pushLog(3,e,t)}warn(e,t){this.pushLog(4,e,t)}error(e,t){this.pushLog(5,e,t)}pushLog(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.logs.push({timestamp:Date.now(),module:this.agent.slug,severity:e,fields:i,message:t});const r=this.middlewares.map((e=>e(this)));Promise.all(r).catch((()=>{}))}}var K=Object.freeze({__proto__:null,consoleMiddleware:function(e){const t=e.logs[e.logs.length-1];console.log(`${t.severity} ${t.message}`,t.fields)},createSdkLogger:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return new q(this,e)}});function H(e,t){if(!(null==e?void 0:e.trim()))return"";if(function(e){try{return new URL(e),!0}catch(e){return!1}}(e))return e;const i="http://mock.com",r=new URL(i);r.search=(null==t?void 0:t.toString())||"",r.pathname=e;return r.href.replace(i,"")}const V={"Content-Type":"application/json","X-TS-client-time":(new Date).toUTCString(),"X-TS-ua":navigator.userAgent};function $(e,t,r){var n;const a=(o=t||{},encodeURI(JSON.stringify(o)).split(/%..|./).length-1);var o;return{method:e,headers:i(i(i({},{"X-TS-body-size":String(a)}),V),r||{}),body:null!==(n=t&&JSON.stringify(t||{}))&&void 0!==n?n:void 0}}function J(e,t,i,r,n){const a=H(e,r),o=$(t,i,n);return fetch(a,o)}async function G(e,t,i,r,n){let a;if(a=await J(e,t,i,r,n),!a.ok)throw new Error("Request failed");return a}var W=Object.freeze({__proto__:null,httpDelete:async function(e,t){const r=await G(e,"DELETE",void 0,void 0,t);return i(i({data:await r.json()},r),{},{headers:r.headers})},httpGet:async function(e,t,r){const n=await G(e,"GET",void 0,t,r);return i(i({data:await n.json()},n),{},{headers:n.headers})},httpPost:async function(e,t,r,n){const a=await G(e,"POST",t,r,n);return i(i({data:await a.json()},a),{},{headers:a.headers})},httpPut:async function(e,t,r,n){const a=await G(e,"PUT",t,r,n);return i(i({data:await a.json()},a),{},{headers:a.headers})},init:$}),Z=s.create((()=>({events:h,moduleMetadata:g,mainEntry:b,utils:U,storage:S,crypto:N,indexedDB:L,logger:K,http:W}))),Y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Q(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function X(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var i=function e(){if(this instanceof e){var i=[null];i.push.apply(i,arguments);var r=Function.bind.apply(t,i);return new r}return t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),i}var ee={},te={};function ie(e){let t=e.length;for(;--t>=0;)e[t]=0}const re=256,ne=286,ae=30,oe=15,se=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),ce=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),de=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),ue=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),le=new Array(576);ie(le);const he=new Array(60);ie(he);const fe=new Array(512);ie(fe);const pe=new Array(256);ie(pe);const ge=new Array(29);ie(ge);const me=new Array(ae);function be(e,t,i,r,n){this.static_tree=e,this.extra_bits=t,this.extra_base=i,this.elems=r,this.max_length=n,this.has_stree=e&&e.length}let ve,ye,_e;function we(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}ie(me);const xe=e=>e<256?fe[e]:fe[256+(e>>>7)],Ae=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},Ee=(e,t,i)=>{e.bi_valid>16-i?(e.bi_buf|=t<<e.bi_valid&65535,Ae(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=i-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=i)},Se=(e,t,i)=>{Ee(e,i[2*t],i[2*t+1])},ke=(e,t)=>{let i=0;do{i|=1&e,e>>>=1,i<<=1}while(--t>0);return i>>>1},Me=(e,t,i)=>{const r=new Array(16);let n,a,o=0;for(n=1;n<=oe;n++)r[n]=o=o+i[n-1]<<1;for(a=0;a<=t;a++){let t=e[2*a+1];0!==t&&(e[2*a]=ke(r[t]++,t))}},Ce=e=>{let t;for(t=0;t<ne;t++)e.dyn_ltree[2*t]=0;for(t=0;t<ae;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0},Ie=e=>{e.bi_valid>8?Ae(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},De=(e,t,i,r)=>{const n=2*t,a=2*i;return e[n]<e[a]||e[n]===e[a]&&r[t]<=r[i]},Te=(e,t,i)=>{const r=e.heap[i];let n=i<<1;for(;n<=e.heap_len&&(n<e.heap_len&&De(t,e.heap[n+1],e.heap[n],e.depth)&&n++,!De(t,r,e.heap[n],e.depth));)e.heap[i]=e.heap[n],i=n,n<<=1;e.heap[i]=r},Re=(e,t,i)=>{let r,n,a,o,s=0;if(0!==e.last_lit)do{r=e.pending_buf[e.d_buf+2*s]<<8|e.pending_buf[e.d_buf+2*s+1],n=e.pending_buf[e.l_buf+s],s++,0===r?Se(e,n,t):(a=pe[n],Se(e,a+re+1,t),o=se[a],0!==o&&(n-=ge[a],Ee(e,n,o)),r--,a=xe(r),Se(e,a,i),o=ce[a],0!==o&&(r-=me[a],Ee(e,r,o)))}while(s<e.last_lit);Se(e,256,t)},ze=(e,t)=>{const i=t.dyn_tree,r=t.stat_desc.static_tree,n=t.stat_desc.has_stree,a=t.stat_desc.elems;let o,s,c,d=-1;for(e.heap_len=0,e.heap_max=573,o=0;o<a;o++)0!==i[2*o]?(e.heap[++e.heap_len]=d=o,e.depth[o]=0):i[2*o+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=d<2?++d:0,i[2*c]=1,e.depth[c]=0,e.opt_len--,n&&(e.static_len-=r[2*c+1]);for(t.max_code=d,o=e.heap_len>>1;o>=1;o--)Te(e,i,o);c=a;do{o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Te(e,i,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,i[2*c]=i[2*o]+i[2*s],e.depth[c]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,i[2*o+1]=i[2*s+1]=c,e.heap[1]=c++,Te(e,i,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const i=t.dyn_tree,r=t.max_code,n=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length;let d,u,l,h,f,p,g=0;for(h=0;h<=oe;h++)e.bl_count[h]=0;for(i[2*e.heap[e.heap_max]+1]=0,d=e.heap_max+1;d<573;d++)u=e.heap[d],h=i[2*i[2*u+1]+1]+1,h>c&&(h=c,g++),i[2*u+1]=h,u>r||(e.bl_count[h]++,f=0,u>=s&&(f=o[u-s]),p=i[2*u],e.opt_len+=p*(h+f),a&&(e.static_len+=p*(n[2*u+1]+f)));if(0!==g){do{for(h=c-1;0===e.bl_count[h];)h--;e.bl_count[h]--,e.bl_count[h+1]+=2,e.bl_count[c]--,g-=2}while(g>0);for(h=c;0!==h;h--)for(u=e.bl_count[h];0!==u;)l=e.heap[--d],l>r||(i[2*l+1]!==h&&(e.opt_len+=(h-i[2*l+1])*i[2*l],i[2*l+1]=h),u--)}})(e,t),Me(i,d,e.bl_count)},Be=(e,t,i)=>{let r,n,a=-1,o=t[1],s=0,c=7,d=4;for(0===o&&(c=138,d=3),t[2*(i+1)+1]=65535,r=0;r<=i;r++)n=o,o=t[2*(r+1)+1],++s<c&&n===o||(s<d?e.bl_tree[2*n]+=s:0!==n?(n!==a&&e.bl_tree[2*n]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,a=n,0===o?(c=138,d=3):n===o?(c=6,d=3):(c=7,d=4))},Pe=(e,t,i)=>{let r,n,a=-1,o=t[1],s=0,c=7,d=4;for(0===o&&(c=138,d=3),r=0;r<=i;r++)if(n=o,o=t[2*(r+1)+1],!(++s<c&&n===o)){if(s<d)do{Se(e,n,e.bl_tree)}while(0!=--s);else 0!==n?(n!==a&&(Se(e,n,e.bl_tree),s--),Se(e,16,e.bl_tree),Ee(e,s-3,2)):s<=10?(Se(e,17,e.bl_tree),Ee(e,s-3,3)):(Se(e,18,e.bl_tree),Ee(e,s-11,7));s=0,a=n,0===o?(c=138,d=3):n===o?(c=6,d=3):(c=7,d=4)}};let Oe=!1;const Fe=(e,t,i,r)=>{Ee(e,0+(r?1:0),3),((e,t,i,r)=>{Ie(e),r&&(Ae(e,i),Ae(e,~i)),e.pending_buf.set(e.window.subarray(t,t+i),e.pending),e.pending+=i})(e,t,i,!0)};te._tr_init=e=>{Oe||((()=>{let e,t,i,r,n;const a=new Array(16);for(i=0,r=0;r<28;r++)for(ge[r]=i,e=0;e<1<<se[r];e++)pe[i++]=r;for(pe[i-1]=r,n=0,r=0;r<16;r++)for(me[r]=n,e=0;e<1<<ce[r];e++)fe[n++]=r;for(n>>=7;r<ae;r++)for(me[r]=n<<7,e=0;e<1<<ce[r]-7;e++)fe[256+n++]=r;for(t=0;t<=oe;t++)a[t]=0;for(e=0;e<=143;)le[2*e+1]=8,e++,a[8]++;for(;e<=255;)le[2*e+1]=9,e++,a[9]++;for(;e<=279;)le[2*e+1]=7,e++,a[7]++;for(;e<=287;)le[2*e+1]=8,e++,a[8]++;for(Me(le,287,a),e=0;e<ae;e++)he[2*e+1]=5,he[2*e]=ke(e,5);ve=new be(le,se,257,ne,oe),ye=new be(he,ce,0,ae,oe),_e=new be(new Array(0),de,0,19,7)})(),Oe=!0),e.l_desc=new we(e.dyn_ltree,ve),e.d_desc=new we(e.dyn_dtree,ye),e.bl_desc=new we(e.bl_tree,_e),e.bi_buf=0,e.bi_valid=0,Ce(e)},te._tr_stored_block=Fe,te._tr_flush_block=(e,t,i,r)=>{let n,a,o=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,i=4093624447;for(t=0;t<=31;t++,i>>>=1)if(1&i&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<re;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),ze(e,e.l_desc),ze(e,e.d_desc),o=(e=>{let t;for(Be(e,e.dyn_ltree,e.l_desc.max_code),Be(e,e.dyn_dtree,e.d_desc.max_code),ze(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*ue[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),n=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=n&&(n=a)):n=a=i+5,i+4<=n&&-1!==t?Fe(e,t,i,r):4===e.strategy||a===n?(Ee(e,2+(r?1:0),3),Re(e,le,he)):(Ee(e,4+(r?1:0),3),((e,t,i,r)=>{let n;for(Ee(e,t-257,5),Ee(e,i-1,5),Ee(e,r-4,4),n=0;n<r;n++)Ee(e,e.bl_tree[2*ue[n]+1],3);Pe(e,e.dyn_ltree,t-1),Pe(e,e.dyn_dtree,i-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),Re(e,e.dyn_ltree,e.dyn_dtree)),Ce(e),r&&Ie(e)},te._tr_tally=(e,t,i)=>(e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&i,e.last_lit++,0===t?e.dyn_ltree[2*i]++:(e.matches++,t--,e.dyn_ltree[2*(pe[i]+re+1)]++,e.dyn_dtree[2*xe(t)]++),e.last_lit===e.lit_bufsize-1),te._tr_align=e=>{Ee(e,2,3),Se(e,256,le),(e=>{16===e.bi_valid?(Ae(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)};var Ne=(e,t,i,r)=>{let n=65535&e|0,a=e>>>16&65535|0,o=0;for(;0!==i;){o=i>2e3?2e3:i,i-=o;do{n=n+t[r++]|0,a=a+n|0}while(--o);n%=65521,a%=65521}return n|a<<16|0};const Le=new Uint32Array((()=>{let e,t=[];for(var i=0;i<256;i++){e=i;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t})());var je=(e,t,i,r)=>{const n=Le,a=r+i;e^=-1;for(let i=r;i<a;i++)e=e>>>8^n[255&(e^t[i])];return-1^e},Ue={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},qe={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:Ke,_tr_stored_block:He,_tr_flush_block:Ve,_tr_tally:$e,_tr_align:Je}=te,Ge=Ne,We=je,Ze=Ue,{Z_NO_FLUSH:Ye,Z_PARTIAL_FLUSH:Qe,Z_FULL_FLUSH:Xe,Z_FINISH:et,Z_BLOCK:tt,Z_OK:it,Z_STREAM_END:rt,Z_STREAM_ERROR:nt,Z_DATA_ERROR:at,Z_BUF_ERROR:ot,Z_DEFAULT_COMPRESSION:st,Z_FILTERED:ct,Z_HUFFMAN_ONLY:dt,Z_RLE:ut,Z_FIXED:lt,Z_DEFAULT_STRATEGY:ht,Z_UNKNOWN:ft,Z_DEFLATED:pt}=qe,gt=258,mt=262,bt=103,vt=113,yt=666,_t=(e,t)=>(e.msg=Ze[t],t),wt=e=>(e<<1)-(e>4?9:0),xt=e=>{let t=e.length;for(;--t>=0;)e[t]=0};let At=(e,t,i)=>(t<<e.hash_shift^i)&e.hash_mask;const Et=e=>{const t=e.state;let i=t.pending;i>e.avail_out&&(i=e.avail_out),0!==i&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+i),e.next_out),e.next_out+=i,t.pending_out+=i,e.total_out+=i,e.avail_out-=i,t.pending-=i,0===t.pending&&(t.pending_out=0))},St=(e,t)=>{Ve(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Et(e.strm)},kt=(e,t)=>{e.pending_buf[e.pending++]=t},Mt=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},Ct=(e,t,i,r)=>{let n=e.avail_in;return n>r&&(n=r),0===n?0:(e.avail_in-=n,t.set(e.input.subarray(e.next_in,e.next_in+n),i),1===e.state.wrap?e.adler=Ge(e.adler,t,n,i):2===e.state.wrap&&(e.adler=We(e.adler,t,n,i)),e.next_in+=n,e.total_in+=n,n)},It=(e,t)=>{let i,r,n=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match;const c=e.strstart>e.w_size-mt?e.strstart-(e.w_size-mt):0,d=e.window,u=e.w_mask,l=e.prev,h=e.strstart+gt;let f=d[a+o-1],p=d[a+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(i=t,d[i+o]===p&&d[i+o-1]===f&&d[i]===d[a]&&d[++i]===d[a+1]){a+=2,i++;do{}while(d[++a]===d[++i]&&d[++a]===d[++i]&&d[++a]===d[++i]&&d[++a]===d[++i]&&d[++a]===d[++i]&&d[++a]===d[++i]&&d[++a]===d[++i]&&d[++a]===d[++i]&&a<h);if(r=gt-(h-a),a=h-gt,r>o){if(e.match_start=t,o=r,r>=s)break;f=d[a+o-1],p=d[a+o]}}}while((t=l[t&u])>c&&0!=--n);return o<=e.lookahead?o:e.lookahead},Dt=e=>{const t=e.w_size;let i,r,n,a,o;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-mt)){e.window.set(e.window.subarray(t,t+t),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,r=e.hash_size,i=r;do{n=e.head[--i],e.head[i]=n>=t?n-t:0}while(--r);r=t,i=r;do{n=e.prev[--i],e.prev[i]=n>=t?n-t:0}while(--r);a+=t}if(0===e.strm.avail_in)break;if(r=Ct(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=r,e.lookahead+e.insert>=3)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=At(e,e.ins_h,e.window[o+1]);e.insert&&(e.ins_h=At(e,e.ins_h,e.window[o+3-1]),e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<mt&&0!==e.strm.avail_in)},Tt=(e,t)=>{let i,r;for(;;){if(e.lookahead<mt){if(Dt(e),e.lookahead<mt&&t===Ye)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=3&&(e.ins_h=At(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==i&&e.strstart-i<=e.w_size-mt&&(e.match_length=It(e,i)),e.match_length>=3)if(r=$e(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=At(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=At(e,e.ins_h,e.window[e.strstart+1]);else r=$e(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(St(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===et?(St(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(St(e,!1),0===e.strm.avail_out)?1:2},Rt=(e,t)=>{let i,r,n;for(;;){if(e.lookahead<mt){if(Dt(e),e.lookahead<mt&&t===Ye)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=3&&(e.ins_h=At(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==i&&e.prev_length<e.max_lazy_match&&e.strstart-i<=e.w_size-mt&&(e.match_length=It(e,i),e.match_length<=5&&(e.strategy===ct||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-3,r=$e(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=n&&(e.ins_h=At(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(St(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(r=$e(e,0,e.window[e.strstart-1]),r&&St(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=$e(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===et?(St(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(St(e,!1),0===e.strm.avail_out)?1:2};function zt(e,t,i,r,n){this.good_length=e,this.max_lazy=t,this.nice_length=i,this.max_chain=r,this.func=n}const Bt=[new zt(0,0,0,0,((e,t)=>{let i=65535;for(i>e.pending_buf_size-5&&(i=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Dt(e),0===e.lookahead&&t===Ye)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;const r=e.block_start+i;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,St(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-mt&&(St(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===et?(St(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(St(e,!1),e.strm.avail_out),1)})),new zt(4,4,8,4,Tt),new zt(4,5,16,8,Tt),new zt(4,6,32,32,Tt),new zt(4,4,16,16,Rt),new zt(8,16,32,32,Rt),new zt(8,16,128,128,Rt),new zt(8,32,128,256,Rt),new zt(32,128,258,1024,Rt),new zt(32,258,258,4096,Rt)];function Pt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=pt,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),xt(this.dyn_ltree),xt(this.dyn_dtree),xt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),xt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),xt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Ot=e=>{if(!e||!e.state)return _t(e,nt);e.total_in=e.total_out=0,e.data_type=ft;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:vt,e.adler=2===t.wrap?0:1,t.last_flush=Ye,Ke(t),it},Ft=e=>{const t=Ot(e);return t===it&&(e=>{e.window_size=2*e.w_size,xt(e.head),e.max_lazy_match=Bt[e.level].max_lazy,e.good_match=Bt[e.level].good_length,e.nice_match=Bt[e.level].nice_length,e.max_chain_length=Bt[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0})(e.state),t},Nt=(e,t,i,r,n,a)=>{if(!e)return nt;let o=1;if(t===st&&(t=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),n<1||n>9||i!==pt||r<8||r>15||t<0||t>9||a<0||a>lt)return _t(e,nt);8===r&&(r=9);const s=new Pt;return e.state=s,s.strm=e,s.wrap=o,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=n+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new Uint8Array(2*s.w_size),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<n+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new Uint8Array(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=t,s.strategy=a,s.method=i,Ft(e)};ee.deflateInit=(e,t)=>Nt(e,t,pt,15,8,ht),ee.deflateInit2=Nt,ee.deflateReset=Ft,ee.deflateResetKeep=Ot,ee.deflateSetHeader=(e,t)=>e&&e.state?2!==e.state.wrap?nt:(e.state.gzhead=t,it):nt,ee.deflate=(e,t)=>{let i,r;if(!e||!e.state||t>tt||t<0)return e?_t(e,nt):nt;const n=e.state;if(!e.output||!e.input&&0!==e.avail_in||n.status===yt&&t!==et)return _t(e,0===e.avail_out?ot:nt);n.strm=e;const a=n.last_flush;if(n.last_flush=t,42===n.status)if(2===n.wrap)e.adler=0,kt(n,31),kt(n,139),kt(n,8),n.gzhead?(kt(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),kt(n,255&n.gzhead.time),kt(n,n.gzhead.time>>8&255),kt(n,n.gzhead.time>>16&255),kt(n,n.gzhead.time>>24&255),kt(n,9===n.level?2:n.strategy>=dt||n.level<2?4:0),kt(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(kt(n,255&n.gzhead.extra.length),kt(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=We(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(kt(n,0),kt(n,0),kt(n,0),kt(n,0),kt(n,0),kt(n,9===n.level?2:n.strategy>=dt||n.level<2?4:0),kt(n,3),n.status=vt);else{let t=pt+(n.w_bits-8<<4)<<8,i=-1;i=n.strategy>=dt||n.level<2?0:n.level<6?1:6===n.level?2:3,t|=i<<6,0!==n.strstart&&(t|=32),t+=31-t%31,n.status=vt,Mt(n,t),0!==n.strstart&&(Mt(n,e.adler>>>16),Mt(n,65535&e.adler)),e.adler=1}if(69===n.status)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=We(e.adler,n.pending_buf,n.pending-i,i)),Et(e),i=n.pending,n.pending!==n.pending_buf_size));)kt(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=We(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=We(e.adler,n.pending_buf,n.pending-i,i)),Et(e),i=n.pending,n.pending===n.pending_buf_size)){r=1;break}r=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,kt(n,r)}while(0!==r);n.gzhead.hcrc&&n.pending>i&&(e.adler=We(e.adler,n.pending_buf,n.pending-i,i)),0===r&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=We(e.adler,n.pending_buf,n.pending-i,i)),Et(e),i=n.pending,n.pending===n.pending_buf_size)){r=1;break}r=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,kt(n,r)}while(0!==r);n.gzhead.hcrc&&n.pending>i&&(e.adler=We(e.adler,n.pending_buf,n.pending-i,i)),0===r&&(n.status=bt)}else n.status=bt;if(n.status===bt&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Et(e),n.pending+2<=n.pending_buf_size&&(kt(n,255&e.adler),kt(n,e.adler>>8&255),e.adler=0,n.status=vt)):n.status=vt),0!==n.pending){if(Et(e),0===e.avail_out)return n.last_flush=-1,it}else if(0===e.avail_in&&wt(t)<=wt(a)&&t!==et)return _t(e,ot);if(n.status===yt&&0!==e.avail_in)return _t(e,ot);if(0!==e.avail_in||0!==n.lookahead||t!==Ye&&n.status!==yt){let i=n.strategy===dt?((e,t)=>{let i;for(;;){if(0===e.lookahead&&(Dt(e),0===e.lookahead)){if(t===Ye)return 1;break}if(e.match_length=0,i=$e(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,i&&(St(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===et?(St(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(St(e,!1),0===e.strm.avail_out)?1:2})(n,t):n.strategy===ut?((e,t)=>{let i,r,n,a;const o=e.window;for(;;){if(e.lookahead<=gt){if(Dt(e),e.lookahead<=gt&&t===Ye)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=e.strstart-1,r=o[n],r===o[++n]&&r===o[++n]&&r===o[++n])){a=e.strstart+gt;do{}while(r===o[++n]&&r===o[++n]&&r===o[++n]&&r===o[++n]&&r===o[++n]&&r===o[++n]&&r===o[++n]&&r===o[++n]&&n<a);e.match_length=gt-(a-n),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(i=$e(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(i=$e(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),i&&(St(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===et?(St(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(St(e,!1),0===e.strm.avail_out)?1:2})(n,t):Bt[n.level].func(n,t);if(3!==i&&4!==i||(n.status=yt),1===i||3===i)return 0===e.avail_out&&(n.last_flush=-1),it;if(2===i&&(t===Qe?Je(n):t!==tt&&(He(n,0,0,!1),t===Xe&&(xt(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),Et(e),0===e.avail_out))return n.last_flush=-1,it}return t!==et?it:n.wrap<=0?rt:(2===n.wrap?(kt(n,255&e.adler),kt(n,e.adler>>8&255),kt(n,e.adler>>16&255),kt(n,e.adler>>24&255),kt(n,255&e.total_in),kt(n,e.total_in>>8&255),kt(n,e.total_in>>16&255),kt(n,e.total_in>>24&255)):(Mt(n,e.adler>>>16),Mt(n,65535&e.adler)),Et(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?it:rt)},ee.deflateEnd=e=>{if(!e||!e.state)return nt;const t=e.state.status;return 42!==t&&69!==t&&73!==t&&91!==t&&t!==bt&&t!==vt&&t!==yt?_t(e,nt):(e.state=null,t===vt?_t(e,at):it)},ee.deflateSetDictionary=(e,t)=>{let i=t.length;if(!e||!e.state)return nt;const r=e.state,n=r.wrap;if(2===n||1===n&&42!==r.status||r.lookahead)return nt;if(1===n&&(e.adler=Ge(e.adler,t,i,0)),r.wrap=0,i>=r.w_size){0===n&&(xt(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(i-r.w_size,i),0),t=e,i=r.w_size}const a=e.avail_in,o=e.next_in,s=e.input;for(e.avail_in=i,e.next_in=0,e.input=t,Dt(r);r.lookahead>=3;){let e=r.strstart,t=r.lookahead-2;do{r.ins_h=At(r,r.ins_h,r.window[e+3-1]),r.prev[e&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=e,e++}while(--t);r.strstart=e,r.lookahead=2,Dt(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=o,e.input=s,e.avail_in=a,r.wrap=n,it},ee.deflateInfo="pako deflate (from Nodeca project)";var Lt={};const jt=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);Lt.assign=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const i=t.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(const t in i)jt(i,t)&&(e[t]=i[t])}}return e},Lt.flattenChunks=e=>{let t=0;for(let i=0,r=e.length;i<r;i++)t+=e[i].length;const i=new Uint8Array(t);for(let t=0,r=0,n=e.length;t<n;t++){let n=e[t];i.set(n,r),r+=n.length}return i};var Ut={};let qt=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){qt=!1}const Kt=new Uint8Array(256);for(let e=0;e<256;e++)Kt[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Kt[254]=Kt[254]=1,Ut.string2buf=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,i,r,n,a,o=e.length,s=0;for(n=0;n<o;n++)i=e.charCodeAt(n),55296==(64512&i)&&n+1<o&&(r=e.charCodeAt(n+1),56320==(64512&r)&&(i=65536+(i-55296<<10)+(r-56320),n++)),s+=i<128?1:i<2048?2:i<65536?3:4;for(t=new Uint8Array(s),a=0,n=0;a<s;n++)i=e.charCodeAt(n),55296==(64512&i)&&n+1<o&&(r=e.charCodeAt(n+1),56320==(64512&r)&&(i=65536+(i-55296<<10)+(r-56320),n++)),i<128?t[a++]=i:i<2048?(t[a++]=192|i>>>6,t[a++]=128|63&i):i<65536?(t[a++]=224|i>>>12,t[a++]=128|i>>>6&63,t[a++]=128|63&i):(t[a++]=240|i>>>18,t[a++]=128|i>>>12&63,t[a++]=128|i>>>6&63,t[a++]=128|63&i);return t};Ut.buf2string=(e,t)=>{const i=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let r,n;const a=new Array(2*i);for(n=0,r=0;r<i;){let t=e[r++];if(t<128){a[n++]=t;continue}let o=Kt[t];if(o>4)a[n++]=65533,r+=o-1;else{for(t&=2===o?31:3===o?15:7;o>1&&r<i;)t=t<<6|63&e[r++],o--;o>1?a[n++]=65533:t<65536?a[n++]=t:(t-=65536,a[n++]=55296|t>>10&1023,a[n++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&qt)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let i="";for(let r=0;r<t;r++)i+=String.fromCharCode(e[r]);return i})(a,n)},Ut.utf8border=(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let i=t-1;for(;i>=0&&128==(192&e[i]);)i--;return i<0||0===i?t:i+Kt[e[i]]>t?i:t};const Ht=ee,Vt=Lt,$t=Ut,Jt=Ue,Gt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Wt=Object.prototype.toString,{Z_NO_FLUSH:Zt,Z_SYNC_FLUSH:Yt,Z_FULL_FLUSH:Qt,Z_FINISH:Xt,Z_OK:ei,Z_STREAM_END:ti,Z_DEFAULT_COMPRESSION:ii,Z_DEFAULT_STRATEGY:ri,Z_DEFLATED:ni}=qe;function ai(e){this.options=Vt.assign({level:ii,method:ni,chunkSize:16384,windowBits:15,memLevel:8,strategy:ri},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Gt,this.strm.avail_out=0;let i=Ht.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(i!==ei)throw new Error(Jt[i]);if(t.header&&Ht.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?$t.string2buf(t.dictionary):"[object ArrayBuffer]"===Wt.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,i=Ht.deflateSetDictionary(this.strm,e),i!==ei)throw new Error(Jt[i]);this._dict_set=!0}}ai.prototype.push=function(e,t){const i=this.strm,r=this.options.chunkSize;let n,a;if(this.ended)return!1;for(a=t===~~t?t:!0===t?Xt:Zt,"string"==typeof e?i.input=$t.string2buf(e):"[object ArrayBuffer]"===Wt.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;)if(0===i.avail_out&&(i.output=new Uint8Array(r),i.next_out=0,i.avail_out=r),(a===Yt||a===Qt)&&i.avail_out<=6)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else{if(n=Ht.deflate(i,a),n===ti)return i.next_out>0&&this.onData(i.output.subarray(0,i.next_out)),n=Ht.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===ei;if(0!==i.avail_out){if(a>0&&i.next_out>0)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else if(0===i.avail_in)break}else this.onData(i.output)}return!0},ai.prototype.onData=function(e){this.chunks.push(e)},ai.prototype.onEnd=function(e){e===ei&&(this.result=Vt.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var oi=function(e,t){return(t=t||{}).gzip=!0,function(e,t){const i=new ai(t);if(i.push(e,!0),i.err)throw i.msg||Jt[i.err];return i.result}(e,t)};const si=["enabled","userId"];var ci,di,ui=["drs"];ci=ui,di=391,function(e){for(;--e;)ci.push(ci.shift())}(++di);var li,hi,fi,pi=new Z((li="0x0",ui[li-=0])),gi=["getItem","sessionStorage","setItem","removeItemSessionStorageSafe","removeItem","localStorage","FALLBACK_SESSION_STORAGE","FALLBACK_LOCAL_STORAGE","clientId","getClientId","getFullStorageKey","getItemSessionStorageSafe"];hi=gi,fi=378,function(e){for(;--e;)hi.push(hi.shift())}(++fi);var mi=function(e,t){return gi[e-=0]};class bi{constructor(e){this[mi("0x0")]={},this[mi("0x1")]={},this[mi("0x2")]=e}[mi("0x3")](){return this[mi("0x2")]}setClientId(e){this[mi("0x2")]=e}[mi("0x4")](e){return this[mi("0x2")]+"_"+e}[mi("0x5")](e){const t=this[mi("0x4")](e);try{return window.sessionStorage[mi("0x6")](t)}catch(e){return this[mi("0x0")][t]}}setItemSessionStorageSafe(e,t){const i=this[mi("0x4")](e);try{window[mi("0x7")][mi("0x8")](i,t)}catch(e){this[mi("0x0")][i]=t}}[mi("0x9")](e){const t=this.getFullStorageKey(e);try{window[mi("0x7")][mi("0xa")](t)}catch(e){this.FALLBACK_SESSION_STORAGE[t]=void 0}}getItemLocalStorageSafe(e){const t=this.getFullStorageKey(e);try{return window.localStorage[mi("0x6")](t)}catch(e){return this.FALLBACK_LOCAL_STORAGE[t]}}setItemLocalStorageSafe(e,t){const i=this[mi("0x4")](e);try{window[mi("0xb")][mi("0x8")](i,t)}catch(e){this[mi("0x1")][i]=t}}removeItemLocalStorageSafe(e){const t=this[mi("0x4")](e);try{window.localStorage[mi("0xa")](t)}catch(e){this[mi("0x1")][t]=void 0}}}var vi,yi,_i=["pushLog","warn","error","flush","log","logPrefix","stringify","push","now","formatter","unshift","enabled","logsLimit","logs","middlewares","info"];vi=_i,yi=235,function(e){for(;--e;)vi.push(vi.shift())}(++yi);var wi=function(e,t){return _i[e-=0]};class xi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this[wi("0x0")]=e,this.logPrefix="[AccountProtection SDK]",this[wi("0x1")]=1e4,this[wi("0x2")]=[],this[wi("0x3")]=[]}[wi("0x4")](e,t){this[wi("0x5")](3,e,t)}[wi("0x6")](e,t){this[wi("0x5")](4,e,t)}[wi("0x7")](e,t){this.pushLog(5,e,t)}[wi("0x8")](){const e=this[wi("0x2")];return this[wi("0x2")]=[],e}pushLog(e,t,r){this.enabled&&console[wi("0x9")]("%s %s %s",this[wi("0xa")],t,JSON[wi("0xb")](r)),this.logs[wi("0xc")]({timestamp:Date[wi("0xd")](),severity:e,text:JSON[wi("0xb")](i(i({},r),{},{message:t}),this[wi("0xe")])}),this[wi("0x2")].length>this[wi("0x1")]&&this.logs[wi("0xf")]();const n=this[wi("0x3")].map((e=>e()));Promise.all(n).catch((()=>{}))}[wi("0xe")](e,t){if(t instanceof Error){const{name:e,stack:i,message:r}=t;return{name:e,stack:i,message:r}}return t}}const Ai=new xi;var Ei,Si,ki=["refreshConf","keys","setItemLocalStorageSafe","stringify","timestamp","ric","storageManager","requestsManager","conf","loadConf","device/conf?tenantId=","error","error fetching config","getItemLocalStorageSafe","parse","error loading config","getConfValue"];Ei=ki,Si=174,function(e){for(;--e;)Ei.push(Ei.shift())}(++Si);var Mi=function(e,t){return ki[e-=0]};const Ci=Mi("0x0"),Ii=Mi("0x1");class Di{constructor(e,t){this[Mi("0x2")]=e,this[Mi("0x3")]=t,this[Mi("0x4")]=this[Mi("0x5")]()}async fetchConf(e){try{const t=Mi("0x6")+e,i=await this[Mi("0x3")].getData(t);return null!=i?i:{}}catch(t){return Ai[Mi("0x7")](Mi("0x8"),{clientId:e,error:t}),{}}}[Mi("0x5")](){const e=this[Mi("0x2")][Mi("0x9")](Ii);if(null!=e)try{return JSON[Mi("0xa")](e)}catch(e){Ai[Mi("0x7")](Mi("0xb"),{error:e})}return{}}shouldUpdateConf(){const e=this[Mi("0xc")](Ci,0);return Date.now()-e>36e5}async[Mi("0xd")](e){if(!this.shouldUpdateConf())return!1;let t=await this.fetchConf(e);return 0==Object[Mi("0xe")](t).length?t=this.loadConf():this[Mi("0x2")][Mi("0xf")](Ii,JSON[Mi("0x10")](t)),this[Mi("0x4")]=t,!0}[Mi("0xc")](e,t){const i=void 0!==this[Mi("0x4")]?this[Mi("0x4")][e]:void 0;return null!=i?i:t}}var Ti,Ri,zi=["EVENT_TYPE_INTERACTION","interaction","EVENT_TYPE_IDENTIFICATION","desktop_web","mobile_web","device"];Ti=zi,Ri=419,function(e){for(;--e;)Ti.push(Ti.shift())}(++Ri);var Bi,Pi,Oi=function(e,t){return zi[e-=0]};(Pi=Bi||(Bi={})).EVENT_TYPE_ACTION="action",Pi.EVENT_TYPE_DEVICE=Oi("0x0"),Pi[Oi("0x1")]=Oi("0x2"),Pi[Oi("0x3")]="identification";const Fi=Oi("0x4"),Ni=Oi("0x5");var Li,ji,Ui=["length","splice","push","maintainLastXItems"];Li=Ui,ji=131,function(e){for(;--e;)Li.push(Li.shift())}(++ji);var qi=function(e,t){return Ui[e-=0]};class Ki{static[qi("0x0")](e,t,i){return e[qi("0x1")]>=t&&e[qi("0x2")](0,1),e[qi("0x3")](i),e}}var Hi,Vi,$i=["location","shiftKey","inputType","view","data","buffer","collect","extractEventData","maintainLastXItems","getData","now","extractButtonsPressedData","altKey","buttons","offsetX","offsetY","firesTouchEvents","sourceCapabilities","target","isTrusted","cancelable","metaKey","bufferSize","composed"];Hi=$i,Vi=292,function(e){for(;--e;)Hi.push(Hi.shift())}(++Vi);var Ji=function(e,t){return $i[e-=0]};class Gi{constructor(e){this[Ji("0x0")]=[],this[Ji("0x1")]=e}[Ji("0x2")](e){const t=this[Ji("0x3")](e);Ki[Ji("0x4")](this[Ji("0x0")],this[Ji("0x1")],t)}[Ji("0x5")](){return this[Ji("0x0")]}[Ji("0x3")](e){return i({x:e.x,y:e.y,tspl:Date[Ji("0x6")]()},this.extractButtonsPressedData(e))}[Ji("0x7")](e){return i(i(i(i({},e.ctrlKey&&{ctrlKey:!0}),e[Ji("0x8")]&&{altKey:!0}),e.shiftKey&&{shiftKey:!0}),0!=e.buttons&&{buttons:e[Ji("0x9")]})}}class Wi{constructor(e){this[Ji("0x0")]=[],this.buffer=e}[Ji("0x2")](e){var t;const i={x:e.x,y:e.y,timestamp:Date[Ji("0x6")](),mouseButtonType:e.detail,offsetX:e[Ji("0xa")],offsetY:e[Ji("0xb")],isPressed:null==(null===(t=e.sourceCapabilities)||void 0===t?void 0:t[Ji("0xc")])?null:!e[Ji("0xd")].firesTouchEvents,target_id:e[Ji("0xe")].id};Ki[Ji("0x4")](this.data,this.buffer,i)}[Ji("0x5")](){const e=[...this[Ji("0x0")]];return this.data=[],e}}class Zi{constructor(e){this[Ji("0x0")]=[],this.bufferSize=e}[Ji("0x2")](e){var t;const i={isTrusted:e[Ji("0xf")],cancelable:e[Ji("0x10")],composed:e.composed,isView:!!e.view,shiftKey:e.shiftKey,metaKey:e[Ji("0x11")],firesTouchEvents:null===(t=e[Ji("0xd")])||void 0===t?void 0:t.firesTouchEvents,timestamp:Date[Ji("0x6")]()};Ki[Ji("0x4")](this[Ji("0x0")],this[Ji("0x12")],i)}[Ji("0x5")](){const e=[...this[Ji("0x0")]];return this[Ji("0x0")]=[],e}}class Yi{constructor(e){this.data=[],this.bufferSize=e}[Ji("0x2")](e){var t;const i={isTrusted:e[Ji("0xf")],cancelable:e[Ji("0x10")],composed:e[Ji("0x13")],isView:!!e.view,location:e[Ji("0x14")],shiftKey:e[Ji("0x15")],firesTouchEvents:null===(t=e[Ji("0xd")])||void 0===t?void 0:t[Ji("0xc")],timestamp:Date[Ji("0x6")]()};Ki[Ji("0x4")](this[Ji("0x0")],this.bufferSize,i)}[Ji("0x5")](){const e=this[Ji("0x0")];return this.data=[],e}}class Qi{constructor(e){this.data=[],this[Ji("0x12")]=e}[Ji("0x2")](e){const t={isTrusted:e[Ji("0xf")],cancelable:e[Ji("0x10")],composed:e[Ji("0x13")],inputType:e[Ji("0x16")],isView:!!e[Ji("0x17")],timestamp:Date[Ji("0x6")]()};Ki[Ji("0x4")](this[Ji("0x0")],this[Ji("0x12")],t)}[Ji("0x5")](){const e=this[Ji("0x0")];return this[Ji("0x0")]=[],e}}class Xi{constructor(e){this[Ji("0x0")]=[],this[Ji("0x12")]=e}[Ji("0x2")](e){const t={isTrusted:e.isTrusted,cancelable:e[Ji("0x10")],composed:e.composed,timestamp:Date[Ji("0x6")]()};Ki[Ji("0x4")](this[Ji("0x0")],this[Ji("0x12")],t)}[Ji("0x5")](){const e=this[Ji("0x0")];return this[Ji("0x0")]=[],e}}var er,tr,ir=["getGenericAttributes","getAttachedData","error","error adding interaction listener","eventTypesToAttach","getData","href","change","paste","mousemove","mouseup","mousedown","submit","keyup","input","focusout","SELECT","TEXTAREA","safeEventCallback","interactionEventsCollectorsData","detail","sourceCapabilities","firesTouchEvents","offsetX","offsetY","target","isTrusted","cancelable","composed","dropEffect","clipboardData","effectAllowed","mouseEventsCollectionBuffer","dataset","virtualKeyboard","inputTypeFilter","tagName","includes","entries","addSafeInteractionListener","Error while adding listener","filter","handleEvent","forEach"];er=ir,tr=227,function(e){for(;--e;)er.push(er.shift())}(++tr);var rr=function(e,t){return ir[e-=0]};const nr=rr("0x0"),ar=rr("0x1"),or=rr("0x2"),sr=rr("0x3"),cr=rr("0x4"),dr=rr("0x5"),ur=rr("0x6"),lr="keydown",hr=rr("0x7"),fr=rr("0x8"),pr=["INPUT",rr("0x9"),rr("0xa")];class gr{constructor(e,t,r){this.deviceEventDataCollectionIgnoreList=e,this.mouseEventsCollectionBuffer=t,this[rr("0xb")]=r,this[rr("0xc")]={click:{eventTypesToAttach:[or,sr,cr],attributesMapper:e=>{var t;return{x:e.x,y:e.y,mouseButtonType:e[rr("0xd")],isPressed:null==(null===(t=e[rr("0xe")])||void 0===t?void 0:t[rr("0xf")])?null:!e[rr("0xe")][rr("0xf")],offsetX:e[rr("0x10")],offsetY:e[rr("0x11")],target_id:e[rr("0x12")].id}}},[ar]:{attributesMapper:e=>({target_id:e.target.id,isTrusted:e[rr("0x13")],cancelable:e[rr("0x14")],composed:e[rr("0x15")],dropEffect:e.clipboardData[rr("0x16")],effectAllowed:e[rr("0x17")][rr("0x18")]})},[dr]:{attributesMapper:e=>({target_id:e[rr("0x12")].id})},[or]:{continousCollectors:[new Gi(this[rr("0x19")])]},[sr]:{continousCollectors:[new Wi(1)]},[cr]:{continousCollectors:[new Wi(1)]},[fr]:{eventTypesToAttach:[hr,ur,lr,nr],filter:this.inputTypeFilter,attributesMapper:e=>{const{target:t,isTrusted:r,cancelable:n,composed:a}=e;return i({target_id:t.id,dataset_keys:Object.keys(t[rr("0x1a")]||{}),isTrusted:r,cancelable:n,composed:a},navigator[rr("0x1b")]&&{navigator_virtualKeyboard:navigator[rr("0x1b")].overlaysContent})}},[hr]:{filter:this[rr("0x1c")],continousCollectors:[new Qi(50)]},[ur]:{filter:this[rr("0x1c")],continousCollectors:[new Yi(50)]},[lr]:{filter:this[rr("0x1c")],continousCollectors:[new Zi(50)]},[nr]:{continousCollectors:[new Xi(50)]}}}inputTypeFilter(e){var t;const i=null===(t=e[rr("0x12")])||void 0===t?void 0:t[rr("0x1d")];return pr[rr("0x1e")](i)}registerEventListeners(){for(const[e,t]of Object[rr("0x1f")](this[rr("0xc")]))if(!this.deviceEventDataCollectionIgnoreList[rr("0x1e")](e))try{this[rr("0x20")](e,t)}catch(t){Ai.error(rr("0x21"),{error:t,eventType:e})}}[rr("0x22")](e,t){return!e.filter||e[rr("0x22")](t)}async[rr("0x23")](e,t,r){const{attributesMapper:n,continousCollectors:a}=e;if(!this[rr("0x22")](e,t))return!1;if(a)a[rr("0x24")]((e=>{e.collect(t)}));else{const e=this[rr("0x25")](),a=this[rr("0x26")](r),o=i(i(i({},e),n(t)),a&&{attachedEventsData:a});await this.safeEventCallback(r,o)}return!0}addSafeInteractionListener(e,t){window.addEventListener(e,(async i=>{try{await this[rr("0x23")](t,i,e)}catch(e){Ai[rr("0x27")](rr("0x28"),{error:e})}}))}[rr("0x26")](e){let t;const i=this[rr("0xc")][e][rr("0x29")];return i&&(t={},i[rr("0x24")]((e=>{const{continousCollectors:i}=this[rr("0xc")][e];i&&i[rr("0x24")]((i=>t[e]=i[rr("0x2a")]()))}))),t}[rr("0x25")](){return{location:window.location[rr("0x2b")]}}}var mr,br,vr=["race","catch","warn","executor reached timeout","finally","getHighEntropyValues","model","platform","platformVersion","fullVersionList","bitness","mobile","wow64","resolve","setTimeout"];mr=vr,br=140,function(e){for(;--e;)mr.push(mr.shift())}(++br);var yr=function(e,t){return vr[e-=0]};function _r(){var e;return null===(e=navigator.userAgentData)||void 0===e?void 0:e[yr("0x0")](["architecture",yr("0x1"),yr("0x2"),yr("0x3"),yr("0x4"),yr("0x5"),yr("0x6"),yr("0x7"),"uaFullVersion"])}function wr(e,t){let i;const r=[Promise[yr("0x8")](e()).catch((()=>{})),new Promise(((e,r)=>i=window[yr("0x9")](r,t)))];return Promise[yr("0xa")](r)[yr("0xb")]((()=>Ai[yr("0xc")](yr("0xd"),{fnName:e.name})))[yr("0xe")]((()=>clearTimeout(i)))}var xr,Ar,Er=["worker throw error","resolve","collectPromisesData","worker promise rejected","getCookieEnabled","getFIDOEnabled","credentials","PublicKeyCredential","crypto","getRandomValues","from","RTCPeerConnection","getWindowBasedKeys","chrome","safari","__crWeb","yandex","__yb","__ybro","__edgeTrackingPreventionStatistics","webkit","samsungAr","ucweb","UCShellJava","puffinDevice","_phantom","callPhantom","Buffer","emit","spawn","domAutomationController","domAutomation","__nightmare","_selenium","callSelenium","_Selenium_IDE_Recorder","__$webdriverAsyncExecutor","__driver_evaluate","__driver_unwrapped","__fxdriver_evaluate","__lastWatirAlert","__lastWatirConfirm","__lastWatirPrompt","__selenium_evaluate","__selenium_unwrapped","__webdriver__chr","__webdriver_evaluate","__webdriver_script_fn","__webdriver_script_func","__webdriver_script_function","__webdriver_unwrapped","awesomium","cdc_adoQpoasnfa76pfcZLmcfl_Array","cdc_adoQpoasnfa76pfcZLmcfl_Promise","chrome_asyncScriptInfo","OSMJIF","spynner_additional_js_loaded","watinExpressionError","watinExpressionResult","push","getMediaMatch","standard","no-preference","high","low","more","less","forced","100","active","none","inverted","rec2020","replace","matchMedia","matches","log","sqrt","exp","acos","acosh","asin","asinh","atanh","atan","sinh","cos","cosh","expm1","log1p","length","hashCodeString","getSessionStorage","sessionStorage","localStorage","external","toString","indexOf","Sequentum","webdriver","__fxdriver_unwrapped","calledSelenium","_WEBDRIVER_ELEM_CACHE","ChromeDriverw","webdriver-evaluate","selenium-evaluate","webdriverCommand","webdriver-evaluate-response","__webdriverFunc","$cdc_asdjflasutopfhvcZLmcfl_","serviceWorker","filter","product","userAgent","userAgentData","storage","estimate","navigatorOnLine","userActivation","isActive","permissions","state","sendBeacon","getOwnPropertyDescriptor","hardwareConcurrency","languages","get","function","platform","url","referrer","memory","indexedDB","DocumentTouch","maxTouchPoints","msMaxTouchPoints","getPlugins","type","plugins","name","description","screen","availHeight","availWidth","height","pixelDepth","orientation","angle","devicePixelRatio","outerWidth","outerHeight","getCpuClass","getOsCpu","oscpu","HTMLElement","prototype","addBehavior","enumerateDevices","kind","label","groupId","OfflineAudioContext","webkitOfflineAudioContext","createOscillator","triangle","frequency","createDynamicsCompressor","knee","ratio","release","connect","destination","start","renderedBuffer","startRendering","getChannelData","subarray","getHash","threshold","attack","createAnalyser","disconnect","frequencyBinCount","getFloatFrequencyData","call","fftSize","getFloatTimeDomainData","reduction","abs","monospace","sans-serif","serif","sans-serif-thin","ARNO PRO","Agency FB","AvantGarde Bk BT","BankGothic Md BT","Calibri","Century","Century Gothic","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Levenim MT","Lucida Bright","Lucida Sans","MS Mincho","MS Outlook","MS Reference Specialty","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Minion Pro","Monotype Corsiva","PMingLiU","SCRIPTINA","Segoe UI Light","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","ZWAdobeF","createElement","style","visibility","hidden","span","top","left","fontSize","10px","textContent","appendChild","map","some","offsetWidth","offsetHeight","body","removeChild","language","DateTimeFormat","resolvedOptions","timeZone","vendor","getBuildID","buildID","width","textBaseline","alphabetic","fillStyle","#f60","#069","font",'11pt "Times New Roman"',"fillText","rgba(102, 204, 0, 0.2)","18pt Arial","globalCompositeOperation","multiply","#f2f","#2ff","arc","fill","#f9c","toDataURL","rect","getContext","charging","chargingTime","dischargingTime","level","brave","isBrave","canvas","webgl","webgl-experimental","getExtension","WEBGL_debug_renderer_info","getParameter","UNMASKED_RENDERER_WEBGL","getCodesTests","video","canPlayType",'video/mp4; codecs="avc1.42E01E"',"video/mp4;;Codecs =avc1.42E01E","getPublicData","isMobile","only screen and (max-width: 600px)","sdkDeviceDataCollectionIgnoreList","deviceDataCalculationExpiry","reduce","storageManager","configManager","cryptoBinding","calculate","getConfValue","dataPointsExtractor","lastDeviceData","now","getDeviceData","getItemLocalStorageSafe","dataPoints","getBattery","getBrave","getCanvasFingerprint","getConnection","getCryptoRandomValues","getDeviceMemory","getDocumentBasedKeys","getHardwareConcurrency","getIndexedDB","getLanguages","getLanguage","getTimezoneOffset","getLocalStorage","getNavigatorBasedKeys","getNavigatorProduct","getNavigatorUAData","getNavigatorHighEntropyData","navigatorStorageEstimation","navigatorIsUserActive","getMathFingerprint","getOpenDatabase","getWindowOrientation","getPlatform","getAddBehavior","getProductSub","getMediaDevices","getAudioFingerprintExtended","getFonts","getPerformanceMemory","getScreen","hasSequentum","getReferrer","getTimezone","getTouchSupport","getVendor","getWebGlRenderer","getWindowOuter","webRTCDisabled","getCryptoBindingData","bind","getNavigatorPermissionsState","geolocation","isGeoLocationExists","isSendBeaconFunction","getNavigatorPrototype","getInstalledRelatedApps","windowConstructorAliasTest","CDPRuntimeDomainTest","Error","Object","console","debug","windowDocumentAuxVarsTest","getOwnPropertyNames","document","$chrome_asyncScriptInfo","values","value","cache_","getPrototypeOf","storeItem","retrieveItem","isNodeReachable_","sort","Promise","Symbol","token","getAsyncToken","startPromisesLoop","entries","includes","warn"];xr=Er,Ar=295,function(e){for(;--e;)xr.push(xr.shift())}(++Ar);var Sr=function(e,t){return Er[e-=0]};const kr=Sr("0x0"),Mr=Sr("0x1"),Cr=e=>e?[...e][Sr("0x2")](((e,t)=>e+Math.abs(t)),0):0;class Ir{constructor(e,t,i){this[Sr("0x3")]=e,this[Sr("0x4")]=t,this[Sr("0x5")]=i}async[Sr("0x6")](){const e=this[Sr("0x4")][Sr("0x7")](kr,[]),t=this[Sr("0x4")][Sr("0x7")](Mr,36e5),i=await new Dr(e,this[Sr("0x5")])[Sr("0x8")]();return this[Sr("0x9")]=i,this[Sr("0x3")].setItemLocalStorageSafe(Mr,Date[Sr("0xa")]()+t),i}async[Sr("0xb")](){return Number(this[Sr("0x3")][Sr("0xc")](Mr))<Date.now()||!this.lastDeviceData?await this.calculate():this[Sr("0x9")]}}class Dr{constructor(e,t){this[Sr("0x0")]=e,this[Sr("0x5")]=t,this[Sr("0xd")]={battery:this[Sr("0xe")],brave:this[Sr("0xf")],canvas:this[Sr("0x10")],codecs:this.getCodesTests,connection:this[Sr("0x11")],cookieEnabled:this.getCookieEnabled,cryptoRandomValues:this[Sr("0x12")],deviceMemory:this[Sr("0x13")],documentBasedKeys:this[Sr("0x14")],hardwareConcurrency:this[Sr("0x15")],indexedDB:this[Sr("0x16")],fidoEnabled:this.getFIDOEnabled,languages:this[Sr("0x17")],language:this[Sr("0x18")],timezoneOffset:this[Sr("0x19")],localStorage:this[Sr("0x1a")],navigatorBasedKeys:this[Sr("0x1b")],navigatorProduct:this[Sr("0x1c")],navigatorUserAgent:this.getNavigatorUserAgent,navigatorUAData:this[Sr("0x1d")],navigatorHighEntropyData:this[Sr("0x1e")],navigatorStorageEstimation:this[Sr("0x1f")],navigatorOnLine:this.navigatorOnLine,navigatorIsUserActive:this[Sr("0x20")],math:this[Sr("0x21")],mediaMatch:this.getMediaMatch,openDatabase:this[Sr("0x22")],windowOrientation:this[Sr("0x23")],platform:this[Sr("0x24")],cpuClass:this.getCpuClass,osClass:this.getOsCpu,addBehavior:this[Sr("0x25")],productSub:this[Sr("0x26")],mediaDevices:this[Sr("0x27")],audioFingerprint:this.getAudioFingerprint,audioFingerprintExtended:this[Sr("0x28")],fonts:this[Sr("0x29")],performanceTiming:this.getPerformanceTiming,performanceMemory:this[Sr("0x2a")],plugins:this.getPlugins,screen:this[Sr("0x2b")],sequentum:this[Sr("0x2c")],sessionStorage:this.getSessionStorage,referrer:this[Sr("0x2d")],timezone:this[Sr("0x2e")],touchSupport:this[Sr("0x2f")],vendor:this[Sr("0x30")],buildID:this.getBuildID,webdriver:this.getWebDriver,webGlRenderer:this[Sr("0x31")],windowBasedKeys:this.getWindowBasedKeys,windowOuter:this[Sr("0x32")],webRTCDisabled:this[Sr("0x33")],cryptoBindingData:this[Sr("0x34")][Sr("0x35")](this),notificationState:this[Sr("0x36")].bind(this,"notifications"),geolocationState:this.getNavigatorPermissionsState[Sr("0x35")](this,Sr("0x37")),isGeoLocationExists:this[Sr("0x38")],isSendBeaconExists:this[Sr("0x39")],navigatorPrototype:this[Sr("0x3a")],installedRelatedApps:this[Sr("0x3b")],windowConstructorAliasTest:this[Sr("0x3c")],windowDocumentAuxVarsTest:this.windowDocumentAuxVarsTest,CDPRuntimeDomainTest:this[Sr("0x3d")]}}[Sr("0x3d")](){let e=!1;const t=new(window[Sr("0x3e")]);return window[Sr("0x3f")].defineProperty(t,"stack",{configurable:!1,enumerable:!1,get:function(){return e=!0,""}}),window[Sr("0x40")][Sr("0x41")](t.stack),e}[Sr("0x42")](){for(const e of window[Sr("0x3f")][Sr("0x43")](window[Sr("0x44")]))if(e==Sr("0x45")||/^\$cdc_[a-zA-Z0-9]{22}_$/.test(e))return!0;for(const e of window[Sr("0x3f")][Sr("0x46")](window.Object.getOwnPropertyDescriptors(window[Sr("0x44")]))){if(!e[Sr("0x47")]||void 0===e[Sr("0x47")][Sr("0x48")])continue;const t=window.Object[Sr("0x43")](window[Sr("0x3f")][Sr("0x49")](e[Sr("0x47")])),i=[Sr("0x4a"),Sr("0x4b"),Sr("0x4c")];if(t[Sr("0x4d")](),i[Sr("0x4d")](),t.every(((e,t)=>e==i[t])))return!0}return!1}[Sr("0x3c")](){const e=window[Sr("0x3f")].getOwnPropertyNames(window);for(const t of e){if(/^cdc_[a-zA-Z0-9]{22}_(Array|Promise|Symbol)$/.test(t))return!0;for(const e of[window.Array,window[Sr("0x4e")],window[Sr("0x4f")]])if(t!=(null==e?void 0:e.name)&&t!=Sr("0x50")&&t!=Sr("0x51")&&window[t]===e)return!0}return!1}async[Sr("0x8")](){const e=this.startPromisesLoop();return await this.collectPromisesData(e)}[Sr("0x52")](){const e={};for(const[t,i]of Object[Sr("0x53")](this[Sr("0xd")]))if(!this.sdkDeviceDataCollectionIgnoreList[Sr("0x54")](t))try{e[t]=wr(i,100)}catch(i){Ai[Sr("0x55")](Sr("0x56"),{e:i,key:t}),e[t]=Promise[Sr("0x57")]()}return e}async[Sr("0x58")](e){const t={};for(const[i,r]of Object[Sr("0x53")](e))try{t[i]=await r}catch(e){Ai[Sr("0x55")](Sr("0x59"),{e:e,key:i}),t[i]=void 0}return t}[Sr("0x5a")](){const e=navigator.cookieEnabled;return Promise[Sr("0x57")](e)}async[Sr("0x5b")](){return!!navigator[Sr("0x5c")]&&await window[Sr("0x5d")].isUserVerifyingPlatformAuthenticatorAvailable()}[Sr("0x12")](){const e=window[Sr("0x5e")][Sr("0x5f")](new Uint8Array(16));return Array[Sr("0x60")](e)}[Sr("0x33")](){const e=null==window[Sr("0x61")];return Promise[Sr("0x57")](e)}[Sr("0x62")](){const e=[Sr("0x63"),Sr("0x64"),Sr("0x65"),"__gCrWeb",Sr("0x66"),Sr("0x67"),Sr("0x68"),"__firefox__",Sr("0x69"),Sr("0x6a"),"oprt",Sr("0x6b"),Sr("0x6c"),Sr("0x6d"),Sr("0x6e"),Sr("0x6f"),"__phantomas",Sr("0x70"),Sr("0x71"),Sr("0x72"),Sr("0x73"),Sr("0x74"),Sr("0x75"),Sr("0x76"),Sr("0x77"),"calledSelenium",Sr("0x78"),Sr("0x79"),Sr("0x7a"),Sr("0x7b"),Sr("0x7c"),Sr("0x7d"),"__fxdriver_unwrapped",Sr("0x7e"),Sr("0x7f"),Sr("0x80"),Sr("0x81"),Sr("0x82"),Sr("0x83"),Sr("0x84"),Sr("0x85"),Sr("0x86"),Sr("0x87"),Sr("0x88"),"__webdriverFuncgeb",Sr("0x89"),"calledPhantom",Sr("0x8a"),Sr("0x8b"),"cdc_adoQpoasnfa76pfcZLmcfl_Symbol",Sr("0x8c"),"fmget_targets","geb",Sr("0x8d"),Sr("0x8e"),Sr("0x8f"),Sr("0x90")],t=[];for(const i of e){const e=window[i];void 0!==e&&null!=e&&t[Sr("0x91")](i)}return Promise[Sr("0x57")](t)}[Sr("0x92")](){const e={"dynamic-range":["high",Sr("0x93")],"prefers-reduced-motion":[Sr("0x94"),Sr("0x2")],"prefers-contrast":[Sr("0x94"),Sr("0x95"),Sr("0x96"),Sr("0x97"),Sr("0x98"),Sr("0x99")],"max-monochrome":["0","10",Sr("0x9a"),"1000"],"forced-colors":[Sr("0x9b"),Sr("0x9c")],"inverted-colors":[Sr("0x9d"),Sr("0x9c")],"color-gamut":[Sr("0x9e"),"p3","srgb"]},t={};for(const[i,r]of Object[Sr("0x53")](e))for(const e of r)t[i[Sr("0x9f")](/-/g,"_")+"_"+e[Sr("0x9f")](/-/g,"_")]=window[Sr("0xa0")]("("+i+": "+e+")")[Sr("0xa1")];return Promise[Sr("0x57")](t)}getMathFingerprint(){const e=[Math[Sr("0xa5")](.12312423423423424),Math[Sr("0xa6")](1e308),(t=1e154,Math[Sr("0xa2")](t+Math[Sr("0xa3")](t*t-1))),Math[Sr("0xa7")](.12312423423423424),Math[Sr("0xa8")](1),Math[Sr("0xa2")](1+Math[Sr("0xa3")](2)),Math[Sr("0xa9")](.5),Math[Sr("0xa2")](3)/2,Math[Sr("0xaa")](.5),Math.sin(-1e300),Math[Sr("0xab")](1),Math[Sr("0xa4")](1)-1/Math[Sr("0xa4")](1)/2,Math[Sr("0xac")](10.000000000123),Math[Sr("0xad")](1),(Math[Sr("0xa4")](1)+1/Math.exp(1))/2,Math.tan(-1e300),Math.tanh(1),(Math[Sr("0xa4")](2)-1)/(Math[Sr("0xa4")](2)+1),Math[Sr("0xa4")](1),Math[Sr("0xae")](1),Math[Sr("0xa4")](1)-1,Math[Sr("0xaf")](10),Math[Sr("0xa2")](11),Math.PI**-100];var t;let i="";for(let t=0;t<e[Sr("0xb0")];t++)i+=e[t].toString();return Promise[Sr("0x57")](Dr[Sr("0xb1")](i))}[Sr("0x11")](){const{connection:e}=navigator,t=(e=>{let{downlink:t,effectiveType:i,rtt:r,saveData:n}=e;return{downlink:t,effectiveType:i,rtt:r,saveData:n}})(e);return Promise[Sr("0x57")](t)}[Sr("0xb2")](){return Promise[Sr("0x57")](!!window[Sr("0xb3")])}[Sr("0x1a")](){return Promise[Sr("0x57")](!!window[Sr("0xb4")])}[Sr("0x2c")](){return-1!==window[Sr("0xb5")][Sr("0xb6")]()[Sr("0xb7")](Sr("0xb8"))}[Sr("0x1b")](){return[Sr("0xb9"),Sr("0x7b"),Sr("0x84"),Sr("0x81"),Sr("0x7d"),Sr("0x7c"),"__webdriver_unwrapped",Sr("0x82"),Sr("0xba"),Sr("0x79"),Sr("0x77"),Sr("0xbb"),Sr("0xbc"),Sr("0xbd"),"driver-evaluate",Sr("0xbe"),Sr("0xbf"),Sr("0xc0"),Sr("0xc1"),Sr("0xc2"),"__webdriver_script_fn","__$webdriverAsyncExecutor",Sr("0x7e"),"__lastWatirConfirm","__lastWatirPrompt",Sr("0x45"),Sr("0xc3"),Sr("0xc4")][Sr("0xc5")]((e=>navigator[e]))}[Sr("0x1c")](){const e=navigator[Sr("0xc6")];return Promise.resolve(e)}getNavigatorUserAgent(){return navigator[Sr("0xc7")]}[Sr("0x1d")](){return navigator[Sr("0xc8")]}getNavigatorHighEntropyData(){return _r()}[Sr("0x1f")](){return navigator[Sr("0xc9")][Sr("0xca")]()}[Sr("0xcb")](){return navigator.onLine}[Sr("0x20")](){return navigator[Sr("0xcc")][Sr("0xcd")]}async[Sr("0x36")](e){try{const t=await navigator[Sr("0xce")].query({name:e});return null==t?void 0:t[Sr("0xcf")]}catch(e){}}[Sr("0x38")](){return!!navigator.geolocation}[Sr("0x39")](){return"function"==typeof navigator[Sr("0xd0")]}[Sr("0x3a")](){return{hardwareConcurrency:Object[Sr("0xd1")](Object.getPrototypeOf(navigator),Sr("0xd2")).get[Sr("0xb6")](),languages:Object[Sr("0xd1")](Object.getPrototypeOf(navigator),Sr("0xd3"))[Sr("0xd4")][Sr("0xb6")]()}}async[Sr("0x3b")](){if(typeof navigator[Sr("0x3b")]===Sr("0xd5"))try{const{related_applications:e}=await navigator[Sr("0x3b")]();if(e&&Array.isArray(e))return e.map((e=>({platform:e[Sr("0xd6")],url:e[Sr("0xd7")]})))}catch(e){}}[Sr("0x2d")](){return document[Sr("0xd8")]}getPerformanceTiming(){return performance.timing}[Sr("0x2a")](){const{jsHeapSizeLimit:e,totalJSHeapSize:t,usedJSHeapSize:i}=performance[Sr("0xd9")];return{jsHeapSizeLimit:e,totalJSHeapSize:t,usedJSHeapSize:i}}[Sr("0x16")](){return Promise[Sr("0x57")](!!window[Sr("0xda")])}getOpenDatabase(){const{openDatabase:e}=window;return Promise.resolve(!!e)}[Sr("0x2f")](){const e=window[Sr("0xdb")]&&document instanceof DocumentTouch,t={maxTouchPoints:navigator[Sr("0xdc")]||navigator[Sr("0xdd")]||0,documentTouch:e,ontouchstart:"ontouchstart"in window};return Promise[Sr("0x57")](t)}[Sr("0xde")](){function e(e){const t=[];for(let i=0;i<e[Sr("0xb0")];++i)t[Sr("0x91")]({type:e[i][Sr("0xdf")],suffixes:e[i].suffixes});return t}const t=[];for(let i=0;i<navigator.plugins[Sr("0xb0")];++i){const r=navigator[Sr("0xe0")][i];r&&t[Sr("0x91")]({name:r[Sr("0xe1")],description:r[Sr("0xe2")],mimeTypes:e(r)})}return Promise[Sr("0x57")](t)}[Sr("0x2b")](){const e=window[Sr("0xe3")]||screen,{availLeft:t}=e,{availTop:i}=e,r={availHeight:e[Sr("0xe4")],availLeft:t,availTop:i,availWidth:e[Sr("0xe5")],colorDepth:e.colorDepth,height:e[Sr("0xe6")],width:e.width,pixelDepth:e[Sr("0xe7")],orientationAngle:e[Sr("0xe8")]&&e[Sr("0xe8")][Sr("0xe9")],orientationType:e[Sr("0xe8")]&&e[Sr("0xe8")].type,devicePixelRatio:window[Sr("0xea")]};return Promise[Sr("0x57")](r)}static[Sr("0xb1")](e){if(null==e)return;let t=0,i=0;const r=e[Sr("0xb0")];for(;i<r;)t=(t<<5)-t+e.charCodeAt(i++)|0;return t}[Sr("0x32")](){const e={outerWidth:window[Sr("0xeb")],outerHeight:window[Sr("0xec")]};return Promise[Sr("0x57")](e)}getWebDriver(){const e=navigator[Sr("0xb9")];return Promise[Sr("0x57")](e)}[Sr("0x23")](){const e=window[Sr("0xe8")];return Promise[Sr("0x57")](e)}[Sr("0x24")](){const e=navigator[Sr("0xd6")];return Promise[Sr("0x57")](e)}[Sr("0xed")](){const e=navigator.cpuClass;return Promise[Sr("0x57")](e)}[Sr("0xee")](){const e=navigator[Sr("0xef")];return Promise[Sr("0x57")](e)}[Sr("0x25")](){const e=!!window[Sr("0xf0")][Sr("0xf1")][Sr("0xf2")];return Promise[Sr("0x57")](e)}getProductSub(){const e=navigator.productSub;return Promise.resolve(e)}async getMediaDevices(){const e=await navigator.mediaDevices[Sr("0xf3")](),t=[];for(const i of e)t.push({kind:i[Sr("0xf4")],label:i[Sr("0xf5")],deviceId:i.deviceId,groupId:i[Sr("0xf6")]});return t}async getAudioFingerprint(){const e=window[Sr("0xf7")]||window[Sr("0xf8")];if(!e)return-1;const t=new e(1,5e3,44100),i=t[Sr("0xf9")]();i[Sr("0xdf")]=Sr("0xfa"),i[Sr("0xfb")][Sr("0x47")]=1e4;const r=t[Sr("0xfc")]();r.threshold.value=-50,r[Sr("0xfd")].value=40,r[Sr("0xfe")][Sr("0x47")]=12,r.attack[Sr("0x47")]=0,r[Sr("0xff")][Sr("0x47")]=.25,i[Sr("0x100")](r),r[Sr("0x100")](t[Sr("0x101")]),i[Sr("0x102")](0);const n=new Promise((async(e,i)=>{t.oncomplete=t=>e(t[Sr("0x103")]);try{await t[Sr("0x104")]()}catch(e){i(e)}})),a=(await n)[Sr("0x105")](0)[Sr("0x106")](4500);return Dr[Sr("0x107")](a)}async[Sr("0x28")](){var e;const t=window[Sr("0xf7")]||window[Sr("0xf8")];if(!t)return{};const i=new t(1,5e3,44100),r=i[Sr("0xf9")]();r[Sr("0xdf")]="triangle",r[Sr("0xfb")][Sr("0x47")]=1e4;const n=i[Sr("0xfc")]();n[Sr("0x108")][Sr("0x47")]=-50,n[Sr("0xfd")][Sr("0x47")]=40,n[Sr("0x109")][Sr("0x47")]=0;const a=i[Sr("0x10a")]();r[Sr("0x100")](n),n[Sr("0x100")](a),n[Sr("0x100")](i[Sr("0x101")]),r[Sr("0x102")](0);try{await i[Sr("0x104")](),n[Sr("0x10b")](),r[Sr("0x10b")]();const t=new Float32Array(a[Sr("0x10c")]);null===(e=a[Sr("0x10d")])||void 0===e||e[Sr("0x10e")](a,t);const o=new Float32Array(a[Sr("0x10f")]);return Sr("0x110")in a&&a[Sr("0x110")](o),{gain:n[Sr("0x111")][Sr("0x47")]||n[Sr("0x111")],freq:Cr(t),time:Cr(o)}}catch(e){return{}}}static[Sr("0x107")](e){let t=0;for(let i=0;i<e.length;++i)t+=Math[Sr("0x112")](e[i]);return t}[Sr("0x29")](){const e=[Sr("0x113"),Sr("0x114"),Sr("0x115")],t=[Sr("0x116"),Sr("0x117"),Sr("0x118"),"Arabic Typesetting","Arial Unicode MS",Sr("0x119"),Sr("0x11a"),"Batang","Bitstream Vera Sans Mono",Sr("0x11b"),Sr("0x11c"),Sr("0x11d"),"Clarendon",Sr("0x11e"),Sr("0x11f"),Sr("0x120"),Sr("0x121"),Sr("0x122"),"Gill Sans",Sr("0x123"),Sr("0x124"),Sr("0x125"),Sr("0x126"),"Leelawadee","Letter Gothic",Sr("0x127"),Sr("0x128"),Sr("0x129"),"Menlo",Sr("0x12a"),Sr("0x12b"),Sr("0x12c"),"MS UI Gothic",Sr("0x12d"),Sr("0x12e"),Sr("0x12f"),Sr("0x130"),"Microsoft Uighur",Sr("0x131"),Sr("0x132"),Sr("0x133"),"Pristina",Sr("0x134"),Sr("0x135"),"Serifa","SimHei",Sr("0x136"),Sr("0x137"),Sr("0x138"),Sr("0x139"),"Vrinda",Sr("0x13a")],i=document[Sr("0x13b")]("div");i[Sr("0x13c")][Sr("0x13d")]=Sr("0x13e");const r={},n={},a=e=>{const t=document[Sr("0x13b")](Sr("0x13f")),{style:r}=t;return r.position="absolute",r[Sr("0x140")]="0",r[Sr("0x141")]="0",r.fontFamily=e,r[Sr("0x142")]=Sr("0x143"),t[Sr("0x144")]="mmMwWLliI0O&1",i[Sr("0x145")](t),t},o=(e,t)=>a("'"+e+"',"+t),s=e[Sr("0x146")](a),c=(()=>{const i={};for(const r of t)i[r]=e[Sr("0x146")]((e=>o(r,e)));return i})();document.body[Sr("0x145")](i);try{for(let t=0;t<e[Sr("0xb0")];t++)r[e[t]]=s[t][Sr("0x148")],n[e[t]]=s[t][Sr("0x149")];const i=t.filter((t=>{return i=c[t],e[Sr("0x147")](((e,t)=>i[t].offsetWidth!==r[e]||i[t].offsetHeight!==n[e]));var i}));return Promise[Sr("0x57")](i)}finally{document[Sr("0x14a")][Sr("0x14b")](i)}}getTimezoneOffset(){const e=(new Date)[Sr("0x19")]();return Promise[Sr("0x57")](e)}[Sr("0x18")](){const e=navigator[Sr("0x14c")];return Promise[Sr("0x57")](e)}[Sr("0x17")](){const e=navigator[Sr("0xd3")];return Promise[Sr("0x57")](e)}[Sr("0x15")](){const e=navigator[Sr("0xd2")];return Promise[Sr("0x57")](e)}[Sr("0x13")](){const e=navigator.deviceMemory;return Promise.resolve(e)}[Sr("0x14")](){return[Sr("0x84"),Sr("0x81"),Sr("0x87"),Sr("0x86"),Sr("0x85"),Sr("0x7d"),Sr("0x7c"),"__webdriver_unwrapped",Sr("0x7b"),"__selenium_unwrapped",Sr("0xba")][Sr("0xc5")]((e=>document[e]))}[Sr("0x2e")](){const e=Intl[Sr("0x14d")]()[Sr("0x14e")]()[Sr("0x14f")];return Promise.resolve(e)}[Sr("0x30")](){const e=navigator[Sr("0x150")];return Promise.resolve(e)}[Sr("0x151")](){const e=navigator[Sr("0x152")];return Promise[Sr("0x57")](e)}async[Sr("0x10")](){const e=document[Sr("0x13b")]("canvas");e.width=1,e[Sr("0xe6")]=1;const t=e[Sr("0x167")]("2d"),i={winding:function(e){return e[Sr("0x166")](0,0,10,10),e[Sr("0x166")](2,2,6,6),!e.isPointInPath(5,5,"evenodd")}(t),geometry:function(e,t){e[Sr("0x153")]=122,e[Sr("0xe6")]=110,t[Sr("0x15e")]=Sr("0x15f");const i=[[Sr("0x160"),40,40],[Sr("0x161"),80,40],["#ff2",60,80]];for(const[e,r,n]of i)t[Sr("0x156")]=e,t.beginPath(),t[Sr("0x162")](r,n,40,0,2*Math.PI,!0),t.closePath(),t[Sr("0x163")]();return t[Sr("0x156")]=Sr("0x164"),t[Sr("0x162")](60,60,60,0,2*Math.PI,!0),t[Sr("0x162")](60,60,20,0,2*Math.PI,!0),t[Sr("0x163")]("evenodd"),Dr[Sr("0xb1")](e[Sr("0x165")]())}(e,t),text:function(e,t){e[Sr("0x153")]=240,e.height=60,t[Sr("0x154")]=Sr("0x155"),t[Sr("0x156")]=Sr("0x157"),t.fillRect(100,1,62,20),t[Sr("0x156")]=Sr("0x158"),t[Sr("0x159")]=Sr("0x15a");const i="Cwm fjordbank gly "+String.fromCharCode(55357,56835);return t[Sr("0x15b")](i,2,15),t.fillStyle=Sr("0x15c"),t[Sr("0x159")]=Sr("0x15d"),t.fillText(i,4,45),Dr[Sr("0xb1")](e.toDataURL())}(e,t)};return Promise[Sr("0x57")](i)}async getBattery(){const e=await navigator[Sr("0xe")]();return{charging:e[Sr("0x168")],chargingTime:e[Sr("0x169")],dischargingTime:e[Sr("0x16a")],level:e[Sr("0x16b")]}}async[Sr("0xf")](){return!!navigator[Sr("0x16c")]&&await navigator[Sr("0x16c")][Sr("0x16d")]()}async[Sr("0x31")](){const e=document[Sr("0x13b")](Sr("0x16e")),t=e[Sr("0x167")](Sr("0x16f"))||e.getContext(Sr("0x170")),i=t[Sr("0x171")](Sr("0x172"));return Promise[Sr("0x57")](t[Sr("0x173")](i[Sr("0x174")]))}async[Sr("0x175")](){const e=document[Sr("0x13b")](Sr("0x176")),t={basic:""===e[Sr("0x177")](Sr("0x178")),advanced:""===e[Sr("0x177")](Sr("0x179"))};return Promise.resolve(t)}async[Sr("0x34")](){const{publicKey:e,keyIdentifier:t}=await this.cryptoBinding[Sr("0x17a")]();return{publicKey:e,keyIdentifier:t}}static[Sr("0x17b")](){return/iPhone|iPad|iPod|Android|MiuiBrowser/i.test(navigator[Sr("0xc7")])||null!=window[Sr("0xe8")]||window[Sr("0xa0")](Sr("0x17c"))[Sr("0xa1")]}}var Tr,Rr,zr=["uncompressed","ALLOW","CHALLENGE","DENY","TRUST","compress","compressed"];Tr=zr,Rr=271,function(e){for(;--e;)Tr.push(Tr.shift())}(++Rr);var Br,Pr,Or,Fr,Nr=function(e,t){return zr[e-=0]};(Pr=Br||(Br={}))[Nr("0x0")]=Nr("0x1"),Pr[Nr("0x2")]=Nr("0x2"),(Fr=Or||(Or={}))[Nr("0x3")]=Nr("0x3"),Fr.CHALLENGE=Nr("0x4"),Fr[Nr("0x5")]="DENY",Fr[Nr("0x6")]=Nr("0x6");var Lr,jr,Ur=["parse","SHA-256","crypto is not supported","generateSymKey","subtle","generateKey","AES-GCM","encrypt","decrypt","encryptPayload","string","encode","crypto","arrayBufferToBase64","encryptSymKeyBundle","exportKey","raw","stringify","RSA-OAEP","byteLength","fromCharCode","btoa","importPublicKey","importKey"];Lr=Ur,jr=483,function(e){for(;--e;)Lr.push(Lr.shift())}(++jr);var qr=function(e,t){return Ur[e-=0]};class Kr{constructor(e){this.configManager=e}[qr("0x0")](){return window.crypto[qr("0x1")][qr("0x2")]({name:qr("0x3"),length:256},!0,[qr("0x4"),qr("0x5")])}async[qr("0x6")](e,t){const i=typeof e===qr("0x7")?(new TextEncoder)[qr("0x8")](e):e,r=window.crypto.getRandomValues(new Uint8Array(12)),n={name:qr("0x3"),iv:r},a=await window[qr("0x9")].subtle.encrypt(n,t,i);return{payloadCipherText:this[qr("0xa")](a),iv:r}}async[qr("0xb")](e,t,i){const r=await window[qr("0x9")].subtle[qr("0xc")](qr("0xd"),e),n=this[qr("0xa")](r),a=this[qr("0xa")](t),o=(new TextEncoder)[qr("0x8")](JSON[qr("0xe")]({symKey:n,iv:a})),s=await window[qr("0x9")][qr("0x1")][qr("0x4")]({name:qr("0xf")},i,o);return this[qr("0xa")](s)}[qr("0xa")](e){let t="";const i=new Uint8Array(e),r=i[qr("0x10")];for(let e=0;e<r;e++)t+=String[qr("0x11")](i[e]);return window[qr("0x12")](t)}[qr("0x13")](e){return window[qr("0x9")][qr("0x1")][qr("0x14")]("jwk",JSON[qr("0x15")](e),{name:qr("0xf"),hash:qr("0x16")},!0,["encrypt"])}async[qr("0x4")](e,t){if(!window[qr("0x9")]||!window[qr("0x9")][qr("0x1")])throw new Error(qr("0x17"));const i=await this[qr("0x0")](),{payloadCipherText:r,iv:n}=await this.encryptPayload(t,i),a=await this[qr("0x13")](e);return{encryptedData:r,encryptedKey:await this[qr("0xb")](i,n,a)}}}var Hr,Vr,$r=["error","name","toString","SDKError: ",", errorSpace: ","toLog","CLIENT","SERVER","server","COMMUNICATION","communication","errorSpace","errorCode","message"];Hr=$r,Vr=468,function(e){for(;--e;)Hr.push(Hr.shift())}(++Vr);var Jr,Gr,Wr=function(e,t){return $r[e-=0]};(Gr=Jr||(Jr={}))[Wr("0x0")]="client",Gr[Wr("0x1")]=Wr("0x2"),Gr[Wr("0x3")]=Wr("0x4");class Zr extends Error{constructor(e,t,i){var r,n;super(),this.error=e,this[Wr("0x5")]=t,this[Wr("0x6")]=i,this[Wr("0x7")]=(null===(r=this[Wr("0x8")])||void 0===r?void 0:r.message)||this[Wr("0x8")].toString(),this[Wr("0x9")]=(null===(n=this[Wr("0x8")])||void 0===n?void 0:n.name)||Zr[Wr("0x9")]}[Wr("0xa")](){return Wr("0xb")+this.message+(this[Wr("0x5")]?Wr("0xc")+this[Wr("0x5")]:"")+(this[Wr("0x6")]?", errorCode: "+this[Wr("0x6")]:"")}[Wr("0xd")](){return i(i({name:this[Wr("0x9")],message:this[Wr("0x7")]},this[Wr("0x5")]&&{errorSpace:this.errorSpace}),this[Wr("0x6")]&&{errorCode:this[Wr("0x6")]})}}var Yr,Qr,Xr=["identityManager","getTabId","timestamp","includes","type","addEventToLocalStorage","push","length","flushTimeoutHandle","flush","Error while emitting event","getClientId","errorCode","toLog","min","catch","Error while emitting event (delayed flush)","refreshSessionToken","sendDeviceDataEvent","Failed to refresh data","isTokenExpired","error","Failed to polling data","enrichUADataIfDoesNotExist","navigatorHighEntropyData","popAllEvents","pop","sort","clientId","deviceId","userId","getUserId","sdkPlatform","events","keyIdentifier","warn","sessionToken","buildEncryptedRequestBody","getRotationData","data","signature","postData","device/events","headers","find","value","setDeviceId","setUserId","cleanLocalStorageEvents","COMMUNICATION","stringify","uncompressed","increaseEventIndex","eventIndex","getItemLocalStorageSafe","parseInt","isNaN","setItemLocalStorageSafe","shouldSendDeviceEvent","now","info","no need to send device event","getDeviceData","emitEvent","getDeviceId","page_load","referrer","history","extractWindowRespurces","performance","getEntriesByType","resources","isArray","map","name","initiatorType","registerEventListeners","fetchEventsFromLocalStorage","parse","removeItemLocalStorageSafe","ddls","rei","mouseEventsCollectionBuffer","bufferSize","bufferInterval","EVENT_TYPE_IDENTIFICATION","localStoredEventTypes","configManager","storageManager","requestsManager","cryptoBinding","serverPath","enableSessionToken","safeEventCallback","EVENT_TYPE_INTERACTION","eventsQueue","crypto","interactionEventsManager","getConfValue","isMobile","eventTypesToStore","maxEventStored","pollingInterval","pollingSessionToken","index","location","toString","platform","sdkVersion","tabId"];Yr=Xr,Qr=410,function(e){for(;--e;)Yr.push(Yr.shift())}(++Qr);var en=function(e,t){return Xr[e-=0]};const tn=en("0x0"),rn="lastDeviceInDeviceEvent",nn=en("0x1"),an="lse",on=en("0x2"),sn="deviceEventDataCollectionIgnoreList",cn=en("0x3"),dn=en("0x4"),un=[Bi.EVENT_TYPE_ACTION,Bi[en("0x5")]],ln=en("0x6");class hn{constructor(e,t,r,n,a,o,s,c){this[en("0x7")]=e,this[en("0x8")]=t,this.deviceDataManager=r,this[en("0x9")]=n,this.identityManager=a,this[en("0xa")]=o,this[en("0xb")]=s,this[en("0xc")]=c,this.eventIndex=null,this.flushTimeoutHandle=null,this[en("0xd")]=async(e,t)=>{try{const r=i({},i({interaction_type:e},t)),n={type:Bi[en("0xe")],attributes:r};return await this.emitEvent(n)}catch(e){}},this.enableSessionToken=c,this[en("0xf")]=[],this[en("0x10")]=new Kr(e),this[en("0x11")]=new gr(this.configManager[en("0x12")](sn,[]),this[en("0x7")][en("0x12")](on,100),this.safeEventCallback),this[en("0x13")]=Dr.isMobile(),this[en("0x14")]=this[en("0x7")][en("0x12")](ln,[Bi.EVENT_TYPE_ACTION]),this[en("0x15")]=this.configManager[en("0x12")]("maxLocalStoredEvents",4),this[en("0x16")]=36e4,this[en("0x17")]()}async emitEvent(e){e[en("0x18")]=this.increaseEventIndex(),e[en("0x19")]=location[en("0x1a")](),e.platform=navigator[en("0x1b")],e[en("0x1c")]="1.52.0",e[en("0xb")]=this.serverPath,e[en("0x1d")]=this[en("0x1e")][en("0x1f")](),e[en("0x20")]=Date.now(),await this.enrichUADataIfDoesNotExist(e);let t=0;this[en("0x14")][en("0x21")](e[en("0x22")])?t=this[en("0x23")](e):this[en("0xf")][en("0x24")](e);const i=this[en("0x7")][en("0x12")](cn,2);if(this.eventsQueue[en("0x25")]+t>=i||un[en("0x21")](e[en("0x22")])){this[en("0x26")]&&(clearTimeout(this.flushTimeoutHandle),this[en("0x26")]=null);try{return await this[en("0x27")]()}catch(t){throw Ai.error(en("0x28"),{clientId:this[en("0x1e")][en("0x29")](),eventType:e[en("0x22")],error:t[en("0x2a")]?t[en("0x2b")]():t}),t}}if(!this.flushTimeoutHandle&&this[en("0xf")][en("0x25")]>0){const t=this[en("0x7")][en("0x12")](dn,2),i=Math[en("0x2c")](t,30);this.flushTimeoutHandle=setTimeout((()=>{this[en("0x26")]=null,this[en("0x27")]()[en("0x2d")]((t=>{Ai.error(en("0x2e"),{clientId:this[en("0x1e")][en("0x29")](),eventType:e[en("0x22")],error:t[en("0x2a")]?t.toLog():t})}))}),1e3*i)}return{}}async[en("0x2f")](){try{return this[en("0xf")][en("0x25")]>0||await this[en("0x30")](!0),await this.flush()}catch(e){Ai.error(en("0x31"),{e:e})}}async[en("0x17")](){try{this[en("0x1e")][en("0x32")]()&&await this[en("0x2f")]()}catch(e){Ai[en("0x33")](en("0x34"),{e:e})}finally{setTimeout((async()=>{await this[en("0x17")]()}),this[en("0x16")])}}async[en("0x35")](e){var t;if(!(null===(t=e.attributes)||void 0===t?void 0:t.navigatorHighEntropyData))try{e.attributes[en("0x36")]=await _r()}catch(e){}}[en("0x37")](){const e=[],t=this.fetchEventsFromLocalStorage();for(;this.eventsQueue[en("0x25")];)e[en("0x24")](this[en("0xf")][en("0x38")]());return(null==t?void 0:t[en("0x25")])&&e[en("0x24")](...t),e[en("0x39")](((e,t)=>e[en("0x20")]-t[en("0x20")]))}async flush(){const e=this[en("0x37")]();if(0===e[en("0x25")])return{};const t={};t[en("0x3a")]=this[en("0x1e")][en("0x29")](),t[en("0x3b")]=this[en("0x1e")].getDeviceId(),t[en("0x3c")]=this[en("0x1e")][en("0x3d")](),t[en("0x3e")]=this[en("0x13")]?Ni:Fi,t[en("0x3f")]=e;try{const{keyIdentifier:e}=await this[en("0xa")].getPublicData();t[en("0x40")]=e}catch(e){Ai[en("0x41")]("Crypto-binding is not supported. "+e)}this.enableSessionToken&&(t[en("0x42")]=!0);const r=await this[en("0x43")](t),n=await this[en("0xa")][en("0x44")]();let a;n&&(a=[{type:"key_rotation_data",data:n[en("0x45")],signature:n[en("0x46")]}]);const o=await this.requestsManager[en("0x47")](en("0x48"),i(i({},r),a?{headers:a}:{}));if(o[en("0x49")]){const e=o[en("0x49")][en("0x4a")]((e=>"key_rotation_status"===e[en("0x22")]));e&&e[en("0x4b")]&&this[en("0xa")].handleRotateResponse(e[en("0x4b")])}return o[en("0x3b")]&&this[en("0x1e")][en("0x4c")](o.deviceId),o[en("0x42")]&&this[en("0x1e")].setSessionToken(o[en("0x42")]),o[en("0x3c")]&&this[en("0x1e")][en("0x4d")](o[en("0x3c")]),this[en("0x4e")](),o}async buildEncryptedRequestBody(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=this[en("0x7")][en("0x12")]("publicKey",null);if(null===i&&t)return await this[en("0x7")].refreshConf(this[en("0x1e")][en("0x29")]()),await this[en("0x43")](e);if(null===i)throw new Zr(new Error("Encryption error - missing public key"),Jr[en("0x4f")]);try{const t=JSON[en("0x50")](e),r=this.compressData(t),n=r||t,{encryptedData:a,encryptedKey:o}=await this[en("0x10")].encrypt(i,n);return{data:a,key:o,dataType:r?Br.compress:Br[en("0x51")]}}catch(e){throw new Zr(e,Jr.CLIENT)}}compressData(e){try{return oi(e)}catch(e){Ai.error("Failed to compress data, sending the data to the service uncompressed",{clientId:this[en("0x1e")][en("0x29")](),error:e})}}[en("0x52")](){if(null===this[en("0x53")]){const e=this[en("0x8")][en("0x54")](nn),t=Number[en("0x55")](e);this[en("0x53")]=Number[en("0x56")](t)?-1:t}return this[en("0x53")]++,this[en("0x8")][en("0x57")](nn,this.eventIndex[en("0x1a")]()),this[en("0x53")]}[en("0x58")](){const e=this[en("0x8")][en("0x54")](tn),t=this[en("0x8")][en("0x54")](rn);return!e||!t||Date[en("0x59")]()-e>864e5||t!=this[en("0x1e")].getDeviceId()}async[en("0x30")](e){if(!e&&!this.shouldSendDeviceEvent())return Ai[en("0x5a")](en("0x5b")),!1;const t=await this.deviceDataManager[en("0x5c")](),i={type:Bi.EVENT_TYPE_DEVICE,attributes:t},r=await this[en("0x5d")](i);return r&&(this.storageManager[en("0x57")](tn,Date.now()),this[en("0x8")][en("0x57")](rn,this.identityManager[en("0x5e")]())),r}async sendPageLoadEvent(){const e=en("0x5f");if(this.configManager.getConfValue(sn,[])[en("0x21")](e))return!1;const t=this.extractWindowRespurces();return await this.emitEvent({type:Bi[en("0xe")],attributes:i(i({interaction_type:e,location:window[en("0x19")].href,referrer:document[en("0x60")]},window[en("0x61")]&&{window_historyLength:window[en("0x61")].length}),t&&{windowResources:t})}),!0}[en("0x62")](){try{const e=window[en("0x63")][en("0x64")](en("0x65"));return e&&Array[en("0x66")](e)?e[en("0x67")]((e=>({name:e[en("0x68")],initiatorType:e[en("0x69")]}))):void 0}catch(e){}}registerEventListeners(){this.interactionEventsManager[en("0x6a")](),this[en("0x1e")][en("0x6a")]()}[en("0x6b")](){const e=this[en("0x8")][en("0x54")](an);return e?JSON[en("0x6c")](e):[]}[en("0x23")](e){const t=this.fetchEventsFromLocalStorage();return Ki.maintainLastXItems(t,this[en("0x15")],e),this[en("0x8")].setItemLocalStorageSafe(an,JSON.stringify(t)),t[en("0x25")]}cleanLocalStorageEvents(){this[en("0x8")][en("0x6d")](an)}}var fn,pn,gn=["userId","removeItemSessionStorageSafe","removeItemLocalStorageSafe","tabId","random","setSessionToken","getSessionToken","parse","iat","exp","now","rti","rst","userIdStorageExpiry","configManager","setClientId","clientId","loadDeviceId","loadTabId","registerEventListeners","addEventListener","beforeunload","saveTabIdOnUnload","getDeviceId","setDeviceId","deviceId","info","Updating DeviceId","setItemSessionStorageSafe","storageManager","setItemLocalStorageSafe","getItemSessionStorageSafe","getItemLocalStorageSafe","getClientId","getUserId","getConfValue","setUserId"];fn=gn,pn=344,function(e){for(;--e;)fn.push(fn.shift())}(++pn);var mn=function(e,t){return gn[e-=0]};const bn="rui",vn="rdi",yn="rdit",_n=mn("0x0"),wn=mn("0x1"),xn=mn("0x2");class An{constructor(e,t,i){this.storageManager=e,this[mn("0x3")]=t,this.clientId=i,this[mn("0x4")](this[mn("0x5")])}load(){this[mn("0x6")](),this[mn("0x7")]()}[mn("0x8")](){window[mn("0x9")](mn("0xa"),(async()=>this[mn("0xb")]()))}[mn("0xc")](){return this.deviceId}[mn("0xd")](e){this[mn("0xe")]!==e&&(Ai[mn("0xf")](mn("0x10"),{deviceId:e}),this[mn("0xe")]=e,this.storageManager[mn("0x11")](vn,e),this[mn("0x12")][mn("0x13")](vn,e))}[mn("0x6")](){const e=this.storageManager[mn("0x14")](vn)||this[mn("0x12")][mn("0x15")](vn);return null!=e&&this[mn("0xd")](e),e}[mn("0x16")](){return this[mn("0x5")]}setClientId(e){this[mn("0x12")][mn("0x16")]()!=e&&this.storageManager[mn("0x4")](e),this[mn("0x12")].setItemSessionStorageSafe("rci",e)}[mn("0x17")](){if(Number(this[mn("0x12")].getItemLocalStorageSafe(yn))+this[mn("0x3")][mn("0x18")](xn,864e5)<Date.now())return this.removeUserId(),null;const e=this[mn("0x12")][mn("0x14")](bn);return null!=e?e:this[mn("0x12")][mn("0x15")](bn)}[mn("0x19")](e){this[mn("0x1a")]=e,this.storageManager[mn("0x11")](bn,e),this[mn("0x12")].setItemLocalStorageSafe(bn,e),this[mn("0x12")][mn("0x13")](yn,Date.now())}removeUserId(){this.storageManager[mn("0x1b")](bn),this[mn("0x12")][mn("0x1c")](bn),this[mn("0x12")][mn("0x1c")](yn)}[mn("0x7")](){const e=this.storageManager[mn("0x14")](_n);e?(this[mn("0x12")][mn("0x1b")](_n),this[mn("0x1d")]=e):this[mn("0x1d")]=Math.floor(Math[mn("0x1e")]()*Number.MAX_SAFE_INTEGER).toString()}getTabId(){return this[mn("0x1d")]}[mn("0xb")](){this[mn("0x12")][mn("0x11")](_n,this[mn("0x1d")])}[mn("0x1f")](e){this[mn("0x12")][mn("0x13")](wn,e)}getSessionToken(){return this[mn("0x12")].getItemLocalStorageSafe(wn)||this.storageManager[mn("0x14")](wn)}isTokenExpired(){var e;const t=this[mn("0x20")]();if(!t)return!0;try{const i=JSON[mn("0x21")](atob(t.split(".")[1]));let r=(null!==(e=i.exp)&&void 0!==e?e:i[mn("0x22")])*(i.exp&&i[mn("0x23")]<1e12?1e3:1);return i.exp||(r+=9e5),Date[mn("0x24")]()>=r}catch(e){return Ai.error("Invalid JWT:",{error:e}),!0}}}var En,Sn,kn=["stringify","callServer","getData","GET","fetch","fetch-api is not supported","CLIENT","statusText","status","message","COMMUNICATION","serverPath","postData","postDataFromURL","POST","include","application/json"];En=kn,Sn=198,function(e){for(;--e;)En.push(En.shift())}(++Sn);var Mn=function(e,t){return kn[e-=0]};class Cn{constructor(e){this[Mn("0x0")]=e}async[Mn("0x1")](e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this[Mn("0x2")](this[Mn("0x0")]+e,t,i)}async[Mn("0x2")](e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n={method:Mn("0x3"),credentials:Mn("0x4"),headers:new Headers(i({"Content-Type":Mn("0x5")},r)),body:JSON[Mn("0x6")](t)};return await this[Mn("0x7")](e,n)}async[Mn("0x8")](e){const t=this[Mn("0x0")]+e,i={method:Mn("0x9"),credentials:Mn("0x4")};return await this[Mn("0x7")](t,i)}async[Mn("0x7")](e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(Mn("0xa")in window))throw new Zr(new Error(Mn("0xb")),Jr[Mn("0xc")]);try{const i=await fetch(e,t),r=await i.json();if(i.ok)return r;throw new Zr(new Error(r.message||i[Mn("0xd")]),Jr.SERVER,i[Mn("0xe")])}catch(e){if(!(e instanceof Zr))throw new Zr(new Error(e[Mn("0xf")]),Jr[Mn("0x10")]);throw e}}}var In,Dn,Tn=["filter","length","Invalid SDK params was provided: ","stringify","REQUIRED_SDK_PARAMS","string","throwOrReturnResult","info","throwError","validateSDKParams","keys"];In=Tn,Dn=224,function(e){for(;--e;)In.push(In.shift())}(++Dn);var Rn=function(e,t){return Tn[e-=0]};class zn{constructor(){this[Rn("0x0")]={clientId:Rn("0x1")}}[Rn("0x2")](e,t,i){if(!e&&((null==t?void 0:t.logIfInvalid)&&Ai[Rn("0x3")](i),null==t?void 0:t[Rn("0x4")]))throw new Error(i);return e}[Rn("0x5")](e,t){const i=Object[Rn("0x6")](this[Rn("0x0")])[Rn("0x7")]((t=>typeof e[t]!=this[Rn("0x0")][t]));return this[Rn("0x2")](0==i[Rn("0x8")],t,Rn("0x9")+JSON[Rn("0xa")](i))}}var Bn,Pn,On=["platform","postData","device/logs","requestsManager","identityManager","configManager","lastTimeLogsSent","logMiddleware","reportLogs","middlewares","push","getConfValue","enableLogsReporting","logsMinimumDelay","logs","length","now","flush","getClientId","floor"];Bn=On,Pn=363,function(e){for(;--e;)Bn.push(Bn.shift())}(++Pn);var Fn=function(e,t){return On[e-=0]};class Nn{constructor(e,t,i){this[Fn("0x0")]=e,this[Fn("0x1")]=t,this[Fn("0x2")]=i,this[Fn("0x3")]=0,this[Fn("0x4")]=async()=>{try{await this[Fn("0x5")]()}catch(e){}},Ai[Fn("0x6")][Fn("0x7")](this[Fn("0x4")])}async[Fn("0x5")](){if(!this[Fn("0x2")][Fn("0x8")](Fn("0x9"),!1))return;const e=this[Fn("0x2")].getConfValue("logsMinimumBatch",6),t=this[Fn("0x2")][Fn("0x8")](Fn("0xa"),12e4);if(Ai[Fn("0xb")][Fn("0xc")]<e||this[Fn("0x3")]+t>Date.now())return;this[Fn("0x3")]=Date[Fn("0xd")]();const i=Ai[Fn("0xe")](),r=this[Fn("0x1")][Fn("0xf")](),n=Math[Fn("0x10")](Date[Fn("0xd")]()/1e3),a={sdkVersion:"1.52.0",platform:navigator[Fn("0x11")],clientId:r,timestamp:n,logEntries:i};await this[Fn("0x0")][Fn("0x12")](Fn("0x13"),a)}}var Ln,jn,Un=["getClientId","device/migrate-identifiers","postDataFromURL","deviceId","storageManager","rimd","identityManager","migrateIdentifiers","getItemLocalStorageSafe","true","getDeviceId"];Ln=Un,jn=258,function(e){for(;--e;)Ln.push(Ln.shift())}(++jn);var qn=function(e,t){return Un[e-=0]};const Kn=qn("0x0");class Hn{constructor(e,t,i){this[qn("0x1")]=e,this.requestsManager=t,this.storageManager=i}async[qn("0x2")](e){if(this.storageManager[qn("0x3")](Kn)!=qn("0x4")){const t=this[qn("0x1")][qn("0x5")](),i=this[qn("0x1")][qn("0x6")](),r=(e.endsWith("/")?e:e+"/")+qn("0x7"),n=await this.requestsManager[qn("0x8")](r,{deviceId:t,clientId:i});n.deviceId&&n[qn("0x9")]==t&&this[qn("0xa")].setItemLocalStorageSafe(Kn,qn("0x4"))}}}var Vn,$n,Jn=["identityManager","migrationsManager","storageManager","enableSessionToken","logsReporter","getConfValue","isInitialized","Session token is not enabled","now","info","SDK disabled","disabled_sdk_","eventsManager","refreshSessionToken","getSessionToken","init","object","userId","initializationPromise","refreshConf","tenantId","keyRotation","cryptoBinding","crypto","createCryptoBinding","sign","isEnabled","startedAt","deviceDataManager","enabled","sendDeviceDataEvent","catch","sendPageLoadEvent","updateUserId","registerEventListeners","triggerActionEvent","includes","warn","Invalid action type","CLIENT","claimedUserIdType","invalid_claimed_user_id_type_","getDeviceData","EVENT_TYPE_ACTION","correlationId","claimedUserId","publicKey","extensionMetadata","extensionDeviceAttributes","suspiciousSignals","suspiciousContext","downloadFile","uploadFile","transactionData","customAttributes","emitEvent","Unhandled SDK error. recieved eventResponse: ","errorSpace","SERVER","_error_","message","unexpected_error_","identifyUser","identifyUser called without a valid userid","getUserId","setUserId","EVENT_TYPE_IDENTIFICATION","deviceId","removeUserId","setAuthenticatedUser","setUser","unidentifiedUser","RiskID","TSAccountProtection","dispatchEvent","undefined","sdkEnabled","enableIdentifiersMigration","verbose","actions","https://collect.riskid.security/","email","phone_number","ssn","national_id","passport_number","drivers_license_number","other","isSDKDisabled","identifiersMigrationEnabled","firstPartyMigrationUrl","validationManager","initializedInstance","SDK already initialized","string","clientId","options","serverPath","toString","validateSDKParams","mainEntry","requestsManager","configManager"];Vn=Jn,$n=487,function(e){for(;--e;)Vn.push(Vn.shift())}(++$n);var Gn=function(e,t){return Jn[e-=0]};const Wn=[null,void 0,Gn("0x0"),"",0],Zn=Gn("0x1"),Yn=Gn("0x2"),Qn=Gn("0x3"),Xn=Gn("0x4"),ea=Gn("0x5"),ta=[Gn("0x6"),Gn("0x7"),"account_id",Gn("0x8"),Gn("0x9"),Gn("0xa"),Gn("0xb"),Gn("0xc")];class ia{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i;if(this.initializationPromise=null,this[Gn("0xd")]=!1,this.enableSessionToken=!1,this[Gn("0xe")]=!1,this[Gn("0xf")]=null,this[Gn("0x10")]=new zn,ia[Gn("0x11")])throw new Error(Gn("0x12"));ia[Gn("0x11")]=!0;const r=typeof t===Gn("0x13");this[Gn("0x14")]=r?t:e,this[Gn("0x15")]=r?{serverPath:e}:t,(i=this[Gn("0x15")])[Gn("0x16")]||(i[Gn("0x16")]=ea),this[Gn("0x15")][Gn("0x16")]=new URL(this.options[Gn("0x16")])[Gn("0x17")](),this[Gn("0xf")]=this.options.firstPartyMigrationUrl||null,Ai.enabled=!!this[Gn("0x15")].verbose,this[Gn("0x10")][Gn("0x18")](this,{throwError:!0,logIfInvalid:!0})||(this[Gn("0xd")]=!0),this.storageManager=new bi(this[Gn("0x14")]),this[Gn("0x1a")]=new Cn(this.options[Gn("0x16")]),this[Gn("0x1b")]=new Di(this.storageManager,this.requestsManager),this[Gn("0x1c")]=new An(this.storageManager,this.configManager,this[Gn("0x14")]),this[Gn("0x1c")].load(),this[Gn("0x1d")]=new Hn(this[Gn("0x1c")],this[Gn("0x1a")],this[Gn("0x1e")]),this[Gn("0x1f")]=this[Gn("0x15")][Gn("0x1f")]||!1,this[Gn("0x20")]=new Nn(this[Gn("0x1a")],this[Gn("0x1c")],this.configManager)}get[Gn("0x4")](){return this[Gn("0x1b")][Gn("0x21")](Xn,[])}async getActions(){return await this[Gn("0x22")](),this[Gn("0x4")]}async getSessionToken(){if(!this[Gn("0x1f")])throw new Error(Gn("0x23"));if(!await this[Gn("0x22")]()){const e=Date[Gn("0x24")]();return Ai[Gn("0x25")](Gn("0x26")),{actionToken:Gn("0x27")+e}}return this[Gn("0x1c")].isTokenExpired()&&await this[Gn("0x28")][Gn("0x29")](),this[Gn("0x1c")][Gn("0x2a")]()}async[Gn("0x2b")](e){const t=typeof e!==Gn("0x2c")?e:null==e?void 0:e[Gn("0x2d")];return Ai[Gn("0x25")]("sdk init started"),this[Gn("0x2e")]=(async()=>{await this.configManager[Gn("0x2f")](this[Gn("0x1c")].getClientId());const e=this[Gn("0x1b")].getConfValue(Gn("0x30"),null),i=this[Gn("0x1b")][Gn("0x21")](Gn("0x31"),null);return this[Gn("0x32")]=pi[Gn("0x33")][Gn("0x34")](Gn("0x35"),(null==i?void 0:i[Gn("0x36")])?{keyRotation:{isEnabled:!0,expiryDays:i.expiryDays,startedAt:i[Gn("0x37")],tenantId:e}}:void 0),this[Gn("0x38")]=new Ir(this[Gn("0x1e")],this[Gn("0x1b")],this[Gn("0x32")]),this[Gn("0x28")]=new hn(this[Gn("0x1b")],this[Gn("0x1e")],this[Gn("0x38")],this[Gn("0x1a")],this[Gn("0x1c")],this[Gn("0x32")],this.options.serverPath,this[Gn("0x1f")]),this.isSDKDisabled=this[Gn("0xd")]||!this[Gn("0x1b")][Gn("0x21")](Zn,!1),!this[Gn("0xd")]&&(this[Gn("0xe")]=this[Gn("0xe")]||this.configManager.getConfValue(Yn,!1),this[Gn("0xe")]&&this[Gn("0xf")]&&await this[Gn("0x1d")].migrateIdentifiers(this[Gn("0xf")]),Ai[Gn("0x39")]=Ai[Gn("0x39")]||!!this.configManager[Gn("0x21")](Qn,!1),await this[Gn("0x28")][Gn("0x3a")]()[Gn("0x3b")]((()=>{})),await this[Gn("0x28")][Gn("0x3c")]()[Gn("0x3b")]((()=>{})),await this[Gn("0x3d")](t)[Gn("0x3b")]((()=>{})),this.eventsManager[Gn("0x3e")](),await this.eventsManager.flush()[Gn("0x3b")]((()=>{})),Ai.info("sdk init done"),!0)})(),await this[Gn("0x2e")]}async isInitialized(){return null!==this.initializationPromise&&await this[Gn("0x2e")]}async[Gn("0x3f")](e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=Date[Gn("0x24")]();if(!await this[Gn("0x22")]())return Ai[Gn("0x25")]("SDK disabled"),{actionToken:Gn("0x27")+r};if(!this[Gn("0x4")][Gn("0x40")](e))return Ai[Gn("0x41")](Gn("0x42"),{actionType:e}),{actionToken:Jr[Gn("0x43")]+"_error_'invalid action type - "+e+"'_"+r};const n=null==t?void 0:t[Gn("0x44")];if(n&&!ta.includes(n))return Ai[Gn("0x41")]("Invalid claimedUserIdType",{claimedUserIdType:n}),{actionToken:Gn("0x45")+n+"_"+r};let a;this[Gn("0x1b")].getConfValue("enableDeviceAttributesInActions",!1)&&(a=await this[Gn("0x38")][Gn("0x46")]());const o=i({type:Bi[Gn("0x47")],attributes:i(i(i(i(i(i(i(i(i(i(i(i({action_type:e},(null==t?void 0:t[Gn("0x48")])&&{correlation_id:t[Gn("0x48")]}),(null==t?void 0:t[Gn("0x49")])&&{claimed_user_id:t[Gn("0x49")]}),n&&{claimed_user_id_type:n}),(null==t?void 0:t[Gn("0x4a")])&&{public_key:t[Gn("0x4a")]}),(null==t?void 0:t[Gn("0x4b")])&&{extension_metadata:t.extensionMetadata}),(null==t?void 0:t.extensionDeviceAttributes)&&{extension_device_attributes:t[Gn("0x4c")]}),(null==t?void 0:t[Gn("0x4d")])&&{suspicious_signals:t[Gn("0x4d")]}),(null==t?void 0:t[Gn("0x4e")])&&{suspicious_context:t.suspiciousContext}),(null==t?void 0:t.downloadFile)&&{download_file:t[Gn("0x4f")]}),(null==t?void 0:t.uploadFile)&&{upload_file:t[Gn("0x50")]}),(null==t?void 0:t[Gn("0x51")])&&{transactionData:t.transactionData}),a)},(null==t?void 0:t.customAttributes)&&{customAttributes:t[Gn("0x52")]});try{const e=await this[Gn("0x28")][Gn("0x53")](o),{actionToken:t}=e;if(!t)throw new Zr(new Error(Gn("0x54")+(typeof e==Gn("0x2c")?JSON.stringify(e).slice(15):e)),Jr.CLIENT);return e}catch(t){return{actionToken:t instanceof Zr?t[Gn("0x55")]===Jr[Gn("0x56")]?t[Gn("0x55")]+Gn("0x57")+e+"_"+t.errorCode+"_'"+t[Gn("0x58")]+"'_"+r:t[Gn("0x55")]+Gn("0x57")+e+"_'"+t.message+"'_"+r:Gn("0x59")+e+"_"+r}}}async[Gn("0x5a")](e){return await this[Gn("0x22")]()?this.updateUserId(e):(Ai[Gn("0x25")](Gn("0x26")),!1)}async[Gn("0x3d")](e){if(Wn[Gn("0x40")](e))return Ai[Gn("0x25")](Gn("0x5b"),{userId:e}),!1;e=e.toString(),Ai.info(Gn("0x5a"),{userId:e});const t=this[Gn("0x1c")][Gn("0x5c")]();return t===e||(this.identityManager[Gn("0x5d")](e),!!(await this[Gn("0x28")].emitEvent({type:Bi[Gn("0x5e")],attributes:{previous_user_id:t,user_id:e}}))[Gn("0x5f")])}async unidentifiedUser(){if(!await this[Gn("0x22")]())return Ai[Gn("0x25")](Gn("0x26")),!1;const e=this[Gn("0x1c")][Gn("0x5c")]();return null!=e&&this.identityManager[Gn("0x60")](),!!(await this[Gn("0x28")].emitEvent({type:Bi[Gn("0x5e")],attributes:{previous_user_id:e}}))[Gn("0x5f")]}async[Gn("0x61")](e){return await this[Gn("0x5a")](e)}async[Gn("0x62")](e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return await this[Gn("0x61")](e,t)}async clearUser(){return await this[Gn("0x63")]()}}ia[Gn("0x11")]=!1,document[Gn("0x66")](new CustomEvent("TSAccountProtectionReady"));var ra,na,aa=["events","MODULE_INITIALIZED","moduleMetadata","getInitConfig","init","utils","exceptions","TsError","not_initialized","tsPlatform not initialized","setUser","clearUser","identifyUser","unidentifiedUser","getSessionToken","identityManager","getDeviceId","getClientId","eventsManager","flush"];ra=aa,na=500,function(e){for(;--e;)ra.push(ra.shift())}(++na);var oa=function(e,t){return aa[e-=0]};let sa=null;function ca(e){if(!e)throw new(pi[oa("0x5")][oa("0x6")][oa("0x7")])(oa("0x8"),oa("0x9"))}pi.events.on(pi[oa("0x0")][oa("0x1")],(()=>{const{clientId:e,drs:t}=pi[oa("0x2")][oa("0x3")](),i=t||{},{enabled:r,userId:n}=i,o=a(i,si);!1!==r&&(sa=new ia(e,o),sa[oa("0x4")]({userId:n}))}));const da=function(){return ca(sa),sa[oa("0xe")]()},ua={getDeviceId:()=>sa[oa("0xf")][oa("0x10")](),getClientId:()=>sa[oa("0xf")][oa("0x11")](),flush:()=>sa[oa("0x12")][oa("0x13")]()};var la=Object.freeze({__proto__:null,__internal:ua,clearUser:function(){return ca(sa),sa[oa("0xb")](...arguments)},getActions:function(){return ca(sa),sa.getActions()},getSessionToken:da,identifyUser:function(){return ca(sa),sa[oa("0xc")](...arguments)},setAuthenticatedUser:function(){return ca(sa),sa.setAuthenticatedUser(...arguments)},setUser:function(){return ca(sa),sa[oa("0xa")](...arguments)},triggerActionEvent:function(){return ca(sa),sa.triggerActionEvent(...arguments)},unidentifiedUser:function(){return ca(sa),sa[oa("0xd")](...arguments)}});class ha extends Error{constructor(e,t,i){super(i),this.name="ApiError",this.url=t.url,this.status=t.status,this.statusText=t.statusText,this.body=t.body,this.request=e}}const fa={BASE:window.location.origin,VERSION:"",WITH_CREDENTIALS:!1,CREDENTIALS:"include",TOKEN:void 0,USERNAME:void 0,PASSWORD:void 0,HEADERS:void 0,ENCODE_PATH:void 0};var pa,ga,ma,ba;!function(e){var t;(t=e.feedback||(e.feedback={})).OK="ok",t.OTHER="other",t.DOCUMENT_NOT_FOUND="document_not_found",t.FACE_NOT_FOUND="face_not_found",t.DOCUMENT_FACE_NOT_FOUND="document_face_not_found",t.OBSTRUCTED="obstructed",t.BLUR="blur",t.GLARE="glare",t.DOCUMENT_NOT_SUPPORTED="document_not_supported",t.DOCUMENT_NOT_MATCHING="document_not_matching",t.WRONG_DOCUMENT_SIDE="wrong_document_side",t.MULTI_FACE="multi_face",t.FACE_ROTATED="face_rotated",t.FACE_TOO_SMALL="face_too_small",t.FACE_TOO_CLOSE="face_too_close",t.CLOSED_EYES="closed_eyes",t.FACE_ANGLE_TOO_LARGE="face_angle_too_large",t.FACE_CLOSE_TO_BORDER="face_close_to_border",t.FACE_OCCLUDED="face_occluded",t.FACE_CROPPED="face_cropped",t.BARCODE_NOT_FOUND="barcode_not_found",t.GLARE_SELFIE="glare_selfie",t.BLUR_SELFIE="blur_selfie",t.RESTRICTED_CRITERIA="restricted_criteria"}(pa||(pa={})),function(e){var t;(t=e.image_type||(e.image_type={})).DOCUMENT_FRONT="document_front",t.DOCUMENT_BACK="document_back",t.SELFIE="selfie"}(ga||(ga={})),function(e){var t,i;(t=e.status||(e.status={})).PENDING="pending",t.CAPTURING="capturing",t.PROCESSING="processing",t.RECAPTURE="recapture",t.COMPLETE="complete",t.ERROR="error",t.EXPIRED="expired",(i=e.recapture_reason||(e.recapture_reason={})).IMAGE_MISSING="image_missing",i.DOCUMENT_EXPIRED="document_expired",i.DOCUMENT_NOT_SUPPORTED="document_not_supported",i.DOCUMENT_DAMAGED="document_damaged",i.POOR_IMAGE_QUALITY="poor_image_quality",i.DOCUMENT_NOT_FOUND="document_not_found",i.OBSTRUCTED="obstructed",i.BLUR="blur",i.GLARE="glare",i.DOCUMENT_NOT_MATCHING="document_not_matching",i.WRONG_DOCUMENT_SIDE="wrong_document_side",i.FACE_NOT_FOUND="face_not_found",i.DOCUMENT_FACE_NOT_FOUND="document_face_not_found",i.INVALID_INPUT="invalid_input",i.MULTI_FACE="multi_face",i.FACE_ROTATED="face_rotated",i.FACE_TOO_SMALL="face_too_small",i.FACE_TOO_CLOSE="face_too_close",i.CLOSED_EYES="closed_eyes",i.FACE_ANGLE_TOO_LARGE="face_angle_too_large",i.FACE_CLOSE_TO_BORDER="face_close_to_border",i.FACE_OCCLUDED="face_occluded",i.FACE_CROPPED="face_cropped",i.BARCODE_NOT_FOUND="barcode_not_found",i.GLARE_SELFIE="glare_selfie",i.BLUR_SELFIE="blur_selfie",i.NO_FACE="no_face",i.DOCUMENT_TYPE_RESTRICTED="document_type_restricted"}(ma||(ma={})),function(e){var t;(t=e.client_type||(e.client_type={})).HOSTED_APP="hosted_app",t.MOBILE_SDK="mobile_sdk"}(ba||(ba={}));var va={},ya={get exports(){return va},set exports(e){va=e}};!function(e,t){!function(i,r){var n="function",a="undefined",o="object",s="string",c="major",d="model",u="name",l="type",h="vendor",f="version",p="architecture",g="console",m="mobile",b="tablet",v="smarttv",y="wearable",_="embedded",w="Amazon",x="Apple",A="ASUS",E="BlackBerry",S="Browser",k="Chrome",M="Firefox",C="Google",I="Huawei",D="LG",T="Microsoft",R="Motorola",z="Opera",B="Samsung",P="Sharp",O="Sony",F="Xiaomi",N="Zebra",L="Facebook",j="Chromium OS",U="Mac OS",q=" Browser",K=function(e){for(var t={},i=0;i<e.length;i++)t[e[i].toUpperCase()]=e[i];return t},H=function(e,t){return typeof e===s&&-1!==V(t).indexOf(V(e))},V=function(e){return e.toLowerCase()},$=function(e,t){if(typeof e===s)return e=e.replace(/^\s\s*/,""),typeof t===a?e:e.substring(0,500)},J=function(e,t){for(var i,a,s,c,d,u,l=0;l<t.length&&!d;){var h=t[l],f=t[l+1];for(i=a=0;i<h.length&&!d&&h[i];)if(d=h[i++].exec(e))for(s=0;s<f.length;s++)u=d[++a],typeof(c=f[s])===o&&c.length>0?2===c.length?typeof c[1]==n?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?typeof c[1]!==n||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):r:this[c[0]]=u?c[1].call(this,u,c[2]):r:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):r):this[c]=u||r;l+=2}},G=function(e,t){for(var i in t)if(typeof t[i]===o&&t[i].length>0){for(var n=0;n<t[i].length;n++)if(H(t[i][n],e))return"?"===i?r:i}else if(H(t[i],e))return"?"===i?r:i;return t.hasOwnProperty("*")?t["*"]:e},W={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"},Z={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[f,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,f],[/opios[\/ ]+([\w\.]+)/i],[f,[u,z+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[f,[u,z+" GX"]],[/\bopr\/([\w\.]+)/i],[f,[u,z]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[f,[u,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/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)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[u,f],[/quark(?:pc)?\/([-\w\.]+)/i],[f,[u,"Quark"]],[/\bddg\/([\w\.]+)/i],[f,[u,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[u,"UC"+S]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[f,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[u,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[f,[u,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[f,[u,"Smart Lenovo "+S]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure "+S],f],[/\bfocus\/([\w\.]+)/i],[f,[u,M+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[u,z+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[u,z+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[u,"MIUI "+S]],[/fxios\/([-\w\.]+)/i],[f,[u,M]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360"+q]],[/\b(qq)\/([\w\.]+)/i],[[u,/(.+)/,"$1Browser"],f],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1"+q],f],[/samsungbrowser\/([\w\.]+)/i],[f,[u,B+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[u,/_/g," "],f],[/metasr[\/ ]?([\d\.]+)/i],[f,[u,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[u,"Sogou Mobile"],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[u,f],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,L],f],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\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],[u,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[u,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[f,[u,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[u,k+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,k+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[u,"Android "+S]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,f],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[f,[u,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[f,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[f,G,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[u,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],f],[/(wolvic)\/([\w\.]+)/i],[u,f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[u,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,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[u,[f,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[u,[f,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[p,"amd64"]],[/(ia32(?=;))/i],[[p,V]],[/((?:i[346]|x)86)[;\)]/i],[[p,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[p,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[p,"armhf"]],[/windows (ce|mobile); ppc;/i],[[p,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[p,/ower/,"",V]],[/(sun4\w)[;\)]/i],[[p,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[p,V]]],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],[d,[h,B],[l,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],[d,[h,B],[l,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[d,[h,x],[l,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[d,[h,x],[l,b]],[/(macintosh);/i],[d,[h,x]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[d,[h,P],[l,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[d,[h,I],[l,b]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[d,[h,I],[l,m]],[/\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],[[d,/_/g," "],[h,F],[l,m]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[d,/_/g," "],[h,F],[l,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[d,[h,"OPPO"],[l,m]],[/\b(opd2\d{3}a?) bui/i],[d,[h,"OPPO"],[l,b]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[d,[h,"Vivo"],[l,m]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[d,[h,"Realme"],[l,m]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[d,[h,R],[l,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[d,[h,R],[l,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[d,[h,D],[l,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[d,[h,D],[l,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[d,[h,"Lenovo"],[l,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[d,/_/g," "],[h,"Nokia"],[l,m]],[/(pixel c)\b/i],[d,[h,C],[l,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[d,[h,C],[l,m]],[/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],[d,[h,O],[l,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[d,"Xperia Tablet"],[h,O],[l,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[d,[h,"OnePlus"],[l,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[d,[h,w],[l,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[d,/(.+)/g,"Fire Phone $1"],[h,w],[l,m]],[/(playbook);[-\w\),; ]+(rim)/i],[d,h,[l,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[d,[h,E],[l,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[d,[h,A],[l,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[d,[h,A],[l,m]],[/(nexus 9)/i],[d,[h,"HTC"],[l,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[d,/_/g," "],[l,m]],[/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],[d,[h,"TCL"],[l,b]],[/(itel) ((\w+))/i],[[h,V],d,[l,G,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[d,[h,"Acer"],[l,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[d,[h,"Meizu"],[l,m]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[d,[h,"Ulefone"],[l,m]],[/droid.+; (a(?:015|06[35]|142p?))/i],[d,[h,"Nothing"],[l,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,d,[l,m]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/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,d,[l,b]],[/(surface duo)/i],[d,[h,T],[l,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[d,[h,"Fairphone"],[l,m]],[/(u304aa)/i],[d,[h,"AT&T"],[l,m]],[/\bsie-(\w*)/i],[d,[h,"Siemens"],[l,m]],[/\b(rct\w+) b/i],[d,[h,"RCA"],[l,b]],[/\b(venue[\d ]{2,7}) b/i],[d,[h,"Dell"],[l,b]],[/\b(q(?:mv|ta)\w+) b/i],[d,[h,"Verizon"],[l,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[d,[h,"Barnes & Noble"],[l,b]],[/\b(tm\d{3}\w+) b/i],[d,[h,"NuVision"],[l,b]],[/\b(k88) b/i],[d,[h,"ZTE"],[l,b]],[/\b(nx\d{3}j) b/i],[d,[h,"ZTE"],[l,m]],[/\b(gen\d{3}) b.+49h/i],[d,[h,"Swiss"],[l,m]],[/\b(zur\d{3}) b/i],[d,[h,"Swiss"],[l,b]],[/\b((zeki)?tb.*\b) b/i],[d,[h,"Zeki"],[l,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],d,[l,b]],[/\b(ns-?\w{0,9}) b/i],[d,[h,"Insignia"],[l,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[d,[h,"NextBook"],[l,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],d,[l,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],d,[l,m]],[/\b(ph-1) /i],[d,[h,"Essential"],[l,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[d,[h,"Envizen"],[l,b]],[/\b(trio[-\w\. ]+) b/i],[d,[h,"MachSpeed"],[l,b]],[/\btu_(1491) b/i],[d,[h,"Rotor"],[l,b]],[/(shield[\w ]+) b/i],[d,[h,"Nvidia"],[l,b]],[/(sprint) (\w+)/i],[h,d,[l,m]],[/(kin\.[onetw]{3})/i],[[d,/\./g," "],[h,T],[l,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[d,[h,N],[l,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[d,[h,N],[l,m]],[/smart-tv.+(samsung)/i],[h,[l,v]],[/hbbtv.+maple;(\d+)/i],[[d,/^/,"SmartTV"],[h,B],[l,v]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,D],[l,v]],[/(apple) ?tv/i],[h,[d,x+" TV"],[l,v]],[/crkey/i],[[d,k+"cast"],[h,C],[l,v]],[/droid.+aft(\w+)( bui|\))/i],[d,[h,w],[l,v]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[d,[h,P],[l,v]],[/(bravia[\w ]+)( bui|\))/i],[d,[h,O],[l,v]],[/(mitv-\w{5}) bui/i],[d,[h,F],[l,v]],[/Hbbtv.*(technisat) (.*);/i],[h,d,[l,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[h,$],[d,$],[l,v]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,d,[l,g]],[/droid.+; (shield) bui/i],[d,[h,"Nvidia"],[l,g]],[/(playstation [345portablevi]+)/i],[d,[h,O],[l,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[d,[h,T],[l,g]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[d,[h,B],[l,y]],[/((pebble))app/i],[h,d,[l,y]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[d,[h,x],[l,y]],[/droid.+; (glass) \d/i],[d,[h,C],[l,y]],[/droid.+; (wt63?0{2,3})\)/i],[d,[h,N],[l,y]],[/(quest( \d| pro)?)/i],[d,[h,L],[l,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[l,_]],[/(aeobc)\b/i],[d,[h,w],[l,_]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[d,[l,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[d,[l,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[l,m]],[/(android[-\w\. ]{0,9});.+buil/i],[d,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[u,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[u,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[u,f],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,f],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[u,[f,G,W]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[f,G,W],[u,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,U],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[f,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,f],[/\(bb(10);/i],[f,[u,E]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[f,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[u,M+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[u,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[f,[u,"watchOS"]],[/crkey\/([\d\.]+)/i],[f,[u,k+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[u,j],f],[/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) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[u,f],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[u,f]]},Y=function e(t,g){if(typeof t===o&&(g=t,t=r),!(this instanceof e))return new e(t,g).getResult();var v=typeof i!==a&&i.navigator?i.navigator:r,y=t||(v&&v.userAgent?v.userAgent:""),_=v&&v.userAgentData?v.userAgentData:r,w=g?function(e,t){var i={};for(var r in e)t[r]&&t[r].length%2==0?i[r]=t[r].concat(e[r]):i[r]=e[r];return i}(Z,g):Z,x=v&&v.userAgent==y;return this.getBrowser=function(){var e={};return e[u]=r,e[f]=r,J.call(e,y,w.browser),e[c]=function(e){return typeof e===s?e.replace(/[^\d\.]/g,"").split(".")[0]:r}(e[f]),x&&v&&v.brave&&typeof v.brave.isBrave==n&&(e[u]="Brave"),e},this.getCPU=function(){var e={};return e[p]=r,J.call(e,y,w.cpu),e},this.getDevice=function(){var e={};return e[h]=r,e[d]=r,e[l]=r,J.call(e,y,w.device),x&&!e[l]&&_&&_.mobile&&(e[l]=m),x&&"Macintosh"==e[d]&&v&&typeof v.standalone!==a&&v.maxTouchPoints&&v.maxTouchPoints>2&&(e[d]="iPad",e[l]=b),e},this.getEngine=function(){var e={};return e[u]=r,e[f]=r,J.call(e,y,w.engine),e},this.getOS=function(){var e={};return e[u]=r,e[f]=r,J.call(e,y,w.os),x&&!e[u]&&_&&_.platform&&"Unknown"!=_.platform&&(e[u]=_.platform.replace(/chrome os/i,j).replace(/macos/i,U)),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 y},this.setUA=function(e){return y=typeof e===s&&e.length>500?$(e,500):e,this},this.setUA(y),this};Y.VERSION="1.0.39",Y.BROWSER=K([u,f,c]),Y.CPU=K([p]),Y.DEVICE=K([d,h,l,g,m,v,b,y,_]),Y.ENGINE=Y.OS=K([u,f]),e.exports&&(t=e.exports=Y),t.UAParser=Y;var Q=typeof i!==a&&(i.jQuery||i.Zepto);if(Q&&!Q.ua){var X=new Y;Q.ua=X.getResult(),Q.ua.get=function(){return X.getUA()},Q.ua.set=function(e){X.setUA(e);var t=X.getResult();for(var i in t)Q.ua[i]=t[i]}}}("object"==typeof window?window:Y)}(ya,va);const _a="1.4.8",wa=va.UAParser(),xa=_a;function Aa(e,t){var i,r,n,a,o;return{Authorization:`Bearer ${t}`,"ts-sdk-version":xa,"ts-client-id":e,"ts-user-agent":navigator.userAgent,"ts-platform":"web-sdk","ts-os":null===(i=null==wa?void 0:wa.os)||void 0===i?void 0:i.name,"ts-os-version":null===(r=null==wa?void 0:wa.os)||void 0===r?void 0:r.version,"ts-device-model":null===(n=null==wa?void 0:wa.device)||void 0===n?void 0:n.model,"ts-manufacturer":null===(a=null==wa?void 0:wa.device)||void 0===a?void 0:a.vendor,"ts-browser":null===(o=null==wa?void 0:wa.browser)||void 0===o?void 0:o.name,"Content-Type":"application/json","X-TS-client-time":(new Date).toUTCString(),"X-TS-ua":navigator.userAgent}}var Ea="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},Sa=[],ka=[],Ma="undefined"!=typeof Uint8Array?Uint8Array:Array,Ca=!1;function Ia(){Ca=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,i=e.length;t<i;++t)Sa[t]=e[t],ka[e.charCodeAt(t)]=t;ka["-".charCodeAt(0)]=62,ka["_".charCodeAt(0)]=63}function Da(e,t,i){for(var r,n,a=[],o=t;o<i;o+=3)r=(e[o]<<16)+(e[o+1]<<8)+e[o+2],a.push(Sa[(n=r)>>18&63]+Sa[n>>12&63]+Sa[n>>6&63]+Sa[63&n]);return a.join("")}function Ta(e){var t;Ca||Ia();for(var i=e.length,r=i%3,n="",a=[],o=16383,s=0,c=i-r;s<c;s+=o)a.push(Da(e,s,s+o>c?c:s+o));return 1===r?(t=e[i-1],n+=Sa[t>>2],n+=Sa[t<<4&63],n+="=="):2===r&&(t=(e[i-2]<<8)+e[i-1],n+=Sa[t>>10],n+=Sa[t>>4&63],n+=Sa[t<<2&63],n+="="),a.push(n),a.join("")}function Ra(e,t,i,r,n){var a,o,s=8*n-r-1,c=(1<<s)-1,d=c>>1,u=-7,l=i?n-1:0,h=i?-1:1,f=e[t+l];for(l+=h,a=f&(1<<-u)-1,f>>=-u,u+=s;u>0;a=256*a+e[t+l],l+=h,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=256*o+e[t+l],l+=h,u-=8);if(0===a)a=1-d;else{if(a===c)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,r),a-=d}return(f?-1:1)*o*Math.pow(2,a-r)}function za(e,t,i,r,n,a){var o,s,c,d=8*a-n-1,u=(1<<d)-1,l=u>>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:a-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+l>=1?h/c:h*Math.pow(2,1-l))*c>=2&&(o++,c/=2),o+l>=u?(s=0,o=u):o+l>=1?(s=(t*c-1)*Math.pow(2,n),o+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,n),o=0));n>=8;e[i+f]=255&s,f+=p,s/=256,n-=8);for(o=o<<n|s,d+=n;d>0;e[i+f]=255&o,f+=p,o/=256,d-=8);e[i+f-p]|=128*g}var Ba={}.toString,Pa=Array.isArray||function(e){return"[object Array]"==Ba.call(e)};La.TYPED_ARRAY_SUPPORT=void 0===Ea.TYPED_ARRAY_SUPPORT||Ea.TYPED_ARRAY_SUPPORT;var Oa=Fa();function Fa(){return La.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Na(e,t){if(Fa()<t)throw new RangeError("Invalid typed array length");return La.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=La.prototype:(null===e&&(e=new La(t)),e.length=t),e}function La(e,t,i){if(!(La.TYPED_ARRAY_SUPPORT||this instanceof La))return new La(e,t,i);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return qa(this,e)}return ja(this,e,t,i)}function ja(e,t,i,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,i,r){if(t.byteLength,i<0||t.byteLength<i)throw new RangeError("'offset' is out of bounds");if(t.byteLength<i+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===i&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,i):new Uint8Array(t,i,r);La.TYPED_ARRAY_SUPPORT?(e=t).__proto__=La.prototype:e=Ka(e,t);return e}(e,t,i,r):"string"==typeof t?function(e,t,i){"string"==typeof i&&""!==i||(i="utf8");if(!La.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var r=0|$a(t,i);e=Na(e,r);var n=e.write(t,i);n!==r&&(e=e.slice(0,n));return e}(e,t,i):function(e,t){if(Va(t)){var i=0|Ha(t.length);return 0===(e=Na(e,i)).length||t.copy(e,0,0,i),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?Na(e,0):Ka(e,t);if("Buffer"===t.type&&Pa(t.data))return Ka(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function Ua(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function qa(e,t){if(Ua(t),e=Na(e,t<0?0:0|Ha(t)),!La.TYPED_ARRAY_SUPPORT)for(var i=0;i<t;++i)e[i]=0;return e}function Ka(e,t){var i=t.length<0?0:0|Ha(t.length);e=Na(e,i);for(var r=0;r<i;r+=1)e[r]=255&t[r];return e}function Ha(e){if(e>=Fa())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Fa().toString(16)+" bytes");return 0|e}function Va(e){return!(null==e||!e._isBuffer)}function $a(e,t){if(Va(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var i=e.length;if(0===i)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return _o(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return wo(e).length;default:if(r)return _o(e).length;t=(""+t).toLowerCase(),r=!0}}function Ja(e,t,i){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return co(this,t,i);case"utf8":case"utf-8":return no(this,t,i);case"ascii":return oo(this,t,i);case"latin1":case"binary":return so(this,t,i);case"base64":return ro(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return uo(this,t,i);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function Ga(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function Wa(e,t,i,r,n){if(0===e.length)return-1;if("string"==typeof i?(r=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=n?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(n)return-1;i=e.length-1}else if(i<0){if(!n)return-1;i=0}if("string"==typeof t&&(t=La.from(t,r)),Va(t))return 0===t.length?-1:Za(e,t,i,r,n);if("number"==typeof t)return t&=255,La.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):Za(e,[t],i,r,n);throw new TypeError("val must be string, number or Buffer")}function Za(e,t,i,r,n){var a,o=1,s=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,s/=2,c/=2,i/=2}function d(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){var u=-1;for(a=i;a<s;a++)if(d(e,a)===d(t,-1===u?0:a-u)){if(-1===u&&(u=a),a-u+1===c)return u*o}else-1!==u&&(a-=a-u),u=-1}else for(i+c>s&&(i=s-c),a=i;a>=0;a--){for(var l=!0,h=0;h<c;h++)if(d(e,a+h)!==d(t,h)){l=!1;break}if(l)return a}return-1}function Ya(e,t,i,r){i=Number(i)||0;var n=e.length-i;r?(r=Number(r))>n&&(r=n):r=n;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var o=0;o<r;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[i+o]=s}return o}function Qa(e,t,i,r){return xo(_o(t,e.length-i),e,i,r)}function Xa(e,t,i,r){return xo(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,i,r)}function eo(e,t,i,r){return Xa(e,t,i,r)}function to(e,t,i,r){return xo(wo(t),e,i,r)}function io(e,t,i,r){return xo(function(e,t){for(var i,r,n,a=[],o=0;o<e.length&&!((t-=2)<0);++o)r=(i=e.charCodeAt(o))>>8,n=i%256,a.push(n),a.push(r);return a}(t,e.length-i),e,i,r)}function ro(e,t,i){return 0===t&&i===e.length?Ta(e):Ta(e.slice(t,i))}function no(e,t,i){i=Math.min(e.length,i);for(var r=[],n=t;n<i;){var a,o,s,c,d=e[n],u=null,l=d>239?4:d>223?3:d>191?2:1;if(n+l<=i)switch(l){case 1:d<128&&(u=d);break;case 2:128==(192&(a=e[n+1]))&&(c=(31&d)<<6|63&a)>127&&(u=c);break;case 3:a=e[n+1],o=e[n+2],128==(192&a)&&128==(192&o)&&(c=(15&d)<<12|(63&a)<<6|63&o)>2047&&(c<55296||c>57343)&&(u=c);break;case 4:a=e[n+1],o=e[n+2],s=e[n+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(c=(15&d)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&c<1114112&&(u=c)}null===u?(u=65533,l=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),n+=l}return function(e){var t=e.length;if(t<=ao)return String.fromCharCode.apply(String,e);var i="",r=0;for(;r<t;)i+=String.fromCharCode.apply(String,e.slice(r,r+=ao));return i}(r)}La.poolSize=8192,La._augment=function(e){return e.__proto__=La.prototype,e},La.from=function(e,t,i){return ja(null,e,t,i)},La.TYPED_ARRAY_SUPPORT&&(La.prototype.__proto__=Uint8Array.prototype,La.__proto__=Uint8Array),La.alloc=function(e,t,i){return function(e,t,i,r){return Ua(t),t<=0?Na(e,t):void 0!==i?"string"==typeof r?Na(e,t).fill(i,r):Na(e,t).fill(i):Na(e,t)}(null,e,t,i)},La.allocUnsafe=function(e){return qa(null,e)},La.allocUnsafeSlow=function(e){return qa(null,e)},La.isBuffer=Ao,La.compare=function(e,t){if(!Va(e)||!Va(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var i=e.length,r=t.length,n=0,a=Math.min(i,r);n<a;++n)if(e[n]!==t[n]){i=e[n],r=t[n];break}return i<r?-1:r<i?1:0},La.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},La.concat=function(e,t){if(!Pa(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return La.alloc(0);var i;if(void 0===t)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var r=La.allocUnsafe(t),n=0;for(i=0;i<e.length;++i){var a=e[i];if(!Va(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,n),n+=a.length}return r},La.byteLength=$a,La.prototype._isBuffer=!0,La.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)Ga(this,t,t+1);return this},La.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)Ga(this,t,t+3),Ga(this,t+1,t+2);return this},La.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)Ga(this,t,t+7),Ga(this,t+1,t+6),Ga(this,t+2,t+5),Ga(this,t+3,t+4);return this},La.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?no(this,0,e):Ja.apply(this,arguments)},La.prototype.equals=function(e){if(!Va(e))throw new TypeError("Argument must be a Buffer");return this===e||0===La.compare(this,e)},La.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},La.prototype.compare=function(e,t,i,r,n){if(!Va(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===r&&(r=0),void 0===n&&(n=this.length),t<0||i>e.length||r<0||n>this.length)throw new RangeError("out of range index");if(r>=n&&t>=i)return 0;if(r>=n)return-1;if(t>=i)return 1;if(this===e)return 0;for(var a=(n>>>=0)-(r>>>=0),o=(i>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(r,n),d=e.slice(t,i),u=0;u<s;++u)if(c[u]!==d[u]){a=c[u],o=d[u];break}return a<o?-1:o<a?1:0},La.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},La.prototype.indexOf=function(e,t,i){return Wa(this,e,t,i,!0)},La.prototype.lastIndexOf=function(e,t,i){return Wa(this,e,t,i,!1)},La.prototype.write=function(e,t,i,r){if(void 0===t)r="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)r=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(i)?(i|=0,void 0===r&&(r="utf8")):(r=i,i=void 0)}var n=this.length-t;if((void 0===i||i>n)&&(i=n),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return Ya(this,e,t,i);case"utf8":case"utf-8":return Qa(this,e,t,i);case"ascii":return Xa(this,e,t,i);case"latin1":case"binary":return eo(this,e,t,i);case"base64":return to(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return io(this,e,t,i);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},La.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ao=4096;function oo(e,t,i){var r="";i=Math.min(e.length,i);for(var n=t;n<i;++n)r+=String.fromCharCode(127&e[n]);return r}function so(e,t,i){var r="";i=Math.min(e.length,i);for(var n=t;n<i;++n)r+=String.fromCharCode(e[n]);return r}function co(e,t,i){var r=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>r)&&(i=r);for(var n="",a=t;a<i;++a)n+=yo(e[a]);return n}function uo(e,t,i){for(var r=e.slice(t,i),n="",a=0;a<r.length;a+=2)n+=String.fromCharCode(r[a]+256*r[a+1]);return n}function lo(e,t,i){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}function ho(e,t,i,r,n,a){if(!Va(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<a)throw new RangeError('"value" argument is out of bounds');if(i+r>e.length)throw new RangeError("Index out of range")}function fo(e,t,i,r){t<0&&(t=65535+t+1);for(var n=0,a=Math.min(e.length-i,2);n<a;++n)e[i+n]=(t&255<<8*(r?n:1-n))>>>8*(r?n:1-n)}function po(e,t,i,r){t<0&&(t=4294967295+t+1);for(var n=0,a=Math.min(e.length-i,4);n<a;++n)e[i+n]=t>>>8*(r?n:3-n)&255}function go(e,t,i,r,n,a){if(i+r>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function mo(e,t,i,r,n){return n||go(e,0,i,4),za(e,t,i,r,23,4),i+4}function bo(e,t,i,r,n){return n||go(e,0,i,8),za(e,t,i,r,52,8),i+8}La.prototype.slice=function(e,t){var i,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),La.TYPED_ARRAY_SUPPORT)(i=this.subarray(e,t)).__proto__=La.prototype;else{var n=t-e;i=new La(n,void 0);for(var a=0;a<n;++a)i[a]=this[a+e]}return i},La.prototype.readUIntLE=function(e,t,i){e|=0,t|=0,i||lo(e,t,this.length);for(var r=this[e],n=1,a=0;++a<t&&(n*=256);)r+=this[e+a]*n;return r},La.prototype.readUIntBE=function(e,t,i){e|=0,t|=0,i||lo(e,t,this.length);for(var r=this[e+--t],n=1;t>0&&(n*=256);)r+=this[e+--t]*n;return r},La.prototype.readUInt8=function(e,t){return t||lo(e,1,this.length),this[e]},La.prototype.readUInt16LE=function(e,t){return t||lo(e,2,this.length),this[e]|this[e+1]<<8},La.prototype.readUInt16BE=function(e,t){return t||lo(e,2,this.length),this[e]<<8|this[e+1]},La.prototype.readUInt32LE=function(e,t){return t||lo(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},La.prototype.readUInt32BE=function(e,t){return t||lo(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},La.prototype.readIntLE=function(e,t,i){e|=0,t|=0,i||lo(e,t,this.length);for(var r=this[e],n=1,a=0;++a<t&&(n*=256);)r+=this[e+a]*n;return r>=(n*=128)&&(r-=Math.pow(2,8*t)),r},La.prototype.readIntBE=function(e,t,i){e|=0,t|=0,i||lo(e,t,this.length);for(var r=t,n=1,a=this[e+--r];r>0&&(n*=256);)a+=this[e+--r]*n;return a>=(n*=128)&&(a-=Math.pow(2,8*t)),a},La.prototype.readInt8=function(e,t){return t||lo(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},La.prototype.readInt16LE=function(e,t){t||lo(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},La.prototype.readInt16BE=function(e,t){t||lo(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},La.prototype.readInt32LE=function(e,t){return t||lo(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},La.prototype.readInt32BE=function(e,t){return t||lo(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},La.prototype.readFloatLE=function(e,t){return t||lo(e,4,this.length),Ra(this,e,!0,23,4)},La.prototype.readFloatBE=function(e,t){return t||lo(e,4,this.length),Ra(this,e,!1,23,4)},La.prototype.readDoubleLE=function(e,t){return t||lo(e,8,this.length),Ra(this,e,!0,52,8)},La.prototype.readDoubleBE=function(e,t){return t||lo(e,8,this.length),Ra(this,e,!1,52,8)},La.prototype.writeUIntLE=function(e,t,i,r){(e=+e,t|=0,i|=0,r)||ho(this,e,t,i,Math.pow(2,8*i)-1,0);var n=1,a=0;for(this[t]=255&e;++a<i&&(n*=256);)this[t+a]=e/n&255;return t+i},La.prototype.writeUIntBE=function(e,t,i,r){(e=+e,t|=0,i|=0,r)||ho(this,e,t,i,Math.pow(2,8*i)-1,0);var n=i-1,a=1;for(this[t+n]=255&e;--n>=0&&(a*=256);)this[t+n]=e/a&255;return t+i},La.prototype.writeUInt8=function(e,t,i){return e=+e,t|=0,i||ho(this,e,t,1,255,0),La.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},La.prototype.writeUInt16LE=function(e,t,i){return e=+e,t|=0,i||ho(this,e,t,2,65535,0),La.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):fo(this,e,t,!0),t+2},La.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||ho(this,e,t,2,65535,0),La.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):fo(this,e,t,!1),t+2},La.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||ho(this,e,t,4,4294967295,0),La.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):po(this,e,t,!0),t+4},La.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||ho(this,e,t,4,4294967295,0),La.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):po(this,e,t,!1),t+4},La.prototype.writeIntLE=function(e,t,i,r){if(e=+e,t|=0,!r){var n=Math.pow(2,8*i-1);ho(this,e,t,i,n-1,-n)}var a=0,o=1,s=0;for(this[t]=255&e;++a<i&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+i},La.prototype.writeIntBE=function(e,t,i,r){if(e=+e,t|=0,!r){var n=Math.pow(2,8*i-1);ho(this,e,t,i,n-1,-n)}var a=i-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+i},La.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||ho(this,e,t,1,127,-128),La.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},La.prototype.writeInt16LE=function(e,t,i){return e=+e,t|=0,i||ho(this,e,t,2,32767,-32768),La.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):fo(this,e,t,!0),t+2},La.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||ho(this,e,t,2,32767,-32768),La.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):fo(this,e,t,!1),t+2},La.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||ho(this,e,t,4,2147483647,-2147483648),La.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):po(this,e,t,!0),t+4},La.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||ho(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),La.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):po(this,e,t,!1),t+4},La.prototype.writeFloatLE=function(e,t,i){return mo(this,e,t,!0,i)},La.prototype.writeFloatBE=function(e,t,i){return mo(this,e,t,!1,i)},La.prototype.writeDoubleLE=function(e,t,i){return bo(this,e,t,!0,i)},La.prototype.writeDoubleBE=function(e,t,i){return bo(this,e,t,!1,i)},La.prototype.copy=function(e,t,i,r){if(i||(i=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<i&&(r=i),r===i)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-i&&(r=e.length-t+i);var n,a=r-i;if(this===e&&i<t&&t<r)for(n=a-1;n>=0;--n)e[n+t]=this[n+i];else if(a<1e3||!La.TYPED_ARRAY_SUPPORT)for(n=0;n<a;++n)e[n+t]=this[n+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+a),t);return a},La.prototype.fill=function(e,t,i,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,i=this.length):"string"==typeof i&&(r=i,i=this.length),1===e.length){var n=e.charCodeAt(0);n<256&&(e=n)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!La.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;var a;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(a=t;a<i;++a)this[a]=e;else{var o=Va(e)?e:_o(new La(e,r).toString()),s=o.length;for(a=0;a<i-t;++a)this[a+t]=o[a%s]}return this};var vo=/[^+\/0-9A-Za-z-_]/g;function yo(e){return e<16?"0"+e.toString(16):e.toString(16)}function _o(e,t){var i;t=t||1/0;for(var r=e.length,n=null,a=[],o=0;o<r;++o){if((i=e.charCodeAt(o))>55295&&i<57344){if(!n){if(i>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}n=i;continue}if(i<56320){(t-=3)>-1&&a.push(239,191,189),n=i;continue}i=65536+(n-55296<<10|i-56320)}else n&&(t-=3)>-1&&a.push(239,191,189);if(n=null,i<128){if((t-=1)<0)break;a.push(i)}else if(i<2048){if((t-=2)<0)break;a.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;a.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return a}function wo(e){return function(e){var t,i,r,n,a,o;Ca||Ia();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a="="===e[s-2]?2:"="===e[s-1]?1:0,o=new Ma(3*s/4-a),r=a>0?s-4:s;var c=0;for(t=0,i=0;t<r;t+=4,i+=3)n=ka[e.charCodeAt(t)]<<18|ka[e.charCodeAt(t+1)]<<12|ka[e.charCodeAt(t+2)]<<6|ka[e.charCodeAt(t+3)],o[c++]=n>>16&255,o[c++]=n>>8&255,o[c++]=255&n;return 2===a?(n=ka[e.charCodeAt(t)]<<2|ka[e.charCodeAt(t+1)]>>4,o[c++]=255&n):1===a&&(n=ka[e.charCodeAt(t)]<<10|ka[e.charCodeAt(t+1)]<<4|ka[e.charCodeAt(t+2)]>>2,o[c++]=n>>8&255,o[c++]=255&n),o}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(vo,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function xo(e,t,i,r){for(var n=0;n<r&&!(n+i>=t.length||n>=e.length);++n)t[n+i]=e[n];return n}function Ao(e){return null!=e&&(!!e._isBuffer||Eo(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&Eo(e.slice(0,0))}(e))}function Eo(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var So=Object.freeze({__proto__:null,Buffer:La,INSPECT_MAX_BYTES:50,SlowBuffer:function(e){return+e!=e&&(e=0),La.alloc(+e)},isBuffer:Ao,kMaxLength:Oa});const ko=e=>null!=e,Mo=e=>"string"==typeof e,Co=e=>Mo(e)&&""!==e,Io=e=>"object"==typeof e&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.arrayBuffer&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag]),Do=e=>e instanceof FormData,To=e=>{const t=[],i=(e,r)=>{ko(r)&&(Array.isArray(r)?r.forEach((t=>{i(e,t)})):"object"==typeof r?Object.entries(r).forEach((t=>{let[r,n]=t;i(`${e}[${r}]`,n)})):((e,i)=>{t.push(`${encodeURIComponent(e)}=${encodeURIComponent(String(i))}`)})(e,r))};return Object.entries(e).forEach((e=>{let[t,r]=e;i(t,r)})),t.length>0?`?${t.join("&")}`:""},Ro=async(e,t)=>"function"==typeof t?t(e):t,zo=async(e,t)=>{const r=await Ro(t,e.TOKEN),n=await Ro(t,e.USERNAME),a=await Ro(t,e.PASSWORD),o=await Ro(t,e.HEADERS),s=Object.entries(i(i({Accept:"application/json"},o),t.headers)).filter((e=>{let[t,i]=e;return ko(i)})).reduce(((e,t)=>{let[r,n]=t;return i(i({},e),{},{[r]:String(n)})}),{});if(Co(r)&&(s.Authorization=`Bearer ${r}`),Co(n)&&Co(a)){const e=(e=>{try{return btoa(e)}catch(t){return La.from(e).toString("base64")}})(`${n}:${a}`);s.Authorization=`Basic ${e}`}return t.body&&(t.mediaType?s["Content-Type"]=t.mediaType:Io(t.body)?s["Content-Type"]=t.body.type||"application/octet-stream":Mo(t.body)?s["Content-Type"]="text/plain":Do(t.body)||(s["Content-Type"]="application/json")),new Headers(s)},Bo=(e,t)=>new Promise((async(r,n)=>{try{const n=((e,t)=>{const i=e.ENCODE_PATH||encodeURI,r=null==t?void 0:t.url.replace("{api-version}",e.VERSION).replace(/{(.*?)}/g,((e,r)=>{var n;return(null===(n=null==t?void 0:t.path)||void 0===n?void 0:n.hasOwnProperty(r))?i(String(t.path[r])):e})),n=`${e.BASE}${r}`;return t.query?`${n}${To(t.query)}`:n})(e,t),a=(e=>{if(e.formData){const t=new FormData,i=(e,i)=>{Mo(i)||Io(i)?t.append(e,i):t.append(e,JSON.stringify(i))};return Object.entries(e.formData).filter((e=>{let[t,i]=e;return ko(i)})).forEach((e=>{let[t,r]=e;Array.isArray(r)?r.forEach((e=>i(t,e))):i(t,r)})),t}})(t),o=(e=>{var t;if(void 0!==e.body)return(null===(t=e.mediaType)||void 0===t?void 0:t.includes("/json"))?JSON.stringify(e.body):Mo(e.body)||Io(e.body)||Do(e.body)?e.body:JSON.stringify(e.body)})(t),s=await zo(e,t),c=await(async(e,t,i,r,n,a)=>{const o=new AbortController,s={headers:a,body:null!=r?r:n,method:t.method,signal:o.signal};return e.WITH_CREDENTIALS&&(s.credentials=e.CREDENTIALS),await fetch(i,s)})(e,t,n,o,a,s),d=await(async e=>{if(204!==e.status)try{const t=e.headers.get("Content-Type");if(t)return["application/json","application/problem+json"].some((e=>t.toLowerCase().startsWith(e)))?await e.json():await e.text()}catch(e){console.error(e)}})(c),u=((e,t)=>{if(t){const i=e.headers.get(t);if(Mo(i))return i}})(c,t.responseHeader),l={url:n,ok:c.ok,status:c.status,statusText:c.statusText,headers:c.headers,body:null!=u?u:d};((e,t)=>{var r,n;const a=i({400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"},e.errors)[t.status];if(a)throw new ha(e,t,a);if(!t.ok){const i=null!==(r=t.status)&&void 0!==r?r:"unknown",a=null!==(n=t.statusText)&&void 0!==n?n:"unknown",o=(()=>{try{return JSON.stringify(t.body,null,2)}catch(e){return}})();throw new ha(e,t,`Generic Error: status: ${i}; status text: ${a}; body: ${o}`)}})(t,l),r(l)}catch(e){n(e)}})),Po=new Z("idv"),Oo=Symbol(),Fo=Symbol(),No="verify-id-sdk";function Lo(e){return sessionStorage.getItem(e)}const jo=new Map;function Uo(e,t){const i=jo.get(e);Po.events.emit(i,t)}function qo(e){Uo(Oo,e)}function Ko(e,t,i,r,n){qo({type:"verification-result",status:t,step:e,state:r,callbackUrl:n,sessionId:i})}function Ho(e,t){qo({type:"capture-error",errorCode:t,step:e})}function Vo(e,t,i){qo({type:"api-request-error",errorCode:t,step:e,error:i})}function $o(e,t){return Bo(fa,e).catch((i=>(e.url.endsWith("/events")||Vo(t,"request-error",i.message),Promise.reject(i))))}async function Jo(e){var t;fa.HEADERS=Aa(e);const i=await function(e){return $o({keepalive:!0,method:"GET",url:`/verify/api/v1/sdk-settings?clientId=${e}`},"init")}(e);return{autocapture_settings:null!==(t=i.body.autocapture_settings)&&void 0!==t?t:void 0,autocapture_enabled:i.body.autocapture_enabled}}jo.set(Oo,Oo),jo.set(Fo,Fo);var Go={setStep(e,t){e.commit("setStep",t)},setSessionId(e,t){e.commit("setSessionId",t)},setIsCapturingProcessStarted(e,t){e.commit("setIsCapturingProcessStarted",t)},setServerPath(e,t){e.commit("setServerPath",t)},setStartToken(e,t){e.commit("setStartToken",t)},setRootElement(e,t){e.commit("setRootElement",t)},setLanguage(e,t){e.commit("setLanguage",t)},setCallback(e,t){e.commit("setCallback",t)},setUserToken(e,t){e.commit("setUserToken",t)},setConsentVersion(e,t){e.commit("setConsentVersion",t)},setMissingImages(e,t){e.commit("setMissingImages",t)},setClientId(e,t){e.commit("setClientId",t)},setStatus(e,t){e.commit("setStatus",t)},setMarkdownSupportText(e,t){e.commit("setMarkdownSupportText",t)},setVideoCaptureSettings(e,t){e.commit("setVideoCaptureSettings",t)},setCdnHost(e,t){e.commit("setCdnHost",t)},setIsImageSigningEnabled(e,t){e.commit("setIsImageSigningEnabled",t)},setAutoCaptureSettings(e,t){e.commit("setAutoCaptureSettings",t)}},Wo={setStep:(e,t)=>(e.step=t,e),setSessionId:(e,t)=>(e.sessionId=t,e),setIsCapturingProcessStarted:(e,t)=>(e.isCapturingProcessStarted=t,e),setServerPath:(e,t)=>(e.serverPath=t,e),setStartToken:(e,t)=>(e.startToken=t,e),setRootElement:(e,t)=>(e.rootElementId=t,e),setLanguage:(e,t)=>(e.language=t,e),setCallback:(e,t)=>(e.callback=t,e),setUserToken:(e,t)=>(e.userToken=t,e),setConsentVersion:(e,t)=>(e.consentVersion=t,e),setMissingImages:(e,t)=>(e.missingImages=t,e),setClientId:(e,t)=>(e.clientId=t,e),setStatus:(e,t)=>(e.verificationStatus=t,e),setMarkdownSupportText:(e,t)=>(e.markdownSupportText=t,e),setVideoCaptureSettings:(e,t)=>(e.videoCaptureSettings=t,e),setCdnHost:(e,t)=>(e.cdnHost=t,e),setIsImageSigningEnabled:(e,t)=>(e.isImageSigningEnabled=t,e),setAutoCaptureSettings:(e,t)=>(e.autoCaptureSettings=t,e)};const Zo=new class{constructor(e){this.actions={},this.mutations={},this.state={},this.status="resting",Object.prototype.hasOwnProperty.call(e,"actions")&&(this.actions=e.actions),Object.prototype.hasOwnProperty.call(e,"mutations")&&(this.mutations=e.mutations);const t=this;this.state=new Proxy(e.state||{},{get:function(e,t){return e[t]},set:function(e,i,r){return e[i]=r,Uo(Fo,{key:i,state:e}),"mutation"!==t.status&&console.warn(`You should use a mutation to set ${String(i)}`),t.status="resting",!0}})}dispatch(e,t){return"function"!=typeof this.actions[e]?(console.error(`Action "${e} doesn't exist.`),!1):(this.status="action",this.actions[e](this,t),!0)}commit(e,t){if("function"!=typeof this.mutations[e])return console.info(`Mutation "${e}" doesn't exist`),!1;this.status="mutation";const i=this.mutations[e](this.state,t);return this.state=i,!0}}({actions:Go,mutations:Wo,state:{step:"",sessionId:"",serverPath:"",startToken:"",rootElementId:"",language:"en",callback:()=>null,userToken:"",missingImages:[],consentVersion:"",clientId:"",verificationStatus:"pending",markdownSupportText:"",isImageSigningEnabled:!0,isCapturingProcessStarted:!1}});var Yo;function Qo(e){const t=[],i=function(e){var t,i,r,n;const a=e.stats.get(Yo.BLUR_DETECTION),o=e.stats.get(Yo.GLARE_DETECTION);if(!a&&!o||0===(null==a?void 0:a.durations.length)&&0===(null==o?void 0:o.durations.length))return;const s=ts(null!==(t=null==a?void 0:a.durations)&&void 0!==t?t:null==o?void 0:o.durations),c=a&&o?Math.min(a.countSuccess,o.countSuccess):null!==(i=null==a?void 0:a.countSuccess)&&void 0!==i?i:null==o?void 0:o.countSuccess;return{name:es(Yo.BLUR_DETECTION),count_success:c,count_failure_glare:null!==(r=null==o?void 0:o.countFailed)&&void 0!==r?r:0,count_failure_blur:null!==(n=null==a?void 0:a.countFailed)&&void 0!==n?n:0,avg_duration:s.duration_avg,std_duration:s.duration_std}}(e);i&&t.push(i);for(const[i,r]of e.stats.entries())i!==Yo.BLUR_DETECTION&&i!==Yo.GLARE_DETECTION&&r.durations.length>0&&t.push(Xo(r,i));return e.frameHandleDurations.length>0&&t.push(function(e){const t=ts(e.frameHandleDurations);return{name:"stability_manager",avg_stable_count:Math.round(e.stableCounts.reduce(((e,t)=>e+t),0)/e.stableCounts.length),avg_duration:t.duration_avg,std_duration:t.duration_std}}(e)),t}function Xo(e,t){const i=ts(e.durations);return{name:es(t),count_success:e.countSuccess,count_failure:e.countFailed,avg_duration:i.duration_avg,std_duration:i.duration_std}}function es(e){switch(e){case Yo.BLUR_DETECTION:case Yo.GLARE_DETECTION:return"blur_glare_detector";case Yo.DOCUMENT_DETECTION:return"doc_detector";case Yo.DOCUMENT_POSITION:return"doc_frame_detector";case Yo.BARCODE_DETECTION:return"barcode_detector";case Yo.FACE_DETECTION:return"face_detector";case Yo.FACE_POSITION:return"face_frame_detector";default:return e}}function ts(e){var t;if(e.length<2)return{duration_avg:null!==(t=e[0])&&void 0!==t?t:0,duration_std:0};const i=e.length,r=e.reduce(((e,t)=>e+t),0)/i;let n=0;for(let t=0;t<i;t++){const i=e[t];n+=Math.pow(i-r,2)}const a=Math.sqrt(n/(i-1));return{duration_avg:Math.round(r),duration_std:Math.round(a)}}!function(e){e.DOCUMENT_DETECTION="document_detection",e.DOCUMENT_POSITION="document_position",e.GLARE_DETECTION="glare_detection",e.BLUR_DETECTION="blur_detection",e.BARCODE_DETECTION="barcode_detection",e.FACE_DETECTION="face_detection",e.FACE_POSITION="face_position"}(Yo||(Yo={}));const is=new class{createUploadImageEvent(e,t,i,r){return{event_type:"upload_image",upload_image_req:{process_result:"success",image_type:e,request_total_time_ms:String(t),request_processing_time_ms:String(i),request_build_time_ms:String(r)}}}createPageViewEvent(e){return{event_type:"page_view",page_view_req:{page_name:e}}}createProcessingCompleteEvent(){return{event_type:"processing_complete",processing_complete_req:{status:"complete"}}}createSdkInitEvent(e,t){return{event_type:"sdk_init",sdk_init_req:{user_wait_time:Math.round(e),model_stats:this.convertModelStats(t)}}}convertModelStats(e){return e.map((e=>({model_name:e.modelName,init_duration:Math.round(e.initDuration),download_duration:Math.round(e.downloadDuration)})))}createUserActionEvent(e,t,i){var r,n,a;const o={user_action_type:e,page_name:t,autocapture:!!i,autocapture_enabled:null!==(a=null===(n=null===(r=Zo.state)||void 0===r?void 0:r.autoCaptureSettings)||void 0===n?void 0:n.enabled)&&void 0!==a&&a};if(i){const e=Qo(i);o.stats=e}return{event_type:"user_action",user_action_req:o}}createErrorEvent(e,t,i){return{event_type:"error",error_req:{error_name:t,error_description:e,step:i}}}createCameraNotAllowedEvent(e,t){return{event_type:"error",error_req:{error_name:"camera_not_allowed",error_description:e,step:t}}}createDrsInitFailureEvent(e,t){return{event_type:"error",error_req:{error_name:"missing_drs_action_token",error_description:e,step:t}}}};async function rs(e,t,i,r,n){i?(fa.HEADERS=Aa(r,t),await function(e,t,i){return $o({keepalive:!0,method:"POST",url:`/verify/api/v1/verification/${e}/events`,path:{sid:e},body:t},i)}(i,n,e)):console.error("cannot send event, sessionId or startToken is not set")}const ns=new class{handelEventData(e){if("session-id-acquired"===e.type)this.sendRiskSessionToken()}sendRiskSessionToken(){try{const e=`${fa.BASE}/verify/api/v1/verification/${Zo.state.sessionId}/risk-session-token`,t=Zo.state.clientId,i=Aa(t,Zo.state.userToken);da().then((t=>{Po.http.httpPost(e,{session_token:t},null,i).catch((t=>{throw console.log("unable to send session token to IDV",e),console.error(t),t}))})).catch((t=>{var i,r,n,a;console.log("unable to get session token from DRS",e),console.error(t);const o=(null==t?void 0:t.message)||"failed to initialize DRS",s=is.createDrsInitFailureEvent(o,"init");rs(null===(i=Zo.state)||void 0===i?void 0:i.step,null===(r=Zo.state)||void 0===r?void 0:r.userToken,null===(n=Zo.state)||void 0===n?void 0:n.sessionId,null===(a=Zo.state)||void 0===a?void 0:a.clientId,s).then((()=>{qo({type:"failed-to-init-drs",errorCode:"other",step:"init"})}))}))}catch(e){throw console.log("Error sending risk session token"),console.error(e),e}}};async function as(e,t,i){const r=is.createErrorEvent(e,t,i);await os(i,r)}async function os(e,t){var i,r,n,a,o;const s=null===(i=Zo.state)||void 0===i?void 0:i.userToken,c=(null===(r=Zo.state)||void 0===r?void 0:r.sessionId)||(null===(n=Zo.state)||void 0===n?void 0:n.startToken),d=null===(a=Zo.state)||void 0===a?void 0:a.clientId,u=(null===(o=Zo.state)||void 0===o?void 0:o.step)||e;await rs(u,s,c,d,t)}const ss=function(){var e,t;(null===(t=null===(e=Zo.state.autoCaptureSettings)||void 0===e?void 0:e.settings)||void 0===t?void 0:t.debug)&&console.log(...arguments)};var cs;!function(e){e.DOCUMENT_DETECTOR="document_detector",e.BLUR_GLARE_CLASSIFIER="blur_glare_classifier",e.FACE_LANDMARK="face_landmark"}(cs||(cs={}));const ds=["pdf417","qr_code"];class us{constructor(){this.model=new BarcodeDetector({formats:ds})}async detect(e){const t=await this.model.detect(e);return ss("detectedBarcodes:",t),t.map((e=>({class:e.format,score:1,x:e.boundingBox.x,y:e.boundingBox.y,width:e.boundingBox.width,height:e.boundingBox.height,extra:e.rawValue})))}}var ls;!function(e){e.NOT_AVAILABLE="notAvailable",e.LOADING="loading",e.LOADED="loaded"}(ls||(ls={}));const hs={[cs.DOCUMENT_DETECTOR]:{status:ls.LOADING},[cs.BLUR_GLARE_CLASSIFIER]:{status:ls.LOADING},[cs.FACE_LANDMARK]:{status:ls.LOADING}};const fs=[cs.DOCUMENT_DETECTOR,cs.BLUR_GLARE_CLASSIFIER],ps=async()=>{let e=!1;for(;!e;){const t=Object.values(hs).filter((e=>e.status===ls.NOT_AVAILABLE));if(t.length>0)throw new Error(`Model not available: ${t.join(", ")}`);if(e=fs.every((e=>hs[e].status===ls.LOADED)),e)return!0;await new Promise((e=>setTimeout(e,100)))}},gs=e=>"function"==typeof e,ms=function(e){};Po.events.on(Po.events.MODULE_INITIALIZED,(function(){const{clientId:e,IDV:t}=Po.moduleMetadata.getInitConfig();if(!e||!t)return!1;const r=(null==t?void 0:t.serverPath)&&(n=null==t?void 0:t.serverPath,a="/verify",(null==n?void 0:n.endsWith(a))?n.slice(0,n.length-a.length):n);var n,a;fa.BASE=r||window.location.origin,Zo.dispatch("setClientId",e),Zo.dispatch("setRootElement",(null==t?void 0:t.rootElement)||"root-element"),Zo.dispatch("setServerPath",null==t?void 0:t.serverPath),Zo.dispatch("setLanguage",null==t?void 0:t.language),Zo.dispatch("setCallback",null==t?void 0:t.callback),Zo.dispatch("setConsentVersion",null==t?void 0:t.consentVersion),Zo.dispatch("setMarkdownSupportText",null==t?void 0:t.markdownSupportText),Zo.dispatch("setVideoCaptureSettings",null==t?void 0:t.videoCaptureSettings),Zo.dispatch("setCdnHost",null==t?void 0:t.cdnHost),Zo.dispatch("setIsImageSigningEnabled",null==t?void 0:t.isImageSigningEnabled),(null==t?void 0:t.callbacks)&&(e=>{let{callbacks:t,callback:i}=e;gs(t.sessionGranted)&&(bs=t.sessionGranted);gs(t.sessionStarted)&&(vs=t.sessionStarted);gs(t.imageSubmitted)&&(ys=t.imageSubmitted);gs(t.processing)&&(_s=t.processing);gs(t.completed)&&(ws=t.completed);gs(t.recapture)&&(xs=t.recapture);gs(t.error)&&(As=t.error);gs(i)&&(Es=i)})(t);return Zo.dispatch("setStartToken",null==t?void 0:t.startToken),Jo(Zo.state.clientId).then((e=>{!async function(e){if(null==e?void 0:e.autocapture_enabled){if("serviceWorker"in navigator)return Zo.dispatch("setAutoCaptureSettings",{enabled:!0,settings:e.autocapture_settings}),ss("service worker available"),void navigator.serviceWorker.addEventListener("message",(e=>{if(e.data&&"MODEL_READY"===e.data.type){const t=e.data.modelName;hs[t]={status:ls.LOADED,imageDimensions:e.data.imageDimensions,loadingStats:i(i({},e.data.stats),{},{modelName:t})}}else if(e.data&&"MODEL_LOAD_ERROR"===e.data.type){const t=e.data.modelName;hs[t].status=ls.NOT_AVAILABLE,as(`${e.data.modelName} error: ${e.data.error}`,"model_load_error","init")}}));as("service worker not available","service_worker_not_available","init")}Zo.dispatch("setAutoCaptureSettings",{enabled:!1,autocapture_settings:e.autocapture_settings})}(e)})),function(e){qo({type:"init",step:e})}("init"),!0})),Po.events.on(Oo,(function(e){switch(ns.handelEventData(e),Es(e),e.type){case"session-granted":bs({session:Zo.state.sessionId});break;case"session-id-acquired":vs({session:Zo.state.sessionId});break;case"capture-image-result":ys({session:Zo.state.sessionId},e.imageType);break;case"start-verification-processing":_s({session:Zo.state.sessionId});break;case"verification-complete":ws({session:Zo.state.sessionId});break;case"capture-error":case"failed-to-init-drs":case"api-request-error":As({session:Zo.state.sessionId},e.errorCode,e.error);break;case"verification-recapture":xs({session:Zo.state.sessionId},e.reason)}}));let bs=ms,vs=ms,ys=ms,_s=ms,ws=ms,xs=ms,As=ms,Es=e=>{};async function Ss(e,t,i){fa.HEADERS=Aa(i,t);var r;return(await(r=e,$o({method:"GET",url:`/verify/api/v1/verification/${r}/status`,path:{sid:r},errors:{404:"Session not found"}},"processing"))).body}function ks(e){try{return JSON.parse(e)}catch(e){return console.error(e),null}}async function Ms(e,t,i,r){fa.HEADERS=Aa(t);const n=await(a={start_token:e,accessed_from_desktop:!1,client_type:ba.client_type.MOBILE_SDK,consent:{granted:!0,document_id:i},image_signing_public_key:r},$o({method:"POST",url:"/verify/api/v1/verification/start",headers:{},body:a,mediaType:"application/json"},"init"));var a;return{sessionId:n.body.session_id,userToken:n.body.user_token,requiredImages:n.body.required_images}}async function Cs(e,t,i){let r,n,a;if(r)try{r=Lo(No);const e=JSON.parse(r);n=e.sessionId,a=e.userToken}catch(e){}try{let o;if(a){o=(await Ss(n,a,i)).missing_images}else{const s=Po.crypto.createCryptoBinding("sign"),c=await s.getPublicData(),d=await Ms(e,i,t,c.publicKey);n=d.sessionId,a=d.userToken,o=d.requiredImages,r=JSON.stringify({sessionId:n,userToken:a}),function(e,t){sessionStorage.setItem(e,t)}(No,r)}return{requiredImages:o,sessionId:n.toString(),userToken:a.toString()}}catch(e){throw console.log("Error starting session"),console.error(e),e}}function Is(e){let{tagName:t,style:i,id:r="",className:n="",testid:a,options:o}=e;const s=document.createElement(t,o);return s.id=r,s.className=n,s.setAttribute("data-auto",a+"-auto"),Object.keys(i).forEach((e=>{s.style[e]=i[e]})),s}function Ds(e,t){Array.isArray(t)?t.forEach((t=>{e.appendChild(t)})):e.appendChild(t)}const Ts={blur_message:"Please focus camera on the document before capturing",blur_title:"Blurred image",document_incorrect_position_message:"Please make sure the document is fully within the frame, and nothing covers it",document_incorrect_position_title:"Incorrect document position",document_not_found_message:"Make sure you capture a valid government issued ID",document_not_found_title:"Document not detected",document_not_matching_message:"Please make sure to capture the back side of the document",document_not_matching_title:"Back image mismatch",document_not_supported_message:"Please use a different government issued ID instead",document_not_supported_title:"Document not supported",capturing_in_progress_message:"Capturing, stay steady",capturing_in_progress_title:"Capturing in progress",face_not_found_message:"Ensure your face is not covered and fully visible",face_not_found_title:"Face not detected",glare_message:"Avoid any direct light reflecting with glare",glare_title:"Glare detected",main_title_document_back:"Back side",main_title_document_face:"Selfie",main_title_document_front:"Front side",obstructed_message:"Some of the document parts are covered or missing",obstructed_title:"Missing information",other_error_code_message:"Please try again",other_error_code_title:"An error occurred",page_header_document:"Scan document",loading_screen_small_title:"Preparing...",page_header_face:"Face Recognition",second_title_document_back:"Please place your document on a solid surface, back side up.",second_title_document_face:"Please position your face in the center of the oval below.",second_title_document_front:"Please place your document on a solid surface, photo side up.",wrong_document_side_message:"The wrong document side has been detected",wrong_document_side_title:"Wrong document side detected",face_angle_too_large_title:"your face is not directly aligned with the camera",face_angle_too_large_message:"Please take another photo with your face fully visible for accurate detection",face_close_to_border_title:"Your face is too close to the edge",face_close_to_border_message:"Please adjust your position and make sure your entire face is within the frame",face_too_small_title:"Your face is too distant from the edge",face_too_small_message:"Please move closer to the camera so your face is clearer and easier to detect",face_too_close_title:"Your face is too close ",face_too_close_message:"Please adjust your position and make sure your entire face is within the frame",face_cropped_title:"Your face is partially cropped",face_cropped_message:"Please adjust your position and make sure your entire face is within the frame for optimal",no_face_title:"Face not found",no_face_message:"Please move closer to the camera or adjust your position so your face is clearer and easier to detect",multi_face_title:"Multiple faces detected",multi_face_message:"Please make sure only one face is visible in the frame to proceed",blur_selfie_title:"The selfie is out of focus",blur_selfie_message:"Please try taking another one with clearer focus for better detection",glare_selfie_title:"Too much reflection in your selfie",glare_selfie_message:"Please try taking another photo with better lighting and without glare for accurate detection",closed_eyes_title:"It looks like your eyes are closed",closed_eyes_message:"Please retake the photo with your eyes open",face_occluded_title:"Your face is partially hidden",face_occluded_message:"Please take another photo with your face fully visible for accurate detection",face_rotated_title:"Your face is not directly aligned with the camera",face_rotated_message:"Please take another photo with your face fully visible for accurate detection",barcode_not_found_title:"We are having trouble capturing some important elements of your document, Please try placing it in a clearer spot",barcode_not_found_message:"We are having trouble capturing some important elements of your document, Please try placing it in a clearer spot",searching_document_autocapture:"Searching for document",capturing_document_autocapture:"Capturing, please hold steady",click_manual_autocapture:"Click to capture manually",glare_blur_issues_autocapture:"Please make sure there are no light reflections, and try again",doc_not_in_frame_issues_autocapture:"Please bring the document closer and ensure it is fully within the capture frame for a clear image.",doc_not_found_autocapture:"Looking for document",capturing_face_issue_closer:"Please move closer to the frame",second_title_face_autocapture:"Get ready! Your selfie will be auto-captured, or tap to capture it manually",capturing_face_autocapture3:"Capturing... please, hold steady for 3",capturing_face_autocapture2:"Capturing... please, hold steady for 2",capturing_face_autocapture1:"Capturing... please, hold steady for 1",selfie_approval_autocapture:"Great job! Approve your selfie to continue"};const Rs=new class{constructor(e){this.translations=e,this.translations=new Proxy(this.translations,{get:function(e,t){return e[t]},set:function(e,t,i){return e[t]=i,!0}})}overrideLanguage(e){Object.assign(this.translations,e)}translate(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];let n=this.translations[e];return n||(n=e),n.replace(/{(\d+)}/g,(function(e,t){return void 0!==i[t]?i[t]:e}))}}(Ts),zs={en:Ts,es:{blur_message:"Favor enfoca la cámara en tú cédula antes de la captura",blur_title:"Imagen borrosa",document_incorrect_position_message:"Asegúrate de que la cédula esté completamente dentro del marco y nada la cubra",document_incorrect_position_title:"Posición incorrecta del documento",capturing_in_progress_title:"Capturando en progreso",capturing_in_progress_message:"Capturando, mantente estable",document_not_found_message:"Asegúrate de utilizar una cédula valida",document_not_found_title:"Cédula no detectada",document_not_matching_message:"Favor Asegúrate de capturar la parte trasera de tu cédula",document_not_matching_title:"Parte trasera no corresponde",document_not_supported_message:"Favor utliza tu cédula",document_not_supported_title:"Cédula no compatible",face_not_found_message:"Asegurase de no tapar su rostro",face_not_found_title:"Selfie no detectada",glare_message:"Evite luz directa que pueda generar brillo",glare_title:"Demasiado brillo",main_title_document_back:"Parte trasera de tu cédula",main_title_document_face:"Tómate un Selfie",main_title_document_front:"Parte frontal de tu cédula",obstructed_message:"Parte de la cédula documento no está visible o falta información",obstructed_title:"Falta información",other_error_code_message:"Intenta nuevamente",other_error_code_title:"Ha ocurrido un error",page_header_document:"Escanéa tu cédula",page_header_face:"Reconocimiento Facial",second_title_document_back:"Asegúrate de poner su cédula en una superfice plana con la parte trasera visible.",second_title_document_face:"Asegúrate de posicionar tu rostro en el centro del circulo.",second_title_document_front:"Asegúrate de poner su cédula en una superfice plana con la parte frontal visible.",wrong_document_side_message:"Lado incorrecto de tu cédula ha sido detectado",wrong_document_side_title:"Lado de tu cédula incorrecto",face_angle_too_large_title:"Tu rostro no está directamente alineado con la cámara.",face_angle_too_large_message:"Por favor, toma otra foto con tu rostro completamente visible para una detección precisa.",face_close_to_border_title:"Tu rostro está demasiado cerca del borde.",face_close_to_border_message:"Por favor, cambia la posicion de tu rostro y asegúrate de que todo tu rostro esté dentro del marco.",face_too_small_title:"Tu rostro está demasiado lejos del borde.",face_too_small_message:"Por favor, acércate más a la cámara para que tu rostro esté más claro y sea más fácil de detectar.",face_too_close_title:"Tu rostro está demasiado cerca",face_too_close_message:"Acomode la posición y asegúrese de que toda su rostro esté dentro del marco.",face_cropped_title:"Tu rostro está parcialmente recortado.",face_cropped_message:"Por favor, cambia tu posición y asegúrate de que todo tu rostro esté dentro del marco para una detección óptima.",no_face_title:"Rostro no encontrado.",no_face_message:"Por favor, acércate más a la cámara o ajusta tu posición para que tu rostro esté más claro y sea más fácil de detectar.",multi_face_title:"Se detectaron múltiples rostros.",multi_face_message:"Por favor, asegúrate de que solo haya un rostro visible en el marco para continuar.",blur_selfie_title:"El autorretrato está fuera de foco.",blur_selfie_message:"Por favor, intenta tomar una nueva imagen con un enfoque más claro para una mejor detección.",glare_selfie_title:"Demasiado reflejo en tu autorretrato.",glare_selfie_message:"Por favor, intenta tomar otra foto con una mejor iluminación y sin brillos para una detección precisa.",closed_eyes_title:"Parece que tienes los ojos cerrados.",closed_eyes_message:"Por favor, vuelve a tomar la foto con los ojos abiertos.",face_occluded_title:"Tu rostro está parcialmente oculto.",face_occluded_message:"Por favor, toma otra foto con tu rostro completamente visible para una detección precisa.",face_rotated_title:"Tu rostro está fuera de foco.",face_rotated_message:"Por favor, intenta tomar otro con un enfoque más claro para una mejor detección.",barcode_not_found_title:"Estamos teniendo problemas para capturar algunos elementos importantes de su documento, Intente colocarlo en un lugar más despejado.",barcode_not_found_message:"Estamos teniendo problemas para capturar algunos elementos importantes de su documento, Intente colocarlo en un lugar más despejado.",searching_document_autocapture:"Buscando la cedula",capturing_document_autocapture:"Capturando, por favor mantente quieto",click_manual_autocapture:"Haz clic para capturar manualmente",glare_blur_issues_autocapture:"Por favor, asegúrate de que no haya reflejos de luz antes de intentarlo de nuevo",doc_not_in_frame_issues_autocapture:"Por favor, acerque la cedula y asegúrese de que esté completamente dentro del marco de captura para obtener una imagen clara",second_title_face_autocapture:"¡Prepárate! Tu selfie se capturará automáticamente, o toca para capturarla manualmente",capturing_face_autocapture3:"Capturando... por favor, mantente quieto durante 3",capturing_face_autocapture2:"Capturando... por favor, mantente quieto durante 2",capturing_face_autocapture1:"Capturando... por favor, mantente quieto durante 1",selfie_approval_autocapture:"¡Buen trabajo! Aprueba tu selfie para continuar"},pt:{blur_message:"Por favor, foque a câmera no documento antes de capturar",blur_title:"Imagem borrada",document_incorrect_position_message:"Certifique-se de que o documento esteja totalmente dentro do quadro e nada o cubra",document_incorrect_position_title:"Posição incorreta do documento",document_not_found_message:"Certifique-se de capturar um documento válido emitido pelo governo",document_not_found_title:"Documento não detectado",document_not_matching_message:"Por favor, certifique-se de capturar o verso do documento",document_not_matching_title:"Imagem do verso incorreta",document_not_supported_message:"Por favor, utilize um documento diferente emitido pelo governo",document_not_supported_title:"Documento não suportado",capturing_in_progress_message:"Capturando, mantenha-se firme",capturing_in_progress_title:"Captura em andamento",face_not_found_message:"Certifique-se de que seu rosto não esteja coberto e esteja totalmente visível",face_not_found_title:"Rosto não detectado",glare_message:"Evite qualquer luz direta refletindo com brilho",glare_title:"Brilho detectado",main_title_document_back:"Verso",main_title_document_face:"Selfie",main_title_document_front:"Frente",obstructed_message:"Algumas partes do documento estão encobertas ou ausentes",obstructed_title:"Informações incompletas",other_error_code_message:"Por favor, tente novamente",other_error_code_title:"Ocorreu um eprro",page_header_document:"Digitalizar o documento",page_header_face:"Reconhecimento facial",second_title_document_back:"Coloque o documento em uma superfície sólida, com o verso voltado para cima.",second_title_document_face:"Por favor, posicione seu rosto no centro do oval abaixo.",second_title_document_front:"Coloque o documento em uma superfície sólida, com a foto voltada para cima.",wrong_document_side_message:"O lado errado do documento foi detectado",wrong_document_side_title:"Lado incorreto do documento identificado",face_angle_too_large_title:"Seu rosto não está diretamente alinhado com a câmera.",face_angle_too_large_message:"Tire outra foto com seu rosto totalmente visível para uma detecção precisa.",face_close_to_border_title:"Seu rosto está muito próximo da borda.",face_close_to_border_message:"Por favor, reposicione seu rosto e certifique-se de que todo o seu rosto esteja dentro da moldura.",face_too_small_title:"Seu rosto está muito longe da borda.",face_too_small_message:"Aproxime-se da câmera para que seu rosto fique mais claro e fácil de detectar.",face_too_close_title:"Seu rosto está muito perto",face_too_close_message:"Ajuste a posição e certifique-se de que todo o seu rosto esteja dentro da moldura.",face_cropped_title:"Seu rosto está parcialmente cortado.",face_cropped_message:"Mude sua posição e certifique-se de que todo o seu rosto esteja dentro do enquadramento para uma detecção ideal.",no_face_title:"Rosto não encontrado..",no_face_message:"Aproxime-se da câmera ou ajuste sua posição para que seu rosto fique mais claro e fácil de detectar.",multi_face_title:"Vários rostos foram detectados.",multi_face_message:"Certifique-se de que haja apenas um rosto visível no quadro para continuar.",blur_selfie_title:"O autorretrato está fora de foco.",blur_selfie_message:"Tente tirar uma nova imagem com foco mais claro para melhor detecção.",glare_selfie_title:"Muita reflexão em seu autorretrato.",glare_selfie_message:"Tente tirar outra foto com melhor iluminação e sem brilho para uma detecção precisa.",closed_eyes_title:"Parece que seus olhos estão fechados.",closed_eyes_message:"Por favor, tire a foto novamente com os olhos abertos.",face_occluded_title:"Seu rosto está parcialmente oculto.",face_occluded_message:"Tire outra foto com seu rosto totalmente visível para uma detecção precisa.",face_rotated_title:"Seu rosto está fora de foco.",face_rotated_message:"Por favor, tente pegar outro com foco mais claro para melhor detecção.",barcode_not_found_title:"Estamos tendo problemas para capturar alguns elementos importantes do seu documento, Experimente colocá-lo em um local mais claro.",barcode_not_found_message:"Estamos tendo problemas para capturar alguns elementos importantes do seu documento, Experimente colocá-lo em um local mais claro.",searching_document_autocapture:"Buscando o documento",capturing_document_autocapture:"Capturando, por favor mantenha-se imóvel",click_manual_autocapture:"Clique para capturar manualmente.",glare_blur_issues_autocapture:"Por favor, certifique-se de que não há reflexos de luz antes de tentar novamente",doc_not_in_frame_issues_autocapture:"Por favor, aproxime o documento e certifique-se de que está totalmente dentro da moldura de captura para uma imagem nítida",second_title_face_autocapture:"Prepare-se! Sua selfie será capturada automaticamente, ou toque para capturá-la manualmente",capturing_face_autocapture3:"Capturando... por favor, fique parado por 3",capturing_face_autocapture2:"Capturando... por favor, fique parado por 2",capturing_face_autocapture1:"Capturando... por favor, fique parado por 1",selfie_approval_autocapture:"Ótimo trabalho! Aprove sua selfie para continuar"},frCa:{blur_message:"Veuillez faire la mise au point de l’appareil photo sur le document avant de le capturer",blur_title:"Image floue",document_not_found_message:"Munissez-vous d’une pièce d’identité valide délivrée par le gouvernement",document_not_found_title:"Document non détecté",document_not_matching_message:"Veillez à capturer le verso du document",document_not_matching_title:"Non-concordance entre les images du recto et du verso",document_not_supported_message:"Veuillez utiliser une autre pièce d’identité délivrée par le gouvernement",document_not_supported_title:"Document non pris en charge",face_not_found_message:"Assurez-vous que votre visage n’est pas couvert et qu’il est entièrement visible",face_not_found_title:"Visage non détecté",glare_message:"Évitez la lumière directe qui pourrait se refléter sur le document",glare_title:"Reflet détecté",main_title_document_back:"Verso",main_title_document_face:"Égoportrait",main_title_document_front:"Face avant",obstructed_message:"Le document comporte des parties manquantes ou couvertes",obstructed_title:"Informations manquantes",other_error_code_message:"Veuillez réessayer",other_error_code_title:"Une erreur s’est produite",page_header_document:"Numériser le document",page_header_face:"Reconnaissance faciale",second_title_document_back:"Veuillez placer votre document sur une surface solide, le verso vers le haut.",second_title_document_face:"Veuillez positionner votre visage au centre de l’ovale ci-dessous.",second_title_document_front:"Veuillez placer votre document sur une surface solide, photo vers le haut.",wrong_document_side_message:"Le mauvais côté du document a été détecté",wrong_document_side_title:"Mauvais côté du document détecté",face_angle_too_large_title:"votre visage n’est pas directement aligné avec l’appareil photo",face_angle_too_large_message:"Veuillez prendre une autre photo avec votre visage entièrement visible pour une détection précise",face_close_to_border_title:"Votre visage est trop près du bord",face_close_to_border_message:"Veuillez ajuster votre position et vous assurer que l’ensemble de votre visage se trouve dans le cadre",face_too_small_title:"Votre visage est trop éloigné du bord",face_too_small_message:"Veuillez vous rapprocher de la caméra pour que votre visage soit plus clair et plus facile à détecter",face_too_close_title:"Votre visage est trop proche",face_too_close_message:"Veuillez ajuster votre position et vous assurer que l’ensemble de votre visage se trouve dans le cadre",face_cropped_title:"Votre visage est partiellement rogné",face_cropped_message:"Veuillez ajuster votre position et vous assurer que l’ensemble de votre visage se trouve dans le cadre pour optimiser",no_face_title:"Visage introuvable",no_face_message:"Veuillez vous rapprocher de la caméra ou ajuster votre position pour que votre visage soit plus clair et plus facile à détecter",multi_face_title:"Plusieurs visages détectés",multi_face_message:"Veuillez vous assurer qu’un seul visage est visible dans le cadre pour continuer",blur_selfie_title:"L’égoportrait n’est pas net",blur_selfie_message:"Essayez d’en prendre un autre avec une mise au point plus claire pour une meilleure détection",glare_selfie_title:"Trop de reflets sur votre égoportrait",glare_selfie_message:"Veuillez essayer de prendre une autre photo avec un meilleur éclairage et sans reflet pour une détection précise",closed_eyes_title:"Il semble que vos yeux soient fermés.",closed_eyes_message:"Veuillez reprendre la photo avec les yeux ouverts",face_occluded_title:"Votre visage est partiellement caché.",face_occluded_message:"Veuillez prendre une autre photo avec votre visage entièrement visible pour une détection précise",face_rotated_title:"votre visage n’est pas directement aligné avec l’appareil photo",face_rotated_message:"Veuillez prendre une autre photo avec votre visage entièrement visible pour une détection précise",barcode_not_found_title:"Nous avons des difficultés à capturer certains éléments importants de votre document. Veuillez essayer de le placer à un endroit plus clair",barcode_not_found_message:"Nous avons des difficultés à capturer certains éléments importants de votre document. Veuillez essayer de le placer à un endroit plus clair",searching_document_autocapture:"Recherche du document",capturing_document_autocapture:"Capture en cours, veuillez rester immobile",click_manual_autocapture:"Cliquez pour capturer manuellement",glare_blur_issues_autocapture:"Veuillez vous assurer qu’il n’y a pas de reflets de lumière avant de réessayer",doc_not_in_frame_issues_autocapture:"Veuillez rapprocher le document et assurez-vous qu’il soit entièrement dans le cadre de capture pour une image claire",second_title_face_autocapture:"Préparez-vous! Votre selfie sera capturé automatiquement, ou appuyez pour le capturer manuellement",capturing_face_autocapture3:"Capture... en cours, veuillez rester immobile pendant 3",capturing_face_autocapture2:"Capture... en cours, veuillez rester immobile pendant 2",capturing_face_autocapture1:"Capture... en cours, veuillez rester immobile pendant 1",selfie_approval_autocapture:"Bon travail! Approuvez votre selfie pour continuer"}};const Bs=async(e,t,i,r,n,a)=>{var o,s,c,d,u,l,h;fa.HEADERS=Aa(i,t);const f=va.UAParser();let p;if(Zo.state.isImageSigningEnabled){const e=Po.crypto.createCryptoBinding("sign");p=await e.sign(r.data)}const g=await(m=e,b={image:{format:r.format,image_type:a,content:r.data,capture_margins:r.captureMargins,signature:p},device_info:{model:null===(o=null==f?void 0:f.device)||void 0===o?void 0:o.model,type:null===(s=null==f?void 0:f.device)||void 0===s?void 0:s.type,manufacturer:null===(c=null==f?void 0:f.device)||void 0===c?void 0:c.vendor,os:null===(d=null==f?void 0:f.os)||void 0===d?void 0:d.name,os_version:null===(u=null==f?void 0:f.os)||void 0===u?void 0:u.version,browser:null===(l=null==f?void 0:f.browser)||void 0===l?void 0:l.name,browser_version:null===(h=null==f?void 0:f.browser)||void 0===h?void 0:h.version,used_camera:null==n?void 0:n.selectedCamera,cameras:null==n?void 0:n.camerasInfo}},$o({method:"POST",url:"/verify/api/v1/verification/{sid}/images",path:{sid:m},body:b,mediaType:"application/json",errors:{400:"Request is malformed or missing required fields",401:"Access token is malformed, missing data, or expired",404:"Session not found",409:"All required images were successfully submitted"}},b.image.image_type));var m,b;const v=function(e,t){const i=[...e].find((e=>e.includes(t)));return void 0!==i?i[1]:void 0}(g.headers,"x-ts-processing-time-ms");return"ok"!==g.body.feedback&&console.error("Error",g),{missing_images:g.body.missing_images,feedback:g.body.feedback,custom_feedback:g.body.custom_feedback,has_barcode:g.body.has_barcode,serverProcessingTime:v}},Ps=()=>{const e=document.getElementById("overlay-frame");if(e){const t=e.getBoundingClientRect(),i=(3840-screen.width)/2,r=(2160-screen.height)/2;return{top:r+t.top,bottom:r+t.bottom,right:i+t.right,left:i+t.left}}},Os=e=>["document_front","document_back"].includes(e)?"environment":"user";function Fs(e){switch(e){case"document_front":return ga.image_type.DOCUMENT_FRONT;case"document_back":return ga.image_type.DOCUMENT_BACK;case"selfie":return ga.image_type.SELFIE}}var Ns={},Ls={get exports(){return Ns},set exports(e){Ns=e}};Ls.exports=function(e){function t(r){if(i[r])return i[r].exports;var n=i[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var i={};return t.m=e,t.c=i,t.d=function(e,i,r){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t,i){i.d(t,"b",(function(){return a})),i.d(t,"c",(function(){return o}));var r=i(1),n=i(7);i.d(t,"a",(function(){return n.a})),i.d(t,"d",(function(){return r.b}));var a=r.a.FACING_MODES,o=r.a.IMAGE_TYPES},function(e,t,i){var r=i(6);i.d(t,"a",(function(){return r.a}));var n=i(2);i.d(t,"b",(function(){return n.a}))},function(e,t,i){function r(e,t){if(!(t>=0&&t<=1))throw new Error(t+" is invalid imageCompression, choose between: [0, 1]");if(!h.f.includes(e))throw new Error(e+" is invalid imageType, choose between: "+h.f.join(", "));return!0}function n(e,t){var i={};try{r(e,t),i.imageType=e,i.imageCompression=t}catch(e){console.error(e),console.error("default value of "+h.c.PNG+" is used"),i.imageType=h.c.PNG,i.imageCompression=null}return i}function a(){var e=window.navigator.platform,t=window.navigator.userAgent;return e||t}function o(){return"ontouchend"in document}function s(e,t,i){var r=e*parseFloat(i);return{imageWidth:r,imageHeight:t/(e/r)}}function c(e,t,i){return n(t,i).imageType===h.c.JPG?i?e.toDataURL(h.b[h.c.JPG],i):e.toDataURL(h.b[h.c.JPG]):e.toDataURL(h.b[t])}function d(e,t){return e||t}function u(){var e=a();if(/iPad|iPhone|iPod/.test(e))return!0;var t=o();return!(!/Mac/.test(e)||!t)}function l(){return{userAgent:window.navigator.userAgent,platform:window.navigator.platform,_getStringWithPlatform:a(),_getHasTouchEvents:o(),getIsIOS:u()}}t.c=s,t.b=c,t.e=d,t.d=u,t.a=l;var h=i(3)},function(e,t,i){function r(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}i.d(t,"e",(function(){return a})),i.d(t,"a",(function(){return o})),i.d(t,"f",(function(){return s})),i.d(t,"c",(function(){return c})),i.d(t,"b",(function(){return d})),i.d(t,"d",(function(){return u}));var n,a=["user","environment"],o={USER:"user",ENVIRONMENT:"environment"},s=["jpg","png"],c={PNG:"png",JPG:"jpg"},d=(r(n={},"jpg","image/jpeg"),r(n,"png","image/png"),n),u={audio:!1,video:!0}},function(e,t,i){e.exports=i(5)},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});var r=i(0);i.d(t,"FACING_MODES",(function(){return r.b})),i.d(t,"IMAGE_TYPES",(function(){return r.c})),i.d(t,"_getDebugPlatformInfo",(function(){return r.d}));var n=i(9);i.d(t,"downloadPhoto",(function(){return n.a})),t.default=r.a},function(e,t,i){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}i.d(t,"a",(function(){return s}));var n=i(2),a=i(3),o=function(){function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),s=function(){function e(){r(this,e)}return o(e,null,[{key:"getDataUri",value:function(e,t){var i=t.sizeFactor,r=t.imageType,a=t.imageCompression,o=t.isImageMirror,s=e.videoWidth,c=e.videoHeight,d=Object(n.c)(s,c,i),u=d.imageWidth,l=d.imageHeight,h=document.createElement("canvas");h.width=u,h.height=l;var f=h.getContext("2d");return o&&f.setTransform(-1,0,0,1,h.width,0),f.drawImage(e,0,0,u,l),Object(n.b)(h,r,a)}},{key:"getWindowURL",value:function(){return window.URL||window.webkitURL||window.mozURL||window.msURL}},{key:"getNavigatorMediaDevices",value:function(){var e=null,t=!(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia),i=!(!navigator.mozGetUserMedia&&!navigator.webkitGetUserMedia);if(t)e=navigator.mediaDevices;else if(i){var r=navigator.mozGetUserMedia||navigator.webkitGetUserMedia,n={getUserMedia:function(e){return new Promise((function(t,i){r.call(navigator,e,t,i)}))}};e=Object.assign(r,n)}return e}},{key:"isSupportedFacingMode",value:function(){return e.getNavigatorMediaDevices().getSupportedConstraints().facingMode}},{key:"getIdealConstraints",value:function(t,i){if(!Object(n.e)(t,i))return a.d;var r=e.getNavigatorMediaDevices().getSupportedConstraints();if(!r.width||!r.height)return console.error("Constraint width or height not supported! fallback to default resolution"),a.d;var o=void 0,s=void 0;return t&&(a.e.includes(t)?o=t:s={exact:t}),{audio:!1,video:{facingMode:o,deviceId:s,width:i&&i.width,height:i&&i.height}}}},{key:"getMaxResolutionConstraints",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments[1];console.warn("getMaxResolutionConstraints() numberOfMaxResolutionTry:",i);var r=[{width:{min:640}},{width:{min:800}},{width:{min:900}},{width:{min:1024}},{width:{min:1080}},{width:{min:1280}},{width:{min:1920}},{width:{min:2560}},{width:{min:3840}}],a=e.getIdealConstraints(t,{});if(0===i)return Object(n.d)()?(console.warn("fallback to iOS constraints"),e.getIdealConstraints(t,{width:{min:640,ideal:3840},height:{min:480,ideal:2160}})):(a.video.advanced=r,a);if(i<r.length){var o=r.slice(0,-i);return a.video.advanced=o,a}return null}},{key:"FACING_MODES",get:function(){return a.a}},{key:"IMAGE_TYPES",get:function(){return a.c}}]),e}()},function(e,t,i){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}i.d(t,"a",(function(){return c}));var n=i(1),a=i(8),o=function(){function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),s=n.a.IMAGE_TYPES.PNG,c=function(){function e(t){r(this,e),this.videoElement=t,this.stream=null,this.numberOfMaxResolutionTry=0,this.settings=null,this.cameras=[],this.windowURL=n.a.getWindowURL(),this.mediaDevices=n.a.getNavigatorMediaDevices()}return o(e,[{key:"_getStreamDevice",value:function(e,t){var i=this;return new Promise((function(r,a){var o=n.a.getIdealConstraints(e,t);i.mediaDevices.getUserMedia(o).then((function(e){i._gotStream(e),r(e)})).catch((function(e){a(e)}))}))}},{key:"_getStreamDeviceMaxResolution",value:function(e){var t=this,i=n.a.getMaxResolutionConstraints(e,this.numberOfMaxResolutionTry);if(null==i){var r={};return this._getStreamDevice(e,r)}return new Promise((function(r,n){t.mediaDevices.getUserMedia(i).then((function(e){t._gotStream(e),r(e)})).catch((function(i){setTimeout((function(){t.numberOfMaxResolutionTry+=1,t._getStreamDeviceMaxResolution(e).catch((function(){n(i)}))}),20)}))}))}},{key:"_setVideoSrc",value:function(e){if("srcObject"in this.videoElement)this.videoElement.srcObject=e;else{var t=this.windowURL.createObjectURL(e);this.videoElement.src=t}}},{key:"_setSettings",value:function(e){this.settings=null;var t=e&&e.getTracks?e.getTracks():[];t.length>0&&t[0].getSettings&&(this.settings=t[0].getSettings())}},{key:"_enumerateCamerasPromise",value:function(){var e=this;return new Promise((function(t,i){var r=[];e.mediaDevices.enumerateDevices().then((function(e){e.forEach((function(e){"videoinput"===e.kind&&e.deviceId&&r.push(e)})),t(r)})).catch((function(e){i(e)}))}))}},{key:"_gotStream",value:function(e){this.stream=e,this._setSettings(e),this._setVideoSrc(e)}},{key:"getCameraSettings",value:function(){return this.settings}},{key:"enumerateCameras",value:function(){var e=this;return this.stream?this._enumerateCamerasPromise():this.stopCamera().then((function(){})).catch((function(){})).then((function(){var t={video:!0};return e.mediaDevices.getUserMedia(t).then((function(e){setTimeout((function(){e.getTracks().forEach((function(e){e.stop()}))}),20)})).then((function(){})).catch((function(){})).then((function(){return e._enumerateCamerasPromise()}))}))}},{key:"startCamera",value:function(e,t){var i=this;return this.stopCamera().then((function(){})).catch((function(){})).then((function(){return i._getStreamDevice(e,t)}))}},{key:"startCameraMaxResolution",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.numberOfMaxResolutionTry=0,this.stopCamera().then((function(){})).catch((function(){})).then((function(){return e._getStreamDeviceMaxResolution(t)}))}},{key:"getDataUri",value:function(e){var t={sizeFactor:void 0===e.sizeFactor?a.c:e.sizeFactor,imageType:void 0===e.imageType?s:e.imageType,imageCompression:void 0===e.imageCompression?a.a:e.imageCompression,isImageMirror:void 0===e.isImageMirror?a.b:e.isImageMirror};return n.a.getDataUri(this.videoElement,t)}},{key:"stopCamera",value:function(){var e=this;return new Promise((function(t,i){e.stream&&(e.stream.getTracks().forEach((function(e){e.stop()})),e.videoElement.src="",e.stream=null,e._setSettings(null),t()),i(Error("no stream to stop!"))}))}}]),e}()},function(e,t,i){i.d(t,"c",(function(){return r})),i.d(t,"a",(function(){return n})),i.d(t,"b",(function(){return a}));var r=1,n=null,a=!1},function(e,t,i){var r=i(10);i.d(t,"a",(function(){return r.a}))},function(e,t,i){function r(e){for(var t=atob(e.split(",")[1]),i=e.split(",")[0].split(":")[1].split(";")[0],r=new ArrayBuffer(t.length),n=new Uint8Array(r),a=0;a<t.length;a++)n[a]=t.charCodeAt(a);return new Blob([r],{type:i})}function n(e,t){return(e+="").length>=t?e:new Array(t-e.length+1).join("0")+e}function a(e){var t=d.c.PNG;return"image/jpeg"===e&&(t=d.c.JPG),t}function o(e,t,i){return e+"-"+n(t,4)+"."+a(i)}function s(e,t,i){window.URL=window.webkitURL||window.URL;var r=document.createElement("a");r.download=o(t,i,e.type),r.href=window.URL.createObjectURL(e);var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,0,null),r.dispatchEvent(n)}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"photo",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;s(r(e),t,i)}t.a=c;var d=i(0)}]);var js=Q(Ns);class Us{constructor(){this.currentStream=null,this.currentConstraints=null}static getInstance(){return Us.instance||(Us.instance=new Us),Us.instance}getStream(){return this.currentStream}isStreaming(){return this.currentStream&&this.currentStream.getTracks().some((e=>"live"===e.readyState))}stopStream(){this.currentStream&&(this.currentStream.getTracks().forEach((e=>e.stop())),this.currentStream=null)}areConstraintsEqual(e){return!!this.currentConstraints&&JSON.stringify(this.currentConstraints)===JSON.stringify(e)}async startNewStream(e){this.isStreaming()&&this.areConstraintsEqual(e)||(this.stopStream(),this.currentStream=await navigator.mediaDevices.getUserMedia(e),this.currentConstraints=e)}async enumerateDevices(){try{return await navigator.mediaDevices.enumerateDevices()}catch(e){throw console.error("Failed to enumerate devices:",e),e}}}const qs=[{os:{name:"Android"},label:"2 0"}];async function Ks(){const e=(await async function(){const e=Us.getInstance();let t=await e.enumerateDevices();return t.filter((e=>"videoinput"===e.kind)).every((e=>""===e.label))&&(await e.startNewStream({video:{facingMode:{ideal:"environment"}},audio:!1}),t=await e.enumerateDevices(),e.stopStream()),t}()).filter((e=>{if(!(null==e?void 0:e.label)||"videoinput"!==e.kind||""===e.label)return!1;const t=e.label.toLowerCase();return Hs.some((e=>t.includes(e)))})),t=va.UAParser(),i=e.find((e=>qs.find((i=>i.os.name===t.os.name&&e.label.includes(i.label)))));return i?{optionalCameras:e,selectedCamera:i}:{optionalCameras:e}}const Hs=["rear","back","rück","arrière","trasera","trás","traseira","posteriore","后面","後面","背面","后置","後置","背置","задней","الخلفية","후","arka","achterzijde","หลัง","baksidan","bagside","sau","bak","tylny","takakamera","belakang","אחורית","πίσω","spate","hátsó","zadní","darrere","zadná","задня","stražnja","belakang","बैक","camera2 0, facing back"],Vs={width:{min:640,max:3840,ideal:3840},height:{min:480,max:2160,ideal:2160},frameRate:30},$s={width:{min:640,max:1280,ideal:1280},height:{min:480,max:720,ideal:720},frameRate:30},Js=async e=>{var t,i;let r;return"environment"==e&&(r=await Ks()),null!==(i=null===(t=null==r?void 0:r.selectedCamera)||void 0===t?void 0:t.deviceId)&&void 0!==i?i:e},Gs=(e,t)=>{var i,r;return"user"===e?null!==(i=null==t?void 0:t.selfieVideoConstraints)&&void 0!==i?i:$s:null!==(r=null==t?void 0:t.environmentVideoConstraints)&&void 0!==r?r:Vs},Ws=e=>{const t=Is({tagName:"video",style:{position:"absolute",zIndex:"0",top:"0",width:"100%",height:"100%",objectFit:"cover"},id:"video",testid:"video"});return t.style.transform="user"===e?"scaleX(-1)":"",t.autoplay=!0,t.muted=!0,t.setAttribute("playsinline","true"),t},Zs={title:"other_error_code_title",message:"other_error_code_message"},Ys={ok:Zs,document_face_not_found:Zs,restricted_criteria:Zs,other:Zs,glare:{title:"glare_title",message:"glare_message"},document_not_found:{title:"document_not_found_title",message:"document_not_found_message"},blur:{title:"blur_title",message:"blur_message"},document_not_supported:{title:"document_not_supported_title",message:"document_not_supported_message"},obstructed:{title:"obstructed_title",message:"obstructed_message"},document_not_matching:{title:"document_not_matching_title",message:"document_not_matching_message"},face_not_found:{title:"face_not_found_title",message:"face_not_found_message"},wrong_document_side:{title:"wrong_document_side_title",message:"wrong_document_side_message"},glare_selfie:{title:"glare_selfie_title",message:"glare_selfie_message"},blur_selfie:{title:"blur_selfie_title",message:"blur_selfie_message"},multi_face:{title:"multi_face_title",message:"multi_face_message"},face_rotated:{title:"face_rotated_title",message:"face_rotated_message"},face_too_small:{title:"face_too_small_title",message:"face_too_small_message"},face_too_close:{title:"face_too_close_title",message:"face_too_close_message"},closed_eyes:{title:"closed_eyes_title",message:"closed_eyes_message"},face_angle_too_large:{title:"face_angle_too_large_title",message:"face_angle_too_large_message"},face_close_to_border:{title:"face_close_to_border_title",message:"face_close_to_border_message"},face_occluded:{title:"face_occluded_title",message:"face_occluded_message"},face_cropped:{title:"face_cropped_title",message:"face_cropped_message"},barcode_not_found:{title:"barcode_not_found_title",message:"barcode_not_found_message"}},Qs={loading_screen:{page:"page_header_document",title:"main_title_document_front",instructions:"loading_screen_small_title"},document_front:{page:"page_header_document",title:"main_title_document_front",instructions:"second_title_document_front"},document_back:{page:"page_header_document",title:"main_title_document_back",instructions:"second_title_document_back"},selfie:{page:"page_header_face",title:"main_title_document_face",instructions:"second_title_document_face"}},Xs=(e,t)=>{const i=Is({tagName:"div",style:{display:"flex",justifyContent:"center",flexDirection:"column",alignItems:"center",position:"relative",zIndex:"1",background:"transparent",boxShadow:"0 0 0 1000px rgb(0 0 0 / 50%)",borderStyle:"solid",borderWidth:"1px",borderColor:"white"},id:`overlay-frame ${e}`,testid:`overlay-frame ${e}`});if("environment"===e){!function(e){Ds(e,Is({tagName:"div",style:{position:"absolute",top:"-2px",left:"-2px",width:"20px",height:"20px",backgroundColor:"transparent",borderTopStyle:"solid",borderRightStyle:"none",borderBottomStyle:"none",borderLeftStyle:"solid",borderColor:"white",borderWidth:"4px"},id:"overlay-frame__top-left",testid:"overlay-frame__top-left"})),Ds(e,Is({tagName:"div",style:{position:"absolute",top:"-2px",right:"-2px",width:"20px",height:"20px",backgroundColor:"transparent",borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"none",borderLeftStyle:"none",borderColor:"white",borderWidth:"4px"},id:"overlay-frame__top-right",testid:"overlay-frame__top-right"})),Ds(e,Is({tagName:"div",style:{position:"absolute",bottom:"-2px",right:"-2px",width:"20px",height:"20px",backgroundColor:"transparent",borderTopStyle:"none",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"none",borderColor:"white",borderWidth:"4px"},id:"overlay-frame__bottom-right",testid:"overlay-frame__bottom-right"})),Ds(e,Is({tagName:"div",style:{position:"absolute",bottom:"-2px",left:"-2px",width:"20px",height:"20px",backgroundColor:"transparent",borderTopStyle:"none",borderRightStyle:"none",borderBottomStyle:"solid",borderLeftStyle:"solid",borderColor:"white",borderWidth:"4px"},id:"overlay-frame__bottom-left",testid:"overlay-frame__bottom-left"}))}(i);const e=.85*t.clientWidth;i.style.width=`${e}px`,i.style.height=.65*e+"px",i.style.maxHeight=.5*window.innerHeight+"px"}else{const e=t.clientWidth*(t.clientHeight<700?.8:.85);i.style.width=.8*e+"px",i.style.height=`${e}px`,i.style.minHeight=.8*e+"px",i.style.maxHeight=.5*window.innerHeight+"px",i.style.borderRadius="50%"}return i};const ec=e=>{const t=document.createElementNS("http://www.w3.org/2000/svg","svg");return t.setAttribute("viewBox","0 0 68 68"),t.innerHTML=`<style>.spinner-autocapture circle {animation: rotate 1.5s linear infinite;} @keyframes rotate { 50% {stroke-dashoffset: 94; stroke-dasharray: 6 57; } 100% { stroke-dashoffset: 188; stroke-dasharray: 51 12; }} </style> <g class="spinner-autocapture"> <circle cx="34" cy="34" fill="none" r="30" stroke-width="4" stroke="${null!=e?e:"#fff"}" stroke-dasharray="51 12" stroke-linecap="round" stroke-dashoffset="0" /> </g>`,t};function tc(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("width","16px"),e.setAttribute("height","16px"),e.innerHTML='\n <path d="M8 16C12.4187 16 16 12.4187 16 8C16 3.58125 12.4187 0 8 0C3.58125 0 0 3.58125 0 8C0 12.4187 3.58125 16 8 16ZM8 4C8.41562 4 8.75 4.33437 8.75 4.75V8.25C8.75 8.66562 8.41562 9 8 9C7.58437 9 7.25 8.66562 7.25 8.25V4.75C7.25 4.33437 7.58437 4 8 4ZM9 11C9 11.5531 8.55313 12 8 12C7.44688 12 7 11.5531 7 11C7 10.4469 7.44688 10 8 10C8.55313 10 9 10.4469 9 11Z" fill="#F2F2F2"/>\n ',e}const ic={all:{color:"black",margin:"0"},1:{color:"white",fontSize:"var(--font-size-4xl)",fontWeight:"var(--font-weight-bold)"},2:{color:"white",fontSize:"var(--font-size-2xl)",fontWeight:"var(--font-weight-semibold)"},3:{color:"white",fontSize:"var(--font-size-xl)",fontWeight:"var(--font-weight-medium)"},4:{fontSize:"var(--font-size-lg)",fontWeight:"var(--font-weight-regular)"},5:{fontSize:"var(--font-size-md)",fontWeight:"var(--font-weight-light)"},6:{fontSize:"var(--font-size-sm)",fontWeight:"var(--font-weight-light)"}},rc=e=>{let{text:t,level:r=1,style:n={},id:a,testid:o}=e;const s=Is({tagName:`h${r}`,style:i(i(i({},ic.all),ic[r]),n),id:a,testid:o});return s.textContent=t,s.id=a,s};var nc,ac={};let oc=null;try{oc=(nc||(nc=1,function(e,t){!function(e){function t(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function r(t){e.defaults=t}e.defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};const a={exec:()=>null};function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i="string"==typeof e?e:e.source;const r={replace:(e,t)=>{let n="string"==typeof t?t:t.source;return n=n.replace(s.caret,"$1"),i=i.replace(e,n),r},getRegex:()=>new RegExp(i,t)};return r}const s={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10107}-\u{10133}\u{10140}-\u{10178}\u{1018A}\u{1018B}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E1}-\u{102FB}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{103A0}-\u{103C3}\u{103C8}-\u{103CF}\u{103D1}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{10570}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10858}-\u{10876}\u{10879}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A60}-\u{10A7E}\u{10A80}-\u{10A9F}\u{10AC0}-\u{10AC7}\u{10AC9}-\u{10AE4}\u{10AEB}-\u{10AEF}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D30}-\u{10D39}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EB0}\u{10EB1}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F54}\u{10F70}-\u{10F81}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{11003}-\u{11037}\u{11052}-\u{1106F}\u{11071}\u{11072}\u{11075}\u{11083}-\u{110AF}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11103}-\u{11126}\u{11136}-\u{1113F}\u{11144}\u{11147}\u{11150}-\u{11172}\u{11176}\u{11183}-\u{111B2}\u{111C1}-\u{111C4}\u{111D0}-\u{111DA}\u{111DC}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{1122B}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A8}\u{112B0}-\u{112DE}\u{112F0}-\u{112F9}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}\u{11350}\u{1135D}-\u{11361}\u{11400}-\u{11434}\u{11447}-\u{1144A}\u{11450}-\u{11459}\u{1145F}-\u{11461}\u{11480}-\u{114AF}\u{114C4}\u{114C5}\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115AE}\u{115D8}-\u{115DB}\u{11600}-\u{1162F}\u{11644}\u{11650}-\u{11659}\u{11680}-\u{116AA}\u{116B8}\u{116C0}-\u{116C9}\u{11700}-\u{1171A}\u{11730}-\u{1173B}\u{11740}-\u{11746}\u{11800}-\u{1182B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{1192F}\u{1193F}\u{11941}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D0}\u{119E1}\u{119E3}\u{11A00}\u{11A0B}-\u{11A32}\u{11A3A}\u{11A50}\u{11A5C}-\u{11A89}\u{11A9D}\u{11AB0}-\u{11AF8}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2E}\u{11C40}\u{11C50}-\u{11C6C}\u{11C72}-\u{11C8F}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D89}\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF2}\u{11F02}\u{11F04}-\u{11F10}\u{11F12}-\u{11F33}\u{11F50}-\u{11F59}\u{11FB0}\u{11FC0}-\u{11FD4}\u{12000}-\u{12399}\u{12400}-\u{1246E}\u{12480}-\u{12543}\u{12F90}-\u{12FF0}\u{13000}-\u{1342F}\u{13441}-\u{13446}\u{14400}-\u{14646}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A70}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16B00}-\u{16B2F}\u{16B40}-\u{16B43}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16E40}-\u{16E96}\u{16F00}-\u{16F4A}\u{16F50}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18D00}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1D7CE}-\u{1D7FF}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E2F0}-\u{1E2F9}\u{1E4D0}-\u{1E4EB}\u{1E4F0}-\u{1E4F9}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1EC71}-\u{1ECAB}\u{1ECAD}-\u{1ECAF}\u{1ECB1}-\u{1ECB4}\u{1ED01}-\u{1ED2D}\u{1ED2F}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{1F100}-\u{1F10C}\u{1FBF0}-\u{1FBF9}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},c=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,d=/(?:[*+-]|\d{1,9}[.)])/,u=o(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,d).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),l=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,h=/(?!\s*\])(?:\\.|[^\[\]\\])+/,f=o(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",h).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),p=o(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,d).getRegex(),g="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",m=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,b=o("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",m).replace("tag",g).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),v=o(l).replace("hr",c).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",g).getRegex(),y={blockquote:o(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",v).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:f,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:c,html:b,lheading:u,list:p,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:v,table:a,text:/^[^\n]+/},_=o("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",c).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",g).getRegex(),w=i(i({},y),{},{table:_,paragraph:o(l).replace("hr",c).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",_).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",g).getRegex()}),x=i(i({},y),{},{html:o("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",m).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:a,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:o(l).replace("hr",c).replace("heading"," *#{1,6} *[^\n]").replace("lheading",u).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),A=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,E=/^( {2,}|\\)\n(?!\s*$)/,S="\\p{P}\\p{S}",k=o(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,S).getRegex(),M=o(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,S).getRegex(),C=o("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,S).getRegex(),I=o("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,S).getRegex(),D=o(/\\([punct])/,"gu").replace(/punct/g,S).getRegex(),T=o(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),R=o(m).replace("(?:--\x3e|$)","--\x3e").getRegex(),z=o("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",R).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),B=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,P=o(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",B).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),O=o(/^!?\[(label)\]\[(ref)\]/).replace("label",B).replace("ref",h).getRegex(),F=o(/^!?\[(ref)\](?:\[\])?/).replace("ref",h).getRegex(),N={_backpedal:a,anyPunctuation:D,autolink:T,blockSkip:/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,br:E,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:a,emStrongLDelim:M,emStrongRDelimAst:C,emStrongRDelimUnd:I,escape:A,link:P,nolink:F,punctuation:k,reflink:O,reflinkSearch:o("reflink|nolink(?!\\()","g").replace("reflink",O).replace("nolink",F).getRegex(),tag:z,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:a},L=i(i({},N),{},{link:o(/^!?\[(label)\]\((.*?)\)/).replace("label",B).getRegex(),reflink:o(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",B).getRegex()}),j=i(i({},N),{},{escape:o(A).replace("])","~|])").getRegex(),url:o(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),U=i(i({},j),{},{br:o(E).replace("{2,}","*").getRegex(),text:o(j.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),q={normal:y,gfm:w,pedantic:x},K={normal:N,gfm:j,breaks:U,pedantic:L},H={"&":"&","<":"<",">":">",'"':""","'":"'"},V=e=>H[e];function $(e,t){if(t){if(s.escapeTest.test(e))return e.replace(s.escapeReplace,V)}else if(s.escapeTestNoEncode.test(e))return e.replace(s.escapeReplaceNoEncode,V);return e}function J(e){try{e=encodeURI(e).replace(s.percentDecode,"%")}catch(e){return null}return e}function G(e,t){const i=e.replace(s.findPipe,((e,t,i)=>{let r=!1,n=t;for(;--n>=0&&"\\"===i[n];)r=!r;return r?"|":" |"})).split(s.splitPipe);let r=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(s.slashPipe,"|");return i}function W(e,t,i){const r=e.length;if(0===r)return"";let n=0;for(;n<r;){const a=e.charAt(r-n-1);if(a!==t||i){if(a===t||!i)break;n++}else n++}return e.slice(0,r-n)}function Z(e,t,i,r,n){const a=t.href,o=t.title||null,s=e[1].replace(n.other.outputLinkReplace,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:i,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,e}return{type:"image",raw:i,href:a,title:o,text:s}}class Y{constructor(t){n(this,"options",void 0),n(this,"rules",void 0),n(this,"lexer",void 0),this.options=t||e.defaults}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:W(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],i=function(e,t,i){const r=e.match(i.other.indentCodeCompensation);if(null===r)return t;const n=r[1];return t.split("\n").map((e=>{const t=e.match(i.other.beginningSpace);if(null===t)return e;const[r]=t;return r.length>=n.length?e.slice(n.length):e})).join("\n")}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){const t=W(e,"#");this.options.pedantic?e=t.trim():t&&!this.rules.other.endingSpaceChar.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:W(t[0],"\n")}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=W(t[0],"\n").split("\n"),i="",r="";const n=[];for(;e.length>0;){let t=!1;const a=[];let o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else{if(t)break;a.push(e[o])}e=e.slice(o);const s=a.join("\n"),c=s.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}\n${s}`:s,r=r?`${r}\n${c}`:c;const d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,n,!0),this.lexer.state.top=d,0===e.length)break;const u=n[n.length-1];if("code"===(null==u?void 0:u.type))break;if("blockquote"===(null==u?void 0:u.type)){const t=u,a=t.raw+"\n"+e.join("\n"),o=this.blockquote(a);n[n.length-1]=o,i=i.substring(0,i.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}if("list"!==(null==u?void 0:u.type));else{const t=u,a=t.raw+"\n"+e.join("\n"),o=this.list(a);n[n.length-1]=o,i=i.substring(0,i.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(n[n.length-1].raw.length).split("\n")}}return{type:"blockquote",raw:i,tokens:n,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let i=t[1].trim();const r=i.length>1,n={type:"list",raw:"",ordered:r,start:r?+i.slice(0,-1):"",loose:!1,items:[]};i=r?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=r?i:"[*+-]");const a=this.rules.other.listItemRegex(i);let o=!1;for(;e;){let i=!1,r="",s="";if(!(t=a.exec(e)))break;if(this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,(e=>" ".repeat(3*e.length))),d=e.split("\n",1)[0],u=!c.trim(),l=0;if(this.options.pedantic?(l=2,s=c.trimStart()):u?l=t[1].length+1:(l=t[2].search(this.rules.other.nonSpaceChar),l=l>4?1:l,s=c.slice(l),l+=t[1].length),u&&this.rules.other.blankLine.test(d)&&(r+=d+"\n",e=e.substring(d.length+1),i=!0),!i){const t=this.rules.other.nextBulletRegex(l),i=this.rules.other.hrRegex(l),n=this.rules.other.fencesBeginRegex(l),a=this.rules.other.headingBeginRegex(l),o=this.rules.other.htmlBeginRegex(l);for(;e;){const h=e.split("\n",1)[0];let f;if(d=h,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting," "),f=d):f=d.replace(this.rules.other.tabCharGlobal," "),n.test(d))break;if(a.test(d))break;if(o.test(d))break;if(t.test(d))break;if(i.test(d))break;if(f.search(this.rules.other.nonSpaceChar)>=l||!d.trim())s+="\n"+f.slice(l);else{if(u)break;if(c.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4)break;if(n.test(c))break;if(a.test(c))break;if(i.test(c))break;s+="\n"+d}u||d.trim()||(u=!0),r+=h+"\n",e=e.substring(h.length+1),c=f.slice(l)}}n.loose||(o?n.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0));let h,f=null;this.options.gfm&&(f=this.rules.other.listIsTask.exec(s),f&&(h="[ ] "!==f[0],s=s.replace(this.rules.other.listReplaceTask,""))),n.items.push({type:"list_item",raw:r,task:!!f,checked:h,loose:!1,text:s,tokens:[]}),n.raw+=r}n.items[n.items.length-1].raw=n.items[n.items.length-1].raw.trimEnd(),n.items[n.items.length-1].text=n.items[n.items.length-1].text.trimEnd(),n.raw=n.raw.trimEnd();for(let e=0;e<n.items.length;e++)if(this.lexer.state.top=!1,n.items[e].tokens=this.lexer.blockTokens(n.items[e].text,[]),!n.loose){const t=n.items[e].tokens.filter((e=>"space"===e.type)),i=t.length>0&&t.some((e=>this.rules.other.anyLine.test(e.raw)));n.loose=i}if(n.loose)for(let e=0;e<n.items.length;e++)n.items[e].loose=!0;return n}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:i,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!this.rules.other.tableDelimiter.test(t[2]))return;const i=G(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=t[3]&&t[3].trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],a={type:"table",raw:t[0],header:[],align:[],rows:[]};if(i.length===r.length){for(const e of r)this.rules.other.tableAlignRight.test(e)?a.align.push("right"):this.rules.other.tableAlignCenter.test(e)?a.align.push("center"):this.rules.other.tableAlignLeft.test(e)?a.align.push("left"):a.align.push(null);for(let e=0;e<i.length;e++)a.header.push({text:i[e],tokens:this.lexer.inline(i[e]),header:!0,align:a.align[e]});for(const e of n)a.rows.push(G(e,a.header.length).map(((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]}))));return a}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;const t=W(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let i=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])i++;else if(e[r]===t[1]&&(i--,i<0))return r;return-1}(t[2],"()");if(e>-1){const i=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,i).trim(),t[3]=""}}let i=t[2],r="";if(this.options.pedantic){const e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?i.slice(1):i.slice(1,-1)),Z(t,{href:i?i.replace(this.rules.inline.anyPunctuation,"$1"):i,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer,this.rules)}}reflink(e,t){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){const e=t[(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){const e=i[0].charAt(0);return{type:"text",raw:e,text:e}}return Z(i,e,i[0],this.lexer,this.rules)}}emStrong(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=this.rules.inline.emStrongLDelim.exec(e);if(r&&(!r[3]||!i.match(this.rules.other.unicodeAlphaNumeric))&&(!r[1]&&!r[2]||!i||this.rules.inline.punctuation.exec(i))){const i=[...r[0]].length-1;let n,a,o=i,s=0;const c="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+i);null!=(r=c.exec(t));){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n)continue;if(a=[...n].length,r[3]||r[4]){o+=a;continue}if((r[5]||r[6])&&i%3&&!((i+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);const t=[...r[0]][0].length,c=e.slice(0,i+r.index+t+a);if(Math.min(i,a)%2){const e=c.slice(1,-1);return{type:"em",raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}const d=c.slice(2,-2);return{type:"strong",raw:c,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," ");const i=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return i&&r&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,i;return"@"===t[2]?(e=t[1],i="mailto:"+e):(e=t[1],i=e),{type:"link",raw:t[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=t[0],n="mailto:"+e;else{let a;do{var i,r;a=t[0],t[0]=null!==(i=null===(r=this.rules.inline._backpedal.exec(t[0]))||void 0===r?void 0:r[0])&&void 0!==i?i:""}while(a!==t[0]);e=t[0],n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}}class Q{constructor(t){n(this,"tokens",void 0),n(this,"options",void 0),n(this,"state",void 0),n(this,"tokenizer",void 0),n(this,"inlineQueue",void 0),this.tokens=[],this.tokens.links=Object.create(null),this.options=t||e.defaults,this.options.tokenizer=this.options.tokenizer||new Y,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const i={other:s,block:q.normal,inline:K.normal};this.options.pedantic?(i.block=q.pedantic,i.inline=K.pedantic):this.options.gfm&&(i.block=q.gfm,this.options.breaks?i.inline=K.breaks:i.inline=K.gfm),this.tokenizer.rules=i}static get rules(){return{block:q,inline:K}}static lex(e,t){return new Q(t).lex(e)}static lexInline(e,t){return new Q(t).inlineTokens(e)}lex(e){e=e.replace(s.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){const t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e){let t,i,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(this.options.pedantic&&(e=e.replace(s.tabCharGlobal," ").replace(s.spaceLine,""));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((i=>!!(t=i.call({lexer:this},e,n))&&(e=e.substring(t.raw.length),n.push(t),!0)))))if(t=this.tokenizer.space(e))e=e.substring(t.raw.length),1===t.raw.length&&n.length>0?n[n.length-1].raw+="\n":n.push(t);else if(t=this.tokenizer.code(e))e=e.substring(t.raw.length),i=n[n.length-1],!i||"paragraph"!==i.type&&"text"!==i.type?n.push(t):(i.raw+="\n"+t.raw,i.text+="\n"+t.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text);else if(t=this.tokenizer.fences(e))e=e.substring(t.raw.length),n.push(t);else if(t=this.tokenizer.heading(e))e=e.substring(t.raw.length),n.push(t);else if(t=this.tokenizer.hr(e))e=e.substring(t.raw.length),n.push(t);else if(t=this.tokenizer.blockquote(e))e=e.substring(t.raw.length),n.push(t);else if(t=this.tokenizer.list(e))e=e.substring(t.raw.length),n.push(t);else if(t=this.tokenizer.html(e))e=e.substring(t.raw.length),n.push(t);else if(t=this.tokenizer.def(e))e=e.substring(t.raw.length),i=n[n.length-1],!i||"paragraph"!==i.type&&"text"!==i.type?this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title}):(i.raw+="\n"+t.raw,i.text+="\n"+t.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text);else if(t=this.tokenizer.table(e))e=e.substring(t.raw.length),n.push(t);else if(t=this.tokenizer.lheading(e))e=e.substring(t.raw.length),n.push(t);else{var o;if(r=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const i=e.slice(1);let n;this.options.extensions.startBlock.forEach((e=>{n=e.call({lexer:this},i),"number"==typeof n&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(this.state.top&&(t=this.tokenizer.paragraph(r)))i=n[n.length-1],a&&"paragraph"===(null===(o=i)||void 0===o?void 0:o.type)?(i.raw+="\n"+t.raw,i.text+="\n"+t.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(t),a=r.length!==e.length,e=e.substring(t.raw.length);else if(t=this.tokenizer.text(e))e=e.substring(t.raw.length),i=n[n.length-1],i&&"text"===i.type?(i.raw+="\n"+t.raw,i.text+="\n"+t.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(t);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,n}inline(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e){let t,i,r,n,a,o,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],c=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(n=this.tokenizer.rules.inline.reflinkSearch.exec(c));)e.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(n=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(n=this.tokenizer.rules.inline.anyPunctuation.exec(c));)c=c.slice(0,n.index)+"++"+c.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(a||(o=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((i=>!!(t=i.call({lexer:this},e,s))&&(e=e.substring(t.raw.length),s.push(t),!0)))))if(t=this.tokenizer.escape(e))e=e.substring(t.raw.length),s.push(t);else if(t=this.tokenizer.tag(e))e=e.substring(t.raw.length),i=s[s.length-1],s.push(t);else if(t=this.tokenizer.link(e))e=e.substring(t.raw.length),s.push(t);else if(t=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(t.raw.length),i=s[s.length-1],i&&"text"===t.type&&"text"===i.type?(i.raw+=t.raw,i.text+=t.text):s.push(t);else if(t=this.tokenizer.emStrong(e,c,o))e=e.substring(t.raw.length),s.push(t);else if(t=this.tokenizer.codespan(e))e=e.substring(t.raw.length),s.push(t);else if(t=this.tokenizer.br(e))e=e.substring(t.raw.length),s.push(t);else if(t=this.tokenizer.del(e))e=e.substring(t.raw.length),s.push(t);else if(t=this.tokenizer.autolink(e))e=e.substring(t.raw.length),s.push(t);else if(this.state.inLink||!(t=this.tokenizer.url(e))){if(r=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const i=e.slice(1);let n;this.options.extensions.startInline.forEach((e=>{n=e.call({lexer:this},i),"number"==typeof n&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(t=this.tokenizer.inlineText(r))e=e.substring(t.raw.length),"_"!==t.raw.slice(-1)&&(o=t.raw.slice(-1)),a=!0,i=s[s.length-1],i&&"text"===i.type?(i.raw+=t.raw,i.text+=t.text):s.push(t);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(t.raw.length),s.push(t);return s}}class X{constructor(t){n(this,"options",void 0),n(this,"parser",void 0),this.options=t||e.defaults}space(e){return""}code(e){var t;let{text:i,lang:r,escaped:n}=e;const a=null===(t=(r||"").match(s.notSpaceStart))||void 0===t?void 0:t[0],o=i.replace(s.endingNewline,"")+"\n";return a?'<pre><code class="language-'+$(a)+'">'+(n?o:$(o,!0))+"</code></pre>\n":"<pre><code>"+(n?o:$(o,!0))+"</code></pre>\n"}blockquote(e){let{tokens:t}=e;return`<blockquote>\n${this.parser.parse(t)}</blockquote>\n`}html(e){let{text:t}=e;return t}heading(e){let{tokens:t,depth:i}=e;return`<h${i}>${this.parser.parseInline(t)}</h${i}>\n`}hr(e){return"<hr>\n"}list(e){const t=e.ordered,i=e.start;let r="";for(let t=0;t<e.items.length;t++){const i=e.items[t];r+=this.listitem(i)}const n=t?"ol":"ul";return"<"+n+(t&&1!==i?' start="'+i+'"':"")+">\n"+r+"</"+n+">\n"}listitem(e){let t="";if(e.task){const i=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&"paragraph"===e.tokens[0].type?(e.tokens[0].text=i+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=i+" "+$(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):t+=i+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>\n`}checkbox(e){let{checked:t}=e;return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){let{tokens:t}=e;return`<p>${this.parser.parseInline(t)}</p>\n`}table(e){let t="",i="";for(let t=0;t<e.header.length;t++)i+=this.tablecell(e.header[t]);t+=this.tablerow({text:i});let r="";for(let t=0;t<e.rows.length;t++){const n=e.rows[t];i="";for(let e=0;e<n.length;e++)i+=this.tablecell(n[e]);r+=this.tablerow({text:i})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+r+"</table>\n"}tablerow(e){let{text:t}=e;return`<tr>\n${t}</tr>\n`}tablecell(e){const t=this.parser.parseInline(e.tokens),i=e.header?"th":"td";return(e.align?`<${i} align="${e.align}">`:`<${i}>`)+t+`</${i}>\n`}strong(e){let{tokens:t}=e;return`<strong>${this.parser.parseInline(t)}</strong>`}em(e){let{tokens:t}=e;return`<em>${this.parser.parseInline(t)}</em>`}codespan(e){let{text:t}=e;return`<code>${$(t,!0)}</code>`}br(e){return"<br>"}del(e){let{tokens:t}=e;return`<del>${this.parser.parseInline(t)}</del>`}link(e){let{href:t,title:i,tokens:r}=e;const n=this.parser.parseInline(r),a=J(t);if(null===a)return n;let o='<a href="'+(t=a)+'"';return i&&(o+=' title="'+$(i)+'"'),o+=">"+n+"</a>",o}image(e){let{href:t,title:i,text:r}=e;const n=J(t);if(null===n)return $(r);let a=`<img src="${t=n}" alt="${r}"`;return i&&(a+=` title="${$(i)}"`),a+=">",a}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:$(e.text)}}class ee{strong(e){let{text:t}=e;return t}em(e){let{text:t}=e;return t}codespan(e){let{text:t}=e;return t}del(e){let{text:t}=e;return t}html(e){let{text:t}=e;return t}text(e){let{text:t}=e;return t}link(e){let{text:t}=e;return""+t}image(e){let{text:t}=e;return""+t}br(){return""}}class te{constructor(t){n(this,"options",void 0),n(this,"renderer",void 0),n(this,"textRenderer",void 0),this.options=t||e.defaults,this.options.renderer=this.options.renderer||new X,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ee}static parse(e,t){return new te(t).parse(e)}static parseInline(e,t){return new te(t).parseInline(e)}parse(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i="";for(let r=0;r<e.length;r++){const n=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[n.type]){const e=n,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){i+=t||"";continue}}const a=n;switch(a.type){case"space":i+=this.renderer.space(a);continue;case"hr":i+=this.renderer.hr(a);continue;case"heading":i+=this.renderer.heading(a);continue;case"code":i+=this.renderer.code(a);continue;case"table":i+=this.renderer.table(a);continue;case"blockquote":i+=this.renderer.blockquote(a);continue;case"list":i+=this.renderer.list(a);continue;case"html":i+=this.renderer.html(a);continue;case"paragraph":i+=this.renderer.paragraph(a);continue;case"text":{let n=a,o=this.renderer.text(n);for(;r+1<e.length&&"text"===e[r+1].type;)n=e[++r],o+="\n"+this.renderer.text(n);i+=t?this.renderer.paragraph({type:"paragraph",raw:o,text:o,tokens:[{type:"text",raw:o,text:o,escaped:!0}]}):o;continue}default:{const e='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return i}parseInline(e,t){t=t||this.renderer;let i="";for(let r=0;r<e.length;r++){const n=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[n.type]){const e=this.options.extensions.renderers[n.type].call({parser:this},n);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){i+=e||"";continue}}const a=n;switch(a.type){case"escape":case"text":i+=t.text(a);break;case"html":i+=t.html(a);break;case"link":i+=t.link(a);break;case"image":i+=t.image(a);break;case"strong":i+=t.strong(a);break;case"em":i+=t.em(a);break;case"codespan":i+=t.codespan(a);break;case"br":i+=t.br(a);break;case"del":i+=t.del(a);break;default:{const e='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return i}}class ie{constructor(t){n(this,"options",void 0),n(this,"block",void 0),this.options=t||e.defaults}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?Q.lex:Q.lexInline}provideParser(){return this.block?te.parse:te.parseInline}}n(ie,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class re{constructor(){n(this,"defaults",{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}),n(this,"options",this.setOptions),n(this,"parse",this.parseMarkdown(!0)),n(this,"parseInline",this.parseMarkdown(!1)),n(this,"Parser",te),n(this,"Renderer",X),n(this,"TextRenderer",ee),n(this,"Lexer",Q),n(this,"Tokenizer",Y),n(this,"Hooks",ie),this.use(...arguments)}walkTokens(e,t){let i=[];for(const n of e)switch(i=i.concat(t.call(this,n)),n.type){case"table":{const e=n;for(const r of e.header)i=i.concat(this.walkTokens(r.tokens,t));for(const r of e.rows)for(const e of r)i=i.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=n;i=i.concat(this.walkTokens(e.items,t));break}default:{var r;const e=n;null!==(r=this.defaults.extensions)&&void 0!==r&&null!==(r=r.childTokens)&&void 0!==r&&r[e.type]?this.defaults.extensions.childTokens[e.type].forEach((r=>{const n=e[r].flat(1/0);i=i.concat(this.walkTokens(n,t))})):e.tokens&&(i=i.concat(this.walkTokens(e.tokens,t)))}}return i}use(){const e=this.defaults.extensions||{renderers:{},childTokens:{}};for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.forEach((t=>{const r=i({},t);if(r.async=this.defaults.async||r.async||!1,t.extensions&&(t.extensions.forEach((t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){const i=e.renderers[t.name];e.renderers[t.name]=i?function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];let a=t.renderer.apply(this,r);return!1===a&&(a=i.apply(this,r)),a}:t.renderer}if("tokenizer"in t){if(!t.level||"block"!==t.level&&"inline"!==t.level)throw new Error("extension level must be 'block' or 'inline'");const i=e[t.level];i?i.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&("block"===t.level?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:"inline"===t.level&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)})),r.extensions=e),t.renderer){const e=this.defaults.renderer||new X(this.defaults);for(const i in t.renderer){if(!(i in e))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const r=i,n=t.renderer[r],a=e[r];e[r]=function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];let o=n.apply(e,i);return!1===o&&(o=a.apply(e,i)),o||""}}r.renderer=e}if(t.tokenizer){const e=this.defaults.tokenizer||new Y(this.defaults);for(const i in t.tokenizer){if(!(i in e))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const r=i,n=t.tokenizer[r],a=e[r];e[r]=function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];let o=n.apply(e,i);return!1===o&&(o=a.apply(e,i)),o}}r.tokenizer=e}if(t.hooks){const e=this.defaults.hooks||new ie;for(const i in t.hooks){if(!(i in e))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;const r=i,n=t.hooks[r],a=e[r];ie.passThroughHooks.has(i)?e[r]=t=>{if(this.defaults.async)return Promise.resolve(n.call(e,t)).then((t=>a.call(e,t)));const i=n.call(e,t);return a.call(e,i)}:e[r]=function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];let o=n.apply(e,i);return!1===o&&(o=a.apply(e,i)),o}}r.hooks=e}if(t.walkTokens){const e=this.defaults.walkTokens,i=t.walkTokens;r.walkTokens=function(t){let r=[];return r.push(i.call(this,t)),e&&(r=r.concat(e.call(this,t))),r}}this.defaults=i(i({},this.defaults),r)})),this}setOptions(e){return this.defaults=i(i({},this.defaults),e),this}lexer(e,t){return Q.lex(e,null!=t?t:this.defaults)}parser(e,t){return te.parse(e,null!=t?t:this.defaults)}parseMarkdown(e){return(t,r)=>{const n=i({},r),a=i(i({},this.defaults),n),o=this.onError(!!a.silent,!!a.async);if(!0===this.defaults.async&&!1===n.async)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(null==t)return o(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));a.hooks&&(a.hooks.options=a,a.hooks.block=e);const s=a.hooks?a.hooks.provideLexer():e?Q.lex:Q.lexInline,c=a.hooks?a.hooks.provideParser():e?te.parse:te.parseInline;if(a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(t):t).then((e=>s(e,a))).then((e=>a.hooks?a.hooks.processAllTokens(e):e)).then((e=>a.walkTokens?Promise.all(this.walkTokens(e,a.walkTokens)).then((()=>e)):e)).then((e=>c(e,a))).then((e=>a.hooks?a.hooks.postprocess(e):e)).catch(o);try{a.hooks&&(t=a.hooks.preprocess(t));let e=s(t,a);a.hooks&&(e=a.hooks.processAllTokens(e)),a.walkTokens&&this.walkTokens(e,a.walkTokens);let i=c(e,a);return a.hooks&&(i=a.hooks.postprocess(i)),i}catch(e){return o(e)}}}onError(e,t){return i=>{if(i.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+$(i.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(i);throw i}}}const ne=new re;function ae(e,t){return ne.parse(e,t)}ae.options=ae.setOptions=function(e){return ne.setOptions(e),ae.defaults=ne.defaults,r(ae.defaults),ae},ae.getDefaults=t,ae.defaults=e.defaults,ae.use=function(){return ne.use(...arguments),ae.defaults=ne.defaults,r(ae.defaults),ae},ae.walkTokens=function(e,t){return ne.walkTokens(e,t)},ae.parseInline=ne.parseInline,ae.Parser=te,ae.parser=te.parse,ae.Renderer=X,ae.TextRenderer=ee,ae.Lexer=Q,ae.lexer=Q.lex,ae.Tokenizer=Y,ae.Hooks=ie,ae.parse=ae;const oe=ae.options,se=ae.setOptions,ce=ae.use,de=ae.walkTokens,ue=ae.parseInline,le=ae,he=te.parse,fe=Q.lex;e.Hooks=ie,e.Lexer=Q,e.Marked=re,e.Parser=te,e.Renderer=X,e.TextRenderer=ee,e.Tokenizer=Y,e.getDefaults=t,e.lexer=fe,e.marked=ae,e.options=oe,e.parse=le,e.parseInline=ue,e.parser=he,e.setOptions=se,e.use=ce,e.walkTokens=de}(t)}(0,ac)),ac).marked}catch(e){console.log("marked is not supported",e)}const sc=oc,cc=e=>{let{text:t,id:i,testid:r,clientHeight:n}=e;const a=!!n&&n<700,o=Is({tagName:"div",style:{position:"relative",zIndex:"2",width:"100%",minHeight:a?"48px":"70px",textAlign:"center",backgroundColor:"#262626",display:"flex",justifyContent:"center",alignItems:"center"},id:i,testid:r});return Ds(o,rc({text:t,level:a?6:5,style:{color:"white"}})),o};const dc=e=>{const t=function(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("width","270"),e.setAttribute("height","175"),e.setAttribute("viewBox","40 60 250 140"),e.innerHTML='\n <g transform="matrix(1,0,0,1,0,0)"><g id="12" opacity="1" style="mix-blend-mode:normal"><g><defs><clipPath id="12_clipPath" x="-50%" y="-50%" width="200%" height="200%"><path d="M0,260v-260h333v260z" fill="white" clip-rule="nonzero"></path></clipPath></defs><g clip-path="url(#12_clipPath)"><g transform="matrix(1,0,0,1,48,60)"><g id="83287" opacity="1" style="mix-blend-mode:normal"><g><g><g transform="matrix(1,0,0,1,0,0)"><g id="83288" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83288_fill_path" d="M4,140c-2.20914,0 -4,-1.79086 -4,-4v-132c0,-2.20914 1.79086,-4 4,-4h228c2.20914,0 4,1.79086 4,4v132c0,2.20914 -1.79086,4 -4,4z" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path><defs><clipPath id="ligziij3rlyasnggflf" clipPathUnits="userSpaceOnUse"><path d="M4,140c-2.20914,0 -4,-1.79086 -4,-4v-132c0,-2.20914 1.79086,-4 4,-4h228c2.20914,0 4,1.79086 4,4v132c0,2.20914 -1.79086,4 -4,4z"></path></clipPath></defs><path id="83288_stroke_path" d="M4,140c-2.20914,0 -4,-1.79086 -4,-4v-132c0,-2.20914 1.79086,-4 4,-4h228c2.20914,0 4,1.79086 4,4v132c0,2.20914 -1.79086,4 -4,4z" fill="none" stroke="rgb(195, 205, 255)" stroke-width="4" stroke-linecap="butt" stroke-linejoin="butt" stroke-dasharray="0 0" stroke-opacity="1" clip-path="url(#ligziij3rlyasnggflf)"></path></g></g></g></g><g transform="matrix(1,0,0,1,97,116.5)"><g id="83289" opacity="0.4" style="mix-blend-mode:normal"><g><g><path id="83289_fill_path" d="M135,0l-135,23.5h135z" fill-rule="nonzero" fill="rgb(244, 247, 251)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,2,2)"><g id="83290" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83290_fill_path" d="M0,2c0,-1 1,-2 2,-2h228c1,0 2,1 2,2v18h-232z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(-1,0,0,-1,228.54000000000002,62.99940000000001)"><g id="83291" opacity="0.2" style="mix-blend-mode:lighten"><g><g><path id="83291_fill_path" d="M227,-0.00002l-227,60.99934l226.99998,0.00002z" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,24,42)"><g id="83292" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83292_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h109c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,143,42)"><g id="83293" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83293_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h65c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,24,58)"><g id="83294" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83294_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h64c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,98,58)"><g id="83295" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83295_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h86c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,194,58)"><g id="83296" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83296_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h14c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,24,74)"><g id="83297" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83297_fill_path" d="M1,6c-0.55228,0 -1,-0.44772 -1,-1v-4c0,-0.55228 0.44772,-1 1,-1h83c0.55228,0 1,0.44772 1,1v4c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(244, 247, 251)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,117,74)"><g id="83298" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83298_fill_path" d="M1,6c-0.55228,0 -1,-0.44772 -1,-1v-4c0,-0.55228 0.44772,-1 1,-1h38c0.55228,0 1,0.44772 1,1v4c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(244, 247, 251)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,165,74)"><g id="83299" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83299_fill_path" d="M1,6c-0.55228,0 -1,-0.44772 -1,-1v-4c0,-0.55228 0.44772,-1 1,-1h43c0.55228,0 1,0.44772 1,1v4c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,68,92)"><g id="83300" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83300_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,74,92)"><g id="83301" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83301_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,80,92)"><g id="83302" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83302_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,86,92)"><g id="83303" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83303_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,92,92)"><g id="83304" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83304_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,98,92)"><g id="83305" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83305_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,104,92)"><g id="83306" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83306_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,110,92)"><g id="83307" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83307_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,116,92)"><g id="83308" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83308_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,122,92)"><g id="83309" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83309_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,128,92)"><g id="83310" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83310_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,134,92)"><g id="83311" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83311_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,140,92)"><g id="83312" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83312_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,146,92)"><g id="83313" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83313_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,152,92)"><g id="83314" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83314_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,158,92)"><g id="83315" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83315_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,164,92)"><g id="83316" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83316_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,170,92)"><g id="83317" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83317_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,97,116)"><g id="83318" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83318_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h38c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,2,21)"><g id="83320" opacity="0.2" style="mix-blend-mode:normal"><g><g><path id="83320_fill_path" d="M0,118v-118h234v118z" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g></g></g></g></g><g transform="matrix(1,0,0,1,48,60)"><g id="83268" opacity="1" style="mix-blend-mode:normal"><g><g><g transform="matrix(1,0,0,1,0,0)"><g id="83269" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83269_fill_path" d="M4,140c-2.20914,0 -4,-1.79086 -4,-4v-132c0,-2.20914 1.79086,-4 4,-4h228c2.20914,0 4,1.79086 4,4v132c0,2.20914 -1.79086,4 -4,4z" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path><defs><clipPath id="ligziij4hmxrv43iz67" clipPathUnits="userSpaceOnUse"><path d="M4,140c-2.20914,0 -4,-1.79086 -4,-4v-132c0,-2.20914 1.79086,-4 4,-4h228c2.20914,0 4,1.79086 4,4v132c0,2.20914 -1.79086,4 -4,4z"></path></clipPath></defs><path id="83269_stroke_path" d="M4,140c-2.20914,0 -4,-1.79086 -4,-4v-132c0,-2.20914 1.79086,-4 4,-4h228c2.20914,0 4,1.79086 4,4v132c0,2.20914 -1.79086,4 -4,4z" fill="none" stroke="rgb(195, 205, 255)" stroke-width="4" stroke-linecap="butt" stroke-linejoin="butt" stroke-dasharray="0 0" stroke-opacity="1" clip-path="url(#ligziij4hmxrv43iz67)"></path></g></g></g></g><g transform="matrix(1,0,0,1,196,100)"><g id="83270" opacity="0.4" style="mix-blend-mode:normal"><g><g><defs><clipPath id="ligziij4roiiqcgytn" clipPathUnits="userSpaceOnUse"><path d="M24,12c0,1.2588 -0.198,2.5104 -0.5868,3.708c-0.3888,1.1976 -0.9648,2.3268 -1.7052,3.3456c-0.7404,1.0188 -1.6356,1.914 -2.6544,2.6544c-1.0188,0.7404 -2.148,1.3164 -3.3456,1.7052c-1.1976,0.3888 -2.4492,0.5868 -3.708,0.5868c-1.2588,0 -2.5104,-0.198 -3.708,-0.5868c-1.1976,-0.3888 -2.3268,-0.9648 -3.3456,-1.7052c-1.0188,-0.7404 -1.914,-1.6356 -2.6544,-2.6544c-0.7404,-1.0188 -1.3164,-2.148 -1.7052,-3.3456c-0.3888,-1.1976 -0.5868,-2.4492 -0.5868,-3.708c0,-1.2588 0.198,-2.5104 0.5868,-3.708c0.3888,-1.1976 0.9648,-2.3268 1.7052,-3.3456c0.7404,-1.0188 1.6356,-1.914 2.6544,-2.6544c1.0188,-0.7404 2.148,-1.3164 3.3456,-1.7052c1.1976,-0.3888 2.4492,-0.5868 3.708,-0.5868c1.2588,0 2.5104,0.198 3.708,0.5868c1.1976,0.3888 2.3268,0.9648 3.3456,1.7052c1.0188,0.7404 1.914,1.6356 2.6544,2.6544c0.7404,1.0188 1.3164,2.148 1.7052,3.3456c0.3888,1.1976 0.5868,2.4492 0.5868,3.708z"></path></clipPath></defs><path id="83270_stroke_path" d="M24,12c0,1.2588 -0.198,2.5104 -0.5868,3.708c-0.3888,1.1976 -0.9648,2.3268 -1.7052,3.3456c-0.7404,1.0188 -1.6356,1.914 -2.6544,2.6544c-1.0188,0.7404 -2.148,1.3164 -3.3456,1.7052c-1.1976,0.3888 -2.4492,0.5868 -3.708,0.5868c-1.2588,0 -2.5104,-0.198 -3.708,-0.5868c-1.1976,-0.3888 -2.3268,-0.9648 -3.3456,-1.7052c-1.0188,-0.7404 -1.914,-1.6356 -2.6544,-2.6544c-0.7404,-1.0188 -1.3164,-2.148 -1.7052,-3.3456c-0.3888,-1.1976 -0.5868,-2.4492 -0.5868,-3.708c0,-1.2588 0.198,-2.5104 0.5868,-3.708c0.3888,-1.1976 0.9648,-2.3268 1.7052,-3.3456c0.7404,-1.0188 1.6356,-1.914 2.6544,-2.6544c1.0188,-0.7404 2.148,-1.3164 3.3456,-1.7052c1.1976,-0.3888 2.4492,-0.5868 3.708,-0.5868c1.2588,0 2.5104,0.198 3.708,0.5868c1.1976,0.3888 2.3268,0.9648 3.3456,1.7052c1.0188,0.7404 1.914,1.6356 2.6544,2.6544c0.7404,1.0188 1.3164,2.148 1.7052,3.3456c0.3888,1.1976 0.5868,2.4492 0.5868,3.708z" fill="none" stroke="rgb(195, 205, 255)" stroke-width="10" stroke-linecap="butt" stroke-linejoin="butt" stroke-dasharray="0 0" stroke-opacity="1" clip-path="url(#ligziij4roiiqcgytn)"></path></g></g></g></g><g transform="matrix(1,0,0,1,98,98)"><g id="83271" opacity="0.4" style="mix-blend-mode:normal"><g><g><path id="83271_fill_path" d="M135,0l-135,40h135z" fill-rule="nonzero" fill="rgb(244, 247, 251)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,1,1)"><g id="83272" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83272_fill_path" d="M0,2c0,-1 1,-2 2,-2h229c1,0 2,1 2,2v18h-233z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,42,74.4508)"><g id="83273" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83273_fill_path" d="M18.00001,0h-8c-5.5225,0 -10.00001,4.47496 -10.00001,9.99992c0,1.09999 0.895,1.99998 2,1.99998h24.00002c1.1045,0 2,-0.89549 2,-1.99998c0,-5.52496 -4.475,-9.99992 -10.00001,-9.99992z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,47.5999,54.4509)"><g id="83274" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83274_fill_path" d="M17.306,8.653c0,0.9077 -0.1428,1.8102 -0.4232,2.6738c-0.2804,0.8636 -0.6957,1.6778 -1.2296,2.4124c-0.5339,0.7346 -1.1794,1.3801 -1.914,1.914c-0.7346,0.5339 -1.5488,0.9492 -2.4124,1.2296c-0.8636,0.2804 -1.7661,0.4232 -2.6738,0.4232c-0.9077,0 -1.8102,-0.1428 -2.6738,-0.4232c-0.8636,-0.2804 -1.6778,-0.6957 -2.4124,-1.2296c-0.7346,-0.5339 -1.3801,-1.1794 -1.914,-1.914c-0.5339,-0.7346 -0.9492,-1.5488 -1.2296,-2.4124c-0.2804,-0.8636 -0.4232,-1.7661 -0.4232,-2.6738c0,-0.9077 0.1428,-1.8102 0.4232,-2.6738c0.2804,-0.8636 0.6957,-1.6778 1.2296,-2.4124c0.5339,-0.7346 1.1794,-1.3801 1.914,-1.914c0.7346,-0.5339 1.5488,-0.9492 2.4124,-1.2296c0.8636,-0.2804 1.7661,-0.4232 2.6738,-0.4232c0.9077,0 1.8102,0.1428 2.6738,0.4232c0.8636,0.2804 1.6778,0.6957 2.4124,1.2296c0.7346,0.5339 1.3801,1.1794 1.914,1.914c0.5339,0.7346 0.9492,1.5488 1.2296,2.4124c0.2804,0.8636 0.4232,1.7661 0.4232,2.6738z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,32,48)"><g id="83275" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83275_fill_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path><path id="83275_stroke_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill="none" stroke="rgb(195, 205, 255)" stroke-width="2" stroke-linecap="butt" stroke-linejoin="butt" stroke-dasharray="0 0" stroke-opacity="1"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,-1,1,6.123233995736766e-17,32,94)"><g id="83276" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83276_fill_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path><path id="83276_stroke_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill="none" stroke="rgb(195, 205, 255)" stroke-width="2" stroke-linecap="butt" stroke-linejoin="butt" stroke-dasharray="0 0" stroke-opacity="1"></path></g></g></g></g><g transform="matrix(-1,2.4492935982947064e-16,-2.4492935982947064e-16,-1,79,94)"><g id="83277" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83277_fill_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path><path id="83277_stroke_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill="none" stroke="rgb(195, 205, 255)" stroke-width="2" stroke-linecap="butt" stroke-linejoin="butt" stroke-dasharray="0 0" stroke-opacity="1"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,79,48)"><g id="83278" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83278_fill_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path><path id="83278_stroke_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill="none" stroke="rgb(195, 205, 255)" stroke-width="2" stroke-linecap="butt" stroke-linejoin="butt" stroke-dasharray="0 0" stroke-opacity="1"></path></g></g></g></g><g transform="matrix(1,0,0,1,100,47)"><g id="83279" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83279_fill_path" d="M4,8c-2.20914,0 -4,-1.79086 -4,-4v0c0,-2.20914 1.79086,-4 4,-4v0c2.20914,0 4,1.79086 4,4v0c0,2.20914 -1.79086,4 -4,4z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,116,47)"><g id="83280" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83280_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h86c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,100,67)"><g id="83281" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83281_fill_path" d="M4,8c-2.20914,0 -4,-1.79086 -4,-4v0c0,-2.20914 1.79086,-4 4,-4v0c2.20914,0 4,1.79086 4,4v0c0,2.20914 -1.79086,4 -4,4z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,116,67)"><g id="83282" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83282_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h64c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,100,87)"><g id="83283" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83283_fill_path" d="M4,8c-2.20914,0 -4,-1.79086 -4,-4v0c0,-2.20914 1.79086,-4 4,-4v0c2.20914,0 4,1.79086 4,4v0c0,2.20914 -1.79086,4 -4,4z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,116,87)"><g id="83284" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83284_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h51c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,137,9)"><g id="83285" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83285_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h86c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(244, 247, 251)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(-1,0,0,-1,92.4999,98.9985)"><g id="83286" opacity="0.2" style="mix-blend-mode:lighten"><g><g><path id="83286_fill_path" d="M90.49994,0l-90.49994,96.99852l90.49994,0.00002z" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,0,20)"><g id="83319" opacity="0" style="mix-blend-mode:normal"><g><g><path id="83319_fill_path" d="M0,118v-118h234v118z" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g></g></g></g></g></g></g></g></g><animateTransform href="#83287" attributeName="transform" type="translate" values="118 70;118 70;118 70;118 70;118 70" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.37;0.61;0.66;1" keySplines="0.0664 0.4423 0.15 1;0.0664 0.4423 0.1 1;0.0664 0.4423 0.1 1;0.5 0.35 0.1 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83287" attributeName="transform" type="scale" values="0 1;0 1;1.02 1;1 1;1 1" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.37;0.61;0.66;1" keySplines="0.0664 0.4423 0.15 1;0.0664 0.4423 0.1 1;0.0664 0.4423 0.1 1;0.5 0.35 0.1 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83287" attributeName="transform" type="translate" values="-118 -70;-118 -70;-118 -70;-118 -70;-118 -70" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.37;0.61;0.66;1" keySplines="0.0664 0.4423 0.15 1;0.0664 0.4423 0.1 1;0.0664 0.4423 0.1 1;0.5 0.35 0.1 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83291" attributeName="transform" type="translate" values="0 0;0 0;9.018099999999999 -4;9.018099999999999 -4" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.37;0.52;1" keySplines="0.42 0 0.15 1;0.42 0 0.15 1;0.5 0.35 0.15 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83291" attributeName="transform" type="translate" values="113.5 30.4997;113.5 30.4997;113.5 30.4997;113.5 30.4997" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.37;0.52;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.15 1;0.5 0.35 0.15 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83291" attributeName="transform" type="scale" values="-1 -1;-1 -1;-0.88 -0.88;-0.88 -0.88" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.37;0.52;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.15 1;0.5 0.35 0.15 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83291" attributeName="transform" type="translate" values="-113.5 -30.4997;-113.5 -30.4997;-113.5 -30.4997;-113.5 -30.4997" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.37;0.52;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.15 1;0.5 0.35 0.15 1" additive="sum" fill="freeze"></animateTransform><animate href="#83320" attributeName="opacity" values="0.2;0.2;0;0" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.39;0.43;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.15 1;0.5 0.35 0.15 1" additive="sum" fill="freeze"></animate><animateTransform href="#83268" attributeName="transform" type="translate" values="117 75;117 75;117 75;117 75" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.09;0.37;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.8 0.15;0.5 0.35 0.8 0.15" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83268" attributeName="transform" type="scale" values="1 1;1 1;0 1;0 1" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.09;0.37;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.8 0.15;0.5 0.35 0.8 0.15" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83268" attributeName="transform" type="translate" values="-117 -75;-117 -75;-117 -75;-117 -75" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.09;0.37;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.8 0.15;0.5 0.35 0.8 0.15" additive="sum" fill="freeze"></animateTransform><animate href="#83271_fill_path" attributeName="d" values="M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,-0.0042l-135.0142,40.0042h135.0142z;M135,-0.0364l-135.1228,40.0364h135.1228z;M135,-0.0975l-135.3292,40.0975h135.3292z;M135,-0.1848l-135.6236,40.1848h135.6236z;M135,-0.2958l-135.9982,40.2958h135.9982z;M135,-0.4285l-136.4462,40.4285h136.4462z;M135,-0.5812l-136.9617,40.5812h136.9617z;M135,-0.7525l-137.5397,40.7525h137.5397z;M135,-0.941l-138.176,40.941h138.176z;M135,-1.1457l-138.8667,41.1457h138.8667z;M135,-1.3655l-139.6085,41.3655h139.6085z;M135,-1.5996l-140.3986,41.5996h140.3986z;M135,-1.8472l-141.2343,41.8472h141.2343z;M135,-2.1077l-142.1134,42.1077h142.1134z;M135,-2.3804l-143.0339,42.3804h143.0339z;M135,-2.6649l-143.994,42.6649h143.994z;M135,-2.9607l-144.9922,42.9607h144.9922z;M135,-3.2673l-146.0272,43.2673h146.0272z;M135,-3.5846l-147.0978,43.5846h147.0978z;M135,-3.9121l-148.2031,43.9121h148.2031z;M135,-4.2497l-149.3424,44.2497h149.3424z;M135,-4.5972l-150.5153,44.5972h150.5153z;M135,-4.9545l-151.7213,44.9545h151.7213z;M135,-5.3218l-152.9607,45.3218h152.9607z;M135,-5.6991l-154.2341,45.6991h154.2341z;M135,-6.0868l-155.5427,46.0868h155.5427z;M135,-6.4858l-156.8893,46.4858h156.8893z;M135,-6.898l-158.2804,46.898h158.2804z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z" dur="2.6s" repeatCount="indefinite" keyTimes="0;0.007692307692307693;0.015384615384615385;0.023076923076923078;0.03076923076923077;0.038461538461538464;0.046153846153846156;0.05384615384615385;0.06153846153846154;0.06923076923076923;0.07692307692307693;0.08461538461538462;0.09230769230769231;0.1;0.1076923076923077;0.11538461538461539;0.12307692307692308;0.13076923076923078;0.13846153846153847;0.14615384615384616;0.15384615384615385;0.16153846153846155;0.16923076923076924;0.17692307692307693;0.18461538461538463;0.19230769230769232;0.2;0.2076923076923077;0.2153846153846154;0.2230769230769231;0.23076923076923078;0.23846153846153847;0.24615384615384617;0.25384615384615383;0.26153846153846155;0.2692307692307692;0.27692307692307694;0.2846153846153846;0.2923076923076923;0.3;0.3076923076923077;0.3153846153846154;0.3230769230769231;0.33076923076923076;0.3384615384615385;0.34615384615384615;0.35384615384615387;0.36153846153846153;0.36923076923076925;0.3769230769230769;0.38461538461538464;0.3923076923076923;0.4;0.4076923076923077;0.4153846153846154;0.4230769230769231;0.4307692307692308;0.43846153846153846;0.4461538461538462;0.45384615384615384;0.46153846153846156;0.46923076923076923;0.47692307692307695;0.4846153846153846;0.49230769230769234;0.5;0.5076923076923077;0.5153846153846153;0.5230769230769231;0.5307692307692308;0.5384615384615384;0.5461538461538461;0.5538461538461539;0.5615384615384615;0.5692307692307692;0.5769230769230769;0.5846153846153846;0.5923076923076923;0.6;0.6076923076923076;0.6153846153846154;0.6230769230769231;0.6307692307692307;0.6384615384615384;0.6461538461538462;0.6538461538461539;0.6615384615384615;0.6692307692307692;0.676923076923077;0.6846153846153846;0.6923076923076923;0.7;0.7076923076923077;0.7153846153846154;0.7230769230769231;0.7307692307692307;0.7384615384615385;0.7461538461538462;0.7538461538461538;0.7615384615384615;0.7692307692307693;0.7769230769230769;0.7846153846153846;0.7923076923076923;0.8;0.8076923076923077;0.8153846153846154;0.823076923076923;0.8307692307692308;0.8384615384615385;0.8461538461538461;0.8538461538461538;0.8615384615384616;0.8692307692307693;0.8769230769230769;0.8846153846153846;0.8923076923076924;0.9;0.9076923076923077;0.9153846153846154;0.9230769230769231;0.9307692307692308;0.9384615384615385;0.9461538461538461;0.9538461538461539;0.9615384615384616;0.9692307692307692;0.9769230769230769;0.9846153846153847;0.9923076923076923;1" fill="freeze"></animate><animateTransform href="#83285" attributeName="transform" type="translate" values="88 2;88 2;88 2;88 2;88 2" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.12;0.27;0.33;1" keySplines="0.42 0 0.15 1;0.42 0 0.48 1;0.42 0 0.48 1;0.5 0.35 0.48 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83285" attributeName="transform" type="scale" values="0.98 1;0.98 1;1 1;0.96 1;0.96 1" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.12;0.27;0.33;1" keySplines="0.42 0 0.15 1;0.42 0 0.48 1;0.42 0 0.48 1;0.5 0.35 0.48 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83285" attributeName="transform" type="translate" values="-88 -2;-88 -2;-88 -2;-88 -2;-88 -2" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.12;0.27;0.33;1" keySplines="0.42 0 0.15 1;0.42 0 0.48 1;0.42 0 0.48 1;0.5 0.35 0.48 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83286" attributeName="transform" type="translate" values="0 0;0 0;0 0;0 0" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.09;0.32;1" keySplines="0.42 0 0.15 1;0.42 0 1 1;0.5 0.35 1 1" additive="sum" fill="freeze"></animateTransform><animateTransform xlink:href="#83286" href="#83286" attributeName="transform" type="skewX" values="0;0;-4;-4" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.09;0.32;1" keySplines="0.42 0 0.15 1;0.42 0 1 1;0.5 0.35 1 1" additive="sum" fill="freeze"></animateTransform><animateTransform xlink:href="#83286" href="#83286" attributeName="transform" type="skewY" values="0;0;0;0" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.09;0.32;1" keySplines="0.42 0 0.15 1;0.42 0 1 1;0.5 0.35 1 1" additive="sum" fill="freeze"></animateTransform><animateTransform xlink:href="#83286" href="#83286" attributeName="transform" type="translate" values="0 0;0 0;0 0;0 0" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.09;0.32;1" keySplines="0.42 0 0.15 1;0.42 0 1 1;0.5 0.35 1 1" additive="sum" fill="freeze"></animateTransform><animate href="#83319" attributeName="opacity" values="0;0;0.18;0.18" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.31;0.36;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.15 1;0.5 0.35 0.15 1" additive="sum" fill="freeze"></animate>\n ',e}();return t.setAttribute("style","position: absolute; z-index: 1; opacity: 0; transition: opacity 0.5s ease-in-out;"),"document_back"===e&&(t.style.opacity="1",setTimeout((()=>{t.style.opacity="0"}),5e3)),t};var uc;!function(e){e.INVALID="invalid",e.VALID="valid",e.ACCEPTED="accepted",e.REJECTED="rejected"}(uc||(uc={}));const lc="#ED3232",hc="#01B678",fc="#FFF";const pc=e=>{const t=document.createElement("canvas");t.width=e.videoWidth,t.height=e.videoHeight;return t.getContext("2d").drawImage(e,0,0,e.videoWidth,e.videoHeight),t};async function gc(e){let{context:t,onDetect:i,frame:r,showError:n,isSelfie:a=!1}=e;const o=t.state.name;if(o===uc.REJECTED){n(function(e){switch(e){case Yo.DOCUMENT_DETECTION:return"searching_document_autocapture";case Yo.DOCUMENT_POSITION:return"doc_not_in_frame_issues_autocapture";case Yo.BARCODE_DETECTION:return pa.feedback.BARCODE_NOT_FOUND;case Yo.BLUR_DETECTION:return pa.feedback.BLUR;case Yo.GLARE_DETECTION:return pa.feedback.GLARE;case Yo.FACE_DETECTION:return pa.feedback.FACE_NOT_FOUND;case Yo.FACE_POSITION:return pa.feedback.FACE_TOO_SMALL}}(t.invalidFramesCause));mc("border-color",t.invalidFramesCause===Yo.DOCUMENT_DETECTION?fc:lc)}if(o===uc.VALID)if(a){mc("border-color",hc);n(`capturing_face_autocapture${Math.ceil((t.validFramesThreshold-t.validFramesCounter)/t.validFramesThreshold*3)}`)}else n("capturing_in_progress_message"),mc("border-color",fc);o===uc.ACCEPTED&&(mc("border-color",fc),n(null),"function"==typeof navigator.vibrate&&navigator.vibrate(200),await i({frame:r,suspendedPreview:!0,context:t}))}function mc(e,t){document.querySelectorAll('[id^="overlay-frame"]').forEach((i=>{i.style[e]=t}))}function bc(e){let t,i,r,{captureFrame:n,object:a,videoWidth:o,videoHeight:s,deviceWidth:c,deviceHeight:d,threshold:u,iouThreshold:l=.85}=e;if(o/s>=c/d){r=d/s;const e=(o*r-c)/2;t=a.x*r-e,i=a.y*r}else{r=c/o;const e=(s*r-d)/2;t=a.x*r,i=a.y*r-e}const h=t+a.width*r,f=i+a.height*r;!function(e,t,i,r){var n,a;if(null===(a=null===(n=Zo.state.autoCaptureSettings)||void 0===n?void 0:n.settings)||void 0===a?void 0:a.debug){const n=document.getElementById("image-preview-section"),a=document.getElementById("rectangle");if(a)a.style.width=`${i}px`,a.style.height=`${r}px`,a.style.left=`${e}px`,a.style.top=`${t}px`;else{const a=document.createElement("div");a.id="rectangle",a.style.position="absolute",a.style.border="1px solid yellow",a.style.width=`${i}px`,a.style.height=`${r}px`,a.style.left=`${e}px`,a.style.top=`${t}px`,n.appendChild(a)}}}(t,i,a.width*r,a.height*r);const p=function(e,t){const i=Math.max(e.left,t.left),r=Math.min(e.right,t.right),n=Math.max(e.top,t.top),a=r-i,o=Math.min(e.bottom,t.bottom)-n;if(a<=0||o<=0)return 0;const s=a*o;return s/((e.right-e.left)*(e.bottom-e.top)+(t.right-t.left)*(t.bottom-t.top)-s)}({top:n.top,left:n.left,bottom:n.bottom,right:n.right},{top:i,left:t,bottom:f,right:h}),g=p>l,m=a.width*r*(a.height*r)>u*(n.width*n.height);return g&&m}const vc=()=>{const e=function(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("width","64px"),e.setAttribute("height","64px"),e.innerHTML='\n <path d="M10.7202 25.9524C9.81992 25.9524 9.08331 25.2158 9.08331 24.3155V11.2202C9.08331 10.3199 9.81992 9.58333 10.7202 9.58333C11.6205 9.58333 12.3571 10.3199 12.3571 11.2202V20.6938C16.3675 14.0337 23.662 9.58333 32 9.58333C44.6553 9.58333 54.9166 19.8447 54.9166 32.5C54.9166 45.1553 44.6553 55.4167 32 55.4167C23.8257 55.4167 16.654 51.1403 12.5924 44.6949C11.9274 43.631 12.7357 42.3214 13.994 42.3214C14.6079 42.3214 15.1603 42.6488 15.4979 43.1603C18.9968 48.5621 25.0841 52.1429 32 52.1429C42.8445 52.1429 51.6428 43.3445 51.6428 32.5C51.6428 21.6555 42.8445 12.8571 32 12.8571C24.726 12.8571 18.383 16.8062 14.9864 22.6786H23.8155C24.7158 22.6786 25.4524 23.4152 25.4524 24.3155C25.4524 25.2158 24.7158 25.9524 23.8155 25.9524H10.7202Z" fill="#FF8B8B"/> \n ',e}(),t=Is({tagName:"button",style:{zIndex:"2",width:"fit-content",display:"flex",flexDirection:"column",alignItems:"center",backgroundColor:"transparent",border:"none"},id:"retake-image",testid:"retake-image"});return Ds(t,e),Ds(t,rc({text:"Retake",level:2,style:{color:"#FF8B8B",margin:"0",width:"100%"},id:"retake-image-text"})),t};const yc=()=>{const e=function(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("width","64px"),e.setAttribute("height","64px"),e.innerHTML='\n <path d="M32.5 8.66666C38.6884 8.66666 44.6233 11.125 48.9992 15.5008C53.375 19.8767 55.8333 25.8116 55.8333 32C55.8333 38.1884 53.375 44.1233 48.9992 48.4992C44.6233 52.875 38.6884 55.3333 32.5 55.3333C26.3116 55.3333 20.3767 52.875 16.0009 48.4992C11.625 44.1233 9.16668 38.1884 9.16668 32C9.16668 25.8116 11.625 19.8767 16.0009 15.5008C20.3767 11.125 26.3116 8.66666 32.5 8.66666ZM32.5 58.6667C39.5725 58.6667 46.3552 55.8572 51.3562 50.8562C56.3572 45.8552 59.1667 39.0724 59.1667 32C59.1667 24.9276 56.3572 18.1448 51.3562 13.1438C46.3552 8.14284 39.5725 5.33333 32.5 5.33333C25.4276 5.33333 18.6448 8.14284 13.6438 13.1438C8.64286 18.1448 5.83334 24.9276 5.83334 32C5.83334 39.0724 8.64286 45.8552 13.6438 50.8562C18.6448 55.8572 25.4276 58.6667 32.5 58.6667ZM43.6771 26.5104C44.3229 25.8646 44.3229 24.8021 43.6771 24.1562C43.0313 23.5104 41.9688 23.5104 41.3229 24.1562L29.1667 36.3125L23.6771 30.8229C23.0313 30.1771 21.9688 30.1771 21.3229 30.8229C20.6771 31.4687 20.6771 32.5312 21.3229 33.1771L27.9896 39.8437C28.6354 40.4896 29.6979 40.4896 30.3438 39.8437L43.6771 26.5104Z" fill="#BBF7DD"/>\n ',e}(),t=Is({tagName:"button",style:{zIndex:"2",width:"fit-content",display:"flex",flexDirection:"column",alignItems:"center",backgroundColor:"transparent",border:"none"},id:"approve-image",testid:"approve-image"});return Ds(t,e),Ds(t,rc({text:"Approve",level:2,style:{color:"#BBF7DD",margin:"0",width:"100%"},id:"check-circle-text"})),t},_c=e=>{let{step:t,setImage:i,camera:r}=e;var n,a,o,s;const c=Qs[t];(null===(n=Zo.state.autoCaptureSettings)||void 0===n?void 0:n.enabled)&&"selfie"===t&&(c.instructions="second_title_face_autocapture");const d=((e,t)=>Is({tagName:"div",style:{display:"flex",height:"100%",justifyContent:"space-between",flexDirection:"column",alignItems:"center"},id:e,testid:"document-capture",className:t}))("document-capture",t),u=Is({tagName:"div",style:{position:"relative",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},id:"camera-hint-section",testid:"camera-hint-section"}),l=Is({tagName:"div",style:{display:"flex",flexDirection:"column",alignItems:"center",width:"100%",height:"80%"},id:"central-container",testid:"central-container"}),h=document.getElementById(Zo.state.rootElementId);if(!h)throw new Error("Root element not found");const f=Xs(Os(t),h);Ds(u,dc(t)),Ds(u,f);const p=(()=>{const e=Is({tagName:"div",style:{zIndex:"2",width:"80%",height:"50px",color:"white",display:"flex",alignItems:"center",backgroundColor:"#2E2E2E",justifyContent:"center",opacity:".9"},id:"loading-block",testid:"loading-block"}),t=tc();return t.style.width="16px",t.style.height="16px",t.style.margin="0 10px",Ds(e,t),Ds(e,rc({text:"This may take a few seconds",level:5,style:{color:"white",margin:"0",width:"80%"},id:"image-loading-message"})),e})();Ds(f,p),p.style.visibility="hidden";const g=cc({text:Rs.translate(c.page),id:"page-header",testid:"page-header",clientHeight:h.clientHeight}),m=(e=>{let{click:t,id:i,testid:r,color:n,withLoader:a}=e;if(a){const e=ec();e.style.position="absolute",e.style.left="-7px",e.style.top="-7px",e.style.height="63px",e.style.width="63px";const a=Is({tagName:"button",style:{position:"relative",width:"49px",height:"49px",backgroundColor:n||"white",border:"none",margin:"0 auto",borderRadius:"40px"},id:i+"-inner",testid:r+"-inner"});return Ds(a,e),a.addEventListener("click",t),a}{const e=Is({tagName:"button",style:{width:"65px",height:"65px",zIndex:"1",backgroundColor:"black",padding:"0",border:"solid 5px "+(n||"white"),borderRadius:"40px"},id:i+"-outer",testid:r+"-outer"});return Ds(e,Is({tagName:"div",style:{width:"49px",height:"49px",backgroundColor:n||"white",border:"none",margin:"0 auto",borderRadius:"40px"},id:i+"-inner",testid:r+"-inner"})),e.addEventListener("click",t),e}})({click:()=>i({frame:pc(r.videoElement),suspendedPreview:!1}),id:"submit-image",testid:"submit-image",withLoader:null===(o=null===(a=Zo.state)||void 0===a?void 0:a.autoCaptureSettings)||void 0===o?void 0:o.enabled}),b=(()=>{const e=Is({tagName:"div",style:{zIndex:"2",width:"70%",paddingBottom:"30px",alignItems:"center",backgroundColor:"transparent",justifyContent:"space-between",display:"none"},id:"approve-retake-block",testid:"approve-retake-block"}),t=yc();return Ds(e,vc()),Ds(e,t),e})(),v=(e=>{let{title:t,text:i,clientHeight:r,customTextColor:n}=e;const a=r<700,o=Is({tagName:"div",style:{position:"relative",zIndex:"2",padding:"0 25px",margin:a?"8px 0":"32px 0"},id:"page-info",testid:"page-info"}),s=rc({text:t,level:a?2:1,style:{color:n||"white",textAlign:"center",marginBottom:a?"4px":"10px"},id:"step-title"}),c=rc({text:i,level:a?6:5,style:{color:n||"white",textAlign:"center",height:"35px"},id:"step-instructions"});return Ds(o,s),Ds(o,c),o})({text:Rs.translate(c.instructions),title:Rs.translate(c.title),clientHeight:h.clientHeight}),y=(e=>{const t=e<700,i=Is({tagName:"div",style:{zIndex:"2",width:"85%",display:"flex",flexDirection:Zo.state.markdownSupportText?"column":"row",backgroundColor:"#2E2E2E",borderRadius:"4px",padding:"12px",visibility:"hidden",marginTop:"16px"},id:"error-block",testid:"error-block"}),r=Is({tagName:"div",style:{display:"flex",flexDirection:"row",width:"100%",height:"inherit",alignItems:"center",paddingTop:"25px"},id:"image-error-block",testid:"image-error-block"}),n=tc();n.style.width="16px",n.style.height="16px",n.style.margin="0 10px",Zo.state.markdownSupportText?Ds(r,n):Ds(i,n);const a=Zo.state.markdownSupportText&&null!=sc?sc.parse(Zo.state.markdownSupportText,{async:!1}):"",o=rc({text:"",level:t?6:5,style:{color:"white",margin:"0",width:"85%",fontWeight:"400",height:"fit-content"},id:"image-error-message"}),s=rc({text:"",level:5,style:{color:"white",margin:"0",width:"80%"},id:"image-error-support-message"});return a&&(s.innerHTML=a,Ds(r,o)),Ds(i,a?[r,s]:o),i})(h.clientHeight),_=(null===(s=Zo.state.autoCaptureSettings)||void 0===s?void 0:s.enabled)?ec():function(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("width","65"),e.setAttribute("height","65"),e.setAttribute("viewBox","0 0 24 24"),e.innerHTML='\n <path fill="#ffffff" d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" opacity=".25"/><path fill="#ffffff" d="M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z"><animateTransform attributeName="transform" type="rotate" dur="0.75s" values="0 12 12;360 12 12" repeatCount="indefinite"/></path>\n ',e}();_.style.display="none",Ds(l,g),Ds(l,v),Ds(l,u),Ds(l,y),Ds(d,l);const w=Is({tagName:"div",style:{width:"100%",margin:"10%",zIndex:"1",display:"flex",justifyContent:"center"},id:"trigger-section",testid:"trigger-section"});Ds(w,_),Ds(w,m),Ds(w,b),Ds(d,w),Ds(d,r.videoElement);const x=Is({tagName:"img",style:{display:"block",position:"absolute",objectFit:"cover",height:"100%",width:"100%",transform:"user"===Os(t)?"scaleX(-1)":""},id:"image-preview",testid:"image-preview"});const A=(e=>{const t=Is({tagName:"div",style:{position:"absolute",height:"100%",width:"100%",objectFit:"cover"},id:"image-preview-section",testid:"image-preview-section"});return t.appendChild(e),t})(x);return Ds(d,A),{component:d,setLoadingMode:e=>{var t;m.style.display="none",y.style.visibility="hidden",_.style.display="block",(null===(t=Zo.state.autoCaptureSettings)||void 0===t?void 0:t.enabled)&&(_.style.height="63px",_.style.width="63px"),e&&(p.style.visibility="visible")},setApprovalRetakeButtons:e=>{let{approveAction:t,retakeAction:i}=e;var r,n;m.style.display="none",y.style.display="none",b.style.display="flex";const a=b.querySelector("#approve-image"),o=b.querySelector("#retake-image"),s=a.cloneNode(!0);null===(r=a.parentNode)||void 0===r||r.replaceChild(s,a),s.addEventListener("click",t);const c=o.cloneNode(!0);null===(n=o.parentNode)||void 0===n||n.replaceChild(c,o),c.addEventListener("click",i)},hideApprovalRetakeButtons:()=>{b.style.display="none",y.style.display="flex"},setPreviewImage:(e,t)=>{x.src=e,p.style.visibility="hidden",r.videoElement.style.display="none",m.style.display="none",y.style.visibility="hidden",A.style.display="block",_.style.display=t?"none":"block"},setLoadingComplete:()=>{_.style.display="none",p.style.visibility="hidden"},setAutoCapturingError:(e,t)=>{if(!e)return void(y.style.visibility="hidden");let i;i=e==pa.feedback.RESTRICTED_CRITERIA&&t?t:Ys[e]?Ys[e].message:Rs.translate(e)!==e?e:Ys.other.message,document.getElementById("image-error-message").innerHTML=Rs.translate(i),y.style.visibility="visible"},enableVideoElement:()=>{m.style.display="block",r.videoElement.style.display="block",A.style.display="none",_.style.display="none"},setCapturingShowErrorMode:(e,t)=>{m.style.display="block",A.style.display="none",r.videoElement.style.display="block";const i=e==pa.feedback.RESTRICTED_CRITERIA,n=Ys[e]||Ys.other;document.getElementById("image-error-message").innerHTML=t&&i&&null!=sc?sc.parse(t,{async:!1}):Rs.translate(n.message),y.style.visibility="visible",p.style.visibility="hidden"},setTitleInstructionsMidStep:e=>{let{title:t,instructions:i}=e;t&&(document.getElementById("step-title").innerHTML=Rs.translate(t)),i&&(document.getElementById("step-instructions").innerHTML=Rs.translate(i))}}};class wc{constructor(){this.isValid=!0,this.failedStep=null,this.steps=[]}addStepResponse(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;t||(this.isValid=!1,this.failedStep=e),this.steps.push(new xc(e,t,i))}}class xc{constructor(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.duration=0,this.success=!0,this.step=e,this.success=t,this.duration=i}}class Ac{constructor(){this.name=uc.ACCEPTED}async handleFrame(){return new wc}}class Ec{constructor(){this.name=uc.VALID}async handleFrame(e){let{context:t,frame:i,deviceInfo:r,detectionStrategy:n}=e;const a=await n.validate({frame:i,deviceInfo:r});return a.isValid?(t.validFramesCounter++,t.validFramesCounter>=t.validFramesThreshold&&t.setState(new Ac)):(t.validFramesCounter=0,t.invalidFramesCounter=1,t.invalidFramesCause=a.failedStep,t.setState(new kc)),a}}class Sc{constructor(){this.name=uc.REJECTED}async handleFrame(e){let{context:t,frame:i,detectionStrategy:r,deviceInfo:n}=e;const a=await r.validate({frame:i,deviceInfo:n});return a.isValid?(t.invalidFramesCounter=0,t.validFramesCounter=1,t.setState(new Ec),a):t.invalidFramesCause!==a.failedStep?(t.invalidFramesCounter=1,t.invalidFramesCause=a.failedStep,t.setState(new kc),a):(t.invalidFramesCounter++,a)}}class kc{constructor(){this.name=uc.INVALID}async handleFrame(e){let{context:t,frame:i,detectionStrategy:r,deviceInfo:n}=e;const a=await r.validate({frame:i,deviceInfo:n});return a.isValid?(t.invalidFramesCounter=0,t.validFramesCounter=1,t.setState(new Ec)):t.invalidFramesCause!==a.failedStep?(t.invalidFramesCounter=1,t.invalidFramesCause=a.failedStep):(t.invalidFramesCounter++,t.invalidFramesCounter>=t.invalidFramesThreshold&&t.setState(new Sc)),a}}class Mc{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3;this.detectionStrategy=e,this.state=new kc,this.validFramesCounter=0,this.invalidFramesCounter=0,this.invalidFramesCause=null,this.validFramesThreshold=t,this.invalidFramesThreshold=i}setState(e){this.state=e}async handleFrame(e){let{frame:t,deviceInfo:i}=e;return await this.state.handleFrame({context:this,frame:t,deviceInfo:i,detectionStrategy:this.detectionStrategy})}}async function Cc(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;const o=Ic(t,n,a),s=await new Promise(((n,a)=>{navigator.serviceWorker.ready.then((s=>{var c;const d=t=>{t.data.type===e+"_RESULT"&&(navigator.serviceWorker.removeEventListener("message",d),n(t.data.result)),t.data.type===e+"_ERROR"&&(navigator.serviceWorker.removeEventListener("message",d),as(t.data.error.toString(),e,"error"),a(t.data.error))};navigator.serviceWorker.addEventListener("message",d),null===(c=s.active)||void 0===c||c.postMessage(i({type:e,imageData:o,height:t.height,width:t.width},r))}))}));return ss(`****** in web-SDK return result for ${e}`,s),s}function Ic(e,t,i){const r=document.createElement("canvas"),n=t||{height:e.height,width:e.width},a=r.getContext("2d");r.width=n.width,r.height=n.height,i?null==a||a.drawImage(e,i.x,i.y,i.width,i.height,0,0,n.width,n.height):null==a||a.drawImage(e,0,0,n.width,n.height);const o=null==a?void 0:a.getImageData(0,0,n.width,n.height);return r.remove(),o}async function Dc(e){if(e instanceof HTMLVideoElement&&e.paused)return[];return Cc("DETECT_DOCUMENT",e,{},hs[cs.DOCUMENT_DETECTOR].imageDimensions)}async function Tc(e,t){return Cc("BLUR_GLARE_CLASSIFY",e,{},hs[cs.BLUR_GLARE_CLASSIFIER].imageDimensions,t)}const Rc=function(){try{return new us}catch(e){return ss("Error initializing barcode model",e),as("Error initializing barcode model","barcode_model_not_supported","init"),null}}();class zc{constructor(e){this.barcodeModel=null,this.hasBarcode=e,this.barcodeModel=Rc}async validate(e){let{frame:t,deviceInfo:i}=e;var r;const n=new wc;let a=Date.now();const o=null===(r=await Dc(t))||void 0===r?void 0:r[0];let s=Date.now()-a;if(n.addStepResponse(Yo.DOCUMENT_DETECTION,void 0!==o,s),!o)return n;a=Date.now();const c=bc({captureFrame:document.getElementById("overlay-frame environment").getBoundingClientRect(),object:o,videoWidth:t.width,videoHeight:t.height,deviceWidth:i.width,deviceHeight:i.height,threshold:Zo.state.autoCaptureSettings.settings.capture.documentBackSizeThreshold,iouThreshold:Zo.state.autoCaptureSettings.settings.capture.documentBackIouThreshold});if(s=Date.now()-a,n.addStepResponse(Yo.DOCUMENT_POSITION,c,s),!c)return n;a=Date.now();const d=await Tc(t,o);s=Date.now()-a;const u=d.some((e=>"blur"===e.class));if(n.addStepResponse(Yo.BLUR_DETECTION,!u,s),u)return n;const l=d.some((e=>"glare"===e.class));if(n.addStepResponse(Yo.GLARE_DETECTION,!l,s),l)return n;if(this.barcodeModel&&this.hasBarcode){a=Date.now();const e=await this.barcodeModel.detect(t);s=Date.now()-a;const i=(null==e?void 0:e.length)>0;if(n.addStepResponse(Yo.BARCODE_DETECTION,i,s),!i)return n}return n}}class Bc{constructor(){this.durations=[],this.countSuccess=0,this.countFailed=0}}class Pc{constructor(){this.frameHandleDurations=[],this.stableCounts=[0],this.stats=new Map,Object.values(Yo).forEach((e=>{this.stats.set(e,new Bc)}))}addStats(e,t){this.frameHandleDurations.push(t),e.isValid?this.stableCounts[this.stableCounts.length-1]++:this.stableCounts.push(0),e.steps.forEach((e=>{this.addStat(e.step,e.duration,e.success?1:0,e.success?0:1)}))}addStat(e,t,i,r){const n=this.stats.get(e);if(!n)throw new Error(`Stat for step ${e} not found`);n.durations.push(t),n.countSuccess+=i,n.countFailed+=r}}let Oc=!1;const Fc=e=>{Oc=e};class Nc{async validate(e){let{frame:t,deviceInfo:i}=e;var r;const n=new wc;let a=Date.now();const o=null===(r=await Dc(t))||void 0===r?void 0:r[0];let s=Date.now()-a;if(n.addStepResponse(Yo.DOCUMENT_DETECTION,void 0!==o,s),!o)return n;a=Date.now();const c=bc({captureFrame:document.getElementById("overlay-frame environment").getBoundingClientRect(),object:o,videoWidth:t.width,videoHeight:t.height,deviceWidth:i.width,deviceHeight:i.height,threshold:Zo.state.autoCaptureSettings.settings.capture.documentFrontSizeThreshold,iouThreshold:Zo.state.autoCaptureSettings.settings.capture.documentFrontIouThreshold});if(s=Date.now()-a,n.addStepResponse(Yo.DOCUMENT_POSITION,c,s),!c)return n;a=Date.now();const d=await Tc(t,o);s=Date.now()-a;const u=d.some((e=>"blur"===e.class));if(n.addStepResponse(Yo.BLUR_DETECTION,!u,s),u)return n;const l=d.some((e=>"glare"===e.class));return n.addStepResponse(Yo.GLARE_DETECTION,!l,s),n}}let Lc=!1;const jc=e=>{Lc=e};class Uc{async validate(e){let{frame:t,deviceInfo:i}=e;var r;const n=new wc;let a=Date.now();const o=null===(r=await async function(e){return e instanceof HTMLVideoElement&&e.paused?[]:Cc("DETECT_FACE_LANDMARKS",e)}(t))||void 0===r?void 0:r[0];let s=Date.now()-a;if(n.addStepResponse(Yo.FACE_DETECTION,"face"===(null==o?void 0:o.class),s),!o)return n;a=Date.now();const c=bc({captureFrame:document.getElementById("overlay-frame user").getBoundingClientRect(),object:o,videoWidth:t.width,videoHeight:t.height,deviceWidth:i.width,deviceHeight:i.height,threshold:Zo.state.autoCaptureSettings.settings.faceDetector.selfieSizeThreshold,iouThreshold:Zo.state.autoCaptureSettings.settings.faceDetector.selfieIouThreshold});return s=Date.now()-a,n.addStepResponse(Yo.FACE_POSITION,c,s),n}}let qc=!1;const Kc=e=>{qc=e};async function Hc(e,t){var i,r,n,a;let o="camera-error";if("NotAllowedError"===t.name){o="Permission dismissed"===t.message?"camera-permission-dismissed":"camera-permission-denied";const s=is.createCameraNotAllowedEvent(t.message,e);await rs(null===(i=Zo.state)||void 0===i?void 0:i.step,null===(r=Zo.state)||void 0===r?void 0:r.userToken,null===(n=Zo.state)||void 0===n?void 0:n.sessionId,null===(a=Zo.state)||void 0===a?void 0:a.clientId,s),Zo.dispatch("setIsCapturingProcessStarted",!1)}Ho(e,o)}function Vc(e){const t=(e=>{var t,i,r,n;const[a,o]=e.split(",");if(!a||!o)throw new Error("unable-to-parse-data-uri");const s=null===(r=null===(i=null===(t=a.split(";"))||void 0===t?void 0:t[0])||void 0===i?void 0:i.split(":"))||void 0===r?void 0:r[1];if(!s)throw new Error("unable-to-parse-data-uri");const c=null===(n=s.split("/"))||void 0===n?void 0:n[1];if(!c)throw new Error("unable-to-parse-data-uri");return{data:o,format:c}})(e);return{image:{data:t.data,format:t.format,captureMargins:Ps()}}}let $c=!1;const Jc=async()=>{const e=await Ss(Zo.state.sessionId,Zo.state.userToken,Zo.state.clientId);Gc(e)},Gc=async e=>{var t;"expired"===(null==e?void 0:e.status)?Vo("processing","session-expired",`Session expired for session id: ${Zo.state.sessionId}`):(null==e?void 0:e.missing_images)&&(null===(t=null==e?void 0:e.missing_images)||void 0===t?void 0:t.length)>0&&setTimeout(Jc,3e3)},Wc=e=>{let{step:t}=e;var i,r,n;const a=null===(r=null===(i=Zo.state)||void 0===i?void 0:i.autoCaptureSettings)||void 0===r?void 0:r.enabled;let o=!1;const s=null===(n=Zo.state)||void 0===n?void 0:n.videoCaptureSettings,c=(e=>{let t,i,r=!1;const n=Ws(e),a=new js(n),o=async()=>{r&&(await a.stopCamera(),a.stream&&a.stream.getTracks().forEach((e=>{"live"==e.readyState&&e.stop()})),r=!1)};return{videoStream:i,startVideoFeed:async e=>{var n,s,c;r&&await o(),"environment"==e&&(t=await Ks());const d=null!==(s=null===(n=null==t?void 0:t.selectedCamera)||void 0===n?void 0:n.deviceId)&&void 0!==s?s:e,u=Gs(e,null===(c=Zo.state)||void 0===c?void 0:c.videoCaptureSettings);Us.getInstance().stopStream(),i=await a.startCamera(d,u),r=!0},stopVideoFeed:o,videoElement:a.videoElement,getDataUri:a.getDataUri,getCameraInfo:()=>t}})(Os(t));!function(e){qo({type:"page-load",step:e})}(t),Jc();const d=_c({step:t,setImage:u,camera:c});async function u(e){let{suspendedPreview:i=!1,frame:r,context:n}=e;r||(r=pc(c.videoElement)),"document_front"===t&&jc(!1),"document_back"===t&&Fc(!1),"selfie"===t&&Kc(!1);const a=Date.now(),u=function(e){const t=e.getCameraInfo();return{selectedCamera:(null==t?void 0:t.selectedCamera)&&{label:t.selectedCamera.label},camerasInfo:(null==t?void 0:t.optionalCameras)&&t.optionalCameras.map((e=>({label:e.label})))}}(c);if(!o)return;d.setLoadingMode(null==s?void 0:s.showLoadingBlock);const f=(e=>e.toDataURL("image/jpeg"))(r);d.setPreviewImage(f,"selfie"===t),await c.stopVideoFeed(),"selfie"!==t?await h(i,f,u,a,null==n?void 0:n.stats):(d.setTitleInstructionsMidStep({instructions:"selfie_approval_autocapture"}),d.setApprovalRetakeButtons({approveAction:async()=>{d.hideApprovalRetakeButtons(),await h(i,f,u,a,null==n?void 0:n.stats)},retakeAction:()=>{d.hideApprovalRetakeButtons(),l()}}))}function l(){"selfie"===t&&d.setTitleInstructionsMidStep({instructions:"second_title_face_autocapture"}),c.startVideoFeed(Os(t)).then((()=>{o=!0,d.enableVideoElement(),a&&(d.setAutoCapturingError(null),f(t))})).catch((async e=>{throw await Hc(t,e),e}))}async function h(e,i,r,n,u){const h=[];!function(e){var i,r,n,a;const o=is.createUserActionEvent("capture_image",t,e);rs(null===(i=Zo.state)||void 0===i?void 0:i.step,null===(r=Zo.state)||void 0===r?void 0:r.userToken,null===(n=Zo.state)||void 0===n?void 0:n.sessionId,null===(a=Zo.state)||void 0===a?void 0:a.clientId,o)}(u),function(e,t){qo({type:"capture-image",imageType:t,step:e})}(t,Fs(t));try{const c=Date.now(),u=Vc(i);o=!1,h.push(Bs(Zo.state.sessionId,Zo.state.userToken,Zo.state.clientId,null==u?void 0:u.image,r,Fs(t))),h.push(e?new Promise((e=>setTimeout(e,500))):Promise.resolve(null)),d.setLoadingMode(null==s?void 0:s.showLoadingBlock);const f=(await Promise.all(h))[0];if(Object.prototype.hasOwnProperty.call(f,"has_barcode")&&($c=f.has_barcode),async function(e){let{step:t,requestStartTime:i,imageProcessingStartTime:r,serverProcessingTime:n,userToken:a,sessionId:o,clientId:s}=e;const c=Date.now()-i,d=r?i-r:0,u=is.createUploadImageEvent(t,String(c),String(n),String(d));await rs(t,a,o,s,u)}({step:t,requestStartTime:c,imageProcessingStartTime:n,serverProcessingTime:f.serverProcessingTime,userToken:Zo.state.userToken,sessionId:Zo.state.sessionId,clientId:Zo.state.clientId}),Zo.dispatch("setMissingImages",f.missing_images),d.setLoadingComplete(),function(e,t,i){qo({type:"capture-image-result",imageType:t,feedback:i,step:e})}(t,Fs(t),f.feedback),"ok"!==f.feedback)return await async function(e){mc("border-color",lc),a?d.setAutoCapturingError(e.feedback,e.custom_feedback):d.setCapturingShowErrorMode(e.feedback,e.custom_feedback),await new Promise((e=>setTimeout(e,1e3))),mc("border-color",fc)}(f),void l();mc("border-color",hc),await new Promise((e=>setTimeout(e,750))),mc("border-color",fc),Zo.dispatch("setStep",(e=>{let t;return t=e&&e.length>0?e.shift():"processing",t})(Zo.state.missingImages))}catch(e){d.setLoadingComplete(),d.setCapturingShowErrorMode(pa.feedback.OTHER),c.startVideoFeed(Os(t)).then((()=>{o=!0})).catch((async e=>{throw await Hc(t,e),e})),Ho(t,"failed-to-submit-image")}}async function f(e){if("document_front"===e){for(;!o||c.videoElement.paused;)await new Promise((e=>setTimeout(e,100)));return c.videoElement.onloadedmetadata=()=>{var e;ss("video dimensions (width, height, orientation): ",c.videoElement.videoWidth,c.videoElement.videoHeight,null===(e=null===window||void 0===window?void 0:window.screen)||void 0===e?void 0:e.orientation)},await async function(e){let{camera:t,onDetect:i,showError:r}=e;var n,a,o,s,c,d,u;const l=new Mc(new Nc,null!==(o=null===(a=null===(n=Zo.state.autoCaptureSettings.settings)||void 0===n?void 0:n.stability)||void 0===a?void 0:a.numStableFrames)&&void 0!==o?o:2),h=new Pc;for(jc(!0);l.state.name!==uc.ACCEPTED&&Lc;){const e=Date.now(),n=pc(t.videoElement),a={width:null!==(c=null===(s=t.videoElement.getBoundingClientRect())||void 0===s?void 0:s.width)&&void 0!==c?c:0,height:null!==(u=null===(d=t.videoElement.getBoundingClientRect())||void 0===d?void 0:d.height)&&void 0!==u?u:0},o=await l.handleFrame({frame:n,deviceInfo:a}),f=Date.now()-e+50;h.addStats(o,f),l.stats=h,await gc({context:l,onDetect:i,showError:r,frame:n}),await new Promise((e=>setTimeout(e,50)))}}({camera:c,onDetect:u,showError:d.setAutoCapturingError})}if("document_back"===e){for(;!o||c.videoElement.paused;)await new Promise((e=>setTimeout(e,100)));return c.videoElement.onloadedmetadata=()=>{var e;ss("video dimensions (width, height, orientation): ",c.videoElement.videoWidth,c.videoElement.videoHeight,null===(e=null===window||void 0===window?void 0:window.screen)||void 0===e?void 0:e.orientation)},await async function(e){let{camera:t,onDetect:i,showError:r,hasBarcode:n}=e;var a,o,s,c,d,u,l;const h=new Mc(new zc(n),null!==(s=null===(o=null===(a=Zo.state.autoCaptureSettings.settings)||void 0===a?void 0:a.stability)||void 0===o?void 0:o.numStableFrames)&&void 0!==s?s:2);Fc(!0);const f=new Pc;for(;h.state.name!==uc.ACCEPTED&&Oc;){const e=Date.now(),n=pc(t.videoElement),a={width:null!==(d=null===(c=t.videoElement.getBoundingClientRect())||void 0===c?void 0:c.width)&&void 0!==d?d:0,height:null!==(l=null===(u=t.videoElement.getBoundingClientRect())||void 0===u?void 0:u.height)&&void 0!==l?l:0},o=await h.handleFrame({frame:n,deviceInfo:a}),s=Date.now()-e+50;f.addStats(o,s),h.stats=f,await gc({context:h,onDetect:i,showError:r,frame:n}),await new Promise((e=>setTimeout(e,50)))}}({camera:c,onDetect:u,showError:d.setAutoCapturingError,hasBarcode:$c})}if("selfie"===e){for(;!o||c.videoElement.paused;)await new Promise((e=>setTimeout(e,100)));return c.videoElement.onloadedmetadata=()=>{var e;ss("video dimensions (width, height, orientation): ",c.videoElement.videoWidth,c.videoElement.videoHeight,null===(e=null===window||void 0===window?void 0:window.screen)||void 0===e?void 0:e.orientation)},await async function(e){let{camera:t,onDetect:i,showError:r}=e;var n,a,o,s;const c=new Mc(new Uc,30);Kc(!0);const d=new Pc;for(;c.state.name!==uc.ACCEPTED&&qc;){const e=Date.now(),u=pc(t.videoElement),l={width:null!==(a=null===(n=t.videoElement.getBoundingClientRect())||void 0===n?void 0:n.width)&&void 0!==a?a:0,height:null!==(s=null===(o=t.videoElement.getBoundingClientRect())||void 0===o?void 0:o.height)&&void 0!==s?s:0},h=await c.handleFrame({frame:u,deviceInfo:l}),f=Date.now()-e;d.addStats(h,f),c.stats=d,await gc({context:c,onDetect:i,showError:r,frame:u,isSelfie:!0}),await new Promise((e=>setTimeout(e,50)))}}({camera:c,onDetect:u,showError:d.setAutoCapturingError})}}return a&&f(t),(async e=>{var t,i,r,n;const a=is.createPageViewEvent(e);await rs(null===(t=Zo.state)||void 0===t?void 0:t.step,null===(i=Zo.state)||void 0===i?void 0:i.userToken,null===(r=Zo.state)||void 0===r?void 0:r.sessionId,null===(n=Zo.state)||void 0===n?void 0:n.clientId,a)})(t),c.startVideoFeed(Os(t)).then((()=>{o=!0})).catch((async e=>{throw await Hc(t,e),e})),d.component},Zc=()=>{qo({type:"start-verification-processing",step:Zo.state.step}),Ko("processing","processing",Zo.state.sessionId);const e=Yc("processing-verification");Ds(e,cc({text:"Processing Verification",id:"processing-verification-header",testid:"processing-verification-header"}));const t=async()=>{const e=await Ss(Zo.state.sessionId,Zo.state.userToken,Zo.state.clientId);n(e)},i=()=>{setTimeout(t,3e3)},r=async e=>{Zo.dispatch("setStep",e.status),Zo.dispatch("setStatus",e.status)},n=async e=>{var t,n;if(Zo.dispatch("setMissingImages",e.missing_images),e.status)if("complete"===(null==e?void 0:e.status)){Us.getInstance().stopStream();const i=is.createProcessingCompleteEvent();await rs(Zo.state.step,Zo.state.userToken,null===(t=Zo.state)||void 0===t?void 0:t.sessionId,null===(n=Zo.state)||void 0===n?void 0:n.clientId,i),r(e),Ko("complete",e.status,Zo.state.sessionId),function(e,t,i){qo({type:"verification-complete",step:e,sessionId:t,callbackUrl:i})}("complete",Zo.state.sessionId,e.callback_url),function(e){sessionStorage.removeItem(e)}(No)}else"recapture"===(null==e?void 0:e.status)?(r(e),Zo.dispatch("setIsCapturingProcessStarted",!1),Ko("recapture",e.status,Zo.state.sessionId),function(e,t,i){qo({type:"verification-recapture",step:e,sessionId:t,reason:i})}("recapture",e.status,e.recapture_reason)):"expired"===(null==e?void 0:e.status)?Vo("processing","session-expired",`Session expired for session id: ${Zo.state.sessionId}`):i();else"processing"!==e.state&&(r(e),i())};return t(),e},Yc=e=>Is({tagName:"div",style:{display:"flex",height:"100%",justifyContent:"space-between",flexDirection:"column",alignItems:"center"},id:e,testid:"processing-verification"});function Qc(e,t){var i;if(!e)return;null===(i=t.firstChild)||void 0===i||i.remove();const r=function(e){switch(e){case"processing":return Zc;case"document_front":case"document_back":case"selfie":return Wc;default:throw new Error("Invalid step")}}(e);Ds(t,r({step:e}))}function Xc(e){let{key:t,state:i}=e;const r=i.rootElementId,n=document.getElementById(r);"step"===t&&"complete"!==i.step&&"recapture"!==i.step&&Qc(i.step,n),n&&"processing"===i.step&&(n.style.visibility="hidden")}function ed(){const e=ks(Lo(No));if(!ks)throw console.log("Error restarting session, stored session data is invalid or missing"),new Error("Error restarting session, stored session data is invalid or missing");const t=e.sessionId,i=e.userToken;return Zo.dispatch("setSessionId",t),Zo.dispatch("setUserToken",i),{sessionId:t,userToken:i}}async function td(){var e,t;if(null===(e=Zo.state.autoCaptureSettings)||void 0===e?void 0:e.enabled){const e=Date.now();try{await nd(),ss("all models loaded - auto-capture enabled")}catch(e){Zo.dispatch("setAutoCaptureSettings",{enabled:!1,autocapture_settings:null===(t=Zo.state.autoCaptureSettings)||void 0===t?void 0:t.settings}),ss("Model loading did not complete on time:",e);as(`timed out loading models: ${fs.filter((e=>hs[e].status!==ls.LOADED)).map((e=>e)).join(", ")}`,"model_load_timeout","init")}const i=Object.values(hs).filter((e=>e.status===ls.LOADED)).map((e=>e.loadingStats));!async function(e,t){const i=is.createSdkInitEvent(e,t);await os("init",i)}(Date.now()-e,i)}}async function id(e){var t;try{await Us.getInstance().startNewStream({video:i(i({},Gs("environment",null===(t=Zo.state)||void 0===t?void 0:t.videoCaptureSettings)),{},{deviceId:await Js("environment")})}),function(e,t){qo({type:"session-id-acquired",step:e,sessionId:t})}("init",e),function(e,t,i){const r=document.getElementById(i);r.style.visibility="visible",Qc(e.shift(),r)}(Zo.state.missingImages,Zo.state.sessionId,Zo.state.rootElementId)}catch(e){await Hc("init",e)}}async function rd(e){let{status:t,sessionId:i,userToken:r,missingImages:n,rootElementId:a,language:o}=e;!function(e,t){qo({type:"session-granted",step:e,sessionId:t})}("init",i),Zo.dispatch("setStatus",t),Zo.dispatch("setSessionId",i),Zo.dispatch("setUserToken",r),Zo.dispatch("setMissingImages",n),Zo.dispatch("setRootElement",a),Zo.dispatch("setLanguage",o),async function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en";Rs.overrideLanguage(zs[i]||zs.en);let r=document.getElementById(t);if(!r){r=Is({tagName:"div",style:{background:"#fff",position:"absolute",top:"0",left:"0",zIndex:"1",width:"100%",height:"100%",font:"inherit"},id:t,testid:"root"});const e=document.createElement("style");e.innerHTML=`\n @media only screen and (max-height: 576px) {\n #${t} #trigger-section {\n margin: 0 !important;\n }\n #${t} #page-header {\n height: 5% !important;\n }\n }\n `,Ds(document.head,e),Ds(document.body,r)}}(Zo.state.sessionId,Zo.state.rootElementId,Zo.state.language),function(){try{Po.events.off(Fo,Xc)}catch(e){}Po.events.on(Fo,Xc)}(),await td(),await id(i)}const nd=async()=>{const e=Zo.state.autoCaptureSettings.settings.modelLoadingTimeout;return Promise.race([ps(),new Promise(((t,i)=>setTimeout((()=>i(new Error(`Model loading timed out after ${e} ms`))),e)))])};async function ad(e){if(Zo.state.isCapturingProcessStarted)return void Ho(Zo.state.step,"trying-to-initialize-active-session");let t,i;if(e){const r=await async function(e){let t,i;try{const r=await Cs(e,Zo.state.consentVersion,Zo.state.clientId);return t=r.sessionId,i=r.userToken,Zo.dispatch("setSessionId",t),Zo.dispatch("setUserToken",i),{sessionId:t,userToken:i}}catch(e){throw console.log("Error starting session"),console.error(e),e}}(e);t=r.sessionId,i=r.userToken}else{const e=ed();t=e.sessionId,i=e.userToken}if(!t)return void Ho(Zo.state.step,"other");const{missing_images:r,status:n}=await Ss(t,i,Zo.state.clientId);return Zo.dispatch("setIsCapturingProcessStarted",!0),await rd({status:n,sessionId:t,userToken:i,missingImages:r,rootElementId:Zo.state.rootElementId,language:Zo.state.language}),!0}async function od(){try{return await async function(){if("recapture"===Zo.state.verificationStatus||"pending"===Zo.state.verificationStatus){const{sessionId:e,userToken:t}=ed(),{missing_images:i,status:r}=await Ss(e,t,Zo.state.clientId);return await rd({status:r,sessionId:e,userToken:t,missingImages:i,rootElementId:Zo.state.rootElementId,language:Zo.state.language}),!0}Ho(Zo.state.step,"trying-to-initialize-active-session")}()}catch(e){throw console.log("Error restarting session"),console.error(e),e}}var sd=Object.freeze({__proto__:null,recapture:od,restart:async function(){return od()},start:async function(e){try{return await ad(e)}catch(e){throw console.log("Error starting session"),console.error(e),e}},version:()=>_a});class cd{static arrayBufferToBase64(e){return btoa(String.fromCharCode(...new Uint8Array(e)))}static base64ToArrayBuffer(e){return Uint8Array.from(atob(e),(e=>e.charCodeAt(0)))}static stringToBase64(e){return btoa(e)}static jsonToBase64(e){const t=JSON.stringify(e);return btoa(t)}static base64ToJson(e){const t=atob(e);return JSON.parse(t)}}const dd={log:console.log,error:console.error};var ud,ld;!function(e){e.NotInitialized="not_initialized",e.AuthenticationFailed="authentication_failed",e.AuthenticationAbortedTimeout="authentication_aborted_timeout",e.AuthenticationCanceled="webauthn_authentication_canceled",e.RegistrationFailed="registration_failed",e.AlreadyRegistered="username_already_registered",e.RegistrationAbortedTimeout="registration_aborted_timeout",e.RegistrationCanceled="webauthn_registration_canceled",e.AutofillAuthenticationAborted="autofill_authentication_aborted",e.AuthenticationProcessAlreadyActive="authentication_process_already_active",e.InvalidApprovalData="invalid_approval_data",e.FailedToInitCrossDeviceSession="cross_device_init_failed",e.FailedToGetCrossDeviceStatus="cross_device_status_failed",e.Unknown="unknown"}(ud||(ud={}));class hd extends Error{constructor(e,t){super(e),this.errorCode=ud.NotInitialized,this.data=t}}class fd extends hd{constructor(e,t){super(null!=e?e:"WebAuthnSdk is not initialized",t),this.errorCode=ud.NotInitialized}}class pd extends hd{constructor(e,t){super(null!=e?e:"Authentication failed with an error",t),this.errorCode=ud.AuthenticationFailed}}class gd extends hd{constructor(e,t){super(null!=e?e:"Authentication was canceled by the user or got timeout",t),this.errorCode=ud.AuthenticationCanceled}}class md extends hd{constructor(e,t){super(null!=e?e:"Registration failed with an error",t),this.errorCode=ud.RegistrationFailed}}class bd extends hd{constructor(e,t){super(null!=e?e:"Registration was canceled by the user or got timeout",t),this.errorCode=ud.RegistrationCanceled}}class vd extends hd{constructor(e){super(null!=e?e:"Autofill flow was aborted"),this.errorCode=ud.AutofillAuthenticationAborted}}class yd extends hd{constructor(e){super(null!=e?e:"Operation was aborted by timeout"),this.errorCode=ud.AutofillAuthenticationAborted}}class _d extends hd{constructor(e){super(null!=e?e:"Passkey with this username is already registered with the relying party."),this.errorCode=ud.AlreadyRegistered}}class wd extends hd{constructor(e,t){super(null!=e?e:"Authentication process is already active",t),this.errorCode=ud.AuthenticationProcessAlreadyActive}}class xd extends hd{constructor(e,t){super(null!=e?e:"Invalid approval data",t),this.errorCode=ud.InvalidApprovalData}}class Ad extends hd{constructor(e,t){super(null!=e?e:"Failed to init cross device authentication",t),this.errorCode=ud.FailedToInitCrossDeviceSession}}class Ed extends hd{constructor(e,t){super(null!=e?e:"Failed to get cross device status",t),this.errorCode=ud.FailedToGetCrossDeviceStatus}}function Sd(e){return e.errorCode&&Object.values(ud).includes(e.errorCode)}!function(e){e[e.persistent=0]="persistent",e[e.session=1]="session"}(ld||(ld={}));class kd{static get(e){return kd.getStorageMedium(kd.allowedKeys[e]).getItem(kd.getStorageKey(e))||void 0}static set(e,t){return kd.getStorageMedium(kd.allowedKeys[e]).setItem(kd.getStorageKey(e),t)}static remove(e){kd.getStorageMedium(kd.allowedKeys[e]).removeItem(kd.getStorageKey(e))}static clear(e){for(const[t,i]of Object.entries(kd.allowedKeys)){const r=t;e&&this.configurationKeys.includes(r)||kd.getStorageMedium(i).removeItem(kd.getStorageKey(r))}}static getStorageKey(e){return`WebAuthnSdk:${e}`}static getStorageMedium(e){return e===ld.session?sessionStorage:localStorage}}kd.allowedKeys={clientId:ld.session},kd.configurationKeys=["clientId"];class Md{static isNewApiDomain(e){return e&&(this.newApiDomains.includes(e)||e.startsWith("api.")&&e.endsWith(".transmitsecurity.io"))}static dnsPrefetch(e){const t=document.createElement("link");t.rel="dns-prefetch",t.href=e,document.head.appendChild(t)}static preconnect(e,t){const i=document.createElement("link");i.rel="preconnect",i.href=e,t&&(i.crossOrigin="anonymous"),document.head.appendChild(i)}static warmupConnection(e){this.dnsPrefetch(e),this.preconnect(e,!1),this.preconnect(e,!0)}static init(e,t){var i,r;try{this._serverPath=new URL(t.serverPath),this.isNewApiDomain(null===(i=this._serverPath)||void 0===i?void 0:i.hostname)&&this.warmupConnection(this._serverPath.origin),this._apiPaths=null!==(r=t.webauthnApiPaths)&&void 0!==r?r:this.getDefaultPaths(),this._clientId=e,kd.set("clientId",e)}catch(e){throw new fd("Invalid options.serverPath",{error:e})}}static getDefaultPaths(){var e;const t=this.isNewApiDomain(null===(e=this._serverPath)||void 0===e?void 0:e.hostname)?"/cis":"";return{startAuthentication:`${t}/v1/auth/webauthn/authenticate/start`,startRegistration:`${t}/v1/auth/webauthn/register/start`,initCrossDeviceAuthentication:`${t}/v1/auth/webauthn/cross-device/authenticate/init`,startCrossDeviceAuthentication:`${t}/v1/auth/webauthn/cross-device/authenticate/start`,startCrossDeviceRegistration:`${t}/v1/auth/webauthn/cross-device/register/start`,getCrossDeviceTicketStatus:`${t}/v1/auth/webauthn/cross-device/status`,attachDeviceToCrossDeviceSession:`${t}/v1/auth/webauthn/cross-device/attach-device`}}static getApiPaths(){return this._apiPaths}static async sendRequest(e,t,i){dd.log(`[WebAuthn SDK] Calling ${t.method} ${e}...`);const r=new URL(this._serverPath);return r.pathname=e,i&&(r.search=i),fetch(r.toString(),t)}static async startRegistration(e){const t=await this.sendRequest(this._apiPaths.startRegistration,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i(i({client_id:this.getValidatedClientId(),username:e.username,display_name:e.displayName},e.timeout&&{timeout:e.timeout}),e.limitSingleCredentialToDevice&&{limit_single_credential_to_device:e.limitSingleCredentialToDevice}))});if(!(null==t?void 0:t.ok))throw new pd("Failed to start registration",null==t?void 0:t.body);return await t.json()}static async startAuthentication(e){const t=await this.sendRequest(this._apiPaths.startAuthentication,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i(i(i({client_id:this.getValidatedClientId()},e.username&&{username:e.username}),e.approvalData&&{approval_data:e.approvalData}),e.timeout&&{timeout:e.timeout}))});if(!(null==t?void 0:t.ok))throw new pd("Failed to start authentication",null==t?void 0:t.body);return await t.json()}static async initCrossDeviceAuthentication(e){const t=await this.sendRequest(this._apiPaths.initCrossDeviceAuthentication,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i(i({client_id:this.getValidatedClientId()},e.username&&{username:e.username}),e.approvalData&&{approval_data:e.approvalData}))});if(!(null==t?void 0:t.ok))throw new Ad(void 0,null==t?void 0:t.body);return await t.json()}static async getCrossDeviceTicketStatus(e){const t=await this.sendRequest(this._apiPaths.getCrossDeviceTicketStatus,{method:"GET"},`cross_device_ticket_id=${e.ticketId}`);if(!(null==t?void 0:t.ok))throw new Ed(void 0,null==t?void 0:t.body);return await t.json()}static async startCrossDeviceAuthentication(e){const t=await this.sendRequest(this._apiPaths.startCrossDeviceAuthentication,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cross_device_ticket_id:e.ticketId})});if(!(null==t?void 0:t.ok))throw new pd("Failed to start cross device authentication",null==t?void 0:t.body);return await t.json()}static async startCrossDeviceRegistration(e){const t=await this.sendRequest(this._apiPaths.startCrossDeviceRegistration,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cross_device_ticket_id:e.ticketId})});if(!(null==t?void 0:t.ok))throw new md("Failed to start cross device registration",null==t?void 0:t.body);return await t.json()}static async attachDeviceToCrossDeviceSession(e){const t=await this.sendRequest(this._apiPaths.attachDeviceToCrossDeviceSession,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cross_device_ticket_id:e.ticketId})});if(!(null==t?void 0:t.ok))throw new md("Failed to attach device to cross device session",null==t?void 0:t.body);return await t.json()}static getValidatedClientId(){var e;const t=null!==(e=this._clientId)&&void 0!==e?e:kd.get("clientId");if(!t)throw new fd("Missing clientId");return t}}var Cd,Id,Dd,Td;Md.newApiDomains=["api.idsec-dev.com","api.idsec-stg.com"],function(e){e.InputAutofill="input-autofill",e.Modal="modal"}(Cd||(Cd={})),function(e){e.Pending="pending",e.Scanned="scanned",e.Success="success",e.Error="error",e.Timeout="timeout",e.Aborted="aborted"}(Id||(Id={})),function(e){e.toAuthenticationError=e=>Sd(e)?e:"NotAllowedError"===e.name?new gd:"OperationError"===e.name?new wd(e.message):"SecurityError"===e.name?new pd(e.message):e===ud.AuthenticationAbortedTimeout?new yd:"AbortError"===e.name||e===ud.AutofillAuthenticationAborted?new vd:new pd("Something went wrong during authentication",{error:e}),e.toRegistrationError=e=>Sd(e)?e:"NotAllowedError"===e.name?new bd:"SecurityError"===e.name?new md(e.message):"InvalidStateError"===e.name?new _d:e===ud.RegistrationAbortedTimeout?new yd:new md("Something went wrong during registration",{error:e})}(Dd||(Dd={})),function(e){e.processCredentialRequestOptions=e=>i(i({},e),{},{challenge:cd.base64ToArrayBuffer(e.challenge),allowCredentials:e.allowCredentials.map((e=>i(i({},e),{},{id:cd.base64ToArrayBuffer(e.id)})))}),e.processCredentialCreationOptions=(e,t)=>{var r;const n=JSON.parse(JSON.stringify(e));return n.challenge=cd.base64ToArrayBuffer(e.challenge),n.user.id=cd.base64ToArrayBuffer(e.user.id),(null==t?void 0:t.limitSingleCredentialToDevice)&&(n.excludeCredentials=null===(r=e.excludeCredentials)||void 0===r?void 0:r.map((e=>i(i({},e),{},{id:cd.base64ToArrayBuffer(e.id)})))),(null==t?void 0:t.registerAsDiscoverable)?(n.authenticatorSelection.residentKey="preferred",n.authenticatorSelection.requireResidentKey=!0):(n.authenticatorSelection.residentKey="discouraged",n.authenticatorSelection.requireResidentKey=!1),n.authenticatorSelection.authenticatorAttachment=(null==t?void 0:t.allowCrossPlatformAuthenticators)?void 0:"platform",n},e.encodeAuthenticationResult=e=>{const{authenticatorAttachment:t}=e,i=e.response;return{id:e.id,rawId:cd.arrayBufferToBase64(e.rawId),response:{authenticatorData:cd.arrayBufferToBase64(i.authenticatorData),clientDataJSON:cd.arrayBufferToBase64(i.clientDataJSON),signature:cd.arrayBufferToBase64(i.signature),userHandle:cd.arrayBufferToBase64(i.userHandle)},authenticatorAttachment:t,type:e.type}},e.encodeRegistrationResult=e=>{const{authenticatorAttachment:t}=e,i=e.response;return{id:e.id,rawId:cd.arrayBufferToBase64(e.rawId),response:{attestationObject:cd.arrayBufferToBase64(i.attestationObject),clientDataJSON:cd.arrayBufferToBase64(i.clientDataJSON)},authenticatorAttachment:t,type:e.type}}}(Td||(Td={}));class Rd{async modal(e){try{const t=await this.performAuthentication(i(i({},e),{},{mediationType:Cd.Modal}));return cd.jsonToBase64(t)}catch(e){throw Dd.toAuthenticationError(e)}}activateAutofill(e,t){const{onSuccess:i,onError:r,onReady:n}=e;this.performAuthentication({username:t,mediationType:Cd.InputAutofill,onReady:n}).then((e=>{i(cd.jsonToBase64(e))})).catch((e=>{const t=Dd.toAuthenticationError(e);if(!r)throw t;r(t)}))}abortAutofill(){this.abortController&&this.abortController.abort(ud.AutofillAuthenticationAborted)}abortAuthentication(){this.abortController&&this.abortController.abort(ud.AuthenticationAbortedTimeout)}async performAuthentication(e){var t,i;const r="crossDeviceTicketId"in e?await Md.startCrossDeviceAuthentication({ticketId:e.crossDeviceTicketId}):await Md.startAuthentication({username:e.username,timeout:null===(t=e.options)||void 0===t?void 0:t.timeout}),n=r.credential_request_options,a=Td.processCredentialRequestOptions(n),o=this.getMediatedCredentialRequest(a,e.mediationType);e.mediationType===Cd.InputAutofill&&(null===(i=e.onReady)||void 0===i||i.call(e));const s=await navigator.credentials.get(o).catch((e=>{throw Dd.toAuthenticationError(e)}));return{webauthnSessionId:r.webauthn_session_id,publicKeyCredential:Td.encodeAuthenticationResult(s),userAgent:navigator.userAgent}}getMediatedCredentialRequest(e,t){const i={publicKey:e};return this.abortController=new AbortController,i.signal=this.abortController&&this.abortController.signal,t===Cd.InputAutofill?i.mediation="conditional":e.timeout&&setTimeout((()=>{this.abortAuthentication()}),e.timeout),i}}class zd{constructor(e,t){this.handler=e,this.intervalInMs=t}begin(){var e;this.intervalId=window.setInterval((e=this.handler,async function(){e.isRunning||(e.isRunning=!0,await e(...arguments),e.isRunning=!1)}),this.intervalInMs)}stop(){clearInterval(this.intervalId)}}const Bd=/^[A-Za-z0-9\-_.: ]*$/;function Pd(e){if(e&&(!function(e){return Object.keys(e).length<=10}(e)||!function(e){const t=e=>"string"==typeof e,i=e=>Bd.test(e);return Object.keys(e).every((r=>t(r)&&t(e[r])&&i(r)&&i(e[r])))}(e)))throw dd.error("Failed validating approval data"),new xd("Provided approval data should have 10 properties max. Also, it should contain only \n alphanumeric characters, numbers, and the special characters: '-', '_', '.'")}class Od{constructor(e,t,r){this.authenticationHandler=e,this.registrationHandler=t,this.approvalHandler=r,this.init={registration:async e=>(this.ticketStatus=Id.Pending,this.pollCrossDeviceSession(e.crossDeviceTicketId,e.handlers)),authentication:async e=>{const{username:t}=e,r=(await Md.initCrossDeviceAuthentication(i({},t&&{username:t}))).cross_device_ticket_id;return this.ticketStatus=Id.Pending,this.pollCrossDeviceSession(r,e.handlers)},approval:async e=>{const{username:t,approvalData:i}=e;Pd(i);const r=(await Md.initCrossDeviceAuthentication({username:t,approvalData:i})).cross_device_ticket_id;return this.ticketStatus=Id.Pending,this.pollCrossDeviceSession(r,e.handlers)}},this.authenticate={modal:async e=>this.authenticationHandler.modal({crossDeviceTicketId:e})},this.approve={modal:async e=>this.approvalHandler.modal({crossDeviceTicketId:e})}}async register(e,t){return this.registrationHandler.register({crossDeviceTicketId:e},t)}async attachDevice(e){const t=await Md.attachDeviceToCrossDeviceSession({ticketId:e});return i({status:t.status,startedAt:t.started_at},t.approval_data&&{approvalData:t.approval_data})}async pollCrossDeviceSession(e,t){return this.poller=new zd((async()=>{var i,r;const n=await Md.getCrossDeviceTicketStatus({ticketId:e}),a=n.status;if(a!==this.ticketStatus)switch(this.ticketStatus=a,a){case Id.Scanned:await t.onDeviceAttach();break;case Id.Error:case Id.Timeout:case Id.Aborted:await t.onFailure(n),null===(i=this.poller)||void 0===i||i.stop();break;case Id.Success:if("onCredentialRegister"in t)await t.onCredentialRegister();else{if(!n.session_id)throw new Ed("Cross device session is complete without returning session_id",n);await t.onCredentialAuthenticate(n.session_id)}null===(r=this.poller)||void 0===r||r.stop()}}),1e3),this.poller.begin(),setTimeout((()=>{var e;null===(e=this.poller)||void 0===e||e.stop(),t.onFailure({status:Id.Timeout})}),3e5),{crossDeviceTicketId:e,stop:()=>{var e;null===(e=this.poller)||void 0===e||e.stop()}}}}class Fd{async register(e,t){this.abortController=new AbortController;const r=i({allowCrossPlatformAuthenticators:!("crossDeviceTicketId"in e),registerAsDiscoverable:!0},t);try{const i="crossDeviceTicketId"in e?await Md.startCrossDeviceRegistration({ticketId:e.crossDeviceTicketId}):await Md.startRegistration({username:e.username,displayName:(null==t?void 0:t.displayName)||e.username,timeout:null==t?void 0:t.timeout,limitSingleCredentialToDevice:null==t?void 0:t.limitSingleCredentialToDevice}),n=Td.processCredentialCreationOptions(i.credential_creation_options,r);setTimeout((()=>{this.abortRegistration()}),n.timeout);const a=await this.registerCredential(n),o={webauthnSessionId:i.webauthn_session_id,publicKeyCredential:a,userAgent:navigator.userAgent};return cd.jsonToBase64(o)}catch(e){throw Dd.toRegistrationError(e)}}abortRegistration(){this.abortController&&this.abortController.abort(ud.RegistrationAbortedTimeout)}async registerCredential(e){const t=await navigator.credentials.create({publicKey:e,signal:this.abortController&&this.abortController.signal}).catch((e=>{throw Dd.toRegistrationError(e)}));return Td.encodeRegistrationResult(t)}}class Nd{async modal(e){try{const t=await this.performApproval(e);return cd.jsonToBase64(t)}catch(e){throw Dd.toAuthenticationError(e)}}async performApproval(e){"approvalData"in e&&Pd(e.approvalData);const t="crossDeviceTicketId"in e?await Md.startCrossDeviceAuthentication({ticketId:e.crossDeviceTicketId}):await Md.startAuthentication({username:e.username,approvalData:e.approvalData}),i=t.credential_request_options,r=Td.processCredentialRequestOptions(i),n=await navigator.credentials.get({publicKey:r}).catch((e=>{throw Dd.toAuthenticationError(e)}));return{webauthnSessionId:t.webauthn_session_id,publicKeyCredential:Td.encodeAuthenticationResult(n),userAgent:navigator.userAgent}}}class Ld{constructor(){this._initialized=!1,this._authenticationHandler=new Rd,this._registrationHandler=new Fd,this._approvalHandler=new Nd,this._crossDeviceHandler=new Od(this._authenticationHandler,this._registrationHandler,this._approvalHandler),this.authenticate={modal:async(e,t)=>(this.initCheck(),this._authenticationHandler.modal({username:e,options:t})),autofill:{activate:(e,t)=>(this.initCheck(),this._authenticationHandler.activateAutofill(e,t)),abort:()=>this._authenticationHandler.abortAutofill()}},this.approve={modal:async(e,t)=>(this.initCheck(),this._approvalHandler.modal({username:e,approvalData:t}))},this.register=async(e,t)=>(this.initCheck(),this._registrationHandler.register({username:e},t)),this.crossDevice={init:{registration:async e=>(this.initCheck(),this._crossDeviceHandler.init.registration(e)),authentication:async e=>(this.initCheck(),this._crossDeviceHandler.init.authentication(e)),approval:async e=>(this.initCheck(),this._crossDeviceHandler.init.approval(e))},authenticate:{modal:async e=>(this.initCheck(),this._crossDeviceHandler.authenticate.modal(e))},approve:{modal:async e=>(this.initCheck(),this._crossDeviceHandler.approve.modal(e))},register:async(e,t)=>(this.initCheck(),this._crossDeviceHandler.register(e,t)),attachDevice:async e=>(this.initCheck(),this._crossDeviceHandler.attachDevice(e))},this.isPlatformAuthenticatorSupported=async()=>{var e;try{return await(null===(e=Ld.StaticPublicKeyCredential)||void 0===e?void 0:e.isUserVerifyingPlatformAuthenticatorAvailable())}catch(e){return!1}},this.isAutofillSupported=async()=>{var e,t;return!(!(null===(e=Ld.StaticPublicKeyCredential)||void 0===e?void 0:e.isConditionalMediationAvailable)||!await(null===(t=Ld.StaticPublicKeyCredential)||void 0===t?void 0:t.isConditionalMediationAvailable()))}}async init(e,t){try{if(!e)throw new fd("Invalid clientId",{clientId:e});if(t.webauthnApiPaths){const e=Md.getDefaultPaths();if(function(e,t){const i=new Set(e),r=new Set(t);return[...e.filter((e=>!r.has(e))),...t.filter((e=>!i.has(e)))]}(Object.keys(t.webauthnApiPaths),Object.keys(e)).length)throw new fd("Invalid custom paths",{customApiPaths:t.webauthnApiPaths})}Md.init(e,t),this._initialized=!0}catch(e){throw Sd(e)?e:new fd("Failed to initialize SDK")}}getDefaultPaths(){return this.initCheck(),Md.getDefaultPaths()}getApiPaths(){return this.initCheck(),Md.getApiPaths()}initCheck(){if(!this._initialized)throw new fd}}Ld.StaticPublicKeyCredential=window.PublicKeyCredential;const jd=new Z("webauthn"),Ud=new Ld;jd.events.on(jd.events.MODULE_INITIALIZED,(()=>{var e;const t=jd.moduleMetadata.getInitConfig();if(!(null===(e=null==t?void 0:t.webauthn)||void 0===e?void 0:e.serverPath))return;const{clientId:r,webauthn:n}=t;Ud.init(r,i({},n))}));const qd={modal:async(e,t)=>(Ud.initCheck(),Ud.authenticate.modal(e,t)),autofill:{activate:(e,t)=>{Ud.initCheck(),Ud.authenticate.autofill.activate(e,t)},abort:()=>{Ud.initCheck(),Ud.authenticate.autofill.abort()}}},Kd={modal:async(e,t)=>(Ud.initCheck(),Ud.approve.modal(e,t))};const{crossDevice:Hd}=Ud,{isPlatformAuthenticatorSupported:Vd}=Ud,{isAutofillSupported:$d}=Ud,{getDefaultPaths:Jd}=Ud;window.localWebAuthnSDK=Ud;var Gd=Object.freeze({__proto__:null,get WebauthnCrossDeviceStatus(){return Id},approve:Kd,authenticate:qd,crossDevice:Hd,getDefaultPaths:Jd,isAutofillSupported:$d,isPlatformAuthenticatorSupported:Vd,register:async function(e,t){return Ud.initCheck(),Ud.register(e,t)}});const Wd=new Z("ido");var Zd,Yd,Qd,Xd,eu;!function(e){e[e.Debug=0]="Debug",e[e.Info=1]="Info",e[e.Warning=2]="Warning",e[e.Error=3]="Error"}(Zd||(Zd={})),function(e){e.InvalidInitOptions="invalid_initialization_options",e.NotInitialized="not_initialized",e.NoActiveJourney="no_active_journey",e.NetworkError="network_error",e.ClientResponseNotValid="client_response_not_valid",e.ServerError="server_error",e.InvalidState="invalid_state",e.InvalidCredentials="invalid_credentials",e.ExpiredOTPPasscode="expired_otp_passcode",e.ExpiredValidationPasscode="expired_validation_passcode",e.MaxResendReached="expired_otp_passcode"}(Yd||(Yd={})),function(e){e.ClientInput="client_input",e.Cancel="cancel",e.Fail="failure",e.Custom="custom",e.Resend="resend"}(Qd||(Qd={})),function(e){e.JourneySuccess="journey_success",e.ClientInputRequired="client_input_required",e.ClientInputUpdateRequired="client_input_update_required",e.JourneyRejection="journey_rejection"}(Xd||(Xd={})),function(e){e.Rejection="action:rejection",e.Success="action:success",e.Information="action:information",e.DebugBreak="action:debug_break",e.WaitForAnotherDevice="action:wait_for_another_device",e.CryptoBindingRegistration="action:crypto_binding_registration",e.CryptoBindingValidation="action:crypto_binding_validation",e.RegisterDeviceAction="transmit_platform_device_registration",e.ValidateDeviceAction="transmit_platform_device_validation",e.WebAuthnRegistration="action:webauthn_registration",e.DrsTriggerAction="action:drs_trigger_action",e.IdentityVerification="action:id_verification",e.EmailOTPAuthentication="transmit_platform_email_otp_authentication",e.SmsOTPAuthentication="transmit_platform_sms_otp_authentication",e.EmailValidation="transmit_platform_email_validation",e.SmsValidation="transmit_platform_sms_validation",e.TotpRegistration="transmit_platform_totp_registration",e.TransactionSigningTOTP="transmit_platform_transaction_signing_totp",e.InvokeIDP="invoke_idp",e.WebAuthnTransactionSigning="transmit_platform_transaction_signing_webauthn",e.SelectOrganization="transmit_platform_select_organization",e.MobileApproveAuthentication="transmit_platform_mobile_approve_authentication"}(eu||(eu={}));const tu=new class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Zd.Info;this.logLevel=e}setLogLevel(e){e<Zd.Debug||e>Zd.Error?this.error("Invalid log level"):this.logLevel=e}debug(e){this.logLevel<=Zd.Debug&&console.debug(`[DEBUG] ${e}`)}info(e){this.logLevel<=Zd.Info&&console.info(`[INFO] ${e}`)}warning(e){this.logLevel<=Zd.Warning&&console.warn(`[WARNING] ${e}`)}error(e){this.logLevel<=Zd.Error&&console.error(`[ERROR] ${e}`)}},iu={[eu.CryptoBindingRegistration]:"input",[eu.CryptoBindingValidation]:"input",[eu.RegisterDeviceAction]:"data",[eu.ValidateDeviceAction]:"data"},ru="api/v2/",nu={path:"auth/sso"},au={path:"auth/anonymous_invoke"},ou={path:"auth/assert"},su={path:"auth/poll"},cu={path:"auth/create_debug_token"},du={path:"auth/key_exchange"},uu={headers:{mandatory:!0,dummy:[{type:"correlation_id",correlation_id:"337BFFE6BEE7D694B8FA41F42B00742CA537DC398F79369A3A60E04D0EB2E8E1"}]},data:{mandatory:!0,dummy:{collection_result:{metadata:{timestamp:(new Date).getTime()},content:{}},policy_request_id:"LoginWithMenu"},large_dummy:{metadata:{timestamp:1679422144431},content:{device_details:{logged_users:1,persistence_mode:"persistent",device_id:"8951bd7b67a959e7b12b5018816f9ce4",os_type:"Mac OS",os_version:"10.15.7",device_model:"Chrome 111.0.0.0"},location:{enabled:!1},capabilities:{fido2_user_verifying_platform_authenticator_available:!0,audio_acquisition_supported:!0,finger_print_supported:!1,image_acquisition_supported:!1,persistent_keys_supported:!0,face_id_key_bio_protection_supported:!1,fido_client_present:!1,fido2_client_present:!0,dyadic_present:!1,installed_plugins:[]},collector_state:{accounts:"disabled",devicedetails:"active",contacts:"disabled",owner:"disabled",software:"disabled",location:"disabled",locationcountry:"disabled",bluetooth:"disabled",externalsdkdetails:"active",hwauthenticators:"active",capabilities:"active",fidoauthenticators:"disabled",largedata:"active",localenrollments:"active",devicefingerprint:"active",apppermissions:"disabled"},local_enrollments:{}},fp2:{user_agent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36",webdriver:!0,language:"en-US",color_depth:30,device_memory:8,pixel_ratio:2,hardware_concurrency:12,screen_resolution:[1680,1050],available_screen_resolution:[1680,1025],timezone_offset:240,timezone:"America/New_York",session_storage:!0,local_storage:!0,indexed_db:!0,add_behavior:!1,open_database:!0,cpu_class:"not available",platform:"MacIntel",do_not_track:"not available",plugins:[["PDF Viewer","Portable Document Format",[["application/pdf","pdf"],["text/pdf","pdf"]]],["Chrome PDF Viewer","Portable Document Format",[["application/pdf","pdf"],["text/pdf","pdf"]]],["Chromium PDF Viewer","Portable Document Format",[["application/pdf","pdf"],["text/pdf","pdf"]]],["Microsoft Edge PDF Viewer","Portable Document Format",[["application/pdf","pdf"],["text/pdf","pdf"]]],["WebKit built-in PDF","Portable Document Format",[["application/pdf","pdf"],["text/pdf","pdf"]]]],canvas:["canvas winding:yes","canvas fp:data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAB9AAAADICAYAAACwGnoBAAAAAXNSR0IArs4c6QAAIABJREFUeF7s3XeYXVW9//H3Omdaeu+FGgiE9BDAgmIBQRRQ4eIP0JCQmdC8YgHrZRQLAooSSjIpRMpVCZciiIAiKhoIpEMoUtILKaS3KWf/nu8+e0/2nDkzc+bMmckMfNbz8Ejm7L3W2q8zwT8++/tdjlY+PLz+wAhgKHA0MBjoB/QEDq9j+6uAzcAGYDXwFvA6sMzh1of3eHjtgWHA8ZH/7Qa0q+Mfu3VfHf9sA14Flof/63B7q/fn5fY5cAefo5V/hdqeBCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQggTYh4FrbLj2844BPAh8FTg4C81xucyewBygAeuRy4uhcrwF/6sx7Tw3lwMKT6LDtNDr7T2Sxf26GvRjwAvBP4G84Z0tmNLxivIwufJ9d5Mpodb/v7zNiPY4EJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAE2rRAqwgUPbyTgC8AnwMsQG+TYz7wEPAYUGeaPQr4MPCh4BWBQTl7VFvSln4I52wrdQ4F6Dkz10QSkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkMD7SOCQBegenlV/XwpMCtqzt0nWrcDdwKygR3yjH+IU4LPBqwPWqD43w8J029IcnLMt1hgK0HODrFkkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIIH3l0D9AXppaR6lpZX+I0f/vQkGHt5w4EqgJJNprNf4GnYzgA7EcWxhPz0pyuTWjK7ZxgG6UehfW0mCchK0J6/Be18G7gCmN3ilPYER5jd4JacDnw/CdDvpPXXsPQDxOBQ2vL/IrdOAO3HOtuwPC9C3056uHDyiveHNte0rttCRXmW7c/PCSH1/F+r6LJt72ja5di8BCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCCBNidQO1CcNPNo4lU/Ak7AeTvwXAc8twbnHUdl3jhmT9qVzVN6eFZf/W3g4kzvf43tXMW/6EIBf2Ud/+YcRvAgD3E653F4ptOkve6fbOBbvEARcZ7lc3ydefyW//AHPsWZ1N1XfRlwM3Bfg6sngEWA5dZ2lHsjOtPb+wHWzN7C9C8DO3fD3Bdg4Ttw3blwZO8GV09zwb3ALUyZftyR3pbfn83L/IY/ZDNPm7vnGYbyKa6BWGI40y5/JesHmDTzMPIqLwGOwnPjgd9QVlLmzze5bAKxxEA8Z9+Y/ZpcR1nJarK5J+sN6kYJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSKApAjUD9MllZ+K8J/DcNLZ3/W/mXlBOaWmMDX2/h+duIBHry8zJ7zZmQQ+vF3B9UHXemFv5DE9QwvF+oD2L15nAMfyOt/3wvEcOqtBLeI632MEznM1G9tKP+3iCM9MG6JuAHwdV55k/hIXoM4PDzhsRoEcXOAGYAHxmG9w2tykBejjrHeNLrrvyZFa1ugB9PV1ZS1fGszJz4gyutGr7uYyluPD8IqZ+7UAGt6S/ZHLZTJx3P2Ulz/qBufPuJq+yH55rT2XeLGYUn+Z3aljfbwUwl7KSb5DNPVlvUDdKQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAJNETgYoF9+Zzeq4quAFfTfMJrSUkt/D47JZc/iuYnMnGzhYEbDw7sK+CnQOaMbUi7qzN0NVoRnM294z38zD6tyf5qz2EE5XZmTNkC/Hfi+FYJntZidkN7ICvR06/TfBX1+B788F07LqgK9eta8kmv4CBt4thVVoO8jnzP4b67mWc5nYVbSDd3kymhaC/eSaU+SiC1hRvF3KJ4+FHgN532RRGwjzvs35QXdmHPpdoqn3w+Mo6zkWLK5p6EH0ecSkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkECzCBwMFIunX+6fle25S5lRPKfWapfNOI5YYj0wFRjmH/+diC3Eeb8hlojjuespK3ma4um39NhUOOL5x88teKRy5cfWsofx9OYuXuUIOvFTTuQJVnMfb/lnmc/k1Fpnmr/Bdn7CYu7jTT7NQAbRgV9wEovYwu94iy9zNKczkASeP6+1Y99DJcfSlR8yhnbEeYxVzOYNJnIsv+YVzmAgP2AMv+Zl/swaulHA62ynH+15MhKg38h4/sMO/sVGPs3R/IfR/IUYYDXo9u7APvDPDv8Y0A74D/AOcDzwFrANOBGqW8yHAfoQ8IPh7UBfwDrap+a5Nu/rwA7ACqUtKG8PWFZrnfN/B+3PhQsLoO+L0KcSThqS/OfNjfDnRfCpkbBtF7z4Fpx0DCx8GzZuh48Ng9NtTTt9/hpgC0f564xlLOuYzT104ABv+d/Vx/xK8G104G7mMMDfc3JUEqOEi1nCIE7jDW7hQd6hJ5O5hE/xOt/lz2yiE9/jPJYxgE/yOpfzDwbzHj/lLJ7jaH++…brB0xZVAGAtqpyy+87fNf4HUyf1sNzSz83GXvYnYKXM6qTDBVhJ29tL7uzrJF+rcOC5Dy8Hq5efB1QGSkNdigBLnWXzB/zn10h7RWRj1hcaCpHOK7cB1fwKc4cvBQCWL6UDjnPuTG//1SRguT7Vqy8CqoAWMXRFBQBWRaE0X3bu9kH/avgtoVv6ndkDVJq9tRY7wErc8bOvknxFBt+/csByS787LgGqxK1PMj2AlaStg6TOvmLQv3JLv9f+FVAlbnnS6QGspO0VOXerbBaF/PoNfwNUiVttIj2AlbjNZ2+W9l2XgVXiNptJD2CZsZpEUUC/AgBLv4dkgAJmFABYZqwmURTQrwDA0u8hGaCAGQUAlhmrSRQF9CsAsPR7SAYoYEYBgGXGahJFAf0K/B9qEBa1B23aowAAAABJRU5ErkJggg==","extensions:ANGLE_instanced_arrays;EXT_blend_minmax;EXT_color_buffer_half_float;EXT_disjoint_timer_query;EXT_float_blend;EXT_frag_depth;EXT_shader_texture_lod;EXT_texture_compression_rgtc;EXT_texture_filter_anisotropic;EXT_sRGB;KHR_parallel_shader_compile;OES_element_index_uint;OES_fbo_render_mipmap;OES_standard_derivatives;OES_texture_float;OES_texture_float_linear;OES_texture_half_float;OES_texture_half_float_linear;OES_vertex_array_object;WEBGL_color_buffer_float;WEBGL_compressed_texture_s3tc;WEBGL_compressed_texture_s3tc_srgb;WEBGL_debug_renderer_info;WEBGL_debug_shaders;WEBGL_depth_texture;WEBGL_draw_buffers;WEBGL_lose_context;WEBGL_multi_draw","webgl aliased line width range:[1, 1]","webgl aliased point size range:[1, 8191]","webgl alpha bits:8","webgl antialiasing:yes","webgl blue bits:8","webgl depth bits:24","webgl green bits:8","webgl max anisotropy:16","webgl max combined texture image units:32","webgl max cube map texture size:16384","webgl max fragment uniform vectors:1024","webgl max render buffer size:16384","webgl max texture image units:16","webgl max texture size:16384","webgl max varying vectors:32","webgl max vertex attribs:16","webgl max vertex texture image units:16","webgl max vertex uniform vectors:1024","webgl max viewport dims:[16384, 16384]","webgl red bits:8","webgl renderer:WebKit WebGL","webgl shading language version:WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium)","webgl stencil bits:0","webgl vendor:WebKit","webgl version:WebGL 1.0 (OpenGL ES 2.0 Chromium)","webgl unmasked vendor:Google Inc. (ATI Technologies Inc.)","webgl unmasked renderer:ANGLE (ATI Technologies Inc., AMD Radeon Pro 560X OpenGL Engine, OpenGL 4.1)","webgl vertex shader high float precision:23","webgl vertex shader high float precision rangeMin:127","webgl vertex shader high float precision rangeMax:127","webgl vertex shader medium float precision:23","webgl vertex shader medium float precision rangeMin:127","webgl vertex shader medium float precision rangeMax:127","webgl vertex shader low float precision:23","webgl vertex shader low float precision rangeMin:127","webgl vertex shader low float precision rangeMax:127","webgl fragment shader high float precision:23","webgl fragment shader high float precision rangeMin:127","webgl fragment shader high float precision rangeMax:127","webgl fragment shader medium float precision:23","webgl fragment shader medium float precision rangeMin:127","webgl fragment shader medium float precision rangeMax:127","webgl fragment shader low float precision:23","webgl fragment shader low float precision rangeMin:127","webgl fragment shader low float precision rangeMax:127","webgl vertex shader high int precision:0","webgl vertex shader high int precision rangeMin:31","webgl vertex shader high int precision rangeMax:30","webgl vertex shader medium int precision:0","webgl vertex shader medium int precision rangeMin:31","webgl vertex shader medium int precision rangeMax:30","webgl vertex shader low int precision:0","webgl vertex shader low int precision rangeMin:31","webgl vertex shader low int precision rangeMax:30","webgl fragment shader high int precision:0","webgl fragment shader high int precision rangeMin:31","webgl fragment shader high int precision rangeMax:30","webgl fragment shader medium int precision:0","webgl fragment shader medium int precision rangeMin:31","webgl fragment shader medium int precision rangeMax:30","webgl fragment shader low int precision:0","webgl fragment shader low int precision rangeMin:31","webgl fragment shader low int precision rangeMax:30"],webgl_vendor_and_renderer:"Google Inc. (ATI Technologies Inc.)~ANGLE (ATI Technologies Inc., AMD Radeon Pro 560X OpenGL Engine, OpenGL 4.1)",ad_block:!1,has_lied_languages:!1,has_lied_resolution:!1,has_lied_os:!1,has_lied_browser:!1,touch_support:[0,!1,!1],fonts:["Andale Mono","Arial","Arial Black","Arial Hebrew","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","Comic Sans MS","Courier","Courier New","Geneva","Georgia","Helvetica","Helvetica Neue","Impact","LUCIDA GRANDE","Microsoft Sans Serif","Monaco","Palatino","Tahoma","Times","Times New Roman","Trebuchet MS","Verdana","Wingdings","Wingdings 2","Wingdings 3"],fonts_flash:"swf object not loaded",audio:"124.04347657808103",enumerate_devices:["id=;gid=;audioinput;","id=;gid=;videoinput;","id=;gid=;audiooutput;"]}},policy_request_id:"LoginWithMenu",params:{}}},lu=[{"control_flow.0":["assertion_id","type"]}];class hu extends Error{constructor(e,t){tu.error(`[ERROR] ${e}`),super(e),this.description=e,this.errorCode=t}static convertFromAssertionError(e){switch(e){case 28:return Yd.ClientResponseNotValid;case 29:case 31:case 35:return Yd.InvalidCredentials;case 30:return Yd.ExpiredOTPPasscode;case 32:return Yd.ExpiredValidationPasscode;case 33:return Yd.MaxResendReached;default:return Yd.ServerError}}}var fu,pu,gu;!function(e){e.JsonRejection="Json Rejection",e.TextRejection="Text Rejection",e.UpdateAction="Update Action",e.NextAction="Next Action",e.JourneyEnd="Journey End"}(fu||(fu={})),function(e){e.Pending="pending",e.Completed="completed",e.Rejected="rejected"}(pu||(pu={})),function(e){e.Form="form",e.LoginForm="login_form",e.Rejection="rejection",e.Information="information",e.DebugBreak="debug_break",e.WaitForTicket="wait_for_ticket",e.DrsTriggerAction="transmit_acp",e.IdentityVerification="kyc",e.WebAuthnRegistration="transmit_platform_web_authn_registration"}(gu||(gu={}));var mu={},bu="6.6.1",vu={},yu={},_u={get exports(){return yu},set exports(e){yu=e}},wu=X(So);!function(e){!function(e,t){function i(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}function n(e,t,i){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(i=t,t=10),this._init(e||0,t||10,i||"be"))}var a;"object"==typeof e?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:wu.Buffer}catch(e){}function o(e,t){var i=e.charCodeAt(t);return i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:i-48&15}function s(e,t,i){var r=o(e,i);return i-1>=t&&(r|=o(e,i-1)<<4),r}function c(e,t,i,r){for(var n=0,a=Math.min(e.length,i),o=t;o<a;o++){var s=e.charCodeAt(o)-48;n*=r,n+=s>=49?s-49+10:s>=17?s-17+10:s}return n}n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return e.cmp(t)<0?e:t},n.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,r):(this._parseBase(e,t,n),"le"===r&&this._initArray(this.toArray(),t,r)))},n.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(i(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},n.prototype._initArray=function(e,t,r){if(i("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var a,o,s=0;if("be"===r)for(n=e.length-1,a=0;n>=0;n-=3)o=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(n=0,a=0;n<e.length;n+=3)o=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},n.prototype._parseHex=function(e,t,i){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,a=0,o=0;if("be"===i)for(r=e.length-1;r>=t;r-=2)n=s(e,t,r)<<a,this.words[o]|=67108863&n,a>=18?(a-=18,o+=1,this.words[o]|=n>>>26):a+=8;else for(r=(e.length-t)%2==0?t+1:t;r<e.length;r+=2)n=s(e,t,r)<<a,this.words[o]|=67108863&n,a>=18?(a-=18,o+=1,this.words[o]|=n>>>26):a+=8;this.strip()},n.prototype._parseBase=function(e,t,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var a=e.length-i,o=a%r,s=Math.min(a,a-o)+i,d=0,u=i;u<s;u+=r)d=c(e,u,u+r,t),this.imuln(n),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(0!==o){var l=1;for(d=c(e,u,e.length,t),u=0;u<o;u++)l*=t;this.imuln(l),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}this.strip()},n.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,i){i.negative=t.negative^e.negative;var r=e.length+t.length|0;i.length=r,r=r-1|0;var n=0|e.words[0],a=0|t.words[0],o=n*a,s=67108863&o,c=o/67108864|0;i.words[0]=s;for(var d=1;d<r;d++){for(var u=c>>>26,l=67108863&c,h=Math.min(d,t.length-1),f=Math.max(0,d-e.length+1);f<=h;f++){var p=d-f|0;u+=(o=(n=0|e.words[p])*(a=0|t.words[f])+l)/67108864|0,l=67108863&o}i.words[d]=0|l,c=0|u}return 0!==c?i.words[d]=0|c:i.length--,i.strip()}n.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,a=0,o=0;o<this.length;o++){var s=this.words[o],c=(16777215&(s<<n|a)).toString(16);a=s>>>24-n&16777215,(n+=2)>=26&&(n-=26,o--),r=0!==a||o!==this.length-1?d[6-c.length]+c+r:c+r}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var h=u[e],f=l[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?g+r:d[h-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,t){return i(void 0!==a),this.toArrayLike(a,e,t)},n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,r){var n=this.byteLength(),a=r||Math.max(1,n);i(n<=a,"byte array longer than desired length"),i(a>0,"Requested array length <= 0"),this.strip();var o,s,c="le"===t,d=new e(a),u=this.clone();if(c){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),d[s]=o;for(;s<a;s++)d[s]=0}else{for(s=0;s<a-n;s++)d[s]=0;for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),d[a-s-1]=o}return d},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var t=e,i=0;return t>=4096&&(i+=13,t>>>=13),t>=64&&(i+=7,t>>>=7),t>=8&&(i+=4,t>>>=4),t>=2&&(i+=2,t>>>=2),i+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,i=0;return 0==(8191&t)&&(i+=13,t>>>=13),0==(127&t)&&(i+=7,t>>>=7),0==(15&t)&&(i+=4,t>>>=4),0==(3&t)&&(i+=2,t>>>=2),0==(1&t)&&i++,i},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var i=this._zeroBits(this.words[t]);if(e+=i,26!==i)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},n.prototype.ior=function(e){return i(0==(this.negative|e.negative)),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var i=0;i<t.length;i++)this.words[i]=this.words[i]&e.words[i];return this.length=t.length,this.strip()},n.prototype.iand=function(e){return i(0==(this.negative|e.negative)),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,i;this.length>e.length?(t=this,i=e):(t=e,i=this);for(var r=0;r<i.length;r++)this.words[r]=t.words[r]^i.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this.strip()},n.prototype.ixor=function(e){return i(0==(this.negative|e.negative)),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},n.prototype.iadd=function(e){var t,i,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(i=this,r=e):(i=e,r=this);for(var n=0,a=0;a<r.length;a++)t=(0|i.words[a])+(0|r.words[a])+n,this.words[a]=67108863&t,n=t>>>26;for(;0!==n&&a<i.length;a++)t=(0|i.words[a])+n,this.words[a]=67108863&t,n=t>>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;a<i.length;a++)this.words[a]=i.words[a];return this},n.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=e):(i=e,r=this);for(var a=0,o=0;o<r.length;o++)a=(t=(0|i.words[o])-(0|r.words[o])+a)>>26,this.words[o]=67108863&t;for(;0!==a&&o<i.length;o++)a=(t=(0|i.words[o])+a)>>26,this.words[o]=67108863&t;if(0===a&&o<i.length&&i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this.length=Math.max(this.length,o),i!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(e){return this.clone().isub(e)};var f=function(e,t,i){var r,n,a,o=e.words,s=t.words,c=i.words,d=0,u=0|o[0],l=8191&u,h=u>>>13,f=0|o[1],p=8191&f,g=f>>>13,m=0|o[2],b=8191&m,v=m>>>13,y=0|o[3],_=8191&y,w=y>>>13,x=0|o[4],A=8191&x,E=x>>>13,S=0|o[5],k=8191&S,M=S>>>13,C=0|o[6],I=8191&C,D=C>>>13,T=0|o[7],R=8191&T,z=T>>>13,B=0|o[8],P=8191&B,O=B>>>13,F=0|o[9],N=8191&F,L=F>>>13,j=0|s[0],U=8191&j,q=j>>>13,K=0|s[1],H=8191&K,V=K>>>13,$=0|s[2],J=8191&$,G=$>>>13,W=0|s[3],Z=8191&W,Y=W>>>13,Q=0|s[4],X=8191&Q,ee=Q>>>13,te=0|s[5],ie=8191&te,re=te>>>13,ne=0|s[6],ae=8191&ne,oe=ne>>>13,se=0|s[7],ce=8191&se,de=se>>>13,ue=0|s[8],le=8191&ue,he=ue>>>13,fe=0|s[9],pe=8191&fe,ge=fe>>>13;i.negative=e.negative^t.negative,i.length=19;var me=(d+(r=Math.imul(l,U))|0)+((8191&(n=(n=Math.imul(l,q))+Math.imul(h,U)|0))<<13)|0;d=((a=Math.imul(h,q))+(n>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(p,U),n=(n=Math.imul(p,q))+Math.imul(g,U)|0,a=Math.imul(g,q);var be=(d+(r=r+Math.imul(l,H)|0)|0)+((8191&(n=(n=n+Math.imul(l,V)|0)+Math.imul(h,H)|0))<<13)|0;d=((a=a+Math.imul(h,V)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(b,U),n=(n=Math.imul(b,q))+Math.imul(v,U)|0,a=Math.imul(v,q),r=r+Math.imul(p,H)|0,n=(n=n+Math.imul(p,V)|0)+Math.imul(g,H)|0,a=a+Math.imul(g,V)|0;var ve=(d+(r=r+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,G)|0)+Math.imul(h,J)|0))<<13)|0;d=((a=a+Math.imul(h,G)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(_,U),n=(n=Math.imul(_,q))+Math.imul(w,U)|0,a=Math.imul(w,q),r=r+Math.imul(b,H)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(v,H)|0,a=a+Math.imul(v,V)|0,r=r+Math.imul(p,J)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(g,J)|0,a=a+Math.imul(g,G)|0;var ye=(d+(r=r+Math.imul(l,Z)|0)|0)+((8191&(n=(n=n+Math.imul(l,Y)|0)+Math.imul(h,Z)|0))<<13)|0;d=((a=a+Math.imul(h,Y)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(A,U),n=(n=Math.imul(A,q))+Math.imul(E,U)|0,a=Math.imul(E,q),r=r+Math.imul(_,H)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,H)|0,a=a+Math.imul(w,V)|0,r=r+Math.imul(b,J)|0,n=(n=n+Math.imul(b,G)|0)+Math.imul(v,J)|0,a=a+Math.imul(v,G)|0,r=r+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(g,Z)|0,a=a+Math.imul(g,Y)|0;var _e=(d+(r=r+Math.imul(l,X)|0)|0)+((8191&(n=(n=n+Math.imul(l,ee)|0)+Math.imul(h,X)|0))<<13)|0;d=((a=a+Math.imul(h,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(k,U),n=(n=Math.imul(k,q))+Math.imul(M,U)|0,a=Math.imul(M,q),r=r+Math.imul(A,H)|0,n=(n=n+Math.imul(A,V)|0)+Math.imul(E,H)|0,a=a+Math.imul(E,V)|0,r=r+Math.imul(_,J)|0,n=(n=n+Math.imul(_,G)|0)+Math.imul(w,J)|0,a=a+Math.imul(w,G)|0,r=r+Math.imul(b,Z)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(v,Z)|0,a=a+Math.imul(v,Y)|0,r=r+Math.imul(p,X)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(g,X)|0,a=a+Math.imul(g,ee)|0;var we=(d+(r=r+Math.imul(l,ie)|0)|0)+((8191&(n=(n=n+Math.imul(l,re)|0)+Math.imul(h,ie)|0))<<13)|0;d=((a=a+Math.imul(h,re)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(I,U),n=(n=Math.imul(I,q))+Math.imul(D,U)|0,a=Math.imul(D,q),r=r+Math.imul(k,H)|0,n=(n=n+Math.imul(k,V)|0)+Math.imul(M,H)|0,a=a+Math.imul(M,V)|0,r=r+Math.imul(A,J)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(E,J)|0,a=a+Math.imul(E,G)|0,r=r+Math.imul(_,Z)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(w,Z)|0,a=a+Math.imul(w,Y)|0,r=r+Math.imul(b,X)|0,n=(n=n+Math.imul(b,ee)|0)+Math.imul(v,X)|0,a=a+Math.imul(v,ee)|0,r=r+Math.imul(p,ie)|0,n=(n=n+Math.imul(p,re)|0)+Math.imul(g,ie)|0,a=a+Math.imul(g,re)|0;var xe=(d+(r=r+Math.imul(l,ae)|0)|0)+((8191&(n=(n=n+Math.imul(l,oe)|0)+Math.imul(h,ae)|0))<<13)|0;d=((a=a+Math.imul(h,oe)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(R,U),n=(n=Math.imul(R,q))+Math.imul(z,U)|0,a=Math.imul(z,q),r=r+Math.imul(I,H)|0,n=(n=n+Math.imul(I,V)|0)+Math.imul(D,H)|0,a=a+Math.imul(D,V)|0,r=r+Math.imul(k,J)|0,n=(n=n+Math.imul(k,G)|0)+Math.imul(M,J)|0,a=a+Math.imul(M,G)|0,r=r+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,Y)|0)+Math.imul(E,Z)|0,a=a+Math.imul(E,Y)|0,r=r+Math.imul(_,X)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,X)|0,a=a+Math.imul(w,ee)|0,r=r+Math.imul(b,ie)|0,n=(n=n+Math.imul(b,re)|0)+Math.imul(v,ie)|0,a=a+Math.imul(v,re)|0,r=r+Math.imul(p,ae)|0,n=(n=n+Math.imul(p,oe)|0)+Math.imul(g,ae)|0,a=a+Math.imul(g,oe)|0;var Ae=(d+(r=r+Math.imul(l,ce)|0)|0)+((8191&(n=(n=n+Math.imul(l,de)|0)+Math.imul(h,ce)|0))<<13)|0;d=((a=a+Math.imul(h,de)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(P,U),n=(n=Math.imul(P,q))+Math.imul(O,U)|0,a=Math.imul(O,q),r=r+Math.imul(R,H)|0,n=(n=n+Math.imul(R,V)|0)+Math.imul(z,H)|0,a=a+Math.imul(z,V)|0,r=r+Math.imul(I,J)|0,n=(n=n+Math.imul(I,G)|0)+Math.imul(D,J)|0,a=a+Math.imul(D,G)|0,r=r+Math.imul(k,Z)|0,n=(n=n+Math.imul(k,Y)|0)+Math.imul(M,Z)|0,a=a+Math.imul(M,Y)|0,r=r+Math.imul(A,X)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(E,X)|0,a=a+Math.imul(E,ee)|0,r=r+Math.imul(_,ie)|0,n=(n=n+Math.imul(_,re)|0)+Math.imul(w,ie)|0,a=a+Math.imul(w,re)|0,r=r+Math.imul(b,ae)|0,n=(n=n+Math.imul(b,oe)|0)+Math.imul(v,ae)|0,a=a+Math.imul(v,oe)|0,r=r+Math.imul(p,ce)|0,n=(n=n+Math.imul(p,de)|0)+Math.imul(g,ce)|0,a=a+Math.imul(g,de)|0;var Ee=(d+(r=r+Math.imul(l,le)|0)|0)+((8191&(n=(n=n+Math.imul(l,he)|0)+Math.imul(h,le)|0))<<13)|0;d=((a=a+Math.imul(h,he)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(N,U),n=(n=Math.imul(N,q))+Math.imul(L,U)|0,a=Math.imul(L,q),r=r+Math.imul(P,H)|0,n=(n=n+Math.imul(P,V)|0)+Math.imul(O,H)|0,a=a+Math.imul(O,V)|0,r=r+Math.imul(R,J)|0,n=(n=n+Math.imul(R,G)|0)+Math.imul(z,J)|0,a=a+Math.imul(z,G)|0,r=r+Math.imul(I,Z)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(D,Z)|0,a=a+Math.imul(D,Y)|0,r=r+Math.imul(k,X)|0,n=(n=n+Math.imul(k,ee)|0)+Math.imul(M,X)|0,a=a+Math.imul(M,ee)|0,r=r+Math.imul(A,ie)|0,n=(n=n+Math.imul(A,re)|0)+Math.imul(E,ie)|0,a=a+Math.imul(E,re)|0,r=r+Math.imul(_,ae)|0,n=(n=n+Math.imul(_,oe)|0)+Math.imul(w,ae)|0,a=a+Math.imul(w,oe)|0,r=r+Math.imul(b,ce)|0,n=(n=n+Math.imul(b,de)|0)+Math.imul(v,ce)|0,a=a+Math.imul(v,de)|0,r=r+Math.imul(p,le)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(g,le)|0,a=a+Math.imul(g,he)|0;var Se=(d+(r=r+Math.imul(l,pe)|0)|0)+((8191&(n=(n=n+Math.imul(l,ge)|0)+Math.imul(h,pe)|0))<<13)|0;d=((a=a+Math.imul(h,ge)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(N,H),n=(n=Math.imul(N,V))+Math.imul(L,H)|0,a=Math.imul(L,V),r=r+Math.imul(P,J)|0,n=(n=n+Math.imul(P,G)|0)+Math.imul(O,J)|0,a=a+Math.imul(O,G)|0,r=r+Math.imul(R,Z)|0,n=(n=n+Math.imul(R,Y)|0)+Math.imul(z,Z)|0,a=a+Math.imul(z,Y)|0,r=r+Math.imul(I,X)|0,n=(n=n+Math.imul(I,ee)|0)+Math.imul(D,X)|0,a=a+Math.imul(D,ee)|0,r=r+Math.imul(k,ie)|0,n=(n=n+Math.imul(k,re)|0)+Math.imul(M,ie)|0,a=a+Math.imul(M,re)|0,r=r+Math.imul(A,ae)|0,n=(n=n+Math.imul(A,oe)|0)+Math.imul(E,ae)|0,a=a+Math.imul(E,oe)|0,r=r+Math.imul(_,ce)|0,n=(n=n+Math.imul(_,de)|0)+Math.imul(w,ce)|0,a=a+Math.imul(w,de)|0,r=r+Math.imul(b,le)|0,n=(n=n+Math.imul(b,he)|0)+Math.imul(v,le)|0,a=a+Math.imul(v,he)|0;var ke=(d+(r=r+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,ge)|0)+Math.imul(g,pe)|0))<<13)|0;d=((a=a+Math.imul(g,ge)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(N,J),n=(n=Math.imul(N,G))+Math.imul(L,J)|0,a=Math.imul(L,G),r=r+Math.imul(P,Z)|0,n=(n=n+Math.imul(P,Y)|0)+Math.imul(O,Z)|0,a=a+Math.imul(O,Y)|0,r=r+Math.imul(R,X)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(z,X)|0,a=a+Math.imul(z,ee)|0,r=r+Math.imul(I,ie)|0,n=(n=n+Math.imul(I,re)|0)+Math.imul(D,ie)|0,a=a+Math.imul(D,re)|0,r=r+Math.imul(k,ae)|0,n=(n=n+Math.imul(k,oe)|0)+Math.imul(M,ae)|0,a=a+Math.imul(M,oe)|0,r=r+Math.imul(A,ce)|0,n=(n=n+Math.imul(A,de)|0)+Math.imul(E,ce)|0,a=a+Math.imul(E,de)|0,r=r+Math.imul(_,le)|0,n=(n=n+Math.imul(_,he)|0)+Math.imul(w,le)|0,a=a+Math.imul(w,he)|0;var Me=(d+(r=r+Math.imul(b,pe)|0)|0)+((8191&(n=(n=n+Math.imul(b,ge)|0)+Math.imul(v,pe)|0))<<13)|0;d=((a=a+Math.imul(v,ge)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(N,Z),n=(n=Math.imul(N,Y))+Math.imul(L,Z)|0,a=Math.imul(L,Y),r=r+Math.imul(P,X)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(O,X)|0,a=a+Math.imul(O,ee)|0,r=r+Math.imul(R,ie)|0,n=(n=n+Math.imul(R,re)|0)+Math.imul(z,ie)|0,a=a+Math.imul(z,re)|0,r=r+Math.imul(I,ae)|0,n=(n=n+Math.imul(I,oe)|0)+Math.imul(D,ae)|0,a=a+Math.imul(D,oe)|0,r=r+Math.imul(k,ce)|0,n=(n=n+Math.imul(k,de)|0)+Math.imul(M,ce)|0,a=a+Math.imul(M,de)|0,r=r+Math.imul(A,le)|0,n=(n=n+Math.imul(A,he)|0)+Math.imul(E,le)|0,a=a+Math.imul(E,he)|0;var Ce=(d+(r=r+Math.imul(_,pe)|0)|0)+((8191&(n=(n=n+Math.imul(_,ge)|0)+Math.imul(w,pe)|0))<<13)|0;d=((a=a+Math.imul(w,ge)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(N,X),n=(n=Math.imul(N,ee))+Math.imul(L,X)|0,a=Math.imul(L,ee),r=r+Math.imul(P,ie)|0,n=(n=n+Math.imul(P,re)|0)+Math.imul(O,ie)|0,a=a+Math.imul(O,re)|0,r=r+Math.imul(R,ae)|0,n=(n=n+Math.imul(R,oe)|0)+Math.imul(z,ae)|0,a=a+Math.imul(z,oe)|0,r=r+Math.imul(I,ce)|0,n=(n=n+Math.imul(I,de)|0)+Math.imul(D,ce)|0,a=a+Math.imul(D,de)|0,r=r+Math.imul(k,le)|0,n=(n=n+Math.imul(k,he)|0)+Math.imul(M,le)|0,a=a+Math.imul(M,he)|0;var Ie=(d+(r=r+Math.imul(A,pe)|0)|0)+((8191&(n=(n=n+Math.imul(A,ge)|0)+Math.imul(E,pe)|0))<<13)|0;d=((a=a+Math.imul(E,ge)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(N,ie),n=(n=Math.imul(N,re))+Math.imul(L,ie)|0,a=Math.imul(L,re),r=r+Math.imul(P,ae)|0,n=(n=n+Math.imul(P,oe)|0)+Math.imul(O,ae)|0,a=a+Math.imul(O,oe)|0,r=r+Math.imul(R,ce)|0,n=(n=n+Math.imul(R,de)|0)+Math.imul(z,ce)|0,a=a+Math.imul(z,de)|0,r=r+Math.imul(I,le)|0,n=(n=n+Math.imul(I,he)|0)+Math.imul(D,le)|0,a=a+Math.imul(D,he)|0;var De=(d+(r=r+Math.imul(k,pe)|0)|0)+((8191&(n=(n=n+Math.imul(k,ge)|0)+Math.imul(M,pe)|0))<<13)|0;d=((a=a+Math.imul(M,ge)|0)+(n>>>13)|0)+(De>>>26)|0,De&=67108863,r=Math.imul(N,ae),n=(n=Math.imul(N,oe))+Math.imul(L,ae)|0,a=Math.imul(L,oe),r=r+Math.imul(P,ce)|0,n=(n=n+Math.imul(P,de)|0)+Math.imul(O,ce)|0,a=a+Math.imul(O,de)|0,r=r+Math.imul(R,le)|0,n=(n=n+Math.imul(R,he)|0)+Math.imul(z,le)|0,a=a+Math.imul(z,he)|0;var Te=(d+(r=r+Math.imul(I,pe)|0)|0)+((8191&(n=(n=n+Math.imul(I,ge)|0)+Math.imul(D,pe)|0))<<13)|0;d=((a=a+Math.imul(D,ge)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(N,ce),n=(n=Math.imul(N,de))+Math.imul(L,ce)|0,a=Math.imul(L,de),r=r+Math.imul(P,le)|0,n=(n=n+Math.imul(P,he)|0)+Math.imul(O,le)|0,a=a+Math.imul(O,he)|0;var Re=(d+(r=r+Math.imul(R,pe)|0)|0)+((8191&(n=(n=n+Math.imul(R,ge)|0)+Math.imul(z,pe)|0))<<13)|0;d=((a=a+Math.imul(z,ge)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(N,le),n=(n=Math.imul(N,he))+Math.imul(L,le)|0,a=Math.imul(L,he);var ze=(d+(r=r+Math.imul(P,pe)|0)|0)+((8191&(n=(n=n+Math.imul(P,ge)|0)+Math.imul(O,pe)|0))<<13)|0;d=((a=a+Math.imul(O,ge)|0)+(n>>>13)|0)+(ze>>>26)|0,ze&=67108863;var Be=(d+(r=Math.imul(N,pe))|0)+((8191&(n=(n=Math.imul(N,ge))+Math.imul(L,pe)|0))<<13)|0;return d=((a=Math.imul(L,ge))+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,c[0]=me,c[1]=be,c[2]=ve,c[3]=ye,c[4]=_e,c[5]=we,c[6]=xe,c[7]=Ae,c[8]=Ee,c[9]=Se,c[10]=ke,c[11]=Me,c[12]=Ce,c[13]=Ie,c[14]=De,c[15]=Te,c[16]=Re,c[17]=ze,c[18]=Be,0!==d&&(c[19]=d,i.length++),i};function p(e,t,i){return(new g).mulp(e,t,i)}function g(e,t){this.x=e,this.y=t}Math.imul||(f=h),n.prototype.mulTo=function(e,t){var i,r=this.length+e.length;return i=10===this.length&&10===e.length?f(this,e,t):r<63?h(this,e,t):r<1024?function(e,t,i){i.negative=t.negative^e.negative,i.length=e.length+t.length;for(var r=0,n=0,a=0;a<i.length-1;a++){var o=n;n=0;for(var s=67108863&r,c=Math.min(a,t.length-1),d=Math.max(0,a-e.length+1);d<=c;d++){var u=a-d,l=(0|e.words[u])*(0|t.words[d]),h=67108863&l;s=67108863&(h=h+s|0),n+=(o=(o=o+(l/67108864|0)|0)+(h>>>26)|0)>>>26,o&=67108863}i.words[a]=s,r=o,o=n}return 0!==r?i.words[a]=r:i.length--,i.strip()}(this,e,t):p(this,e,t),i},g.prototype.makeRBT=function(e){for(var t=new Array(e),i=n.prototype._countBits(e)-1,r=0;r<e;r++)t[r]=this.revBin(r,i,e);return t},g.prototype.revBin=function(e,t,i){if(0===e||e===i-1)return e;for(var r=0,n=0;n<t;n++)r|=(1&e)<<t-n-1,e>>=1;return r},g.prototype.permute=function(e,t,i,r,n,a){for(var o=0;o<a;o++)r[o]=t[e[o]],n[o]=i[e[o]]},g.prototype.transform=function(e,t,i,r,n,a){this.permute(a,e,t,i,r,n);for(var o=1;o<n;o<<=1)for(var s=o<<1,c=Math.cos(2*Math.PI/s),d=Math.sin(2*Math.PI/s),u=0;u<n;u+=s)for(var l=c,h=d,f=0;f<o;f++){var p=i[u+f],g=r[u+f],m=i[u+f+o],b=r[u+f+o],v=l*m-h*b;b=l*b+h*m,m=v,i[u+f]=p+m,r[u+f]=g+b,i[u+f+o]=p-m,r[u+f+o]=g-b,f!==s&&(v=c*l-d*h,h=c*h+d*l,l=v)}},g.prototype.guessLen13b=function(e,t){var i=1|Math.max(t,e),r=1&i,n=0;for(i=i/2|0;i;i>>>=1)n++;return 1<<n+1+r},g.prototype.conjugate=function(e,t,i){if(!(i<=1))for(var r=0;r<i/2;r++){var n=e[r];e[r]=e[i-r-1],e[i-r-1]=n,n=t[r],t[r]=-t[i-r-1],t[i-r-1]=-n}},g.prototype.normalize13b=function(e,t){for(var i=0,r=0;r<t/2;r++){var n=8192*Math.round(e[2*r+1]/t)+Math.round(e[2*r]/t)+i;e[r]=67108863&n,i=n<67108864?0:n/67108864|0}return e},g.prototype.convert13b=function(e,t,r,n){for(var a=0,o=0;o<t;o++)a+=0|e[o],r[2*o]=8191&a,a>>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*t;o<n;++o)r[o]=0;i(0===a),i(0==(-8192&a))},g.prototype.stub=function(e){for(var t=new Array(e),i=0;i<e;i++)t[i]=0;return t},g.prototype.mulp=function(e,t,i){var r=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(r),a=this.stub(r),o=new Array(r),s=new Array(r),c=new Array(r),d=new Array(r),u=new Array(r),l=new Array(r),h=i.words;h.length=r,this.convert13b(e.words,e.length,o,r),this.convert13b(t.words,t.length,d,r),this.transform(o,a,s,c,r,n),this.transform(d,a,u,l,r,n);for(var f=0;f<r;f++){var p=s[f]*u[f]-c[f]*l[f];c[f]=s[f]*l[f]+c[f]*u[f],s[f]=p}return this.conjugate(s,c,r),this.transform(s,c,h,a,r,n),this.conjugate(h,a,r),this.normalize13b(h,r),i.negative=e.negative^t.negative,i.length=e.length+t.length,i.strip()},n.prototype.mul=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},n.prototype.mulf=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),p(this,e,t)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){i("number"==typeof e),i(e<67108864);for(var t=0,r=0;r<this.length;r++){var n=(0|this.words[r])*e,a=(67108863&n)+(67108863&t);t>>=26,t+=n/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),i=0;i<t.length;i++){var r=i/26|0,n=i%26;t[i]=(e.words[r]&1<<n)>>>n}return t}(e);if(0===t.length)return new n(1);for(var i=this,r=0;r<t.length&&0===t[r];r++,i=i.sqr());if(++r<t.length)for(var a=i.sqr();r<t.length;r++,a=a.sqr())0!==t[r]&&(i=i.mul(a));return i},n.prototype.iushln=function(e){i("number"==typeof e&&e>=0);var t,r=e%26,n=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t<this.length;t++){var s=this.words[t]&a,c=(0|this.words[t])-s<<r;this.words[t]=c|o,o=s>>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this.strip()},n.prototype.ishln=function(e){return i(0===this.negative),this.iushln(e)},n.prototype.iushrn=function(e,t,r){var n;i("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<<a,c=r;if(n-=o,n=Math.max(0,n),c){for(var d=0;d<o;d++)c.words[d]=this.words[d];c.length=o}if(0===o);else if(this.length>o)for(this.length-=o,d=0;d<this.length;d++)this.words[d]=this.words[d+o];else this.words[0]=0,this.length=1;var u=0;for(d=this.length-1;d>=0&&(0!==u||d>=n);d--){var l=0|this.words[d];this.words[d]=u<<26-a|l>>>a,u=l&s}return c&&0!==u&&(c.words[c.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<<t;return!(this.length<=r)&&!!(this.words[r]&n)},n.prototype.imaskn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this.strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return i("number"==typeof e),i(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,t,r){var n,a,o=e.length+r;this._expand(o);var s=0;for(n=0;n<e.length;n++){a=(0|this.words[n+r])+s;var c=(0|e.words[n])*t;s=((a-=67108863&c)>>26)-(c/67108864|0),this.words[n+r]=67108863&a}for(;n<this.length-r;n++)s=(a=(0|this.words[n+r])+s)>>26,this.words[n+r]=67108863&a;if(0===s)return this.strip();for(i(-1===s),s=0,n=0;n<this.length;n++)s=(a=-(0|this.words[n])+s)>>26,this.words[n]=67108863&a;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,t){var i=(this.length,e.length),r=this.clone(),a=e,o=0|a.words[a.length-1];0!==(i=26-this._countBits(o))&&(a=a.ushln(i),r.iushln(i),o=0|a.words[a.length-1]);var s,c=r.length-a.length;if("mod"!==t){(s=new n(null)).length=c+1,s.words=new Array(s.length);for(var d=0;d<s.length;d++)s.words[d]=0}var u=r.clone()._ishlnsubmul(a,1,c);0===u.negative&&(r=u,s&&(s.words[c]=1));for(var l=c-1;l>=0;l--){var h=67108864*(0|r.words[a.length+l])+(0|r.words[a.length+l-1]);for(h=Math.min(h/o|0,67108863),r._ishlnsubmul(a,h,l);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(a,1,l),r.isZero()||(r.negative^=1);s&&(s.words[l]=h)}return s&&s.strip(),r.strip(),"div"!==t&&0!==i&&r.iushrn(i),{div:s||null,mod:r}},n.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(a=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:a,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(a=s.div.neg()),{div:a,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,t);var a,o,s},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var i=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),a=i.cmp(r);return a<0||1===n&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modn=function(e){i(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},n.prototype.idivn=function(e){i(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new n(1),o=new n(0),s=new n(0),c=new n(1),d=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++d;for(var u=r.clone(),l=t.clone();!t.isZero();){for(var h=0,f=1;0==(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(u),o.isub(l)),a.iushrn(1),o.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(u),c.isub(l)),s.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s),o.isub(c)):(r.isub(t),s.isub(a),c.isub(o))}return{a:s,b:c,gcd:r.iushln(d)}},n.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,o=new n(1),s=new n(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var d=0,u=1;0==(t.words[0]&u)&&d<26;++d,u<<=1);if(d>0)for(t.iushrn(d);d-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);for(var l=0,h=1;0==(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s)):(r.isub(t),s.isub(o))}return(a=0===t.cmpn(1)?o:s).cmpn(0)<0&&a.iadd(e),a},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),i=e.clone();t.negative=0,i.negative=0;for(var r=0;t.isEven()&&i.isEven();r++)t.iushrn(1),i.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=t.cmp(i);if(n<0){var a=t;t=i,i=a}else if(0===n||0===i.cmpn(1))break;t.isub(i)}return i.iushln(r)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return 0==(1&this.words[0])},n.prototype.isOdd=function(){return 1==(1&this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var a=n,o=r;0!==a&&o<this.length;o++){var s=0|this.words[o];a=(s+=a)>>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},n.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,i=this.length-1;i>=0;i--){var r=0|this.words[i],n=0|e.words[i];if(r!==n){r<n?t=-1:r>n&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new x(e)},n.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},n.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(e){if("string"==typeof e){var t=n._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(e){x.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var e=new n(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,i=e;do{this.split(i,this.tmp),t=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t<this.n?-1:i.ucmp(this.p);return 0===r?(i.words[0]=0,i.length=1):r>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},r(v,b),v.prototype.split=function(e,t){for(var i=4194303,r=Math.min(e.length,9),n=0;n<r;n++)t.words[n]=e.words[n];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var a=e.words[9];for(t.words[t.length++]=a&i,n=10;n<e.length;n++){var o=0|e.words[n];e.words[n-10]=(o&i)<<4|a>>>22,a=o}a>>>=22,e.words[n-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,i=0;i<e.length;i++){var r=0|e.words[i];t+=977*r,e.words[i]=67108863&t,t=64*r+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},r(y,b),r(_,b),r(w,b),w.prototype.imulK=function(e){for(var t=0,i=0;i<e.length;i++){var r=19*(0|e.words[i])+t,n=67108863&r;r>>>=26,e.words[i]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new y;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return m[e]=t,t},x.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},x.prototype._verify2=function(e,t){i(0==(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},x.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},x.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},x.prototype.add=function(e,t){this._verify2(e,t);var i=e.add(t);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},x.prototype.iadd=function(e,t){this._verify2(e,t);var i=e.iadd(t);return i.cmp(this.m)>=0&&i.isub(this.m),i},x.prototype.sub=function(e,t){this._verify2(e,t);var i=e.sub(t);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},x.prototype.isub=function(e,t){this._verify2(e,t);var i=e.isub(t);return i.cmpn(0)<0&&i.iadd(this.m),i},x.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},x.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},x.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},x.prototype.isqr=function(e){return this.imul(e,e.clone())},x.prototype.sqr=function(e){return this.mul(e,e)},x.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new n(1)).iushrn(2);return this.pow(e,r)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);i(!a.isZero());var s=new n(1).toRed(this),c=s.redNeg(),d=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new n(2*u*u).toRed(this);0!==this.pow(u,d).cmp(c);)u.redIAdd(c);for(var l=this.pow(u,a),h=this.pow(e,a.addn(1).iushrn(1)),f=this.pow(e,a),p=o;0!==f.cmp(s);){for(var g=f,m=0;0!==g.cmp(s);m++)g=g.redSqr();i(m<p);var b=this.pow(l,new n(1).iushln(p-m-1));h=h.redMul(b),l=b.redSqr(),f=f.redMul(l),p=m}return h},x.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},x.prototype.pow=function(e,t){if(t.isZero())return new n(1).toRed(this);if(0===t.cmpn(1))return e.clone();var i=new Array(16);i[0]=new n(1).toRed(this),i[1]=e;for(var r=2;r<i.length;r++)i[r]=this.mul(i[r-1],e);var a=i[0],o=0,s=0,c=t.bitLength()%26;for(0===c&&(c=26),r=t.length-1;r>=0;r--){for(var d=t.words[r],u=c-1;u>=0;u--){var l=d>>u&1;a!==i[0]&&(a=this.sqr(a)),0!==l||0!==o?(o<<=1,o|=l,(4===++s||0===r&&0===u)&&(a=this.mul(a,i[o]),s=0,o=0)):s=0}c=26}return a},x.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},x.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new A(e)},r(A,x),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},A.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var i=e.imul(t),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},A.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var i=e.mul(t),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=i.isub(r).iushrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},A.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,Y)}(_u);var xu=Au;function Au(e,t){if(!e)throw new Error(t||"Assertion failed")}Au.equal=function(e,t,i){if(e!=t)throw new Error(i||"Assertion failed: "+e+" != "+t)};var Eu={};!function(e){var t=e;function i(e){return 1===e.length?"0"+e:e}function r(e){for(var t="",r=0;r<e.length;r++)t+=i(e[r].toString(16));return t}t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var i=[];if("string"!=typeof e){for(var r=0;r<e.length;r++)i[r]=0|e[r];return i}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(r=0;r<e.length;r+=2)i.push(parseInt(e[r]+e[r+1],16))}else for(r=0;r<e.length;r++){var n=e.charCodeAt(r),a=n>>8,o=255&n;a?i.push(a,o):i.push(o)}return i},t.zero2=i,t.toHex=r,t.encode=function(e,t){return"hex"===t?r(e):e}}(Eu),function(e){var t=e,i=yu,r=xu,n=Eu;t.assert=r,t.toArray=n.toArray,t.zero2=n.zero2,t.toHex=n.toHex,t.encode=n.encode,t.getNAF=function(e,t,i){var r,n=new Array(Math.max(e.bitLength(),i)+1);for(r=0;r<n.length;r+=1)n[r]=0;var a=1<<t+1,o=e.clone();for(r=0;r<n.length;r++){var s,c=o.andln(a-1);o.isOdd()?(s=c>(a>>1)-1?(a>>1)-c:c,o.isubn(s)):s=0,n[r]=s,o.iushrn(1)}return n},t.getJSF=function(e,t){var i=[[],[]];e=e.clone(),t=t.clone();for(var r,n=0,a=0;e.cmpn(-n)>0||t.cmpn(-a)>0;){var o,s,c=e.andln(3)+n&3,d=t.andln(3)+a&3;3===c&&(c=-1),3===d&&(d=-1),o=0==(1&c)?0:3!==(r=e.andln(7)+n&7)&&5!==r||2!==d?c:-c,i[0].push(o),s=0==(1&d)?0:3!==(r=t.andln(7)+a&7)&&5!==r||2!==c?d:-d,i[1].push(s),2*n===o+1&&(n=1-n),2*a===s+1&&(a=1-a),e.iushrn(1),t.iushrn(1)}return i},t.cachedProperty=function(e,t,i){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=i.call(this)}},t.parseBytes=function(e){return"string"==typeof e?t.toArray(e,"hex"):e},t.intFromLE=function(e){return new i(e,"hex","le")}}(vu);var Su,ku={},Mu={get exports(){return ku},set exports(e){ku=e}},Cu=X(Object.freeze({__proto__:null,default:{}}));function Iu(e){this.rand=e}if(Mu.exports=function(e){return Su||(Su=new Iu(null)),Su.generate(e)},ku.Rand=Iu,Iu.prototype.generate=function(e){return this._rand(e)},Iu.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),i=0;i<t.length;i++)t[i]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?Iu.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?Iu.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(Iu.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var Du=Cu;if("function"!=typeof Du.randomBytes)throw new Error("Not supported");Iu.prototype._rand=function(e){return Du.randomBytes(e)}}catch(e){}var Tu={},Ru=yu,zu=vu,Bu=zu.getNAF,Pu=zu.getJSF,Ou=zu.assert;function Fu(e,t){this.type=e,this.p=new Ru(t.p,16),this.red=t.prime?Ru.red(t.prime):Ru.mont(this.p),this.zero=new Ru(0).toRed(this.red),this.one=new Ru(1).toRed(this.red),this.two=new Ru(2).toRed(this.red),this.n=t.n&&new Ru(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Nu=Fu;function Lu(e,t){this.curve=e,this.type=t,this.precomputed=null}Fu.prototype.point=function(){throw new Error("Not implemented")},Fu.prototype.validate=function(){throw new Error("Not implemented")},Fu.prototype._fixedNafMul=function(e,t){Ou(e.precomputed);var i=e._getDoubles(),r=Bu(t,1,this._bitLength),n=(1<<i.step+1)-(i.step%2==0?2:1);n/=3;var a,o,s=[];for(a=0;a<r.length;a+=i.step){o=0;for(var c=a+i.step-1;c>=a;c--)o=(o<<1)+r[c];s.push(o)}for(var d=this.jpoint(null,null,null),u=this.jpoint(null,null,null),l=n;l>0;l--){for(a=0;a<s.length;a++)(o=s[a])===l?u=u.mixedAdd(i.points[a]):o===-l&&(u=u.mixedAdd(i.points[a].neg()));d=d.add(u)}return d.toP()},Fu.prototype._wnafMul=function(e,t){var i=4,r=e._getNAFPoints(i);i=r.wnd;for(var n=r.points,a=Bu(t,i,this._bitLength),o=this.jpoint(null,null,null),s=a.length-1;s>=0;s--){for(var c=0;s>=0&&0===a[s];s--)c++;if(s>=0&&c++,o=o.dblp(c),s<0)break;var d=a[s];Ou(0!==d),o="affine"===e.type?d>0?o.mixedAdd(n[d-1>>1]):o.mixedAdd(n[-d-1>>1].neg()):d>0?o.add(n[d-1>>1]):o.add(n[-d-1>>1].neg())}return"affine"===e.type?o.toP():o},Fu.prototype._wnafMulAdd=function(e,t,i,r,n){var a,o,s,c=this._wnafT1,d=this._wnafT2,u=this._wnafT3,l=0;for(a=0;a<r;a++){var h=(s=t[a])._getNAFPoints(e);c[a]=h.wnd,d[a]=h.points}for(a=r-1;a>=1;a-=2){var f=a-1,p=a;if(1===c[f]&&1===c[p]){var g=[t[f],null,null,t[p]];0===t[f].y.cmp(t[p].y)?(g[1]=t[f].add(t[p]),g[2]=t[f].toJ().mixedAdd(t[p].neg())):0===t[f].y.cmp(t[p].y.redNeg())?(g[1]=t[f].toJ().mixedAdd(t[p]),g[2]=t[f].add(t[p].neg())):(g[1]=t[f].toJ().mixedAdd(t[p]),g[2]=t[f].toJ().mixedAdd(t[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],b=Pu(i[f],i[p]);for(l=Math.max(b[0].length,l),u[f]=new Array(l),u[p]=new Array(l),o=0;o<l;o++){var v=0|b[0][o],y=0|b[1][o];u[f][o]=m[3*(v+1)+(y+1)],u[p][o]=0,d[f]=g}}else u[f]=Bu(i[f],c[f],this._bitLength),u[p]=Bu(i[p],c[p],this._bitLength),l=Math.max(u[f].length,l),l=Math.max(u[p].length,l)}var _=this.jpoint(null,null,null),w=this._wnafT4;for(a=l;a>=0;a--){for(var x=0;a>=0;){var A=!0;for(o=0;o<r;o++)w[o]=0|u[o][a],0!==w[o]&&(A=!1);if(!A)break;x++,a--}if(a>=0&&x++,_=_.dblp(x),a<0)break;for(o=0;o<r;o++){var E=w[o];0!==E&&(E>0?s=d[o][E-1>>1]:E<0&&(s=d[o][-E-1>>1].neg()),_="affine"===s.type?_.mixedAdd(s):_.add(s))}}for(a=0;a<r;a++)d[a]=null;return n?_:_.toP()},Fu.BasePoint=Lu,Lu.prototype.eq=function(){throw new Error("Not implemented")},Lu.prototype.validate=function(){return this.curve.validate(this)},Fu.prototype.decodePoint=function(e,t){e=zu.toArray(e,t);var i=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*i)return 6===e[0]?Ou(e[e.length-1]%2==0):7===e[0]&&Ou(e[e.length-1]%2==1),this.point(e.slice(1,1+i),e.slice(1+i,1+2*i));if((2===e[0]||3===e[0])&&e.length-1===i)return this.pointFromX(e.slice(1,1+i),3===e[0]);throw new Error("Unknown point format")},Lu.prototype.encodeCompressed=function(e){return this.encode(e,!0)},Lu.prototype._encode=function(e){var t=this.curve.p.byteLength(),i=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(i):[4].concat(i,this.getY().toArray("be",t))},Lu.prototype.encode=function(e,t){return zu.encode(this._encode(t),e)},Lu.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},Lu.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},Lu.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],r=this,n=0;n<t;n+=e){for(var a=0;a<e;a++)r=r.dbl();i.push(r)}return{step:e,points:i}},Lu.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],i=(1<<e)-1,r=1===i?null:this.dbl(),n=1;n<i;n++)t[n]=t[n-1].add(r);return{wnd:e,points:t}},Lu.prototype._getBeta=function(){return null},Lu.prototype.dblp=function(e){for(var t=this,i=0;i<e;i++)t=t.dbl();return t};var ju={},Uu={get exports(){return ju},set exports(e){ju=e}};"function"==typeof Object.create?Uu.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Uu.exports=function(e,t){if(t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}};var qu=yu,Ku=ju,Hu=Nu,Vu=vu.assert;function $u(e){Hu.call(this,"short",e),this.a=new qu(e.a,16).toRed(this.red),this.b=new qu(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}Ku($u,Hu);var Ju=$u;function Gu(e,t,i,r){Hu.BasePoint.call(this,e,"affine"),null===t&&null===i?(this.x=null,this.y=null,this.inf=!0):(this.x=new qu(t,16),this.y=new qu(i,16),r&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function Wu(e,t,i,r){Hu.BasePoint.call(this,e,"jacobian"),null===t&&null===i&&null===r?(this.x=this.curve.one,this.y=this.curve.one,this.z=new qu(0)):(this.x=new qu(t,16),this.y=new qu(i,16),this.z=new qu(r,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}$u.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,i;if(e.beta)t=new qu(e.beta,16).toRed(this.red);else{var r=this._getEndoRoots(this.p);t=(t=r[0].cmp(r[1])<0?r[0]:r[1]).toRed(this.red)}if(e.lambda)i=new qu(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?i=n[0]:(i=n[1],Vu(0===this.g.mul(i).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:i,basis:e.basis?e.basis.map((function(e){return{a:new qu(e.a,16),b:new qu(e.b,16)}})):this._getEndoBasis(i)}}},$u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:qu.mont(e),i=new qu(2).toRed(t).redInvm(),r=i.redNeg(),n=new qu(3).toRed(t).redNeg().redSqrt().redMul(i);return[r.redAdd(n).fromRed(),r.redSub(n).fromRed()]},$u.prototype._getEndoBasis=function(e){for(var t,i,r,n,a,o,s,c,d,u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=e,h=this.n.clone(),f=new qu(1),p=new qu(0),g=new qu(0),m=new qu(1),b=0;0!==l.cmpn(0);){var v=h.div(l);c=h.sub(v.mul(l)),d=g.sub(v.mul(f));var y=m.sub(v.mul(p));if(!r&&c.cmp(u)<0)t=s.neg(),i=f,r=c.neg(),n=d;else if(r&&2==++b)break;s=c,h=l,l=c,g=f,f=d,m=p,p=y}a=c.neg(),o=d;var _=r.sqr().add(n.sqr());return a.sqr().add(o.sqr()).cmp(_)>=0&&(a=t,o=i),r.negative&&(r=r.neg(),n=n.neg()),a.negative&&(a=a.neg(),o=o.neg()),[{a:r,b:n},{a:a,b:o}]},$u.prototype._endoSplit=function(e){var t=this.endo.basis,i=t[0],r=t[1],n=r.b.mul(e).divRound(this.n),a=i.b.neg().mul(e).divRound(this.n),o=n.mul(i.a),s=a.mul(r.a),c=n.mul(i.b),d=a.mul(r.b);return{k1:e.sub(o).sub(s),k2:c.add(d).neg()}},$u.prototype.pointFromX=function(e,t){(e=new qu(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),r=i.redSqrt();if(0!==r.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");var n=r.fromRed().isOdd();return(t&&!n||!t&&n)&&(r=r.redNeg()),this.point(e,r)},$u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,i=e.y,r=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===i.redSqr().redISub(n).cmpn(0)},$u.prototype._endoWnafMulAdd=function(e,t,i){for(var r=this._endoWnafT1,n=this._endoWnafT2,a=0;a<e.length;a++){var o=this._endoSplit(t[a]),s=e[a],c=s._getBeta();o.k1.negative&&(o.k1.ineg(),s=s.neg(!0)),o.k2.negative&&(o.k2.ineg(),c=c.neg(!0)),r[2*a]=s,r[2*a+1]=c,n[2*a]=o.k1,n[2*a+1]=o.k2}for(var d=this._wnafMulAdd(1,r,n,2*a,i),u=0;u<2*a;u++)r[u]=null,n[u]=null;return d},Ku(Gu,Hu.BasePoint),$u.prototype.point=function(e,t,i){return new Gu(this,e,t,i)},$u.prototype.pointFromJSON=function(e,t){return Gu.fromJSON(this,e,t)},Gu.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var i=this.curve,r=function(e){return i.point(e.x.redMul(i.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(r)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(r)}}}return t}},Gu.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Gu.fromJSON=function(e,t,i){"string"==typeof t&&(t=JSON.parse(t));var r=e.point(t[0],t[1],i);if(!t[2])return r;function n(t){return e.point(t[0],t[1],i)}var a=t[2];return r.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[r].concat(a.doubles.points.map(n))},naf:a.naf&&{wnd:a.naf.wnd,points:[r].concat(a.naf.points.map(n))}},r},Gu.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Gu.prototype.isInfinity=function(){return this.inf},Gu.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var i=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,r)},Gu.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,i=this.x.redSqr(),r=e.redInvm(),n=i.redAdd(i).redIAdd(i).redIAdd(t).redMul(r),a=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},Gu.prototype.getX=function(){return this.x.fromRed()},Gu.prototype.getY=function(){return this.y.fromRed()},Gu.prototype.mul=function(e){return e=new qu(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},Gu.prototype.mulAdd=function(e,t,i){var r=[this,t],n=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(r,n):this.curve._wnafMulAdd(1,r,n,2)},Gu.prototype.jmulAdd=function(e,t,i){var r=[this,t],n=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(r,n,!0):this.curve._wnafMulAdd(1,r,n,2,!0)},Gu.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},Gu.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var i=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(r)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(r)}}}return t},Gu.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Ku(Wu,Hu.BasePoint),$u.prototype.jpoint=function(e,t,i){return new Wu(this,e,t,i)},Wu.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),i=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(i,r)},Wu.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Wu.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),i=this.z.redSqr(),r=this.x.redMul(t),n=e.x.redMul(i),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(i.redMul(this.z)),s=r.redSub(n),c=a.redSub(o);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var d=s.redSqr(),u=d.redMul(s),l=r.redMul(d),h=c.redSqr().redIAdd(u).redISub(l).redISub(l),f=c.redMul(l.redISub(h)).redISub(a.redMul(u)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,f,p)},Wu.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),i=this.x,r=e.x.redMul(t),n=this.y,a=e.y.redMul(t).redMul(this.z),o=i.redSub(r),s=n.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),d=c.redMul(o),u=i.redMul(c),l=s.redSqr().redIAdd(d).redISub(u).redISub(u),h=s.redMul(u.redISub(l)).redISub(n.redMul(d)),f=this.z.redMul(o);return this.curve.jpoint(l,h,f)},Wu.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var i=this;for(t=0;t<e;t++)i=i.dbl();return i}var r=this.curve.a,n=this.curve.tinv,a=this.x,o=this.y,s=this.z,c=s.redSqr().redSqr(),d=o.redAdd(o);for(t=0;t<e;t++){var u=a.redSqr(),l=d.redSqr(),h=l.redSqr(),f=u.redAdd(u).redIAdd(u).redIAdd(r.redMul(c)),p=a.redMul(l),g=f.redSqr().redISub(p.redAdd(p)),m=p.redISub(g),b=f.redMul(m);b=b.redIAdd(b).redISub(h);var v=d.redMul(s);t+1<e&&(c=c.redMul(h)),a=g,s=v,d=b}return this.curve.jpoint(a,d.redMul(n),s)},Wu.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},Wu.prototype._zeroDbl=function(){var e,t,i;if(this.zOne){var r=this.x.redSqr(),n=this.y.redSqr(),a=n.redSqr(),o=this.x.redAdd(n).redSqr().redISub(r).redISub(a);o=o.redIAdd(o);var s=r.redAdd(r).redIAdd(r),c=s.redSqr().redISub(o).redISub(o),d=a.redIAdd(a);d=(d=d.redIAdd(d)).redIAdd(d),e=c,t=s.redMul(o.redISub(c)).redISub(d),i=this.y.redAdd(this.y)}else{var u=this.x.redSqr(),l=this.y.redSqr(),h=l.redSqr(),f=this.x.redAdd(l).redSqr().redISub(u).redISub(h);f=f.redIAdd(f);var p=u.redAdd(u).redIAdd(u),g=p.redSqr(),m=h.redIAdd(h);m=(m=m.redIAdd(m)).redIAdd(m),e=g.redISub(f).redISub(f),t=p.redMul(f.redISub(e)).redISub(m),i=(i=this.y.redMul(this.z)).redIAdd(i)}return this.curve.jpoint(e,t,i)},Wu.prototype._threeDbl=function(){var e,t,i;if(this.zOne){var r=this.x.redSqr(),n=this.y.redSqr(),a=n.redSqr(),o=this.x.redAdd(n).redSqr().redISub(r).redISub(a);o=o.redIAdd(o);var s=r.redAdd(r).redIAdd(r).redIAdd(this.curve.a),c=s.redSqr().redISub(o).redISub(o);e=c;var d=a.redIAdd(a);d=(d=d.redIAdd(d)).redIAdd(d),t=s.redMul(o.redISub(c)).redISub(d),i=this.y.redAdd(this.y)}else{var u=this.z.redSqr(),l=this.y.redSqr(),h=this.x.redMul(l),f=this.x.redSub(u).redMul(this.x.redAdd(u));f=f.redAdd(f).redIAdd(f);var p=h.redIAdd(h),g=(p=p.redIAdd(p)).redAdd(p);e=f.redSqr().redISub(g),i=this.y.redAdd(this.z).redSqr().redISub(l).redISub(u);var m=l.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=f.redMul(p.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,i)},Wu.prototype._dbl=function(){var e=this.curve.a,t=this.x,i=this.y,r=this.z,n=r.redSqr().redSqr(),a=t.redSqr(),o=i.redSqr(),s=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(n)),c=t.redAdd(t),d=(c=c.redIAdd(c)).redMul(o),u=s.redSqr().redISub(d.redAdd(d)),l=d.redISub(u),h=o.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var f=s.redMul(l).redISub(h),p=i.redAdd(i).redMul(r);return this.curve.jpoint(u,f,p)},Wu.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),i=this.z.redSqr(),r=t.redSqr(),n=e.redAdd(e).redIAdd(e),a=n.redSqr(),o=this.x.redAdd(t).redSqr().redISub(e).redISub(r),s=(o=(o=(o=o.redIAdd(o)).redAdd(o).redIAdd(o)).redISub(a)).redSqr(),c=r.redIAdd(r);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var d=n.redIAdd(o).redSqr().redISub(a).redISub(s).redISub(c),u=t.redMul(d);u=(u=u.redIAdd(u)).redIAdd(u);var l=this.x.redMul(s).redISub(u);l=(l=l.redIAdd(l)).redIAdd(l);var h=this.y.redMul(d.redMul(c.redISub(d)).redISub(o.redMul(s)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var f=this.z.redAdd(o).redSqr().redISub(i).redISub(s);return this.curve.jpoint(l,h,f)},Wu.prototype.mul=function(e,t){return e=new qu(e,t),this.curve._wnafMul(this,e)},Wu.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),i=e.z.redSqr();if(0!==this.x.redMul(i).redISub(e.x.redMul(t)).cmpn(0))return!1;var r=t.redMul(this.z),n=i.redMul(e.z);return 0===this.y.redMul(n).redISub(e.y.redMul(r)).cmpn(0)},Wu.prototype.eqXToP=function(e){var t=this.z.redSqr(),i=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(i))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(t);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(i.redIAdd(n),0===this.x.cmp(i))return!0}},Wu.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},Wu.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Zu=yu,Yu=ju,Qu=Nu,Xu=vu;function el(e){Qu.call(this,"mont",e),this.a=new Zu(e.a,16).toRed(this.red),this.b=new Zu(e.b,16).toRed(this.red),this.i4=new Zu(4).toRed(this.red).redInvm(),this.two=new Zu(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}Yu(el,Qu);var tl=el;function il(e,t,i){Qu.BasePoint.call(this,e,"projective"),null===t&&null===i?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Zu(t,16),this.z=new Zu(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}el.prototype.validate=function(e){var t=e.normalize().x,i=t.redSqr(),r=i.redMul(t).redAdd(i.redMul(this.a)).redAdd(t);return 0===r.redSqrt().redSqr().cmp(r)},Yu(il,Qu.BasePoint),el.prototype.decodePoint=function(e,t){return this.point(Xu.toArray(e,t),1)},el.prototype.point=function(e,t){return new il(this,e,t)},el.prototype.pointFromJSON=function(e){return il.fromJSON(this,e)},il.prototype.precompute=function(){},il.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},il.fromJSON=function(e,t){return new il(e,t[0],t[1]||e.one)},il.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},il.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},il.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),i=e.redSub(t),r=e.redMul(t),n=i.redMul(t.redAdd(this.curve.a24.redMul(i)));return this.curve.point(r,n)},il.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},il.prototype.diffAdd=function(e,t){var i=this.x.redAdd(this.z),r=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(i),o=n.redMul(r),s=t.z.redMul(a.redAdd(o).redSqr()),c=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,c)},il.prototype.mul=function(e){for(var t=e.clone(),i=this,r=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.iushrn(1))n.push(t.andln(1));for(var a=n.length-1;a>=0;a--)0===n[a]?(i=i.diffAdd(r,this),r=r.dbl()):(r=i.diffAdd(r,this),i=i.dbl());return r},il.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},il.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},il.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},il.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},il.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var rl=yu,nl=ju,al=Nu,ol=vu.assert;function sl(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,al.call(this,"edwards",e),this.a=new rl(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new rl(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new rl(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),ol(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}nl(sl,al);var cl=sl;function dl(e,t,i,r,n){al.BasePoint.call(this,e,"projective"),null===t&&null===i&&null===r?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new rl(t,16),this.y=new rl(i,16),this.z=r?new rl(r,16):this.curve.one,this.t=n&&new rl(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}sl.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},sl.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},sl.prototype.jpoint=function(e,t,i,r){return this.point(e,t,i,r)},sl.prototype.pointFromX=function(e,t){(e=new rl(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr(),r=this.c2.redSub(this.a.redMul(i)),n=this.one.redSub(this.c2.redMul(this.d).redMul(i)),a=r.redMul(n.redInvm()),o=a.redSqrt();if(0!==o.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var s=o.fromRed().isOdd();return(t&&!s||!t&&s)&&(o=o.redNeg()),this.point(e,o)},sl.prototype.pointFromY=function(e,t){(e=new rl(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr(),r=i.redSub(this.c2),n=i.redMul(this.d).redMul(this.c2).redSub(this.a),a=r.redMul(n.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var o=a.redSqrt();if(0!==o.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return o.fromRed().isOdd()!==t&&(o=o.redNeg()),this.point(o,e)},sl.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),i=e.y.redSqr(),r=t.redMul(this.a).redAdd(i),n=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(i)));return 0===r.cmp(n)},nl(dl,al.BasePoint),sl.prototype.pointFromJSON=function(e){return dl.fromJSON(this,e)},sl.prototype.point=function(e,t,i,r){return new dl(this,e,t,i,r)},dl.fromJSON=function(e,t){return new dl(e,t[0],t[1],t[2])},dl.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},dl.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},dl.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),i=this.z.redSqr();i=i.redIAdd(i);var r=this.curve._mulA(e),n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),a=r.redAdd(t),o=a.redSub(i),s=r.redSub(t),c=n.redMul(o),d=a.redMul(s),u=n.redMul(s),l=o.redMul(a);return this.curve.point(c,d,l,u)},dl.prototype._projDbl=function(){var e,t,i,r,n,a,o=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var d=(r=this.curve._mulA(s)).redAdd(c);this.zOne?(e=o.redSub(s).redSub(c).redMul(d.redSub(this.curve.two)),t=d.redMul(r.redSub(c)),i=d.redSqr().redSub(d).redSub(d)):(n=this.z.redSqr(),a=d.redSub(n).redISub(n),e=o.redSub(s).redISub(c).redMul(a),t=d.redMul(r.redSub(c)),i=d.redMul(a))}else r=s.redAdd(c),n=this.curve._mulC(this.z).redSqr(),a=r.redSub(n).redSub(n),e=this.curve._mulC(o.redISub(r)).redMul(a),t=this.curve._mulC(r).redMul(s.redISub(c)),i=r.redMul(a);return this.curve.point(e,t,i)},dl.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},dl.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),i=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),r=this.t.redMul(this.curve.dd).redMul(e.t),n=this.z.redMul(e.z.redAdd(e.z)),a=i.redSub(t),o=n.redSub(r),s=n.redAdd(r),c=i.redAdd(t),d=a.redMul(o),u=s.redMul(c),l=a.redMul(c),h=o.redMul(s);return this.curve.point(d,u,h,l)},dl.prototype._projAdd=function(e){var t,i,r=this.z.redMul(e.z),n=r.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),c=n.redSub(s),d=n.redAdd(s),u=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),l=r.redMul(c).redMul(u);return this.curve.twisted?(t=r.redMul(d).redMul(o.redSub(this.curve._mulA(a))),i=c.redMul(d)):(t=r.redMul(d).redMul(o.redSub(a)),i=this.curve._mulC(c).redMul(d)),this.curve.point(l,t,i)},dl.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},dl.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},dl.prototype.mulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!1)},dl.prototype.jmulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!0)},dl.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},dl.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},dl.prototype.getX=function(){return this.normalize(),this.x.fromRed()},dl.prototype.getY=function(){return this.normalize(),this.y.fromRed()},dl.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},dl.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var i=e.clone(),r=this.curve.redN.redMul(this.z);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(r),0===this.x.cmp(t))return!0}},dl.prototype.toP=dl.prototype.normalize,dl.prototype.mixedAdd=dl.prototype.add,function(e){var t=e;t.base=Nu,t.short=Ju,t.mont=tl,t.edwards=cl}(Tu);var ul={},ll={},hl={},fl=xu,pl=ju;function gl(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function ml(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function bl(e){return 1===e.length?"0"+e:e}function vl(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}hl.inherits=pl,hl.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var i=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)i.push(parseInt(e[n]+e[n+1],16))}else for(var r=0,n=0;n<e.length;n++){var a=e.charCodeAt(n);a<128?i[r++]=a:a<2048?(i[r++]=a>>6|192,i[r++]=63&a|128):gl(e,n)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++n)),i[r++]=a>>18|240,i[r++]=a>>12&63|128,i[r++]=a>>6&63|128,i[r++]=63&a|128):(i[r++]=a>>12|224,i[r++]=a>>6&63|128,i[r++]=63&a|128)}else for(n=0;n<e.length;n++)i[n]=0|e[n];return i},hl.toHex=function(e){for(var t="",i=0;i<e.length;i++)t+=bl(e[i].toString(16));return t},hl.htonl=ml,hl.toHex32=function(e,t){for(var i="",r=0;r<e.length;r++){var n=e[r];"little"===t&&(n=ml(n)),i+=vl(n.toString(16))}return i},hl.zero2=bl,hl.zero8=vl,hl.join32=function(e,t,i,r){var n=i-t;fl(n%4==0);for(var a=new Array(n/4),o=0,s=t;o<a.length;o++,s+=4){var c;c="big"===r?e[s]<<24|e[s+1]<<16|e[s+2]<<8|e[s+3]:e[s+3]<<24|e[s+2]<<16|e[s+1]<<8|e[s],a[o]=c>>>0}return a},hl.split32=function(e,t){for(var i=new Array(4*e.length),r=0,n=0;r<e.length;r++,n+=4){var a=e[r];"big"===t?(i[n]=a>>>24,i[n+1]=a>>>16&255,i[n+2]=a>>>8&255,i[n+3]=255&a):(i[n+3]=a>>>24,i[n+2]=a>>>16&255,i[n+1]=a>>>8&255,i[n]=255&a)}return i},hl.rotr32=function(e,t){return e>>>t|e<<32-t},hl.rotl32=function(e,t){return e<<t|e>>>32-t},hl.sum32=function(e,t){return e+t>>>0},hl.sum32_3=function(e,t,i){return e+t+i>>>0},hl.sum32_4=function(e,t,i,r){return e+t+i+r>>>0},hl.sum32_5=function(e,t,i,r,n){return e+t+i+r+n>>>0},hl.sum64=function(e,t,i,r){var n=e[t],a=r+e[t+1]>>>0,o=(a<r?1:0)+i+n;e[t]=o>>>0,e[t+1]=a},hl.sum64_hi=function(e,t,i,r){return(t+r>>>0<t?1:0)+e+i>>>0},hl.sum64_lo=function(e,t,i,r){return t+r>>>0},hl.sum64_4_hi=function(e,t,i,r,n,a,o,s){var c=0,d=t;return c+=(d=d+r>>>0)<t?1:0,c+=(d=d+a>>>0)<a?1:0,e+i+n+o+(c+=(d=d+s>>>0)<s?1:0)>>>0},hl.sum64_4_lo=function(e,t,i,r,n,a,o,s){return t+r+a+s>>>0},hl.sum64_5_hi=function(e,t,i,r,n,a,o,s,c,d){var u=0,l=t;return u+=(l=l+r>>>0)<t?1:0,u+=(l=l+a>>>0)<a?1:0,u+=(l=l+s>>>0)<s?1:0,e+i+n+o+c+(u+=(l=l+d>>>0)<d?1:0)>>>0},hl.sum64_5_lo=function(e,t,i,r,n,a,o,s,c,d){return t+r+a+s+d>>>0},hl.rotr64_hi=function(e,t,i){return(t<<32-i|e>>>i)>>>0},hl.rotr64_lo=function(e,t,i){return(e<<32-i|t>>>i)>>>0},hl.shr64_hi=function(e,t,i){return e>>>i},hl.shr64_lo=function(e,t,i){return(e<<32-i|t>>>i)>>>0};var yl={},_l=hl,wl=xu;function xl(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}yl.BlockHash=xl,xl.prototype.update=function(e,t){if(e=_l.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var i=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-i,e.length),0===this.pending.length&&(this.pending=null),e=_l.join32(e,0,e.length-i,this.endian);for(var r=0;r<e.length;r+=this._delta32)this._update(e,r,r+this._delta32)}return this},xl.prototype.digest=function(e){return this.update(this._pad()),wl(null===this.pending),this._digest(e)},xl.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,i=t-(e+this.padLength)%t,r=new Array(i+this.padLength);r[0]=128;for(var n=1;n<i;n++)r[n]=0;if(e<<=3,"big"===this.endian){for(var a=8;a<this.padLength;a++)r[n++]=0;r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=e>>>24&255,r[n++]=e>>>16&255,r[n++]=e>>>8&255,r[n++]=255&e}else for(r[n++]=255&e,r[n++]=e>>>8&255,r[n++]=e>>>16&255,r[n++]=e>>>24&255,r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=0,a=8;a<this.padLength;a++)r[n++]=0;return r};var Al={},El={},Sl=hl.rotr32;function kl(e,t,i){return e&t^~e&i}function Ml(e,t,i){return e&t^e&i^t&i}function Cl(e,t,i){return e^t^i}El.ft_1=function(e,t,i,r){return 0===e?kl(t,i,r):1===e||3===e?Cl(t,i,r):2===e?Ml(t,i,r):void 0},El.ch32=kl,El.maj32=Ml,El.p32=Cl,El.s0_256=function(e){return Sl(e,2)^Sl(e,13)^Sl(e,22)},El.s1_256=function(e){return Sl(e,6)^Sl(e,11)^Sl(e,25)},El.g0_256=function(e){return Sl(e,7)^Sl(e,18)^e>>>3},El.g1_256=function(e){return Sl(e,17)^Sl(e,19)^e>>>10};var Il=hl,Dl=yl,Tl=El,Rl=Il.rotl32,zl=Il.sum32,Bl=Il.sum32_5,Pl=Tl.ft_1,Ol=Dl.BlockHash,Fl=[1518500249,1859775393,2400959708,3395469782];function Nl(){if(!(this instanceof Nl))return new Nl;Ol.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Il.inherits(Nl,Ol);var Ll=Nl;Nl.blockSize=512,Nl.outSize=160,Nl.hmacStrength=80,Nl.padLength=64,Nl.prototype._update=function(e,t){for(var i=this.W,r=0;r<16;r++)i[r]=e[t+r];for(;r<i.length;r++)i[r]=Rl(i[r-3]^i[r-8]^i[r-14]^i[r-16],1);var n=this.h[0],a=this.h[1],o=this.h[2],s=this.h[3],c=this.h[4];for(r=0;r<i.length;r++){var d=~~(r/20),u=Bl(Rl(n,5),Pl(d,a,o,s),c,i[r],Fl[d]);c=s,s=o,o=Rl(a,30),a=n,n=u}this.h[0]=zl(this.h[0],n),this.h[1]=zl(this.h[1],a),this.h[2]=zl(this.h[2],o),this.h[3]=zl(this.h[3],s),this.h[4]=zl(this.h[4],c)},Nl.prototype._digest=function(e){return"hex"===e?Il.toHex32(this.h,"big"):Il.split32(this.h,"big")};var jl=hl,Ul=yl,ql=El,Kl=xu,Hl=jl.sum32,Vl=jl.sum32_4,$l=jl.sum32_5,Jl=ql.ch32,Gl=ql.maj32,Wl=ql.s0_256,Zl=ql.s1_256,Yl=ql.g0_256,Ql=ql.g1_256,Xl=Ul.BlockHash,eh=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function th(){if(!(this instanceof th))return new th;Xl.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=eh,this.W=new Array(64)}jl.inherits(th,Xl);var ih=th;th.blockSize=512,th.outSize=256,th.hmacStrength=192,th.padLength=64,th.prototype._update=function(e,t){for(var i=this.W,r=0;r<16;r++)i[r]=e[t+r];for(;r<i.length;r++)i[r]=Vl(Ql(i[r-2]),i[r-7],Yl(i[r-15]),i[r-16]);var n=this.h[0],a=this.h[1],o=this.h[2],s=this.h[3],c=this.h[4],d=this.h[5],u=this.h[6],l=this.h[7];for(Kl(this.k.length===i.length),r=0;r<i.length;r++){var h=$l(l,Zl(c),Jl(c,d,u),this.k[r],i[r]),f=Hl(Wl(n),Gl(n,a,o));l=u,u=d,d=c,c=Hl(s,h),s=o,o=a,a=n,n=Hl(h,f)}this.h[0]=Hl(this.h[0],n),this.h[1]=Hl(this.h[1],a),this.h[2]=Hl(this.h[2],o),this.h[3]=Hl(this.h[3],s),this.h[4]=Hl(this.h[4],c),this.h[5]=Hl(this.h[5],d),this.h[6]=Hl(this.h[6],u),this.h[7]=Hl(this.h[7],l)},th.prototype._digest=function(e){return"hex"===e?jl.toHex32(this.h,"big"):jl.split32(this.h,"big")};var rh=hl,nh=ih;function ah(){if(!(this instanceof ah))return new ah;nh.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}rh.inherits(ah,nh);var oh=ah;ah.blockSize=512,ah.outSize=224,ah.hmacStrength=192,ah.padLength=64,ah.prototype._digest=function(e){return"hex"===e?rh.toHex32(this.h.slice(0,7),"big"):rh.split32(this.h.slice(0,7),"big")};var sh=hl,ch=yl,dh=xu,uh=sh.rotr64_hi,lh=sh.rotr64_lo,hh=sh.shr64_hi,fh=sh.shr64_lo,ph=sh.sum64,gh=sh.sum64_hi,mh=sh.sum64_lo,bh=sh.sum64_4_hi,vh=sh.sum64_4_lo,yh=sh.sum64_5_hi,_h=sh.sum64_5_lo,wh=ch.BlockHash,xh=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Ah(){if(!(this instanceof Ah))return new Ah;wh.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=xh,this.W=new Array(160)}sh.inherits(Ah,wh);var Eh=Ah;function Sh(e,t,i,r,n){var a=e&i^~e&n;return a<0&&(a+=4294967296),a}function kh(e,t,i,r,n,a){var o=t&r^~t&a;return o<0&&(o+=4294967296),o}function Mh(e,t,i,r,n){var a=e&i^e&n^i&n;return a<0&&(a+=4294967296),a}function Ch(e,t,i,r,n,a){var o=t&r^t&a^r&a;return o<0&&(o+=4294967296),o}function Ih(e,t){var i=uh(e,t,28)^uh(t,e,2)^uh(t,e,7);return i<0&&(i+=4294967296),i}function Dh(e,t){var i=lh(e,t,28)^lh(t,e,2)^lh(t,e,7);return i<0&&(i+=4294967296),i}function Th(e,t){var i=uh(e,t,14)^uh(e,t,18)^uh(t,e,9);return i<0&&(i+=4294967296),i}function Rh(e,t){var i=lh(e,t,14)^lh(e,t,18)^lh(t,e,9);return i<0&&(i+=4294967296),i}function zh(e,t){var i=uh(e,t,1)^uh(e,t,8)^hh(e,t,7);return i<0&&(i+=4294967296),i}function Bh(e,t){var i=lh(e,t,1)^lh(e,t,8)^fh(e,t,7);return i<0&&(i+=4294967296),i}function Ph(e,t){var i=uh(e,t,19)^uh(t,e,29)^hh(e,t,6);return i<0&&(i+=4294967296),i}function Oh(e,t){var i=lh(e,t,19)^lh(t,e,29)^fh(e,t,6);return i<0&&(i+=4294967296),i}Ah.blockSize=1024,Ah.outSize=512,Ah.hmacStrength=192,Ah.padLength=128,Ah.prototype._prepareBlock=function(e,t){for(var i=this.W,r=0;r<32;r++)i[r]=e[t+r];for(;r<i.length;r+=2){var n=Ph(i[r-4],i[r-3]),a=Oh(i[r-4],i[r-3]),o=i[r-14],s=i[r-13],c=zh(i[r-30],i[r-29]),d=Bh(i[r-30],i[r-29]),u=i[r-32],l=i[r-31];i[r]=bh(n,a,o,s,c,d,u,l),i[r+1]=vh(n,a,o,s,c,d,u,l)}},Ah.prototype._update=function(e,t){this._prepareBlock(e,t);var i=this.W,r=this.h[0],n=this.h[1],a=this.h[2],o=this.h[3],s=this.h[4],c=this.h[5],d=this.h[6],u=this.h[7],l=this.h[8],h=this.h[9],f=this.h[10],p=this.h[11],g=this.h[12],m=this.h[13],b=this.h[14],v=this.h[15];dh(this.k.length===i.length);for(var y=0;y<i.length;y+=2){var _=b,w=v,x=Th(l,h),A=Rh(l,h),E=Sh(l,h,f,p,g),S=kh(l,h,f,p,g,m),k=this.k[y],M=this.k[y+1],C=i[y],I=i[y+1],D=yh(_,w,x,A,E,S,k,M,C,I),T=_h(_,w,x,A,E,S,k,M,C,I);_=Ih(r,n),w=Dh(r,n),x=Mh(r,n,a,o,s),A=Ch(r,n,a,o,s,c);var R=gh(_,w,x,A),z=mh(_,w,x,A);b=g,v=m,g=f,m=p,f=l,p=h,l=gh(d,u,D,T),h=mh(u,u,D,T),d=s,u=c,s=a,c=o,a=r,o=n,r=gh(D,T,R,z),n=mh(D,T,R,z)}ph(this.h,0,r,n),ph(this.h,2,a,o),ph(this.h,4,s,c),ph(this.h,6,d,u),ph(this.h,8,l,h),ph(this.h,10,f,p),ph(this.h,12,g,m),ph(this.h,14,b,v)},Ah.prototype._digest=function(e){return"hex"===e?sh.toHex32(this.h,"big"):sh.split32(this.h,"big")};var Fh=hl,Nh=Eh;function Lh(){if(!(this instanceof Lh))return new Lh;Nh.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Fh.inherits(Lh,Nh);var jh=Lh;Lh.blockSize=1024,Lh.outSize=384,Lh.hmacStrength=192,Lh.padLength=128,Lh.prototype._digest=function(e){return"hex"===e?Fh.toHex32(this.h.slice(0,12),"big"):Fh.split32(this.h.slice(0,12),"big")},Al.sha1=Ll,Al.sha224=oh,Al.sha256=ih,Al.sha384=jh,Al.sha512=Eh;var Uh={},qh=hl,Kh=yl,Hh=qh.rotl32,Vh=qh.sum32,$h=qh.sum32_3,Jh=qh.sum32_4,Gh=Kh.BlockHash;function Wh(){if(!(this instanceof Wh))return new Wh;Gh.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function Zh(e,t,i,r){return e<=15?t^i^r:e<=31?t&i|~t&r:e<=47?(t|~i)^r:e<=63?t&r|i&~r:t^(i|~r)}function Yh(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function Qh(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}qh.inherits(Wh,Gh),Uh.ripemd160=Wh,Wh.blockSize=512,Wh.outSize=160,Wh.hmacStrength=192,Wh.padLength=64,Wh.prototype._update=function(e,t){for(var i=this.h[0],r=this.h[1],n=this.h[2],a=this.h[3],o=this.h[4],s=i,c=r,d=n,u=a,l=o,h=0;h<80;h++){var f=Vh(Hh(Jh(i,Zh(h,r,n,a),e[Xh[h]+t],Yh(h)),tf[h]),o);i=o,o=a,a=Hh(n,10),n=r,r=f,f=Vh(Hh(Jh(s,Zh(79-h,c,d,u),e[ef[h]+t],Qh(h)),rf[h]),l),s=l,l=u,u=Hh(d,10),d=c,c=f}f=$h(this.h[1],n,u),this.h[1]=$h(this.h[2],a,l),this.h[2]=$h(this.h[3],o,s),this.h[3]=$h(this.h[4],i,c),this.h[4]=$h(this.h[0],r,d),this.h[0]=f},Wh.prototype._digest=function(e){return"hex"===e?qh.toHex32(this.h,"little"):qh.split32(this.h,"little")};var Xh=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],ef=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],tf=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],rf=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],nf=hl,af=xu;function of(e,t,i){if(!(this instanceof of))return new of(e,t,i);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(nf.toArray(t,i))}var sf,cf,df=of;of.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),af(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},of.prototype.update=function(e,t){return this.inner.update(e,t),this},of.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},function(e){var t=e;t.utils=hl,t.common=yl,t.sha=Al,t.ripemd=Uh,t.hmac=df,t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160}(ll),function(e){var t,i=e,r=ll,n=Tu,a=vu.assert;function o(e){"short"===e.type?this.curve=new n.short(e):"edwards"===e.type?this.curve=new n.edwards(e):this.curve=new n.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=o,s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:r.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:r.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{t=cf?sf:(cf=1,sf={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}})}catch(e){t=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",t]})}(ul);var uf=ll,lf=Eu,hf=xu;function ff(e){if(!(this instanceof ff))return new ff(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=lf.toArray(e.entropy,e.entropyEnc||"hex"),i=lf.toArray(e.nonce,e.nonceEnc||"hex"),r=lf.toArray(e.pers,e.persEnc||"hex");hf(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,i,r)}var pf=ff;ff.prototype._init=function(e,t,i){var r=e.concat(t).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(r),this._reseed=1,this.reseedInterval=281474976710656},ff.prototype._hmac=function(){return new uf.hmac(this.hash,this.K)},ff.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},ff.prototype.reseed=function(e,t,i,r){"string"!=typeof t&&(r=i,i=t,t=null),e=lf.toArray(e,t),i=lf.toArray(i,r),hf(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(i||[])),this._reseed=1},ff.prototype.generate=function(e,t,i,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(r=i,i=t,t=null),i&&(i=lf.toArray(i,r||"hex"),this._update(i));for(var n=[];n.length<e;)this.V=this._hmac().update(this.V).digest(),n=n.concat(this.V);var a=n.slice(0,e);return this._update(i),this._reseed++,lf.encode(a,t)};var gf=yu,mf=vu.assert;function bf(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var vf=bf;bf.fromPublic=function(e,t,i){return t instanceof bf?t:new bf(e,{pub:t,pubEnc:i})},bf.fromPrivate=function(e,t,i){return t instanceof bf?t:new bf(e,{priv:t,privEnc:i})},bf.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},bf.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},bf.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},bf.prototype._importPrivate=function(e,t){this.priv=new gf(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},bf.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?mf(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||mf(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},bf.prototype.derive=function(e){return e.validate()||mf(e.validate(),"public point not validated"),e.mul(this.priv).getX()},bf.prototype.sign=function(e,t,i){return this.ec.sign(e,this,t,i)},bf.prototype.verify=function(e,t,i){return this.ec.verify(e,t,this,void 0,i)},bf.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var yf=yu,_f=vu,wf=_f.assert;function xf(e,t){if(e instanceof xf)return e;this._importDER(e,t)||(wf(e.r&&e.s,"Signature without r or s"),this.r=new yf(e.r,16),this.s=new yf(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var Af=xf;function Ef(){this.place=0}function Sf(e,t){var i=e[t.place++];if(!(128&i))return i;var r=15&i;if(0===r||r>4)return!1;if(0===e[t.place])return!1;for(var n=0,a=0,o=t.place;a<r;a++,o++)n<<=8,n|=e[o],n>>>=0;return!(n<=127)&&(t.place=o,n)}function kf(e){for(var t=0,i=e.length-1;!e[t]&&!(128&e[t+1])&&t<i;)t++;return 0===t?e:e.slice(t)}function Mf(e,t){if(t<128)e.push(t);else{var i=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|i);--i;)e.push(t>>>(i<<3)&255);e.push(t)}}xf.prototype._importDER=function(e,t){e=_f.toArray(e,t);var i=new Ef;if(48!==e[i.place++])return!1;var r=Sf(e,i);if(!1===r)return!1;if(r+i.place!==e.length)return!1;if(2!==e[i.place++])return!1;var n=Sf(e,i);if(!1===n)return!1;if(0!=(128&e[i.place]))return!1;var a=e.slice(i.place,n+i.place);if(i.place+=n,2!==e[i.place++])return!1;var o=Sf(e,i);if(!1===o)return!1;if(e.length!==o+i.place)return!1;if(0!=(128&e[i.place]))return!1;var s=e.slice(i.place,o+i.place);if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new yf(a),this.s=new yf(s),this.recoveryParam=null,!0},xf.prototype.toDER=function(e){var t=this.r.toArray(),i=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&i[0]&&(i=[0].concat(i)),t=kf(t),i=kf(i);!(i[0]||128&i[1]);)i=i.slice(1);var r=[2];Mf(r,t.length),(r=r.concat(t)).push(2),Mf(r,i.length);var n=r.concat(i),a=[48];return Mf(a,n.length),a=a.concat(n),_f.encode(a,e)};var Cf=yu,If=pf,Df=ul,Tf=ku,Rf=vu.assert,zf=vf,Bf=Af;function Pf(e){if(!(this instanceof Pf))return new Pf(e);"string"==typeof e&&(Rf(Object.prototype.hasOwnProperty.call(Df,e),"Unknown curve "+e),e=Df[e]),e instanceof Df.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var Of=Pf;Pf.prototype.keyPair=function(e){return new zf(this,e)},Pf.prototype.keyFromPrivate=function(e,t){return zf.fromPrivate(this,e,t)},Pf.prototype.keyFromPublic=function(e,t){return zf.fromPublic(this,e,t)},Pf.prototype.genKeyPair=function(e){e||(e={});for(var t=new If({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Tf(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),r=this.n.sub(new Cf(2));;){var n=new Cf(t.generate(i));if(!(n.cmp(r)>0))return n.iaddn(1),this.keyFromPrivate(n)}},Pf.prototype._truncateToN=function(e,t,i){var r;if(Cf.isBN(e)||"number"==typeof e)r=(e=new Cf(e,16)).byteLength();else if("object"==typeof e)r=e.length,e=new Cf(e,16);else{var n=e.toString();r=n.length+1>>>1,e=new Cf(n,16)}"number"!=typeof i&&(i=8*r);var a=i-this.n.bitLength();return a>0&&(e=e.ushrn(a)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},Pf.prototype.sign=function(e,t,i,r){if("object"==typeof i&&(r=i,i=null),r||(r={}),"string"!=typeof e&&"number"!=typeof e&&!Cf.isBN(e)){Rf("object"==typeof e&&e&&"number"==typeof e.length,"Expected message to be an array-like, a hex string, or a BN instance"),Rf(e.length>>>0===e.length);for(var n=0;n<e.length;n++)Rf((255&e[n])===e[n])}t=this.keyFromPrivate(t,i),e=this._truncateToN(e,!1,r.msgBitLength),Rf(!e.isNeg(),"Can not sign a negative message");var a=this.n.byteLength(),o=t.getPrivate().toArray("be",a),s=e.toArray("be",a);Rf(new Cf(s).eq(e),"Can not sign message");for(var c=new If({hash:this.hash,entropy:o,nonce:s,pers:r.pers,persEnc:r.persEnc||"utf8"}),d=this.n.sub(new Cf(1)),u=0;;u++){var l=r.k?r.k(u):new Cf(c.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(d)>=0)){var h=this.g.mul(l);if(!h.isInfinity()){var f=h.getX(),p=f.umod(this.n);if(0!==p.cmpn(0)){var g=l.invm(this.n).mul(p.mul(t.getPrivate()).iadd(e));if(0!==(g=g.umod(this.n)).cmpn(0)){var m=(h.getY().isOdd()?1:0)|(0!==f.cmp(p)?2:0);return r.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),m^=1),new Bf({r:p,s:g,recoveryParam:m})}}}}}},Pf.prototype.verify=function(e,t,i,r,n){n||(n={}),e=this._truncateToN(e,!1,n.msgBitLength),i=this.keyFromPublic(i,r);var a=(t=new Bf(t,"hex")).r,o=t.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s,c=o.invm(this.n),d=c.mul(e).umod(this.n),u=c.mul(a).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(d,i.getPublic(),u)).isInfinity()&&s.eqXToP(a):!(s=this.g.mulAdd(d,i.getPublic(),u)).isInfinity()&&0===s.getX().umod(this.n).cmp(a)},Pf.prototype.recoverPubKey=function(e,t,i,r){Rf((3&i)===i,"The recovery param is more than two bits"),t=new Bf(t,r);var n=this.n,a=new Cf(e),o=t.r,s=t.s,c=1&i,d=i>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");o=d?this.curve.pointFromX(o.add(this.curve.n),c):this.curve.pointFromX(o,c);var u=t.r.invm(n),l=n.sub(a).mul(u).umod(n),h=s.mul(u).umod(n);return this.g.mulAdd(l,o,h)},Pf.prototype.getKeyRecoveryParam=function(e,t,i,r){if(null!==(t=new Bf(t,r)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(e,t,n)}catch(e){continue}if(a.eq(i))return n}throw new Error("Unable to find valid recovery factor")};var Ff=vu,Nf=Ff.assert,Lf=Ff.parseBytes,jf=Ff.cachedProperty;function Uf(e,t){this.eddsa=e,this._secret=Lf(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=Lf(t.pub)}Uf.fromPublic=function(e,t){return t instanceof Uf?t:new Uf(e,{pub:t})},Uf.fromSecret=function(e,t){return t instanceof Uf?t:new Uf(e,{secret:t})},Uf.prototype.secret=function(){return this._secret},jf(Uf,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),jf(Uf,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),jf(Uf,"privBytes",(function(){var e=this.eddsa,t=this.hash(),i=e.encodingLength-1,r=t.slice(0,e.encodingLength);return r[0]&=248,r[i]&=127,r[i]|=64,r})),jf(Uf,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),jf(Uf,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),jf(Uf,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),Uf.prototype.sign=function(e){return Nf(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},Uf.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},Uf.prototype.getSecret=function(e){return Nf(this._secret,"KeyPair is public only"),Ff.encode(this.secret(),e)},Uf.prototype.getPublic=function(e){return Ff.encode(this.pubBytes(),e)};var qf=Uf,Kf=yu,Hf=vu,Vf=Hf.assert,$f=Hf.cachedProperty,Jf=Hf.parseBytes;function Gf(e,t){this.eddsa=e,"object"!=typeof t&&(t=Jf(t)),Array.isArray(t)&&(Vf(t.length===2*e.encodingLength,"Signature has invalid size"),t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),Vf(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof Kf&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}$f(Gf,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),$f(Gf,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),$f(Gf,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),$f(Gf,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),Gf.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},Gf.prototype.toHex=function(){return Hf.encode(this.toBytes(),"hex").toUpperCase()};var Wf=Gf,Zf=ll,Yf=ul,Qf=vu,Xf=Qf.assert,ep=Qf.parseBytes,tp=qf,ip=Wf;function rp(e){if(Xf("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof rp))return new rp(e);e=Yf[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=Zf.sha512}var np=rp;rp.prototype.sign=function(e,t){e=ep(e);var i=this.keyFromSecret(t),r=this.hashInt(i.messagePrefix(),e),n=this.g.mul(r),a=this.encodePoint(n),o=this.hashInt(a,i.pubBytes(),e).mul(i.priv()),s=r.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:s,Rencoded:a})},rp.prototype.verify=function(e,t,i){if(e=ep(e),(t=this.makeSignature(t)).S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var r=this.keyFromPublic(i),n=this.hashInt(t.Rencoded(),r.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(r.pub().mul(n)).eq(a)},rp.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return Qf.intFromLE(e.digest()).umod(this.curve.n)},rp.prototype.keyFromPublic=function(e){return tp.fromPublic(this,e)},rp.prototype.keyFromSecret=function(e){return tp.fromSecret(this,e)},rp.prototype.makeSignature=function(e){return e instanceof ip?e:new ip(this,e)},rp.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},rp.prototype.decodePoint=function(e){var t=(e=Qf.parseBytes(e)).length-1,i=e.slice(0,t).concat(-129&e[t]),r=0!=(128&e[t]),n=Qf.intFromLE(i);return this.curve.pointFromY(n,r)},rp.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},rp.prototype.decodeInt=function(e){return Qf.intFromLE(e)},rp.prototype.isPoint=function(e){return e instanceof this.pointClass},function(e){var t=e;t.version=bu,t.utils=vu,t.rand=ku,t.curve=Tu,t.curves=ul,t.ec=Of,t.eddsa=np}(mu);var ap,op,sp={},cp={get exports(){return sp},set exports(e){sp=e}};
|
|
1
|
+
var tsPlatform=function(e){"use strict";function t(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function n(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?r(Object(i),!0).forEach(function(r){t(e,r,i[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function i(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function o(e,t){return Object.entries(t).reduce((t,r)=>{let[i,s]=r;return n(n({},t),{},{[i]:a.isPrototypeOf(s)?new s(e.slug):"function"==typeof s?s.bind(e):"object"==typeof s&&!Array.isArray(s)&&s?o(e,s):s})},{})}class a{constructor(e){this.slug=e}static create(e){return class extends a{constructor(t){super(t),Object.assign(this,o(this,e(this)))}}}}var s=Object.freeze({__proto__:null,Agent:a});const u=new Map;function c(e,t){var r,n;null===(r=u.get(e))||void 0===r||r.forEach((n=e=>e(t),function(){try{return n(...arguments)}catch(e){console.log(e)}}))}const l=Symbol("MODULE_INITIALIZED");var d=Object.freeze({__proto__:null,MODULE_INITIALIZED:l,emit:c,off:function(e,t){const r=u.get(e);if(!r)return;const n=r.indexOf(t);-1!==n&&r.splice(n,1)},on:function(e,t){var r;u.has(e)?null===(r=u.get(e))||void 0===r||r.push(t):u.set(e,[t])}});let h=null;function f(e){h=e}var p=Object.freeze({__proto__:null,getInitConfig:function(){return h},get initConfig(){return h},setInitConfig:f});function g(e){f(e),c(l,void 0)}var m=Object.freeze({__proto__:null,initialize:g});function y(e,t){const r=!e||"object"!=typeof e||Array.isArray(e)?{}:e;return[t.reduce((e,t)=>{if(t in e){const r=e[t];if(null!==r&&"object"==typeof r&&!Array.isArray(r))return r}const r={};return e[t]=r,r},r),r]}const v="tsec",b="general";function w(e){return e?b:h.clientId}function _(e){return function(e){if(!e)return{};try{return JSON.parse(e)}catch(e){return{}}}((e?sessionStorage:localStorage).getItem(v))}function A(e,t){const r=e?sessionStorage:localStorage,n=t(_(e));r.setItem(v,JSON.stringify(n))}var E=Object.freeze({__proto__:null,COMMON_STORAGE_KEY:v,GENERAL_ID_KEY:b,getValue:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=w(!!t.isGeneral),n=_(!!t.sessionOnly),[i]=y(n,[this.slug.toString(),r]);return i[e]},hasValue:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=w(!!t.isGeneral);return function(e,t){let r=e;return t.every(e=>!(!r||"object"!=typeof r||Array.isArray(r)||!(e in r)||(r=r[e],0)),e)}(_(!!t.sessionOnly),[this.slug.toString(),r,e])},removeValue:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=w(!!t.isGeneral);A(!!t.sessionOnly,t=>{const[n,i]=y(t,[this.slug.toString(),r]);return delete n[e],i})},setValue:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=w(!!r.isGeneral);A(!!r.sessionOnly,r=>{const[i,o]=y(r,[this.slug.toString(),n]);return i[e]=t,o})}});const C="RSA-PSS",x=async(e,t)=>await window.crypto.subtle.generateKey({name:e,modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:"SHA-256"},!1,t),S=async()=>await x("RSA-OAEP",["encrypt","decrypt"]),I=async()=>await x(C,["sign"]),T=async(e,t)=>{const r=(new TextEncoder).encode(t);return await window.crypto.subtle.sign({name:C,saltLength:32},e,r)};class M{constructor(e,t,r){this.slug=e,this.dbName=t,this.dbVersion=r}queryObjectStore(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{attemptToRecoverDB:i=!0}=r,o=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB||window.shimIndexedDB,a=`${this.slug}:${this.dbName}`,s=o.open(a,this.dbVersion||1);s.onupgradeneeded=()=>{var t;const r=s.result;(null===(t=null==r?void 0:r.objectStoreNames)||void 0===t?void 0:t.contains)&&!r.objectStoreNames.contains(e)&&r.createObjectStore(e,{keyPath:"key"})},s.onsuccess=()=>{const u=s.result;let c;try{c=u.transaction(e,(null==r?void 0:r.operation)||"readwrite")}catch(s){if(i&&s instanceof DOMException&&"NotFoundError"===s.name){u.close();return void(o.deleteDatabase(a).onsuccess=()=>{this.queryObjectStore(e,t,n(n({},r),{},{attemptToRecoverDB:!1}))})}throw s}const l=c.objectStore(e);t(l),c.oncomplete=()=>{u.close()}}}put(e,t,r){return new Promise((n,i)=>{this.queryObjectStore(e,e=>{const o=e.put({key:t,value:r});o.onsuccess=()=>{n(o.result)},o.onerror=e=>{i("Failed adding item to objectStore, err: "+e)}})})}add(e,t,r){return new Promise((n,i)=>{this.queryObjectStore(e,e=>{const o=e.add({key:t,value:r});o.onsuccess=()=>{n(o.result)},o.onerror=e=>{const t=e.target.error;i(t)}})})}get(e,t){return new Promise((r,n)=>{this.queryObjectStore(e,e=>{const i=e.get(t);i.onsuccess=()=>{var e;i.result?r(null===(e=i.result)||void 0===e?void 0:e.value):r(void 0)},i.onerror=e=>{n("Failed adding item to objectStore, err: "+e)}})})}getAll(e,t){return new Promise((r,n)=>{this.queryObjectStore(e,e=>{const i=e.getAll(null,t);i.onsuccess=()=>{if(i.result){const e=i.result;(null==e?void 0:e.length)?r(e.map(e=>null==e?void 0:e.value)):r(e)}else r([])},i.onerror=e=>{n("Failed getting items, err: "+e)}})})}delete(e,t){return new Promise((r,n)=>{this.queryObjectStore(e,e=>{const i=e.delete(t);i.onsuccess=()=>{r()},i.onerror=e=>{n(`Failed deleting key: '${t}' from objectStore, err: `+e)}})})}clear(e){return new Promise((t,r)=>{this.queryObjectStore(e,e=>{const n=e.clear();n.onsuccess=()=>{t()},n.onerror=e=>{r("Failed clearing objectStore, err: "+e)}})})}}const D="platform",R="init",O="completed",k="RSA2048",N=[R,O];class P{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"sign",r=arguments.length>2?arguments[2]:void 0;var n,i,o,a;this.agent=e,this.keysType=t,this.options=r,this._extractingKeysPromise=null;const s=!(null===(n=this.options)||void 0===n?void 0:n.productScope);this.keysDatabaseName=s||!(null===(i=this.options)||void 0===i?void 0:i.indexedDBName)?"ts_crypto_binding":this.options.indexedDBName,this.dbVersion=s?1:(null===(o=this.options)||void 0===o?void 0:o.dbVersion)||1,this.keysStoreName=s||!(null===(a=this.options)||void 0===a?void 0:a.keysStoreName)?"identifiers_store":this.options.keysStoreName,this.indexedDBClient=new M(s?D:e.slug,this.keysDatabaseName,this.dbVersion),this.indexedDBClientFallback=new M((s?D:e.slug)+`:${h.clientId}`,this.keysDatabaseName,this.dbVersion)}getKeysRecordKey(){return`${this.keysType}_keys`}getRotatedKeysRecordKey(){return`rotated_${this.keysType}_keys`}getRotatedKeysRecordKeyPending(){return`rotated_pending_${this.keysType}_keys`}arrayBufferToBase64(e){return window.btoa(String.fromCharCode(...new Uint8Array(e)))}async getPKRepresentations(e){const t=await crypto.subtle.exportKey("spki",e);return{arrayBufferKey:t,base64Key:this.arrayBufferToBase64(t)}}async generateKeyPair(){return"sign"==this.keysType?await I():await S()}async calcKeyIdentifier(e){const t=await crypto.subtle.digest("SHA-256",e);return Array.from(new Uint8Array(t)).map(e=>e.toString(16).padStart(2,"0")).join("")}async extractKeysData(){if(this._extractingKeysPromise)return this._extractingKeysPromise;this._extractingKeysPromise=(async()=>{var e,t;const r=(null===(t=null===(e=this.options)||void 0===e?void 0:e.keyRotation)||void 0===t?void 0:t.isEnabled)?await this.getRotatedKeysData():await this.getKeysData(),{base64Key:n}=await this.getPKRepresentations(r.publicKey);return this.publicKeyBase64=n,this.keyIdentifier=r.keyIdentifier,r})();try{return await this._extractingKeysPromise}finally{this._extractingKeysPromise=null}}async generateKeyPairData(e){const t=await this.generateKeyPair(),{arrayBufferKey:r}=await this.getPKRepresentations(t.publicKey),i=e||await this.calcKeyIdentifier(r);return n(n({},t),{},{keyIdentifier:i,createdDate:Date.now()})}shouldKeyBeRotated(e){var t;const r=null===(t=this.options)||void 0===t?void 0:t.keyRotation;if(!(null==r?void 0:r.isEnabled)||!r.expiryDays||void 0===r.startedAt)return!1;const n=24*r.expiryDays*60*60*1e3,i=e.createdDate&&e.createdDate>=r.startedAt?e.createdDate:r.startedAt;return Date.now()-i>n-2592e6}async extractMainKeysData(){return await this.indexedDBClient.get(this.keysStoreName,this.getKeysRecordKey())}async extractFallbackMainKeysData(){return await this.indexedDBClientFallback.get(this.keysStoreName,this.getKeysRecordKey())}async extractRotatedKeysData(){return await this.indexedDBClient.get(this.keysStoreName,this.getRotatedKeysRecordKey())}async extractPendingRotatedKeysData(){return await this.indexedDBClient.get(this.keysStoreName,this.getRotatedKeysRecordKeyPending())}async saveKeyData(e,t){try{return await this.indexedDBClient.add(this.keysStoreName,e,t),t}catch(t){if(t instanceof DOMException&&"ConstraintError"===t.name){const t=await this.indexedDBClient.get(this.keysStoreName,e);if(t)return t}throw t}}async getKeysData(){const e=this.getKeysRecordKey();let t=await this.extractMainKeysData();if(t)return t;if(t=await this.extractFallbackMainKeysData(),t)return this.saveKeyData(e,t);const r=await this.generateKeyPairData();return this.saveKeyData(e,r)}async getOrCreateRotatedKeys(){let e=await this.extractRotatedKeysData();if(!e){const t=this.getRotatedKeysRecordKey(),r=await this.getKeysData(),i=n(n({},r),{},{createdDate:r.createdDate||Date.now()});e=await this.saveKeyData(t,i)}return e}async getRotatedKeysData(){const e=await this.getOrCreateRotatedKeys();if(this.shouldKeyBeRotated(e)){if(!await this.extractPendingRotatedKeysData()){const t=this.getRotatedKeysRecordKeyPending(),r=await this.generateKeyPairData(e.keyIdentifier);await this.saveKeyData(t,r)}}return e}async getPublicData(){return this.publicKeyBase64&&this.keyIdentifier||await this.extractKeysData(),{publicKey:this.publicKeyBase64,keyIdentifier:this.keyIdentifier}}async sign(e){if("sign"==this.keysType){const{privateKey:t}=await this.extractKeysData(),r=await T(t,e);return this.arrayBufferToBase64(r)}throw new Error("keysType must be 'sign' in order to use sign keys")}async clearKeys(){const e=this.getKeysRecordKey();await this.indexedDBClient.delete(this.keysStoreName,e)}getBaseRotationPayload(){return{keyIdentifier:this.keyIdentifier,slot:this.getRotatedKeysRecordKey(),publicKey:this.publicKeyBase64,publicKeyType:k,tenantId:this.options.keyRotation.tenantId}}async getRotationData(){var e,t;if(!(null===(t=null===(e=this.options)||void 0===e?void 0:e.keyRotation)||void 0===t?void 0:t.isEnabled))return;this.publicKeyBase64&&this.keyIdentifier||await this.extractKeysData();const r=await this.extractPendingRotatedKeysData();if(r){const{base64Key:e}=await this.getPKRepresentations(r.publicKey),{privateKey:t}=await this.extractKeysData(),i=n(n({},this.getBaseRotationPayload()),{},{newPublicKey:e,createdDate:r.createdDate,newPublicKeyType:k}),o=JSON.stringify(i);return{data:o,signature:await this.signPayload(o,t)}}const i=await this.extractRotatedKeysData();if(i&&!1===i.confirmed){await this.extractKeysData();const e=JSON.stringify(this.getBaseRotationPayload());return{data:e,signature:await this.signPayload(e,i.privateKey)}}}async signPayload(e,t){const r=await T(t,e);return this.arrayBufferToBase64(r)}async handleRotateResponse(e){if(N.includes(e))if(e===R){const e=await this.extractPendingRotatedKeysData();if(e){await this.indexedDBClient.delete(this.keysStoreName,this.getRotatedKeysRecordKey());const t=n(n({},e),{},{confirmed:!1});await this.indexedDBClient.put(this.keysStoreName,this.getRotatedKeysRecordKey(),t),await this.indexedDBClient.delete(this.keysStoreName,this.getRotatedKeysRecordKeyPending());const{base64Key:r}=await this.getPKRepresentations(e.publicKey);this.publicKeyBase64=r,this.keyIdentifier=e.keyIdentifier}}else if(e===O){const e=await this.extractRotatedKeysData();e&&!1===e.confirmed&&await this.indexedDBClient.put(this.keysStoreName,this.getRotatedKeysRecordKey(),n(n({},e),{},{confirmed:!0}))}}}var B=Object.freeze({__proto__:null,createCryptoBinding:function(){return new P(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:"sign",arguments.length>1?arguments[1]:void 0)},generateRSAKeyPair:S,generateRSASignKeyPair:I,signAssymetric:T,verifyAssymetric:async(e,t,r)=>{const n=(new TextEncoder).encode(t);return await window.crypto.subtle.verify(C,e,r,n)}}),F=Object.freeze({__proto__:null});const L=a.create(e=>{class t extends Error{constructor(t,r){super(`${e.slug}-${t} ${r}`)}}return{TsError:t,TsInternalError:class extends t{constructor(e){super(e,"Internal error")}}}});var z=a.create(()=>n({exceptions:L},s));class U{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.agent=e,this.middlewares=t,this.logs=[]}info(e,t){this.pushLog(3,e,t)}warn(e,t){this.pushLog(4,e,t)}error(e,t){this.pushLog(5,e,t)}pushLog(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.logs.push({timestamp:Date.now(),module:this.agent.slug,severity:e,fields:r,message:t});const n=this.middlewares.map(e=>e(this));Promise.all(n).catch(()=>{})}}var j=Object.freeze({__proto__:null,consoleMiddleware:function(e){const t=e.logs[e.logs.length-1];console.log(`${t.severity} ${t.message}`,t.fields)},createSdkLogger:function(){return new U(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:[])}});function V(e,t){if(!(null==e?void 0:e.trim()))return"";if(function(e){try{return new URL(e),!0}catch(e){return!1}}(e))return e;const r="http://mock.com",n=new URL(r);n.search=(null==t?void 0:t.toString())||"",n.pathname=e;return n.href.replace(r,"")}const H={"Content-Type":"application/json","X-TS-client-time":(new Date).toUTCString(),"X-TS-ua":navigator.userAgent};function G(e,t,r){var i;const o=(a=t||{},encodeURI(JSON.stringify(a)).split(/%..|./).length-1);var a;return{method:e,headers:n(n(n({},{"X-TS-body-size":String(o)}),H),r||{}),body:null!==(i=t&&JSON.stringify(t||{}))&&void 0!==i?i:void 0}}function q(e,t,r,n,i){const o=V(e,n),a=G(t,r,i);return fetch(o,a)}async function W(e,t,r,n,i){let o;if(o=await q(e,t,r,n,i),!o.ok)throw new Error("Request failed");return o}var K=Object.freeze({__proto__:null,httpDelete:async function(e,t){const r=await W(e,"DELETE",void 0,void 0,t);return n(n({data:await r.json()},r),{},{headers:r.headers})},httpGet:async function(e,t,r){const i=await W(e,"GET",void 0,t,r);return n(n({data:await i.json()},i),{},{headers:i.headers})},httpPost:async function(e,t,r,i){const o=await W(e,"POST",t,r,i);return n(n({data:await o.json()},o),{},{headers:o.headers})},httpPut:async function(e,t,r,i){const o=await W(e,"PUT",t,r,i);return n(n({data:await o.json()},o),{},{headers:o.headers})},init:G}),X=a.create(()=>({events:d,moduleMetadata:p,mainEntry:m,utils:z,storage:E,crypto:B,indexedDB:F,logger:j,http:K})),Y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Z(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function J(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){if(this instanceof e){var r=[null];return r.push.apply(r,arguments),new(Function.bind.apply(t,r))}return t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}var $={},Q={};function ee(e){let t=e.length;for(;--t>=0;)e[t]=0}const te=256,re=286,ne=30,ie=15,oe=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),ae=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),se=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),ue=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ce=new Array(576);ee(ce);const le=new Array(60);ee(le);const de=new Array(512);ee(de);const he=new Array(256);ee(he);const fe=new Array(29);ee(fe);const pe=new Array(ne);function ge(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}let me,ye,ve;function be(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}ee(pe);const we=e=>e<256?de[e]:de[256+(e>>>7)],_e=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},Ae=(e,t,r)=>{e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,_e(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)},Ee=(e,t,r)=>{Ae(e,r[2*t],r[2*t+1])},Ce=(e,t)=>{let r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1},xe=(e,t,r)=>{const n=new Array(16);let i,o,a=0;for(i=1;i<=ie;i++)n[i]=a=a+r[i-1]<<1;for(o=0;o<=t;o++){let t=e[2*o+1];0!==t&&(e[2*o]=Ce(n[t]++,t))}},Se=e=>{let t;for(t=0;t<re;t++)e.dyn_ltree[2*t]=0;for(t=0;t<ne;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0},Ie=e=>{e.bi_valid>8?_e(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Te=(e,t,r,n)=>{const i=2*t,o=2*r;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]},Me=(e,t,r)=>{const n=e.heap[r];let i=r<<1;for(;i<=e.heap_len&&(i<e.heap_len&&Te(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!Te(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n},De=(e,t,r)=>{let n,i,o,a,s=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*s]<<8|e.pending_buf[e.d_buf+2*s+1],i=e.pending_buf[e.l_buf+s],s++,0===n?Ee(e,i,t):(o=he[i],Ee(e,o+te+1,t),a=oe[o],0!==a&&(i-=fe[o],Ae(e,i,a)),n--,o=we(n),Ee(e,o,r),a=ae[o],0!==a&&(n-=pe[o],Ae(e,n,a)))}while(s<e.last_lit);Ee(e,256,t)},Re=(e,t)=>{const r=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems;let a,s,u,c=-1;for(e.heap_len=0,e.heap_max=573,a=0;a<o;a++)0!==r[2*a]?(e.heap[++e.heap_len]=c=a,e.depth[a]=0):r[2*a+1]=0;for(;e.heap_len<2;)u=e.heap[++e.heap_len]=c<2?++c:0,r[2*u]=1,e.depth[u]=0,e.opt_len--,i&&(e.static_len-=n[2*u+1]);for(t.max_code=c,a=e.heap_len>>1;a>=1;a--)Me(e,r,a);u=o;do{a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Me(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,r[2*u]=r[2*a]+r[2*s],e.depth[u]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,r[2*a+1]=r[2*s+1]=u,e.heap[1]=u++,Me(e,r,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,u=t.stat_desc.max_length;let c,l,d,h,f,p,g=0;for(h=0;h<=ie;h++)e.bl_count[h]=0;for(r[2*e.heap[e.heap_max]+1]=0,c=e.heap_max+1;c<573;c++)l=e.heap[c],h=r[2*r[2*l+1]+1]+1,h>u&&(h=u,g++),r[2*l+1]=h,l>n||(e.bl_count[h]++,f=0,l>=s&&(f=a[l-s]),p=r[2*l],e.opt_len+=p*(h+f),o&&(e.static_len+=p*(i[2*l+1]+f)));if(0!==g){do{for(h=u-1;0===e.bl_count[h];)h--;e.bl_count[h]--,e.bl_count[h+1]+=2,e.bl_count[u]--,g-=2}while(g>0);for(h=u;0!==h;h--)for(l=e.bl_count[h];0!==l;)d=e.heap[--c],d>n||(r[2*d+1]!==h&&(e.opt_len+=(h-r[2*d+1])*r[2*d],r[2*d+1]=h),l--)}})(e,t),xe(r,c,e.bl_count)},Oe=(e,t,r)=>{let n,i,o=-1,a=t[1],s=0,u=7,c=4;for(0===a&&(u=138,c=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=t[2*(n+1)+1],++s<u&&i===a||(s<c?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,o=i,0===a?(u=138,c=3):i===a?(u=6,c=3):(u=7,c=4))},ke=(e,t,r)=>{let n,i,o=-1,a=t[1],s=0,u=7,c=4;for(0===a&&(u=138,c=3),n=0;n<=r;n++)if(i=a,a=t[2*(n+1)+1],!(++s<u&&i===a)){if(s<c)do{Ee(e,i,e.bl_tree)}while(0!==--s);else 0!==i?(i!==o&&(Ee(e,i,e.bl_tree),s--),Ee(e,16,e.bl_tree),Ae(e,s-3,2)):s<=10?(Ee(e,17,e.bl_tree),Ae(e,s-3,3)):(Ee(e,18,e.bl_tree),Ae(e,s-11,7));s=0,o=i,0===a?(u=138,c=3):i===a?(u=6,c=3):(u=7,c=4)}};let Ne=!1;const Pe=(e,t,r,n)=>{Ae(e,0+(n?1:0),3),((e,t,r,n)=>{Ie(e),n&&(_e(e,r),_e(e,~r)),e.pending_buf.set(e.window.subarray(t,t+r),e.pending),e.pending+=r})(e,t,r,!0)};Q._tr_init=e=>{Ne||((()=>{let e,t,r,n,i;const o=new Array(16);for(r=0,n=0;n<28;n++)for(fe[n]=r,e=0;e<1<<oe[n];e++)he[r++]=n;for(he[r-1]=n,i=0,n=0;n<16;n++)for(pe[n]=i,e=0;e<1<<ae[n];e++)de[i++]=n;for(i>>=7;n<ne;n++)for(pe[n]=i<<7,e=0;e<1<<ae[n]-7;e++)de[256+i++]=n;for(t=0;t<=ie;t++)o[t]=0;for(e=0;e<=143;)ce[2*e+1]=8,e++,o[8]++;for(;e<=255;)ce[2*e+1]=9,e++,o[9]++;for(;e<=279;)ce[2*e+1]=7,e++,o[7]++;for(;e<=287;)ce[2*e+1]=8,e++,o[8]++;for(xe(ce,287,o),e=0;e<ne;e++)le[2*e+1]=5,le[2*e]=Ce(e,5);me=new ge(ce,oe,257,re,ie),ye=new ge(le,ae,0,ne,ie),ve=new ge(new Array(0),se,0,19,7)})(),Ne=!0),e.l_desc=new be(e.dyn_ltree,me),e.d_desc=new be(e.dyn_dtree,ye),e.bl_desc=new be(e.bl_tree,ve),e.bi_buf=0,e.bi_valid=0,Se(e)},Q._tr_stored_block=Pe,Q._tr_flush_block=(e,t,r,n)=>{let i,o,a=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<te;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),Re(e,e.l_desc),Re(e,e.d_desc),a=(e=>{let t;for(Oe(e,e.dyn_ltree,e.l_desc.max_code),Oe(e,e.dyn_dtree,e.d_desc.max_code),Re(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*ue[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),i=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?Pe(e,t,r,n):4===e.strategy||o===i?(Ae(e,2+(n?1:0),3),De(e,ce,le)):(Ae(e,4+(n?1:0),3),((e,t,r,n)=>{let i;for(Ae(e,t-257,5),Ae(e,r-1,5),Ae(e,n-4,4),i=0;i<n;i++)Ae(e,e.bl_tree[2*ue[i]+1],3);ke(e,e.dyn_ltree,t-1),ke(e,e.dyn_dtree,r-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),De(e,e.dyn_ltree,e.dyn_dtree)),Se(e),n&&Ie(e)},Q._tr_tally=(e,t,r)=>(e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(he[r]+te+1)]++,e.dyn_dtree[2*we(t)]++),e.last_lit===e.lit_bufsize-1),Q._tr_align=e=>{Ae(e,2,3),Ee(e,256,ce),(e=>{16===e.bi_valid?(_e(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)};var Be=(e,t,r,n)=>{let i=65535&e,o=e>>>16&65535,a=0;for(;0!==r;){a=r>2e3?2e3:r,r-=a;do{i=i+t[n++]|0,o=o+i|0}while(--a);i%=65521,o%=65521}return i|o<<16};const Fe=new Uint32Array((()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t})());var Le=(e,t,r,n)=>{const i=Fe,o=n+r;e^=-1;for(let r=n;r<o;r++)e=e>>>8^i[255&(e^t[r])];return-1^e},ze={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Ue={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:je,_tr_stored_block:Ve,_tr_flush_block:He,_tr_tally:Ge,_tr_align:qe}=Q,We=Be,Ke=Le,Xe=ze,{Z_NO_FLUSH:Ye,Z_PARTIAL_FLUSH:Ze,Z_FULL_FLUSH:Je,Z_FINISH:$e,Z_BLOCK:Qe,Z_OK:et,Z_STREAM_END:tt,Z_STREAM_ERROR:rt,Z_DATA_ERROR:nt,Z_BUF_ERROR:it,Z_DEFAULT_COMPRESSION:ot,Z_FILTERED:at,Z_HUFFMAN_ONLY:st,Z_RLE:ut,Z_FIXED:ct,Z_DEFAULT_STRATEGY:lt,Z_UNKNOWN:dt,Z_DEFLATED:ht}=Ue,ft=258,pt=262,gt=103,mt=113,yt=666,vt=(e,t)=>(e.msg=Xe[t],t),bt=e=>(e<<1)-(e>4?9:0),wt=e=>{let t=e.length;for(;--t>=0;)e[t]=0};let _t=(e,t,r)=>(t<<e.hash_shift^r)&e.hash_mask;const At=e=>{const t=e.state;let r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+r),e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))},Et=(e,t)=>{He(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,At(e.strm)},Ct=(e,t)=>{e.pending_buf[e.pending++]=t},xt=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},St=(e,t,r,n)=>{let i=e.avail_in;return i>n&&(i=n),0===i?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),r),1===e.state.wrap?e.adler=We(e.adler,t,i,r):2===e.state.wrap&&(e.adler=Ke(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)},It=(e,t)=>{let r,n,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match;const u=e.strstart>e.w_size-pt?e.strstart-(e.w_size-pt):0,c=e.window,l=e.w_mask,d=e.prev,h=e.strstart+ft;let f=c[o+a-1],p=c[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(r=t,c[r+a]===p&&c[r+a-1]===f&&c[r]===c[o]&&c[++r]===c[o+1]){o+=2,r++;do{}while(c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&o<h);if(n=ft-(h-o),o=h-ft,n>a){if(e.match_start=t,a=n,n>=s)break;f=c[o+a-1],p=c[o+a]}}}while((t=d[t&l])>u&&0!==--i);return a<=e.lookahead?a:e.lookahead},Tt=e=>{const t=e.w_size;let r,n,i,o,a;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-pt)){e.window.set(e.window.subarray(t,t+t),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,r=n;do{i=e.head[--r],e.head[r]=i>=t?i-t:0}while(--n);n=t,r=n;do{i=e.prev[--r],e.prev[r]=i>=t?i-t:0}while(--n);o+=t}if(0===e.strm.avail_in)break;if(n=St(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=n,e.lookahead+e.insert>=3)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=_t(e,e.ins_h,e.window[a+1]);e.insert&&(e.ins_h=_t(e,e.ins_h,e.window[a+3-1]),e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<pt&&0!==e.strm.avail_in)},Mt=(e,t)=>{let r,n;for(;;){if(e.lookahead<pt){if(Tt(e),e.lookahead<pt&&t===Ye)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=_t(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-pt&&(e.match_length=It(e,r)),e.match_length>=3)if(n=Ge(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=_t(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!==--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=_t(e,e.ins_h,e.window[e.strstart+1]);else n=Ge(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(Et(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===$e?(Et(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(Et(e,!1),0===e.strm.avail_out)?1:2},Dt=(e,t)=>{let r,n,i;for(;;){if(e.lookahead<pt){if(Tt(e),e.lookahead<pt&&t===Ye)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=_t(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-pt&&(e.match_length=It(e,r),e.match_length<=5&&(e.strategy===at||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=Ge(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=_t(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!==--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(Et(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(n=Ge(e,0,e.window[e.strstart-1]),n&&Et(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=Ge(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===$e?(Et(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(Et(e,!1),0===e.strm.avail_out)?1:2};function Rt(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}const Ot=[new Rt(0,0,0,0,(e,t)=>{let r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Tt(e),0===e.lookahead&&t===Ye)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;const n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,Et(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-pt&&(Et(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===$e?(Et(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(Et(e,!1),e.strm.avail_out),1)}),new Rt(4,4,8,4,Mt),new Rt(4,5,16,8,Mt),new Rt(4,6,32,32,Mt),new Rt(4,4,16,16,Dt),new Rt(8,16,32,32,Dt),new Rt(8,16,128,128,Dt),new Rt(8,32,128,256,Dt),new Rt(32,128,258,1024,Dt),new Rt(32,258,258,4096,Dt)];function kt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ht,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),wt(this.dyn_ltree),wt(this.dyn_dtree),wt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),wt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),wt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Nt=e=>{if(!e||!e.state)return vt(e,rt);e.total_in=e.total_out=0,e.data_type=dt;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:mt,e.adler=2===t.wrap?0:1,t.last_flush=Ye,je(t),et},Pt=e=>{const t=Nt(e);return t===et&&(e=>{e.window_size=2*e.w_size,wt(e.head),e.max_lazy_match=Ot[e.level].max_lazy,e.good_match=Ot[e.level].good_length,e.nice_match=Ot[e.level].nice_length,e.max_chain_length=Ot[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0})(e.state),t},Bt=(e,t,r,n,i,o)=>{if(!e)return rt;let a=1;if(t===ot&&(t=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),i<1||i>9||r!==ht||n<8||n>15||t<0||t>9||o<0||o>ct)return vt(e,rt);8===n&&(n=9);const s=new kt;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new Uint8Array(2*s.w_size),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new Uint8Array(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=t,s.strategy=o,s.method=r,Pt(e)};$.deflateInit=(e,t)=>Bt(e,t,ht,15,8,lt),$.deflateInit2=Bt,$.deflateReset=Pt,$.deflateResetKeep=Nt,$.deflateSetHeader=(e,t)=>e&&e.state?2!==e.state.wrap?rt:(e.state.gzhead=t,et):rt,$.deflate=(e,t)=>{let r,n;if(!e||!e.state||t>Qe||t<0)return e?vt(e,rt):rt;const i=e.state;if(!e.output||!e.input&&0!==e.avail_in||i.status===yt&&t!==$e)return vt(e,0===e.avail_out?it:rt);i.strm=e;const o=i.last_flush;if(i.last_flush=t,42===i.status)if(2===i.wrap)e.adler=0,Ct(i,31),Ct(i,139),Ct(i,8),i.gzhead?(Ct(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),Ct(i,255&i.gzhead.time),Ct(i,i.gzhead.time>>8&255),Ct(i,i.gzhead.time>>16&255),Ct(i,i.gzhead.time>>24&255),Ct(i,9===i.level?2:i.strategy>=st||i.level<2?4:0),Ct(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(Ct(i,255&i.gzhead.extra.length),Ct(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=Ke(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(Ct(i,0),Ct(i,0),Ct(i,0),Ct(i,0),Ct(i,0),Ct(i,9===i.level?2:i.strategy>=st||i.level<2?4:0),Ct(i,3),i.status=mt);else{let t=ht+(i.w_bits-8<<4)<<8,r=-1;r=i.strategy>=st||i.level<2?0:i.level<6?1:6===i.level?2:3,t|=r<<6,0!==i.strstart&&(t|=32),t+=31-t%31,i.status=mt,xt(i,t),0!==i.strstart&&(xt(i,e.adler>>>16),xt(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(r=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>r&&(e.adler=Ke(e.adler,i.pending_buf,i.pending-r,r)),At(e),r=i.pending,i.pending!==i.pending_buf_size));)Ct(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>r&&(e.adler=Ke(e.adler,i.pending_buf,i.pending-r,r)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){r=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(e.adler=Ke(e.adler,i.pending_buf,i.pending-r,r)),At(e),r=i.pending,i.pending===i.pending_buf_size)){n=1;break}n=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,Ct(i,n)}while(0!==n);i.gzhead.hcrc&&i.pending>r&&(e.adler=Ke(e.adler,i.pending_buf,i.pending-r,r)),0===n&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){r=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(e.adler=Ke(e.adler,i.pending_buf,i.pending-r,r)),At(e),r=i.pending,i.pending===i.pending_buf_size)){n=1;break}n=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,Ct(i,n)}while(0!==n);i.gzhead.hcrc&&i.pending>r&&(e.adler=Ke(e.adler,i.pending_buf,i.pending-r,r)),0===n&&(i.status=gt)}else i.status=gt;if(i.status===gt&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&At(e),i.pending+2<=i.pending_buf_size&&(Ct(i,255&e.adler),Ct(i,e.adler>>8&255),e.adler=0,i.status=mt)):i.status=mt),0!==i.pending){if(At(e),0===e.avail_out)return i.last_flush=-1,et}else if(0===e.avail_in&&bt(t)<=bt(o)&&t!==$e)return vt(e,it);if(i.status===yt&&0!==e.avail_in)return vt(e,it);if(0!==e.avail_in||0!==i.lookahead||t!==Ye&&i.status!==yt){let r=i.strategy===st?((e,t)=>{let r;for(;;){if(0===e.lookahead&&(Tt(e),0===e.lookahead)){if(t===Ye)return 1;break}if(e.match_length=0,r=Ge(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(Et(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===$e?(Et(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(Et(e,!1),0===e.strm.avail_out)?1:2})(i,t):i.strategy===ut?((e,t)=>{let r,n,i,o;const a=e.window;for(;;){if(e.lookahead<=ft){if(Tt(e),e.lookahead<=ft&&t===Ye)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=e.strstart-1,n=a[i],n===a[++i]&&n===a[++i]&&n===a[++i])){o=e.strstart+ft;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<o);e.match_length=ft-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=Ge(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Ge(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(Et(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===$e?(Et(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(Et(e,!1),0===e.strm.avail_out)?1:2})(i,t):Ot[i.level].func(i,t);if(3!==r&&4!==r||(i.status=yt),1===r||3===r)return 0===e.avail_out&&(i.last_flush=-1),et;if(2===r&&(t===Ze?qe(i):t!==Qe&&(Ve(i,0,0,!1),t===Je&&(wt(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),At(e),0===e.avail_out))return i.last_flush=-1,et}return t!==$e?et:i.wrap<=0?tt:(2===i.wrap?(Ct(i,255&e.adler),Ct(i,e.adler>>8&255),Ct(i,e.adler>>16&255),Ct(i,e.adler>>24&255),Ct(i,255&e.total_in),Ct(i,e.total_in>>8&255),Ct(i,e.total_in>>16&255),Ct(i,e.total_in>>24&255)):(xt(i,e.adler>>>16),xt(i,65535&e.adler)),At(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?et:tt)},$.deflateEnd=e=>{if(!e||!e.state)return rt;const t=e.state.status;return 42!==t&&69!==t&&73!==t&&91!==t&&t!==gt&&t!==mt&&t!==yt?vt(e,rt):(e.state=null,t===mt?vt(e,nt):et)},$.deflateSetDictionary=(e,t)=>{let r=t.length;if(!e||!e.state)return rt;const n=e.state,i=n.wrap;if(2===i||1===i&&42!==n.status||n.lookahead)return rt;if(1===i&&(e.adler=We(e.adler,t,r,0)),n.wrap=0,r>=n.w_size){0===i&&(wt(n.head),n.strstart=0,n.block_start=0,n.insert=0);let e=new Uint8Array(n.w_size);e.set(t.subarray(r-n.w_size,r),0),t=e,r=n.w_size}const o=e.avail_in,a=e.next_in,s=e.input;for(e.avail_in=r,e.next_in=0,e.input=t,Tt(n);n.lookahead>=3;){let e=n.strstart,t=n.lookahead-2;do{n.ins_h=_t(n,n.ins_h,n.window[e+3-1]),n.prev[e&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=e,e++}while(--t);n.strstart=e,n.lookahead=2,Tt(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,e.next_in=a,e.input=s,e.avail_in=o,n.wrap=i,et},$.deflateInfo="pako deflate (from Nodeca project)";var Ft={};const Lt=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);Ft.assign=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(const t in r)Lt(r,t)&&(e[t]=r[t])}}return e},Ft.flattenChunks=e=>{let t=0;for(let r=0,n=e.length;r<n;r++)t+=e[r].length;const r=new Uint8Array(t);for(let t=0,n=0,i=e.length;t<i;t++){let i=e[t];r.set(i,n),n+=i.length}return r};var zt={};let Ut=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){Ut=!1}const jt=new Uint8Array(256);for(let e=0;e<256;e++)jt[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;jt[254]=jt[254]=1,zt.string2buf=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,r,n,i,o,a=e.length,s=0;for(i=0;i<a;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<a&&(n=e.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(s),o=0,i=0;o<s;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<a&&(n=e.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t};zt.buf2string=(e,t)=>{const r=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let n,i;const o=new Array(2*r);for(i=0,n=0;n<r;){let t=e[n++];if(t<128){o[i++]=t;continue}let a=jt[t];if(a>4)o[i++]=65533,n+=a-1;else{for(t&=2===a?31:3===a?15:7;a>1&&n<r;)t=t<<6|63&e[n++],a--;a>1?o[i++]=65533:t<65536?o[i++]=t:(t-=65536,o[i++]=55296|t>>10&1023,o[i++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&Ut)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let r="";for(let n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r})(o,i)},zt.utf8border=(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let r=t-1;for(;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+jt[e[r]]>t?r:t};const Vt=$,Ht=Ft,Gt=zt,qt=ze,Wt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Kt=Object.prototype.toString,{Z_NO_FLUSH:Xt,Z_SYNC_FLUSH:Yt,Z_FULL_FLUSH:Zt,Z_FINISH:Jt,Z_OK:$t,Z_STREAM_END:Qt,Z_DEFAULT_COMPRESSION:er,Z_DEFAULT_STRATEGY:tr,Z_DEFLATED:rr}=Ue;function nr(e){this.options=Ht.assign({level:er,method:rr,chunkSize:16384,windowBits:15,memLevel:8,strategy:tr},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Wt,this.strm.avail_out=0;let r=Vt.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==$t)throw new Error(qt[r]);if(t.header&&Vt.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?Gt.string2buf(t.dictionary):"[object ArrayBuffer]"===Kt.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,r=Vt.deflateSetDictionary(this.strm,e),r!==$t)throw new Error(qt[r]);this._dict_set=!0}}nr.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize;let i,o;if(this.ended)return!1;for(o=t===~~t?t:!0===t?Jt:Xt,"string"==typeof e?r.input=Gt.string2buf(e):"[object ArrayBuffer]"===Kt.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(o===Yt||o===Zt)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(i=Vt.deflate(r,o),i===Qt)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=Vt.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===$t;if(0!==r.avail_out){if(o>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},nr.prototype.onData=function(e){this.chunks.push(e)},nr.prototype.onEnd=function(e){e===$t&&(this.result=Ht.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var ir=function(e,t){return(t=t||{}).gzip=!0,function(e,t){const r=new nr(t);if(r.push(e,!0),r.err)throw r.msg||qt[r.err];return r.result}(e,t)};const or=["enabled","userId"];var ar,sr,ur=["drs"];ar=ur,sr=226,function(e){for(;--e;)ar.push(ar.shift())}(++sr);var cr,lr,dr,hr=new X((cr="0x0",ur[cr-=0])),fr=["setItem","FALLBACK_SESSION_STORAGE","FALLBACK_LOCAL_STORAGE","clientId","setClientId","getFullStorageKey","getItemSessionStorageSafe","sessionStorage","setItemSessionStorageSafe","removeItemSessionStorageSafe","removeItem","getItemLocalStorageSafe","localStorage","getItem","setItemLocalStorageSafe"];lr=fr,dr=286,function(e){for(;--e;)lr.push(lr.shift())}(++dr);var pr=function(e,t){return fr[e-=0]};class gr{constructor(e){this[pr("0x0")]={},this[pr("0x1")]={},this[pr("0x2")]=e}getClientId(){return this[pr("0x2")]}[pr("0x3")](e){this[pr("0x2")]=e}[pr("0x4")](e){return this.clientId+"_"+e}[pr("0x5")](e){const t=this.getFullStorageKey(e);try{return window[pr("0x6")].getItem(t)}catch(e){return this.FALLBACK_SESSION_STORAGE[t]}}[pr("0x7")](e,t){const r=this[pr("0x4")](e);try{window.sessionStorage.setItem(r,t)}catch(e){this[pr("0x0")][r]=t}}[pr("0x8")](e){const t=this[pr("0x4")](e);try{window[pr("0x6")][pr("0x9")](t)}catch(e){this[pr("0x0")][t]=void 0}}[pr("0xa")](e){const t=this[pr("0x4")](e);try{return window[pr("0xb")][pr("0xc")](t)}catch(e){return this.FALLBACK_LOCAL_STORAGE[t]}}[pr("0xd")](e,t){const r=this[pr("0x4")](e);try{window[pr("0xb")][pr("0xe")](r,t)}catch(e){this[pr("0x1")][r]=t}}removeItemLocalStorageSafe(e){const t=this[pr("0x4")](e);try{window[pr("0xb")].removeItem(t)}catch(e){this[pr("0x1")][t]=void 0}}}var mr,yr,vr=["unshift","middlewares","map","all","enabled","logPrefix","logs","info","pushLog","warn","%s %s %s","stringify","push","formatter","length","logsLimit"];mr=vr,yr=212,function(e){for(;--e;)mr.push(mr.shift())}(++yr);var br=function(e,t){return vr[e-=0]};class wr{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this[br("0x0")]=e,this[br("0x1")]="[AccountProtection SDK]",this.logsLimit=1e4,this[br("0x2")]=[],this.middlewares=[]}[br("0x3")](e,t){this[br("0x4")](3,e,t)}[br("0x5")](e,t){this.pushLog(4,e,t)}error(e,t){this[br("0x4")](5,e,t)}flush(){const e=this[br("0x2")];return this[br("0x2")]=[],e}[br("0x4")](e,t,r){this.enabled&&console.log(br("0x6"),this[br("0x1")],t,JSON[br("0x7")](r)),this[br("0x2")][br("0x8")]({timestamp:Date.now(),severity:e,text:JSON[br("0x7")](n(n({},r),{},{message:t}),this[br("0x9")])}),this.logs[br("0xa")]>this[br("0xb")]&&this[br("0x2")][br("0xc")]();const i=this[br("0xd")][br("0xe")](e=>e());Promise[br("0xf")](i).catch(()=>{})}[br("0x9")](e,t){if(t instanceof Error){const{name:e,stack:r,message:n}=t;return{name:e,stack:r,message:n}}return t}}const _r=new wr;var Ar,Er,Cr=["error loading config","shouldUpdateConf","getConfValue","now","refreshConf","keys","length","stringify","conf","timestamp","ric","storageManager","loadConf","fetchConf","getData","error","error fetching config","getItemLocalStorageSafe","parse"];Ar=Cr,Er=104,function(e){for(;--e;)Ar.push(Ar.shift())}(++Er);var xr=function(e,t){return Cr[e-=0]};const Sr=xr("0x0"),Ir=xr("0x1");class Tr{constructor(e,t){this[xr("0x2")]=e,this.requestsManager=t,this.conf=this[xr("0x3")]()}async[xr("0x4")](e){try{const t="device/conf?tenantId="+e,r=await this.requestsManager[xr("0x5")](t);return null!=r?r:{}}catch(t){return _r[xr("0x6")](xr("0x7"),{clientId:e,error:t}),{}}}[xr("0x3")](){const e=this.storageManager[xr("0x8")](Ir);if(null!=e)try{return JSON[xr("0x9")](e)}catch(e){_r[xr("0x6")](xr("0xa"),{error:e})}return{}}[xr("0xb")](){const e=this[xr("0xc")](Sr,0);return Date[xr("0xd")]()-e>36e5}async[xr("0xe")](e){if(!this[xr("0xb")]())return!1;let t=await this.fetchConf(e);return 0==Object[xr("0xf")](t)[xr("0x10")]?t=this[xr("0x3")]():this.storageManager.setItemLocalStorageSafe(Ir,JSON[xr("0x11")](t)),this.conf=t,!0}[xr("0xc")](e,t){const r=void 0!==this.conf?this[xr("0x12")][e]:void 0;return null!=r?r:t}}var Mr,Dr,Rr=["EVENT_TYPE_ACTION","action","EVENT_TYPE_DEVICE","device","interaction","EVENT_TYPE_IDENTIFICATION","desktop_web","mobile_web"];Mr=Rr,Dr=328,function(e){for(;--e;)Mr.push(Mr.shift())}(++Dr);var Or,kr,Nr=function(e,t){return Rr[e-=0]};(kr=Or||(Or={}))[Nr("0x0")]=Nr("0x1"),kr[Nr("0x2")]=Nr("0x3"),kr.EVENT_TYPE_INTERACTION=Nr("0x4"),kr[Nr("0x5")]="identification";const Pr=Nr("0x6"),Br=Nr("0x7");var Fr,Lr,zr=["push","maintainLastXItems","length","splice"];Fr=zr,Lr=313,function(e){for(;--e;)Fr.push(Fr.shift())}(++Lr);var Ur=function(e,t){return zr[e-=0]};class jr{static[Ur("0x0")](e,t,r){return e[Ur("0x1")]>=t&&e[Ur("0x2")](0,1),e[Ur("0x3")](r),e}}var Vr,Hr,Gr=["firesTouchEvents","target","bufferSize","cancelable","metaKey","sourceCapabilities","isTrusted","composed","location","view","buffer","collect","maintainLastXItems","data","getData","now","extractButtonsPressedData","ctrlKey","altKey","shiftKey","buttons","offsetX","offsetY"];Vr=Gr,Hr=240,function(e){for(;--e;)Vr.push(Vr.shift())}(++Hr);var qr=function(e,t){return Gr[e-=0]};class Wr{constructor(e){this.data=[],this[qr("0x0")]=e}[qr("0x1")](e){const t=this.extractEventData(e);jr[qr("0x2")](this[qr("0x3")],this[qr("0x0")],t)}[qr("0x4")](){return this[qr("0x3")]}extractEventData(e){return n({x:e.x,y:e.y,tspl:Date[qr("0x5")]()},this[qr("0x6")](e))}[qr("0x6")](e){return n(n(n(n({},e[qr("0x7")]&&{ctrlKey:!0}),e[qr("0x8")]&&{altKey:!0}),e[qr("0x9")]&&{shiftKey:!0}),0!=e[qr("0xa")]&&{buttons:e[qr("0xa")]})}}class Kr{constructor(e){this[qr("0x3")]=[],this[qr("0x0")]=e}collect(e){var t;const r={x:e.x,y:e.y,timestamp:Date[qr("0x5")](),mouseButtonType:e.detail,offsetX:e[qr("0xb")],offsetY:e[qr("0xc")],isPressed:null==(null===(t=e.sourceCapabilities)||void 0===t?void 0:t.firesTouchEvents)?null:!e.sourceCapabilities[qr("0xd")],target_id:e[qr("0xe")].id};jr[qr("0x2")](this.data,this[qr("0x0")],r)}getData(){const e=[...this[qr("0x3")]];return this.data=[],e}}class Xr{constructor(e){this.data=[],this[qr("0xf")]=e}collect(e){var t;const r={isTrusted:e.isTrusted,cancelable:e[qr("0x10")],composed:e.composed,isView:!!e.view,shiftKey:e.shiftKey,metaKey:e[qr("0x11")],firesTouchEvents:null===(t=e[qr("0x12")])||void 0===t?void 0:t[qr("0xd")],timestamp:Date[qr("0x5")]()};jr[qr("0x2")](this[qr("0x3")],this[qr("0xf")],r)}[qr("0x4")](){const e=[...this[qr("0x3")]];return this[qr("0x3")]=[],e}}class Yr{constructor(e){this[qr("0x3")]=[],this[qr("0xf")]=e}collect(e){var t;const r={isTrusted:e[qr("0x13")],cancelable:e[qr("0x10")],composed:e[qr("0x14")],isView:!!e.view,location:e[qr("0x15")],shiftKey:e[qr("0x9")],firesTouchEvents:null===(t=e[qr("0x12")])||void 0===t?void 0:t.firesTouchEvents,timestamp:Date[qr("0x5")]()};jr[qr("0x2")](this[qr("0x3")],this[qr("0xf")],r)}[qr("0x4")](){const e=this[qr("0x3")];return this[qr("0x3")]=[],e}}class Zr{constructor(e){this[qr("0x3")]=[],this.bufferSize=e}[qr("0x1")](e){const t={isTrusted:e[qr("0x13")],cancelable:e[qr("0x10")],composed:e[qr("0x14")],inputType:e.inputType,isView:!!e[qr("0x16")],timestamp:Date[qr("0x5")]()};jr.maintainLastXItems(this[qr("0x3")],this.bufferSize,t)}[qr("0x4")](){const e=this.data;return this.data=[],e}}class Jr{constructor(e){this[qr("0x3")]=[],this[qr("0xf")]=e}[qr("0x1")](e){const t={isTrusted:e.isTrusted,cancelable:e[qr("0x10")],composed:e[qr("0x14")],timestamp:Date.now()};jr[qr("0x2")](this.data,this[qr("0xf")],t)}[qr("0x4")](){const e=this[qr("0x3")];return this[qr("0x3")]=[],e}}var $r,Qr,en=["eventTypesToAttach","forEach","location","href","change","click","paste","mouseup","submit","keyup","keydown","input","focusout","SELECT","TEXTAREA","deviceEventDataCollectionIgnoreList","mouseEventsCollectionBuffer","safeEventCallback","interactionEventsCollectorsData","detail","sourceCapabilities","firesTouchEvents","offsetX","offsetY","target","isTrusted","cancelable","composed","clipboardData","dropEffect","effectAllowed","inputTypeFilter","keys","dataset","virtualKeyboard","overlaysContent","tagName","entries","includes","addSafeInteractionListener","error","Error while adding listener","filter","collect","getGenericAttributes","getAttachedData","handleEvent","error adding interaction listener"];$r=en,Qr=196,function(e){for(;--e;)$r.push($r.shift())}(++Qr);var tn=function(e,t){return en[e-=0]};const rn=tn("0x0"),nn=tn("0x1"),on=tn("0x2"),an="mousemove",sn=tn("0x3"),un="mousedown",cn=tn("0x4"),ln=tn("0x5"),dn=tn("0x6"),hn=tn("0x7"),fn=tn("0x8"),pn=["INPUT",tn("0x9"),tn("0xa")];class gn{constructor(e,t,r){this[tn("0xb")]=e,this[tn("0xc")]=t,this[tn("0xd")]=r,this[tn("0xe")]={[nn]:{eventTypesToAttach:[an,sn,un],attributesMapper:e=>{var t;return{x:e.x,y:e.y,mouseButtonType:e[tn("0xf")],isPressed:null==(null===(t=e[tn("0x10")])||void 0===t?void 0:t.firesTouchEvents)?null:!e.sourceCapabilities[tn("0x11")],offsetX:e[tn("0x12")],offsetY:e[tn("0x13")],target_id:e[tn("0x14")].id}}},[on]:{attributesMapper:e=>({target_id:e.target.id,isTrusted:e[tn("0x15")],cancelable:e[tn("0x16")],composed:e[tn("0x17")],dropEffect:e[tn("0x18")][tn("0x19")],effectAllowed:e[tn("0x18")][tn("0x1a")]})},[cn]:{attributesMapper:e=>({target_id:e.target.id})},[an]:{continousCollectors:[new Wr(this[tn("0xc")])]},[sn]:{continousCollectors:[new Kr(1)]},[un]:{continousCollectors:[new Kr(1)]},[fn]:{eventTypesToAttach:[hn,ln,dn,rn],filter:this[tn("0x1b")],attributesMapper:e=>{const{target:t,isTrusted:r,cancelable:i,composed:o}=e;return n({target_id:t.id,dataset_keys:Object[tn("0x1c")](t[tn("0x1d")]||{}),isTrusted:r,cancelable:i,composed:o},navigator.virtualKeyboard&&{navigator_virtualKeyboard:navigator[tn("0x1e")][tn("0x1f")]})}},[hn]:{filter:this[tn("0x1b")],continousCollectors:[new Zr(50)]},[ln]:{filter:this[tn("0x1b")],continousCollectors:[new Yr(50)]},[dn]:{filter:this[tn("0x1b")],continousCollectors:[new Xr(50)]},[rn]:{continousCollectors:[new Jr(50)]}}}[tn("0x1b")](e){var t;const r=null===(t=e.target)||void 0===t?void 0:t[tn("0x20")];return pn.includes(r)}registerEventListeners(){for(const[e,t]of Object[tn("0x21")](this[tn("0xe")]))if(!this[tn("0xb")][tn("0x22")](e))try{this[tn("0x23")](e,t)}catch(t){_r[tn("0x24")](tn("0x25"),{error:t,eventType:e})}}[tn("0x26")](e,t){return!e[tn("0x26")]||e[tn("0x26")](t)}async handleEvent(e,t,r){const{attributesMapper:i,continousCollectors:o}=e;if(!this[tn("0x26")](e,t))return!1;if(o)o.forEach(e=>{e[tn("0x27")](t)});else{const e=this[tn("0x28")](),o=this[tn("0x29")](r),a=n(n(n({},e),i(t)),o&&{attachedEventsData:o});await this[tn("0xd")](r,a)}return!0}[tn("0x23")](e,t){window.addEventListener(e,async r=>{try{await this[tn("0x2a")](t,r,e)}catch(e){_r[tn("0x24")](tn("0x2b"),{error:e})}})}[tn("0x29")](e){let t;const r=this.interactionEventsCollectorsData[e][tn("0x2c")];return r&&(t={},r[tn("0x2d")](e=>{const{continousCollectors:r}=this[tn("0xe")][e];r&&r.forEach(r=>t[e]=r.getData())})),t}getGenericAttributes(){return{location:window[tn("0x2e")][tn("0x2f")]}}}var mn,yn,vn=["finally","userAgentData","getHighEntropyValues","architecture","model","platform","platformVersion","fullVersionList","bitness","mobile","uaFullVersion","resolve","setTimeout","race","catch","warn","executor reached timeout","name"];mn=vn,yn=127,function(e){for(;--e;)mn.push(mn.shift())}(++yn);var bn=function(e,t){return vn[e-=0]};function wn(){var e;return null===(e=navigator[bn("0x0")])||void 0===e?void 0:e[bn("0x1")]([bn("0x2"),bn("0x3"),bn("0x4"),bn("0x5"),bn("0x6"),bn("0x7"),bn("0x8"),"wow64",bn("0x9")])}function _n(e,t){let r;const n=[Promise[bn("0xa")](e()).catch(()=>{}),new Promise((e,n)=>r=window[bn("0xb")](n,t))];return Promise[bn("0xc")](n)[bn("0xd")](()=>_r[bn("0xe")](bn("0xf"),{fnName:e[bn("0x10")]}))[bn("0x11")](()=>clearTimeout(r))}var An,En,Cn=["__selenium_evaluate","__selenium_unwrapped","__webdriver__chr","__webdriver_evaluate","__webdriver_script_fn","__webdriver_script_func","__webdriver_unwrapped","__webdriverFuncgeb","cdc_adoQpoasnfa76pfcZLmcfl_Array","cdc_adoQpoasnfa76pfcZLmcfl_Symbol","chrome_asyncScriptInfo","fmget_targets","geb","OSMJIF","spynner_additional_js_loaded","watinExpressionError","watinExpressionResult","high","standard","no-preference","low","less","1000","active","none","inverted","rec2020","srgb","matchMedia","matches","log","sqrt","exp","acos","asin","asinh","atanh","sin","sinh","cos","cosh","tan","tanh","expm1","length","hashCodeString","sessionStorage","localStorage","external","toString","indexOf","Sequentum","getNavigatorBasedKeys","webdriver","__fxdriver_evaluate","_selenium","calledSelenium","ChromeDriverw","webdriver-evaluate","selenium-evaluate","webdriverCommand","__webdriverFunc","__lastWatirConfirm","$cdc_asdjflasutopfhvcZLmcfl_","product","getNavigatorUAData","userAgentData","storage","estimate","onLine","userActivation","isActive","permissions","state","sendBeacon","function","hardwareConcurrency","get","languages","platform","timing","memory","msMaxTouchPoints","ontouchstart","push","type","plugins","description","getScreen","screen","availWidth","height","width","orientation","angle","outerWidth","getWebDriver","cpuClass","oscpu","HTMLElement","productSub","getMediaDevices","mediaDevices","enumerateDevices","label","deviceId","groupId","webkitOfflineAudioContext","createOscillator","frequency","threshold","knee","ratio","attack","connect","destination","oncomplete","renderedBuffer","startRendering","getChannelData","subarray","getHash","triangle","createAnalyser","start","disconnect","getFloatTimeDomainData","reduction","mmMwWLliI0O&1","sans-serif","serif","sans-serif-thin","ARNO PRO","Arabic Typesetting","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","Franklin Gothic","Futura Bk BT","Futura Md BT","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Small Fonts","Univers CE 55 Medium","Vrinda","ZWAdobeF","div","style","visibility","hidden","createElement","position","absolute","top","left","fontFamily","appendChild","map","some","offsetWidth","offsetHeight","body","filter","removeChild","language","__webdriver_script_function","__driver_evaluate","__fxdriver_unwrapped","DateTimeFormat","resolvedOptions","timeZone","vendor","getBuildID","buildID","textBaseline","alphabetic","#f60","fillRect","#069","font",'11pt "Times New Roman"',"fromCharCode","fillText","rgba(102, 204, 0, 0.2)","toDataURL","globalCompositeOperation","multiply","#f2f","#ff2","fillStyle","beginPath","arc","fill","#f9c","evenodd","rect","isPointInPath","canvas","getContext","charging","chargingTime","dischargingTime","getBrave","brave","webgl","webgl-experimental","getExtension","WEBGL_debug_renderer_info","UNMASKED_RENDERER_WEBGL","getCodesTests","video","canPlayType",'video/mp4; codecs="avc1.42E01E"',"video/mp4;;Codecs =avc1.42E01E","getPublicData","only screen and (max-width: 600px)","deviceDataCalculationExpiry","reduce","abs","storageManager","configManager","cryptoBinding","calculate","getConfValue","dataPointsExtractor","lastDeviceData","setItemLocalStorageSafe","now","getItemLocalStorageSafe","sdkDeviceDataCollectionIgnoreList","dataPoints","getBattery","getCanvasFingerprint","getConnection","getCookieEnabled","getDeviceMemory","getDocumentBasedKeys","getHardwareConcurrency","getIndexedDB","getFIDOEnabled","getLanguages","getLanguage","getTimezoneOffset","getLocalStorage","getNavigatorProduct","getNavigatorUserAgent","getNavigatorHighEntropyData","navigatorStorageEstimation","navigatorOnLine","navigatorIsUserActive","getMathFingerprint","getMediaMatch","getOpenDatabase","getWindowOrientation","getPlatform","getCpuClass","getOsCpu","getAddBehavior","getProductSub","getAudioFingerprint","getAudioFingerprintExtended","getFonts","getPerformanceTiming","getPerformanceMemory","getPlugins","hasSequentum","getSessionStorage","getReferrer","getTimezone","getTouchSupport","getVendor","getWebGlRenderer","getWindowBasedKeys","getWindowOuter","getCryptoBindingData","bind","getNavigatorPermissionsState","notifications","geolocation","isGeoLocationExists","isSendBeaconFunction","getNavigatorPrototype","getInstalledRelatedApps","windowConstructorAliasTest","CDPRuntimeDomainTest","defineProperty","stack","console","debug","windowDocumentAuxVarsTest","Object","getOwnPropertyNames","document","values","getOwnPropertyDescriptors","value","cache_","getPrototypeOf","storeItem","isNodeReachable_","sort","every","test","Array","Symbol","name","getAsyncToken","collectPromisesData","startPromisesLoop","entries","warn","worker throw error","resolve","worker promise rejected","cookieEnabled","credentials","PublicKeyCredential","getCryptoRandomValues","crypto","getRandomValues","from","webRTCDisabled","chrome","safari","__crWeb","yandex","__yb","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice","_phantom","__phantomas","callPhantom","Buffer","emit","spawn","domAutomationController","domAutomation","__nightmare","callSelenium","_Selenium_IDE_Recorder","__$webdriverAsyncExecutor","__driver_unwrapped","__lastWatirAlert","__lastWatirPrompt"];An=Cn,En=243,function(e){for(;--e;)An.push(An.shift())}(++En);var xn=function(e,t){return Cn[e-=0]};const Sn=xn("0x0"),In=e=>e?[...e][xn("0x1")]((e,t)=>e+Math[xn("0x2")](t),0):0;class Tn{constructor(e,t,r){this[xn("0x3")]=e,this[xn("0x4")]=t,this[xn("0x5")]=r}async[xn("0x6")](){const e=this[xn("0x4")][xn("0x7")]("sdkDeviceDataCollectionIgnoreList",[]),t=this[xn("0x4")].getConfValue(Sn,36e5),r=await new Mn(e,this[xn("0x5")])[xn("0x8")]();return this[xn("0x9")]=r,this[xn("0x3")][xn("0xa")](Sn,Date[xn("0xb")]()+t),r}async getDeviceData(){return Number(this[xn("0x3")][xn("0xc")](Sn))<Date[xn("0xb")]()||!this[xn("0x9")]?await this[xn("0x6")]()||{}:this.lastDeviceData||{}}}class Mn{constructor(e,t){this[xn("0xd")]=e,this[xn("0x5")]=t,this[xn("0xe")]={battery:this[xn("0xf")],brave:this.getBrave,canvas:this[xn("0x10")],codecs:this.getCodesTests,connection:this[xn("0x11")],cookieEnabled:this[xn("0x12")],cryptoRandomValues:this.getCryptoRandomValues,deviceMemory:this[xn("0x13")],documentBasedKeys:this[xn("0x14")],hardwareConcurrency:this[xn("0x15")],indexedDB:this[xn("0x16")],fidoEnabled:this[xn("0x17")],languages:this[xn("0x18")],language:this[xn("0x19")],timezoneOffset:this[xn("0x1a")],localStorage:this[xn("0x1b")],navigatorBasedKeys:this.getNavigatorBasedKeys,navigatorProduct:this[xn("0x1c")],navigatorUserAgent:this[xn("0x1d")],navigatorUAData:this.getNavigatorUAData,navigatorHighEntropyData:this[xn("0x1e")],navigatorStorageEstimation:this[xn("0x1f")],navigatorOnLine:this[xn("0x20")],navigatorIsUserActive:this[xn("0x21")],math:this[xn("0x22")],mediaMatch:this[xn("0x23")],openDatabase:this[xn("0x24")],windowOrientation:this[xn("0x25")],platform:this[xn("0x26")],cpuClass:this[xn("0x27")],osClass:this[xn("0x28")],addBehavior:this[xn("0x29")],productSub:this[xn("0x2a")],mediaDevices:this.getMediaDevices,audioFingerprint:this[xn("0x2b")],audioFingerprintExtended:this[xn("0x2c")],fonts:this[xn("0x2d")],performanceTiming:this[xn("0x2e")],performanceMemory:this[xn("0x2f")],plugins:this[xn("0x30")],screen:this.getScreen,sequentum:this[xn("0x31")],sessionStorage:this[xn("0x32")],referrer:this[xn("0x33")],timezone:this[xn("0x34")],touchSupport:this[xn("0x35")],vendor:this[xn("0x36")],buildID:this.getBuildID,webdriver:this.getWebDriver,webGlRenderer:this[xn("0x37")],windowBasedKeys:this[xn("0x38")],windowOuter:this[xn("0x39")],webRTCDisabled:this.webRTCDisabled,cryptoBindingData:this[xn("0x3a")][xn("0x3b")](this),notificationState:this[xn("0x3c")].bind(this,xn("0x3d")),geolocationState:this[xn("0x3c")].bind(this,xn("0x3e")),isGeoLocationExists:this[xn("0x3f")],isSendBeaconExists:this[xn("0x40")],navigatorPrototype:this[xn("0x41")],installedRelatedApps:this[xn("0x42")],windowConstructorAliasTest:this[xn("0x43")],windowDocumentAuxVarsTest:this.windowDocumentAuxVarsTest,CDPRuntimeDomainTest:this[xn("0x44")]}}CDPRuntimeDomainTest(){let e=!1;const t=new window.Error;return window.Object[xn("0x45")](t,xn("0x46"),{configurable:!1,enumerable:!1,get:function(){return e=!0,""}}),window[xn("0x47")][xn("0x48")](t[xn("0x46")]),e}[xn("0x49")](){for(const e of window[xn("0x4a")][xn("0x4b")](window[xn("0x4c")]))if("$chrome_asyncScriptInfo"==e||/^\$cdc_[a-zA-Z0-9]{22}_$/.test(e))return!0;for(const e of window.Object[xn("0x4d")](window[xn("0x4a")][xn("0x4e")](window[xn("0x4c")]))){if(!e[xn("0x4f")]||void 0===e[xn("0x4f")][xn("0x50")])continue;const t=window[xn("0x4a")][xn("0x4b")](window[xn("0x4a")][xn("0x51")](e.value)),r=[xn("0x52"),"retrieveItem",xn("0x53")];if(t[xn("0x54")](),r[xn("0x54")](),t[xn("0x55")]((e,t)=>e==r[t]))return!0}return!1}[xn("0x43")](){const e=window.Object.getOwnPropertyNames(window);for(const t of e){if(/^cdc_[a-zA-Z0-9]{22}_(Array|Promise|Symbol)$/[xn("0x56")](t))return!0;for(const e of[window[xn("0x57")],window.Promise,window[xn("0x58")]])if(t!=(null==e?void 0:e[xn("0x59")])&&"token"!=t&&t!=xn("0x5a")&&window[t]===e)return!0}return!1}async dataPointsExtractor(){const e=this.startPromisesLoop();return await this[xn("0x5b")](e)}[xn("0x5c")](){const e={};for(const[t,r]of Object[xn("0x5d")](this.dataPoints))if(!this[xn("0xd")].includes(t))try{e[t]=_n(r,100)}catch(r){_r[xn("0x5e")](xn("0x5f"),{e:r,key:t}),e[t]=Promise[xn("0x60")]()}return e}async[xn("0x5b")](e){const t={};for(const[r,n]of Object[xn("0x5d")](e))try{t[r]=await n}catch(e){_r[xn("0x5e")](xn("0x61"),{e:e,key:r}),t[r]=void 0}return t}getCookieEnabled(){const e=navigator[xn("0x62")];return Promise[xn("0x60")](e)}async getFIDOEnabled(){return!!navigator[xn("0x63")]&&await window[xn("0x64")].isUserVerifyingPlatformAuthenticatorAvailable()}[xn("0x65")](){const e=window[xn("0x66")][xn("0x67")](new Uint8Array(16));return Array[xn("0x68")](e)}[xn("0x69")](){const e=null==window.RTCPeerConnection;return Promise[xn("0x60")](e)}[xn("0x38")](){const e=[xn("0x6a"),xn("0x6b"),xn("0x6c"),"__gCrWeb",xn("0x6d"),xn("0x6e"),"__ybro","__firefox__",xn("0x6f"),xn("0x70"),xn("0x71"),xn("0x72"),xn("0x73"),xn("0x74"),xn("0x75"),xn("0x76"),xn("0x77"),xn("0x78"),xn("0x79"),xn("0x7a"),xn("0x7b"),xn("0x7c"),xn("0x7d"),xn("0x7e"),"_selenium","calledSelenium",xn("0x7f"),xn("0x80"),xn("0x81"),"__driver_evaluate",xn("0x82"),"__fxdriver_evaluate","__fxdriver_unwrapped",xn("0x83"),"__lastWatirConfirm",xn("0x84"),xn("0x85"),xn("0x86"),xn("0x87"),xn("0x88"),xn("0x89"),xn("0x8a"),"__webdriver_script_function",xn("0x8b"),xn("0x8c"),"awesomium","calledPhantom",xn("0x8d"),"cdc_adoQpoasnfa76pfcZLmcfl_Promise",xn("0x8e"),xn("0x8f"),xn("0x90"),xn("0x91"),xn("0x92"),xn("0x93"),xn("0x94"),xn("0x95")],t=[];for(const r of e){const e=window[r];void 0!==e&&null!=e&&t.push(r)}return Promise.resolve(t)}[xn("0x23")](){const e={"dynamic-range":[xn("0x96"),xn("0x97")],"prefers-reduced-motion":[xn("0x98"),xn("0x1")],"prefers-contrast":[xn("0x98"),xn("0x96"),xn("0x99"),"more",xn("0x9a"),"forced"],"max-monochrome":["0","10","100",xn("0x9b")],"forced-colors":[xn("0x9c"),xn("0x9d")],"inverted-colors":[xn("0x9e"),xn("0x9d")],"color-gamut":[xn("0x9f"),"p3",xn("0xa0")]},t={};for(const[r,n]of Object[xn("0x5d")](e))for(const e of n)t[r.replace(/-/g,"_")+"_"+e.replace(/-/g,"_")]=window[xn("0xa1")]("("+r+": "+e+")")[xn("0xa2")];return Promise[xn("0x60")](t)}getMathFingerprint(){const e=[Math[xn("0xa6")](.12312423423423424),Math.acosh(1e308),(t=1e154,Math[xn("0xa3")](t+Math[xn("0xa4")](t*t-1))),Math[xn("0xa7")](.12312423423423424),Math[xn("0xa8")](1),Math[xn("0xa3")](1+Math[xn("0xa4")](2)),Math[xn("0xa9")](.5),Math[xn("0xa3")](3)/2,Math.atan(.5),Math[xn("0xaa")](-1e300),Math[xn("0xab")](1),Math.exp(1)-1/Math[xn("0xa5")](1)/2,Math[xn("0xac")](10.000000000123),Math[xn("0xad")](1),(Math[xn("0xa5")](1)+1/Math[xn("0xa5")](1))/2,Math[xn("0xae")](-1e300),Math[xn("0xaf")](1),(Math[xn("0xa5")](2)-1)/(Math[xn("0xa5")](2)+1),Math[xn("0xa5")](1),Math[xn("0xb0")](1),Math[xn("0xa5")](1)-1,Math.log1p(10),Math.log(11),Math.PI**-100];var t;let r="";for(let t=0;t<e[xn("0xb1")];t++)r+=e[t].toString();return Promise[xn("0x60")](Mn[xn("0xb2")](r))}[xn("0x11")](){const{connection:e}=navigator,t=(e=>{let{downlink:t,effectiveType:r,rtt:n,saveData:i}=e;return{downlink:t,effectiveType:r,rtt:n,saveData:i}})(e);return Promise[xn("0x60")](t)}[xn("0x32")](){return Promise[xn("0x60")](!!window[xn("0xb3")])}[xn("0x1b")](){return Promise[xn("0x60")](!!window[xn("0xb4")])}[xn("0x31")](){return-1!==window[xn("0xb5")][xn("0xb6")]()[xn("0xb7")](xn("0xb8"))}[xn("0xb9")](){return[xn("0xba"),"__driver_evaluate",xn("0x88"),xn("0x85"),xn("0xbb"),xn("0x82"),xn("0x8b"),xn("0x86"),"__fxdriver_unwrapped",xn("0x80"),xn("0xbc"),xn("0xbd"),"_WEBDRIVER_ELEM_CACHE",xn("0xbe"),"driver-evaluate",xn("0xbf"),xn("0xc0"),xn("0xc1"),"webdriver-evaluate-response",xn("0xc2"),xn("0x89"),xn("0x81"),xn("0x83"),xn("0xc3"),"__lastWatirPrompt","$chrome_asyncScriptInfo",xn("0xc4"),"serviceWorker"].filter(e=>navigator[e])}[xn("0x1c")](){const e=navigator[xn("0xc5")];return Promise[xn("0x60")](e)}getNavigatorUserAgent(){return navigator.userAgent}[xn("0xc6")](){return navigator[xn("0xc7")]}getNavigatorHighEntropyData(){return wn()}[xn("0x1f")](){return navigator[xn("0xc8")][xn("0xc9")]()}navigatorOnLine(){return navigator[xn("0xca")]}[xn("0x21")](){return navigator[xn("0xcb")][xn("0xcc")]}async getNavigatorPermissionsState(e){try{const t=await navigator[xn("0xcd")].query({name:e});return null==t?void 0:t[xn("0xce")]}catch(e){}}[xn("0x3f")](){return!!navigator[xn("0x3e")]}[xn("0x40")](){return typeof navigator[xn("0xcf")]===xn("0xd0")}getNavigatorPrototype(){return{hardwareConcurrency:Object.getOwnPropertyDescriptor(Object[xn("0x51")](navigator),xn("0xd1"))[xn("0xd2")][xn("0xb6")](),languages:Object.getOwnPropertyDescriptor(Object[xn("0x51")](navigator),xn("0xd3"))[xn("0xd2")][xn("0xb6")]()}}async getInstalledRelatedApps(){if(typeof navigator[xn("0x42")]===xn("0xd0"))try{const{related_applications:e}=await navigator[xn("0x42")]();if(e&&Array.isArray(e))return e.map(e=>({platform:e[xn("0xd4")],url:e.url}))}catch(e){}}getReferrer(){return document.referrer}[xn("0x2e")](){return performance[xn("0xd5")]}getPerformanceMemory(){const{jsHeapSizeLimit:e,totalJSHeapSize:t,usedJSHeapSize:r}=performance[xn("0xd6")];return{jsHeapSizeLimit:e,totalJSHeapSize:t,usedJSHeapSize:r}}getIndexedDB(){return Promise[xn("0x60")](!!window.indexedDB)}getOpenDatabase(){const{openDatabase:e}=window;return Promise.resolve(!!e)}[xn("0x35")](){const e=window.DocumentTouch&&document instanceof DocumentTouch,t={maxTouchPoints:navigator.maxTouchPoints||navigator[xn("0xd7")]||0,documentTouch:e,ontouchstart:xn("0xd8")in window};return Promise.resolve(t)}getPlugins(){function e(e){const t=[];for(let r=0;r<e.length;++r)t[xn("0xd9")]({type:e[r][xn("0xda")],suffixes:e[r].suffixes});return t}const t=[];for(let r=0;r<navigator[xn("0xdb")][xn("0xb1")];++r){const n=navigator[xn("0xdb")][r];n&&t[xn("0xd9")]({name:n.name,description:n[xn("0xdc")],mimeTypes:e(n)})}return Promise.resolve(t)}[xn("0xdd")](){const e=window[xn("0xde")]||screen,{availLeft:t}=e,{availTop:r}=e,n={availHeight:e.availHeight,availLeft:t,availTop:r,availWidth:e[xn("0xdf")],colorDepth:e.colorDepth,height:e[xn("0xe0")],width:e[xn("0xe1")],pixelDepth:e.pixelDepth,orientationAngle:e[xn("0xe2")]&&e[xn("0xe2")][xn("0xe3")],orientationType:e[xn("0xe2")]&&e[xn("0xe2")][xn("0xda")],devicePixelRatio:window.devicePixelRatio};return Promise[xn("0x60")](n)}static[xn("0xb2")](e){if(null==e)return;let t=0,r=0;const n=e[xn("0xb1")];for(;r<n;)t=(t<<5)-t+e.charCodeAt(r++)|0;return t}[xn("0x39")](){const e={outerWidth:window[xn("0xe4")],outerHeight:window.outerHeight};return Promise[xn("0x60")](e)}[xn("0xe5")](){const e=navigator.webdriver;return Promise[xn("0x60")](e)}[xn("0x25")](){const e=window.orientation;return Promise[xn("0x60")](e)}[xn("0x26")](){const e=navigator[xn("0xd4")];return Promise[xn("0x60")](e)}[xn("0x27")](){const e=navigator[xn("0xe6")];return Promise.resolve(e)}[xn("0x28")](){const e=navigator[xn("0xe7")];return Promise[xn("0x60")](e)}getAddBehavior(){const e=!!window[xn("0xe8")].prototype.addBehavior;return Promise[xn("0x60")](e)}[xn("0x2a")](){const e=navigator[xn("0xe9")];return Promise[xn("0x60")](e)}async[xn("0xea")](){const e=await navigator[xn("0xeb")][xn("0xec")](),t=[];for(const r of e)t[xn("0xd9")]({kind:r.kind,label:r[xn("0xed")],deviceId:r[xn("0xee")],groupId:r[xn("0xef")]});return t}async getAudioFingerprint(){const e=window.OfflineAudioContext||window[xn("0xf0")];if(!e)return-1;const t=new e(1,5e3,44100),r=t[xn("0xf1")]();r[xn("0xda")]="triangle",r[xn("0xf2")][xn("0x4f")]=1e4;const n=t.createDynamicsCompressor();n[xn("0xf3")][xn("0x4f")]=-50,n[xn("0xf4")].value=40,n[xn("0xf5")][xn("0x4f")]=12,n[xn("0xf6")][xn("0x4f")]=0,n.release.value=.25,r[xn("0xf7")](n),n[xn("0xf7")](t[xn("0xf8")]),r.start(0);const i=new Promise(async(e,r)=>{t[xn("0xf9")]=t=>e(t[xn("0xfa")]);try{await t[xn("0xfb")]()}catch(e){r(e)}}),o=(await i)[xn("0xfc")](0)[xn("0xfd")](4500);return Mn[xn("0xfe")](o)}async[xn("0x2c")](){var e;const t=window.OfflineAudioContext||window.webkitOfflineAudioContext;if(!t)return{};const r=new t(1,5e3,44100),n=r[xn("0xf1")]();n[xn("0xda")]=xn("0xff"),n[xn("0xf2")][xn("0x4f")]=1e4;const i=r.createDynamicsCompressor();i[xn("0xf3")].value=-50,i.knee.value=40,i[xn("0xf6")][xn("0x4f")]=0;const o=r[xn("0x100")]();n[xn("0xf7")](i),i[xn("0xf7")](o),i[xn("0xf7")](r[xn("0xf8")]),n[xn("0x101")](0);try{await r[xn("0xfb")](),i[xn("0x102")](),n[xn("0x102")]();const t=new Float32Array(o.frequencyBinCount);null===(e=o.getFloatFrequencyData)||void 0===e||e.call(o,t);const a=new Float32Array(o.fftSize);return xn("0x103")in o&&o[xn("0x103")](a),{gain:i[xn("0x104")][xn("0x4f")]||i[xn("0x104")],freq:In(t),time:In(a)}}catch(e){return{}}}static[xn("0xfe")](e){let t=0;for(let r=0;r<e.length;++r)t+=Math[xn("0x2")](e[r]);return t}[xn("0x2d")](){const e=xn("0x105"),t=["monospace",xn("0x106"),xn("0x107")],r=[xn("0x108"),xn("0x109"),"Agency FB",xn("0x10a"),"Arial Unicode MS","AvantGarde Bk BT",xn("0x10b"),xn("0x10c"),xn("0x10d"),xn("0x10e"),xn("0x10f"),xn("0x110"),xn("0x111"),"EUROSTILE",xn("0x112"),xn("0x113"),xn("0x114"),"GOTHAM",xn("0x115"),xn("0x116"),xn("0x117"),xn("0x118"),"Humanst521 BT",xn("0x119"),xn("0x11a"),xn("0x11b"),xn("0x11c"),xn("0x11d"),xn("0x11e"),xn("0x11f"),xn("0x120"),xn("0x121"),xn("0x122"),xn("0x123"),xn("0x124"),xn("0x125"),xn("0x126"),xn("0x127"),xn("0x128"),xn("0x129"),xn("0x12a"),xn("0x12b"),xn("0x12c"),xn("0x12d"),"Serifa","SimHei",xn("0x12e"),"Staccato222 BT","TRAJAN PRO",xn("0x12f"),xn("0x130"),xn("0x131")],n=document.createElement(xn("0x132"));n[xn("0x133")][xn("0x134")]=xn("0x135");const i={},o={},a=t=>{const r=document[xn("0x136")]("span"),{style:i}=r;return i[xn("0x137")]=xn("0x138"),i[xn("0x139")]="0",i[xn("0x13a")]="0",i[xn("0x13b")]=t,i.fontSize="10px",r.textContent=e,n[xn("0x13c")](r),r},s=(e,t)=>a("'"+e+"',"+t),u=t[xn("0x13d")](a),c=(()=>{const e={};for(const n of r)e[n]=t[xn("0x13d")](e=>s(n,e));return e})();document[xn("0x141")][xn("0x13c")](n);try{for(let e=0;e<t[xn("0xb1")];e++)i[t[e]]=u[e][xn("0x13f")],o[t[e]]=u[e].offsetHeight;const e=r[xn("0x142")](e=>{return r=c[e],t[xn("0x13e")]((e,t)=>r[t][xn("0x13f")]!==i[e]||r[t][xn("0x140")]!==o[e]);var r});return Promise[xn("0x60")](e)}finally{document[xn("0x141")][xn("0x143")](n)}}[xn("0x1a")](){const e=(new Date).getTimezoneOffset();return Promise[xn("0x60")](e)}getLanguage(){const e=navigator[xn("0x144")];return Promise[xn("0x60")](e)}[xn("0x18")](){const e=navigator[xn("0xd3")];return Promise[xn("0x60")](e)}[xn("0x15")](){const e=navigator[xn("0xd1")];return Promise[xn("0x60")](e)}[xn("0x13")](){const e=navigator.deviceMemory;return Promise[xn("0x60")](e)}[xn("0x14")](){return[xn("0x88"),xn("0x85"),xn("0x145"),xn("0x8a"),xn("0x89"),xn("0xbb"),xn("0x82"),xn("0x8b"),xn("0x146"),xn("0x86"),xn("0x147")][xn("0x142")](e=>document[e])}[xn("0x34")](){const e=Intl[xn("0x148")]()[xn("0x149")]()[xn("0x14a")];return Promise.resolve(e)}[xn("0x36")](){const e=navigator[xn("0x14b")];return Promise.resolve(e)}[xn("0x14c")](){const e=navigator[xn("0x14d")];return Promise.resolve(e)}async getCanvasFingerprint(){const e=document.createElement(xn("0x165"));e[xn("0xe1")]=1,e[xn("0xe0")]=1;const t=e[xn("0x166")]("2d"),r={winding:function(e){return e[xn("0x163")](0,0,10,10),e[xn("0x163")](2,2,6,6),!e[xn("0x164")](5,5,"evenodd")}(t),geometry:function(e,t){e[xn("0xe1")]=122,e.height=110,t[xn("0x159")]=xn("0x15a");const r=[[xn("0x15b"),40,40],["#2ff",80,40],[xn("0x15c"),60,80]];for(const[e,n,i]of r)t[xn("0x15d")]=e,t[xn("0x15e")](),t[xn("0x15f")](n,i,40,0,2*Math.PI,!0),t.closePath(),t[xn("0x160")]();return t[xn("0x15d")]=xn("0x161"),t[xn("0x15f")](60,60,60,0,2*Math.PI,!0),t[xn("0x15f")](60,60,20,0,2*Math.PI,!0),t[xn("0x160")](xn("0x162")),Mn[xn("0xb2")](e.toDataURL())}(e,t),text:function(e,t){e[xn("0xe1")]=240,e[xn("0xe0")]=60,t[xn("0x14e")]=xn("0x14f"),t.fillStyle=xn("0x150"),t[xn("0x151")](100,1,62,20),t.fillStyle=xn("0x152"),t[xn("0x153")]=xn("0x154");const r="Cwm fjordbank gly "+String[xn("0x155")](55357,56835);return t[xn("0x156")](r,2,15),t.fillStyle=xn("0x157"),t.font="18pt Arial",t.fillText(r,4,45),Mn[xn("0xb2")](e[xn("0x158")]())}(e,t)};return Promise[xn("0x60")](r)}async[xn("0xf")](){const e=await navigator[xn("0xf")]();return{charging:e[xn("0x167")],chargingTime:e[xn("0x168")],dischargingTime:e[xn("0x169")],level:e.level}}async[xn("0x16a")](){return!!navigator[xn("0x16b")]&&await navigator[xn("0x16b")].isBrave()}async getWebGlRenderer(){const e=document[xn("0x136")](xn("0x165")),t=e[xn("0x166")](xn("0x16c"))||e[xn("0x166")](xn("0x16d")),r=t[xn("0x16e")](xn("0x16f"));return Promise[xn("0x60")](t.getParameter(r[xn("0x170")]))}async[xn("0x171")](){const e=document[xn("0x136")](xn("0x172")),t={basic:""===e[xn("0x173")](xn("0x174")),advanced:""===e[xn("0x173")](xn("0x175"))};return Promise[xn("0x60")](t)}async getCryptoBindingData(){const{publicKey:e,keyIdentifier:t}=await this[xn("0x5")][xn("0x176")]();return{publicKey:e,keyIdentifier:t}}static isMobile(){return/iPhone|iPad|iPod|Android|MiuiBrowser/i.test(navigator.userAgent)||null!=window.orientation||window.matchMedia(xn("0x177")).matches}}var Dn,Rn,On=["compress","compressed","uncompressed","ALLOW","CHALLENGE","DENY","TRUST"];Dn=On,Rn=203,function(e){for(;--e;)Dn.push(Dn.shift())}(++Rn);var kn,Nn,Pn,Bn,Fn=function(e,t){return On[e-=0]};(Nn=kn||(kn={}))[Fn("0x0")]=Fn("0x1"),Nn[Fn("0x2")]="uncompressed",(Bn=Pn||(Pn={}))[Fn("0x3")]=Fn("0x3"),Bn[Fn("0x4")]=Fn("0x4"),Bn[Fn("0x5")]=Fn("0x5"),Bn[Fn("0x6")]=Fn("0x6");var Ln,zn,Un=["importKey","jwk","SHA-256","encryptPayload","configManager","generateSymKey","crypto","subtle","AES-GCM","decrypt","string","encode","encrypt","encryptSymKeyBundle","raw","arrayBufferToBase64","stringify","RSA-OAEP","byteLength","fromCharCode","importPublicKey"];Ln=Un,zn=172,function(e){for(;--e;)Ln.push(Ln.shift())}(++zn);var jn=function(e,t){return Un[e-=0]};class Vn{constructor(e){this[jn("0x0")]=e}[jn("0x1")](){return window[jn("0x2")][jn("0x3")].generateKey({name:jn("0x4"),length:256},!0,["encrypt",jn("0x5")])}async encryptPayload(e,t){const r=typeof e===jn("0x6")?(new TextEncoder)[jn("0x7")](e):e,n=window.crypto.getRandomValues(new Uint8Array(12)),i={name:jn("0x4"),iv:n},o=await window[jn("0x2")][jn("0x3")][jn("0x8")](i,t,r);return{payloadCipherText:this.arrayBufferToBase64(o),iv:n}}async[jn("0x9")](e,t,r){const n=await window[jn("0x2")].subtle.exportKey(jn("0xa"),e),i=this.arrayBufferToBase64(n),o=this[jn("0xb")](t),a=(new TextEncoder)[jn("0x7")](JSON[jn("0xc")]({symKey:i,iv:o})),s=await window[jn("0x2")][jn("0x3")][jn("0x8")]({name:jn("0xd")},r,a);return this[jn("0xb")](s)}[jn("0xb")](e){let t="";const r=new Uint8Array(e),n=r[jn("0xe")];for(let e=0;e<n;e++)t+=String[jn("0xf")](r[e]);return window.btoa(t)}[jn("0x10")](e){return window[jn("0x2")].subtle[jn("0x11")](jn("0x12"),JSON.parse(e),{name:jn("0xd"),hash:jn("0x13")},!0,["encrypt"])}async[jn("0x8")](e,t){if(!window[jn("0x2")]||!window[jn("0x2")].subtle)throw new Error("crypto is not supported");const r=await this.generateSymKey(),{payloadCipherText:n,iv:i}=await this[jn("0x14")](t,r),o=await this[jn("0x10")](e);return{encryptedData:n,encryptedKey:await this[jn("0x9")](r,i,o)}}}var Hn,Gn,qn=["SERVER","COMMUNICATION","communication","error","errorSpace","errorCode","message","toString","name","SDKError: ",", errorSpace: ",", errorCode: ","CLIENT","client"];Hn=qn,Gn=446,function(e){for(;--e;)Hn.push(Hn.shift())}(++Gn);var Wn,Kn,Xn=function(e,t){return qn[e-=0]};(Kn=Wn||(Wn={}))[Xn("0x0")]=Xn("0x1"),Kn[Xn("0x2")]="server",Kn[Xn("0x3")]=Xn("0x4");class Yn extends Error{constructor(e,t,r){var n,i;super(),this[Xn("0x5")]=e,this[Xn("0x6")]=t,this[Xn("0x7")]=r,this.message=(null===(n=this[Xn("0x5")])||void 0===n?void 0:n[Xn("0x8")])||this.error[Xn("0x9")](),this[Xn("0xa")]=(null===(i=this.error)||void 0===i?void 0:i[Xn("0xa")])||Yn[Xn("0xa")]}[Xn("0x9")](){return Xn("0xb")+this[Xn("0x8")]+(this[Xn("0x6")]?Xn("0xc")+this[Xn("0x6")]:"")+(this[Xn("0x7")]?Xn("0xd")+this.errorCode:"")}toLog(){return n(n({name:this[Xn("0xa")],message:this[Xn("0x8")]},this[Xn("0x6")]&&{errorSpace:this[Xn("0x6")]}),this[Xn("0x7")]&&{errorCode:this.errorCode})}}var Zn,Jn,$n=["push","length","includes","type","flushTimeoutHandle","error","Error while emitting event","errorCode","toLog","min","flush","Error while emitting event (delayed flush)","getClientId","sendDeviceDataEvent","Failed to refresh data","pollingSessionToken","isTokenExpired","refreshSessionToken","attributes","navigatorHighEntropyData","fetchEventsFromLocalStorage","pop","timestamp","popAllEvents","clientId","deviceId","userId","getUserId","events","getPublicData","warn","Crypto-binding is not supported. ","sessionToken","buildEncryptedRequestBody","getRotationData","data","signature","postData","device/events","headers","find","handleRotateResponse","value","setSessionToken","setUserId","refreshConf","stringify","compressData","encrypt","uncompressed","CLIENT","setItemLocalStorageSafe","toString","shouldSendDeviceEvent","getItemLocalStorageSafe","info","no need to send device event","getDeviceId","sendPageLoadEvent","page_load","extractWindowRespurces","href","referrer","history","performance","resources","map","initiatorType","registerEventListeners","parse","maintainLastXItems","cleanLocalStorageEvents","removeItemLocalStorageSafe","ddls","rei","mouseEventsCollectionBuffer","deviceEventDataCollectionIgnoreList","publicKey","bufferInterval","EVENT_TYPE_ACTION","EVENT_TYPE_IDENTIFICATION","maxLocalStoredEvents","key_rotation_data","key_rotation_status","configManager","storageManager","deviceDataManager","identityManager","cryptoBinding","enableSessionToken","eventIndex","safeEventCallback","EVENT_TYPE_INTERACTION","emitEvent","eventsQueue","crypto","getConfValue","isMobile","maxEventStored","pollingInterval","index","increaseEventIndex","location","platform","serverPath","getTabId","now","enrichUADataIfDoesNotExist","eventTypesToStore","addEventToLocalStorage"];Zn=$n,Jn=183,function(e){for(;--e;)Zn.push(Zn.shift())}(++Jn);var Qn=function(e,t){return $n[e-=0]};const ei=Qn("0x0"),ti="lastDeviceInDeviceEvent",ri=Qn("0x1"),ni="lse",ii=Qn("0x2"),oi=Qn("0x3"),ai=Qn("0x4"),si=Qn("0x5"),ui=[Or[Qn("0x6")],Or[Qn("0x7")]],ci=Qn("0x8"),li=Qn("0x9"),di=Qn("0xa");class hi{constructor(e,t,r,i,o,a,s,u){this[Qn("0xb")]=e,this[Qn("0xc")]=t,this[Qn("0xd")]=r,this.requestsManager=i,this[Qn("0xe")]=o,this[Qn("0xf")]=a,this.serverPath=s,this[Qn("0x10")]=u,this[Qn("0x11")]=null,this.flushTimeoutHandle=null,this[Qn("0x12")]=async(e,t)=>{try{const r=n({},n({interaction_type:e},t)),i={type:Or[Qn("0x13")],attributes:r};return await this[Qn("0x14")](i)}catch(e){}},this[Qn("0x10")]=u,this[Qn("0x15")]=[],this[Qn("0x16")]=new Vn(e),this.interactionEventsManager=new gn(this[Qn("0xb")][Qn("0x17")](oi,[]),this[Qn("0xb")].getConfValue(ii,100),this.safeEventCallback),this[Qn("0x18")]=Mn[Qn("0x18")](),this.eventTypesToStore=this[Qn("0xb")][Qn("0x17")]("localStoredEventTypes",[Or[Qn("0x6")]]),this[Qn("0x19")]=this[Qn("0xb")][Qn("0x17")](ci,4),this[Qn("0x1a")]=36e4,this.pollingSessionToken()}async emitEvent(e){e[Qn("0x1b")]=this[Qn("0x1c")](),e[Qn("0x1d")]=location.toString(),e[Qn("0x1e")]=navigator[Qn("0x1e")],e.sdkVersion="1.52.6",e[Qn("0x1f")]=this[Qn("0x1f")],e.tabId=this[Qn("0xe")][Qn("0x20")](),e.timestamp=Date[Qn("0x21")](),await this[Qn("0x22")](e);let t=0;this[Qn("0x23")].includes(e.type)?t=this[Qn("0x24")](e):this[Qn("0x15")][Qn("0x25")](e);const r=this[Qn("0xb")].getConfValue("bufferSize",2);if(this[Qn("0x15")][Qn("0x26")]+t>=r||ui[Qn("0x27")](e[Qn("0x28")])){this[Qn("0x29")]&&(clearTimeout(this.flushTimeoutHandle),this.flushTimeoutHandle=null);try{return await this.flush()}catch(t){throw _r[Qn("0x2a")](Qn("0x2b"),{clientId:this[Qn("0xe")].getClientId(),eventType:e[Qn("0x28")],error:t[Qn("0x2c")]?t[Qn("0x2d")]():t}),t}}if(!this[Qn("0x29")]&&this[Qn("0x15")].length>0){const t=this[Qn("0xb")][Qn("0x17")](si,2),r=Math[Qn("0x2e")](t,30);this[Qn("0x29")]=setTimeout(()=>{this[Qn("0x29")]=null,this[Qn("0x2f")]().catch(t=>{_r[Qn("0x2a")](Qn("0x30"),{clientId:this[Qn("0xe")][Qn("0x31")](),eventType:e[Qn("0x28")],error:t[Qn("0x2c")]?t[Qn("0x2d")]():t})})},1e3*r)}return{}}async refreshSessionToken(){try{return this.eventsQueue[Qn("0x26")]>0?await this.flush():(await this[Qn("0x32")](!0),await this[Qn("0x2f")]())}catch(e){_r.error(Qn("0x33"),{e:e})}}async[Qn("0x34")](){try{this[Qn("0xe")][Qn("0x35")]()&&await this[Qn("0x36")]()}catch(e){_r.error("Failed to polling data",{e:e})}finally{setTimeout(async()=>{await this[Qn("0x34")]()},this.pollingInterval)}}async[Qn("0x22")](e){var t;if(!(null===(t=e[Qn("0x37")])||void 0===t?void 0:t[Qn("0x38")]))try{e.attributes[Qn("0x38")]=await wn()}catch(e){}}popAllEvents(){const e=[],t=this[Qn("0x39")]();for(;this[Qn("0x15")][Qn("0x26")];)e[Qn("0x25")](this[Qn("0x15")][Qn("0x3a")]());return(null==t?void 0:t[Qn("0x26")])&&e[Qn("0x25")](...t),e.sort((e,t)=>e[Qn("0x3b")]-t.timestamp)}async[Qn("0x2f")](){const e=this[Qn("0x3c")]();if(0===e[Qn("0x26")])return{};const t={};t[Qn("0x3d")]=this.identityManager[Qn("0x31")](),t[Qn("0x3e")]=this[Qn("0xe")].getDeviceId(),t[Qn("0x3f")]=this.identityManager[Qn("0x40")](),t.sdkPlatform=this[Qn("0x18")]?Br:Pr,t[Qn("0x41")]=e;try{const{keyIdentifier:e}=await this[Qn("0xf")][Qn("0x42")]();t.keyIdentifier=e}catch(e){_r[Qn("0x43")](Qn("0x44")+e)}this[Qn("0x10")]&&(t[Qn("0x45")]=!0);const r=await this[Qn("0x46")](t,!0),i=await this[Qn("0xf")][Qn("0x47")]();let o;i&&(o=[{type:li,data:i[Qn("0x48")],signature:i[Qn("0x49")]}]);const a=await this.requestsManager[Qn("0x4a")](Qn("0x4b"),n(n({},r),o?{headers:o}:{}));if(a[Qn("0x4c")]){const e=a[Qn("0x4c")][Qn("0x4d")](e=>e[Qn("0x28")]===di);e&&e.value&&this[Qn("0xf")][Qn("0x4e")](e[Qn("0x4f")])}return a.deviceId&&this[Qn("0xe")].setDeviceId(a[Qn("0x3e")]),a.sessionToken&&this[Qn("0xe")][Qn("0x50")](a[Qn("0x45")]),a[Qn("0x3f")]&&this[Qn("0xe")][Qn("0x51")](a[Qn("0x3f")]),this.cleanLocalStorageEvents(),a}async buildEncryptedRequestBody(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const r=this[Qn("0xb")][Qn("0x17")](ai,null);if(null===r&&t)return await this[Qn("0xb")][Qn("0x52")](this.identityManager[Qn("0x31")]()),await this.buildEncryptedRequestBody(e);if(null===r)throw new Yn(new Error("Encryption error - missing public key"),Wn.COMMUNICATION);try{const t=JSON[Qn("0x53")](e),n=this[Qn("0x54")](t),i=n||t,{encryptedData:o,encryptedKey:a}=await this.crypto[Qn("0x55")](r,i);return{data:o,key:a,dataType:n?kn.compress:kn[Qn("0x56")]}}catch(e){throw new Yn(e,Wn[Qn("0x57")])}}compressData(e){try{return ir(e)}catch(e){_r[Qn("0x2a")]("Failed to compress data, sending the data to the service uncompressed",{clientId:this.identityManager[Qn("0x31")](),error:e})}}[Qn("0x1c")](){if(null===this[Qn("0x11")]){const e=this[Qn("0xc")].getItemLocalStorageSafe(ri),t=Number.parseInt(e);this.eventIndex=Number.isNaN(t)?-1:t}return this[Qn("0x11")]++,this[Qn("0xc")][Qn("0x58")](ri,this[Qn("0x11")][Qn("0x59")]()),this[Qn("0x11")]}[Qn("0x5a")](){const e=this[Qn("0xc")][Qn("0x5b")](ei),t=this.storageManager[Qn("0x5b")](ti);return!e||!t||Date[Qn("0x21")]()-e>864e5||t!=this[Qn("0xe")].getDeviceId()}async[Qn("0x32")](e){if(!e&&!this[Qn("0x5a")]())return _r[Qn("0x5c")](Qn("0x5d")),!1;const t=await this[Qn("0xd")].getDeviceData(),r={type:Or.EVENT_TYPE_DEVICE,attributes:t},n=await this[Qn("0x14")](r);return n&&(this[Qn("0xc")][Qn("0x58")](ei,Date.now()),this[Qn("0xc")][Qn("0x58")](ti,this[Qn("0xe")][Qn("0x5e")]())),n}async[Qn("0x5f")](){const e=Qn("0x60");if(this[Qn("0xb")][Qn("0x17")](oi,[]).includes(e))return!1;const t=this[Qn("0x61")]();return await this[Qn("0x14")]({type:Or[Qn("0x13")],attributes:n(n({interaction_type:e,location:window[Qn("0x1d")][Qn("0x62")],referrer:document[Qn("0x63")]},window[Qn("0x64")]&&{window_historyLength:window[Qn("0x64")][Qn("0x26")]}),t&&{windowResources:t})}),!0}[Qn("0x61")](){try{const e=window[Qn("0x65")].getEntriesByType(Qn("0x66"));return e&&Array.isArray(e)?e[Qn("0x67")](e=>({name:e.name,initiatorType:e[Qn("0x68")]})):void 0}catch(e){}}[Qn("0x69")](){this.interactionEventsManager[Qn("0x69")](),this[Qn("0xe")].registerEventListeners()}fetchEventsFromLocalStorage(){const e=this[Qn("0xc")][Qn("0x5b")](ni);return e?JSON[Qn("0x6a")](e):[]}[Qn("0x24")](e){const t=this.fetchEventsFromLocalStorage();return jr[Qn("0x6b")](t,this[Qn("0x19")],e),this[Qn("0xc")].setItemLocalStorageSafe(ni,JSON[Qn("0x53")](t)),t[Qn("0x26")]}[Qn("0x6c")](){this[Qn("0xc")][Qn("0x6d")](ni)}}var fi,pi,gi=["clientId","setClientId","load","loadDeviceId","loadTabId","registerEventListeners","addEventListener","beforeunload","saveTabIdOnUnload","getDeviceId","deviceId","setDeviceId","info","Updating DeviceId","storageManager","setItemSessionStorageSafe","setItemLocalStorageSafe","getItemSessionStorageSafe","getItemLocalStorageSafe","getClientId","getUserId","configManager","getConfValue","now","removeUserId","setUserId","userId","removeItemSessionStorageSafe","removeItemLocalStorageSafe","tabId","floor","MAX_SAFE_INTEGER","toString","setSessionToken","getSessionToken","split","exp","error","Invalid JWT:","rui","rci","rdi","rdit","rti","rst","userIdStorageExpiry"];fi=gi,pi=361,function(e){for(;--e;)fi.push(fi.shift())}(++pi);var mi=function(e,t){return gi[e-=0]};const yi=mi("0x0"),vi=mi("0x1"),bi=mi("0x2"),wi=mi("0x3"),_i=mi("0x4"),Ai=mi("0x5"),Ei=mi("0x6");class Ci{constructor(e,t,r){this.storageManager=e,this.configManager=t,this[mi("0x7")]=r,this[mi("0x8")](this.clientId)}[mi("0x9")](){this[mi("0xa")](),this[mi("0xb")]()}[mi("0xc")](){window[mi("0xd")](mi("0xe"),async()=>this[mi("0xf")]())}[mi("0x10")](){return this[mi("0x11")]}[mi("0x12")](e){this[mi("0x11")]!==e&&(_r[mi("0x13")](mi("0x14"),{deviceId:e}),this.deviceId=e,this[mi("0x15")][mi("0x16")](bi,e),this[mi("0x15")][mi("0x17")](bi,e))}[mi("0xa")](){const e=this.storageManager[mi("0x18")](bi)||this[mi("0x15")][mi("0x19")](bi);return null!=e&&this[mi("0x12")](e),e}[mi("0x1a")](){return this[mi("0x7")]}[mi("0x8")](e){this[mi("0x15")][mi("0x1a")]()!=e&&this[mi("0x15")].setClientId(e),this[mi("0x15")].setItemSessionStorageSafe(vi,e)}[mi("0x1b")](){if(Number(this.storageManager[mi("0x19")](wi))+this[mi("0x1c")][mi("0x1d")](Ei,864e5)<Date[mi("0x1e")]())return this[mi("0x1f")](),null;const e=this[mi("0x15")][mi("0x18")](yi);return null!=e?e:this[mi("0x15")][mi("0x19")](yi)}[mi("0x20")](e){this[mi("0x21")]=e,this[mi("0x15")][mi("0x16")](yi,e),this[mi("0x15")][mi("0x17")](yi,e),this[mi("0x15")][mi("0x17")](wi,Date.now())}[mi("0x1f")](){this[mi("0x15")][mi("0x22")](yi),this[mi("0x15")][mi("0x23")](yi),this[mi("0x15")].removeItemLocalStorageSafe(wi)}loadTabId(){const e=this[mi("0x15")][mi("0x18")](_i);e?(this[mi("0x15")].removeItemSessionStorageSafe(_i),this.tabId=e):this[mi("0x24")]=Math[mi("0x25")](Math.random()*Number[mi("0x26")])[mi("0x27")]()}getTabId(){return this[mi("0x24")]}[mi("0xf")](){this[mi("0x15")][mi("0x16")](_i,this.tabId)}[mi("0x28")](e){this[mi("0x15")].setItemLocalStorageSafe(Ai,e)}[mi("0x29")](){return this[mi("0x15")][mi("0x19")](Ai)||this[mi("0x15")][mi("0x18")](Ai)}isTokenExpired(){var e;const t=this[mi("0x29")]();if(!t)return!0;try{const r=JSON.parse(atob(t[mi("0x2a")](".")[1]));let n=(null!==(e=r[mi("0x2b")])&&void 0!==e?e:r.iat)*(r[mi("0x2b")]&&r[mi("0x2b")]<1e12?1e3:1);return r[mi("0x2b")]||(n+=9e5),Date[mi("0x1e")]()>=n}catch(e){return _r[mi("0x2c")](mi("0x2d"),{error:e}),!0}}}var xi,Si,Ii=["include","application/json","getData","callServer","fetch","fetch-api is not supported","CLIENT","json","message","statusText","SERVER","status","COMMUNICATION","serverPath","postData","postDataFromURL","POST"];xi=Ii,Si=251,function(e){for(;--e;)xi.push(xi.shift())}(++Si);var Ti=function(e,t){return Ii[e-=0]};class Mi{constructor(e){this[Ti("0x0")]=e}async[Ti("0x1")](e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this[Ti("0x2")](this[Ti("0x0")]+e,t,r)}async postDataFromURL(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={method:Ti("0x3"),credentials:Ti("0x4"),headers:new Headers(n({"Content-Type":Ti("0x5")},r)),body:JSON.stringify(t)};return await this.callServer(e,i)}async[Ti("0x6")](e){const t=this[Ti("0x0")]+e,r={method:"GET",credentials:Ti("0x4")};return await this[Ti("0x7")](t,r)}async[Ti("0x7")](e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(Ti("0x8")in window))throw new Yn(new Error(Ti("0x9")),Wn[Ti("0xa")]);try{const r=await fetch(e,t),n=await r[Ti("0xb")]();if(r.ok)return n;throw new Yn(new Error(n[Ti("0xc")]||r[Ti("0xd")]),Wn[Ti("0xe")],r[Ti("0xf")])}catch(e){if(!(e instanceof Yn))throw new Yn(new Error(e.message),Wn[Ti("0x10")]);throw e}}}var Di,Ri,Oi=["info","throwError","validateSDKParams","keys","filter","throwOrReturnResult","length","Invalid SDK params was provided: ","REQUIRED_SDK_PARAMS","string"];Di=Oi,Ri=108,function(e){for(;--e;)Di.push(Di.shift())}(++Ri);var ki=function(e,t){return Oi[e-=0]};class Ni{constructor(){this[ki("0x0")]={clientId:ki("0x1")}}throwOrReturnResult(e,t,r){if(!e&&((null==t?void 0:t.logIfInvalid)&&_r[ki("0x2")](r),null==t?void 0:t[ki("0x3")]))throw new Error(r);return e}[ki("0x4")](e,t){const r=Object[ki("0x5")](this[ki("0x0")])[ki("0x6")](t=>typeof e[t]!=this[ki("0x0")][t]);return this[ki("0x7")](0==r[ki("0x8")],t,ki("0x9")+JSON.stringify(r))}}var Pi,Bi,Fi=["getConfValue","logsMinimumBatch","logsMinimumDelay","logs","length","now","flush","identityManager","platform","requestsManager","configManager","lastTimeLogsSent","logMiddleware","middlewares","push","reportLogs"];Pi=Fi,Bi=473,function(e){for(;--e;)Pi.push(Pi.shift())}(++Bi);var Li=function(e,t){return Fi[e-=0]};class zi{constructor(e,t,r){this[Li("0x0")]=e,this.identityManager=t,this[Li("0x1")]=r,this[Li("0x2")]=0,this[Li("0x3")]=async()=>{try{await this.reportLogs()}catch(e){}},_r[Li("0x4")][Li("0x5")](this[Li("0x3")])}async[Li("0x6")](){if(!this[Li("0x1")][Li("0x7")]("enableLogsReporting",!1))return;const e=this[Li("0x1")][Li("0x7")](Li("0x8"),6),t=this[Li("0x1")][Li("0x7")](Li("0x9"),12e4);if(_r[Li("0xa")][Li("0xb")]<e||this[Li("0x2")]+t>Date[Li("0xc")]())return;this[Li("0x2")]=Date[Li("0xc")]();const r=_r[Li("0xd")](),n=this[Li("0xe")].getClientId(),i=Math.floor(Date[Li("0xc")]()/1e3),o={sdkVersion:"1.52.6",platform:navigator[Li("0xf")],clientId:n,timestamp:i,logEntries:r};await this[Li("0x0")].postData("device/logs",o)}}var Ui,ji,Vi=["storageManager","migrateIdentifiers","identityManager","getDeviceId","getClientId","endsWith","device/migrate-identifiers","postDataFromURL","deviceId","setItemLocalStorageSafe","true","rimd","requestsManager"];Ui=Vi,ji=245,function(e){for(;--e;)Ui.push(Ui.shift())}(++ji);var Hi=function(e,t){return Vi[e-=0]};const Gi=Hi("0x0");class qi{constructor(e,t,r){this.identityManager=e,this[Hi("0x1")]=t,this[Hi("0x2")]=r}async[Hi("0x3")](e){if("true"!=this.storageManager.getItemLocalStorageSafe(Gi)){const t=this[Hi("0x4")][Hi("0x5")](),r=this[Hi("0x4")][Hi("0x6")](),n=(e[Hi("0x7")]("/")?e:e+"/")+Hi("0x8"),i=await this.requestsManager[Hi("0x9")](n,{deviceId:t,clientId:r});i[Hi("0xa")]&&i[Hi("0xa")]==t&&this.storageManager[Hi("0xb")](Gi,Hi("0xc"))}}}var Wi,Ki,Xi=["refreshConf","getConfValue","cryptoBinding","crypto","createCryptoBinding","sign","expiryDays","startedAt","deviceDataManager","eventsManager","migrationsManager","sendDeviceDataEvent","sendPageLoadEvent","catch","registerEventListeners","flush","init_failed","triggerActionEvent","action","warn","Invalid action type","CLIENT","_error_'invalid action type - ","includes","Invalid claimedUserIdType","getDeviceData","EVENT_TYPE_ACTION","correlationId","extensionDeviceAttributes","suspiciousSignals","downloadFile","uploadFile","transactionData","customAttributes","emitEvent","stringify","slice","errorSpace","_error_","message","unexpected_error_","identifyUser","updateUserId","getUserId","setUserId","deviceId","unidentifiedUser","removeUserId","EVENT_TYPE_IDENTIFICATION","setAuthenticatedUser","setUser","clearUser","initializedInstance","RiskID","TSAccountProtection","dispatchEvent","RiskIDReady","TSAccountProtectionReady","sdkEnabled","enableIdentifiersMigration","enableDeviceAttributesInActions","actions","https://collect.riskid.security/","email","phone_number","national_id","drivers_license_number","other","enableSessionToken","identifiersMigrationEnabled","firstPartyMigrationUrl","SDK already initialized","string","clientId","options","serverPath","toString","enabled","validationManager","validateSDKParams","disabledReason","invalid_params","mainEntry","storageManager","requestsManager","configManager","identityManager","generateDisabledToken","now","disabled_sdk_","unknown","isInitialized","Session token is not enabled","info","SDK disabled","session","refreshSessionToken","getSessionToken","init","object","userId","sdk init started","initializationPromise"];Wi=Xi,Ki=367,function(e){for(;--e;)Wi.push(Wi.shift())}(++Ki);var Yi=function(e,t){return Xi[e-=0]};const Zi=[null,void 0,"undefined","",0],Ji=Yi("0x0"),$i=Yi("0x1"),Qi=Yi("0x2"),eo=Yi("0x3"),to=Yi("0x4"),ro=[Yi("0x5"),Yi("0x6"),"account_id","ssn",Yi("0x7"),"passport_number",Yi("0x8"),Yi("0x9")];class no{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var r;if(this.initializationPromise=null,this.disabledReason=null,this[Yi("0xa")]=!1,this[Yi("0xb")]=!1,this[Yi("0xc")]=null,this.validationManager=new Ni,no.initializedInstance)throw new Error(Yi("0xd"));no.initializedInstance=!0;const n=typeof t===Yi("0xe");this[Yi("0xf")]=n?t:e,this[Yi("0x10")]=n?{serverPath:e}:t,(r=this[Yi("0x10")])[Yi("0x11")]||(r[Yi("0x11")]=to),this[Yi("0x10")][Yi("0x11")]=new URL(this[Yi("0x10")][Yi("0x11")])[Yi("0x12")](),this[Yi("0xc")]=this[Yi("0x10")].firstPartyMigrationUrl||null,_r[Yi("0x13")]=!!this[Yi("0x10")].verbose,this[Yi("0x14")][Yi("0x15")](this,{throwError:!0,logIfInvalid:!0})||(this[Yi("0x16")]=Yi("0x17")),this[Yi("0x19")]=new gr(this[Yi("0xf")]),this[Yi("0x1a")]=new Mi(this.options.serverPath),this[Yi("0x1b")]=new Tr(this[Yi("0x19")],this[Yi("0x1a")]),this[Yi("0x1c")]=new Ci(this[Yi("0x19")],this[Yi("0x1b")],this[Yi("0xf")]),this[Yi("0x1c")].load(),this.migrationsManager=new qi(this[Yi("0x1c")],this[Yi("0x1a")],this[Yi("0x19")]),this[Yi("0xa")]=this.options[Yi("0xa")]||!1,this.logsReporter=new zi(this[Yi("0x1a")],this[Yi("0x1c")],this[Yi("0x1b")])}[Yi("0x1d")](e){const t=Date[Yi("0x1e")]();return Yi("0x1f")+(this[Yi("0x16")]||Yi("0x20"))+"_"+e+"_"+t}get[Yi("0x3")](){return this[Yi("0x1b")].getConfValue(eo,[])}async getActions(){return await this[Yi("0x21")](),this[Yi("0x3")]}async getSessionToken(){if(!this[Yi("0xa")])throw new Error(Yi("0x22"));return await this[Yi("0x21")]()?(this[Yi("0x1c")].isTokenExpired()&&await this.eventsManager[Yi("0x26")](),this[Yi("0x1c")][Yi("0x27")]()):(_r[Yi("0x23")](Yi("0x24")),{actionToken:this[Yi("0x1d")](Yi("0x25"))})}async[Yi("0x28")](e){const t=typeof e!==Yi("0x29")?e:null==e?void 0:e[Yi("0x2a")];return _r[Yi("0x23")](Yi("0x2b")),this[Yi("0x2c")]=(async()=>{await this.configManager[Yi("0x2d")](this.identityManager.getClientId());const e=this[Yi("0x1b")][Yi("0x2e")]("tenantId",null),r=this[Yi("0x1b")].getConfValue("keyRotation",null);if(this[Yi("0x2f")]=hr[Yi("0x30")][Yi("0x31")](Yi("0x32"),(null==r?void 0:r.isEnabled)?{keyRotation:{isEnabled:!0,expiryDays:r[Yi("0x33")],startedAt:r[Yi("0x34")],tenantId:e}}:void 0),this[Yi("0x35")]=new Tn(this[Yi("0x19")],this[Yi("0x1b")],this[Yi("0x2f")]),this[Yi("0x36")]=new hi(this[Yi("0x1b")],this[Yi("0x19")],this[Yi("0x35")],this[Yi("0x1a")],this[Yi("0x1c")],this[Yi("0x2f")],this.options[Yi("0x11")],this[Yi("0xa")]),null!==this[Yi("0x16")])return!1;const n=this[Yi("0x1b")].getConfValue(Ji,void 0);return n?(this.identifiersMigrationEnabled=this[Yi("0xb")]||this[Yi("0x1b")][Yi("0x2e")]($i,!1),this[Yi("0xb")]&&this[Yi("0xc")]&&await this[Yi("0x37")].migrateIdentifiers(this.firstPartyMigrationUrl),_r[Yi("0x13")]=_r[Yi("0x13")]||!!this[Yi("0x1b")].getConfValue("verbose",!1),await this[Yi("0x36")][Yi("0x38")]().catch(()=>{}),await this[Yi("0x36")][Yi("0x39")]()[Yi("0x3a")](()=>{}),await this.updateUserId(t)[Yi("0x3a")](()=>{}),this.eventsManager[Yi("0x3b")](),await this[Yi("0x36")][Yi("0x3c")]().catch(()=>{}),_r[Yi("0x23")]("sdk init done"),!0):(this[Yi("0x16")]=void 0===n?"missing_config":"config_disabled",!1)})(),await this.initializationPromise}async[Yi("0x21")](){if(null===this[Yi("0x2c")])return this[Yi("0x16")]||(this[Yi("0x16")]="init_not_called"),!1;const e=await this[Yi("0x2c")];return e||this[Yi("0x16")]||(this[Yi("0x16")]=Yi("0x3d")),e}async[Yi("0x3e")](e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=Date[Yi("0x1e")]();if(!await this[Yi("0x21")]())return _r[Yi("0x23")](Yi("0x24")),{actionToken:this[Yi("0x1d")](Yi("0x3f"))};if(!this.actions.includes(e))return _r[Yi("0x40")](Yi("0x41"),{actionType:e}),{actionToken:Wn[Yi("0x42")]+Yi("0x43")+e+"'_"+r};const i=null==t?void 0:t.claimedUserIdType;if(i&&!ro[Yi("0x44")](i))return _r[Yi("0x40")](Yi("0x45"),{claimedUserIdType:i}),{actionToken:"invalid_claimed_user_id_type_"+i+"_"+r};let o;this[Yi("0x1b")][Yi("0x2e")](Qi,!1)&&(o=await this[Yi("0x35")][Yi("0x46")]());const a=n({type:Or[Yi("0x47")],attributes:n(n(n(n(n(n(n(n(n(n(n(n({action_type:e},(null==t?void 0:t[Yi("0x48")])&&{correlation_id:t[Yi("0x48")]}),(null==t?void 0:t.claimedUserId)&&{claimed_user_id:t.claimedUserId}),i&&{claimed_user_id_type:i}),(null==t?void 0:t.publicKey)&&{public_key:t.publicKey}),(null==t?void 0:t.extensionMetadata)&&{extension_metadata:t.extensionMetadata}),(null==t?void 0:t.extensionDeviceAttributes)&&{extension_device_attributes:t[Yi("0x49")]}),(null==t?void 0:t[Yi("0x4a")])&&{suspicious_signals:t[Yi("0x4a")]}),(null==t?void 0:t.suspiciousContext)&&{suspicious_context:t.suspiciousContext}),(null==t?void 0:t[Yi("0x4b")])&&{download_file:t[Yi("0x4b")]}),(null==t?void 0:t[Yi("0x4c")])&&{upload_file:t[Yi("0x4c")]}),(null==t?void 0:t.transactionData)&&{transactionData:t[Yi("0x4d")]}),o)},(null==t?void 0:t[Yi("0x4e")])&&{customAttributes:t[Yi("0x4e")]});try{const e=await this[Yi("0x36")][Yi("0x4f")](a),{actionToken:t}=e;if(!t)throw new Yn(new Error("Unhandled SDK error. Received eventResponse: "+(typeof e==Yi("0x29")?JSON[Yi("0x50")](e)[Yi("0x51")](15):e)),Wn[Yi("0x42")]);return e}catch(t){return{actionToken:t instanceof Yn?t[Yi("0x52")]===Wn.SERVER?t[Yi("0x52")]+Yi("0x53")+e+"_"+t.errorCode+"_'"+t[Yi("0x54")]+"'_"+r:t.errorSpace+"_error_"+e+"_'"+t.message+"'_"+r:Yi("0x55")+e+"_"+r}}}async[Yi("0x56")](e){return await this.isInitialized()?this[Yi("0x57")](e):(_r[Yi("0x23")](Yi("0x24")),!1)}async[Yi("0x57")](e){if(Zi[Yi("0x44")](e))return _r[Yi("0x23")]("identifyUser called without a valid userid",{userId:e}),!1;e=e.toString(),_r[Yi("0x23")]("identifyUser",{userId:e});const t=this[Yi("0x1c")][Yi("0x58")]();return t===e||(this[Yi("0x1c")][Yi("0x59")](e),!!(await this[Yi("0x36")][Yi("0x4f")]({type:Or.EVENT_TYPE_IDENTIFICATION,attributes:{previous_user_id:t,user_id:e}}))[Yi("0x5a")])}async[Yi("0x5b")](){if(!await this[Yi("0x21")]())return _r[Yi("0x23")](Yi("0x24")),!1;const e=this.identityManager[Yi("0x58")]();return null!=e&&this[Yi("0x1c")][Yi("0x5c")](),!!(await this[Yi("0x36")][Yi("0x4f")]({type:Or[Yi("0x5d")],attributes:{previous_user_id:e}}))[Yi("0x5a")]}async[Yi("0x5e")](e){return await this[Yi("0x56")](e)}async[Yi("0x5f")](e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return await this[Yi("0x5e")](e,t)}async[Yi("0x60")](){return await this[Yi("0x5b")]()}}no[Yi("0x61")]=!1,document.dispatchEvent(new CustomEvent(Yi("0x66")));var io,oo,ao=["flush","events","TsError","not_initialized","tsPlatform not initialized","setAuthenticatedUser","clearUser","identifyUser","getSessionToken","identityManager","getDeviceId","getClientId","eventsManager"];io=ao,oo=274,function(e){for(;--e;)io.push(io.shift())}(++oo);var so=function(e,t){return ao[e-=0]};let uo=null;function co(e){if(!e)throw new(hr.utils.exceptions[so("0x1")])(so("0x2"),so("0x3"))}hr[so("0x0")].on(hr.events.MODULE_INITIALIZED,()=>{const{clientId:e,drs:t}=hr.moduleMetadata.getInitConfig(),r=t||{},{enabled:n,userId:o}=r,a=i(r,or);!1!==n&&(uo=new no(e,a),uo.init({userId:o}))});const lo=function(){return co(uo),uo[so("0x7")]()},ho={getDeviceId:()=>uo[so("0x8")][so("0x9")](),getClientId:()=>uo[so("0x8")][so("0xa")](),flush:()=>uo[so("0xb")][so("0xc")]()};var fo=Object.freeze({__proto__:null,__internal:ho,clearUser:function(){return co(uo),uo[so("0x5")](...arguments)},getActions:function(){return co(uo),uo.getActions()},getSessionToken:lo,identifyUser:function(){return co(uo),uo[so("0x6")](...arguments)},setAuthenticatedUser:function(){return co(uo),uo[so("0x4")](...arguments)},setUser:function(){return co(uo),uo.setUser(...arguments)},triggerActionEvent:function(){return co(uo),uo.triggerActionEvent(...arguments)},unidentifiedUser:function(){return co(uo),uo.unidentifiedUser(...arguments)}});class po extends Error{constructor(e,t,r){super(r),this.name="ApiError",this.url=t.url,this.status=t.status,this.statusText=t.statusText,this.body=t.body,this.request=e}}const go={BASE:window.location.origin,VERSION:"",WITH_CREDENTIALS:!1,CREDENTIALS:"include",TOKEN:void 0,USERNAME:void 0,PASSWORD:void 0,HEADERS:void 0,ENCODE_PATH:void 0};var mo,yo,vo,bo;!function(e){var t;(t=e.feedback||(e.feedback={})).OK="ok",t.OTHER="other",t.DOCUMENT_NOT_FOUND="document_not_found",t.FACE_NOT_FOUND="face_not_found",t.DOCUMENT_FACE_NOT_FOUND="document_face_not_found",t.OBSTRUCTED="obstructed",t.BLUR="blur",t.GLARE="glare",t.DOCUMENT_NOT_SUPPORTED="document_not_supported",t.DOCUMENT_NOT_MATCHING="document_not_matching",t.WRONG_DOCUMENT_SIDE="wrong_document_side",t.MULTI_FACE="multi_face",t.FACE_ROTATED="face_rotated",t.FACE_TOO_SMALL="face_too_small",t.FACE_TOO_CLOSE="face_too_close",t.CLOSED_EYES="closed_eyes",t.FACE_ANGLE_TOO_LARGE="face_angle_too_large",t.FACE_CLOSE_TO_BORDER="face_close_to_border",t.FACE_OCCLUDED="face_occluded",t.FACE_CROPPED="face_cropped",t.BARCODE_NOT_FOUND="barcode_not_found",t.GLARE_SELFIE="glare_selfie",t.BLUR_SELFIE="blur_selfie",t.RESTRICTED_CRITERIA="restricted_criteria"}(mo||(mo={})),function(e){var t;(t=e.image_type||(e.image_type={})).DOCUMENT_FRONT="document_front",t.DOCUMENT_BACK="document_back",t.SELFIE="selfie"}(yo||(yo={})),function(e){var t,r;(t=e.status||(e.status={})).PENDING="pending",t.CAPTURING="capturing",t.PROCESSING="processing",t.RECAPTURE="recapture",t.COMPLETE="complete",t.ERROR="error",t.EXPIRED="expired",(r=e.recapture_reason||(e.recapture_reason={})).IMAGE_MISSING="image_missing",r.DOCUMENT_EXPIRED="document_expired",r.DOCUMENT_NOT_SUPPORTED="document_not_supported",r.DOCUMENT_DAMAGED="document_damaged",r.POOR_IMAGE_QUALITY="poor_image_quality",r.DOCUMENT_NOT_FOUND="document_not_found",r.OBSTRUCTED="obstructed",r.BLUR="blur",r.GLARE="glare",r.DOCUMENT_NOT_MATCHING="document_not_matching",r.WRONG_DOCUMENT_SIDE="wrong_document_side",r.FACE_NOT_FOUND="face_not_found",r.DOCUMENT_FACE_NOT_FOUND="document_face_not_found",r.INVALID_INPUT="invalid_input",r.MULTI_FACE="multi_face",r.FACE_ROTATED="face_rotated",r.FACE_TOO_SMALL="face_too_small",r.FACE_TOO_CLOSE="face_too_close",r.CLOSED_EYES="closed_eyes",r.FACE_ANGLE_TOO_LARGE="face_angle_too_large",r.FACE_CLOSE_TO_BORDER="face_close_to_border",r.FACE_OCCLUDED="face_occluded",r.FACE_CROPPED="face_cropped",r.BARCODE_NOT_FOUND="barcode_not_found",r.GLARE_SELFIE="glare_selfie",r.BLUR_SELFIE="blur_selfie",r.NO_FACE="no_face",r.DOCUMENT_TYPE_RESTRICTED="document_type_restricted"}(vo||(vo={})),function(e){var t;(t=e.client_type||(e.client_type={})).HOSTED_APP="hosted_app",t.MOBILE_SDK="mobile_sdk"}(bo||(bo={}));var wo={},_o={get exports(){return wo},set exports(e){wo=e}};!function(e,t){!function(r,n){var i="function",o="undefined",a="object",s="string",u="major",c="model",l="name",d="type",h="vendor",f="version",p="architecture",g="console",m="mobile",y="tablet",v="smarttv",b="wearable",w="embedded",_="Amazon",A="Apple",E="ASUS",C="BlackBerry",x="Browser",S="Chrome",I="Firefox",T="Google",M="Huawei",D="LG",R="Microsoft",O="Motorola",k="Opera",N="Samsung",P="Sharp",B="Sony",F="Xiaomi",L="Zebra",z="Facebook",U="Chromium OS",j="Mac OS",V=" Browser",H=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},G=function(e,t){return typeof e===s&&-1!==q(t).indexOf(q(e))},q=function(e){return e.toLowerCase()},W=function(e,t){if(typeof e===s)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,500)},K=function(e,t){for(var r,o,s,u,c,l,d=0;d<t.length&&!c;){var h=t[d],f=t[d+1];for(r=o=0;r<h.length&&!c&&h[r];)if(c=h[r++].exec(e))for(s=0;s<f.length;s++)l=c[++o],typeof(u=f[s])===a&&u.length>0?2===u.length?typeof u[1]==i?this[u[0]]=u[1].call(this,l):this[u[0]]=u[1]:3===u.length?typeof u[1]!==i||u[1].exec&&u[1].test?this[u[0]]=l?l.replace(u[1],u[2]):n:this[u[0]]=l?u[1].call(this,l,u[2]):n:4===u.length&&(this[u[0]]=l?u[3].call(this,l.replace(u[1],u[2])):n):this[u]=l||n;d+=2}},X=function(e,t){for(var r in t)if(typeof t[r]===a&&t[r].length>0){for(var i=0;i<t[r].length;i++)if(G(t[r][i],e))return"?"===r?n:r}else if(G(t[r],e))return"?"===r?n:r;return t.hasOwnProperty("*")?t["*"]:e},Y={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"},Z={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[f,[l,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[l,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[l,f],[/opios[\/ ]+([\w\.]+)/i],[f,[l,k+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[f,[l,k+" GX"]],[/\bopr\/([\w\.]+)/i],[f,[l,k]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[f,[l,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/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)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[l,f],[/quark(?:pc)?\/([-\w\.]+)/i],[f,[l,"Quark"]],[/\bddg\/([\w\.]+)/i],[f,[l,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[l,"UC"+x]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[f,[l,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[l,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[l,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[f,[l,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[f,[l,"Smart Lenovo "+x]],[/(avast|avg)\/([\w\.]+)/i],[[l,/(.+)/,"$1 Secure "+x],f],[/\bfocus\/([\w\.]+)/i],[f,[l,I+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[l,k+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[l,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[l,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[l,k+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[l,"MIUI "+x]],[/fxios\/([-\w\.]+)/i],[f,[l,I]],[/\bqihu|(qi?ho?o?|360)browser/i],[[l,"360"+V]],[/\b(qq)\/([\w\.]+)/i],[[l,/(.+)/,"$1Browser"],f],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[l,/(.+)/,"$1"+V],f],[/samsungbrowser\/([\w\.]+)/i],[f,[l,N+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],f],[/metasr[\/ ]?([\d\.]+)/i],[f,[l,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[l,"Sogou Mobile"],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[l,f],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[l],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[l,z],f],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\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],[l,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[l,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[f,[l,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[l,S+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[l,S+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[l,"Android "+x]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[l,f],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[f,[l,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[f,l],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[l,[f,X,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[l,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[l,"Netscape"],f],[/(wolvic)\/([\w\.]+)/i],[l,f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[l,I+" 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,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[l,[f,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[l,[f,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[p,"amd64"]],[/(ia32(?=;))/i],[[p,q]],[/((?:i[346]|x)86)[;\)]/i],[[p,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[p,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[p,"armhf"]],[/windows (ce|mobile); ppc;/i],[[p,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[p,/ower/,"",q]],[/(sun4\w)[;\)]/i],[[p,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[p,q]]],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],[c,[h,N],[d,y]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[c,[h,N],[d,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[c,[h,A],[d,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[c,[h,A],[d,y]],[/(macintosh);/i],[c,[h,A]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[c,[h,P],[d,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[c,[h,M],[d,y]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[c,[h,M],[d,m]],[/\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],[[c,/_/g," "],[h,F],[d,m]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[c,/_/g," "],[h,F],[d,y]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[c,[h,"OPPO"],[d,m]],[/\b(opd2\d{3}a?) bui/i],[c,[h,"OPPO"],[d,y]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[c,[h,"Vivo"],[d,m]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[c,[h,"Realme"],[d,m]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[c,[h,O],[d,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[c,[h,O],[d,y]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[c,[h,D],[d,y]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[c,[h,D],[d,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[c,[h,"Lenovo"],[d,y]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[c,/_/g," "],[h,"Nokia"],[d,m]],[/(pixel c)\b/i],[c,[h,T],[d,y]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[c,[h,T],[d,m]],[/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],[c,[h,B],[d,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[c,"Xperia Tablet"],[h,B],[d,y]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[c,[h,"OnePlus"],[d,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[c,[h,_],[d,y]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[c,/(.+)/g,"Fire Phone $1"],[h,_],[d,m]],[/(playbook);[-\w\),; ]+(rim)/i],[c,h,[d,y]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[c,[h,C],[d,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[c,[h,E],[d,y]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[c,[h,E],[d,m]],[/(nexus 9)/i],[c,[h,"HTC"],[d,y]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[c,/_/g," "],[d,m]],[/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],[c,[h,"TCL"],[d,y]],[/(itel) ((\w+))/i],[[h,q],c,[d,X,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[c,[h,"Acer"],[d,y]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[c,[h,"Meizu"],[d,m]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[c,[h,"Ulefone"],[d,m]],[/droid.+; (a(?:015|06[35]|142p?))/i],[c,[h,"Nothing"],[d,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,c,[d,m]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/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,c,[d,y]],[/(surface duo)/i],[c,[h,R],[d,y]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[c,[h,"Fairphone"],[d,m]],[/(u304aa)/i],[c,[h,"AT&T"],[d,m]],[/\bsie-(\w*)/i],[c,[h,"Siemens"],[d,m]],[/\b(rct\w+) b/i],[c,[h,"RCA"],[d,y]],[/\b(venue[\d ]{2,7}) b/i],[c,[h,"Dell"],[d,y]],[/\b(q(?:mv|ta)\w+) b/i],[c,[h,"Verizon"],[d,y]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[c,[h,"Barnes & Noble"],[d,y]],[/\b(tm\d{3}\w+) b/i],[c,[h,"NuVision"],[d,y]],[/\b(k88) b/i],[c,[h,"ZTE"],[d,y]],[/\b(nx\d{3}j) b/i],[c,[h,"ZTE"],[d,m]],[/\b(gen\d{3}) b.+49h/i],[c,[h,"Swiss"],[d,m]],[/\b(zur\d{3}) b/i],[c,[h,"Swiss"],[d,y]],[/\b((zeki)?tb.*\b) b/i],[c,[h,"Zeki"],[d,y]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],c,[d,y]],[/\b(ns-?\w{0,9}) b/i],[c,[h,"Insignia"],[d,y]],[/\b((nxa|next)-?\w{0,9}) b/i],[c,[h,"NextBook"],[d,y]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],c,[d,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],c,[d,m]],[/\b(ph-1) /i],[c,[h,"Essential"],[d,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[c,[h,"Envizen"],[d,y]],[/\b(trio[-\w\. ]+) b/i],[c,[h,"MachSpeed"],[d,y]],[/\btu_(1491) b/i],[c,[h,"Rotor"],[d,y]],[/(shield[\w ]+) b/i],[c,[h,"Nvidia"],[d,y]],[/(sprint) (\w+)/i],[h,c,[d,m]],[/(kin\.[onetw]{3})/i],[[c,/\./g," "],[h,R],[d,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[c,[h,L],[d,y]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[c,[h,L],[d,m]],[/smart-tv.+(samsung)/i],[h,[d,v]],[/hbbtv.+maple;(\d+)/i],[[c,/^/,"SmartTV"],[h,N],[d,v]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,D],[d,v]],[/(apple) ?tv/i],[h,[c,A+" TV"],[d,v]],[/crkey/i],[[c,S+"cast"],[h,T],[d,v]],[/droid.+aft(\w+)( bui|\))/i],[c,[h,_],[d,v]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[c,[h,P],[d,v]],[/(bravia[\w ]+)( bui|\))/i],[c,[h,B],[d,v]],[/(mitv-\w{5}) bui/i],[c,[h,F],[d,v]],[/Hbbtv.*(technisat) (.*);/i],[h,c,[d,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[h,W],[c,W],[d,v]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,c,[d,g]],[/droid.+; (shield) bui/i],[c,[h,"Nvidia"],[d,g]],[/(playstation [345portablevi]+)/i],[c,[h,B],[d,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[c,[h,R],[d,g]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[c,[h,N],[d,b]],[/((pebble))app/i],[h,c,[d,b]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[c,[h,A],[d,b]],[/droid.+; (glass) \d/i],[c,[h,T],[d,b]],[/droid.+; (wt63?0{2,3})\)/i],[c,[h,L],[d,b]],[/(quest( \d| pro)?)/i],[c,[h,z],[d,b]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[d,w]],[/(aeobc)\b/i],[c,[h,_],[d,w]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[c,[d,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[c,[d,y]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,y]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,m]],[/(android[-\w\. ]{0,9});.+buil/i],[c,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[l,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[l,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[l,f],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,l]],os:[[/microsoft (windows) (vista|xp)/i],[l,f],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[l,[f,X,Y]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[f,X,Y],[l,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[l,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[l,j],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[f,l],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[l,f],[/\(bb(10);/i],[f,[l,C]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[f,[l,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[l,I+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[l,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[f,[l,"watchOS"]],[/crkey\/([\d\.]+)/i],[f,[l,S+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[l,U],f],[/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) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[l,f],[/(sunos) ?([\w\.\d]*)/i],[[l,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[l,f]]},J=function(e,t){if(typeof e===a&&(t=e,e=n),!(this instanceof J))return new J(e,t).getResult();var g=typeof r!==o&&r.navigator?r.navigator:n,v=e||(g&&g.userAgent?g.userAgent:""),b=g&&g.userAgentData?g.userAgentData:n,w=t?function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r}(Z,t):Z,_=g&&g.userAgent==v;return this.getBrowser=function(){var e={};return e[l]=n,e[f]=n,K.call(e,v,w.browser),e[u]=function(e){return typeof e===s?e.replace(/[^\d\.]/g,"").split(".")[0]:n}(e[f]),_&&g&&g.brave&&typeof g.brave.isBrave==i&&(e[l]="Brave"),e},this.getCPU=function(){var e={};return e[p]=n,K.call(e,v,w.cpu),e},this.getDevice=function(){var e={};return e[h]=n,e[c]=n,e[d]=n,K.call(e,v,w.device),_&&!e[d]&&b&&b.mobile&&(e[d]=m),_&&"Macintosh"==e[c]&&g&&typeof g.standalone!==o&&g.maxTouchPoints&&g.maxTouchPoints>2&&(e[c]="iPad",e[d]=y),e},this.getEngine=function(){var e={};return e[l]=n,e[f]=n,K.call(e,v,w.engine),e},this.getOS=function(){var e={};return e[l]=n,e[f]=n,K.call(e,v,w.os),_&&!e[l]&&b&&b.platform&&"Unknown"!=b.platform&&(e[l]=b.platform.replace(/chrome os/i,U).replace(/macos/i,j)),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 v},this.setUA=function(e){return v=typeof e===s&&e.length>500?W(e,500):e,this},this.setUA(v),this};J.VERSION="1.0.39",J.BROWSER=H([l,f,u]),J.CPU=H([p]),J.DEVICE=H([c,h,d,g,m,v,y,b,w]),J.ENGINE=J.OS=H([l,f]),e.exports&&(t=e.exports=J),t.UAParser=J;var $=typeof r!==o&&(r.jQuery||r.Zepto);if($&&!$.ua){var Q=new J;$.ua=Q.getResult(),$.ua.get=function(){return Q.getUA()},$.ua.set=function(e){Q.setUA(e);var t=Q.getResult();for(var r in t)$.ua[r]=t[r]}}}("object"==typeof window?window:Y)}(_o,wo);const Ao="1.4.10",Eo=wo.UAParser(),Co=Ao;function xo(e,t){var r,n,i,o,a;return{Authorization:`Bearer ${t}`,"ts-sdk-version":Co,"ts-client-id":e,"ts-user-agent":navigator.userAgent,"ts-platform":"web-sdk","ts-os":null===(r=null==Eo?void 0:Eo.os)||void 0===r?void 0:r.name,"ts-os-version":null===(n=null==Eo?void 0:Eo.os)||void 0===n?void 0:n.version,"ts-device-model":null===(i=null==Eo?void 0:Eo.device)||void 0===i?void 0:i.model,"ts-manufacturer":null===(o=null==Eo?void 0:Eo.device)||void 0===o?void 0:o.vendor,"ts-browser":null===(a=null==Eo?void 0:Eo.browser)||void 0===a?void 0:a.name,"Content-Type":"application/json","X-TS-client-time":(new Date).toUTCString(),"X-TS-ua":navigator.userAgent}}var So="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},Io=[],To=[],Mo="undefined"!=typeof Uint8Array?Uint8Array:Array,Do=!1;function Ro(){Do=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)Io[t]=e[t],To[e.charCodeAt(t)]=t;To["-".charCodeAt(0)]=62,To["_".charCodeAt(0)]=63}function Oo(e){return Io[e>>18&63]+Io[e>>12&63]+Io[e>>6&63]+Io[63&e]}function ko(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16)+(e[o+1]<<8)+e[o+2],i.push(Oo(n));return i.join("")}function No(e){var t;Do||Ro();for(var r=e.length,n=r%3,i="",o=[],a=16383,s=0,u=r-n;s<u;s+=a)o.push(ko(e,s,s+a>u?u:s+a));return 1===n?(t=e[r-1],i+=Io[t>>2],i+=Io[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=Io[t>>10],i+=Io[t>>4&63],i+=Io[t<<2&63],i+="="),o.push(i),o.join("")}function Po(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,c=u>>1,l=-7,d=r?i-1:0,h=r?-1:1,f=e[t+d];for(d+=h,o=f&(1<<-l)-1,f>>=-l,l+=s;l>0;o=256*o+e[t+d],d+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+e[t+d],d+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=c}return(f?-1:1)*a*Math.pow(2,o-n)}function Bo(e,t,r,n,i,o){var a,s,u,c=8*o-i-1,l=(1<<c)-1,d=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+d>=1?h/u:h*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*u-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[r+f]=255&s,f+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;e[r+f]=255&a,f+=p,a/=256,c-=8);e[r+f-p]|=128*g}var Fo={}.toString,Lo=Array.isArray||function(e){return"[object Array]"==Fo.call(e)};Vo.TYPED_ARRAY_SUPPORT=void 0===So.TYPED_ARRAY_SUPPORT||So.TYPED_ARRAY_SUPPORT;var zo=Uo();function Uo(){return Vo.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function jo(e,t){if(Uo()<t)throw new RangeError("Invalid typed array length");return Vo.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=Vo.prototype:(null===e&&(e=new Vo(t)),e.length=t),e}function Vo(e,t,r){if(!(Vo.TYPED_ARRAY_SUPPORT||this instanceof Vo))return new Vo(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return qo(this,e)}return Ho(this,e,t,r)}function Ho(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);Vo.TYPED_ARRAY_SUPPORT?(e=t).__proto__=Vo.prototype:e=Wo(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!Vo.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|Yo(t,r);e=jo(e,n);var i=e.write(t,r);i!==n&&(e=e.slice(0,i));return e}(e,t,r):function(e,t){if(Xo(t)){var r=0|Ko(t.length);return 0===(e=jo(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?jo(e,0):Wo(e,t);if("Buffer"===t.type&&Lo(t.data))return Wo(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function Go(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function qo(e,t){if(Go(t),e=jo(e,t<0?0:0|Ko(t)),!Vo.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function Wo(e,t){var r=t.length<0?0:0|Ko(t.length);e=jo(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function Ko(e){if(e>=Uo())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Uo().toString(16)+" bytes");return 0|e}function Xo(e){return!(null==e||!e._isBuffer)}function Yo(e,t){if(Xo(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Aa(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Ea(e).length;default:if(n)return Aa(e).length;t=(""+t).toLowerCase(),n=!0}}function Zo(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return da(this,t,r);case"utf8":case"utf-8":return sa(this,t,r);case"ascii":return ca(this,t,r);case"latin1":case"binary":return la(this,t,r);case"base64":return aa(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ha(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function Jo(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function $o(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=Vo.from(t,n)),Xo(t))return 0===t.length?-1:Qo(e,t,r,n,i);if("number"==typeof t)return t&=255,Vo.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):Qo(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Qo(e,t,r,n,i){var o,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var l=-1;for(o=r;o<s;o++)if(c(e,o)===c(t,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*a}else-1!==l&&(o-=o-l),l=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){for(var d=!0,h=0;h<u;h++)if(c(e,o+h)!==c(t,h)){d=!1;break}if(d)return o}return-1}function ea(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[r+a]=s}return a}function ta(e,t,r,n){return Ca(Aa(t,e.length-r),e,r,n)}function ra(e,t,r,n){return Ca(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function na(e,t,r,n){return ra(e,t,r,n)}function ia(e,t,r,n){return Ca(Ea(t),e,r,n)}function oa(e,t,r,n){return Ca(function(e,t){for(var r,n,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function aa(e,t,r){return 0===t&&r===e.length?No(e):No(e.slice(t,r))}function sa(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,a,s,u,c=e[i],l=null,d=c>239?4:c>223?3:c>191?2:1;if(i+d<=r)switch(d){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,d=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=d}return function(e){var t=e.length;if(t<=ua)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=ua));return r}(n)}Vo.poolSize=8192,Vo._augment=function(e){return e.__proto__=Vo.prototype,e},Vo.from=function(e,t,r){return Ho(null,e,t,r)},Vo.TYPED_ARRAY_SUPPORT&&(Vo.prototype.__proto__=Uint8Array.prototype,Vo.__proto__=Uint8Array),Vo.alloc=function(e,t,r){return function(e,t,r,n){return Go(t),t<=0?jo(e,t):void 0!==r?"string"==typeof n?jo(e,t).fill(r,n):jo(e,t).fill(r):jo(e,t)}(null,e,t,r)},Vo.allocUnsafe=function(e){return qo(null,e)},Vo.allocUnsafeSlow=function(e){return qo(null,e)},Vo.isBuffer=xa,Vo.compare=function(e,t){if(!Xo(e)||!Xo(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},Vo.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Vo.concat=function(e,t){if(!Lo(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Vo.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=Vo.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(!Xo(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},Vo.byteLength=Yo,Vo.prototype._isBuffer=!0,Vo.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)Jo(this,t,t+1);return this},Vo.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)Jo(this,t,t+3),Jo(this,t+1,t+2);return this},Vo.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)Jo(this,t,t+7),Jo(this,t+1,t+6),Jo(this,t+2,t+5),Jo(this,t+3,t+4);return this},Vo.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?sa(this,0,e):Zo.apply(this,arguments)},Vo.prototype.equals=function(e){if(!Xo(e))throw new TypeError("Argument must be a Buffer");return this===e||0===Vo.compare(this,e)},Vo.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},Vo.prototype.compare=function(e,t,r,n,i){if(!Xo(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(n,i),c=e.slice(t,r),l=0;l<s;++l)if(u[l]!==c[l]){o=u[l],a=c[l];break}return o<a?-1:a<o?1:0},Vo.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},Vo.prototype.indexOf=function(e,t,r){return $o(this,e,t,r,!0)},Vo.prototype.lastIndexOf=function(e,t,r){return $o(this,e,t,r,!1)},Vo.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return ea(this,e,t,r);case"utf8":case"utf-8":return ta(this,e,t,r);case"ascii":return ra(this,e,t,r);case"latin1":case"binary":return na(this,e,t,r);case"base64":return ia(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return oa(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},Vo.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ua=4096;function ca(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function la(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function da(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=_a(e[o]);return i}function ha(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function fa(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function pa(e,t,r,n,i,o){if(!Xo(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function ga(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function ma(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function ya(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function va(e,t,r,n,i){return i||ya(e,0,r,4),Bo(e,t,r,n,23,4),r+4}function ba(e,t,r,n,i){return i||ya(e,0,r,8),Bo(e,t,r,n,52,8),r+8}Vo.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),Vo.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=Vo.prototype;else{var i=t-e;r=new Vo(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+e]}return r},Vo.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||fa(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},Vo.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||fa(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},Vo.prototype.readUInt8=function(e,t){return t||fa(e,1,this.length),this[e]},Vo.prototype.readUInt16LE=function(e,t){return t||fa(e,2,this.length),this[e]|this[e+1]<<8},Vo.prototype.readUInt16BE=function(e,t){return t||fa(e,2,this.length),this[e]<<8|this[e+1]},Vo.prototype.readUInt32LE=function(e,t){return t||fa(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Vo.prototype.readUInt32BE=function(e,t){return t||fa(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Vo.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||fa(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},Vo.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||fa(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},Vo.prototype.readInt8=function(e,t){return t||fa(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Vo.prototype.readInt16LE=function(e,t){t||fa(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Vo.prototype.readInt16BE=function(e,t){t||fa(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Vo.prototype.readInt32LE=function(e,t){return t||fa(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Vo.prototype.readInt32BE=function(e,t){return t||fa(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Vo.prototype.readFloatLE=function(e,t){return t||fa(e,4,this.length),Po(this,e,!0,23,4)},Vo.prototype.readFloatBE=function(e,t){return t||fa(e,4,this.length),Po(this,e,!1,23,4)},Vo.prototype.readDoubleLE=function(e,t){return t||fa(e,8,this.length),Po(this,e,!0,52,8)},Vo.prototype.readDoubleBE=function(e,t){return t||fa(e,8,this.length),Po(this,e,!1,52,8)},Vo.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||pa(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},Vo.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||pa(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},Vo.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||pa(this,e,t,1,255,0),Vo.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Vo.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||pa(this,e,t,2,65535,0),Vo.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):ga(this,e,t,!0),t+2},Vo.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||pa(this,e,t,2,65535,0),Vo.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):ga(this,e,t,!1),t+2},Vo.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||pa(this,e,t,4,4294967295,0),Vo.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):ma(this,e,t,!0),t+4},Vo.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||pa(this,e,t,4,4294967295,0),Vo.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):ma(this,e,t,!1),t+4},Vo.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);pa(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<r&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+r},Vo.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);pa(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+r},Vo.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||pa(this,e,t,1,127,-128),Vo.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Vo.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||pa(this,e,t,2,32767,-32768),Vo.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):ga(this,e,t,!0),t+2},Vo.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||pa(this,e,t,2,32767,-32768),Vo.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):ga(this,e,t,!1),t+2},Vo.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||pa(this,e,t,4,2147483647,-2147483648),Vo.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):ma(this,e,t,!0),t+4},Vo.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||pa(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Vo.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):ma(this,e,t,!1),t+4},Vo.prototype.writeFloatLE=function(e,t,r){return va(this,e,t,!0,r)},Vo.prototype.writeFloatBE=function(e,t,r){return va(this,e,t,!1,r)},Vo.prototype.writeDoubleLE=function(e,t,r){return ba(this,e,t,!0,r)},Vo.prototype.writeDoubleBE=function(e,t,r){return ba(this,e,t,!1,r)},Vo.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,o=n-r;if(this===e&&r<t&&t<n)for(i=o-1;i>=0;--i)e[i+t]=this[i+r];else if(o<1e3||!Vo.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return o},Vo.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!Vo.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var a=Xo(e)?e:Aa(new Vo(e,n).toString()),s=a.length;for(o=0;o<r-t;++o)this[o+t]=a[o%s]}return this};var wa=/[^+\/0-9A-Za-z-_]/g;function _a(e){return e<16?"0"+e.toString(16):e.toString(16)}function Aa(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Ea(e){return function(e){var t,r,n,i,o,a;Do||Ro();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[s-2]?2:"="===e[s-1]?1:0,a=new Mo(3*s/4-o),n=o>0?s-4:s;var u=0;for(t=0,r=0;t<n;t+=4,r+=3)i=To[e.charCodeAt(t)]<<18|To[e.charCodeAt(t+1)]<<12|To[e.charCodeAt(t+2)]<<6|To[e.charCodeAt(t+3)],a[u++]=i>>16&255,a[u++]=i>>8&255,a[u++]=255&i;return 2===o?(i=To[e.charCodeAt(t)]<<2|To[e.charCodeAt(t+1)]>>4,a[u++]=255&i):1===o&&(i=To[e.charCodeAt(t)]<<10|To[e.charCodeAt(t+1)]<<4|To[e.charCodeAt(t+2)]>>2,a[u++]=i>>8&255,a[u++]=255&i),a}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(wa,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Ca(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function xa(e){return null!=e&&(!!e._isBuffer||Sa(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&Sa(e.slice(0,0))}(e))}function Sa(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var Ia=Object.freeze({__proto__:null,Buffer:Vo,INSPECT_MAX_BYTES:50,SlowBuffer:function(e){return+e!=e&&(e=0),Vo.alloc(+e)},isBuffer:xa,kMaxLength:zo});const Ta=e=>null!=e,Ma=e=>"string"==typeof e,Da=e=>Ma(e)&&""!==e,Ra=e=>"object"==typeof e&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.arrayBuffer&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag]),Oa=e=>e instanceof FormData,ka=e=>{const t=[],r=(e,n)=>{Ta(n)&&(Array.isArray(n)?n.forEach(t=>{r(e,t)}):"object"==typeof n?Object.entries(n).forEach(t=>{let[n,i]=t;r(`${e}[${n}]`,i)}):((e,r)=>{t.push(`${encodeURIComponent(e)}=${encodeURIComponent(String(r))}`)})(e,n))};return Object.entries(e).forEach(e=>{let[t,n]=e;r(t,n)}),t.length>0?`?${t.join("&")}`:""},Na=async(e,t)=>"function"==typeof t?t(e):t,Pa=async(e,t)=>{const r=await Na(t,e.TOKEN),i=await Na(t,e.USERNAME),o=await Na(t,e.PASSWORD),a=await Na(t,e.HEADERS),s=Object.entries(n(n({Accept:"application/json"},a),t.headers)).filter(e=>{let[t,r]=e;return Ta(r)}).reduce((e,t)=>{let[r,i]=t;return n(n({},e),{},{[r]:String(i)})},{});if(Da(r)&&(s.Authorization=`Bearer ${r}`),Da(i)&&Da(o)){const e=(e=>{try{return btoa(e)}catch(t){return Vo.from(e).toString("base64")}})(`${i}:${o}`);s.Authorization=`Basic ${e}`}return t.body&&(t.mediaType?s["Content-Type"]=t.mediaType:Ra(t.body)?s["Content-Type"]=t.body.type||"application/octet-stream":Ma(t.body)?s["Content-Type"]="text/plain":Oa(t.body)||(s["Content-Type"]="application/json")),new Headers(s)},Ba=(e,t)=>new Promise(async(r,i)=>{try{const i=((e,t)=>{const r=e.ENCODE_PATH||encodeURI,n=null==t?void 0:t.url.replace("{api-version}",e.VERSION).replace(/{(.*?)}/g,(e,n)=>{var i;return(null===(i=null==t?void 0:t.path)||void 0===i?void 0:i.hasOwnProperty(n))?r(String(t.path[n])):e}),i=`${e.BASE}${n}`;return t.query?`${i}${ka(t.query)}`:i})(e,t),o=(e=>{if(e.formData){const t=new FormData,r=(e,r)=>{Ma(r)||Ra(r)?t.append(e,r):t.append(e,JSON.stringify(r))};return Object.entries(e.formData).filter(e=>{let[t,r]=e;return Ta(r)}).forEach(e=>{let[t,n]=e;Array.isArray(n)?n.forEach(e=>r(t,e)):r(t,n)}),t}})(t),a=(e=>{var t;if(void 0!==e.body)return(null===(t=e.mediaType)||void 0===t?void 0:t.includes("/json"))?JSON.stringify(e.body):Ma(e.body)||Ra(e.body)||Oa(e.body)?e.body:JSON.stringify(e.body)})(t),s=await Pa(e,t),u=await(async(e,t,r,n,i,o)=>{const a=new AbortController,s={headers:o,body:null!=n?n:i,method:t.method,signal:a.signal};return e.WITH_CREDENTIALS&&(s.credentials=e.CREDENTIALS),await fetch(r,s)})(e,t,i,a,o,s),c=await(async e=>{if(204!==e.status)try{const t=e.headers.get("Content-Type");if(t)return["application/json","application/problem+json"].some(e=>t.toLowerCase().startsWith(e))?await e.json():await e.text()}catch(e){console.error(e)}})(u),l=((e,t)=>{if(t){const r=e.headers.get(t);if(Ma(r))return r}})(u,t.responseHeader),d={url:i,ok:u.ok,status:u.status,statusText:u.statusText,headers:u.headers,body:null!=l?l:c};((e,t)=>{var r,i;const o=n({400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"},e.errors)[t.status];if(o)throw new po(e,t,o);if(!t.ok){const n=null!==(r=t.status)&&void 0!==r?r:"unknown",o=null!==(i=t.statusText)&&void 0!==i?i:"unknown",a=(()=>{try{return JSON.stringify(t.body,null,2)}catch(e){return}})();throw new po(e,t,`Generic Error: status: ${n}; status text: ${o}; body: ${a}`)}})(t,d),r(d)}catch(e){i(e)}}),Fa=new X("idv"),La=Symbol(),za=Symbol(),Ua="verify-id-sdk";function ja(e){return sessionStorage.getItem(e)}const Va=new Map;function Ha(e,t){const r=Va.get(e);Fa.events.emit(r,t)}function Ga(e){Ha(La,e)}function qa(e,t,r,n,i){Ga({type:"verification-result",status:t,step:e,state:n,callbackUrl:i,sessionId:r})}function Wa(e,t){Ga({type:"capture-error",errorCode:t,step:e})}function Ka(e,t,r){Ga({type:"api-request-error",errorCode:t,step:e,error:r})}function Xa(e,t){return Ba(go,e).catch(r=>(e.url.endsWith("/events")||Ka(t,"request-error",r.message),Promise.reject(r)))}async function Ya(e){var t;go.HEADERS=xo(e);const r=await function(e){return Xa({keepalive:!0,method:"GET",url:`/verify/api/v1/sdk-settings?clientId=${e}`},"init")}(e);return{autocapture_settings:null!==(t=r.body.autocapture_settings)&&void 0!==t?t:void 0,autocapture_enabled:r.body.autocapture_enabled}}Va.set(La,La),Va.set(za,za);var Za={setStep(e,t){e.commit("setStep",t)},setSessionId(e,t){e.commit("setSessionId",t)},setIsCapturingProcessStarted(e,t){e.commit("setIsCapturingProcessStarted",t)},setServerPath(e,t){e.commit("setServerPath",t)},setStartToken(e,t){e.commit("setStartToken",t)},setRootElement(e,t){e.commit("setRootElement",t)},setLanguage(e,t){e.commit("setLanguage",t)},setCallback(e,t){e.commit("setCallback",t)},setUserToken(e,t){e.commit("setUserToken",t)},setConsentVersion(e,t){e.commit("setConsentVersion",t)},setMissingImages(e,t){e.commit("setMissingImages",t)},setClientId(e,t){e.commit("setClientId",t)},setStatus(e,t){e.commit("setStatus",t)},setMarkdownSupportText(e,t){e.commit("setMarkdownSupportText",t)},setVideoCaptureSettings(e,t){e.commit("setVideoCaptureSettings",t)},setCdnHost(e,t){e.commit("setCdnHost",t)},setIsImageSigningEnabled(e,t){e.commit("setIsImageSigningEnabled",t)},setAutoCaptureSettings(e,t){e.commit("setAutoCaptureSettings",t)}},Ja={setStep:(e,t)=>(e.step=t,e),setSessionId:(e,t)=>(e.sessionId=t,e),setIsCapturingProcessStarted:(e,t)=>(e.isCapturingProcessStarted=t,e),setServerPath:(e,t)=>(e.serverPath=t,e),setStartToken:(e,t)=>(e.startToken=t,e),setRootElement:(e,t)=>(e.rootElementId=t,e),setLanguage:(e,t)=>(e.language=t,e),setCallback:(e,t)=>(e.callback=t,e),setUserToken:(e,t)=>(e.userToken=t,e),setConsentVersion:(e,t)=>(e.consentVersion=t,e),setMissingImages:(e,t)=>(e.missingImages=t,e),setClientId:(e,t)=>(e.clientId=t,e),setStatus:(e,t)=>(e.verificationStatus=t,e),setMarkdownSupportText:(e,t)=>(e.markdownSupportText=t,e),setVideoCaptureSettings:(e,t)=>(e.videoCaptureSettings=t,e),setCdnHost:(e,t)=>(e.cdnHost=t,e),setIsImageSigningEnabled:(e,t)=>(e.isImageSigningEnabled=t,e),setAutoCaptureSettings:(e,t)=>(e.autoCaptureSettings=t,e)};const $a=new class{constructor(e){this.actions={},this.mutations={},this.state={},this.status="resting",Object.prototype.hasOwnProperty.call(e,"actions")&&(this.actions=e.actions),Object.prototype.hasOwnProperty.call(e,"mutations")&&(this.mutations=e.mutations);const t=this;this.state=new Proxy(e.state||{},{get:function(e,t){return e[t]},set:function(e,r,n){return e[r]=n,Ha(za,{key:r,state:e}),"mutation"!==t.status&&console.warn(`You should use a mutation to set ${String(r)}`),t.status="resting",!0}})}dispatch(e,t){return"function"!=typeof this.actions[e]?(console.error(`Action "${e} doesn't exist.`),!1):(this.status="action",this.actions[e](this,t),!0)}commit(e,t){if("function"!=typeof this.mutations[e])return console.info(`Mutation "${e}" doesn't exist`),!1;this.status="mutation";const r=this.mutations[e](this.state,t);return this.state=r,!0}}({actions:Za,mutations:Ja,state:{step:"",sessionId:"",serverPath:"",startToken:"",rootElementId:"",language:"en",callback:()=>null,userToken:"",missingImages:[],consentVersion:"",clientId:"",verificationStatus:"pending",markdownSupportText:"",isImageSigningEnabled:!0,isCapturingProcessStarted:!1}});var Qa;function es(e){const t=[],r=function(e){var t,r,n,i;const o=e.stats.get(Qa.BLUR_DETECTION),a=e.stats.get(Qa.GLARE_DETECTION);if(!o&&!a||0===(null==o?void 0:o.durations.length)&&0===(null==a?void 0:a.durations.length))return;const s=ns(null!==(t=null==o?void 0:o.durations)&&void 0!==t?t:null==a?void 0:a.durations),u=o&&a?Math.min(o.countSuccess,a.countSuccess):null!==(r=null==o?void 0:o.countSuccess)&&void 0!==r?r:null==a?void 0:a.countSuccess;return{name:rs(Qa.BLUR_DETECTION),count_success:u,count_failure_glare:null!==(n=null==a?void 0:a.countFailed)&&void 0!==n?n:0,count_failure_blur:null!==(i=null==o?void 0:o.countFailed)&&void 0!==i?i:0,avg_duration:s.duration_avg,std_duration:s.duration_std}}(e);r&&t.push(r);for(const[r,n]of e.stats.entries())r!==Qa.BLUR_DETECTION&&r!==Qa.GLARE_DETECTION&&n.durations.length>0&&t.push(ts(n,r));return e.frameHandleDurations.length>0&&t.push(function(e){const t=ns(e.frameHandleDurations);return{name:"stability_manager",avg_stable_count:Math.round(e.stableCounts.reduce((e,t)=>e+t,0)/e.stableCounts.length),avg_duration:t.duration_avg,std_duration:t.duration_std}}(e)),t}function ts(e,t){const r=ns(e.durations);return{name:rs(t),count_success:e.countSuccess,count_failure:e.countFailed,avg_duration:r.duration_avg,std_duration:r.duration_std}}function rs(e){switch(e){case Qa.BLUR_DETECTION:case Qa.GLARE_DETECTION:return"blur_glare_detector";case Qa.DOCUMENT_DETECTION:return"doc_detector";case Qa.DOCUMENT_POSITION:return"doc_frame_detector";case Qa.BARCODE_DETECTION:return"barcode_detector";case Qa.FACE_DETECTION:return"face_detector";case Qa.FACE_POSITION:return"face_frame_detector";default:return e}}function ns(e){var t;if(e.length<2)return{duration_avg:null!==(t=e[0])&&void 0!==t?t:0,duration_std:0};const r=e.length,n=e.reduce((e,t)=>e+t,0)/r;let i=0;for(let t=0;t<r;t++){const r=e[t];i+=Math.pow(r-n,2)}const o=Math.sqrt(i/(r-1));return{duration_avg:Math.round(n),duration_std:Math.round(o)}}!function(e){e.DOCUMENT_DETECTION="document_detection",e.DOCUMENT_POSITION="document_position",e.GLARE_DETECTION="glare_detection",e.BLUR_DETECTION="blur_detection",e.BARCODE_DETECTION="barcode_detection",e.FACE_DETECTION="face_detection",e.FACE_POSITION="face_position"}(Qa||(Qa={}));const is=new class{createUploadImageEvent(e,t,r,n){return{event_type:"upload_image",upload_image_req:{process_result:"success",image_type:e,request_total_time_ms:String(t),request_processing_time_ms:String(r),request_build_time_ms:String(n)}}}createPageViewEvent(e){return{event_type:"page_view",page_view_req:{page_name:e}}}createProcessingCompleteEvent(){return{event_type:"processing_complete",processing_complete_req:{status:"complete"}}}createSdkInitEvent(e,t){return{event_type:"sdk_init",sdk_init_req:{user_wait_time:Math.round(e),model_stats:this.convertModelStats(t)}}}convertModelStats(e){return e.map(e=>({model_name:e.modelName,init_duration:Math.round(e.initDuration),download_duration:Math.round(e.downloadDuration)}))}createUserActionEvent(e,t,r){var n,i,o;const a={user_action_type:e,page_name:t,autocapture:!!r,autocapture_enabled:null!==(o=null===(i=null===(n=$a.state)||void 0===n?void 0:n.autoCaptureSettings)||void 0===i?void 0:i.enabled)&&void 0!==o&&o};if(r){const e=es(r);a.stats=e}return{event_type:"user_action",user_action_req:a}}createErrorEvent(e,t,r){return{event_type:"error",error_req:{error_name:t,error_description:e,step:r}}}createCameraNotAllowedEvent(e,t){return{event_type:"error",error_req:{error_name:"camera_not_allowed",error_description:e,step:t}}}createDrsInitFailureEvent(e,t){return{event_type:"error",error_req:{error_name:"missing_drs_action_token",error_description:e,step:t}}}};async function os(e,t,r,n,i){r?(go.HEADERS=xo(n,t),await function(e,t,r){return Xa({keepalive:!0,method:"POST",url:`/verify/api/v1/verification/${e}/events`,path:{sid:e},body:t},r)}(r,i,e)):console.error("cannot send event, sessionId or startToken is not set")}const as=new class{handelEventData(e){if("session-id-acquired"===e.type)this.sendRiskSessionToken()}sendRiskSessionToken(){try{const e=`${go.BASE}/verify/api/v1/verification/${$a.state.sessionId}/risk-session-token`,t=$a.state.clientId,r=xo(t,$a.state.userToken);lo().then(t=>{Fa.http.httpPost(e,{session_token:t},null,r).catch(t=>{throw console.log("unable to send session token to IDV",e),console.error(t),t})}).catch(t=>{var r,n,i,o;console.log("unable to get session token from DRS",e),console.error(t);const a=(null==t?void 0:t.message)||"failed to initialize DRS",s=is.createDrsInitFailureEvent(a,"init");os(null===(r=$a.state)||void 0===r?void 0:r.step,null===(n=$a.state)||void 0===n?void 0:n.userToken,null===(i=$a.state)||void 0===i?void 0:i.sessionId,null===(o=$a.state)||void 0===o?void 0:o.clientId,s).then(()=>{Ga({type:"failed-to-init-drs",errorCode:"other",step:"init"})})})}catch(e){throw console.log("Error sending risk session token"),console.error(e),e}}};async function ss(e,t,r){const n=is.createErrorEvent(e,t,r);await us(r,n)}async function us(e,t){var r,n,i,o,a;const s=null===(r=$a.state)||void 0===r?void 0:r.userToken,u=(null===(n=$a.state)||void 0===n?void 0:n.sessionId)||(null===(i=$a.state)||void 0===i?void 0:i.startToken),c=null===(o=$a.state)||void 0===o?void 0:o.clientId,l=(null===(a=$a.state)||void 0===a?void 0:a.step)||e;await os(l,s,u,c,t)}const cs=function(){var e,t;(null===(t=null===(e=$a.state.autoCaptureSettings)||void 0===e?void 0:e.settings)||void 0===t?void 0:t.debug)&&console.log(...arguments)};var ls;!function(e){e.DOCUMENT_DETECTOR="document_detector",e.BLUR_GLARE_CLASSIFIER="blur_glare_classifier",e.FACE_LANDMARK="face_landmark"}(ls||(ls={}));var ds,hs,fs=(ds=function(e,t){return ds=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},ds(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ds(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),ps=function(e){function t(t,r){var n,i,o,a=this.constructor,s=e.call(this,t,r)||this;return Object.defineProperty(s,"name",{value:a.name,enumerable:!1,configurable:!0}),n=s,i=a.prototype,(o=Object.setPrototypeOf)?o(n,i):n.__proto__=i,function(e,t){void 0===t&&(t=e.constructor);var r=Error.captureStackTrace;r&&r(e,t)}(s),s}return fs(t,e),t}(Error),gs=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ms=function(e){function t(t){void 0===t&&(t=void 0);var r=e.call(this,t)||this;return r.message=t,r}return gs(t,e),t.prototype.getKind=function(){return this.constructor.kind},t.kind="Exception",t}(ps),ys=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),vs=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ys(t,e),t.kind="ArgumentException",t}(ms),bs=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ws=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return bs(t,e),t.kind="IllegalArgumentException",t}(ms),_s=function(){function e(e){if(this.binarizer=e,null===e)throw new ws("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 null!==this.matrix&&void 0!==this.matrix||(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},e.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},e.prototype.crop=function(t,r,n,i){var o=this.binarizer.getLuminanceSource().crop(t,r,n,i);return new e(this.binarizer.createBinarizer(o))},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(e){return""}},e}(),As=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Es=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return As(t,e),t.getChecksumInstance=function(){return new t},t.kind="ChecksumException",t}(ms),Cs=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}(),xs=function(){function e(){}return e.arraycopy=function(e,t,r,n,i){for(;i--;)r[n++]=e[t++]},e.currentTimeMillis=function(){return Date.now()},e}(),Ss=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Is=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ss(t,e),t.kind="IndexOutOfBoundsException",t}(ms),Ts=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ms=function(e){function t(t,r){void 0===t&&(t=void 0),void 0===r&&(r=void 0);var n=e.call(this,r)||this;return n.index=t,n.message=r,n}return Ts(t,e),t.kind="ArrayIndexOutOfBoundsException",t}(Is),Ds=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Rs=function(){function e(){}return e.fill=function(e,t){for(var r=0,n=e.length;r<n;r++)e[r]=t},e.fillWithin=function(t,r,n,i){e.rangeCheck(t.length,r,n);for(var o=r;o<n;o++)t[o]=i},e.rangeCheck=function(e,t,r){if(t>r)throw new ws("fromIndex("+t+") > toIndex("+r+")");if(t<0)throw new Ms(t);if(r>e)throw new Ms(r)},e.asList=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e},e.create=function(e,t,r){return Array.from({length:e}).map(function(e){return Array.from({length:t}).fill(r)})},e.createInt32Array=function(e,t,r){return Array.from({length:e}).map(function(e){return Int32Array.from({length:t}).fill(r)})},e.equals=function(e,t){if(!e)return!1;if(!t)return!1;if(!e.length)return!1;if(!t.length)return!1;if(e.length!==t.length)return!1;for(var r=0,n=e.length;r<n;r++)if(e[r]!==t[r])return!1;return!0},e.hashCode=function(e){var t,r;if(null===e)return 0;var n=1;try{for(var i=Ds(e),o=i.next();!o.done;o=i.next()){n=31*n+o.value}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n},e.fillUint8Array=function(e,t){for(var r=0;r!==e.length;r++)e[r]=t},e.copyOf=function(e,t){return e.slice(0,t)},e.copyOfUint8Array=function(e,t){if(e.length<=t){var r=new Uint8Array(t);return r.set(e),r}return e.slice(0,t)},e.copyOfRange=function(e,t,r){var n=r-t,i=new Int32Array(n);return xs.arraycopy(e,t,i,0,n),i},e.binarySearch=function(t,r,n){void 0===n&&(n=e.numberComparator);for(var i=0,o=t.length-1;i<=o;){var a=o+i>>1,s=n(r,t[a]);if(s>0)i=a+1;else{if(!(s<0))return a;o=a-1}}return-i-1},e.numberComparator=function(e,t){return e-t},e}(),Os=function(){function e(){}return e.numberOfTrailingZeros=function(e){var t;if(0===e)return 32;var r=31;return 0!==(t=e<<16)&&(r-=16,e=t),0!==(t=e<<8)&&(r-=8,e=t),0!==(t=e<<4)&&(r-=4,e=t),0!==(t=e<<2)&&(r-=2,e=t),r-(e<<1>>>31)},e.numberOfLeadingZeros=function(e){if(0===e)return 32;var t=1;return e>>>16==0&&(t+=16,e<<=16),e>>>24==0&&(t+=8,e<<=8),e>>>28==0&&(t+=4,e<<=4),e>>>30==0&&(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 void 0===t&&(t=void 0),parseInt(e,t)},e.MIN_VALUE_32_BITS=-2147483648,e.MAX_VALUE=Number.MAX_SAFE_INTEGER,e}(),ks=function(){function e(t,r){void 0===t?(this.size=0,this.bits=new Int32Array(1)):(this.size=t,this.bits=null==r?e.makeArray(t):r)}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 r=e.makeArray(t);xs.arraycopy(this.bits,0,r,0,this.bits.length),this.bits=r}},e.prototype.get=function(e){return!!(this.bits[Math.floor(e/32)]&1<<(31&e))},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 r=this.bits,n=Math.floor(e/32),i=r[n];i&=~((1<<(31&e))-1);for(var o=r.length;0===i;){if(++n===o)return t;i=r[n]}var a=32*n+Os.numberOfTrailingZeros(i);return a>t?t:a},e.prototype.getNextUnset=function(e){var t=this.size;if(e>=t)return t;var r=this.bits,n=Math.floor(e/32),i=~r[n];i&=~((1<<(31&e))-1);for(var o=r.length;0===i;){if(++n===o)return t;i=~r[n]}var a=32*n+Os.numberOfTrailingZeros(i);return a>t?t:a},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 ws;if(t!==e){t--;for(var r=Math.floor(e/32),n=Math.floor(t/32),i=this.bits,o=r;o<=n;o++){var a=(2<<(o<n?31:31&t))-(1<<(o>r?0:31&e));i[o]|=a}}},e.prototype.clear=function(){for(var e=this.bits.length,t=this.bits,r=0;r<e;r++)t[r]=0},e.prototype.isRange=function(e,t,r){if(t<e||e<0||t>this.size)throw new ws;if(t===e)return!0;t--;for(var n=Math.floor(e/32),i=Math.floor(t/32),o=this.bits,a=n;a<=i;a++){var s=(2<<(a<i?31:31&t))-(1<<(a>n?0:31&e))&4294967295;if((o[a]&s)!==(r?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 ws("Num bits must be between 0 and 32");this.ensureCapacity(this.size+t);for(var r=t;r>0;r--)this.appendBit(1==(e>>r-1&1))},e.prototype.appendBitArray=function(e){var t=e.size;this.ensureCapacity(this.size+t);for(var r=0;r<t;r++)this.appendBit(e.get(r))},e.prototype.xor=function(e){if(this.size!==e.size)throw new ws("Sizes don't match");for(var t=this.bits,r=0,n=t.length;r<n;r++)t[r]^=e.bits[r]},e.prototype.toBytes=function(e,t,r,n){for(var i=0;i<n;i++){for(var o=0,a=0;a<8;a++)this.get(e)&&(o|=1<<7-a),e++;t[r+i]=o}},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),r=t+1,n=this.bits,i=0;i<r;i++){var o=n[i];o=(o=(o=(o=(o=o>>1&1431655765|(1431655765&o)<<1)>>2&858993459|(858993459&o)<<2)>>4&252645135|(252645135&o)<<4)>>8&16711935|(16711935&o)<<8)>>16&65535|(65535&o)<<16,e[t-i]=o}if(this.size!==32*r){var a=32*r-this.size,s=e[0]>>>a;for(i=1;i<r;i++){var u=e[i];s|=u<<32-a,e[i-1]=s,s=u>>>a}e[r-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 r=t;return this.size===r.size&&Rs.equals(this.bits,r.bits)},e.prototype.hashCode=function(){return 31*this.size+Rs.hashCode(this.bits)},e.prototype.toString=function(){for(var e="",t=0,r=this.size;t<r;t++)7&t||(e+=" "),e+=this.get(t)?"X":".";return e},e.prototype.clone=function(){return new e(this.size,this.bits.slice())},e.prototype.toArray=function(){for(var e=[],t=0,r=this.size;t<r;t++)e.push(this.get(t));return e},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.ENABLE_CODE_39_EXTENDED_MODE=7]="ENABLE_CODE_39_EXTENDED_MODE",e[e.ASSUME_GS1=8]="ASSUME_GS1",e[e.RETURN_CODABAR_START_END=9]="RETURN_CODABAR_START_END",e[e.NEED_RESULT_POINT_CALLBACK=10]="NEED_RESULT_POINT_CALLBACK",e[e.ALLOWED_EAN_EXTENSIONS=11]="ALLOWED_EAN_EXTENSIONS"}(hs||(hs={}));var Ns,Ps=hs,Bs=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Fs=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Bs(t,e),t.getFormatInstance=function(){return new t},t.kind="FormatException",t}(ms),Ls=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new 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"}(Ns||(Ns={}));var zs,Us=function(){function e(t,r,n){for(var i,o,a=[],s=3;s<arguments.length;s++)a[s-3]=arguments[s];this.valueIdentifier=t,this.name=n,this.values="number"==typeof r?Int32Array.from([r]):r,this.otherEncodingNames=a,e.VALUE_IDENTIFIER_TO_ECI.set(t,this),e.NAME_TO_ECI.set(n,this);for(var u=this.values,c=0,l=u.length;c!==l;c++){var d=u[c];e.VALUES_TO_ECI.set(d,this)}try{for(var h=Ls(a),f=h.next();!f.done;f=h.next()){var p=f.value;e.NAME_TO_ECI.set(p,this)}}catch(e){i={error:e}}finally{try{f&&!f.done&&(o=h.return)&&o.call(h)}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 Fs("incorect value");var r=e.VALUES_TO_ECI.get(t);if(void 0===r)throw new Fs("incorect value");return r},e.getCharacterSetECIByName=function(t){var r=e.NAME_TO_ECI.get(t);if(void 0===r)throw new Fs("incorect value");return r},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var r=t;return this.getName()===r.getName()},e.VALUE_IDENTIFIER_TO_ECI=new Map,e.VALUES_TO_ECI=new Map,e.NAME_TO_ECI=new Map,e.Cp437=new e(Ns.Cp437,Int32Array.from([0,2]),"Cp437"),e.ISO8859_1=new e(Ns.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),e.ISO8859_2=new e(Ns.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),e.ISO8859_3=new e(Ns.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),e.ISO8859_4=new e(Ns.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),e.ISO8859_5=new e(Ns.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),e.ISO8859_6=new e(Ns.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),e.ISO8859_7=new e(Ns.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),e.ISO8859_8=new e(Ns.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),e.ISO8859_9=new e(Ns.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),e.ISO8859_10=new e(Ns.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),e.ISO8859_11=new e(Ns.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),e.ISO8859_13=new e(Ns.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),e.ISO8859_14=new e(Ns.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),e.ISO8859_15=new e(Ns.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),e.ISO8859_16=new e(Ns.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),e.SJIS=new e(Ns.SJIS,20,"SJIS","Shift_JIS"),e.Cp1250=new e(Ns.Cp1250,21,"Cp1250","windows-1250"),e.Cp1251=new e(Ns.Cp1251,22,"Cp1251","windows-1251"),e.Cp1252=new e(Ns.Cp1252,23,"Cp1252","windows-1252"),e.Cp1256=new e(Ns.Cp1256,24,"Cp1256","windows-1256"),e.UnicodeBigUnmarked=new e(Ns.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),e.UTF8=new e(Ns.UTF8,26,"UTF8","UTF-8"),e.ASCII=new e(Ns.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),e.Big5=new e(Ns.Big5,28,"Big5"),e.GB18030=new e(Ns.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),e.EUC_KR=new e(Ns.EUC_KR,30,"EUC_KR","EUC-KR"),e}(),js=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Vs=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return js(t,e),t.kind="UnsupportedOperationException",t}(ms),Hs=function(){function e(){}return e.decode=function(e,t){var r=this.encodingName(t);return this.customDecoder?this.customDecoder(e,r):"undefined"==typeof TextDecoder||this.shouldDecodeOnFallback(r)?this.decodeFallback(e,r):new TextDecoder(r).decode(e)},e.shouldDecodeOnFallback=function(t){return!e.isBrowser()&&"ISO-8859-1"===t},e.encode=function(e,t){var r=this.encodingName(t);return this.customEncoder?this.customEncoder(e,r):"undefined"==typeof TextEncoder?this.encodeFallback(e):(new TextEncoder).encode(e)},e.isBrowser=function(){return"undefined"!=typeof window&&"[object Window]"==={}.toString.call(window)},e.encodingName=function(e){return"string"==typeof e?e:e.getName()},e.encodingCharacterSet=function(e){return e instanceof Us?e:Us.getCharacterSetECIByName(e)},e.decodeFallback=function(t,r){var n=this.encodingCharacterSet(r);if(e.isDecodeFallbackSupported(n)){for(var i="",o=0,a=t.length;o<a;o++){var s=t[o].toString(16);s.length<2&&(s="0"+s),i+="%"+s}return decodeURIComponent(i)}if(n.equals(Us.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(t.buffer));throw new Vs("Encoding "+this.encodingName(r)+" not supported by fallback.")},e.isDecodeFallbackSupported=function(e){return e.equals(Us.UTF8)||e.equals(Us.ISO8859_1)||e.equals(Us.ASCII)},e.encodeFallback=function(e){for(var t=btoa(unescape(encodeURIComponent(e))).split(""),r=[],n=0;n<t.length;n++)r.push(t[n].charCodeAt(0));return new Uint8Array(r)},e}(),Gs=function(){function e(){}return e.castAsNonUtf8Char=function(e,t){void 0===t&&(t=null);var r=t?t.getName():this.ISO88591;return Hs.decode(new Uint8Array([e]),r)},e.guessEncoding=function(t,r){if(null!=r&&void 0!==r.get(Ps.CHARACTER_SET))return r.get(Ps.CHARACTER_SET).toString();for(var n=t.length,i=!0,o=!0,a=!0,s=0,u=0,c=0,l=0,d=0,h=0,f=0,p=0,g=0,m=0,y=0,v=t.length>3&&239===t[0]&&187===t[1]&&191===t[2],b=0;b<n&&(i||o||a);b++){var w=255&t[b];a&&(s>0?128&w?s--:a=!1:128&w&&(64&w?(s++,32&w?(s++,16&w?(s++,8&w?a=!1:l++):c++):u++):a=!1)),i&&(w>127&&w<160?i=!1:w>159&&(w<192||215===w||247===w)&&y++),o&&(d>0?w<64||127===w||w>252?o=!1:d--:128===w||160===w||w>239?o=!1:w>160&&w<224?(h++,p=0,++f>g&&(g=f)):w>127?(d++,f=0,++p>m&&(m=p)):(f=0,p=0))}return a&&s>0&&(a=!1),o&&d>0&&(o=!1),a&&(v||u+c+l>0)?e.UTF8:o&&(e.ASSUME_SHIFT_JIS||g>=3||m>=3)?e.SHIFT_JIS:i&&o?2===g&&2===h||10*y>=n?e.SHIFT_JIS:e.ISO88591:i?e.ISO88591:o?e.SHIFT_JIS:a?e.UTF8:e.PLATFORM_DEFAULT_ENCODING},e.format=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=-1;return e.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,function(e,r,i,o,a,s){if("%%"===e)return"%";if(void 0!==t[++n]){e=o?parseInt(o.substr(1)):void 0;var u,c=a?parseInt(a.substr(1)):void 0;switch(s){case"s":u=t[n];break;case"c":u=t[n][0];break;case"f":u=parseFloat(t[n]).toFixed(e);break;case"p":u=parseFloat(t[n]).toPrecision(e);break;case"e":u=parseFloat(t[n]).toExponential(e);break;case"x":u=parseInt(t[n]).toString(c||16);break;case"d":u=parseFloat(parseInt(t[n],c||10).toPrecision(e)).toFixed(0)}u="object"==typeof u?JSON.stringify(u):(+u).toString(c);for(var l=parseInt(i),d=i&&i[0]+""=="0"?"0":" ";u.length<l;)u=void 0!==r?u+d:d+u;return u}})},e.getBytes=function(e,t){return Hs.encode(e,t)},e.getCharCode=function(e,t){return void 0===t&&(t=0),e.charCodeAt(t)},e.getCharAt=function(e){return String.fromCharCode(e)},e.SHIFT_JIS=Us.SJIS.getName(),e.GB2312="GB2312",e.ISO88591=Us.ISO8859_1.getName(),e.EUC_JP="EUC_JP",e.UTF8=Us.UTF8.getName(),e.PLATFORM_DEFAULT_ENCODING=e.UTF8,e.ASSUME_SHIFT_JIS=!1,e}(),qs=function(){function e(e){void 0===e&&(e=""),this.value=e}return e.prototype.enableDecoding=function(e){return this.encoding=e,this},e.prototype.append=function(e){return"string"==typeof e?this.value+=e.toString():this.encoding?this.value+=Gs.castAsNonUtf8Char(e,this.encoding):this.value+=String.fromCharCode(e),this},e.prototype.appendChars=function(e,t,r){for(var n=t;t<t+r;n++)this.append(e[n]);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.substring(0,e)+t+this.value.substring(e)},e}(),Ws=function(){function e(e,t,r,n){if(this.width=e,this.height=t,this.rowSize=r,this.bits=n,null==t&&(t=e),this.height=t,e<1||t<1)throw new ws("Both dimensions must be greater than 0");null==r&&(r=Math.floor((e+31)/32)),this.rowSize=r,null==n&&(this.bits=new Int32Array(this.rowSize*this.height))}return e.parseFromBooleanArray=function(t){for(var r=t.length,n=t[0].length,i=new e(n,r),o=0;o<r;o++)for(var a=t[o],s=0;s<n;s++)a[s]&&i.set(s,o);return i},e.parseFromString=function(t,r,n){if(null===t)throw new ws("stringRepresentation cannot be null");for(var i=new Array(t.length),o=0,a=0,s=-1,u=0,c=0;c<t.length;)if("\n"===t.charAt(c)||"\r"===t.charAt(c)){if(o>a){if(-1===s)s=o-a;else if(o-a!==s)throw new ws("row lengths do not match");a=o,u++}c++}else if(t.substring(c,c+r.length)===r)c+=r.length,i[o]=!0,o++;else{if(t.substring(c,c+n.length)!==n)throw new ws("illegal character encountered: "+t.substring(c));c+=n.length,i[o]=!1,o++}if(o>a){if(-1===s)s=o-a;else if(o-a!==s)throw new ws("row lengths do not match");u++}for(var l=new e(s,u),d=0;d<o;d++)i[d]&&l.set(Math.floor(d%s),Math.floor(d/s));return l},e.prototype.get=function(e,t){var r=t*this.rowSize+Math.floor(e/32);return!!(this.bits[r]>>>(31&e)&1)},e.prototype.set=function(e,t){var r=t*this.rowSize+Math.floor(e/32);this.bits[r]|=1<<(31&e)&4294967295},e.prototype.unset=function(e,t){var r=t*this.rowSize+Math.floor(e/32);this.bits[r]&=~(1<<(31&e)&4294967295)},e.prototype.flip=function(e,t){var r=t*this.rowSize+Math.floor(e/32);this.bits[r]^=1<<(31&e)&4294967295},e.prototype.xor=function(e){if(this.width!==e.getWidth()||this.height!==e.getHeight()||this.rowSize!==e.getRowSize())throw new ws("input matrix dimensions do not match");for(var t=new ks(Math.floor(this.width/32)+1),r=this.rowSize,n=this.bits,i=0,o=this.height;i<o;i++)for(var a=i*r,s=e.getRow(i,t).getBitArray(),u=0;u<r;u++)n[a+u]^=s[u]},e.prototype.clear=function(){for(var e=this.bits,t=e.length,r=0;r<t;r++)e[r]=0},e.prototype.setRegion=function(e,t,r,n){if(t<0||e<0)throw new ws("Left and top must be nonnegative");if(n<1||r<1)throw new ws("Height and width must be at least 1");var i=e+r,o=t+n;if(o>this.height||i>this.width)throw new ws("The region must fit inside the matrix");for(var a=this.rowSize,s=this.bits,u=t;u<o;u++)for(var c=u*a,l=e;l<i;l++)s[c+Math.floor(l/32)]|=1<<(31&l)&4294967295},e.prototype.getRow=function(e,t){null==t||t.getSize()<this.width?t=new ks(this.width):t.clear();for(var r=this.rowSize,n=this.bits,i=e*r,o=0;o<r;o++)t.setBulk(32*o,n[i+o]);return t},e.prototype.setRow=function(e,t){xs.arraycopy(t.getBitArray(),0,this.bits,e*this.rowSize,this.rowSize)},e.prototype.rotate180=function(){for(var e=this.getWidth(),t=this.getHeight(),r=new ks(e),n=new ks(e),i=0,o=Math.floor((t+1)/2);i<o;i++)r=this.getRow(i,r),n=this.getRow(t-1-i,n),r.reverse(),n.reverse(),this.setRow(i,n),this.setRow(t-1-i,r)},e.prototype.getEnclosingRectangle=function(){for(var e=this.width,t=this.height,r=this.rowSize,n=this.bits,i=e,o=t,a=-1,s=-1,u=0;u<t;u++)for(var c=0;c<r;c++){var l=n[u*r+c];if(0!==l){if(u<o&&(o=u),u>s&&(s=u),32*c<i){for(var d=0;!(l<<31-d&4294967295);)d++;32*c+d<i&&(i=32*c+d)}if(32*c+31>a){for(d=31;l>>>d===0;)d--;32*c+d>a&&(a=32*c+d)}}}return a<i||s<o?null:Int32Array.from([i,o,a-i+1,s-o+1])},e.prototype.getTopLeftOnBit=function(){for(var e=this.rowSize,t=this.bits,r=0;r<t.length&&0===t[r];)r++;if(r===t.length)return null;for(var n=r/e,i=r%e*32,o=t[r],a=0;!(o<<31-a&4294967295);)a++;return i+=a,Int32Array.from([i,n])},e.prototype.getBottomRightOnBit=function(){for(var e=this.rowSize,t=this.bits,r=t.length-1;r>=0&&0===t[r];)r--;if(r<0)return null;for(var n=Math.floor(r/e),i=32*Math.floor(r%e),o=t[r],a=31;o>>>a===0;)a--;return i+=a,Int32Array.from([i,n])},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 r=t;return this.width===r.width&&this.height===r.height&&this.rowSize===r.rowSize&&Rs.equals(this.bits,r.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)+Rs.hashCode(this.bits)},e.prototype.toString=function(e,t,r){return void 0===e&&(e="X "),void 0===t&&(t=" "),void 0===r&&(r="\n"),this.buildToString(e,t,r)},e.prototype.buildToString=function(e,t,r){for(var n=new qs,i=0,o=this.height;i<o;i++){for(var a=0,s=this.width;a<s;a++)n.append(this.get(a,i)?e:t);n.append(r)}return n.toString()},e.prototype.clone=function(){return new e(this.width,this.height,this.rowSize,this.bits.slice())},e}(),Ks=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Xs=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ks(t,e),t.getNotFoundInstance=function(){return new t},t.kind="NotFoundException",t}(ms),Ys=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Zs=function(e){function t(r){var n=e.call(this,r)||this;return n.luminances=t.EMPTY,n.buckets=new Int32Array(t.LUMINANCE_BUCKETS),n}return Ys(t,e),t.prototype.getBlackRow=function(e,r){var n=this.getLuminanceSource(),i=n.getWidth();null==r||r.getSize()<i?r=new ks(i):r.clear(),this.initArrays(i);for(var o=n.getRow(e,this.luminances),a=this.buckets,s=0;s<i;s++)a[(255&o[s])>>t.LUMINANCE_SHIFT]++;var u=t.estimateBlackPoint(a);if(i<3)for(s=0;s<i;s++)(255&o[s])<u&&r.set(s);else{var c=255&o[0],l=255&o[1];for(s=1;s<i-1;s++){var d=255&o[s+1];(4*l-c-d)/2<u&&r.set(s),c=l,l=d}}return r},t.prototype.getBlackMatrix=function(){var e=this.getLuminanceSource(),r=e.getWidth(),n=e.getHeight(),i=new Ws(r,n);this.initArrays(r);for(var o=this.buckets,a=1;a<5;a++)for(var s=Math.floor(n*a/5),u=e.getRow(s,this.luminances),c=Math.floor(4*r/5),l=Math.floor(r/5);l<c;l++){o[(255&u[l])>>t.LUMINANCE_SHIFT]++}var d=t.estimateBlackPoint(o),h=e.getMatrix();for(a=0;a<n;a++){var f=a*r;for(l=0;l<r;l++){(255&h[f+l])<d&&i.set(l,a)}}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 r=this.buckets,n=0;n<t.LUMINANCE_BUCKETS;n++)r[n]=0},t.estimateBlackPoint=function(e){for(var r=e.length,n=0,i=0,o=0,a=0;a<r;a++)e[a]>o&&(i=a,o=e[a]),e[a]>n&&(n=e[a]);var s=0,u=0;for(a=0;a<r;a++){var c=a-i;(f=e[a]*c*c)>u&&(s=a,u=f)}if(i>s){var l=i;i=s,s=l}if(s-i<=r/16)throw new Xs;var d=s-1,h=-1;for(a=s-1;a>i;a--){var f,p=a-i;(f=p*p*(s-a)*(n-e[a]))>h&&(d=a,h=f)}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}(Cs),Js=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$s=function(e){function t(t){var r=e.call(this,t)||this;return r.matrix=null,r}return Js(t,e),t.prototype.getBlackMatrix=function(){if(null!==this.matrix)return this.matrix;var r=this.getLuminanceSource(),n=r.getWidth(),i=r.getHeight();if(n>=t.MINIMUM_DIMENSION&&i>=t.MINIMUM_DIMENSION){var o=r.getMatrix(),a=n>>t.BLOCK_SIZE_POWER;0!==(n&t.BLOCK_SIZE_MASK)&&a++;var s=i>>t.BLOCK_SIZE_POWER;0!==(i&t.BLOCK_SIZE_MASK)&&s++;var u=t.calculateBlackPoints(o,a,s,n,i),c=new Ws(n,i);t.calculateThresholdForBlock(o,a,s,n,i,u,c),this.matrix=c}else this.matrix=e.prototype.getBlackMatrix.call(this);return this.matrix},t.prototype.createBinarizer=function(e){return new t(e)},t.calculateThresholdForBlock=function(e,r,n,i,o,a,s){for(var u=o-t.BLOCK_SIZE,c=i-t.BLOCK_SIZE,l=0;l<n;l++){var d=l<<t.BLOCK_SIZE_POWER;d>u&&(d=u);for(var h=t.cap(l,2,n-3),f=0;f<r;f++){var p=f<<t.BLOCK_SIZE_POWER;p>c&&(p=c);for(var g=t.cap(f,2,r-3),m=0,y=-2;y<=2;y++){var v=a[h+y];m+=v[g-2]+v[g-1]+v[g]+v[g+1]+v[g+2]}var b=m/25;t.thresholdBlock(e,p,d,b,i,s)}}},t.cap=function(e,t,r){return e<t?t:e>r?r:e},t.thresholdBlock=function(e,r,n,i,o,a){for(var s=0,u=n*o+r;s<t.BLOCK_SIZE;s++,u+=o)for(var c=0;c<t.BLOCK_SIZE;c++)(255&e[u+c])<=i&&a.set(r+c,n+s)},t.calculateBlackPoints=function(e,r,n,i,o){for(var a=o-t.BLOCK_SIZE,s=i-t.BLOCK_SIZE,u=new Array(n),c=0;c<n;c++){u[c]=new Int32Array(r);var l=c<<t.BLOCK_SIZE_POWER;l>a&&(l=a);for(var d=0;d<r;d++){var h=d<<t.BLOCK_SIZE_POWER;h>s&&(h=s);for(var f=0,p=255,g=0,m=0,y=l*i+h;m<t.BLOCK_SIZE;m++,y+=i){for(var v=0;v<t.BLOCK_SIZE;v++){var b=255&e[y+v];f+=b,b<p&&(p=b),b>g&&(g=b)}if(g-p>t.MIN_DYNAMIC_RANGE)for(m++,y+=i;m<t.BLOCK_SIZE;m++,y+=i)for(v=0;v<t.BLOCK_SIZE;v++)f+=255&e[y+v]}var w=f>>2*t.BLOCK_SIZE_POWER;if(g-p<=t.MIN_DYNAMIC_RANGE&&(w=p/2,c>0&&d>0)){var _=(u[c-1][d]+2*u[c][d-1]+u[c-1][d-1])/4;p<_&&(w=_)}u[c][d]=w}}return u},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}(Zs),Qs=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,r,n){throw new Vs("This luminance source does not support cropping.")},e.prototype.isRotateSupported=function(){return!1},e.prototype.rotateCounterClockwise=function(){throw new Vs("This luminance source does not support rotation by 90 degrees.")},e.prototype.rotateCounterClockwise45=function(){throw new Vs("This luminance source does not support rotation by 45 degrees.")},e.prototype.toString=function(){for(var e=new Uint8ClampedArray(this.width),t=new qs,r=0;r<this.height;r++){for(var n=this.getRow(r,e),i=0;i<this.width;i++){var o=255&n[i],a=void 0;a=o<64?"#":o<128?"+":o<192?".":" ",t.append(a)}t.append("\n")}return t.toString()},e}(),eu=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),tu=function(e){function t(t){var r=e.call(this,t.getWidth(),t.getHeight())||this;return r.delegate=t,r}return eu(t,e),t.prototype.getRow=function(e,t){for(var r=this.delegate.getRow(e,t),n=this.getWidth(),i=0;i<n;i++)r[i]=255-(255&r[i]);return r},t.prototype.getMatrix=function(){for(var e=this.delegate.getMatrix(),t=this.getWidth()*this.getHeight(),r=new Uint8ClampedArray(t),n=0;n<t;n++)r[n]=255-(255&e[n]);return r},t.prototype.isCropSupported=function(){return this.delegate.isCropSupported()},t.prototype.crop=function(e,r,n,i){return new t(this.delegate.crop(e,r,n,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}(Qs),ru=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),nu=function(e){function t(r,n){void 0===n&&(n=!1);var i=e.call(this,r.width,r.height)||this;return i.canvas=r,i.tempCanvasElement=null,i.buffer=t.makeBufferFromCanvasImageData(r,n),i}return ru(t,e),t.makeBufferFromCanvasImageData=function(e,r){void 0===r&&(r=!1);var n=e.getContext("2d").getImageData(0,0,e.width,e.height);return t.toGrayscaleBuffer(n.data,e.width,e.height,r)},t.toGrayscaleBuffer=function(e,r,n,i){void 0===i&&(i=!1);var o=new Uint8ClampedArray(r*n);if(t.FRAME_INDEX=!t.FRAME_INDEX,t.FRAME_INDEX||!i)for(var a=0,s=0,u=e.length;a<u;a+=4,s++){var c=void 0;if(0===e[a+3])c=255;else c=306*e[a]+601*e[a+1]+117*e[a+2]+512>>10;o[s]=c}else{a=0,s=0;for(var l=e.length;a<l;a+=4,s++){c=void 0;if(0===e[a+3])c=255;else c=306*e[a]+601*e[a+1]+117*e[a+2]+512>>10;o[s]=255-c}}return o},t.prototype.getRow=function(e,t){if(e<0||e>=this.getHeight())throw new ws("Requested row is outside the image: "+e);var r=this.getWidth(),n=e*r;return null===t?t=this.buffer.slice(n,n+r):(t.length<r&&(t=new Uint8ClampedArray(r)),t.set(this.buffer.slice(n,n+r))),t},t.prototype.getMatrix=function(){return this.buffer},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(t,r,n,i){return e.prototype.crop.call(this,t,r,n,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(null===this.tempCanvasElement){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 r=this.getTempCanvasElement(),n=r.getContext("2d"),i=e*t.DEGREE_TO_RADIANS,o=this.canvas.width,a=this.canvas.height,s=Math.ceil(Math.abs(Math.cos(i))*o+Math.abs(Math.sin(i))*a),u=Math.ceil(Math.abs(Math.sin(i))*o+Math.abs(Math.cos(i))*a);return r.width=s,r.height=u,n.translate(s/2,u/2),n.rotate(i),n.drawImage(this.canvas,o/-2,a/-2),this.buffer=t.makeBufferFromCanvasImageData(r),this},t.prototype.invert=function(){return new tu(this)},t.DEGREE_TO_RADIANS=Math.PI/180,t.FRAME_INDEX=!0,t}(Qs),iu=function(){function e(e,t,r){this.deviceId=e,this.label=t,this.kind="videoinput",this.groupId=r||void 0}return e.prototype.toJSON=function(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}},e}(),ou=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,s)}u((n=n.apply(e,t||[])).next())})},au=function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},su=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},uu=function(){function e(e,t,r){void 0===t&&(t=500),this.reader=e,this.timeBetweenScansMillis=t,this._hints=r,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}return Object.defineProperty(e.prototype,"hasNavigator",{get:function(){return"undefined"!=typeof navigator},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 ou(this,void 0,void 0,function(){var e,t,r,n,i,o,a,s,u,c,l,d;return au(this,function(h){switch(h.label){case 0:if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:e=h.sent(),t=[];try{for(r=su(e),n=r.next();!n.done;n=r.next())i=n.value,"videoinput"===(o="video"===i.kind?"videoinput":i.kind)&&(a=i.deviceId||i.id,s=i.label||"Video device "+(t.length+1),u=i.groupId,c={deviceId:a,label:s,kind:o,groupId:u},t.push(c))}catch(e){l={error:e}}finally{try{n&&!n.done&&(d=r.return)&&d.call(r)}finally{if(l)throw l.error}}return[2,t]}})})},e.prototype.getVideoInputDevices=function(){return ou(this,void 0,void 0,function(){return au(this,function(e){switch(e.label){case 0:return[4,this.listVideoInputDevices()];case 1:return[2,e.sent().map(function(e){return new iu(e.deviceId,e.label)})]}})})},e.prototype.findDeviceById=function(e){return ou(this,void 0,void 0,function(){var t;return au(this,function(r){switch(r.label){case 0:return[4,this.listVideoInputDevices()];case 1:return(t=r.sent())?[2,t.find(function(t){return t.deviceId===e})]:[2,null]}})})},e.prototype.decodeFromInputVideoDevice=function(e,t){return ou(this,void 0,void 0,function(){return au(this,function(r){switch(r.label){case 0:return[4,this.decodeOnceFromVideoDevice(e,t)];case 1:return[2,r.sent()]}})})},e.prototype.decodeOnceFromVideoDevice=function(e,t){return ou(this,void 0,void 0,function(){var r;return au(this,function(n){switch(n.label){case 0:return this.reset(),r={video:e?{deviceId:{exact:e}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(r,t)];case 1:return[2,n.sent()]}})})},e.prototype.decodeOnceFromConstraints=function(e,t){return ou(this,void 0,void 0,function(){var r;return au(this,function(n){switch(n.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return r=n.sent(),[4,this.decodeOnceFromStream(r,t)];case 2:return[2,n.sent()]}})})},e.prototype.decodeOnceFromStream=function(e,t){return ou(this,void 0,void 0,function(){var r;return au(this,function(n){switch(n.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,t)];case 1:return r=n.sent(),[4,this.decodeOnce(r)];case 2:return[2,n.sent()]}})})},e.prototype.decodeFromInputVideoDeviceContinuously=function(e,t,r){return ou(this,void 0,void 0,function(){return au(this,function(n){switch(n.label){case 0:return[4,this.decodeFromVideoDevice(e,t,r)];case 1:return[2,n.sent()]}})})},e.prototype.decodeFromVideoDevice=function(e,t,r){return ou(this,void 0,void 0,function(){var n;return au(this,function(i){switch(i.label){case 0:return n={video:e?{deviceId:{exact:e}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(n,t,r)];case 1:return[2,i.sent()]}})})},e.prototype.decodeFromConstraints=function(e,t,r){return ou(this,void 0,void 0,function(){var n;return au(this,function(i){switch(i.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return n=i.sent(),[4,this.decodeFromStream(n,t,r)];case 2:return[2,i.sent()]}})})},e.prototype.decodeFromStream=function(e,t,r){return ou(this,void 0,void 0,function(){var n;return au(this,function(i){switch(i.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,t)];case 1:return n=i.sent(),[4,this.decodeContinuously(n,r)];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 ou(this,void 0,void 0,function(){var r;return au(this,function(n){switch(n.label){case 0:return r=this.prepareVideoElement(t),this.addVideoSource(r,e),this.videoElement=r,this.stream=e,[4,this.playVideoOnLoadAsync(r)];case 1:return n.sent(),[2,r]}})})},e.prototype.playVideoOnLoadAsync=function(e){var t=this;return new Promise(function(r,n){return t.playVideoOnLoad(e,function(){return r()})})},e.prototype.playVideoOnLoad=function(e,t){var r=this;this.videoEndedListener=function(){return r.stopStreams()},this.videoCanPlayListener=function(){return r.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 ou(this,void 0,void 0,function(){return au(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 r=document.getElementById(e);if(!r)throw new vs("element with id '"+e+"' not found");if(r.nodeName.toLowerCase()!==t.toLowerCase())throw new vs("element with id '"+e+"' must be an "+t+" element");return r},e.prototype.decodeFromImage=function(e,t){if(!e&&!t)throw new vs("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 vs("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,r){if(void 0===e&&void 0===t)throw new vs("Either an element with a src set or an URL must be provided");return t&&!e?this.decodeFromVideoUrlContinuously(t,r):this.decodeFromVideoElementContinuously(e,r)},e.prototype.decodeFromImageElement=function(e){if(!e)throw new vs("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 r=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideoContinuously(r,t)},e.prototype._decodeFromVideoElementSetup=function(e){if(!e)throw new vs("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 vs("An URL must be provided.");this.reset();var t=this.prepareImageElement();this.imageElement=t;var r=this._decodeOnLoadImage(t);return t.src=e,r},e.prototype.decodeFromVideoUrl=function(e){if(!e)throw new vs("An URL must be provided.");this.reset();var t=this.prepareVideoElement(),r=this.decodeFromVideoElement(t);return t.src=e,r},e.prototype.decodeFromVideoUrlContinuously=function(e,t){if(!e)throw new vs("An URL must be provided.");this.reset();var r=this.prepareVideoElement(),n=this.decodeFromVideoElementContinuously(r,t);return r.src=e,n},e.prototype._decodeOnLoadImage=function(e){var t=this;return new Promise(function(r,n){t.imageLoadedListener=function(){return t.decodeOnce(e,!1,!0).then(r,n)},e.addEventListener("load",t.imageLoadedListener)})},e.prototype._decodeOnLoadVideo=function(e){return ou(this,void 0,void 0,function(){return au(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 ou(this,void 0,void 0,function(){return au(this,function(r){switch(r.label){case 0:return[4,this.playVideoOnLoadAsync(e)];case 1:return r.sent(),this.decodeContinuously(e,t),[2]}})})},e.prototype.isImageLoaded=function(e){return!!e.complete&&0!==e.naturalWidth},e.prototype.prepareImageElement=function(e){var t;return void 0===e&&((t=document.createElement("img")).width=200,t.height=200),"string"==typeof e&&(t=this.getMediaElement(e,"img")),e instanceof HTMLImageElement&&(t=e),t},e.prototype.prepareVideoElement=function(e){var t;return e||"undefined"==typeof document||((t=document.createElement("video")).width=200,t.height=200),"string"==typeof e&&(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,r){var n=this;void 0===t&&(t=!0),void 0===r&&(r=!0),this._stopAsyncDecode=!1;var i=function(o,a){if(n._stopAsyncDecode)return a(new Xs("Video stream has ended before any code could be detected.")),void(n._stopAsyncDecode=void 0);try{o(n.decode(e))}catch(e){if(t&&e instanceof Xs||(e instanceof Es||e instanceof Fs)&&r)return setTimeout(i,n._timeBetweenDecodingAttempts,o,a);a(e)}};return new Promise(function(e,t){return i(e,t)})},e.prototype.decodeContinuously=function(e,t){var r=this;this._stopContinuousDecode=!1;var n=function(){if(r._stopContinuousDecode)r._stopContinuousDecode=void 0;else try{var i=r.decode(e);t(i,null),setTimeout(n,r.timeBetweenScansMillis)}catch(e){t(null,e),(e instanceof Es||e instanceof Fs||e instanceof Xs)&&setTimeout(n,r._timeBetweenDecodingAttempts)}};n()},e.prototype.decode=function(e){var t=this.createBinaryBitmap(e);return this.decodeBitmap(t)},e.prototype.createBinaryBitmap=function(e){this.getCaptureCanvasContext(e);var t=!1;e instanceof HTMLVideoElement?(this.drawFrameOnCanvas(e),t=!0):this.drawImageOnCanvas(e);var r=this.getCaptureCanvas(e),n=new nu(r,t),i=new $s(n);return new _s(i)},e.prototype.getCaptureCanvasContext=function(e){if(!this.captureCanvasContext){var t=this.getCaptureCanvas(e),r=void 0;try{r=t.getContext("2d",{willReadFrequently:!0})}catch(e){r=t.getContext("2d")}this.captureCanvasContext=r}return this.captureCanvasContext},e.prototype.getCaptureCanvas=function(e){if(!this.captureCanvas){var t=this.createCaptureCanvas(e);this.captureCanvas=t}return this.captureCanvas},e.prototype.drawFrameOnCanvas=function(e,t,r){void 0===t&&(t={sx:0,sy:0,sWidth:e.videoWidth,sHeight:e.videoHeight,dx:0,dy:0,dWidth:e.videoWidth,dHeight:e.videoHeight}),void 0===r&&(r=this.captureCanvasContext),r.drawImage(e,t.sx,t.sy,t.sWidth,t.sHeight,t.dx,t.dy,t.dWidth,t.dHeight)},e.prototype.drawImageOnCanvas=function(e,t,r){void 0===t&&(t={sx:0,sy:0,sWidth:e.naturalWidth,sHeight:e.naturalHeight,dx:0,dy:0,dWidth:e.naturalWidth,dHeight:e.naturalHeight}),void 0===r&&(r=this.captureCanvasContext),r.drawImage(e,t.sx,t.sy,t.sWidth,t.sHeight,t.dx,t.dy,t.dWidth,t.dHeight)},e.prototype.decodeBitmap=function(e){return this.reader.decode(e,this._hints)},e.prototype.createCaptureCanvas=function(e){if("undefined"==typeof document)return this._destroyCaptureCanvas(),null;var t,r,n=document.createElement("canvas");return void 0!==e&&(e instanceof HTMLVideoElement?(t=e.videoWidth,r=e.videoHeight):e instanceof HTMLImageElement&&(t=e.naturalWidth||e.width,r=e.naturalHeight||e.height)),n.style.width=t+"px",n.style.height=r+"px",n.width=t,n.height=r,n},e.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach(function(e){return e.stop()}),this.stream=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&&(void 0!==this.videoEndedListener&&this.videoElement.removeEventListener("ended",this.videoEndedListener),void 0!==this.videoPlayingEventListener&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),void 0!==this.videoCanPlayListener&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)},e.prototype._destroyImageElement=function(){this.imageElement&&(void 0!==this.imageLoadedListener&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=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(r){e.src=URL.createObjectURL(t)}},e.prototype.cleanVideoSource=function(e){try{e.srcObject=null}catch(t){e.src=""}this.videoElement.removeAttribute("src")},e}(),cu=function(){function e(e,t,r,n,i,o){void 0===r&&(r=null==t?0:8*t.length),void 0===o&&(o=xs.currentTimeMillis()),this.text=e,this.rawBytes=t,this.numBits=r,this.resultPoints=n,this.format=i,this.timestamp=o,this.text=e,this.rawBytes=t,this.numBits=null==r?null==t?0:8*t.length:r,this.resultPoints=n,this.format=i,this.resultMetadata=null,this.timestamp=null==o?xs.currentTimeMillis():o}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){null===this.resultMetadata&&(this.resultMetadata=new Map),this.resultMetadata.set(e,t)},e.prototype.putAllMetadata=function(e){null!==e&&(null===this.resultMetadata?this.resultMetadata=e:this.resultMetadata=new Map(e))},e.prototype.addResultPoints=function(e){var t=this.resultPoints;if(null===t)this.resultPoints=e;else if(null!==e&&e.length>0){var r=new Array(t.length+e.length);xs.arraycopy(t,0,r,0,t.length),xs.arraycopy(e,0,r,t.length,e.length),this.resultPoints=r}},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"}(zs||(zs={}));var lu,du=zs;!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"}(lu||(lu={}));var hu,fu=lu,pu=function(){function e(e,t,r,n,i,o){void 0===i&&(i=-1),void 0===o&&(o=-1),this.rawBytes=e,this.text=t,this.byteSegments=r,this.ecLevel=n,this.structuredAppendSequenceNumber=i,this.structuredAppendParity=o,this.numBits=null==e?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}(),gu=function(){function e(){}return e.prototype.exp=function(e){return this.expTable[e]},e.prototype.log=function(e){if(0===e)throw new ws;return this.logTable[e]},e.addOrSubtract=function(e,t){return e^t},e}(),mu=function(){function e(e,t){if(0===t.length)throw new ws;this.field=e;var r=t.length;if(r>1&&0===t[0]){for(var n=1;n<r&&0===t[n];)n++;n===r?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(r-n),xs.arraycopy(t,n,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 0===this.coefficients[0]},e.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},e.prototype.evaluateAt=function(e){if(0===e)return this.getCoefficient(0);var t,r=this.coefficients;if(1===e){t=0;for(var n=0,i=r.length;n!==i;n++){var o=r[n];t=gu.addOrSubtract(t,o)}return t}t=r[0];var a=r.length,s=this.field;for(n=1;n<a;n++)t=gu.addOrSubtract(s.multiply(e,t),r[n]);return t},e.prototype.addOrSubtract=function(t){if(!this.field.equals(t.field))throw new ws("GenericGFPolys do not have same GenericGF field");if(this.isZero())return t;if(t.isZero())return this;var r=this.coefficients,n=t.coefficients;if(r.length>n.length){var i=r;r=n,n=i}var o=new Int32Array(n.length),a=n.length-r.length;xs.arraycopy(n,0,o,0,a);for(var s=a;s<n.length;s++)o[s]=gu.addOrSubtract(r[s-a],n[s]);return new e(this.field,o)},e.prototype.multiply=function(t){if(!this.field.equals(t.field))throw new ws("GenericGFPolys do not have same GenericGF field");if(this.isZero()||t.isZero())return this.field.getZero();for(var r=this.coefficients,n=r.length,i=t.coefficients,o=i.length,a=new Int32Array(n+o-1),s=this.field,u=0;u<n;u++)for(var c=r[u],l=0;l<o;l++)a[u+l]=gu.addOrSubtract(a[u+l],s.multiply(c,i[l]));return new e(s,a)},e.prototype.multiplyScalar=function(t){if(0===t)return this.field.getZero();if(1===t)return this;for(var r=this.coefficients.length,n=this.field,i=new Int32Array(r),o=this.coefficients,a=0;a<r;a++)i[a]=n.multiply(o[a],t);return new e(n,i)},e.prototype.multiplyByMonomial=function(t,r){if(t<0)throw new ws;if(0===r)return this.field.getZero();for(var n=this.coefficients,i=n.length,o=new Int32Array(i+t),a=this.field,s=0;s<i;s++)o[s]=a.multiply(n[s],r);return new e(a,o)},e.prototype.divide=function(e){if(!this.field.equals(e.field))throw new ws("GenericGFPolys do not have same GenericGF field");if(e.isZero())throw new ws("Divide by 0");for(var t=this.field,r=t.getZero(),n=this,i=e.getCoefficient(e.getDegree()),o=t.inverse(i);n.getDegree()>=e.getDegree()&&!n.isZero();){var a=n.getDegree()-e.getDegree(),s=t.multiply(n.getCoefficient(n.getDegree()),o),u=e.multiplyByMonomial(a,s),c=t.buildMonomial(a,s);r=r.addOrSubtract(c),n=n.addOrSubtract(u)}return[r,n]},e.prototype.toString=function(){for(var e="",t=this.getDegree();t>=0;t--){var r=this.getCoefficient(t);if(0!==r){if(r<0?(e+=" - ",r=-r):e.length>0&&(e+=" + "),0===t||1!==r){var n=this.field.log(r);0===n?e+="1":1===n?e+="a":(e+="a^",e+=n)}0!==t&&(1===t?e+="x":(e+="x^",e+=t))}}return e},e}(),yu=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),vu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return yu(t,e),t.kind="ArithmeticException",t}(ms),bu=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wu=function(e){function t(t,r,n){var i=e.call(this)||this;i.primitive=t,i.size=r,i.generatorBase=n;for(var o=new Int32Array(r),a=1,s=0;s<r;s++)o[s]=a,(a*=2)>=r&&(a^=t,a&=r-1);i.expTable=o;var u=new Int32Array(r);for(s=0;s<r-1;s++)u[o[s]]=s;return i.logTable=u,i.zero=new mu(i,Int32Array.from([0])),i.one=new mu(i,Int32Array.from([1])),i}return bu(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 ws;if(0===t)return this.zero;var r=new Int32Array(e+1);return r[0]=t,new mu(this,r)},t.prototype.inverse=function(e){if(0===e)throw new vu;return this.expTable[this.size-this.logTable[e]-1]},t.prototype.multiply=function(e,t){return 0===e||0===t?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"+Os.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}(gu),_u=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Au=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return _u(t,e),t.kind="ReedSolomonException",t}(ms),Eu=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Cu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Eu(t,e),t.kind="IllegalStateException",t}(ms),xu=function(){function e(e){this.field=e}return e.prototype.decode=function(e,t){for(var r=this.field,n=new mu(r,e),i=new Int32Array(t),o=!0,a=0;a<t;a++){var s=n.evaluateAt(r.exp(a+r.getGeneratorBase()));i[i.length-1-a]=s,0!==s&&(o=!1)}if(!o){var u=new mu(r,i),c=this.runEuclideanAlgorithm(r.buildMonomial(t,1),u,t),l=c[0],d=c[1],h=this.findErrorLocations(l),f=this.findErrorMagnitudes(d,h);for(a=0;a<h.length;a++){var p=e.length-1-r.log(h[a]);if(p<0)throw new Au("Bad error location");e[p]=wu.addOrSubtract(e[p],f[a])}}},e.prototype.runEuclideanAlgorithm=function(e,t,r){if(e.getDegree()<t.getDegree()){var n=e;e=t,t=n}for(var i=this.field,o=e,a=t,s=i.getZero(),u=i.getOne();a.getDegree()>=(r/2|0);){var c=o,l=s;if(s=u,(o=a).isZero())throw new Au("r_{i-1} was zero");a=c;for(var d=i.getZero(),h=o.getCoefficient(o.getDegree()),f=i.inverse(h);a.getDegree()>=o.getDegree()&&!a.isZero();){var p=a.getDegree()-o.getDegree(),g=i.multiply(a.getCoefficient(a.getDegree()),f);d=d.addOrSubtract(i.buildMonomial(p,g)),a=a.addOrSubtract(o.multiplyByMonomial(p,g))}if(u=d.multiply(s).addOrSubtract(l),a.getDegree()>=o.getDegree())throw new Cu("Division algorithm failed to reduce polynomial?")}var m=u.getCoefficient(0);if(0===m)throw new Au("sigmaTilde(0) was zero");var y=i.inverse(m);return[u.multiplyScalar(y),a.multiplyScalar(y)]},e.prototype.findErrorLocations=function(e){var t=e.getDegree();if(1===t)return Int32Array.from([e.getCoefficient(1)]);for(var r=new Int32Array(t),n=0,i=this.field,o=1;o<i.getSize()&&n<t;o++)0===e.evaluateAt(o)&&(r[n]=i.inverse(o),n++);if(n!==t)throw new Au("Error locator degree does not match number of roots");return r},e.prototype.findErrorMagnitudes=function(e,t){for(var r=t.length,n=new Int32Array(r),i=this.field,o=0;o<r;o++){for(var a=i.inverse(t[o]),s=1,u=0;u<r;u++)if(o!==u){var c=i.multiply(t[u],a),l=1&c?-2&c:1|c;s=i.multiply(s,l)}n[o]=i.multiply(e.evaluateAt(a),i.inverse(s)),0!==i.getGeneratorBase()&&(n[o]=i.multiply(n[o],a))}return n},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"}(hu||(hu={}));var Su=function(){function e(){}return e.prototype.decode=function(t){this.ddata=t;var r=t.getBits(),n=this.extractBits(r),i=this.correctBits(n),o=e.convertBoolArrayToByteArray(i),a=e.getEncodedData(i),s=new pu(o,a,null,null);return s.setNumBits(i.length),s},e.highLevelDecode=function(e){return this.getEncodedData(e)},e.getEncodedData=function(t){for(var r=t.length,n=hu.UPPER,i=hu.UPPER,o="",a=0;a<r;)if(i===hu.BINARY){if(r-a<5)break;var s=e.readCode(t,a,5);if(a+=5,0===s){if(r-a<11)break;s=e.readCode(t,a,11)+31,a+=11}for(var u=0;u<s;u++){if(r-a<8){a=r;break}var c=e.readCode(t,a,8);o+=Gs.castAsNonUtf8Char(c),a+=8}i=n}else{var l=i===hu.DIGIT?4:5;if(r-a<l)break;c=e.readCode(t,a,l);a+=l;var d=e.getCharacter(i,c);d.startsWith("CTRL_")?(n=i,i=e.getTable(d.charAt(5)),"L"===d.charAt(6)&&(n=i)):(o+=d,i=n)}return o},e.getTable=function(e){switch(e){case"L":return hu.LOWER;case"P":return hu.PUNCT;case"M":return hu.MIXED;case"D":return hu.DIGIT;case"B":return hu.BINARY;default:return hu.UPPER}},e.getCharacter=function(t,r){switch(t){case hu.UPPER:return e.UPPER_TABLE[r];case hu.LOWER:return e.LOWER_TABLE[r];case hu.MIXED:return e.MIXED_TABLE[r];case hu.PUNCT:return e.PUNCT_TABLE[r];case hu.DIGIT:return e.DIGIT_TABLE[r];default:throw new Cu("Bad table")}},e.prototype.correctBits=function(t){var r,n;this.ddata.getNbLayers()<=2?(n=6,r=wu.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(n=8,r=wu.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(n=10,r=wu.AZTEC_DATA_10):(n=12,r=wu.AZTEC_DATA_12);var i=this.ddata.getNbDatablocks(),o=t.length/n;if(o<i)throw new Fs;for(var a=t.length%n,s=new Int32Array(o),u=0;u<o;u++,a+=n)s[u]=e.readCode(t,a,n);try{new xu(r).decode(s,o-i)}catch(e){throw new Fs(e)}var c=(1<<n)-1,l=0;for(u=0;u<i;u++){if(0===(f=s[u])||f===c)throw new Fs;1!==f&&f!==c-1||l++}var d=new Array(i*n-l),h=0;for(u=0;u<i;u++){var f;if(1===(f=s[u])||f===c-1)d.fill(f>1,h,h+n-1),h+=n-1;else for(var p=n-1;p>=0;--p)d[h++]=!!(f&1<<p)}return d},e.prototype.extractBits=function(e){var t=this.ddata.isCompact(),r=this.ddata.getNbLayers(),n=(t?11:14)+4*r,i=new Int32Array(n),o=new Array(this.totalBitsInLayer(r,t));if(t)for(var a=0;a<i.length;a++)i[a]=a;else{var s=n+1+2*Os.truncDivision(Os.truncDivision(n,2)-1,15),u=n/2,c=Os.truncDivision(s,2);for(a=0;a<u;a++){var l=a+Os.truncDivision(a,15);i[u-a-1]=c-l-1,i[u+a]=c+l+1}}a=0;for(var d=0;a<r;a++){for(var h=4*(r-a)+(t?9:12),f=2*a,p=n-1-f,g=0;g<h;g++)for(var m=2*g,y=0;y<2;y++)o[d+m+y]=e.get(i[f+y],i[f+g]),o[d+2*h+m+y]=e.get(i[f+g],i[p-y]),o[d+4*h+m+y]=e.get(i[p-y],i[p-g]),o[d+6*h+m+y]=e.get(i[p-g],i[f+y]);d+=8*h}return o},e.readCode=function(e,t,r){for(var n=0,i=t;i<t+r;i++)n<<=1,e[i]&&(n|=1);return n},e.readByte=function(t,r){var n=t.length-r;return n>=8?e.readCode(t,r,8):e.readCode(t,r,n)<<8-n},e.convertBoolArrayToByteArray=function(t){for(var r=new Uint8Array((t.length+7)/8),n=0;n<r.length;n++)r[n]=e.readByte(t,8*n);return r},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"],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"],e.MIXED_TABLE=["CTRL_PS"," ","","","","","","","","\b","\t","\n","\v","\f","\r","","","","","","@","\\","^","_","`","|","~","","CTRL_LL","CTRL_UL","CTRL_PL","CTRL_BS"],e.PUNCT_TABLE=["","\r","\r\n",". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],e.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"],e}(),Iu=function(){function e(){}return e.round=function(e){return isNaN(e)?0:e<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:e>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:e+(e<0?-.5:.5)|0},e.distance=function(e,t,r,n){var i=e-r,o=t-n;return Math.sqrt(i*i+o*o)},e.sum=function(e){for(var t=0,r=0,n=e.length;r!==n;r++){t+=e[r]}return t},e}(),Tu=function(){function e(){}return e.floatToIntBits=function(e){return e},e.MAX_VALUE=Number.MAX_SAFE_INTEGER,e}(),Mu=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 r=t;return this.x===r.x&&this.y===r.y}return!1},e.prototype.hashCode=function(){return 31*Tu.floatToIntBits(this.x)+Tu.floatToIntBits(this.y)},e.prototype.toString=function(){return"("+this.x+","+this.y+")"},e.orderBestPatterns=function(e){var t,r,n,i=this.distance(e[0],e[1]),o=this.distance(e[1],e[2]),a=this.distance(e[0],e[2]);if(o>=i&&o>=a?(r=e[0],t=e[1],n=e[2]):a>=o&&a>=i?(r=e[1],t=e[0],n=e[2]):(r=e[2],t=e[0],n=e[1]),this.crossProductZ(t,r,n)<0){var s=t;t=n,n=s}e[0]=t,e[1]=r,e[2]=n},e.distance=function(e,t){return Iu.distance(e.x,e.y,t.x,t.y)},e.crossProductZ=function(e,t,r){var n=t.x,i=t.y;return(r.x-n)*(e.y-i)-(r.y-i)*(e.x-n)},e}(),Du=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}(),Ru=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ou=function(e){function t(t,r,n,i,o){var a=e.call(this,t,r)||this;return a.compact=n,a.nbDatablocks=i,a.nbLayers=o,a}return Ru(t,e),t.prototype.getNbLayers=function(){return this.nbLayers},t.prototype.getNbDatablocks=function(){return this.nbDatablocks},t.prototype.isCompact=function(){return this.compact},t}(Du),ku=function(){function e(t,r,n,i){this.image=t,this.height=t.getHeight(),this.width=t.getWidth(),null==r&&(r=e.INIT_SIZE),null==n&&(n=t.getWidth()/2|0),null==i&&(i=t.getHeight()/2|0);var o=r/2|0;if(this.leftInit=n-o,this.rightInit=n+o,this.upInit=i-o,this.downInit=i+o,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new Xs}return e.prototype.detect=function(){for(var e=this.leftInit,t=this.rightInit,r=this.upInit,n=this.downInit,i=!1,o=!0,a=!1,s=!1,u=!1,c=!1,l=!1,d=this.width,h=this.height;o;){o=!1;for(var f=!0;(f||!s)&&t<d;)(f=this.containsBlackPoint(r,n,t,!1))?(t++,o=!0,s=!0):s||t++;if(t>=d){i=!0;break}for(var p=!0;(p||!u)&&n<h;)(p=this.containsBlackPoint(e,t,n,!0))?(n++,o=!0,u=!0):u||n++;if(n>=h){i=!0;break}for(var g=!0;(g||!c)&&e>=0;)(g=this.containsBlackPoint(r,n,e,!1))?(e--,o=!0,c=!0):c||e--;if(e<0){i=!0;break}for(var m=!0;(m||!l)&&r>=0;)(m=this.containsBlackPoint(e,t,r,!0))?(r--,o=!0,l=!0):l||r--;if(r<0){i=!0;break}o&&(a=!0)}if(!i&&a){for(var y=t-e,v=null,b=1;null===v&&b<y;b++)v=this.getBlackPointOnSegment(e,n-b,e+b,n);if(null==v)throw new Xs;var w=null;for(b=1;null===w&&b<y;b++)w=this.getBlackPointOnSegment(e,r+b,e+b,r);if(null==w)throw new Xs;var _=null;for(b=1;null===_&&b<y;b++)_=this.getBlackPointOnSegment(t,r+b,t-b,r);if(null==_)throw new Xs;var A=null;for(b=1;null===A&&b<y;b++)A=this.getBlackPointOnSegment(t,n-b,t-b,n);if(null==A)throw new Xs;return this.centerEdges(A,v,_,w)}throw new Xs},e.prototype.getBlackPointOnSegment=function(e,t,r,n){for(var i=Iu.round(Iu.distance(e,t,r,n)),o=(r-e)/i,a=(n-t)/i,s=this.image,u=0;u<i;u++){var c=Iu.round(e+u*o),l=Iu.round(t+u*a);if(s.get(c,l))return new Mu(c,l)}return null},e.prototype.centerEdges=function(t,r,n,i){var o=t.getX(),a=t.getY(),s=r.getX(),u=r.getY(),c=n.getX(),l=n.getY(),d=i.getX(),h=i.getY(),f=e.CORR;return o<this.width/2?[new Mu(d-f,h+f),new Mu(s+f,u+f),new Mu(c-f,l-f),new Mu(o+f,a-f)]:[new Mu(d+f,h+f),new Mu(s+f,u-f),new Mu(c-f,l+f),new Mu(o-f,a-f)]},e.prototype.containsBlackPoint=function(e,t,r,n){var i=this.image;if(n){for(var o=e;o<=t;o++)if(i.get(o,r))return!0}else for(var a=e;a<=t;a++)if(i.get(r,a))return!0;return!1},e.INIT_SIZE=10,e.CORR=1,e}(),Nu=function(){function e(){}return e.checkAndNudgePoints=function(e,t){for(var r=e.getWidth(),n=e.getHeight(),i=!0,o=0;o<t.length&&i;o+=2){var a=Math.floor(t[o]),s=Math.floor(t[o+1]);if(a<-1||a>r||s<-1||s>n)throw new Xs;i=!1,-1===a?(t[o]=0,i=!0):a===r&&(t[o]=r-1,i=!0),-1===s?(t[o+1]=0,i=!0):s===n&&(t[o+1]=n-1,i=!0)}i=!0;for(o=t.length-2;o>=0&&i;o-=2){a=Math.floor(t[o]),s=Math.floor(t[o+1]);if(a<-1||a>r||s<-1||s>n)throw new Xs;i=!1,-1===a?(t[o]=0,i=!0):a===r&&(t[o]=r-1,i=!0),-1===s?(t[o+1]=0,i=!0):s===n&&(t[o+1]=n-1,i=!0)}},e}(),Pu=function(){function e(e,t,r,n,i,o,a,s,u){this.a11=e,this.a21=t,this.a31=r,this.a12=n,this.a22=i,this.a32=o,this.a13=a,this.a23=s,this.a33=u}return e.quadrilateralToQuadrilateral=function(t,r,n,i,o,a,s,u,c,l,d,h,f,p,g,m){var y=e.quadrilateralToSquare(t,r,n,i,o,a,s,u);return e.squareToQuadrilateral(c,l,d,h,f,p,g,m).times(y)},e.prototype.transformPoints=function(e){for(var t=e.length,r=this.a11,n=this.a12,i=this.a13,o=this.a21,a=this.a22,s=this.a23,u=this.a31,c=this.a32,l=this.a33,d=0;d<t;d+=2){var h=e[d],f=e[d+1],p=i*h+s*f+l;e[d]=(r*h+o*f+u)/p,e[d+1]=(n*h+a*f+c)/p}},e.prototype.transformPointsWithValues=function(e,t){for(var r=this.a11,n=this.a12,i=this.a13,o=this.a21,a=this.a22,s=this.a23,u=this.a31,c=this.a32,l=this.a33,d=e.length,h=0;h<d;h++){var f=e[h],p=t[h],g=i*f+s*p+l;e[h]=(r*f+o*p+u)/g,t[h]=(n*f+a*p+c)/g}},e.squareToQuadrilateral=function(t,r,n,i,o,a,s,u){var c=t-n+o-s,l=r-i+a-u;if(0===c&&0===l)return new e(n-t,o-n,t,i-r,a-i,r,0,0,1);var d=n-o,h=s-o,f=i-a,p=u-a,g=d*p-h*f,m=(c*p-h*l)/g,y=(d*l-c*f)/g;return new e(n-t+m*n,s-t+y*s,t,i-r+m*i,u-r+y*u,r,m,y,1)},e.quadrilateralToSquare=function(t,r,n,i,o,a,s,u){return e.squareToQuadrilateral(t,r,n,i,o,a,s,u).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}(),Bu=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Fu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Bu(t,e),t.prototype.sampleGrid=function(e,t,r,n,i,o,a,s,u,c,l,d,h,f,p,g,m,y,v){var b=Pu.quadrilateralToQuadrilateral(n,i,o,a,s,u,c,l,d,h,f,p,g,m,y,v);return this.sampleGridWithTransform(e,t,r,b)},t.prototype.sampleGridWithTransform=function(e,t,r,n){if(t<=0||r<=0)throw new Xs;for(var i=new Ws(t,r),o=new Float32Array(2*t),a=0;a<r;a++){for(var s=o.length,u=a+.5,c=0;c<s;c+=2)o[c]=c/2+.5,o[c+1]=u;n.transformPoints(o),Nu.checkAndNudgePoints(e,o);try{for(c=0;c<s;c+=2)e.get(Math.floor(o[c]),Math.floor(o[c+1]))&&i.set(c/2,a)}catch(e){throw new Xs}}return i},t}(Nu),Lu=function(){function e(){}return e.setGridSampler=function(t){e.gridSampler=t},e.getInstance=function(){return e.gridSampler},e.gridSampler=new Fu,e}(),zu=function(){function e(e,t){this.x=e,this.y=t}return e.prototype.toResultPoint=function(){return new Mu(this.getX(),this.getY())},e.prototype.getX=function(){return this.x},e.prototype.getY=function(){return this.y},e}(),Uu=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(),r=this.getBullsEyeCorners(t);if(e){var n=r[0];r[0]=r[2],r[2]=n}this.extractParameters(r);var i=this.sampleGrid(this.image,r[this.shift%4],r[(this.shift+1)%4],r[(this.shift+2)%4],r[(this.shift+3)%4]),o=this.getMatrixCornerPoints(r);return new Ou(i,o,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 Xs;var t=2*this.nbCenterLayers,r=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(r,t);for(var n=0,i=0;i<4;i++){var o=r[(this.shift+i)%4];this.compact?(n<<=7,n+=o>>1&127):(n<<=10,n+=(o>>2&992)+(o>>1&31))}var a=this.getCorrectedParameterData(n,this.compact);this.compact?(this.nbLayers=1+(a>>6),this.nbDataBlocks=1+(63&a)):(this.nbLayers=1+(a>>11),this.nbDataBlocks=1+(2047&a))},e.prototype.getRotation=function(e,t){var r=0;e.forEach(function(e,n,i){r=(r<<3)+((e>>t-2<<1)+(1&e))}),r=((1&r)<<11)+(r>>1);for(var n=0;n<4;n++)if(Os.bitCount(r^this.EXPECTED_CORNER_BITS[n])<=2)return n;throw new Xs},e.prototype.getCorrectedParameterData=function(e,t){var r,n;t?(r=7,n=2):(r=10,n=4);for(var i=r-n,o=new Int32Array(r),a=r-1;a>=0;--a)o[a]=15&e,e>>=4;try{new xu(wu.AZTEC_PARAM).decode(o,i)}catch(e){throw new Xs}var s=0;for(a=0;a<n;a++)s=(s<<4)+o[a];return s},e.prototype.getBullsEyeCorners=function(e){var t=e,r=e,n=e,i=e,o=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){var a=this.getFirstDifferent(t,o,1,-1),s=this.getFirstDifferent(r,o,1,1),u=this.getFirstDifferent(n,o,-1,1),c=this.getFirstDifferent(i,o,-1,-1);if(this.nbCenterLayers>2){var l=this.distancePoint(c,a)*this.nbCenterLayers/(this.distancePoint(i,t)*(this.nbCenterLayers+2));if(l<.75||l>1.25||!this.isWhiteOrBlackRectangle(a,s,u,c))break}t=a,r=s,n=u,i=c,o=!o}if(5!==this.nbCenterLayers&&7!==this.nbCenterLayers)throw new Xs;this.compact=5===this.nbCenterLayers;var d=new Mu(t.getX()+.5,t.getY()-.5),h=new Mu(r.getX()+.5,r.getY()+.5),f=new Mu(n.getX()-.5,n.getY()+.5),p=new Mu(i.getX()-.5,i.getY()-.5);return this.expandSquare([d,h,f,p],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},e.prototype.getMatrixCenter=function(){var e,t,r,n;try{e=(u=new ku(this.image).detect())[0],t=u[1],r=u[2],n=u[3]}catch(a){var i=this.image.getWidth()/2,o=this.image.getHeight()/2;e=this.getFirstDifferent(new zu(i+7,o-7),!1,1,-1).toResultPoint(),t=this.getFirstDifferent(new zu(i+7,o+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new zu(i-7,o+7),!1,-1,1).toResultPoint(),n=this.getFirstDifferent(new zu(i-7,o-7),!1,-1,-1).toResultPoint()}var a=Iu.round((e.getX()+n.getX()+t.getX()+r.getX())/4),s=Iu.round((e.getY()+n.getY()+t.getY()+r.getY())/4);try{var u;e=(u=new ku(this.image,15,a,s).detect())[0],t=u[1],r=u[2],n=u[3]}catch(i){e=this.getFirstDifferent(new zu(a+7,s-7),!1,1,-1).toResultPoint(),t=this.getFirstDifferent(new zu(a+7,s+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new zu(a-7,s+7),!1,-1,1).toResultPoint(),n=this.getFirstDifferent(new zu(a-7,s-7),!1,-1,-1).toResultPoint()}return a=Iu.round((e.getX()+n.getX()+t.getX()+r.getX())/4),s=Iu.round((e.getY()+n.getY()+t.getY()+r.getY())/4),new zu(a,s)},e.prototype.getMatrixCornerPoints=function(e){return this.expandSquare(e,2*this.nbCenterLayers,this.getDimension())},e.prototype.sampleGrid=function(e,t,r,n,i){var o=Lu.getInstance(),a=this.getDimension(),s=a/2-this.nbCenterLayers,u=a/2+this.nbCenterLayers;return o.sampleGrid(e,a,a,s,s,u,s,u,u,s,u,t.getX(),t.getY(),r.getX(),r.getY(),n.getX(),n.getY(),i.getX(),i.getY())},e.prototype.sampleLine=function(e,t,r){for(var n=0,i=this.distanceResultPoint(e,t),o=i/r,a=e.getX(),s=e.getY(),u=o*(t.getX()-e.getX())/i,c=o*(t.getY()-e.getY())/i,l=0;l<r;l++)this.image.get(Iu.round(a+l*u),Iu.round(s+l*c))&&(n|=1<<r-l-1);return n},e.prototype.isWhiteOrBlackRectangle=function(e,t,r,n){e=new zu(e.getX()-3,e.getY()+3),t=new zu(t.getX()-3,t.getY()-3),r=new zu(r.getX()+3,r.getY()-3),n=new zu(n.getX()+3,n.getY()+3);var i=this.getColor(n,e);if(0===i)return!1;var o=this.getColor(e,t);return o===i&&((o=this.getColor(t,r))===i&&(o=this.getColor(r,n))===i)},e.prototype.getColor=function(e,t){for(var r=this.distancePoint(e,t),n=(t.getX()-e.getX())/r,i=(t.getY()-e.getY())/r,o=0,a=e.getX(),s=e.getY(),u=this.image.get(e.getX(),e.getY()),c=Math.ceil(r),l=0;l<c;l++)a+=n,s+=i,this.image.get(Iu.round(a),Iu.round(s))!==u&&o++;var d=o/r;return d>.1&&d<.9?0:d<=.1===u?1:-1},e.prototype.getFirstDifferent=function(e,t,r,n){for(var i=e.getX()+r,o=e.getY()+n;this.isValid(i,o)&&this.image.get(i,o)===t;)i+=r,o+=n;for(i-=r,o-=n;this.isValid(i,o)&&this.image.get(i,o)===t;)i+=r;for(i-=r;this.isValid(i,o)&&this.image.get(i,o)===t;)o+=n;return new zu(i,o-=n)},e.prototype.expandSquare=function(e,t,r){var n=r/(2*t),i=e[0].getX()-e[2].getX(),o=e[0].getY()-e[2].getY(),a=(e[0].getX()+e[2].getX())/2,s=(e[0].getY()+e[2].getY())/2,u=new Mu(a+n*i,s+n*o),c=new Mu(a-n*i,s-n*o);return i=e[1].getX()-e[3].getX(),o=e[1].getY()-e[3].getY(),a=(e[1].getX()+e[3].getX())/2,s=(e[1].getY()+e[3].getY())/2,[u,new Mu(a+n*i,s+n*o),c,new Mu(a-n*i,s-n*o)]},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=Iu.round(e.getX()),r=Iu.round(e.getY());return this.isValid(t,r)},e.prototype.distancePoint=function(e,t){return Iu.distance(e.getX(),e.getY(),t.getX(),t.getY())},e.prototype.distanceResultPoint=function(e,t){return Iu.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*(Os.truncDivision(this.nbLayers-4,8)+1)+15},e}(),ju=function(){function e(){}return e.prototype.decode=function(e,t){void 0===t&&(t=null);var r=null,n=new Uu(e.getBlackMatrix()),i=null,o=null;try{i=(a=n.detectMirror(!1)).getPoints(),this.reportFoundResultPoints(t,i),o=(new Su).decode(a)}catch(e){r=e}if(null==o)try{var a;i=(a=n.detectMirror(!0)).getPoints(),this.reportFoundResultPoints(t,i),o=(new Su).decode(a)}catch(e){if(null!=r)throw r;throw e}var s=new cu(o.getText(),o.getRawBytes(),o.getNumBits(),i,du.AZTEC,xs.currentTimeMillis()),u=o.getByteSegments();null!=u&&s.putMetadata(fu.BYTE_SEGMENTS,u);var c=o.getECLevel();return null!=c&&s.putMetadata(fu.ERROR_CORRECTION_LEVEL,c),s},e.prototype.reportFoundResultPoints=function(e,t){if(null!=e){var r=e.get(Ps.NEED_RESULT_POINT_CALLBACK);null!=r&&t.forEach(function(e,t,n){r.foundPossibleResultPoint(e)})}},e.prototype.reset=function(){},e}(),Vu=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){function t(t){return void 0===t&&(t=500),e.call(this,new ju,t)||this}Vu(t,e)}(uu);var Hu=function(){function e(){}return e.prototype.decode=function(e,t){try{return this.doDecode(e,t)}catch(c){if(t&&!0===t.get(Ps.TRY_HARDER)&&e.isRotateSupported()){var r=e.rotateCounterClockwise(),n=this.doDecode(r,t),i=n.getResultMetadata(),o=270;null!==i&&!0===i.get(fu.ORIENTATION)&&(o+=i.get(fu.ORIENTATION)%360),n.putMetadata(fu.ORIENTATION,o);var a=n.getResultPoints();if(null!==a)for(var s=r.getHeight(),u=0;u<a.length;u++)a[u]=new Mu(s-a[u].getY()-1,a[u].getX());return n}throw new Xs}},e.prototype.reset=function(){},e.prototype.doDecode=function(e,t){var r,n=e.getWidth(),i=e.getHeight(),o=new ks(n),a=t&&!0===t.get(Ps.TRY_HARDER),s=Math.max(1,i>>(a?8:5));r=a?i:15;for(var u=Math.trunc(i/2),c=0;c<r;c++){var l=Math.trunc((c+1)/2),d=u+s*(!(1&c)?l:-l);if(d<0||d>=i)break;try{o=e.getBlackRow(d,o)}catch(e){continue}for(var h=function(e){if(1===e&&(o.reverse(),t&&!0===t.get(Ps.NEED_RESULT_POINT_CALLBACK))){var r=new Map;t.forEach(function(e,t){return r.set(t,e)}),r.delete(Ps.NEED_RESULT_POINT_CALLBACK),t=r}try{var i=f.decodeRow(d,o,t);if(1===e){i.putMetadata(fu.ORIENTATION,180);var a=i.getResultPoints();null!==a&&(a[0]=new Mu(n-a[0].getX()-1,a[0].getY()),a[1]=new Mu(n-a[1].getX()-1,a[1].getY()))}return{value:i}}catch(e){}},f=this,p=0;p<2;p++){var g=h(p);if("object"==typeof g)return g.value}}throw new Xs},e.recordPattern=function(e,t,r){for(var n=r.length,i=0;i<n;i++)r[i]=0;var o=e.getSize();if(t>=o)throw new Xs;for(var a=!e.get(t),s=0,u=t;u<o;){if(e.get(u)!==a)r[s]++;else{if(++s===n)break;r[s]=1,a=!a}u++}if(s!==n&&(s!==n-1||u!==o))throw new Xs},e.recordPatternInReverse=function(t,r,n){for(var i=n.length,o=t.get(r);r>0&&i>=0;)t.get(--r)!==o&&(i--,o=!o);if(i>=0)throw new Xs;e.recordPattern(t,r+1,n)},e.patternMatchVariance=function(e,t,r){for(var n=e.length,i=0,o=0,a=0;a<n;a++)i+=e[a],o+=t[a];if(i<o)return Number.POSITIVE_INFINITY;var s=i/o;r*=s;for(var u=0,c=0;c<n;c++){var l=e[c],d=t[c]*s,h=l>d?l-d:d-l;if(h>r)return Number.POSITIVE_INFINITY;u+=h}return u/i},e}(),Gu=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),qu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Gu(t,e),t.findStartPattern=function(e){for(var r=e.getSize(),n=e.getNextSet(0),i=0,o=Int32Array.from([0,0,0,0,0,0]),a=n,s=!1,u=n;u<r;u++)if(e.get(u)!==s)o[i]++;else{if(5===i){for(var c=t.MAX_AVG_VARIANCE,l=-1,d=t.CODE_START_A;d<=t.CODE_START_C;d++){var h=Hu.patternMatchVariance(o,t.CODE_PATTERNS[d],t.MAX_INDIVIDUAL_VARIANCE);h<c&&(c=h,l=d)}if(l>=0&&e.isRange(Math.max(0,a-(u-a)/2),a,!1))return Int32Array.from([a,u,l]);a+=o[0]+o[1],(o=o.slice(2,o.length))[i-1]=0,o[i]=0,i--}else i++;o[i]=1,s=!s}throw new Xs},t.decodeCode=function(e,r,n){Hu.recordPattern(e,n,r);for(var i=t.MAX_AVG_VARIANCE,o=-1,a=0;a<t.CODE_PATTERNS.length;a++){var s=t.CODE_PATTERNS[a],u=this.patternMatchVariance(r,s,t.MAX_INDIVIDUAL_VARIANCE);u<i&&(i=u,o=a)}if(o>=0)return o;throw new Xs},t.prototype.decodeRow=function(e,r,n){var i,o=n&&!0===n.get(Ps.ASSUME_GS1),a=t.findStartPattern(r),s=a[2],u=0,c=new Uint8Array(20);switch(c[u++]=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 Fs}for(var l=!1,d=!1,h="",f=a[0],p=a[1],g=Int32Array.from([0,0,0,0,0,0]),m=0,y=0,v=s,b=0,w=!0,_=!1,A=!1;!l;){var E=d;switch(d=!1,m=y,y=t.decodeCode(r,g,p),c[u++]=y,y!==t.CODE_STOP&&(w=!0),y!==t.CODE_STOP&&(v+=++b*y),f=p,p+=g.reduce(function(e,t){return e+t},0),y){case t.CODE_START_A:case t.CODE_START_B:case t.CODE_START_C:throw new Fs}switch(i){case t.CODE_CODE_A:if(y<64)h+=A===_?String.fromCharCode(" ".charCodeAt(0)+y):String.fromCharCode(" ".charCodeAt(0)+y+128),A=!1;else if(y<96)h+=A===_?String.fromCharCode(y-64):String.fromCharCode(y+64),A=!1;else switch(y!==t.CODE_STOP&&(w=!1),y){case t.CODE_FNC_1:o&&(0===h.length?h+="]C1":h+=String.fromCharCode(29));break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_A:!_&&A?(_=!0,A=!1):_&&A?(_=!1,A=!1):A=!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:l=!0}break;case t.CODE_CODE_B:if(y<96)h+=A===_?String.fromCharCode(" ".charCodeAt(0)+y):String.fromCharCode(" ".charCodeAt(0)+y+128),A=!1;else switch(y!==t.CODE_STOP&&(w=!1),y){case t.CODE_FNC_1:o&&(0===h.length?h+="]C1":h+=String.fromCharCode(29));break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_B:!_&&A?(_=!0,A=!1):_&&A?(_=!1,A=!1):A=!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:l=!0}break;case t.CODE_CODE_C:if(y<100)y<10&&(h+="0"),h+=y;else switch(y!==t.CODE_STOP&&(w=!1),y){case t.CODE_FNC_1:o&&(0===h.length?h+="]C1":h+=String.fromCharCode(29));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:l=!0}}E&&(i=i===t.CODE_CODE_A?t.CODE_CODE_B:t.CODE_CODE_A)}var C=p-f;if(p=r.getNextUnset(p),!r.isRange(p,Math.min(r.getSize(),p+(p-f)/2),!1))throw new Xs;if((v-=b*m)%103!==m)throw new Es;var x=h.length;if(0===x)throw new Xs;x>0&&w&&(h=i===t.CODE_CODE_C?h.substring(0,x-2):h.substring(0,x-1));for(var S=(a[1]+a[0])/2,I=f+C/2,T=c.length,M=new Uint8Array(T),D=0;D<T;D++)M[D]=c[D];var R=[new Mu(S,e),new Mu(I,e)];return new cu(h,M,0,R,du.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}(Hu),Wu=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ku=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Xu=function(e){function t(t,r){void 0===t&&(t=!1),void 0===r&&(r=!1);var n=e.call(this)||this;return n.usingCheckDigit=t,n.extendedMode=r,n.decodeRowResult="",n.counters=new Int32Array(9),n}return Wu(t,e),t.prototype.decodeRow=function(e,r,n){var i,o,a,s,u=this.counters;u.fill(0),this.decodeRowResult="";var c,l,d=t.findAsteriskPattern(r,u),h=r.getNextSet(d[1]),f=r.getSize();do{t.recordPattern(r,h,u);var p=t.toNarrowWidePattern(u);if(p<0)throw new Xs;c=t.patternToChar(p),this.decodeRowResult+=c,l=h;try{for(var g=(i=void 0,Ku(u)),m=g.next();!m.done;m=g.next()){h+=m.value}}catch(e){i={error:e}}finally{try{m&&!m.done&&(o=g.return)&&o.call(g)}finally{if(i)throw i.error}}h=r.getNextSet(h)}while("*"!==c);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var y,v=0;try{for(var b=Ku(u),w=b.next();!w.done;w=b.next()){v+=w.value}}catch(e){a={error:e}}finally{try{w&&!w.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}if(h!==f&&2*(h-l-v)<v)throw new Xs;if(this.usingCheckDigit){for(var _=this.decodeRowResult.length-1,A=0,E=0;E<_;E++)A+=t.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(E));if(this.decodeRowResult.charAt(_)!==t.ALPHABET_STRING.charAt(A%43))throw new Es;this.decodeRowResult=this.decodeRowResult.substring(0,_)}if(0===this.decodeRowResult.length)throw new Xs;y=this.extendedMode?t.decodeExtended(this.decodeRowResult):this.decodeRowResult;var C=(d[1]+d[0])/2,x=l+v/2;return new cu(y,null,0,[new Mu(C,e),new Mu(x,e)],du.CODE_39,(new Date).getTime())},t.findAsteriskPattern=function(e,r){for(var n=e.getSize(),i=e.getNextSet(0),o=0,a=i,s=!1,u=r.length,c=i;c<n;c++)if(e.get(c)!==s)r[o]++;else{if(o===u-1){if(this.toNarrowWidePattern(r)===t.ASTERISK_ENCODING&&e.isRange(Math.max(0,a-Math.floor((c-a)/2)),a,!1))return[a,c];a+=r[0]+r[1],r.copyWithin(0,2,2+o-1),r[o-1]=0,r[o]=0,o--}else o++;r[o]=1,s=!s}throw new Xs},t.toNarrowWidePattern=function(e){var t,r,n,i=e.length,o=0;do{var a=2147483647;try{for(var s=(t=void 0,Ku(e)),u=s.next();!u.done;u=s.next()){(h=u.value)<a&&h>o&&(a=h)}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}o=a,n=0;for(var c=0,l=0,d=0;d<i;d++){(h=e[d])>o&&(l|=1<<i-1-d,n++,c+=h)}if(3===n){for(d=0;d<i&&n>0;d++){var h;if((h=e[d])>o&&(n--,2*h>=c))return-1}return l}}while(n>3);return-1},t.patternToChar=function(e){for(var r=0;r<t.CHARACTER_ENCODINGS.length;r++)if(t.CHARACTER_ENCODINGS[r]===e)return t.ALPHABET_STRING.charAt(r);if(e===t.ASTERISK_ENCODING)return"*";throw new Xs},t.decodeExtended=function(e){for(var t=e.length,r="",n=0;n<t;n++){var i=e.charAt(n);if("+"===i||"$"===i||"%"===i||"/"===i){var o=e.charAt(n+1),a="\0";switch(i){case"+":if(!(o>="A"&&o<="Z"))throw new Fs;a=String.fromCharCode(o.charCodeAt(0)+32);break;case"$":if(!(o>="A"&&o<="Z"))throw new Fs;a=String.fromCharCode(o.charCodeAt(0)-64);break;case"%":if(o>="A"&&o<="E")a=String.fromCharCode(o.charCodeAt(0)-38);else if(o>="F"&&o<="J")a=String.fromCharCode(o.charCodeAt(0)-11);else if(o>="K"&&o<="O")a=String.fromCharCode(o.charCodeAt(0)+16);else if(o>="P"&&o<="T")a=String.fromCharCode(o.charCodeAt(0)+43);else if("U"===o)a="\0";else if("V"===o)a="@";else if("W"===o)a="`";else{if("X"!==o&&"Y"!==o&&"Z"!==o)throw new Fs;a=""}break;case"/":if(o>="A"&&o<="O")a=String.fromCharCode(o.charCodeAt(0)-32);else{if("Z"!==o)throw new Fs;a=":"}}r+=a,n++}else r+=i}return r},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}(Hu),Yu=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Zu=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ju=function(e){function t(){var t=e.call(this)||this;return t.decodeRowResult="",t.counters=new Int32Array(6),t}return Yu(t,e),t.prototype.decodeRow=function(e,r,n){var i,o,a,s,u,c,l=this.findAsteriskPattern(r),d=r.getNextSet(l[1]),h=r.getSize(),f=this.counters;f.fill(0),this.decodeRowResult="";do{t.recordPattern(r,d,f);var p=this.toPattern(f);if(p<0)throw new Xs;u=this.patternToChar(p),this.decodeRowResult+=u,c=d;try{for(var g=(i=void 0,Zu(f)),m=g.next();!m.done;m=g.next()){d+=m.value}}catch(e){i={error:e}}finally{try{m&&!m.done&&(o=g.return)&&o.call(g)}finally{if(i)throw i.error}}d=r.getNextSet(d)}while("*"!==u);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var y=0;try{for(var v=Zu(f),b=v.next();!b.done;b=v.next()){y+=b.value}}catch(e){a={error:e}}finally{try{b&&!b.done&&(s=v.return)&&s.call(v)}finally{if(a)throw a.error}}if(d===h||!r.get(d))throw new Xs;if(this.decodeRowResult.length<2)throw new Xs;this.checkChecksums(this.decodeRowResult),this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-2);var w=this.decodeExtended(this.decodeRowResult),_=(l[1]+l[0])/2,A=c+y/2;return new cu(w,null,0,[new Mu(_,e),new Mu(A,e)],du.CODE_93,(new Date).getTime())},t.prototype.findAsteriskPattern=function(e){var r=e.getSize(),n=e.getNextSet(0);this.counters.fill(0);for(var i=this.counters,o=n,a=!1,s=i.length,u=0,c=n;c<r;c++)if(e.get(c)!==a)i[u]++;else{if(u===s-1){if(this.toPattern(i)===t.ASTERISK_ENCODING)return new Int32Array([o,c]);o+=i[0]+i[1],i.copyWithin(0,2,2+u-1),i[u-1]=0,i[u]=0,u--}else u++;i[u]=1,a=!a}throw new Xs},t.prototype.toPattern=function(e){var t,r,n=0;try{for(var i=Zu(e),o=i.next();!o.done;o=i.next()){n+=o.value}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}for(var a=0,s=e.length,u=0;u<s;u++){var c=Math.round(9*e[u]/n);if(c<1||c>4)return-1;if(1&u)a<<=c;else for(var l=0;l<c;l++)a=a<<1|1}return a},t.prototype.patternToChar=function(e){for(var r=0;r<t.CHARACTER_ENCODINGS.length;r++)if(t.CHARACTER_ENCODINGS[r]===e)return t.ALPHABET_STRING.charAt(r);throw new Xs},t.prototype.decodeExtended=function(e){for(var t=e.length,r="",n=0;n<t;n++){var i=e.charAt(n);if(i>="a"&&i<="d"){if(n>=t-1)throw new Fs;var o=e.charAt(n+1),a="\0";switch(i){case"d":if(!(o>="A"&&o<="Z"))throw new Fs;a=String.fromCharCode(o.charCodeAt(0)+32);break;case"a":if(!(o>="A"&&o<="Z"))throw new Fs;a=String.fromCharCode(o.charCodeAt(0)-64);break;case"b":if(o>="A"&&o<="E")a=String.fromCharCode(o.charCodeAt(0)-38);else if(o>="F"&&o<="J")a=String.fromCharCode(o.charCodeAt(0)-11);else if(o>="K"&&o<="O")a=String.fromCharCode(o.charCodeAt(0)+16);else if(o>="P"&&o<="T")a=String.fromCharCode(o.charCodeAt(0)+43);else if("U"===o)a="\0";else if("V"===o)a="@";else if("W"===o)a="`";else{if(!(o>="X"&&o<="Z"))throw new Fs;a=String.fromCharCode(127)}break;case"c":if(o>="A"&&o<="O")a=String.fromCharCode(o.charCodeAt(0)-32);else{if("Z"!==o)throw new Fs;a=":"}}r+=a,n++}else r+=i}return r},t.prototype.checkChecksums=function(e){var t=e.length;this.checkOneChecksum(e,t-2,20),this.checkOneChecksum(e,t-1,15)},t.prototype.checkOneChecksum=function(e,r,n){for(var i=1,o=0,a=r-1;a>=0;a--)o+=i*t.ALPHABET_STRING.indexOf(e.charAt(a)),++i>n&&(i=1);if(e.charAt(r)!==t.ALPHABET_STRING[o%47])throw new Es},t.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*",t.CHARACTER_ENCODINGS=[276,328,324,322,296,292,290,336,274,266,424,420,418,404,402,394,360,356,354,308,282,344,332,326,300,278,436,434,428,422,406,410,364,358,310,314,302,468,466,458,366,374,430,294,474,470,306,350],t.ASTERISK_ENCODING=t.CHARACTER_ENCODINGS[47],t}(Hu),$u=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qu=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ec=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.narrowLineWidth=-1,t}return $u(t,e),t.prototype.decodeRow=function(e,r,n){var i,o,a=this.decodeStart(r),s=this.decodeEnd(r),u=new qs;t.decodeMiddle(r,a[1],s[0],u);var c=u.toString(),l=null;null!=n&&(l=n.get(Ps.ALLOWED_LENGTHS)),null==l&&(l=t.DEFAULT_ALLOWED_LENGTHS);var d=c.length,h=!1,f=0;try{for(var p=Qu(l),g=p.next();!g.done;g=p.next()){var m=g.value;if(d===m){h=!0;break}m>f&&(f=m)}}catch(e){i={error:e}}finally{try{g&&!g.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}if(!h&&d>f&&(h=!0),!h)throw new Fs;var y=[new Mu(a[1],e),new Mu(s[0],e)];return new cu(c,null,0,y,du.ITF,(new Date).getTime())},t.decodeMiddle=function(e,r,n,i){var o=new Int32Array(10),a=new Int32Array(5),s=new Int32Array(5);for(o.fill(0),a.fill(0),s.fill(0);r<n;){Hu.recordPattern(e,r,o);for(var u=0;u<5;u++){var c=2*u;a[u]=o[c],s[u]=o[c+1]}var l=t.decodeDigit(a);i.append(l.toString()),l=this.decodeDigit(s),i.append(l.toString()),o.forEach(function(e){r+=e})}},t.prototype.decodeStart=function(e){var r=t.skipWhiteSpace(e),n=t.findGuardPattern(e,r,t.START_PATTERN);return this.narrowLineWidth=(n[1]-n[0])/4,this.validateQuietZone(e,n[0]),n},t.prototype.validateQuietZone=function(e,t){var r=10*this.narrowLineWidth;r=r<t?r:t;for(var n=t-1;r>0&&n>=0&&!e.get(n);n--)r--;if(0!==r)throw new Xs},t.skipWhiteSpace=function(e){var t=e.getSize(),r=e.getNextSet(0);if(r===t)throw new Xs;return r},t.prototype.decodeEnd=function(e){e.reverse();try{var r=t.skipWhiteSpace(e),n=void 0;try{n=t.findGuardPattern(e,r,t.END_PATTERN_REVERSED[0])}catch(i){i instanceof Xs&&(n=t.findGuardPattern(e,r,t.END_PATTERN_REVERSED[1]))}this.validateQuietZone(e,n[0]);var i=n[0];return n[0]=e.getSize()-n[1],n[1]=e.getSize()-i,n}finally{e.reverse()}},t.findGuardPattern=function(e,r,n){var i=n.length,o=new Int32Array(i),a=e.getSize(),s=!1,u=0,c=r;o.fill(0);for(var l=r;l<a;l++)if(e.get(l)!==s)o[u]++;else{if(u===i-1){if(Hu.patternMatchVariance(o,n,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return[c,l];c+=o[0]+o[1],xs.arraycopy(o,2,o,0,u-1),o[u-1]=0,o[u]=0,u--}else u++;o[u]=1,s=!s}throw new Xs},t.decodeDigit=function(e){for(var r=t.MAX_AVG_VARIANCE,n=-1,i=t.PATTERNS.length,o=0;o<i;o++){var a=t.PATTERNS[o],s=Hu.patternMatchVariance(e,a,t.MAX_INDIVIDUAL_VARIANCE);s<r?(r=s,n=o):s===r&&(n=-1)}if(n>=0)return n%10;throw new Xs},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}(Hu),tc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),rc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.decodeRowStringBuffer="",t}return tc(t,e),t.findStartGuardPattern=function(e){for(var r,n=!1,i=0,o=Int32Array.from([0,0,0]);!n;){o=Int32Array.from([0,0,0]);var a=(r=t.findGuardPattern(e,i,!1,this.START_END_PATTERN,o))[0],s=a-((i=r[1])-a);s>=0&&(n=e.isRange(s,a,!1))}return r},t.checkChecksum=function(e){return t.checkStandardUPCEANChecksum(e)},t.checkStandardUPCEANChecksum=function(e){var r=e.length;if(0===r)return!1;var n=parseInt(e.charAt(r-1),10);return t.getStandardUPCEANChecksum(e.substring(0,r-1))===n},t.getStandardUPCEANChecksum=function(e){for(var t=e.length,r=0,n=t-1;n>=0;n-=2){if((i=e.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||i>9)throw new Fs;r+=i}r*=3;for(n=t-2;n>=0;n-=2){var i;if((i=e.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||i>9)throw new Fs;r+=i}return(1e3-r)%10},t.decodeEnd=function(e,r){return t.findGuardPattern(e,r,!1,t.START_END_PATTERN,new Int32Array(t.START_END_PATTERN.length).fill(0))},t.findGuardPatternWithoutCounters=function(e,t,r,n){return this.findGuardPattern(e,t,r,n,new Int32Array(n.length))},t.findGuardPattern=function(e,r,n,i,o){for(var a=e.getSize(),s=0,u=r=n?e.getNextUnset(r):e.getNextSet(r),c=i.length,l=n,d=r;d<a;d++)if(e.get(d)!==l)o[s]++;else{if(s===c-1){if(Hu.patternMatchVariance(o,i,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return Int32Array.from([u,d]);u+=o[0]+o[1];for(var h=o.slice(2,o.length),f=0;f<s-1;f++)o[f]=h[f];o[s-1]=0,o[s]=0,s--}else s++;o[s]=1,l=!l}throw new Xs},t.decodeDigit=function(e,r,n,i){this.recordPattern(e,n,r);for(var o=this.MAX_AVG_VARIANCE,a=-1,s=i.length,u=0;u<s;u++){var c=i[u],l=Hu.patternMatchVariance(r,c,t.MAX_INDIVIDUAL_VARIANCE);l<o&&(o=l,a=u)}if(a>=0)return a;throw new Xs},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}(Hu),nc=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ic=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,r,n){var i=this.decodeRowStringBuffer,o=this.decodeMiddle(r,n,i),a=i.toString(),s=e.parseExtensionString(a),u=[new Mu((n[0]+n[1])/2,t),new Mu(o,t)],c=new cu(a,null,0,u,du.UPC_EAN_EXTENSION,(new Date).getTime());return null!=s&&c.putAllMetadata(s),c},e.prototype.decodeMiddle=function(t,r,n){var i,o,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=t.getSize(),u=r[1],c=0,l=0;l<5&&u<s;l++){var d=rc.decodeDigit(t,a,u,rc.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+d%10);try{for(var h=(i=void 0,nc(a)),f=h.next();!f.done;f=h.next()){u+=f.value}}catch(e){i={error:e}}finally{try{f&&!f.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}d>=10&&(c|=1<<4-l),4!==l&&(u=t.getNextSet(u),u=t.getNextUnset(u))}if(5!==n.length)throw new Xs;var p=this.determineCheckDigit(c);if(e.extensionChecksum(n.toString())!==p)throw new Xs;return u},e.extensionChecksum=function(e){for(var t=e.length,r=0,n=t-2;n>=0;n-=2)r+=e.charAt(n).charCodeAt(0)-"0".charCodeAt(0);r*=3;for(n=t-1;n>=0;n-=2)r+=e.charAt(n).charCodeAt(0)-"0".charCodeAt(0);return(r*=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 Xs},e.parseExtensionString=function(t){if(5!==t.length)return null;var r=e.parseExtension5String(t);return null==r?null:new Map([[fu.SUGGESTED_PRICE,r]])},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 r=parseInt(e.substring(1)),n=r%100;return t+(r/100).toString()+"."+(n<10?"0"+n:n.toString())},e}(),oc=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ac=function(){function e(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return e.prototype.decodeRow=function(t,r,n){var i=this.decodeRowStringBuffer,o=this.decodeMiddle(r,n,i),a=i.toString(),s=e.parseExtensionString(a),u=[new Mu((n[0]+n[1])/2,t),new Mu(o,t)],c=new cu(a,null,0,u,du.UPC_EAN_EXTENSION,(new Date).getTime());return null!=s&&c.putAllMetadata(s),c},e.prototype.decodeMiddle=function(e,t,r){var n,i,o=this.decodeMiddleCounters;o[0]=0,o[1]=0,o[2]=0,o[3]=0;for(var a=e.getSize(),s=t[1],u=0,c=0;c<2&&s<a;c++){var l=rc.decodeDigit(e,o,s,rc.L_AND_G_PATTERNS);r+=String.fromCharCode("0".charCodeAt(0)+l%10);try{for(var d=(n=void 0,oc(o)),h=d.next();!h.done;h=d.next()){s+=h.value}}catch(e){n={error:e}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}l>=10&&(u|=1<<1-c),1!==c&&(s=e.getNextSet(s),s=e.getNextUnset(s))}if(2!==r.length)throw new Xs;if(parseInt(r.toString())%4!==u)throw new Xs;return s},e.parseExtensionString=function(e){return 2!==e.length?null:new Map([[fu.ISSUE_NUMBER,parseInt(e)]])},e}(),sc=function(){function e(){}return e.decodeRow=function(e,t,r){var n=rc.findGuardPattern(t,r,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return(new ic).decodeRow(e,t,n)}catch(r){return(new ac).decodeRow(e,t,n)}},e.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),e}(),uc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),cc=function(e){function t(){var r=e.call(this)||this;r.decodeRowStringBuffer="",t.L_AND_G_PATTERNS=t.L_PATTERNS.map(function(e){return Int32Array.from(e)});for(var n=10;n<20;n++){for(var i=t.L_PATTERNS[n-10],o=new Int32Array(i.length),a=0;a<i.length;a++)o[a]=i[i.length-a-1];t.L_AND_G_PATTERNS[n]=o}return r}return uc(t,e),t.prototype.decodeRow=function(e,r,n){var i=t.findStartGuardPattern(r),o=null==n?null:n.get(Ps.NEED_RESULT_POINT_CALLBACK);if(null!=o){var a=new Mu((i[0]+i[1])/2,e);o.foundPossibleResultPoint(a)}var s=this.decodeMiddle(r,i,this.decodeRowStringBuffer),u=s.rowOffset,c=s.resultString;if(null!=o){var l=new Mu(u,e);o.foundPossibleResultPoint(l)}var d=t.decodeEnd(r,u);if(null!=o){var h=new Mu((d[0]+d[1])/2,e);o.foundPossibleResultPoint(h)}var f=d[1],p=f+(f-d[0]);if(p>=r.getSize()||!r.isRange(f,p,!1))throw new Xs;var g=c.toString();if(g.length<8)throw new Fs;if(!t.checkChecksum(g))throw new Es;var m=(i[1]+i[0])/2,y=(d[1]+d[0])/2,v=this.getBarcodeFormat(),b=[new Mu(m,e),new Mu(y,e)],w=new cu(g,null,0,b,v,(new Date).getTime()),_=0;try{var A=sc.decodeRow(e,r,d[1]);w.putMetadata(fu.UPC_EAN_EXTENSION,A.getText()),w.putAllMetadata(A.getResultMetadata()),w.addResultPoints(A.getResultPoints()),_=A.getText().length}catch(e){}var E=null==n?null:n.get(Ps.ALLOWED_EAN_EXTENSIONS);if(null!=E){var C=!1;for(var x in E)if(_.toString()===x){C=!0;break}if(!C)throw new Xs}return v===du.EAN_13||du.UPC_A,w},t.checkChecksum=function(e){return t.checkStandardUPCEANChecksum(e)},t.checkStandardUPCEANChecksum=function(e){var r=e.length;if(0===r)return!1;var n=parseInt(e.charAt(r-1),10);return t.getStandardUPCEANChecksum(e.substring(0,r-1))===n},t.getStandardUPCEANChecksum=function(e){for(var t=e.length,r=0,n=t-1;n>=0;n-=2){if((i=e.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||i>9)throw new Fs;r+=i}r*=3;for(n=t-2;n>=0;n-=2){var i;if((i=e.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||i>9)throw new Fs;r+=i}return(1e3-r)%10},t.decodeEnd=function(e,r){return t.findGuardPattern(e,r,!1,t.START_END_PATTERN,new Int32Array(t.START_END_PATTERN.length).fill(0))},t}(rc),lc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),dc=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},hc=function(e){function t(){var t=e.call(this)||this;return t.decodeMiddleCounters=Int32Array.from([0,0,0,0]),t}return lc(t,e),t.prototype.decodeMiddle=function(e,r,n){var i,o,a,s,u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;for(var c=e.getSize(),l=r[1],d=0,h=0;h<6&&l<c;h++){var f=cc.decodeDigit(e,u,l,cc.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+f%10);try{for(var p=(i=void 0,dc(u)),g=p.next();!g.done;g=p.next()){l+=g.value}}catch(e){i={error:e}}finally{try{g&&!g.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}f>=10&&(d|=1<<5-h)}n=t.determineFirstDigit(n,d),l=cc.findGuardPattern(e,l,!0,cc.MIDDLE_PATTERN,new Int32Array(cc.MIDDLE_PATTERN.length).fill(0))[1];for(h=0;h<6&&l<c;h++){f=cc.decodeDigit(e,u,l,cc.L_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+f);try{for(var m=(a=void 0,dc(u)),y=m.next();!y.done;y=m.next()){l+=y.value}}catch(e){a={error:e}}finally{try{y&&!y.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}}return{rowOffset:l,resultString:n}},t.prototype.getBarcodeFormat=function(){return du.EAN_13},t.determineFirstDigit=function(e,t){for(var r=0;r<10;r++)if(t===this.FIRST_DIGIT_ENCODINGS[r])return e=String.fromCharCode("0".charCodeAt(0)+r)+e;throw new Xs},t.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26],t}(cc),fc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),pc=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},gc=function(e){function t(){var t=e.call(this)||this;return t.decodeMiddleCounters=Int32Array.from([0,0,0,0]),t}return fc(t,e),t.prototype.decodeMiddle=function(e,t,r){var n,i,o,a,s=this.decodeMiddleCounters;s[0]=0,s[1]=0,s[2]=0,s[3]=0;for(var u=e.getSize(),c=t[1],l=0;l<4&&c<u;l++){var d=cc.decodeDigit(e,s,c,cc.L_PATTERNS);r+=String.fromCharCode("0".charCodeAt(0)+d);try{for(var h=(n=void 0,pc(s)),f=h.next();!f.done;f=h.next()){c+=f.value}}catch(e){n={error:e}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}}c=cc.findGuardPattern(e,c,!0,cc.MIDDLE_PATTERN,new Int32Array(cc.MIDDLE_PATTERN.length).fill(0))[1];for(l=0;l<4&&c<u;l++){d=cc.decodeDigit(e,s,c,cc.L_PATTERNS);r+=String.fromCharCode("0".charCodeAt(0)+d);try{for(var p=(o=void 0,pc(s)),g=p.next();!g.done;g=p.next()){c+=g.value}}catch(e){o={error:e}}finally{try{g&&!g.done&&(a=p.return)&&a.call(p)}finally{if(o)throw o.error}}}return{rowOffset:c,resultString:r}},t.prototype.getBarcodeFormat=function(){return du.EAN_8},t}(cc),mc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),yc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.ean13Reader=new hc,t}return mc(t,e),t.prototype.getBarcodeFormat=function(){return du.UPC_A},t.prototype.decode=function(e,t){return this.maybeReturnResult(this.ean13Reader.decode(e))},t.prototype.decodeRow=function(e,t,r){return this.maybeReturnResult(this.ean13Reader.decodeRow(e,t,r))},t.prototype.decodeMiddle=function(e,t,r){return this.ean13Reader.decodeMiddle(e,t,r)},t.prototype.maybeReturnResult=function(e){var t=e.getText();if("0"===t.charAt(0)){var r=new cu(t.substring(1),null,null,e.getResultPoints(),du.UPC_A);return null!=e.getResultMetadata()&&r.putAllMetadata(e.getResultMetadata()),r}throw new Xs},t.prototype.reset=function(){this.ean13Reader.reset()},t}(cc),vc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),bc=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},wc=function(e){function t(){var t=e.call(this)||this;return t.decodeMiddleCounters=new Int32Array(4),t}return vc(t,e),t.prototype.decodeMiddle=function(e,r,n){var i,o,a=this.decodeMiddleCounters.map(function(e){return e});a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=e.getSize(),u=r[1],c=0,l=0;l<6&&u<s;l++){var d=t.decodeDigit(e,a,u,t.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+d%10);try{for(var h=(i=void 0,bc(a)),f=h.next();!f.done;f=h.next()){u+=f.value}}catch(e){i={error:e}}finally{try{f&&!f.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}d>=10&&(c|=1<<5-l)}return t.determineNumSysAndCheckDigit(new qs(n),c),u},t.prototype.decodeEnd=function(e,r){return t.findGuardPatternWithoutCounters(e,r,!0,t.MIDDLE_END_PATTERN)},t.prototype.checkChecksum=function(e){return cc.checkChecksum(t.convertUPCEtoUPCA(e))},t.determineNumSysAndCheckDigit=function(e,t){for(var r=0;r<=1;r++)for(var n=0;n<10;n++)if(t===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[r][n])return e.insert(0,"0"+r),void e.append("0"+n);throw Xs.getNotFoundInstance()},t.prototype.getBarcodeFormat=function(){return du.UPC_E},t.convertUPCEtoUPCA=function(e){var t=e.slice(1,7).split("").map(function(e){return e.charCodeAt(0)}),r=new qs;r.append(e.charAt(0));var n=t[5];switch(n){case 0:case 1:case 2:r.appendChars(t,0,2),r.append(n),r.append("0000"),r.appendChars(t,2,3);break;case 3:r.appendChars(t,0,3),r.append("00000"),r.appendChars(t,3,2);break;case 4:r.appendChars(t,0,4),r.append("00000"),r.append(t[4]);break;default:r.appendChars(t,0,5),r.append("0000"),r.append(n)}return e.length>=8&&r.append(e.charAt(7)),r.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}(cc),_c=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ac=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ec=function(e){function t(t){var r=e.call(this)||this,n=null==t?null:t.get(Ps.POSSIBLE_FORMATS),i=[];return null!=n&&(n.indexOf(du.EAN_13)>-1&&i.push(new hc),n.indexOf(du.UPC_A)>-1&&i.push(new yc),n.indexOf(du.EAN_8)>-1&&i.push(new gc),n.indexOf(du.UPC_E)>-1&&i.push(new wc)),0===i.length&&(i.push(new hc),i.push(new yc),i.push(new gc),i.push(new wc)),r.readers=i,r}return _c(t,e),t.prototype.decodeRow=function(e,t,r){var n,i;try{for(var o=Ac(this.readers),a=o.next();!a.done;a=o.next()){var s=a.value;try{var u=s.decodeRow(e,t,r),c=u.getBarcodeFormat()===du.EAN_13&&"0"===u.getText().charAt(0),l=null==r?null:r.get(Ps.POSSIBLE_FORMATS),d=null==l||l.includes(du.UPC_A);if(c&&d){var h=u.getRawBytes(),f=new cu(u.getText().substring(1),h,h?h.length:null,u.getResultPoints(),du.UPC_A);return f.putAllMetadata(u.getResultMetadata()),f}return u}catch(e){}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}throw new Xs},t.prototype.reset=function(){var e,t;try{for(var r=Ac(this.readers),n=r.next();!n.done;n=r.next()){n.value.reset()}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},t}(Hu),Cc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),xc=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.CODA_BAR_CHAR_SET={nnnnnww:"0",nnnnwwn:"1",nnnwnnw:"2",wwnnnnn:"3",nnwnnwn:"4",wnnnnwn:"5",nwnnnnw:"6",nwnnwnn:"7",nwwnnnn:"8",wnnwnnn:"9",nnnwwnn:"-",nnwwnnn:"$",wnnnwnw:":",wnwnnnw:"/",wnwnwnn:".",nnwwwww:"+",nnwwnwn:"A",nwnwnnw:"B",nnnwnww:"C",nnnwwwn:"D"},t}return Cc(t,e),t.prototype.decodeRow=function(e,t,r){var n=this.getValidRowData(t);if(!n)throw new Xs;var i=this.codaBarDecodeRow(n.row);if(!i)throw new Xs;return new cu(i,null,0,[new Mu(n.left,e),new Mu(n.right,e)],du.CODABAR,(new Date).getTime())},t.prototype.getValidRowData=function(e){var t=e.toArray(),r=t.indexOf(!0);if(-1===r)return null;var n=t.lastIndexOf(!0);if(n<=r)return null;for(var i=[],o=(t=t.slice(r,n+1))[0],a=1,s=1;s<t.length;s++)t[s]===o?a++:(o=t[s],i.push(a),a=1);return i.push(a),i.length<23&&(i.length+1)%8!=0?null:{row:i,left:r,right:n}},t.prototype.codaBarDecodeRow=function(e){for(var t=[],r=Math.ceil(e.reduce(function(e,t){return(e+t)/2},0));e.length>0;){var n=e.splice(0,8).splice(0,7).map(function(e){return e<r?"n":"w"}).join("");if(void 0===this.CODA_BAR_CHAR_SET[n])return null;t.push(this.CODA_BAR_CHAR_SET[n])}var i=t.join("");return this.validCodaBarString(i)?i:null},t.prototype.validCodaBarString=function(e){return/^[A-D].{1,}[A-D]$/.test(e)},t}(Hu),Sc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ic=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Tc=function(e){function t(){var t=e.call(this)||this;return t.decodeFinderCounters=new Int32Array(4),t.dataCharacterCounters=new Int32Array(8),t.oddRoundingErrors=new Array(4),t.evenRoundingErrors=new Array(4),t.oddCounts=new Array(t.dataCharacterCounters.length/2),t.evenCounts=new Array(t.dataCharacterCounters.length/2),t}return Sc(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,r){for(var n=0;n<r.length;n++)if(Hu.patternMatchVariance(e,r[n],t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return n;throw new Xs},t.count=function(e){return Iu.sum(new Int32Array(e))},t.increment=function(e,t){for(var r=0,n=t[0],i=1;i<e.length;i++)t[i]>n&&(n=t[i],r=i);e[r]++},t.decrement=function(e,t){for(var r=0,n=t[0],i=1;i<e.length;i++)t[i]<n&&(n=t[i],r=i);e[r]--},t.isFinderPattern=function(e){var r,n,i=e[0]+e[1],o=i/(i+e[2]+e[3]);if(o>=t.MIN_FINDER_PATTERN_RATIO&&o<=t.MAX_FINDER_PATTERN_RATIO){var a=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;try{for(var u=Ic(e),c=u.next();!c.done;c=u.next()){var l=c.value;l>s&&(s=l),l<a&&(a=l)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}return s<10*a}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}(Hu),Mc=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 r=t;return this.value===r.value&&this.checksumPortion===r.checksumPortion},e.prototype.hashCode=function(){return this.value^this.checksumPortion},e}(),Dc=function(){function e(e,t,r,n,i){this.value=e,this.startEnd=t,this.value=e,this.startEnd=t,this.resultPoints=new Array,this.resultPoints.push(new Mu(r,i)),this.resultPoints.push(new Mu(n,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 r=t;return this.value===r.value},e.prototype.hashCode=function(){return this.value},e}(),Rc=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Oc=function(){function e(){}return e.getRSSvalue=function(t,r,n){var i,o,a=0;try{for(var s=Rc(t),u=s.next();!u.done;u=s.next()){a+=u.value}}catch(e){i={error:e}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}for(var c=0,l=0,d=t.length,h=0;h<d-1;h++){var f=void 0;for(f=1,l|=1<<h;f<t[h];f++,l&=~(1<<h)){var p=e.combins(a-f-1,d-h-2);if(n&&0===l&&a-f-(d-h-1)>=d-h-1&&(p-=e.combins(a-f-(d-h),d-h-2)),d-h-1>1){for(var g=0,m=a-f-(d-h-2);m>r;m--)g+=e.combins(a-f-m-1,d-h-3);p-=g*(d-1-h)}else a-f>r&&p--;c+=p}a-=f}return c},e.combins=function(e,t){var r,n;e-t>t?(n=t,r=e-t):(n=e-t,r=t);for(var i=1,o=1,a=e;a>r;a--)i*=a,o<=n&&(i/=o,o++);for(;o<=n;)i/=o,o++;return i},e}(),kc=function(){function e(){}return e.buildBitArray=function(e){var t=2*e.length-1;null==e[e.length-1].getRightChar()&&(t-=1);for(var r=new ks(12*t),n=0,i=e[0].getRightChar().getValue(),o=11;o>=0;--o)i&1<<o&&r.set(n),n++;for(o=1;o<e.length;++o){for(var a=e[o],s=a.getLeftChar().getValue(),u=11;u>=0;--u)s&1<<u&&r.set(n),n++;if(null!==a.getRightChar()){var c=a.getRightChar().getValue();for(u=11;u>=0;--u)c&1<<u&&r.set(n),n++}}return r},e}(),Nc=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}(),Pc=function(){function e(e){this.newPosition=e}return e.prototype.getNewPosition=function(){return this.newPosition},e}(),Bc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Fc=function(e){function t(t,r){var n=e.call(this,t)||this;return n.value=r,n}return Bc(t,e),t.prototype.getValue=function(){return this.value},t.prototype.isFNC1=function(){return this.value===t.FNC1},t.FNC1="$",t}(Pc),Lc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),zc=function(e){function t(t,r,n){var i=e.call(this,t)||this;return n?(i.remaining=!0,i.remainingValue=i.remainingValue):(i.remaining=!1,i.remainingValue=0),i.newString=r,i}return Lc(t,e),t.prototype.getNewString=function(){return this.newString},t.prototype.isRemaining=function(){return this.remaining},t.prototype.getRemainingValue=function(){return this.remainingValue},t}(Pc),Uc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),jc=function(e){function t(t,r,n){var i=e.call(this,t)||this;if(r<0||r>10||n<0||n>10)throw new Fs;return i.firstDigit=r,i.secondDigit=n,i}return Uc(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}(Pc),Vc=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Hc=function(){function e(){}return e.parseFieldsInGeneralPurpose=function(t){var r,n,i,o,a,s,u,c;if(!t)return null;if(t.length<2)throw new Xs;var l=t.substring(0,2);try{for(var d=Vc(e.TWO_DIGIT_DATA_LENGTH),h=d.next();!h.done;h=d.next()){if((_=h.value)[0]===l)return _[1]===e.VARIABLE_LENGTH?e.processVariableAI(2,_[2],t):e.processFixedAI(2,_[1],t)}}catch(e){r={error:e}}finally{try{h&&!h.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}if(t.length<3)throw new Xs;var f=t.substring(0,3);try{for(var p=Vc(e.THREE_DIGIT_DATA_LENGTH),g=p.next();!g.done;g=p.next()){if((_=g.value)[0]===f)return _[1]===e.VARIABLE_LENGTH?e.processVariableAI(3,_[2],t):e.processFixedAI(3,_[1],t)}}catch(e){i={error:e}}finally{try{g&&!g.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}try{for(var m=Vc(e.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),y=m.next();!y.done;y=m.next()){if((_=y.value)[0]===f)return _[1]===e.VARIABLE_LENGTH?e.processVariableAI(4,_[2],t):e.processFixedAI(4,_[1],t)}}catch(e){a={error:e}}finally{try{y&&!y.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}if(t.length<4)throw new Xs;var v=t.substring(0,4);try{for(var b=Vc(e.FOUR_DIGIT_DATA_LENGTH),w=b.next();!w.done;w=b.next()){var _;if((_=w.value)[0]===v)return _[1]===e.VARIABLE_LENGTH?e.processVariableAI(4,_[2],t):e.processFixedAI(4,_[1],t)}}catch(e){u={error:e}}finally{try{w&&!w.done&&(c=b.return)&&c.call(b)}finally{if(u)throw u.error}}throw new Xs},e.processFixedAI=function(t,r,n){if(n.length<t)throw new Xs;var i=n.substring(0,t);if(n.length<t+r)throw new Xs;var o=n.substring(t,t+r),a=n.substring(t+r),s="("+i+")"+o,u=e.parseFieldsInGeneralPurpose(a);return null==u?s:s+u},e.processVariableAI=function(t,r,n){var i,o=n.substring(0,t);i=n.length<t+r?n.length:t+r;var a=n.substring(t,i),s=n.substring(i),u="("+o+")"+a,c=e.parseFieldsInGeneralPurpose(s);return null==c?u:u+c},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}(),Gc=function(){function e(e){this.buffer=new qs,this.information=e}return e.prototype.decodeAllCodes=function(e,t){for(var r=t,n=null;;){var i=this.decodeGeneralPurposeField(r,n),o=Hc.parseFieldsInGeneralPurpose(i.getNewString());if(null!=o&&e.append(o),n=i.isRemaining()?""+i.getRemainingValue():null,r===i.getNewPosition())break;r=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 jc(this.information.getSize(),0===t?jc.FNC1:t-1,jc.FNC1)}var r=this.extractNumericValueFromBitArray(e,7);return new jc(e+7,(r-8)/11,(r-8)%11)},e.prototype.extractNumericValueFromBitArray=function(t,r){return e.extractNumericValueFromBitArray(this.information,t,r)},e.extractNumericValueFromBitArray=function(e,t,r){for(var n=0,i=0;i<r;++i)e.get(t+i)&&(n|=1<<r-i-1);return n},e.prototype.decodeGeneralPurposeField=function(e,t){this.buffer.setLengthToZero(),null!=t&&this.buffer.append(t),this.current.setPosition(e);var r=this.parseBlocks();return null!=r&&r.isRemaining()?new zc(this.current.getPosition(),this.buffer.toString(),r.getRemainingValue()):new zc(this.current.getPosition(),this.buffer.toString())},e.prototype.parseBlocks=function(){var e,t;do{var r=this.current.getPosition();if(e=this.current.isAlpha()?(t=this.parseAlphaBlock()).isFinished():this.current.isIsoIec646()?(t=this.parseIsoIec646Block()).isFinished():(t=this.parseNumericBlock()).isFinished(),!(r!==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 zc(this.current.getPosition(),this.buffer.toString()):new zc(this.current.getPosition(),this.buffer.toString(),e.getSecondDigit()),new Nc(!0,t)}if(this.buffer.append(e.getFirstDigit()),e.isSecondDigitFNC1()){t=new zc(this.current.getPosition(),this.buffer.toString());return new Nc(!0,t)}this.buffer.append(e.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new Nc(!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()){var t=new zc(this.current.getPosition(),this.buffer.toString());return new Nc(!0,t)}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 Nc(!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()){var t=new zc(this.current.getPosition(),this.buffer.toString());return new Nc(!0,t)}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 Nc(!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 r=this.extractNumericValueFromBitArray(e,7);if(r>=64&&r<116)return!0;if(e+8>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(e,8);return n>=232&&n<253},e.prototype.decodeIsoIec646=function(e){var t=this.extractNumericValueFromBitArray(e,5);if(15===t)return new Fc(e+5,Fc.FNC1);if(t>=5&&t<15)return new Fc(e+5,"0"+(t-5));var r,n=this.extractNumericValueFromBitArray(e,7);if(n>=64&&n<90)return new Fc(e+7,""+(n+1));if(n>=90&&n<116)return new Fc(e+7,""+(n+7));switch(this.extractNumericValueFromBitArray(e,8)){case 232:r="!";break;case 233:r='"';break;case 234:r="%";break;case 235:r="&";break;case 236:r="'";break;case 237:r="(";break;case 238:r=")";break;case 239:r="*";break;case 240:r="+";break;case 241:r=",";break;case 242:r="-";break;case 243:r=".";break;case 244:r="/";break;case 245:r=":";break;case 246:r=";";break;case 247:r="<";break;case 248:r="=";break;case 249:r=">";break;case 250:r="?";break;case 251:r="_";break;case 252:r=" ";break;default:throw new Fs}return new Fc(e+8,r)},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 r=this.extractNumericValueFromBitArray(e,6);return r>=16&&r<63},e.prototype.decodeAlphanumeric=function(e){var t=this.extractNumericValueFromBitArray(e,5);if(15===t)return new Fc(e+5,Fc.FNC1);if(t>=5&&t<15)return new Fc(e+5,"0"+(t-5));var r,n=this.extractNumericValueFromBitArray(e,6);if(n>=32&&n<58)return new Fc(e+6,""+(n+33));switch(n){case 58:r="*";break;case 59:r=",";break;case 60:r="-";break;case 61:r=".";break;case 62:r="/";break;default:throw new Cu("Decoding invalid alphanumeric value: "+n)}return new Fc(e+6,r)},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(2===t){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}(),qc=function(){function e(e){this.information=e,this.generalDecoder=new Gc(e)}return e.prototype.getInformation=function(){return this.information},e.prototype.getGeneralDecoder=function(){return this.generalDecoder},e}(),Wc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Kc=function(e){function t(t){return e.call(this,t)||this}return Wc(t,e),t.prototype.encodeCompressedGtin=function(e,t){e.append("(01)");var r=e.length();e.append("9"),this.encodeCompressedGtinWithoutAI(e,t,r)},t.prototype.encodeCompressedGtinWithoutAI=function(e,r,n){for(var i=0;i<4;++i){var o=this.getGeneralDecoder().extractNumericValueFromBitArray(r+10*i,10);o/100==0&&e.append("0"),o/10==0&&e.append("0"),e.append(o)}t.appendCheckDigit(e,n)},t.appendCheckDigit=function(e,t){for(var r=0,n=0;n<13;n++){var i=e.charAt(n+t).charCodeAt(0)-"0".charCodeAt(0);r+=1&n?i:3*i}10===(r=10-r%10)&&(r=0),e.append(r)},t.GTIN_SIZE=40,t}(qc),Xc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Yc=function(e){function t(t){return e.call(this,t)||this}return Xc(t,e),t.prototype.parseInformation=function(){var e=new qs;e.append("(01)");var r=e.length(),n=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE,4);return e.append(n),this.encodeCompressedGtinWithoutAI(e,t.HEADER_SIZE+4,r),this.getGeneralDecoder().decodeAllCodes(e,t.HEADER_SIZE+44)},t.HEADER_SIZE=4,t}(Kc),Zc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Jc=function(e){function t(t){return e.call(this,t)||this}return Zc(t,e),t.prototype.parseInformation=function(){var e=new qs;return this.getGeneralDecoder().decodeAllCodes(e,t.HEADER_SIZE)},t.HEADER_SIZE=5,t}(qc),$c=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qc=function(e){function t(t){return e.call(this,t)||this}return $c(t,e),t.prototype.encodeCompressedWeight=function(e,t,r){var n=this.getGeneralDecoder().extractNumericValueFromBitArray(t,r);this.addWeightCode(e,n);for(var i=this.checkWeight(n),o=1e5,a=0;a<5;++a)i/o===0&&e.append("0"),o/=10;e.append(i)},t}(Kc),el=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),tl=function(e){function t(t){return e.call(this,t)||this}return el(t,e),t.prototype.parseInformation=function(){if(this.getInformation().getSize()!==t.HEADER_SIZE+Qc.GTIN_SIZE+t.WEIGHT_SIZE)throw new Xs;var e=new qs;return this.encodeCompressedGtin(e,t.HEADER_SIZE),this.encodeCompressedWeight(e,t.HEADER_SIZE+Qc.GTIN_SIZE,t.WEIGHT_SIZE),e.toString()},t.HEADER_SIZE=5,t.WEIGHT_SIZE=15,t}(Qc),rl=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),nl=function(e){function t(t){return e.call(this,t)||this}return rl(t,e),t.prototype.addWeightCode=function(e,t){e.append("(3103)")},t.prototype.checkWeight=function(e){return e},t}(tl),il=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ol=function(e){function t(t){return e.call(this,t)||this}return il(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}(tl),al=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),sl=function(e){function t(t){return e.call(this,t)||this}return al(t,e),t.prototype.parseInformation=function(){if(this.getInformation().getSize()<t.HEADER_SIZE+Kc.GTIN_SIZE)throw new Xs;var e=new qs;this.encodeCompressedGtin(e,t.HEADER_SIZE);var r=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+Kc.GTIN_SIZE,t.LAST_DIGIT_SIZE);e.append("(392"),e.append(r),e.append(")");var n=this.getGeneralDecoder().decodeGeneralPurposeField(t.HEADER_SIZE+Kc.GTIN_SIZE+t.LAST_DIGIT_SIZE,null);return e.append(n.getNewString()),e.toString()},t.HEADER_SIZE=8,t.LAST_DIGIT_SIZE=2,t}(Kc),ul=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),cl=function(e){function t(t){return e.call(this,t)||this}return ul(t,e),t.prototype.parseInformation=function(){if(this.getInformation().getSize()<t.HEADER_SIZE+Kc.GTIN_SIZE)throw new Xs;var e=new qs;this.encodeCompressedGtin(e,t.HEADER_SIZE);var r=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+Kc.GTIN_SIZE,t.LAST_DIGIT_SIZE);e.append("(393"),e.append(r),e.append(")");var n=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+Kc.GTIN_SIZE+t.LAST_DIGIT_SIZE,t.FIRST_THREE_DIGITS_SIZE);n/100==0&&e.append("0"),n/10==0&&e.append("0"),e.append(n);var i=this.getGeneralDecoder().decodeGeneralPurposeField(t.HEADER_SIZE+Kc.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}(Kc),ll=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),dl=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.dateCode=n,i.firstAIdigits=r,i}return ll(t,e),t.prototype.parseInformation=function(){if(this.getInformation().getSize()!==t.HEADER_SIZE+t.GTIN_SIZE+t.WEIGHT_SIZE+t.DATE_SIZE)throw new Xs;var e=new qs;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,r){var n=this.getGeneralDecoder().extractNumericValueFromBitArray(r,t.DATE_SIZE);if(38400!==n){e.append("("),e.append(this.dateCode),e.append(")");var i=n%32,o=(n/=32)%12+1,a=n/=12;a/10==0&&e.append("0"),e.append(a),o/10==0&&e.append("0"),e.append(o),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}(Qc);var hl=function(){function e(e,t,r,n){this.leftchar=e,this.rightchar=t,this.finderpattern=r,this.maybeLast=n}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 null==this.rightchar},e.prototype.toString=function(){return"[ "+this.leftchar+", "+this.rightchar+" : "+(null==this.finderpattern?"null":this.finderpattern.getValue())+" ]"},e.equals=function(t,r){return t instanceof e&&(e.equalsOrNull(t.leftchar,r.leftchar)&&e.equalsOrNull(t.rightchar,r.rightchar)&&e.equalsOrNull(t.finderpattern,r.finderpattern))},e.equalsOrNull=function(t,r){return null===t?null===r:e.equals(t,r)},e.prototype.hashCode=function(){return this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue()},e}(),fl=function(){function e(e,t,r){this.pairs=e,this.rowNumber=t,this.wasReversed=r}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,r){return t instanceof e&&(this.checkEqualitity(t,r)&&t.wasReversed===r.wasReversed)},e.prototype.checkEqualitity=function(e,t){var r;if(e&&t)return e.forEach(function(e,n){t.forEach(function(t){e.getLeftChar().getValue()===t.getLeftChar().getValue()&&e.getRightChar().getValue()===t.getRightChar().getValue()&&e.getFinderPatter().getValue()===t.getFinderPatter().getValue()&&(r=!0)})}),r},e}(),pl=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),gl=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ml=function(e){function t(){var r=null!==e&&e.apply(this,arguments)||this;return r.pairs=new Array(t.MAX_PAIRS),r.rows=new Array,r.startEnd=[2],r}return pl(t,e),t.prototype.decodeRow=function(e,r,n){this.pairs.length=0,this.startFromEven=!1;try{return t.constructResult(this.decodeRow2pairs(e,r))}catch(e){}return this.pairs.length=0,this.startFromEven=!0,t.constructResult(this.decodeRow2pairs(e,r))},t.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},t.prototype.decodeRow2pairs=function(e,t){for(var r,n=!1;!n;)try{this.pairs.push(this.retrieveNextPair(t,this.pairs,e))}catch(e){if(e instanceof Xs){if(!this.pairs.length)throw new Xs;n=!0}}if(this.checkChecksum())return this.pairs;if(r=!!this.rows.length,this.storeRow(e,!1),r){var i=this.checkRowsBoolean(!1);if(null!=i)return i;if(null!=(i=this.checkRowsBoolean(!0)))return i}throw new Xs},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(new Array,0)}catch(e){console.log(e)}return e&&(this.rows=this.rows.reverse()),t},t.prototype.checkRows=function(e,r){for(var n,i,o=r;o<this.rows.length;o++){var a=this.rows[o];this.pairs.length=0;try{for(var s=(n=void 0,gl(e)),u=s.next();!u.done;u=s.next()){var c=u.value;this.pairs.push(c.getPairs())}}catch(e){n={error:e}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}if(this.pairs.push(a.getPairs()),t.isValidSequence(this.pairs)){if(this.checkChecksum())return this.pairs;var l=new Array(e);l.push(a);try{return this.checkRows(l,o+1)}catch(e){console.log(e)}}}throw new Xs},t.isValidSequence=function(e){var r,n;try{for(var i=gl(t.FINDER_PATTERN_SEQUENCES),o=i.next();!o.done;o=i.next()){var a=o.value;if(!(e.length>a.length)){for(var s=!0,u=0;u<e.length;u++)if(e[u].getFinderPattern().getValue()!==a[u]){s=!1;break}if(s)return!0}}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1},t.prototype.storeRow=function(e,r){for(var n=0,i=!1,o=!1;n<this.rows.length;){var a=this.rows[n];if(a.getRowNumber()>e){o=a.isEquivalent(this.pairs);break}i=a.isEquivalent(this.pairs),n++}o||i||t.isPartialRow(this.pairs,this.rows)||(this.rows.push(n,new fl(this.pairs,e,r)),this.removePartialRows(this.pairs,this.rows))},t.prototype.removePartialRows=function(e,t){var r,n,i,o,a,s;try{for(var u=gl(t),c=u.next();!c.done;c=u.next()){var l=c.value;if(l.getPairs().length!==e.length){try{for(var d=(i=void 0,gl(l.getPairs())),h=d.next();!h.done;h=d.next()){var f=h.value,p=!1;try{for(var g=(a=void 0,gl(e)),m=g.next();!m.done;m=g.next()){var y=m.value;if(hl.equals(f,y)){p=!0;break}}}catch(e){a={error:e}}finally{try{m&&!m.done&&(s=g.return)&&s.call(g)}finally{if(a)throw a.error}}p||!1}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}}}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}},t.isPartialRow=function(e,t){var r,n,i,o,a,s;try{for(var u=gl(t),c=u.next();!c.done;c=u.next()){var l=c.value,d=!0;try{for(var h=(i=void 0,gl(e)),f=h.next();!f.done;f=h.next()){var p=f.value,g=!1;try{for(var m=(a=void 0,gl(l.getPairs())),y=m.next();!y.done;y=m.next()){var v=y.value;if(p.equals(v)){g=!0;break}}}catch(e){a={error:e}}finally{try{y&&!y.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}if(!g){d=!1;break}}}catch(e){i={error:e}}finally{try{f&&!f.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}if(d)return!0}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.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 Yc(e);if(!e.get(2))return new Jc(e);switch(Gc.extractNumericValueFromBitArray(e,1,4)){case 4:return new nl(e);case 5:return new ol(e)}switch(Gc.extractNumericValueFromBitArray(e,1,5)){case 12:return new sl(e);case 13:return new cl(e)}switch(Gc.extractNumericValueFromBitArray(e,1,7)){case 56:return new dl(e,"310","11");case 57:return new dl(e,"320","11");case 58:return new dl(e,"310","13");case 59:return new dl(e,"320","13");case 60:return new dl(e,"310","15");case 61:return new dl(e,"320","15");case 62:return new dl(e,"310","17");case 63:return new dl(e,"320","17")}}catch(t){throw console.log(t),new Cu("unknown decoder: "+e)}}(kc.buildBitArray(e)).parseInformation(),r=e[0].getFinderPattern().getResultPoints(),n=e[e.length-1].getFinderPattern().getResultPoints(),i=[r[0],r[1],n[0],n[1]];return new cu(t,null,null,i,du.RSS_EXPANDED,null)},t.prototype.checkChecksum=function(){var e=this.pairs.get(0),t=e.getLeftChar(),r=e.getRightChar();if(null===r)return!1;for(var n=r.getChecksumPortion(),i=2,o=1;o<this.pairs.size();++o){var a=this.pairs.get(o);n+=a.getLeftChar().getChecksumPortion(),i++;var s=a.getRightChar();null!=s&&(n+=s.getChecksumPortion(),i++)}return 211*(i-4)+(n%=211)===t.getValue()},t.getNextSecondBar=function(e,t){var r;return e.get(t)?(r=e.getNextUnset(t),r=e.getNextSet(r)):(r=e.getNextSet(t),r=e.getNextUnset(r)),r},t.prototype.retrieveNextPair=function(e,r,n){var i,o=r.length%2==0;this.startFromEven&&(o=!o);var a=!0,s=-1;do{this.findNextPair(e,r,s),null===(i=this.parseFoundFinderPattern(e,n,o))?s=t.getNextSecondBar(e,this.startEnd[0]):a=!1}while(a);var u,c=this.decodeDataCharacter(e,i,o,!0);if(!this.isEmptyPair(r)&&r[r.length-1].mustBeLast())throw new Xs;try{u=this.decodeDataCharacter(e,i,o,!1)}catch(e){u=null,console.log(e)}return new hl(c,u,i,!0)},t.prototype.isEmptyPair=function(e){return 0===e.length},t.prototype.findNextPair=function(e,r,n){var i=this.getDecodeFinderCounters();i[0]=0,i[1]=0,i[2]=0,i[3]=0;var o,a=e.getSize();if(n>=0)o=n;else if(this.isEmptyPair(r))o=0;else{o=r[r.length-1].getFinderPattern().getStartEnd()[1]}var s=r.length%2!=0;this.startFromEven&&(s=!s);for(var u=!1;o<a&&(u=!e.get(o));)o++;for(var c=0,l=o,d=o;d<a;d++)if(e.get(d)!==u)i[c]++;else{if(3===c){if(s&&t.reverseCounters(i),t.isFinderPattern(i))return this.startEnd[0]=l,void(this.startEnd[1]=d);s&&t.reverseCounters(i),l+=i[0]+i[1],i[0]=i[2],i[1]=i[3],i[2]=0,i[3]=0,c--}else c++;i[c]=1,u=!u}throw new Xs},t.reverseCounters=function(e){for(var t=e.length,r=0;r<t/2;++r){var n=e[r];e[r]=e[t-r-1],e[t-r-1]=n}},t.prototype.parseFoundFinderPattern=function(e,r,n){var i,o,a;if(n){for(var s=this.startEnd[0]-1;s>=0&&!e.get(s);)s--;s++,i=this.startEnd[0]-s,o=s,a=this.startEnd[1]}else o=this.startEnd[0],i=(a=e.getNextUnset(this.startEnd[1]+1))-this.startEnd[1];var u,c=this.getDecodeFinderCounters();xs.arraycopy(c,0,c,1,c.length-1),c[0]=i;try{u=this.parseFinderValue(c,t.FINDER_PATTERNS)}catch(e){return null}return new Dc(u,[o,a],o,a,r)},t.prototype.decodeDataCharacter=function(e,r,n,i){for(var o=this.getDataCharacterCounters(),a=0;a<o.length;a++)o[a]=0;if(i)t.recordPatternInReverse(e,r.getStartEnd()[0],o);else{t.recordPattern(e,r.getStartEnd()[1],o);for(var s=0,u=o.length-1;s<u;s++,u--){var c=o[s];o[s]=o[u],o[u]=c}}var l=Iu.sum(new Int32Array(o))/17,d=(r.getStartEnd()[1]-r.getStartEnd()[0])/15;if(Math.abs(l-d)/d>.3)throw new Xs;var h=this.getOddCounts(),f=this.getEvenCounts(),p=this.getOddRoundingErrors(),g=this.getEvenRoundingErrors();for(s=0;s<o.length;s++){var m=1*o[s]/l,y=m+.5;if(y<1){if(m<.3)throw new Xs;y=1}else if(y>8){if(m>8.7)throw new Xs;y=8}var v=s/2;1&s?(f[v]=y,g[v]=m-y):(h[v]=y,p[v]=m-y)}this.adjustOddEvenCounts(17);var b=4*r.getValue()+(n?0:2)+(i?0:1)-1,w=0,_=0;for(s=h.length-1;s>=0;s--){if(t.isNotA1left(r,n,i)){var A=t.WEIGHTS[b][2*s];_+=h[s]*A}w+=h[s]}var E=0;for(s=f.length-1;s>=0;s--)if(t.isNotA1left(r,n,i)){A=t.WEIGHTS[b][2*s+1];E+=f[s]*A}var C=_+E;if(1&w||w>13||w<4)throw new Xs;var x=(13-w)/2,S=t.SYMBOL_WIDEST[x],I=9-S,T=Oc.getRSSvalue(h,S,!0),M=Oc.getRSSvalue(f,I,!1),D=t.EVEN_TOTAL_SUBSET[x],R=t.GSUM[x];return new Mc(T*D+M+R,C)},t.isNotA1left=function(e,t,r){return!(0===e.getValue()&&t&&r)},t.prototype.adjustOddEvenCounts=function(e){var r=Iu.sum(new Int32Array(this.getOddCounts())),n=Iu.sum(new Int32Array(this.getEvenCounts())),i=!1,o=!1;r>13?o=!0:r<4&&(i=!0);var a=!1,s=!1;n>13?s=!0:n<4&&(a=!0);var u=r+n-e,c=!(1&~r),l=!(1&n);if(1===u)if(c){if(l)throw new Xs;o=!0}else{if(!l)throw new Xs;s=!0}else if(-1===u)if(c){if(l)throw new Xs;i=!0}else{if(!l)throw new Xs;a=!0}else{if(0!==u)throw new Xs;if(c){if(!l)throw new Xs;r<n?(i=!0,s=!0):(o=!0,a=!0)}else if(l)throw new Xs}if(i){if(o)throw new Xs;t.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(o&&t.decrement(this.getOddCounts(),this.getOddRoundingErrors()),a){if(s)throw new Xs;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}(Tc),yl=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),vl=function(e){function t(t,r,n){var i=e.call(this,t,r)||this;return i.count=0,i.finderPattern=n,i}return yl(t,e),t.prototype.getFinderPattern=function(){return this.finderPattern},t.prototype.getCount=function(){return this.count},t.prototype.incrementCount=function(){this.count++},t}(Mc),bl=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wl=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},_l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.possibleLeftPairs=[],t.possibleRightPairs=[],t}return bl(t,e),t.prototype.decodeRow=function(e,r,n){var i,o,a,s,u=this.decodePair(r,!1,e,n);t.addOrTally(this.possibleLeftPairs,u),r.reverse();var c=this.decodePair(r,!0,e,n);t.addOrTally(this.possibleRightPairs,c),r.reverse();try{for(var l=wl(this.possibleLeftPairs),d=l.next();!d.done;d=l.next()){var h=d.value;if(h.getCount()>1)try{for(var f=(a=void 0,wl(this.possibleRightPairs)),p=f.next();!p.done;p=f.next()){var g=p.value;if(g.getCount()>1&&t.checkChecksum(h,g))return t.constructResult(h,g)}}catch(e){a={error:e}}finally{try{p&&!p.done&&(s=f.return)&&s.call(f)}finally{if(a)throw a.error}}}}catch(e){i={error:e}}finally{try{d&&!d.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}throw new Xs},t.addOrTally=function(e,t){var r,n;if(null!=t){var i=!1;try{for(var o=wl(e),a=o.next();!a.done;a=o.next()){var s=a.value;if(s.getValue()===t.getValue()){s.incrementCount(),i=!0;break}}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}i||e.push(t)}},t.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},t.constructResult=function(e,t){for(var r=4537077*e.getValue()+t.getValue(),n=new String(r).toString(),i=new qs,o=13-n.length;o>0;o--)i.append("0");i.append(n);var a=0;for(o=0;o<13;o++){var s=i.charAt(o).charCodeAt(0)-"0".charCodeAt(0);a+=1&o?s:3*s}10===(a=10-a%10)&&(a=0),i.append(a.toString());var u=e.getFinderPattern().getResultPoints(),c=t.getFinderPattern().getResultPoints();return new cu(i.toString(),null,0,[u[0],u[1],c[0],c[1]],du.RSS_14,(new Date).getTime())},t.checkChecksum=function(e,t){var r=(e.getChecksumPortion()+16*t.getChecksumPortion())%79,n=9*e.getFinderPattern().getValue()+t.getFinderPattern().getValue();return n>72&&n--,n>8&&n--,r===n},t.prototype.decodePair=function(e,t,r,n){try{var i=this.findFinderPattern(e,t),o=this.parseFoundFinderPattern(e,r,t,i),a=null==n?null:n.get(Ps.NEED_RESULT_POINT_CALLBACK);if(null!=a){var s=(i[0]+i[1])/2;t&&(s=e.getSize()-1-s),a.foundPossibleResultPoint(new Mu(s,r))}var u=this.decodeDataCharacter(e,o,!0),c=this.decodeDataCharacter(e,o,!1);return new vl(1597*u.getValue()+c.getValue(),u.getChecksumPortion()+4*c.getChecksumPortion(),o)}catch(e){return null}},t.prototype.decodeDataCharacter=function(e,r,n){for(var i=this.getDataCharacterCounters(),o=0;o<i.length;o++)i[o]=0;if(n)Hu.recordPatternInReverse(e,r.getStartEnd()[0],i);else{Hu.recordPattern(e,r.getStartEnd()[1]+1,i);for(var a=0,s=i.length-1;a<s;a++,s--){var u=i[a];i[a]=i[s],i[s]=u}}var c=n?16:15,l=Iu.sum(new Int32Array(i))/c,d=this.getOddCounts(),h=this.getEvenCounts(),f=this.getOddRoundingErrors(),p=this.getEvenRoundingErrors();for(a=0;a<i.length;a++){var g=i[a]/l,m=Math.floor(g+.5);m<1?m=1:m>8&&(m=8);var y=Math.floor(a/2);1&a?(h[y]=m,p[y]=g-m):(d[y]=m,f[y]=g-m)}this.adjustOddEvenCounts(n,c);var v=0,b=0;for(a=d.length-1;a>=0;a--)b*=9,b+=d[a],v+=d[a];var w=0,_=0;for(a=h.length-1;a>=0;a--)w*=9,w+=h[a],_+=h[a];var A=b+3*w;if(n){if(1&v||v>12||v<4)throw new Xs;var E=(12-v)/2,C=9-(M=t.OUTSIDE_ODD_WIDEST[E]),x=Oc.getRSSvalue(d,M,!1),S=Oc.getRSSvalue(h,C,!0),I=t.OUTSIDE_EVEN_TOTAL_SUBSET[E],T=t.OUTSIDE_GSUM[E];return new Mc(x*I+S+T,A)}if(1&_||_>10||_<4)throw new Xs;E=(10-_)/2,C=9-(M=t.INSIDE_ODD_WIDEST[E]),x=Oc.getRSSvalue(d,M,!0),S=Oc.getRSSvalue(h,C,!1);var M,D=t.INSIDE_ODD_TOTAL_SUBSET[E];T=t.INSIDE_GSUM[E];return new Mc(S*D+x+T,A)},t.prototype.findFinderPattern=function(e,t){var r=this.getDecodeFinderCounters();r[0]=0,r[1]=0,r[2]=0,r[3]=0;for(var n=e.getSize(),i=!1,o=0;o<n&&t!==(i=!e.get(o));)o++;for(var a=0,s=o,u=o;u<n;u++)if(e.get(u)!==i)r[a]++;else{if(3===a){if(Tc.isFinderPattern(r))return[s,u];s+=r[0]+r[1],r[0]=r[2],r[1]=r[3],r[2]=0,r[3]=0,a--}else a++;r[a]=1,i=!i}throw new Xs},t.prototype.parseFoundFinderPattern=function(e,r,n,i){for(var o=e.get(i[0]),a=i[0]-1;a>=0&&o!==e.get(a);)a--;a++;var s=i[0]-a,u=this.getDecodeFinderCounters(),c=new Int32Array(u.length);xs.arraycopy(u,0,c,1,u.length-1),c[0]=s;var l=this.parseFinderValue(c,t.FINDER_PATTERNS),d=a,h=i[1];return n&&(d=e.getSize()-1-d,h=e.getSize()-1-h),new Dc(l,[a,i[1]],d,h,r)},t.prototype.adjustOddEvenCounts=function(e,t){var r=Iu.sum(new Int32Array(this.getOddCounts())),n=Iu.sum(new Int32Array(this.getEvenCounts())),i=!1,o=!1,a=!1,s=!1;e?(r>12?o=!0:r<4&&(i=!0),n>12?s=!0:n<4&&(a=!0)):(r>11?o=!0:r<5&&(i=!0),n>10?s=!0:n<4&&(a=!0));var u=r+n-t,c=(1&r)==(e?1:0),l=!(1&~n);if(1===u)if(c){if(l)throw new Xs;o=!0}else{if(!l)throw new Xs;s=!0}else if(-1===u)if(c){if(l)throw new Xs;i=!0}else{if(!l)throw new Xs;a=!0}else{if(0!==u)throw new Xs;if(c){if(!l)throw new Xs;r<n?(i=!0,s=!0):(o=!0,a=!0)}else if(l)throw new Xs}if(i){if(o)throw new Xs;Tc.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(o&&Tc.decrement(this.getOddCounts(),this.getOddRoundingErrors()),a){if(s)throw new Xs;Tc.increment(this.getEvenCounts(),this.getOddRoundingErrors())}s&&Tc.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}(Tc),Al=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),El=function(e){function t(t){var r=e.call(this)||this;r.readers=[];var n=t?t.get(Ps.POSSIBLE_FORMATS):null,i=t&&void 0!==t.get(Ps.ASSUME_CODE_39_CHECK_DIGIT),o=t&&void 0!==t.get(Ps.ENABLE_CODE_39_EXTENDED_MODE);return n&&((n.includes(du.EAN_13)||n.includes(du.UPC_A)||n.includes(du.EAN_8)||n.includes(du.UPC_E))&&r.readers.push(new Ec(t)),n.includes(du.CODE_39)&&r.readers.push(new Xu(i,o)),n.includes(du.CODE_93)&&r.readers.push(new Ju),n.includes(du.CODE_128)&&r.readers.push(new qu),n.includes(du.ITF)&&r.readers.push(new ec),n.includes(du.CODABAR)&&r.readers.push(new xc),n.includes(du.RSS_14)&&r.readers.push(new _l),n.includes(du.RSS_EXPANDED)&&(console.warn("RSS Expanded reader IS NOT ready for production yet! use at your own risk."),r.readers.push(new ml))),0===r.readers.length&&(r.readers.push(new Ec(t)),r.readers.push(new Xu),r.readers.push(new Ju),r.readers.push(new Ec(t)),r.readers.push(new qu),r.readers.push(new ec),r.readers.push(new _l)),r}return Al(t,e),t.prototype.decodeRow=function(e,t,r){for(var n=0;n<this.readers.length;n++)try{return this.readers[n].decodeRow(e,t,r)}catch(e){}throw new Xs},t.prototype.reset=function(){this.readers.forEach(function(e){return e.reset()})},t}(Hu),Cl=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){function t(t,r){return void 0===t&&(t=500),e.call(this,new El(r),t,r)||this}Cl(t,e)}(uu);var xl,Sl=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Il=function(){function e(e,t,r){this.ecCodewords=e,this.ecBlocks=[t],r&&this.ecBlocks.push(r)}return e.prototype.getECCodewords=function(){return this.ecCodewords},e.prototype.getECBlocks=function(){return this.ecBlocks},e}(),Tl=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}(),Ml=function(){function e(e,t,r,n,i,o){var a,s;this.versionNumber=e,this.symbolSizeRows=t,this.symbolSizeColumns=r,this.dataRegionSizeRows=n,this.dataRegionSizeColumns=i,this.ecBlocks=o;var u=0,c=o.getECCodewords(),l=o.getECBlocks();try{for(var d=Sl(l),h=d.next();!h.done;h=d.next()){var f=h.value;u+=f.getCount()*(f.getDataCodewords()+c)}}catch(e){a={error:e}}finally{try{h&&!h.done&&(s=d.return)&&s.call(d)}finally{if(a)throw a.error}}this.totalCodewords=u}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,r){var n,i;if(1&t||1&r)throw new Fs;try{for(var o=Sl(e.VERSIONS),a=o.next();!a.done;a=o.next()){var s=a.value;if(s.symbolSizeRows===t&&s.symbolSizeColumns===r)return s}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}throw new Fs},e.prototype.toString=function(){return""+this.versionNumber},e.buildVersions=function(){return[new e(1,10,10,8,8,new Il(5,new Tl(1,3))),new e(2,12,12,10,10,new Il(7,new Tl(1,5))),new e(3,14,14,12,12,new Il(10,new Tl(1,8))),new e(4,16,16,14,14,new Il(12,new Tl(1,12))),new e(5,18,18,16,16,new Il(14,new Tl(1,18))),new e(6,20,20,18,18,new Il(18,new Tl(1,22))),new e(7,22,22,20,20,new Il(20,new Tl(1,30))),new e(8,24,24,22,22,new Il(24,new Tl(1,36))),new e(9,26,26,24,24,new Il(28,new Tl(1,44))),new e(10,32,32,14,14,new Il(36,new Tl(1,62))),new e(11,36,36,16,16,new Il(42,new Tl(1,86))),new e(12,40,40,18,18,new Il(48,new Tl(1,114))),new e(13,44,44,20,20,new Il(56,new Tl(1,144))),new e(14,48,48,22,22,new Il(68,new Tl(1,174))),new e(15,52,52,24,24,new Il(42,new Tl(2,102))),new e(16,64,64,14,14,new Il(56,new Tl(2,140))),new e(17,72,72,16,16,new Il(36,new Tl(4,92))),new e(18,80,80,18,18,new Il(48,new Tl(4,114))),new e(19,88,88,20,20,new Il(56,new Tl(4,144))),new e(20,96,96,22,22,new Il(68,new Tl(4,174))),new e(21,104,104,24,24,new Il(56,new Tl(6,136))),new e(22,120,120,18,18,new Il(68,new Tl(6,175))),new e(23,132,132,20,20,new Il(62,new Tl(8,163))),new e(24,144,144,22,22,new Il(62,new Tl(8,156),new Tl(2,155))),new e(25,8,18,6,16,new Il(7,new Tl(1,5))),new e(26,8,32,6,14,new Il(11,new Tl(1,10))),new e(27,12,26,10,24,new Il(14,new Tl(1,16))),new e(28,12,36,10,16,new Il(18,new Tl(1,22))),new e(29,16,36,14,16,new Il(24,new Tl(1,32))),new e(30,16,48,14,22,new Il(28,new Tl(1,49)))]},e.VERSIONS=e.buildVersions(),e}(),Dl=function(){function e(t){var r=t.getHeight();if(r<8||r>144||1&r)throw new Fs;this.version=e.readVersion(t),this.mappingBitMatrix=this.extractDataRegion(t),this.readMappingMatrix=new Ws(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return e.prototype.getVersion=function(){return this.version},e.readVersion=function(e){var t=e.getHeight(),r=e.getWidth();return Ml.getVersionForDimensions(t,r)},e.prototype.readCodewords=function(){var e=new Int8Array(this.version.getTotalCodewords()),t=0,r=4,n=0,i=this.mappingBitMatrix.getHeight(),o=this.mappingBitMatrix.getWidth(),a=!1,s=!1,u=!1,c=!1;do{if(r!==i||0!==n||a)if(r===i-2&&0===n&&3&o&&!s)e[t++]=255&this.readCorner2(i,o),r-=2,n+=2,s=!0;else if(r!==i+4||2!==n||7&o||u)if(r!==i-2||0!==n||4!=(7&o)||c){do{r<i&&n>=0&&!this.readMappingMatrix.get(n,r)&&(e[t++]=255&this.readUtah(r,n,i,o)),r-=2,n+=2}while(r>=0&&n<o);r+=1,n+=3;do{r>=0&&n<o&&!this.readMappingMatrix.get(n,r)&&(e[t++]=255&this.readUtah(r,n,i,o)),r+=2,n-=2}while(r<i&&n>=0);r+=3,n+=1}else e[t++]=255&this.readCorner4(i,o),r-=2,n+=2,c=!0;else e[t++]=255&this.readCorner3(i,o),r-=2,n+=2,u=!0;else e[t++]=255&this.readCorner1(i,o),r-=2,n+=2,a=!0}while(r<i||n<o);if(t!==this.version.getTotalCodewords())throw new Fs;return e},e.prototype.readModule=function(e,t,r,n){return e<0&&(e+=r,t+=4-(r+4&7)),t<0&&(t+=n,e+=4-(n+4&7)),this.readMappingMatrix.set(t,e),this.mappingBitMatrix.get(t,e)},e.prototype.readUtah=function(e,t,r,n){var i=0;return this.readModule(e-2,t-2,r,n)&&(i|=1),i<<=1,this.readModule(e-2,t-1,r,n)&&(i|=1),i<<=1,this.readModule(e-1,t-2,r,n)&&(i|=1),i<<=1,this.readModule(e-1,t-1,r,n)&&(i|=1),i<<=1,this.readModule(e-1,t,r,n)&&(i|=1),i<<=1,this.readModule(e,t-2,r,n)&&(i|=1),i<<=1,this.readModule(e,t-1,r,n)&&(i|=1),i<<=1,this.readModule(e,t,r,n)&&(i|=1),i},e.prototype.readCorner1=function(e,t){var r=0;return this.readModule(e-1,0,e,t)&&(r|=1),r<<=1,this.readModule(e-1,1,e,t)&&(r|=1),r<<=1,this.readModule(e-1,2,e,t)&&(r|=1),r<<=1,this.readModule(0,t-2,e,t)&&(r|=1),r<<=1,this.readModule(0,t-1,e,t)&&(r|=1),r<<=1,this.readModule(1,t-1,e,t)&&(r|=1),r<<=1,this.readModule(2,t-1,e,t)&&(r|=1),r<<=1,this.readModule(3,t-1,e,t)&&(r|=1),r},e.prototype.readCorner2=function(e,t){var r=0;return this.readModule(e-3,0,e,t)&&(r|=1),r<<=1,this.readModule(e-2,0,e,t)&&(r|=1),r<<=1,this.readModule(e-1,0,e,t)&&(r|=1),r<<=1,this.readModule(0,t-4,e,t)&&(r|=1),r<<=1,this.readModule(0,t-3,e,t)&&(r|=1),r<<=1,this.readModule(0,t-2,e,t)&&(r|=1),r<<=1,this.readModule(0,t-1,e,t)&&(r|=1),r<<=1,this.readModule(1,t-1,e,t)&&(r|=1),r},e.prototype.readCorner3=function(e,t){var r=0;return this.readModule(e-1,0,e,t)&&(r|=1),r<<=1,this.readModule(e-1,t-1,e,t)&&(r|=1),r<<=1,this.readModule(0,t-3,e,t)&&(r|=1),r<<=1,this.readModule(0,t-2,e,t)&&(r|=1),r<<=1,this.readModule(0,t-1,e,t)&&(r|=1),r<<=1,this.readModule(1,t-3,e,t)&&(r|=1),r<<=1,this.readModule(1,t-2,e,t)&&(r|=1),r<<=1,this.readModule(1,t-1,e,t)&&(r|=1),r},e.prototype.readCorner4=function(e,t){var r=0;return this.readModule(e-3,0,e,t)&&(r|=1),r<<=1,this.readModule(e-2,0,e,t)&&(r|=1),r<<=1,this.readModule(e-1,0,e,t)&&(r|=1),r<<=1,this.readModule(0,t-2,e,t)&&(r|=1),r<<=1,this.readModule(0,t-1,e,t)&&(r|=1),r<<=1,this.readModule(1,t-1,e,t)&&(r|=1),r<<=1,this.readModule(2,t-1,e,t)&&(r|=1),r<<=1,this.readModule(3,t-1,e,t)&&(r|=1),r},e.prototype.extractDataRegion=function(e){var t=this.version.getSymbolSizeRows(),r=this.version.getSymbolSizeColumns();if(e.getHeight()!==t)throw new ws("Dimension of bitMatrix must match the version size");for(var n=this.version.getDataRegionSizeRows(),i=this.version.getDataRegionSizeColumns(),o=t/n|0,a=r/i|0,s=new Ws(a*i,o*n),u=0;u<o;++u)for(var c=u*n,l=0;l<a;++l)for(var d=l*i,h=0;h<n;++h)for(var f=u*(n+2)+1+h,p=c+h,g=0;g<i;++g){var m=l*(i+2)+1+g;if(e.get(m,f)){var y=d+g;s.set(y,p)}}return s},e}(),Rl=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ol=function(){function e(e,t){this.numDataCodewords=e,this.codewords=t}return e.getDataBlocks=function(t,r){var n,i,o,a,s=r.getECBlocks(),u=0,c=s.getECBlocks();try{for(var l=Rl(c),d=l.next();!d.done;d=l.next()){u+=(m=d.value).getCount()}}catch(e){n={error:e}}finally{try{d&&!d.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}var h=new Array(u),f=0;try{for(var p=Rl(c),g=p.next();!g.done;g=p.next())for(var m=g.value,y=0;y<m.getCount();y++){var v=m.getDataCodewords(),b=s.getECCodewords()+v;h[f++]=new e(v,new Uint8Array(b))}}catch(e){o={error:e}}finally{try{g&&!g.done&&(a=p.return)&&a.call(p)}finally{if(o)throw o.error}}var w=h[0].codewords.length-s.getECCodewords(),_=w-1,A=0;for(y=0;y<_;y++)for(var E=0;E<f;E++)h[E].codewords[y]=t[A++];var C=24===r.getVersionNumber(),x=C?8:f;for(E=0;E<x;E++)h[E].codewords[w-1]=t[A++];var S=h[0].codewords.length;for(y=w;y<S;y++)for(E=0;E<f;E++){var I=C?(E+8)%f:E,T=C&&I>7?y-1:y;h[I].codewords[T]=t[A++]}if(A!==t.length)throw new ws;return h},e.prototype.getNumDataCodewords=function(){return this.numDataCodewords},e.prototype.getCodewords=function(){return this.codewords},e}(),kl=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 ws(""+e);var t=0,r=this.bitOffset,n=this.byteOffset,i=this.bytes;if(r>0){var o=8-r,a=e<o?e:o,s=255>>8-a<<(u=o-a);t=(i[n]&s)>>u,e-=a,8===(r+=a)&&(r=0,n++)}if(e>0){for(;e>=8;)t=t<<8|255&i[n],n++,e-=8;if(e>0){var u;s=255>>(u=8-e)<<u;t=t<<e|(i[n]&s)>>u,r+=e}}return this.bitOffset=r,this.byteOffset=n,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"}(xl||(xl={}));var Nl,Pl=function(){function e(){}return e.decode=function(e){var t=new kl(e),r=new qs,n=new qs,i=new Array,o=xl.ASCII_ENCODE;do{if(o===xl.ASCII_ENCODE)o=this.decodeAsciiSegment(t,r,n);else{switch(o){case xl.C40_ENCODE:this.decodeC40Segment(t,r);break;case xl.TEXT_ENCODE:this.decodeTextSegment(t,r);break;case xl.ANSIX12_ENCODE:this.decodeAnsiX12Segment(t,r);break;case xl.EDIFACT_ENCODE:this.decodeEdifactSegment(t,r);break;case xl.BASE256_ENCODE:this.decodeBase256Segment(t,r,i);break;default:throw new Fs}o=xl.ASCII_ENCODE}}while(o!==xl.PAD_ENCODE&&t.available()>0);return n.length()>0&&r.append(n.toString()),new pu(e,r.toString(),0===i.length?null:i,null)},e.decodeAsciiSegment=function(e,t,r){var n=!1;do{var i=e.readBits(8);if(0===i)throw new Fs;if(i<=128)return n&&(i+=128),t.append(String.fromCharCode(i-1)),xl.ASCII_ENCODE;if(129===i)return xl.PAD_ENCODE;if(i<=229){var o=i-130;o<10&&t.append("0"),t.append(""+o)}else switch(i){case 230:return xl.C40_ENCODE;case 231:return xl.BASE256_ENCODE;case 232:t.append(String.fromCharCode(29));break;case 233:case 234:case 241:break;case 235:n=!0;break;case 236:t.append("[)>05"),r.insert(0,"");break;case 237:t.append("[)>06"),r.insert(0,"");break;case 238:return xl.ANSIX12_ENCODE;case 239:return xl.TEXT_ENCODE;case 240:return xl.EDIFACT_ENCODE;default:if(254!==i||0!==e.available())throw new Fs}}while(e.available()>0);return xl.ASCII_ENCODE},e.decodeC40Segment=function(e,t){var r=!1,n=[],i=0;do{if(8===e.available())return;var o=e.readBits(8);if(254===o)return;this.parseTwoBytes(o,e.readBits(8),n);for(var a=0;a<3;a++){var s=n[a];switch(i){case 0:if(s<3)i=s+1;else{if(!(s<this.C40_BASIC_SET_CHARS.length))throw new Fs;var u=this.C40_BASIC_SET_CHARS[s];r?(t.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):t.append(u)}break;case 1:r?(t.append(String.fromCharCode(s+128)),r=!1):t.append(String.fromCharCode(s)),i=0;break;case 2:if(s<this.C40_SHIFT2_SET_CHARS.length){u=this.C40_SHIFT2_SET_CHARS[s];r?(t.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):t.append(u)}else switch(s){case 27:t.append(String.fromCharCode(29));break;case 30:r=!0;break;default:throw new Fs}i=0;break;case 3:r?(t.append(String.fromCharCode(s+224)),r=!1):t.append(String.fromCharCode(s+96)),i=0;break;default:throw new Fs}}}while(e.available()>0)},e.decodeTextSegment=function(e,t){var r=!1,n=[],i=0;do{if(8===e.available())return;var o=e.readBits(8);if(254===o)return;this.parseTwoBytes(o,e.readBits(8),n);for(var a=0;a<3;a++){var s=n[a];switch(i){case 0:if(s<3)i=s+1;else{if(!(s<this.TEXT_BASIC_SET_CHARS.length))throw new Fs;var u=this.TEXT_BASIC_SET_CHARS[s];r?(t.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):t.append(u)}break;case 1:r?(t.append(String.fromCharCode(s+128)),r=!1):t.append(String.fromCharCode(s)),i=0;break;case 2:if(s<this.TEXT_SHIFT2_SET_CHARS.length){u=this.TEXT_SHIFT2_SET_CHARS[s];r?(t.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):t.append(u)}else switch(s){case 27:t.append(String.fromCharCode(29));break;case 30:r=!0;break;default:throw new Fs}i=0;break;case 3:if(!(s<this.TEXT_SHIFT3_SET_CHARS.length))throw new Fs;u=this.TEXT_SHIFT3_SET_CHARS[s];r?(t.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):t.append(u),i=0;break;default:throw new Fs}}}while(e.available()>0)},e.decodeAnsiX12Segment=function(e,t){var r=[];do{if(8===e.available())return;var n=e.readBits(8);if(254===n)return;this.parseTwoBytes(n,e.readBits(8),r);for(var i=0;i<3;i++){var o=r[i];switch(o){case 0:t.append("\r");break;case 1:t.append("*");break;case 2:t.append(">");break;case 3:t.append(" ");break;default:if(o<14)t.append(String.fromCharCode(o+44));else{if(!(o<40))throw new Fs;t.append(String.fromCharCode(o+51))}}}}while(e.available()>0)},e.parseTwoBytes=function(e,t,r){var n=(e<<8)+t-1,i=Math.floor(n/1600);r[0]=i,n-=1600*i,i=Math.floor(n/40),r[1]=i,r[2]=n-40*i},e.decodeEdifactSegment=function(e,t){do{if(e.available()<=16)return;for(var r=0;r<4;r++){var n=e.readBits(6);if(31===n){var i=8-e.getBitOffset();return void(8!==i&&e.readBits(i))}32&n||(n|=64),t.append(String.fromCharCode(n))}}while(e.available()>0)},e.decodeBase256Segment=function(e,t,r){var n,i=1+e.getByteOffset(),o=this.unrandomize255State(e.readBits(8),i++);if((n=0===o?e.available()/8|0:o<250?o:250*(o-249)+this.unrandomize255State(e.readBits(8),i++))<0)throw new Fs;for(var a=new Uint8Array(n),s=0;s<n;s++){if(e.available()<8)throw new Fs;a[s]=this.unrandomize255State(e.readBits(8),i++)}r.push(a);try{t.append(Hs.decode(a,Gs.ISO88591))}catch(e){throw new Cu("Platform does not support required encoding: "+e.message)}},e.unrandomize255State=function(e,t){var r=e-(149*t%255+1);return r>=0?r:r+256},e.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","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"],e.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],e.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","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"],e.TEXT_SHIFT2_SET_CHARS=e.C40_SHIFT2_SET_CHARS,e.TEXT_SHIFT3_SET_CHARS=["`","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","{","|","}","~",String.fromCharCode(127)],e}(),Bl=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Fl=function(){function e(){this.rsDecoder=new xu(wu.DATA_MATRIX_FIELD_256)}return e.prototype.decode=function(e){var t,r,n=new Dl(e),i=n.getVersion(),o=n.readCodewords(),a=Ol.getDataBlocks(o,i),s=0;try{for(var u=Bl(a),c=u.next();!c.done;c=u.next()){s+=c.value.getNumDataCodewords()}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}for(var l=new Uint8Array(s),d=a.length,h=0;h<d;h++){var f=a[h],p=f.getCodewords(),g=f.getNumDataCodewords();this.correctErrors(p,g);for(var m=0;m<g;m++)l[m*d+h]=p[m]}return Pl.decode(l)},e.prototype.correctErrors=function(e,t){var r=new Int32Array(e);try{this.rsDecoder.decode(r,e.length-t)}catch(e){throw new Es}for(var n=0;n<t;n++)e[n]=r[n]},e}(),Ll=function(){function e(e){this.image=e,this.rectangleDetector=new ku(this.image)}return e.prototype.detect=function(){var t=this.rectangleDetector.detect(),r=this.detectSolid1(t);if((r=this.detectSolid2(r))[3]=this.correctTopRight(r),!r[3])throw new Xs;var n=(r=this.shiftToModuleCenter(r))[0],i=r[1],o=r[2],a=r[3],s=this.transitionsBetween(n,a)+1,u=this.transitionsBetween(o,a)+1;1&~s||(s+=1),1&~u||(u+=1),4*s<7*u&&4*u<7*s&&(s=u=Math.max(s,u));var c=e.sampleGrid(this.image,n,i,o,a,s,u);return new Du(c,[n,i,o,a])},e.shiftPoint=function(e,t,r){var n=(t.getX()-e.getX())/(r+1),i=(t.getY()-e.getY())/(r+1);return new Mu(e.getX()+n,e.getY()+i)},e.moveAway=function(e,t,r){var n=e.getX(),i=e.getY();return n<t?n-=1:n+=1,i<r?i-=1:i+=1,new Mu(n,i)},e.prototype.detectSolid1=function(e){var t=e[0],r=e[1],n=e[3],i=e[2],o=this.transitionsBetween(t,r),a=this.transitionsBetween(r,n),s=this.transitionsBetween(n,i),u=this.transitionsBetween(i,t),c=o,l=[i,t,r,n];return c>a&&(c=a,l[0]=t,l[1]=r,l[2]=n,l[3]=i),c>s&&(c=s,l[0]=r,l[1]=n,l[2]=i,l[3]=t),c>u&&(l[0]=n,l[1]=i,l[2]=t,l[3]=r),l},e.prototype.detectSolid2=function(t){var r=t[0],n=t[1],i=t[2],o=t[3],a=this.transitionsBetween(r,o),s=e.shiftPoint(n,i,4*(a+1)),u=e.shiftPoint(i,n,4*(a+1));return this.transitionsBetween(s,r)<this.transitionsBetween(u,o)?(t[0]=r,t[1]=n,t[2]=i,t[3]=o):(t[0]=n,t[1]=i,t[2]=o,t[3]=r),t},e.prototype.correctTopRight=function(t){var r=t[0],n=t[1],i=t[2],o=t[3],a=this.transitionsBetween(r,o),s=this.transitionsBetween(n,o),u=e.shiftPoint(r,n,4*(s+1)),c=e.shiftPoint(i,n,4*(a+1));a=this.transitionsBetween(u,o),s=this.transitionsBetween(c,o);var l=new Mu(o.getX()+(i.getX()-n.getX())/(a+1),o.getY()+(i.getY()-n.getY())/(a+1)),d=new Mu(o.getX()+(r.getX()-n.getX())/(s+1),o.getY()+(r.getY()-n.getY())/(s+1));return this.isValid(l)?this.isValid(d)?this.transitionsBetween(u,l)+this.transitionsBetween(c,l)>this.transitionsBetween(u,d)+this.transitionsBetween(c,d)?l:d:l:this.isValid(d)?d:null},e.prototype.shiftToModuleCenter=function(t){var r=t[0],n=t[1],i=t[2],o=t[3],a=this.transitionsBetween(r,o)+1,s=this.transitionsBetween(i,o)+1,u=e.shiftPoint(r,n,4*s),c=e.shiftPoint(i,n,4*a);1&~(a=this.transitionsBetween(u,o)+1)||(a+=1),1&~(s=this.transitionsBetween(c,o)+1)||(s+=1);var l,d,h=(r.getX()+n.getX()+i.getX()+o.getX())/4,f=(r.getY()+n.getY()+i.getY()+o.getY())/4;return r=e.moveAway(r,h,f),n=e.moveAway(n,h,f),i=e.moveAway(i,h,f),o=e.moveAway(o,h,f),u=e.shiftPoint(r,n,4*s),u=e.shiftPoint(u,o,4*a),l=e.shiftPoint(n,r,4*s),l=e.shiftPoint(l,i,4*a),c=e.shiftPoint(i,o,4*s),c=e.shiftPoint(c,n,4*a),d=e.shiftPoint(o,i,4*s),[u,l,c,d=e.shiftPoint(d,r,4*a)]},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,r,n,i,o,a){return Lu.getInstance().sampleGrid(e,o,a,.5,.5,o-.5,.5,o-.5,a-.5,.5,a-.5,t.getX(),t.getY(),i.getX(),i.getY(),n.getX(),n.getY(),r.getX(),r.getY())},e.prototype.transitionsBetween=function(e,t){var r=Math.trunc(e.getX()),n=Math.trunc(e.getY()),i=Math.trunc(t.getX()),o=Math.trunc(t.getY()),a=Math.abs(o-n)>Math.abs(i-r);if(a){var s=r;r=n,n=s,s=i,i=o,o=s}for(var u=Math.abs(i-r),c=Math.abs(o-n),l=-u/2,d=n<o?1:-1,h=r<i?1:-1,f=0,p=this.image.get(a?n:r,a?r:n),g=r,m=n;g!==i;g+=h){var y=this.image.get(a?m:g,a?g:m);if(y!==p&&(f++,p=y),(l+=c)>0){if(m===o)break;m+=d,l-=u}}return f},e}(),zl=function(){function e(){this.decoder=new Fl}return e.prototype.decode=function(t,r){var n,i;if(void 0===r&&(r=null),null!=r&&r.has(Ps.PURE_BARCODE)){var o=e.extractPureBits(t.getBlackMatrix());n=this.decoder.decode(o),i=e.NO_POINTS}else{var a=new Ll(t.getBlackMatrix()).detect();n=this.decoder.decode(a.getBits()),i=a.getPoints()}var s=n.getRawBytes(),u=new cu(n.getText(),s,8*s.length,i,du.DATA_MATRIX,xs.currentTimeMillis()),c=n.getByteSegments();null!=c&&u.putMetadata(fu.BYTE_SEGMENTS,c);var l=n.getECLevel();return null!=l&&u.putMetadata(fu.ERROR_CORRECTION_LEVEL,l),u},e.prototype.reset=function(){},e.extractPureBits=function(e){var t=e.getTopLeftOnBit(),r=e.getBottomRightOnBit();if(null==t||null==r)throw new Xs;var n=this.moduleSize(t,e),i=t[1],o=r[1],a=t[0],s=(r[0]-a+1)/n,u=(o-i+1)/n;if(s<=0||u<=0)throw new Xs;var c=n/2;i+=c,a+=c;for(var l=new Ws(s,u),d=0;d<u;d++)for(var h=i+d*n,f=0;f<s;f++)e.get(a+f*n,h)&&l.set(f,d);return l},e.moduleSize=function(e,t){for(var r=t.getWidth(),n=e[0],i=e[1];n<r&&t.get(n,i);)n++;if(n===r)throw new Xs;var o=n-e[0];if(0===o)throw new Xs;return o},e.NO_POINTS=[],e}(),Ul=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){function t(t){return void 0===t&&(t=500),e.call(this,new zl,t)||this}Ul(t,e)}(uu),function(e){e[e.L=0]="L",e[e.M=1]="M",e[e.Q=2]="Q",e[e.H=3]="H"}(Nl||(Nl={}));var jl,Vl=function(){function e(t,r,n){this.value=t,this.stringValue=r,this.bits=n,e.FOR_BITS.set(n,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 vs(t+"not available")}},e.prototype.toString=function(){return this.stringValue},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var r=t;return this.value===r.value},e.forBits=function(t){if(t<0||t>=e.FOR_BITS.size)throw new ws;return e.FOR_BITS.get(t)},e.FOR_BITS=new Map,e.FOR_VALUE=new Map,e.L=new e(Nl.L,"L",1),e.M=new e(Nl.M,"M",0),e.Q=new e(Nl.Q,"Q",3),e.H=new e(Nl.H,"H",2),e}(),Hl=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Gl=function(){function e(e){this.errorCorrectionLevel=Vl.forBits(e>>3&3),this.dataMask=7&e}return e.numBitsDiffering=function(e,t){return Os.bitCount(e^t)},e.decodeFormatInformation=function(t,r){var n=e.doDecodeFormatInformation(t,r);return null!==n?n:e.doDecodeFormatInformation(t^e.FORMAT_INFO_MASK_QR,r^e.FORMAT_INFO_MASK_QR)},e.doDecodeFormatInformation=function(t,r){var n,i,o=Number.MAX_SAFE_INTEGER,a=0;try{for(var s=Hl(e.FORMAT_INFO_DECODE_LOOKUP),u=s.next();!u.done;u=s.next()){var c=u.value,l=c[0];if(l===t||l===r)return new e(c[1]);var d=e.numBitsDiffering(t,l);d<o&&(a=c[1],o=d),t!==r&&(d=e.numBitsDiffering(r,l))<o&&(a=c[1],o=d)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return o<=3?new e(a):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 r=t;return this.errorCorrectionLevel===r.errorCorrectionLevel&&this.dataMask===r.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}(),ql=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Wl=function(){function e(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.ecCodewordsPerBlock=e,this.ecBlocks=t}return e.prototype.getECCodewordsPerBlock=function(){return this.ecCodewordsPerBlock},e.prototype.getNumBlocks=function(){var e,t,r=0,n=this.ecBlocks;try{for(var i=ql(n),o=i.next();!o.done;o=i.next()){r+=o.value.getCount()}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return r},e.prototype.getTotalECCodewords=function(){return this.ecCodewordsPerBlock*this.getNumBlocks()},e.prototype.getECBlocks=function(){return this.ecBlocks},e}(),Kl=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}(),Xl=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Yl=function(){function e(e,t){for(var r,n,i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];this.versionNumber=e,this.alignmentPatternCenters=t,this.ecBlocks=i;var a=0,s=i[0].getECCodewordsPerBlock(),u=i[0].getECBlocks();try{for(var c=Xl(u),l=c.next();!l.done;l=c.next()){var d=l.value;a+=d.getCount()*(d.getDataCodewords()+s)}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}this.totalCodewords=a}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 Fs;try{return this.getVersionForNumber((e-17)/4)}catch(e){throw new Fs}},e.getVersionForNumber=function(t){if(t<1||t>40)throw new ws;return e.VERSIONS[t-1]},e.decodeVersionInformation=function(t){for(var r=Number.MAX_SAFE_INTEGER,n=0,i=0;i<e.VERSION_DECODE_INFO.length;i++){var o=e.VERSION_DECODE_INFO[i];if(o===t)return e.getVersionForNumber(i+7);var a=Gl.numBitsDiffering(t,o);a<r&&(n=i+7,r=a)}return r<=3?e.getVersionForNumber(n):null},e.prototype.buildFunctionPattern=function(){var e=this.getDimensionForVersion(),t=new Ws(e);t.setRegion(0,0,9,9),t.setRegion(e-8,0,8,9),t.setRegion(0,e-8,9,8);for(var r=this.alignmentPatternCenters.length,n=0;n<r;n++)for(var i=this.alignmentPatternCenters[n]-2,o=0;o<r;o++)0===n&&(0===o||o===r-1)||n===r-1&&0===o||t.setRegion(this.alignmentPatternCenters[o]-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(0),new Wl(7,new Kl(1,19)),new Wl(10,new Kl(1,16)),new Wl(13,new Kl(1,13)),new Wl(17,new Kl(1,9))),new e(2,Int32Array.from([6,18]),new Wl(10,new Kl(1,34)),new Wl(16,new Kl(1,28)),new Wl(22,new Kl(1,22)),new Wl(28,new Kl(1,16))),new e(3,Int32Array.from([6,22]),new Wl(15,new Kl(1,55)),new Wl(26,new Kl(1,44)),new Wl(18,new Kl(2,17)),new Wl(22,new Kl(2,13))),new e(4,Int32Array.from([6,26]),new Wl(20,new Kl(1,80)),new Wl(18,new Kl(2,32)),new Wl(26,new Kl(2,24)),new Wl(16,new Kl(4,9))),new e(5,Int32Array.from([6,30]),new Wl(26,new Kl(1,108)),new Wl(24,new Kl(2,43)),new Wl(18,new Kl(2,15),new Kl(2,16)),new Wl(22,new Kl(2,11),new Kl(2,12))),new e(6,Int32Array.from([6,34]),new Wl(18,new Kl(2,68)),new Wl(16,new Kl(4,27)),new Wl(24,new Kl(4,19)),new Wl(28,new Kl(4,15))),new e(7,Int32Array.from([6,22,38]),new Wl(20,new Kl(2,78)),new Wl(18,new Kl(4,31)),new Wl(18,new Kl(2,14),new Kl(4,15)),new Wl(26,new Kl(4,13),new Kl(1,14))),new e(8,Int32Array.from([6,24,42]),new Wl(24,new Kl(2,97)),new Wl(22,new Kl(2,38),new Kl(2,39)),new Wl(22,new Kl(4,18),new Kl(2,19)),new Wl(26,new Kl(4,14),new Kl(2,15))),new e(9,Int32Array.from([6,26,46]),new Wl(30,new Kl(2,116)),new Wl(22,new Kl(3,36),new Kl(2,37)),new Wl(20,new Kl(4,16),new Kl(4,17)),new Wl(24,new Kl(4,12),new Kl(4,13))),new e(10,Int32Array.from([6,28,50]),new Wl(18,new Kl(2,68),new Kl(2,69)),new Wl(26,new Kl(4,43),new Kl(1,44)),new Wl(24,new Kl(6,19),new Kl(2,20)),new Wl(28,new Kl(6,15),new Kl(2,16))),new e(11,Int32Array.from([6,30,54]),new Wl(20,new Kl(4,81)),new Wl(30,new Kl(1,50),new Kl(4,51)),new Wl(28,new Kl(4,22),new Kl(4,23)),new Wl(24,new Kl(3,12),new Kl(8,13))),new e(12,Int32Array.from([6,32,58]),new Wl(24,new Kl(2,92),new Kl(2,93)),new Wl(22,new Kl(6,36),new Kl(2,37)),new Wl(26,new Kl(4,20),new Kl(6,21)),new Wl(28,new Kl(7,14),new Kl(4,15))),new e(13,Int32Array.from([6,34,62]),new Wl(26,new Kl(4,107)),new Wl(22,new Kl(8,37),new Kl(1,38)),new Wl(24,new Kl(8,20),new Kl(4,21)),new Wl(22,new Kl(12,11),new Kl(4,12))),new e(14,Int32Array.from([6,26,46,66]),new Wl(30,new Kl(3,115),new Kl(1,116)),new Wl(24,new Kl(4,40),new Kl(5,41)),new Wl(20,new Kl(11,16),new Kl(5,17)),new Wl(24,new Kl(11,12),new Kl(5,13))),new e(15,Int32Array.from([6,26,48,70]),new Wl(22,new Kl(5,87),new Kl(1,88)),new Wl(24,new Kl(5,41),new Kl(5,42)),new Wl(30,new Kl(5,24),new Kl(7,25)),new Wl(24,new Kl(11,12),new Kl(7,13))),new e(16,Int32Array.from([6,26,50,74]),new Wl(24,new Kl(5,98),new Kl(1,99)),new Wl(28,new Kl(7,45),new Kl(3,46)),new Wl(24,new Kl(15,19),new Kl(2,20)),new Wl(30,new Kl(3,15),new Kl(13,16))),new e(17,Int32Array.from([6,30,54,78]),new Wl(28,new Kl(1,107),new Kl(5,108)),new Wl(28,new Kl(10,46),new Kl(1,47)),new Wl(28,new Kl(1,22),new Kl(15,23)),new Wl(28,new Kl(2,14),new Kl(17,15))),new e(18,Int32Array.from([6,30,56,82]),new Wl(30,new Kl(5,120),new Kl(1,121)),new Wl(26,new Kl(9,43),new Kl(4,44)),new Wl(28,new Kl(17,22),new Kl(1,23)),new Wl(28,new Kl(2,14),new Kl(19,15))),new e(19,Int32Array.from([6,30,58,86]),new Wl(28,new Kl(3,113),new Kl(4,114)),new Wl(26,new Kl(3,44),new Kl(11,45)),new Wl(26,new Kl(17,21),new Kl(4,22)),new Wl(26,new Kl(9,13),new Kl(16,14))),new e(20,Int32Array.from([6,34,62,90]),new Wl(28,new Kl(3,107),new Kl(5,108)),new Wl(26,new Kl(3,41),new Kl(13,42)),new Wl(30,new Kl(15,24),new Kl(5,25)),new Wl(28,new Kl(15,15),new Kl(10,16))),new e(21,Int32Array.from([6,28,50,72,94]),new Wl(28,new Kl(4,116),new Kl(4,117)),new Wl(26,new Kl(17,42)),new Wl(28,new Kl(17,22),new Kl(6,23)),new Wl(30,new Kl(19,16),new Kl(6,17))),new e(22,Int32Array.from([6,26,50,74,98]),new Wl(28,new Kl(2,111),new Kl(7,112)),new Wl(28,new Kl(17,46)),new Wl(30,new Kl(7,24),new Kl(16,25)),new Wl(24,new Kl(34,13))),new e(23,Int32Array.from([6,30,54,78,102]),new Wl(30,new Kl(4,121),new Kl(5,122)),new Wl(28,new Kl(4,47),new Kl(14,48)),new Wl(30,new Kl(11,24),new Kl(14,25)),new Wl(30,new Kl(16,15),new Kl(14,16))),new e(24,Int32Array.from([6,28,54,80,106]),new Wl(30,new Kl(6,117),new Kl(4,118)),new Wl(28,new Kl(6,45),new Kl(14,46)),new Wl(30,new Kl(11,24),new Kl(16,25)),new Wl(30,new Kl(30,16),new Kl(2,17))),new e(25,Int32Array.from([6,32,58,84,110]),new Wl(26,new Kl(8,106),new Kl(4,107)),new Wl(28,new Kl(8,47),new Kl(13,48)),new Wl(30,new Kl(7,24),new Kl(22,25)),new Wl(30,new Kl(22,15),new Kl(13,16))),new e(26,Int32Array.from([6,30,58,86,114]),new Wl(28,new Kl(10,114),new Kl(2,115)),new Wl(28,new Kl(19,46),new Kl(4,47)),new Wl(28,new Kl(28,22),new Kl(6,23)),new Wl(30,new Kl(33,16),new Kl(4,17))),new e(27,Int32Array.from([6,34,62,90,118]),new Wl(30,new Kl(8,122),new Kl(4,123)),new Wl(28,new Kl(22,45),new Kl(3,46)),new Wl(30,new Kl(8,23),new Kl(26,24)),new Wl(30,new Kl(12,15),new Kl(28,16))),new e(28,Int32Array.from([6,26,50,74,98,122]),new Wl(30,new Kl(3,117),new Kl(10,118)),new Wl(28,new Kl(3,45),new Kl(23,46)),new Wl(30,new Kl(4,24),new Kl(31,25)),new Wl(30,new Kl(11,15),new Kl(31,16))),new e(29,Int32Array.from([6,30,54,78,102,126]),new Wl(30,new Kl(7,116),new Kl(7,117)),new Wl(28,new Kl(21,45),new Kl(7,46)),new Wl(30,new Kl(1,23),new Kl(37,24)),new Wl(30,new Kl(19,15),new Kl(26,16))),new e(30,Int32Array.from([6,26,52,78,104,130]),new Wl(30,new Kl(5,115),new Kl(10,116)),new Wl(28,new Kl(19,47),new Kl(10,48)),new Wl(30,new Kl(15,24),new Kl(25,25)),new Wl(30,new Kl(23,15),new Kl(25,16))),new e(31,Int32Array.from([6,30,56,82,108,134]),new Wl(30,new Kl(13,115),new Kl(3,116)),new Wl(28,new Kl(2,46),new Kl(29,47)),new Wl(30,new Kl(42,24),new Kl(1,25)),new Wl(30,new Kl(23,15),new Kl(28,16))),new e(32,Int32Array.from([6,34,60,86,112,138]),new Wl(30,new Kl(17,115)),new Wl(28,new Kl(10,46),new Kl(23,47)),new Wl(30,new Kl(10,24),new Kl(35,25)),new Wl(30,new Kl(19,15),new Kl(35,16))),new e(33,Int32Array.from([6,30,58,86,114,142]),new Wl(30,new Kl(17,115),new Kl(1,116)),new Wl(28,new Kl(14,46),new Kl(21,47)),new Wl(30,new Kl(29,24),new Kl(19,25)),new Wl(30,new Kl(11,15),new Kl(46,16))),new e(34,Int32Array.from([6,34,62,90,118,146]),new Wl(30,new Kl(13,115),new Kl(6,116)),new Wl(28,new Kl(14,46),new Kl(23,47)),new Wl(30,new Kl(44,24),new Kl(7,25)),new Wl(30,new Kl(59,16),new Kl(1,17))),new e(35,Int32Array.from([6,30,54,78,102,126,150]),new Wl(30,new Kl(12,121),new Kl(7,122)),new Wl(28,new Kl(12,47),new Kl(26,48)),new Wl(30,new Kl(39,24),new Kl(14,25)),new Wl(30,new Kl(22,15),new Kl(41,16))),new e(36,Int32Array.from([6,24,50,76,102,128,154]),new Wl(30,new Kl(6,121),new Kl(14,122)),new Wl(28,new Kl(6,47),new Kl(34,48)),new Wl(30,new Kl(46,24),new Kl(10,25)),new Wl(30,new Kl(2,15),new Kl(64,16))),new e(37,Int32Array.from([6,28,54,80,106,132,158]),new Wl(30,new Kl(17,122),new Kl(4,123)),new Wl(28,new Kl(29,46),new Kl(14,47)),new Wl(30,new Kl(49,24),new Kl(10,25)),new Wl(30,new Kl(24,15),new Kl(46,16))),new e(38,Int32Array.from([6,32,58,84,110,136,162]),new Wl(30,new Kl(4,122),new Kl(18,123)),new Wl(28,new Kl(13,46),new Kl(32,47)),new Wl(30,new Kl(48,24),new Kl(14,25)),new Wl(30,new Kl(42,15),new Kl(32,16))),new e(39,Int32Array.from([6,26,54,82,110,138,166]),new Wl(30,new Kl(20,117),new Kl(4,118)),new Wl(28,new Kl(40,47),new Kl(7,48)),new Wl(30,new Kl(43,24),new Kl(22,25)),new Wl(30,new Kl(10,15),new Kl(67,16))),new e(40,Int32Array.from([6,30,58,86,114,142,170]),new Wl(30,new Kl(19,118),new Kl(6,119)),new Wl(28,new Kl(18,47),new Kl(31,48)),new Wl(30,new Kl(34,24),new Kl(34,25)),new Wl(30,new Kl(20,15),new Kl(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"}(jl||(jl={}));var Zl,Jl=function(){function e(e,t){this.value=e,this.isMasked=t}return e.prototype.unmaskBitMatrix=function(e,t){for(var r=0;r<t;r++)for(var n=0;n<t;n++)this.isMasked(r,n)&&e.flip(n,r)},e.values=new Map([[jl.DATA_MASK_000,new e(jl.DATA_MASK_000,function(e,t){return!(e+t&1)})],[jl.DATA_MASK_001,new e(jl.DATA_MASK_001,function(e,t){return!(1&e)})],[jl.DATA_MASK_010,new e(jl.DATA_MASK_010,function(e,t){return t%3==0})],[jl.DATA_MASK_011,new e(jl.DATA_MASK_011,function(e,t){return(e+t)%3==0})],[jl.DATA_MASK_100,new e(jl.DATA_MASK_100,function(e,t){return!(Math.floor(e/2)+Math.floor(t/3)&1)})],[jl.DATA_MASK_101,new e(jl.DATA_MASK_101,function(e,t){return e*t%6==0})],[jl.DATA_MASK_110,new e(jl.DATA_MASK_110,function(e,t){return e*t%6<3})],[jl.DATA_MASK_111,new e(jl.DATA_MASK_111,function(e,t){return!(e+t+e*t%3&1)})]]),e}(),$l=function(){function e(e){var t=e.getHeight();if(t<21||1!=(3&t))throw new Fs;this.bitMatrix=e}return e.prototype.readFormatInformation=function(){if(null!==this.parsedFormatInfo&&void 0!==this.parsedFormatInfo)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 r=5;r>=0;r--)e=this.copyBit(8,r,e);var n=this.bitMatrix.getHeight(),i=0,o=n-7;for(r=n-1;r>=o;r--)i=this.copyBit(8,r,i);for(t=n-8;t<n;t++)i=this.copyBit(t,8,i);if(this.parsedFormatInfo=Gl.decodeFormatInformation(e,i),null!==this.parsedFormatInfo)return this.parsedFormatInfo;throw new Fs},e.prototype.readVersion=function(){if(null!==this.parsedVersion&&void 0!==this.parsedVersion)return this.parsedVersion;var e=this.bitMatrix.getHeight(),t=Math.floor((e-17)/4);if(t<=6)return Yl.getVersionForNumber(t);for(var r=0,n=e-11,i=5;i>=0;i--)for(var o=e-9;o>=n;o--)r=this.copyBit(o,i,r);var a=Yl.decodeVersionInformation(r);if(null!==a&&a.getDimensionForVersion()===e)return this.parsedVersion=a,a;r=0;for(o=5;o>=0;o--)for(i=e-9;i>=n;i--)r=this.copyBit(o,i,r);if(null!==(a=Yl.decodeVersionInformation(r))&&a.getDimensionForVersion()===e)return this.parsedVersion=a,a;throw new Fs},e.prototype.copyBit=function(e,t,r){return(this.isMirror?this.bitMatrix.get(t,e):this.bitMatrix.get(e,t))?r<<1|1:r<<1},e.prototype.readCodewords=function(){var e=this.readFormatInformation(),t=this.readVersion(),r=Jl.values.get(e.getDataMask()),n=this.bitMatrix.getHeight();r.unmaskBitMatrix(this.bitMatrix,n);for(var i=t.buildFunctionPattern(),o=!0,a=new Uint8Array(t.getTotalCodewords()),s=0,u=0,c=0,l=n-1;l>0;l-=2){6===l&&l--;for(var d=0;d<n;d++)for(var h=o?n-1-d:d,f=0;f<2;f++)i.get(l-f,h)||(c++,u<<=1,this.bitMatrix.get(l-f,h)&&(u|=1),8===c&&(a[s++]=u,c=0,u=0));o=!o}if(s!==t.getTotalCodewords())throw new Fs;return a},e.prototype.remask=function(){if(null!==this.parsedFormatInfo){var e=Jl.values.get(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,r=e.getWidth();t<r;t++)for(var n=t+1,i=e.getHeight();n<i;n++)e.get(t,n)!==e.get(n,t)&&(e.flip(n,t),e.flip(t,n))},e}(),Ql=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ed=function(){function e(e,t){this.numDataCodewords=e,this.codewords=t}return e.getDataBlocks=function(t,r,n){var i,o,a,s;if(t.length!==r.getTotalCodewords())throw new ws;var u=r.getECBlocksForLevel(n),c=0,l=u.getECBlocks();try{for(var d=Ql(l),h=d.next();!h.done;h=d.next()){c+=(y=h.value).getCount()}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}var f=new Array(c),p=0;try{for(var g=Ql(l),m=g.next();!m.done;m=g.next())for(var y=m.value,v=0;v<y.getCount();v++){var b=y.getDataCodewords(),w=u.getECCodewordsPerBlock()+b;f[p++]=new e(b,new Uint8Array(w))}}catch(e){a={error:e}}finally{try{m&&!m.done&&(s=g.return)&&s.call(g)}finally{if(a)throw a.error}}for(var _=f[0].codewords.length,A=f.length-1;A>=0;){if(f[A].codewords.length===_)break;A--}A++;var E=_-u.getECCodewordsPerBlock(),C=0;for(v=0;v<E;v++)for(var x=0;x<p;x++)f[x].codewords[v]=t[C++];for(x=A;x<p;x++)f[x].codewords[E]=t[C++];var S=f[0].codewords.length;for(v=E;v<S;v++)for(x=0;x<p;x++){var I=x<A?v:v+1;f[x].codewords[I]=t[C++]}return f},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"}(Zl||(Zl={}));var td,rd,nd=function(){function e(t,r,n,i){this.value=t,this.stringValue=r,this.characterCountBitsForVersions=n,this.bits=i,e.FOR_BITS.set(i,this),e.FOR_VALUE.set(t,this)}return e.forBits=function(t){var r=e.FOR_BITS.get(t);if(void 0===r)throw new ws;return r},e.prototype.getCharacterCountBits=function(e){var t,r=e.getVersionNumber();return t=r<=9?0:r<=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 r=t;return this.value===r.value},e.prototype.toString=function(){return this.stringValue},e.FOR_BITS=new Map,e.FOR_VALUE=new Map,e.TERMINATOR=new e(Zl.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),e.NUMERIC=new e(Zl.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),e.ALPHANUMERIC=new e(Zl.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),e.STRUCTURED_APPEND=new e(Zl.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),e.BYTE=new e(Zl.BYTE,"BYTE",Int32Array.from([8,16,16]),4),e.ECI=new e(Zl.ECI,"ECI",Int32Array.from([0,0,0]),7),e.KANJI=new e(Zl.KANJI,"KANJI",Int32Array.from([8,10,12]),8),e.FNC1_FIRST_POSITION=new e(Zl.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),e.FNC1_SECOND_POSITION=new e(Zl.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),e.HANZI=new e(Zl.HANZI,"HANZI",Int32Array.from([8,10,12]),13),e}(),id=function(){function e(){}return e.decode=function(t,r,n,i){var o=new kl(t),a=new qs,s=new Array,u=-1,c=-1;try{var l=null,d=!1,h=void 0;do{if(o.available()<4)h=nd.TERMINATOR;else{var f=o.readBits(4);h=nd.forBits(f)}switch(h){case nd.TERMINATOR:break;case nd.FNC1_FIRST_POSITION:case nd.FNC1_SECOND_POSITION:d=!0;break;case nd.STRUCTURED_APPEND:if(o.available()<16)throw new Fs;u=o.readBits(8),c=o.readBits(8);break;case nd.ECI:var p=e.parseECIValue(o);if(null===(l=Us.getCharacterSetECIByValue(p)))throw new Fs;break;case nd.HANZI:var g=o.readBits(4),m=o.readBits(h.getCharacterCountBits(r));g===e.GB2312_SUBSET&&e.decodeHanziSegment(o,a,m);break;default:var y=o.readBits(h.getCharacterCountBits(r));switch(h){case nd.NUMERIC:e.decodeNumericSegment(o,a,y);break;case nd.ALPHANUMERIC:e.decodeAlphanumericSegment(o,a,y,d);break;case nd.BYTE:e.decodeByteSegment(o,a,y,l,s,i);break;case nd.KANJI:e.decodeKanjiSegment(o,a,y);break;default:throw new Fs}}}while(h!==nd.TERMINATOR)}catch(e){throw new Fs}return new pu(t,a.toString(),0===s.length?null:s,null===n?null:n.toString(),u,c)},e.decodeHanziSegment=function(e,t,r){if(13*r>e.available())throw new Fs;for(var n=new Uint8Array(2*r),i=0;r>0;){var o=e.readBits(13),a=o/96<<8&4294967295|o%96;a+=a<959?41377:42657,n[i]=a>>8&255,n[i+1]=255&a,i+=2,r--}try{t.append(Hs.decode(n,Gs.GB2312))}catch(e){throw new Fs(e)}},e.decodeKanjiSegment=function(e,t,r){if(13*r>e.available())throw new Fs;for(var n=new Uint8Array(2*r),i=0;r>0;){var o=e.readBits(13),a=o/192<<8&4294967295|o%192;a+=a<7936?33088:49472,n[i]=a>>8,n[i+1]=a,i+=2,r--}try{t.append(Hs.decode(n,Gs.SHIFT_JIS))}catch(e){throw new Fs(e)}},e.decodeByteSegment=function(e,t,r,n,i,o){if(8*r>e.available())throw new Fs;for(var a,s=new Uint8Array(r),u=0;u<r;u++)s[u]=e.readBits(8);a=null===n?Gs.guessEncoding(s,o):n.getName();try{t.append(Hs.decode(s,a))}catch(e){throw new Fs(e)}i.push(s)},e.toAlphaNumericChar=function(t){if(t>=e.ALPHANUMERIC_CHARS.length)throw new Fs;return e.ALPHANUMERIC_CHARS[t]},e.decodeAlphanumericSegment=function(t,r,n,i){for(var o=r.length();n>1;){if(t.available()<11)throw new Fs;var a=t.readBits(11);r.append(e.toAlphaNumericChar(Math.floor(a/45))),r.append(e.toAlphaNumericChar(a%45)),n-=2}if(1===n){if(t.available()<6)throw new Fs;r.append(e.toAlphaNumericChar(t.readBits(6)))}if(i)for(var s=o;s<r.length();s++)"%"===r.charAt(s)&&(s<r.length()-1&&"%"===r.charAt(s+1)?r.deleteCharAt(s+1):r.setCharAt(s,String.fromCharCode(29)))},e.decodeNumericSegment=function(t,r,n){for(;n>=3;){if(t.available()<10)throw new Fs;var i=t.readBits(10);if(i>=1e3)throw new Fs;r.append(e.toAlphaNumericChar(Math.floor(i/100))),r.append(e.toAlphaNumericChar(Math.floor(i/10)%10)),r.append(e.toAlphaNumericChar(i%10)),n-=3}if(2===n){if(t.available()<7)throw new Fs;var o=t.readBits(7);if(o>=100)throw new Fs;r.append(e.toAlphaNumericChar(Math.floor(o/10))),r.append(e.toAlphaNumericChar(o%10))}else if(1===n){if(t.available()<4)throw new Fs;var a=t.readBits(4);if(a>=10)throw new Fs;r.append(e.toAlphaNumericChar(a))}},e.parseECIValue=function(e){var t=e.readBits(8);if(!(128&t))return 127&t;if(128==(192&t))return(63&t)<<8&4294967295|e.readBits(8);if(192==(224&t))return(31&t)<<16&4294967295|e.readBits(16);throw new Fs},e.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.GB2312_SUBSET=1,e}(),od=function(){function e(e){this.mirrored=e}return e.prototype.isMirrored=function(){return this.mirrored},e.prototype.applyMirroredCorrection=function(e){if(this.mirrored&&null!==e&&!(e.length<3)){var t=e[0];e[0]=e[2],e[2]=t}},e}(),ad=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},sd=function(){function e(){this.rsDecoder=new xu(wu.QR_CODE_FIELD_256)}return e.prototype.decodeBooleanArray=function(e,t){return this.decodeBitMatrix(Ws.parseFromBooleanArray(e),t)},e.prototype.decodeBitMatrix=function(e,t){var r=new $l(e),n=null;try{return this.decodeBitMatrixParser(r,t)}catch(e){n=e}try{r.remask(),r.setMirror(!0),r.readVersion(),r.readFormatInformation(),r.mirror();var i=this.decodeBitMatrixParser(r,t);return i.setOther(new od(!0)),i}catch(e){if(null!==n)throw n;throw e}},e.prototype.decodeBitMatrixParser=function(e,t){var r,n,i,o,a=e.readVersion(),s=e.readFormatInformation().getErrorCorrectionLevel(),u=e.readCodewords(),c=ed.getDataBlocks(u,a,s),l=0;try{for(var d=ad(c),h=d.next();!h.done;h=d.next()){l+=(y=h.value).getNumDataCodewords()}}catch(e){r={error:e}}finally{try{h&&!h.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}var f=new Uint8Array(l),p=0;try{for(var g=ad(c),m=g.next();!m.done;m=g.next()){var y,v=(y=m.value).getCodewords(),b=y.getNumDataCodewords();this.correctErrors(v,b);for(var w=0;w<b;w++)f[p++]=v[w]}}catch(e){i={error:e}}finally{try{m&&!m.done&&(o=g.return)&&o.call(g)}finally{if(i)throw i.error}}return id.decode(f,a,s,t)},e.prototype.correctErrors=function(e,t){var r=new Int32Array(e);try{this.rsDecoder.decode(r,e.length-t)}catch(e){throw new Es}for(var n=0;n<t;n++)e[n]=r[n]},e}(),ud=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),cd=function(e){function t(t,r,n){var i=e.call(this,t,r)||this;return i.estimatedModuleSize=n,i}return ud(t,e),t.prototype.aboutEquals=function(e,t,r){if(Math.abs(t-this.getY())<=e&&Math.abs(r-this.getX())<=e){var n=Math.abs(e-this.estimatedModuleSize);return n<=1||n<=this.estimatedModuleSize}return!1},t.prototype.combineEstimate=function(e,r,n){return new t((this.getX()+r)/2,(this.getY()+e)/2,(this.estimatedModuleSize+n)/2)},t}(Mu),ld=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},dd=function(){function e(e,t,r,n,i,o,a){this.image=e,this.startX=t,this.startY=r,this.width=n,this.height=i,this.moduleSize=o,this.resultPointCallback=a,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}return e.prototype.find=function(){for(var e=this.startX,t=this.height,r=e+this.width,n=this.startY+t/2,i=new Int32Array(3),o=this.image,a=0;a<t;a++){var s=n+(1&a?-Math.floor((a+1)/2):Math.floor((a+1)/2));i[0]=0,i[1]=0,i[2]=0;for(var u=e;u<r&&!o.get(u,s);)u++;for(var c=0;u<r;){if(o.get(u,s))if(1===c)i[1]++;else if(2===c){var l;if(this.foundPatternCross(i))if(null!==(l=this.handlePossibleCenter(i,s,u)))return l;i[0]=i[2],i[1]=1,i[2]=0,c=1}else i[++c]++;else 1===c&&c++,i[c]++;u++}if(this.foundPatternCross(i))if(null!==(l=this.handlePossibleCenter(i,s,r)))return l}if(0!==this.possibleCenters.length)return this.possibleCenters[0];throw new Xs},e.centerFromEnd=function(e,t){return t-e[2]-e[1]/2},e.prototype.foundPatternCross=function(e){for(var t=this.moduleSize,r=t/2,n=0;n<3;n++)if(Math.abs(t-e[n])>=r)return!1;return!0},e.prototype.crossCheckVertical=function(t,r,n,i){var o=this.image,a=o.getHeight(),s=this.crossCheckStateCount;s[0]=0,s[1]=0,s[2]=0;for(var u=t;u>=0&&o.get(r,u)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&!o.get(r,u)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=t+1;u<a&&o.get(r,u)&&s[1]<=n;)s[1]++,u++;if(u===a||s[1]>n)return NaN;for(;u<a&&!o.get(r,u)&&s[2]<=n;)s[2]++,u++;if(s[2]>n)return NaN;var c=s[0]+s[1]+s[2];return 5*Math.abs(c-i)>=2*i?NaN:this.foundPatternCross(s)?e.centerFromEnd(s,u):NaN},e.prototype.handlePossibleCenter=function(t,r,n){var i,o,a=t[0]+t[1]+t[2],s=e.centerFromEnd(t,n),u=this.crossCheckVertical(r,s,2*t[1],a);if(!isNaN(u)){var c=(t[0]+t[1]+t[2])/3;try{for(var l=ld(this.possibleCenters),d=l.next();!d.done;d=l.next()){var h=d.value;if(h.aboutEquals(c,u,s))return h.combineEstimate(u,s,c)}}catch(e){i={error:e}}finally{try{d&&!d.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}var f=new cd(s,u,c);this.possibleCenters.push(f),null!==this.resultPointCallback&&void 0!==this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(f)}return null},e}(),hd=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),fd=function(e){function t(t,r,n,i){var o=e.call(this,t,r)||this;return o.estimatedModuleSize=n,o.count=i,void 0===i&&(o.count=1),o}return hd(t,e),t.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},t.prototype.getCount=function(){return this.count},t.prototype.aboutEquals=function(e,t,r){if(Math.abs(t-this.getY())<=e&&Math.abs(r-this.getX())<=e){var n=Math.abs(e-this.estimatedModuleSize);return n<=1||n<=this.estimatedModuleSize}return!1},t.prototype.combineEstimate=function(e,r,n){var i=this.count+1;return new t((this.count*this.getX()+r)/i,(this.count*this.getY()+e)/i,(this.count*this.estimatedModuleSize+n)/i,i)},t}(Mu),pd=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}(),gd=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},md=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 r=null!=t&&void 0!==t.get(Ps.TRY_HARDER),n=null!=t&&void 0!==t.get(Ps.PURE_BARCODE),i=this.image,o=i.getHeight(),a=i.getWidth(),s=Math.floor(3*o/(4*e.MAX_MODULES));(s<e.MIN_SKIP||r)&&(s=e.MIN_SKIP);for(var u=!1,c=new Int32Array(5),l=s-1;l<o&&!u;l+=s){c[0]=0,c[1]=0,c[2]=0,c[3]=0,c[4]=0;for(var d=0,h=0;h<a;h++)if(i.get(h,l))1&~d||d++,c[d]++;else if(1&d)c[d]++;else if(4===d)if(e.foundPatternCross(c)){if(!0!==this.handlePossibleCenter(c,l,h,n)){c[0]=c[2],c[1]=c[3],c[2]=c[4],c[3]=1,c[4]=0,d=3;continue}if(s=2,!0===this.hasSkipped)u=this.haveMultiplyConfirmedCenters();else{var f=this.findRowSkip();f>c[2]&&(l+=f-c[2]-s,h=a-1)}d=0,c[0]=0,c[1]=0,c[2]=0,c[3]=0,c[4]=0}else c[0]=c[2],c[1]=c[3],c[2]=c[4],c[3]=1,c[4]=0,d=3;else c[++d]++;if(e.foundPatternCross(c))!0===this.handlePossibleCenter(c,l,a,n)&&(s=c[0],this.hasSkipped&&(u=this.haveMultiplyConfirmedCenters()))}var p=this.selectBestPatterns();return Mu.orderBestPatterns(p),new pd(p)},e.centerFromEnd=function(e,t){return t-e[4]-e[3]-e[2]/2},e.foundPatternCross=function(e){for(var t=0,r=0;r<5;r++){var n=e[r];if(0===n)return!1;t+=n}if(t<7)return!1;var i=t/7,o=i/2;return Math.abs(i-e[0])<o&&Math.abs(i-e[1])<o&&Math.abs(3*i-e[2])<3*o&&Math.abs(i-e[3])<o&&Math.abs(i-e[4])<o},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,r,n,i){for(var o=this.getCrossCheckStateCount(),a=0,s=this.image;t>=a&&r>=a&&s.get(r-a,t-a);)o[2]++,a++;if(t<a||r<a)return!1;for(;t>=a&&r>=a&&!s.get(r-a,t-a)&&o[1]<=n;)o[1]++,a++;if(t<a||r<a||o[1]>n)return!1;for(;t>=a&&r>=a&&s.get(r-a,t-a)&&o[0]<=n;)o[0]++,a++;if(o[0]>n)return!1;var u=s.getHeight(),c=s.getWidth();for(a=1;t+a<u&&r+a<c&&s.get(r+a,t+a);)o[2]++,a++;if(t+a>=u||r+a>=c)return!1;for(;t+a<u&&r+a<c&&!s.get(r+a,t+a)&&o[3]<n;)o[3]++,a++;if(t+a>=u||r+a>=c||o[3]>=n)return!1;for(;t+a<u&&r+a<c&&s.get(r+a,t+a)&&o[4]<n;)o[4]++,a++;if(o[4]>=n)return!1;var l=o[0]+o[1]+o[2]+o[3]+o[4];return Math.abs(l-i)<2*i&&e.foundPatternCross(o)},e.prototype.crossCheckVertical=function(t,r,n,i){for(var o=this.image,a=o.getHeight(),s=this.getCrossCheckStateCount(),u=t;u>=0&&o.get(r,u);)s[2]++,u--;if(u<0)return NaN;for(;u>=0&&!o.get(r,u)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&o.get(r,u)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=t+1;u<a&&o.get(r,u);)s[2]++,u++;if(u===a)return NaN;for(;u<a&&!o.get(r,u)&&s[3]<n;)s[3]++,u++;if(u===a||s[3]>=n)return NaN;for(;u<a&&o.get(r,u)&&s[4]<n;)s[4]++,u++;if(s[4]>=n)return NaN;var c=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(c-i)>=2*i?NaN:e.foundPatternCross(s)?e.centerFromEnd(s,u):NaN},e.prototype.crossCheckHorizontal=function(t,r,n,i){for(var o=this.image,a=o.getWidth(),s=this.getCrossCheckStateCount(),u=t;u>=0&&o.get(u,r);)s[2]++,u--;if(u<0)return NaN;for(;u>=0&&!o.get(u,r)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&o.get(u,r)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=t+1;u<a&&o.get(u,r);)s[2]++,u++;if(u===a)return NaN;for(;u<a&&!o.get(u,r)&&s[3]<n;)s[3]++,u++;if(u===a||s[3]>=n)return NaN;for(;u<a&&o.get(u,r)&&s[4]<n;)s[4]++,u++;if(s[4]>=n)return NaN;var c=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(c-i)>=i?NaN:e.foundPatternCross(s)?e.centerFromEnd(s,u):NaN},e.prototype.handlePossibleCenter=function(t,r,n,i){var o=t[0]+t[1]+t[2]+t[3]+t[4],a=e.centerFromEnd(t,n),s=this.crossCheckVertical(r,Math.floor(a),t[2],o);if(!isNaN(s)&&(a=this.crossCheckHorizontal(Math.floor(a),Math.floor(s),t[2],o),!isNaN(a)&&(!i||this.crossCheckDiagonal(Math.floor(s),Math.floor(a),t[2],o)))){for(var u=o/7,c=!1,l=this.possibleCenters,d=0,h=l.length;d<h;d++){var f=l[d];if(f.aboutEquals(u,s,a)){l[d]=f.combineEstimate(s,a,u),c=!0;break}}if(!c){var p=new fd(a,s,u);l.push(p),null!==this.resultPointCallback&&void 0!==this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(p)}return!0}return!1},e.prototype.findRowSkip=function(){var t,r;if(this.possibleCenters.length<=1)return 0;var n=null;try{for(var i=gd(this.possibleCenters),o=i.next();!o.done;o=i.next()){var a=o.value;if(a.getCount()>=e.CENTER_QUORUM){if(null!=n)return this.hasSkipped=!0,Math.floor((Math.abs(n.getX()-a.getX())-Math.abs(n.getY()-a.getY()))/2);n=a}}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return 0},e.prototype.haveMultiplyConfirmedCenters=function(){var t,r,n,i,o=0,a=0,s=this.possibleCenters.length;try{for(var u=gd(this.possibleCenters),c=u.next();!c.done;c=u.next()){(p=c.value).getCount()>=e.CENTER_QUORUM&&(o++,a+=p.getEstimatedModuleSize())}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}if(o<3)return!1;var l=a/s,d=0;try{for(var h=gd(this.possibleCenters),f=h.next();!f.done;f=h.next()){var p=f.value;d+=Math.abs(p.getEstimatedModuleSize()-l)}}catch(e){n={error:e}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}return d<=.05*a},e.prototype.selectBestPatterns=function(){var e,t,r,n,i=this.possibleCenters.length;if(i<3)throw new Xs;var o,a=this.possibleCenters;if(i>3){var s=0,u=0;try{for(var c=gd(this.possibleCenters),l=c.next();!l.done;l=c.next()){var d=l.value.getEstimatedModuleSize();s+=d,u+=d*d}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}o=s/i;var h=Math.sqrt(u/i-o*o);a.sort(function(e,t){var r=Math.abs(t.getEstimatedModuleSize()-o),n=Math.abs(e.getEstimatedModuleSize()-o);return r<n?-1:r>n?1:0});for(var f=Math.max(.2*o,h),p=0;p<a.length&&a.length>3;p++){var g=a[p];Math.abs(g.getEstimatedModuleSize()-o)>f&&(a.splice(p,1),p--)}}if(a.length>3){s=0;try{for(var m=gd(a),y=m.next();!y.done;y=m.next()){s+=y.value.getEstimatedModuleSize()}}catch(e){r={error:e}}finally{try{y&&!y.done&&(n=m.return)&&n.call(m)}finally{if(r)throw r.error}}o=s/a.length,a.sort(function(e,t){if(t.getCount()===e.getCount()){var r=Math.abs(t.getEstimatedModuleSize()-o),n=Math.abs(e.getEstimatedModuleSize()-o);return r<n?1:r>n?-1:0}return t.getCount()-e.getCount()}),a.splice(3)}return[a[0],a[1],a[2]]},e.CENTER_QUORUM=2,e.MIN_SKIP=3,e.MAX_MODULES=57,e}(),yd=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=null==e?null:e.get(Ps.NEED_RESULT_POINT_CALLBACK);var t=new md(this.image,this.resultPointCallback).find(e);return this.processFinderPatternInfo(t)},e.prototype.processFinderPatternInfo=function(t){var r=t.getTopLeft(),n=t.getTopRight(),i=t.getBottomLeft(),o=this.calculateModuleSize(r,n,i);if(o<1)throw new Xs("No pattern found in proccess finder.");var a=e.computeDimension(r,n,i,o),s=Yl.getProvisionalVersionForDimension(a),u=s.getDimensionForVersion()-7,c=null;if(s.getAlignmentPatternCenters().length>0)for(var l=n.getX()-r.getX()+i.getX(),d=n.getY()-r.getY()+i.getY(),h=1-3/u,f=Math.floor(r.getX()+h*(l-r.getX())),p=Math.floor(r.getY()+h*(d-r.getY())),g=4;g<=16;g<<=1)try{c=this.findAlignmentInRegion(o,f,p,g);break}catch(e){if(!(e instanceof Xs))throw e}var m=e.createTransform(r,n,i,c,a),y=e.sampleGrid(this.image,m,a);return new Du(y,null===c?[i,r,n]:[i,r,n,c])},e.createTransform=function(e,t,r,n,i){var o,a,s,u,c=i-3.5;return null!==n?(o=n.getX(),a=n.getY(),u=s=c-3):(o=t.getX()-e.getX()+r.getX(),a=t.getY()-e.getY()+r.getY(),s=c,u=c),Pu.quadrilateralToQuadrilateral(3.5,3.5,c,3.5,s,u,3.5,c,e.getX(),e.getY(),t.getX(),t.getY(),o,a,r.getX(),r.getY())},e.sampleGrid=function(e,t,r){return Lu.getInstance().sampleGridWithTransform(e,r,r,t)},e.computeDimension=function(e,t,r,n){var i=Iu.round(Mu.distance(e,t)/n),o=Iu.round(Mu.distance(e,r)/n),a=Math.floor((i+o)/2)+7;switch(3&a){case 0:a++;break;case 2:a--;break;case 3:throw new Xs("Dimensions could be not found.")}return a},e.prototype.calculateModuleSize=function(e,t,r){return(this.calculateModuleSizeOneWay(e,t)+this.calculateModuleSizeOneWay(e,r))/2},e.prototype.calculateModuleSizeOneWay=function(e,t){var r=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY())),n=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(e.getX()),Math.floor(e.getY()));return isNaN(r)?n/7:isNaN(n)?r/7:(r+n)/14},e.prototype.sizeOfBlackWhiteBlackRunBothWays=function(e,t,r,n){var i=this.sizeOfBlackWhiteBlackRun(e,t,r,n),o=1,a=e-(r-e);a<0?(o=e/(e-a),a=0):a>=this.image.getWidth()&&(o=(this.image.getWidth()-1-e)/(a-e),a=this.image.getWidth()-1);var s=Math.floor(t-(n-t)*o);return o=1,s<0?(o=t/(t-s),s=0):s>=this.image.getHeight()&&(o=(this.image.getHeight()-1-t)/(s-t),s=this.image.getHeight()-1),a=Math.floor(e+(a-e)*o),(i+=this.sizeOfBlackWhiteBlackRun(e,t,a,s))-1},e.prototype.sizeOfBlackWhiteBlackRun=function(e,t,r,n){var i=Math.abs(n-t)>Math.abs(r-e);if(i){var o=e;e=t,t=o,o=r,r=n,n=o}for(var a=Math.abs(r-e),s=Math.abs(n-t),u=-a/2,c=e<r?1:-1,l=t<n?1:-1,d=0,h=r+c,f=e,p=t;f!==h;f+=c){var g=i?p:f,m=i?f:p;if(1===d===this.image.get(g,m)){if(2===d)return Iu.distance(f,p,e,t);d++}if((u+=s)>0){if(p===n)break;p+=l,u-=a}}return 2===d?Iu.distance(r+c,n,e,t):NaN},e.prototype.findAlignmentInRegion=function(e,t,r,n){var i=Math.floor(n*e),o=Math.max(0,t-i),a=Math.min(this.image.getWidth()-1,t+i);if(a-o<3*e)throw new Xs("Alignment top exceeds estimated module size.");var s=Math.max(0,r-i),u=Math.min(this.image.getHeight()-1,r+i);if(u-s<3*e)throw new Xs("Alignment bottom exceeds estimated module size.");return new dd(this.image,o,s,a-o,u-s,e,this.resultPointCallback).find()},e}(),vd=function(){function e(){this.decoder=new sd}return e.prototype.getDecoder=function(){return this.decoder},e.prototype.decode=function(t,r){var n,i;if(null!=r&&void 0!==r.get(Ps.PURE_BARCODE)){var o=e.extractPureBits(t.getBlackMatrix());n=this.decoder.decodeBitMatrix(o,r),i=e.NO_POINTS}else{var a=new yd(t.getBlackMatrix()).detect(r);n=this.decoder.decodeBitMatrix(a.getBits(),r),i=a.getPoints()}n.getOther()instanceof od&&n.getOther().applyMirroredCorrection(i);var s=new cu(n.getText(),n.getRawBytes(),void 0,i,du.QR_CODE,void 0),u=n.getByteSegments();null!==u&&s.putMetadata(fu.BYTE_SEGMENTS,u);var c=n.getECLevel();return null!==c&&s.putMetadata(fu.ERROR_CORRECTION_LEVEL,c),n.hasStructuredAppend()&&(s.putMetadata(fu.STRUCTURED_APPEND_SEQUENCE,n.getStructuredAppendSequenceNumber()),s.putMetadata(fu.STRUCTURED_APPEND_PARITY,n.getStructuredAppendParity())),s},e.prototype.reset=function(){},e.extractPureBits=function(e){var t=e.getTopLeftOnBit(),r=e.getBottomRightOnBit();if(null===t||null===r)throw new Xs;var n=this.moduleSize(t,e),i=t[1],o=r[1],a=t[0],s=r[0];if(a>=s||i>=o)throw new Xs;if(o-i!==s-a&&(s=a+(o-i))>=e.getWidth())throw new Xs;var u=Math.round((s-a+1)/n),c=Math.round((o-i+1)/n);if(u<=0||c<=0)throw new Xs;if(c!==u)throw new Xs;var l=Math.floor(n/2);i+=l;var d=(a+=l)+Math.floor((u-1)*n)-s;if(d>0){if(d>l)throw new Xs;a-=d}var h=i+Math.floor((c-1)*n)-o;if(h>0){if(h>l)throw new Xs;i-=h}for(var f=new Ws(u,c),p=0;p<c;p++)for(var g=i+Math.floor(p*n),m=0;m<u;m++)e.get(a+Math.floor(m*n),g)&&f.set(m,p);return f},e.moduleSize=function(e,t){for(var r=t.getHeight(),n=t.getWidth(),i=e[0],o=e[1],a=!0,s=0;i<n&&o<r;){if(a!==t.get(i,o)){if(5===++s)break;a=!a}i++,o++}if(i===n||o===r)throw new Xs;return(i-e[0])/7},e.NO_POINTS=new Array,e}(),bd=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},wd=function(){function e(){}return e.prototype.PDF417Common=function(){},e.getBitCountSum=function(e){return Iu.sum(e)},e.toIntArray=function(t){var r,n;if(null==t||!t.length)return e.EMPTY_INT_ARRAY;var i=new Int32Array(t.length),o=0;try{for(var a=bd(t),s=a.next();!s.done;s=a.next()){var u=s.value;i[o++]=u}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i},e.getCodeword=function(t){var r=Rs.binarySearch(e.SYMBOL_TABLE,262143&t);return r<0?-1:(e.CODEWORD_TABLE[r]-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}(),_d=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}(),Ad=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ed=function(){function e(){}return e.detectMultiple=function(t,r,n){var i=t.getBlackMatrix(),o=e.detect(n,i);return o.length||((i=i.clone()).rotate180(),o=e.detect(n,i)),new _d(i,o)},e.detect=function(t,r){for(var n,i,o=new Array,a=0,s=0,u=!1;a<r.getHeight();){var c=e.findVertices(r,a,s);if(null!=c[0]||null!=c[3]){if(u=!0,o.push(c),!t)break;null!=c[2]?(s=Math.trunc(c[2].getX()),a=Math.trunc(c[2].getY())):(s=Math.trunc(c[4].getX()),a=Math.trunc(c[4].getY()))}else{if(!u)break;u=!1,s=0;try{for(var l=(n=void 0,Ad(o)),d=l.next();!d.done;d=l.next()){var h=d.value;null!=h[1]&&(a=Math.trunc(Math.max(a,h[1].getY()))),null!=h[3]&&(a=Math.max(a,Math.trunc(h[3].getY())))}}catch(e){n={error:e}}finally{try{d&&!d.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}a+=e.ROW_STEP}}return o},e.findVertices=function(t,r,n){var i=t.getHeight(),o=t.getWidth(),a=new Array(8);return e.copyToResult(a,e.findRowsWithPattern(t,i,o,r,n,e.START_PATTERN),e.INDEXES_START_PATTERN),null!=a[4]&&(n=Math.trunc(a[4].getX()),r=Math.trunc(a[4].getY())),e.copyToResult(a,e.findRowsWithPattern(t,i,o,r,n,e.STOP_PATTERN),e.INDEXES_STOP_PATTERN),a},e.copyToResult=function(e,t,r){for(var n=0;n<r.length;n++)e[r[n]]=t[n]},e.findRowsWithPattern=function(t,r,n,i,o,a){for(var s=new Array(4),u=!1,c=new Int32Array(a.length);i<r;i+=e.ROW_STEP){if(null!=(f=e.findGuardPattern(t,o,i,n,!1,a,c))){for(;i>0;){if(null==(h=e.findGuardPattern(t,o,--i,n,!1,a,c))){i++;break}f=h}s[0]=new Mu(f[0],i),s[1]=new Mu(f[1],i),u=!0;break}}var l=i+1;if(u){for(var d=0,h=Int32Array.from([Math.trunc(s[0].getX()),Math.trunc(s[1].getX())]);l<r;l++){var f;if(null!=(f=e.findGuardPattern(t,h[0],l,n,!1,a,c))&&Math.abs(h[0]-f[0])<e.MAX_PATTERN_DRIFT&&Math.abs(h[1]-f[1])<e.MAX_PATTERN_DRIFT)h=f,d=0;else{if(d>e.SKIPPED_ROW_COUNT_MAX)break;d++}}l-=d+1,s[2]=new Mu(h[0],l),s[3]=new Mu(h[1],l)}return l-i<e.BARCODE_MIN_HEIGHT&&Rs.fill(s,null),s},e.findGuardPattern=function(t,r,n,i,o,a,s){Rs.fillWithin(s,0,s.length,0);for(var u=r,c=0;t.get(u,n)&&u>0&&c++<e.MAX_PIXEL_DRIFT;)u--;for(var l=u,d=0,h=a.length,f=o;l<i;l++){if(t.get(l,n)!==f)s[d]++;else{if(d===h-1){if(e.patternMatchVariance(s,a,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return new Int32Array([u,l]);u+=s[0]+s[1],xs.arraycopy(s,2,s,0,d-1),s[d-1]=0,s[d]=0,d--}else d++;s[d]=1,f=!f}}return d===h-1&&e.patternMatchVariance(s,a,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE?new Int32Array([u,l-1]):null},e.patternMatchVariance=function(e,t,r){for(var n=e.length,i=0,o=0,a=0;a<n;a++)i+=e[a],o+=t[a];if(i<o)return 1/0;var s=i/o;r*=s;for(var u=0,c=0;c<n;c++){var l=e[c],d=t[c]*s,h=l>d?l-d:d-l;if(h>r)return 1/0;u+=h}return u/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}(),Cd=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},xd=function(){function e(e,t){if(0===t.length)throw new ws;this.field=e;var r=t.length;if(r>1&&0===t[0]){for(var n=1;n<r&&0===t[n];)n++;n===r?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(r-n),xs.arraycopy(t,n,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 0===this.coefficients[0]},e.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},e.prototype.evaluateAt=function(e){var t,r;if(0===e)return this.getCoefficient(0);if(1===e){var n=0;try{for(var i=Cd(this.coefficients),o=i.next();!o.done;o=i.next()){var a=o.value;n=this.field.add(n,a)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n}for(var s=this.coefficients[0],u=this.coefficients.length,c=1;c<u;c++)s=this.field.add(this.field.multiply(e,s),this.coefficients[c]);return s},e.prototype.add=function(t){if(!this.field.equals(t.field))throw new ws("ModulusPolys do not have same ModulusGF field");if(this.isZero())return t;if(t.isZero())return this;var r=this.coefficients,n=t.coefficients;if(r.length>n.length){var i=r;r=n,n=i}var o=new Int32Array(n.length),a=n.length-r.length;xs.arraycopy(n,0,o,0,a);for(var s=a;s<n.length;s++)o[s]=this.field.add(r[s-a],n[s]);return new e(this.field,o)},e.prototype.subtract=function(e){if(!this.field.equals(e.field))throw new ws("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 ws("ModulusPolys do not have same ModulusGF field");if(this.isZero()||t.isZero())return new e(this.field,new Int32Array([0]));for(var r=this.coefficients,n=r.length,i=t.coefficients,o=i.length,a=new Int32Array(n+o-1),s=0;s<n;s++)for(var u=r[s],c=0;c<o;c++)a[s+c]=this.field.add(a[s+c],this.field.multiply(u,i[c]));return new e(this.field,a)},e.prototype.negative=function(){for(var t=this.coefficients.length,r=new Int32Array(t),n=0;n<t;n++)r[n]=this.field.subtract(0,this.coefficients[n]);return new e(this.field,r)},e.prototype.multiplyScalar=function(t){if(0===t)return new e(this.field,new Int32Array([0]));if(1===t)return this;for(var r=this.coefficients.length,n=new Int32Array(r),i=0;i<r;i++)n[i]=this.field.multiply(this.coefficients[i],t);return new e(this.field,n)},e.prototype.multiplyByMonomial=function(t,r){if(t<0)throw new ws;if(0===r)return new e(this.field,new Int32Array([0]));for(var n=this.coefficients.length,i=new Int32Array(n+t),o=0;o<n;o++)i[o]=this.field.multiply(this.coefficients[o],r);return new e(this.field,i)},e.prototype.toString=function(){for(var e=new qs,t=this.getDegree();t>=0;t--){var r=this.getCoefficient(t);0!==r&&(r<0?(e.append(" - "),r=-r):e.length()>0&&e.append(" + "),0!==t&&1===r||e.append(r),0!==t&&(1===t?e.append("x"):(e.append("x^"),e.append(t))))}return e.toString()},e}(),Sd=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(0===e)throw new ws;return this.logTable[e]},e.prototype.inverse=function(e){if(0===e)throw new vu;return this.expTable[this.modulus-this.logTable[e]-1]},e.prototype.multiply=function(e,t){return 0===e||0===t?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}(),Id=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Td=function(e){function t(t,r){var n=e.call(this)||this;n.modulus=t,n.expTable=new Int32Array(t),n.logTable=new Int32Array(t);for(var i=1,o=0;o<t;o++)n.expTable[o]=i,i=i*r%t;for(o=0;o<t-1;o++)n.logTable[n.expTable[o]]=o;return n.zero=new xd(n,new Int32Array([0])),n.one=new xd(n,new Int32Array([1])),n}return Id(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 ws;if(0===t)return this.zero;var r=new Int32Array(e+1);return r[0]=t,new xd(this,r)},t.PDF417_GF=new t(wd.NUMBER_OF_CODEWORDS,3),t}(Sd),Md=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Dd=function(){function e(){this.field=Td.PDF417_GF}return e.prototype.decode=function(e,t,r){for(var n,i,o=new xd(this.field,e),a=new Int32Array(t),s=!1,u=t;u>0;u--){var c=o.evaluateAt(this.field.exp(u));a[t-u]=c,0!==c&&(s=!0)}if(!s)return 0;var l=this.field.getOne();if(null!=r)try{for(var d=Md(r),h=d.next();!h.done;h=d.next()){var f=h.value,p=this.field.exp(e.length-1-f),g=new xd(this.field,new Int32Array([this.field.subtract(0,p),1]));l=l.multiply(g)}}catch(e){n={error:e}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}var m=new xd(this.field,a),y=this.runEuclideanAlgorithm(this.field.buildMonomial(t,1),m,t),v=y[0],b=y[1],w=this.findErrorLocations(v),_=this.findErrorMagnitudes(b,v,w);for(u=0;u<w.length;u++){var A=e.length-1-this.field.log(w[u]);if(A<0)throw Es.getChecksumInstance();e[A]=this.field.subtract(e[A],_[u])}return w.length},e.prototype.runEuclideanAlgorithm=function(e,t,r){if(e.getDegree()<t.getDegree()){var n=e;e=t,t=n}for(var i=e,o=t,a=this.field.getZero(),s=this.field.getOne();o.getDegree()>=Math.round(r/2);){var u=i,c=a;if(a=s,(i=o).isZero())throw Es.getChecksumInstance();o=u;for(var l=this.field.getZero(),d=i.getCoefficient(i.getDegree()),h=this.field.inverse(d);o.getDegree()>=i.getDegree()&&!o.isZero();){var f=o.getDegree()-i.getDegree(),p=this.field.multiply(o.getCoefficient(o.getDegree()),h);l=l.add(this.field.buildMonomial(f,p)),o=o.subtract(i.multiplyByMonomial(f,p))}s=l.multiply(a).subtract(c).negative()}var g=s.getCoefficient(0);if(0===g)throw Es.getChecksumInstance();var m=this.field.inverse(g);return[s.multiply(m),o.multiply(m)]},e.prototype.findErrorLocations=function(e){for(var t=e.getDegree(),r=new Int32Array(t),n=0,i=1;i<this.field.getSize()&&n<t;i++)0===e.evaluateAt(i)&&(r[n]=this.field.inverse(i),n++);if(n!==t)throw Es.getChecksumInstance();return r},e.prototype.findErrorMagnitudes=function(e,t,r){for(var n=t.getDegree(),i=new Int32Array(n),o=1;o<=n;o++)i[n-o]=this.field.multiply(o,t.getCoefficient(o));var a=new xd(this.field,i),s=r.length,u=new Int32Array(s);for(o=0;o<s;o++){var c=this.field.inverse(r[o]),l=this.field.subtract(0,e.evaluateAt(c)),d=this.field.inverse(a.evaluateAt(c));u[o]=this.field.multiply(l,d)}return u},e}(),Rd=function(){function e(t,r,n,i,o){t instanceof e?this.constructor_2(t):this.constructor_1(t,r,n,i,o)}return e.prototype.constructor_1=function(e,t,r,n,i){var o=null==t||null==r,a=null==n||null==i;if(o&&a)throw new Xs;o?(t=new Mu(0,n.getY()),r=new Mu(0,i.getY())):a&&(n=new Mu(e.getWidth()-1,t.getY()),i=new Mu(e.getWidth()-1,r.getY())),this.image=e,this.topLeft=t,this.bottomLeft=r,this.topRight=n,this.bottomRight=i,this.minX=Math.trunc(Math.min(t.getX(),r.getX())),this.maxX=Math.trunc(Math.max(n.getX(),i.getX())),this.minY=Math.trunc(Math.min(t.getY(),n.getY())),this.maxY=Math.trunc(Math.max(r.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,r){return null==t?r:null==r?t:new e(t.image,t.topLeft,t.bottomLeft,r.topRight,r.bottomRight)},e.prototype.addMissingRows=function(t,r,n){var i=this.topLeft,o=this.bottomLeft,a=this.topRight,s=this.bottomRight;if(t>0){var u=n?this.topLeft:this.topRight,c=Math.trunc(u.getY()-t);c<0&&(c=0);var l=new Mu(u.getX(),c);n?i=l:a=l}if(r>0){var d=n?this.bottomLeft:this.bottomRight,h=Math.trunc(d.getY()+r);h>=this.image.getHeight()&&(h=this.image.getHeight()-1);var f=new Mu(d.getX(),h);n?o=f:s=f}return new e(this.image,i,o,a,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}(),Od=function(){function e(e,t,r,n){this.columnCount=e,this.errorCorrectionLevel=n,this.rowCountUpperPart=t,this.rowCountLowerPart=r,this.rowCount=t+r}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}(),kd=function(){function e(){this.buffer=""}return e.form=function(e,t){var r=-1;return e.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,function(e,n,i,o,a,s){if("%%"===e)return"%";if(void 0!==t[++r]){e=o?parseInt(o.substr(1)):void 0;var u,c=a?parseInt(a.substr(1)):void 0;switch(s){case"s":u=t[r];break;case"c":u=t[r][0];break;case"f":u=parseFloat(t[r]).toFixed(e);break;case"p":u=parseFloat(t[r]).toPrecision(e);break;case"e":u=parseFloat(t[r]).toExponential(e);break;case"x":u=parseInt(t[r]).toString(c||16);break;case"d":u=parseFloat(parseInt(t[r],c||10).toPrecision(e)).toFixed(0)}u="object"==typeof u?JSON.stringify(u):(+u).toString(c);for(var l=parseInt(i),d=i&&i[0]+""=="0"?"0":" ";u.length<l;)u=void 0!==n?u+d:d+u;return u}})},e.prototype.format=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.buffer+=e.form(t,r)},e.prototype.toString=function(){return this.buffer},e}(),Nd=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Pd=function(){function e(e){this.boundingBox=new Rd(e),this.codewords=new Array(e.getMaxY()-e.getMinY()+1)}return e.prototype.getCodewordNearby=function(t){var r=this.getCodeword(t);if(null!=r)return r;for(var n=1;n<e.MAX_NEARBY_DISTANCE;n++){var i=this.imageRowToCodewordIndex(t)-n;if(i>=0&&null!=(r=this.codewords[i]))return r;if((i=this.imageRowToCodewordIndex(t)+n)<this.codewords.length&&null!=(r=this.codewords[i]))return r}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,r=new kd,n=0;try{for(var i=Nd(this.codewords),o=i.next();!o.done;o=i.next()){var a=o.value;null!=a?r.format("%3d: %3d|%3d%n",n++,a.getRowNumber(),a.getValue()):r.format("%3d: | %n",n++)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return r.toString()},e.MAX_NEARBY_DISTANCE=5,e}(),Bd=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Fd=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a},Ld=function(){function e(){this.values=new Map}return e.prototype.setValue=function(e){e=Math.trunc(e);var t=this.values.get(e);null==t&&(t=0),t++,this.values.set(e,t)},e.prototype.getValue=function(){var e,t,r=-1,n=new Array,i=function(e,t){var i=function(){return e},o=function(){return t};o()>r?(r=o(),(n=[]).push(i())):o()===r&&n.push(i())};try{for(var o=Bd(this.values.entries()),a=o.next();!a.done;a=o.next()){var s=Fd(a.value,2);i(s[0],s[1])}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}return wd.toIntArray(n)},e.prototype.getConfidence=function(e){return this.values.get(e)},e}(),zd=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ud=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},jd=function(e){function t(t,r){var n=e.call(this,t)||this;return n._isLeft=r,n}return zd(t,e),t.prototype.setRowNumbers=function(){var e,t;try{for(var r=Ud(this.getCodewords()),n=r.next();!n.done;n=r.next()){var i=n.value;null!=i&&i.setRowNumberAsRowIndicatorColumn()}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},t.prototype.adjustCompleteIndicatorColumnRowNumbers=function(e){var t=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(t,e);for(var r=this.getBoundingBox(),n=this._isLeft?r.getTopLeft():r.getTopRight(),i=this._isLeft?r.getBottomLeft():r.getBottomRight(),o=this.imageRowToCodewordIndex(Math.trunc(n.getY())),a=this.imageRowToCodewordIndex(Math.trunc(i.getY())),s=-1,u=1,c=0,l=o;l<a;l++)if(null!=t[l]){var d=t[l],h=d.getRowNumber()-s;if(0===h)c++;else if(1===h)u=Math.max(u,c),c=1,s=d.getRowNumber();else if(h<0||d.getRowNumber()>=e.getRowCount()||h>l)t[l]=null;else{for(var f=void 0,p=(f=u>2?(u-2)*h:h)>=l,g=1;g<=f&&!p;g++)p=null!=t[l-g];p?t[l]=null:(s=d.getRowNumber(),c=1)}}},t.prototype.getRowHeights=function(){var e,t,r=this.getBarcodeMetadata();if(null==r)return null;this.adjustIncompleteIndicatorColumnRowNumbers(r);var n=new Int32Array(r.getRowCount());try{for(var i=Ud(this.getCodewords()),o=i.next();!o.done;o=i.next()){var a=o.value;if(null!=a){var s=a.getRowNumber();if(s>=n.length)continue;n[s]++}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return n},t.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(e){for(var t=this.getBoundingBox(),r=this._isLeft?t.getTopLeft():t.getTopRight(),n=this._isLeft?t.getBottomLeft():t.getBottomRight(),i=this.imageRowToCodewordIndex(Math.trunc(r.getY())),o=this.imageRowToCodewordIndex(Math.trunc(n.getY())),a=this.getCodewords(),s=-1,u=i;u<o;u++)if(null!=a[u]){var c=a[u];c.setRowNumberAsRowIndicatorColumn();var l=c.getRowNumber()-s;0===l||(1===l?s=c.getRowNumber():c.getRowNumber()>=e.getRowCount()?a[u]=null:s=c.getRowNumber())}},t.prototype.getBarcodeMetadata=function(){var e,t,r=this.getCodewords(),n=new Ld,i=new Ld,o=new Ld,a=new Ld;try{for(var s=Ud(r),u=s.next();!u.done;u=s.next()){var c=u.value;if(null!=c){c.setRowNumberAsRowIndicatorColumn();var l=c.getValue()%30,d=c.getRowNumber();switch(this._isLeft||(d+=2),d%3){case 0:i.setValue(3*l+1);break;case 1:a.setValue(l/3),o.setValue(l%3);break;case 2:n.setValue(l+1)}}}}catch(t){e={error:t}}finally{try{u&&!u.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}if(0===n.getValue().length||0===i.getValue().length||0===o.getValue().length||0===a.getValue().length||n.getValue()[0]<1||i.getValue()[0]+o.getValue()[0]<wd.MIN_ROWS_IN_BARCODE||i.getValue()[0]+o.getValue()[0]>wd.MAX_ROWS_IN_BARCODE)return null;var h=new Od(n.getValue()[0],i.getValue()[0],o.getValue()[0],a.getValue()[0]);return this.removeIncorrectCodewords(r,h),h},t.prototype.removeIncorrectCodewords=function(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(null!=e[r]){var i=n.getValue()%30,o=n.getRowNumber();if(o>t.getRowCount())e[r]=null;else switch(this._isLeft||(o+=2),o%3){case 0:3*i+1!==t.getRowCountUpperPart()&&(e[r]=null);break;case 1:Math.trunc(i/3)===t.getErrorCorrectionLevel()&&i%3===t.getRowCountLowerPart()||(e[r]=null);break;case 2:i+1!==t.getColumnCount()&&(e[r]=null)}}}},t.prototype.isLeft=function(){return this._isLeft},t.prototype.toString=function(){return"IsLeft: "+this._isLeft+"\n"+e.prototype.toString.call(this)},t}(Pd),Vd=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Hd=function(){function e(e,t){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=e,this.barcodeColumnCount=e.getColumnCount(),this.boundingBox=t,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}return e.prototype.getDetectionResultColumns=function(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);var e,t=wd.MAX_CODEWORDS_IN_BARCODE;do{e=t,t=this.adjustRowNumbersAndGetCount()}while(t>0&&t<e);return this.detectionResultColumns},e.prototype.adjustIndicatorColumnRowNumbers=function(e){null!=e&&e.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)},e.prototype.adjustRowNumbersAndGetCount=function(){var e=this.adjustRowNumbersByRow();if(0===e)return 0;for(var t=1;t<this.barcodeColumnCount+1;t++)for(var r=this.detectionResultColumns[t].getCodewords(),n=0;n<r.length;n++)null!=r[n]&&(r[n].hasValidRowNumber()||this.adjustRowNumbers(t,n,r));return e},e.prototype.adjustRowNumbersByRow=function(){return this.adjustRowNumbersFromBothRI(),this.adjustRowNumbersFromLRI()+this.adjustRowNumbersFromRRI()},e.prototype.adjustRowNumbersFromBothRI=function(){if(null!=this.detectionResultColumns[0]&&null!=this.detectionResultColumns[this.barcodeColumnCount+1])for(var e=this.detectionResultColumns[0].getCodewords(),t=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),r=0;r<e.length;r++)if(null!=e[r]&&null!=t[r]&&e[r].getRowNumber()===t[r].getRowNumber())for(var n=1;n<=this.barcodeColumnCount;n++){var i=this.detectionResultColumns[n].getCodewords()[r];null!=i&&(i.setRowNumber(e[r].getRowNumber()),i.hasValidRowNumber()||(this.detectionResultColumns[n].getCodewords()[r]=null))}},e.prototype.adjustRowNumbersFromRRI=function(){if(null==this.detectionResultColumns[this.barcodeColumnCount+1])return 0;for(var t=0,r=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),n=0;n<r.length;n++)if(null!=r[n])for(var i=r[n].getRowNumber(),o=0,a=this.barcodeColumnCount+1;a>0&&o<this.ADJUST_ROW_NUMBER_SKIP;a--){var s=this.detectionResultColumns[a].getCodewords()[n];null!=s&&(o=e.adjustRowNumberIfValid(i,o,s),s.hasValidRowNumber()||t++)}return t},e.prototype.adjustRowNumbersFromLRI=function(){if(null==this.detectionResultColumns[0])return 0;for(var t=0,r=this.detectionResultColumns[0].getCodewords(),n=0;n<r.length;n++)if(null!=r[n])for(var i=r[n].getRowNumber(),o=0,a=1;a<this.barcodeColumnCount+1&&o<this.ADJUST_ROW_NUMBER_SKIP;a++){var s=this.detectionResultColumns[a].getCodewords()[n];null!=s&&(o=e.adjustRowNumberIfValid(i,o,s),s.hasValidRowNumber()||t++)}return t},e.adjustRowNumberIfValid=function(e,t,r){return null==r||r.hasValidRowNumber()||(r.isValidRowNumber(e)?(r.setRowNumber(e),t=0):++t),t},e.prototype.adjustRowNumbers=function(t,r,n){var i,o;if(null!=this.detectionResultColumns[t-1]){var a=n[r],s=this.detectionResultColumns[t-1].getCodewords(),u=s;null!=this.detectionResultColumns[t+1]&&(u=this.detectionResultColumns[t+1].getCodewords());var c=new Array(14);c[2]=s[r],c[3]=u[r],r>0&&(c[0]=n[r-1],c[4]=s[r-1],c[5]=u[r-1]),r>1&&(c[8]=n[r-2],c[10]=s[r-2],c[11]=u[r-2]),r<n.length-1&&(c[1]=n[r+1],c[6]=s[r+1],c[7]=u[r+1]),r<n.length-2&&(c[9]=n[r+2],c[12]=s[r+2],c[13]=u[r+2]);try{for(var l=Vd(c),d=l.next();!d.done;d=l.next()){var h=d.value;if(e.adjustRowNumber(a,h))return}}catch(e){i={error:e}}finally{try{d&&!d.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}}},e.adjustRowNumber=function(e,t){return null!=t&&(!(!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];null==e&&(e=this.detectionResultColumns[this.barcodeColumnCount+1]);for(var t=new kd,r=0;r<e.getCodewords().length;r++){t.format("CW %3d:",r);for(var n=0;n<this.barcodeColumnCount+2;n++)if(null!=this.detectionResultColumns[n]){var i=this.detectionResultColumns[n].getCodewords()[r];null!=i?t.format(" %3d|%3d",i.getRowNumber(),i.getValue()):t.format(" | ")}else t.format(" | ");t.format("%n")}return t.toString()},e}(),Gd=function(){function e(t,r,n,i){this.rowNumber=e.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(t),this.endX=Math.trunc(r),this.bucket=Math.trunc(n),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}(),qd=function(){function e(){}return e.initialize=function(){for(var t=0;t<wd.SYMBOL_TABLE.length;t++)for(var r=wd.SYMBOL_TABLE[t],n=1&r,i=0;i<wd.BARS_IN_MODULE;i++){for(var o=0;(1&r)===n;)o+=1,r>>=1;n=1&r,e.RATIOS_TABLE[t]||(e.RATIOS_TABLE[t]=new Array(wd.BARS_IN_MODULE)),e.RATIOS_TABLE[t][wd.BARS_IN_MODULE-i-1]=Math.fround(o/wd.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},e.getDecodedValue=function(t){var r=e.getDecodedCodewordValue(e.sampleBitCounts(t));return-1!==r?r:e.getClosestDecodedValue(t)},e.sampleBitCounts=function(e){for(var t=Iu.sum(e),r=new Int32Array(wd.BARS_IN_MODULE),n=0,i=0,o=0;o<wd.MODULES_IN_CODEWORD;o++){var a=t/(2*wd.MODULES_IN_CODEWORD)+o*t/wd.MODULES_IN_CODEWORD;i+e[n]<=a&&(i+=e[n],n++),r[n]++}return r},e.getDecodedCodewordValue=function(t){var r=e.getBitValue(t);return-1===wd.getCodeword(r)?-1:r},e.getBitValue=function(e){for(var t=0,r=0;r<e.length;r++)for(var n=0;n<e[r];n++)t=t<<1|(r%2==0?1:0);return Math.trunc(t)},e.getClosestDecodedValue=function(t){var r=Iu.sum(t),n=new Array(wd.BARS_IN_MODULE);if(r>1)for(var i=0;i<n.length;i++)n[i]=Math.fround(t[i]/r);var o=Tu.MAX_VALUE,a=-1;this.bSymbolTableReady||e.initialize();for(var s=0;s<e.RATIOS_TABLE.length;s++){for(var u=0,c=e.RATIOS_TABLE[s],l=0;l<wd.BARS_IN_MODULE;l++){var d=Math.fround(c[l]-n[l]);if((u+=Math.fround(d*d))>=o)break}u<o&&(o=u,a=wd.SYMBOL_TABLE[s])}return a},e.bSymbolTableReady=!1,e.RATIOS_TABLE=new Array(wd.SYMBOL_TABLE.length).map(function(e){return new Array(wd.BARS_IN_MODULE)}),e}(),Wd=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}(),Kd=function(){function e(){}return e.parseLong=function(e,t){return void 0===t&&(t=void 0),parseInt(e,t)},e}(),Xd=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Yd=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Xd(t,e),t.kind="NullPointerException",t}(ms),Zd=function(){function e(){}return e.prototype.writeBytes=function(e){this.writeBytesOffset(e,0,e.length)},e.prototype.writeBytesOffset=function(e,t,r){if(null==e)throw new Yd;if(t<0||t>e.length||r<0||t+r>e.length||t+r<0)throw new Is;if(0!==r)for(var n=0;n<r;n++)this.write(e[t+n])},e.prototype.flush=function(){},e.prototype.close=function(){},e}(),Jd=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Jd(t,e),t}(ms),Qd=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),eh=function(e){function t(t){void 0===t&&(t=32);var r=e.call(this)||this;if(r.count=0,t<0)throw new ws("Negative initial size: "+t);return r.buf=new Uint8Array(t),r}return Qd(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 $d;t=Os.MAX_VALUE}this.buf=Rs.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,r){if(t<0||t>e.length||r<0||t+r-e.length>0)throw new Is;this.ensureCapacity(this.count+r),xs.arraycopy(e,t,this.buf,this.count,r),this.count+=r},t.prototype.writeTo=function(e){e.writeBytesOffset(this.buf,0,this.count)},t.prototype.reset=function(){this.count=0},t.prototype.toByteArray=function(){return Rs.copyOfUint8Array(this.buf,this.count)},t.prototype.size=function(){return this.count},t.prototype.toString=function(e){return e?"string"==typeof e?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}(Zd);function th(){if("undefined"!=typeof window)return window.BigInt||null;if(void 0!==So)return So.BigInt||null;if("undefined"!=typeof self)return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}function rh(e){if(void 0===rd&&(rd=th()),null===rd)throw new Error("BigInt is not supported!");return rd(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"}(td||(td={}));var nh=function(){function e(){}return e.decode=function(t,r){var n=new qs(""),i=Us.ISO8859_1;n.enableDecoding(i);for(var o=1,a=t[o++],s=new Wd;o<t[0];){switch(a){case e.TEXT_COMPACTION_MODE_LATCH:o=e.textCompaction(t,o,n);break;case e.BYTE_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH_6:o=e.byteCompaction(a,t,i,o,n);break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:n.append(t[o++]);break;case e.NUMERIC_COMPACTION_MODE_LATCH:o=e.numericCompaction(t,o,n);break;case e.ECI_CHARSET:Us.getCharacterSetECIByValue(t[o++]);break;case e.ECI_GENERAL_PURPOSE:o+=2;break;case e.ECI_USER_DEFINED:o++;break;case e.BEGIN_MACRO_PDF417_CONTROL_BLOCK:o=e.decodeMacroBlock(t,o,s);break;case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case e.MACRO_PDF417_TERMINATOR:throw new Fs;default:o--,o=e.textCompaction(t,o,n)}if(!(o<t.length))throw Fs.getFormatInstance();a=t[o++]}if(0===n.length())throw Fs.getFormatInstance();var u=new pu(null,n.toString(),null,r);return u.setOther(s),u},e.decodeMacroBlock=function(t,r,n){if(r+e.NUMBER_OF_SEQUENCE_CODEWORDS>t[0])throw Fs.getFormatInstance();for(var i=new Int32Array(e.NUMBER_OF_SEQUENCE_CODEWORDS),o=0;o<e.NUMBER_OF_SEQUENCE_CODEWORDS;o++,r++)i[o]=t[r];n.setSegmentIndex(Os.parseInt(e.decodeBase900toBase10(i,e.NUMBER_OF_SEQUENCE_CODEWORDS)));var a=new qs;r=e.textCompaction(t,r,a),n.setFileId(a.toString());var s=-1;for(t[r]===e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(s=r+1);r<t[0];)switch(t[r]){case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(t[++r]){case e.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:var u=new qs;r=e.textCompaction(t,r+1,u),n.setFileName(u.toString());break;case e.MACRO_PDF417_OPTIONAL_FIELD_SENDER:var c=new qs;r=e.textCompaction(t,r+1,c),n.setSender(c.toString());break;case e.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:var l=new qs;r=e.textCompaction(t,r+1,l),n.setAddressee(l.toString());break;case e.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:var d=new qs;r=e.numericCompaction(t,r+1,d),n.setSegmentCount(Os.parseInt(d.toString()));break;case e.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:var h=new qs;r=e.numericCompaction(t,r+1,h),n.setTimestamp(Kd.parseLong(h.toString()));break;case e.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:var f=new qs;r=e.numericCompaction(t,r+1,f),n.setChecksum(Os.parseInt(f.toString()));break;case e.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:var p=new qs;r=e.numericCompaction(t,r+1,p),n.setFileSize(Kd.parseLong(p.toString()));break;default:throw Fs.getFormatInstance()}break;case e.MACRO_PDF417_TERMINATOR:r++,n.setLastSegment(!0);break;default:throw Fs.getFormatInstance()}if(-1!==s){var g=r-s;n.isLastSegment()&&g--,n.setOptionalData(Rs.copyOfRange(t,s,s+g))}return r},e.textCompaction=function(t,r,n){for(var i=new Int32Array(2*(t[0]-r)),o=new Int32Array(2*(t[0]-r)),a=0,s=!1;r<t[0]&&!s;){var u=t[r++];if(u<e.TEXT_COMPACTION_MODE_LATCH)i[a]=u/30,i[a+1]=u%30,a+=2;else switch(u){case e.TEXT_COMPACTION_MODE_LATCH:i[a++]=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:r--,s=!0;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i[a]=e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,u=t[r++],o[a]=u,a++}}return e.decodeTextCompaction(i,o,a,n),r},e.decodeTextCompaction=function(t,r,n,i){for(var o=td.ALPHA,a=td.ALPHA,s=0;s<n;){var u=t[s],c="";switch(o){case td.ALPHA:if(u<26)c=String.fromCharCode(65+u);else switch(u){case 26:c=" ";break;case e.LL:o=td.LOWER;break;case e.ML:o=td.MIXED;break;case e.PS:a=o,o=td.PUNCT_SHIFT;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(r[s]);break;case e.TEXT_COMPACTION_MODE_LATCH:o=td.ALPHA}break;case td.LOWER:if(u<26)c=String.fromCharCode(97+u);else switch(u){case 26:c=" ";break;case e.AS:a=o,o=td.ALPHA_SHIFT;break;case e.ML:o=td.MIXED;break;case e.PS:a=o,o=td.PUNCT_SHIFT;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(r[s]);break;case e.TEXT_COMPACTION_MODE_LATCH:o=td.ALPHA}break;case td.MIXED:if(u<e.PL)c=e.MIXED_CHARS[u];else switch(u){case e.PL:o=td.PUNCT;break;case 26:c=" ";break;case e.LL:o=td.LOWER;break;case e.AL:o=td.ALPHA;break;case e.PS:a=o,o=td.PUNCT_SHIFT;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(r[s]);break;case e.TEXT_COMPACTION_MODE_LATCH:o=td.ALPHA}break;case td.PUNCT:if(u<e.PAL)c=e.PUNCT_CHARS[u];else switch(u){case e.PAL:o=td.ALPHA;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(r[s]);break;case e.TEXT_COMPACTION_MODE_LATCH:o=td.ALPHA}break;case td.ALPHA_SHIFT:if(o=a,u<26)c=String.fromCharCode(65+u);else switch(u){case 26:c=" ";break;case e.TEXT_COMPACTION_MODE_LATCH:o=td.ALPHA}break;case td.PUNCT_SHIFT:if(o=a,u<e.PAL)c=e.PUNCT_CHARS[u];else switch(u){case e.PAL:o=td.ALPHA;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(r[s]);break;case e.TEXT_COMPACTION_MODE_LATCH:o=td.ALPHA}}""!==c&&i.append(c),s++}},e.byteCompaction=function(t,r,n,i,o){var a=new eh,s=0,u=0,c=!1;switch(t){case e.BYTE_COMPACTION_MODE_LATCH:for(var l=new Int32Array(6),d=r[i++];i<r[0]&&!c;)switch(l[s++]=d,u=900*u+d,d=r[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--,c=!0;break;default:if(s%5==0&&s>0){for(var h=0;h<6;++h)a.write(Number(rh(u)>>rh(8*(5-h))));u=0,s=0}}i===r[0]&&d<e.TEXT_COMPACTION_MODE_LATCH&&(l[s++]=d);for(var f=0;f<s;f++)a.write(l[f]);break;case e.BYTE_COMPACTION_MODE_LATCH_6:for(;i<r[0]&&!c;){var p=r[i++];if(p<e.TEXT_COMPACTION_MODE_LATCH)s++,u=900*u+p;else switch(p){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--,c=!0}if(s%5==0&&s>0){for(h=0;h<6;++h)a.write(Number(rh(u)>>rh(8*(5-h))));u=0,s=0}}}return o.append(Hs.decode(a.toByteArray(),n)),i},e.numericCompaction=function(t,r,n){for(var i=0,o=!1,a=new Int32Array(e.MAX_NUMERIC_CODEWORDS);r<t[0]&&!o;){var s=t[r++];if(r===t[0]&&(o=!0),s<e.TEXT_COMPACTION_MODE_LATCH)a[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:r--,o=!0}(i%e.MAX_NUMERIC_CODEWORDS===0||s===e.NUMERIC_COMPACTION_MODE_LATCH||o)&&i>0&&(n.append(e.decodeBase900toBase10(a,i)),i=0)}return r},e.decodeBase900toBase10=function(t,r){for(var n=rh(0),i=0;i<r;i++)n+=e.EXP900[r-i-1]*rh(t[i]);var o=n.toString();if("1"!==o.charAt(0))throw new Fs;return o.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\t,:\n-.$/\"|*()?{}'",e.MIXED_CHARS="0123456789&\r\t,:#-.$/+%*=^",e.EXP900=th()?function(){var e=[];e[0]=rh(1);var t=rh(900);e[1]=t;for(var r=2;r<16;r++)e[r]=e[r-1]*t;return e}():[],e.NUMBER_OF_SEQUENCE_CODEWORDS=2,e}(),ih=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},oh=function(){function e(){}return e.decode=function(t,r,n,i,o,a,s){for(var u,c=new Rd(t,r,n,i,o),l=null,d=null,h=!0;;h=!1){if(null!=r&&(l=e.getRowIndicatorColumn(t,c,r,!0,a,s)),null!=i&&(d=e.getRowIndicatorColumn(t,c,i,!1,a,s)),null==(u=e.merge(l,d)))throw Xs.getNotFoundInstance();var f=u.getBoundingBox();if(!h||null==f||!(f.getMinY()<c.getMinY()||f.getMaxY()>c.getMaxY()))break;c=f}u.setBoundingBox(c);var p=u.getBarcodeColumnCount()+1;u.setDetectionResultColumn(0,l),u.setDetectionResultColumn(p,d);for(var g=null!=l,m=1;m<=p;m++){var y=g?m:p-m;if(void 0===u.getDetectionResultColumn(y)){var v=void 0;v=0===y||y===p?new jd(c,0===y):new Pd(c),u.setDetectionResultColumn(y,v);for(var b=-1,w=b,_=c.getMinY();_<=c.getMaxY();_++){if((b=e.getStartColumn(u,y,_,g))<0||b>c.getMaxX()){if(-1===w)continue;b=w}var A=e.detectCodeword(t,c.getMinX(),c.getMaxX(),g,b,_,a,s);null!=A&&(v.setCodeword(_,A),w=b,a=Math.min(a,A.getWidth()),s=Math.max(s,A.getWidth()))}}}return e.createDecoderResult(u)},e.merge=function(t,r){if(null==t&&null==r)return null;var n=e.getBarcodeMetadata(t,r);if(null==n)return null;var i=Rd.merge(e.adjustBoundingBox(t),e.adjustBoundingBox(r));return new Hd(n,i)},e.adjustBoundingBox=function(t){var r,n;if(null==t)return null;var i=t.getRowHeights();if(null==i)return null;var o=e.getMax(i),a=0;try{for(var s=ih(i),u=s.next();!u.done;u=s.next()){var c=u.value;if(a+=o-c,c>0)break}}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}for(var l=t.getCodewords(),d=0;a>0&&null==l[d];d++)a--;var h=0;for(d=i.length-1;d>=0&&(h+=o-i[d],!(i[d]>0));d--);for(d=l.length-1;h>0&&null==l[d];d--)h--;return t.getBoundingBox().addMissingRows(a,h,t.isLeft())},e.getMax=function(e){var t,r,n=-1;try{for(var i=ih(e),o=i.next();!o.done;o=i.next()){var a=o.value;n=Math.max(n,a)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n},e.getBarcodeMetadata=function(e,t){var r,n;return null==e||null==(r=e.getBarcodeMetadata())?null==t?null:t.getBarcodeMetadata():null==t||null==(n=t.getBarcodeMetadata())?r:r.getColumnCount()!==n.getColumnCount()&&r.getErrorCorrectionLevel()!==n.getErrorCorrectionLevel()&&r.getRowCount()!==n.getRowCount()?null:r},e.getRowIndicatorColumn=function(t,r,n,i,o,a){for(var s=new jd(r,i),u=0;u<2;u++)for(var c=0===u?1:-1,l=Math.trunc(Math.trunc(n.getX())),d=Math.trunc(Math.trunc(n.getY()));d<=r.getMaxY()&&d>=r.getMinY();d+=c){var h=e.detectCodeword(t,0,t.getWidth(),i,l,d,o,a);null!=h&&(s.setCodeword(d,h),l=i?h.getStartX():h.getEndX())}return s},e.adjustCodewordCount=function(t,r){var n=r[0][1],i=n.getValue(),o=t.getBarcodeColumnCount()*t.getBarcodeRowCount()-e.getNumberOfECCodeWords(t.getBarcodeECLevel());if(0===i.length){if(o<1||o>wd.MAX_CODEWORDS_IN_BARCODE)throw Xs.getNotFoundInstance();n.setValue(o)}else i[0]!==o&&n.setValue(o)},e.createDecoderResult=function(t){var r=e.createBarcodeMatrix(t);e.adjustCodewordCount(t,r);for(var n=new Array,i=new Int32Array(t.getBarcodeRowCount()*t.getBarcodeColumnCount()),o=[],a=new Array,s=0;s<t.getBarcodeRowCount();s++)for(var u=0;u<t.getBarcodeColumnCount();u++){var c=r[s][u+1].getValue(),l=s*t.getBarcodeColumnCount()+u;0===c.length?n.push(l):1===c.length?i[l]=c[0]:(a.push(l),o.push(c))}for(var d=new Array(o.length),h=0;h<d.length;h++)d[h]=o[h];return e.createDecoderResultFromAmbiguousValues(t.getBarcodeECLevel(),i,wd.toIntArray(n),wd.toIntArray(a),d)},e.createDecoderResultFromAmbiguousValues=function(t,r,n,i,o){for(var a=new Int32Array(i.length),s=100;s-- >0;){for(var u=0;u<a.length;u++)r[i[u]]=o[u][a[u]];try{return e.decodeCodewords(r,t,n)}catch(e){if(!(e instanceof Es))throw e}if(0===a.length)throw Es.getChecksumInstance();for(u=0;u<a.length;u++){if(a[u]<o[u].length-1){a[u]++;break}if(a[u]=0,u===a.length-1)throw Es.getChecksumInstance()}}throw Es.getChecksumInstance()},e.createBarcodeMatrix=function(e){for(var t,r,n,i,o=Array.from({length:e.getBarcodeRowCount()},function(){return new Array(e.getBarcodeColumnCount()+2)}),a=0;a<o.length;a++)for(var s=0;s<o[a].length;s++)o[a][s]=new Ld;var u=0;try{for(var c=ih(e.getDetectionResultColumns()),l=c.next();!l.done;l=c.next()){var d=l.value;if(null!=d)try{for(var h=(n=void 0,ih(d.getCodewords())),f=h.next();!f.done;f=h.next()){var p=f.value;if(null!=p){var g=p.getRowNumber();if(g>=0){if(g>=o.length)continue;o[g][u].setValue(p.getValue())}}}}catch(e){n={error:e}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}u++}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}return o},e.isValidBarcodeColumn=function(e,t){return t>=0&&t<=e.getBarcodeColumnCount()+1},e.getStartColumn=function(t,r,n,i){var o,a,s=i?1:-1,u=null;if(e.isValidBarcodeColumn(t,r-s)&&(u=t.getDetectionResultColumn(r-s).getCodeword(n)),null!=u)return i?u.getEndX():u.getStartX();if(null!=(u=t.getDetectionResultColumn(r).getCodewordNearby(n)))return i?u.getStartX():u.getEndX();if(e.isValidBarcodeColumn(t,r-s)&&(u=t.getDetectionResultColumn(r-s).getCodewordNearby(n)),null!=u)return i?u.getEndX():u.getStartX();for(var c=0;e.isValidBarcodeColumn(t,r-s);){r-=s;try{for(var l=(o=void 0,ih(t.getDetectionResultColumn(r).getCodewords())),d=l.next();!d.done;d=l.next()){var h=d.value;if(null!=h)return(i?h.getEndX():h.getStartX())+s*c*(h.getEndX()-h.getStartX())}}catch(e){o={error:e}}finally{try{d&&!d.done&&(a=l.return)&&a.call(l)}finally{if(o)throw o.error}}c++}return i?t.getBoundingBox().getMinX():t.getBoundingBox().getMaxX()},e.detectCodeword=function(t,r,n,i,o,a,s,u){o=e.adjustCodewordStartColumn(t,r,n,i,o,a);var c,l=e.getModuleBitCount(t,r,n,i,o,a);if(null==l)return null;var d=Iu.sum(l);if(i)c=o+d;else{for(var h=0;h<l.length/2;h++){var f=l[h];l[h]=l[l.length-1-h],l[l.length-1-h]=f}o=(c=o)-d}if(!e.checkCodewordSkew(d,s,u))return null;var p=qd.getDecodedValue(l),g=wd.getCodeword(p);return-1===g?null:new Gd(o,c,e.getCodewordBucketNumber(p),g)},e.getModuleBitCount=function(e,t,r,n,i,o){for(var a=i,s=new Int32Array(8),u=0,c=n?1:-1,l=n;(n?a<r:a>=t)&&u<s.length;)e.get(a,o)===l?(s[u]++,a+=c):(u++,l=!l);return u===s.length||a===(n?r:t)&&u===s.length-1?s:null},e.getNumberOfECCodeWords=function(e){return 2<<e},e.adjustCodewordStartColumn=function(t,r,n,i,o,a){for(var s=o,u=i?-1:1,c=0;c<2;c++){for(;(i?s>=r:s<n)&&i===t.get(s,a);){if(Math.abs(o-s)>e.CODEWORD_SKEW_SIZE)return o;s+=u}u=-u,i=!i}return s},e.checkCodewordSkew=function(t,r,n){return r-e.CODEWORD_SKEW_SIZE<=t&&t<=n+e.CODEWORD_SKEW_SIZE},e.decodeCodewords=function(t,r,n){if(0===t.length)throw Fs.getFormatInstance();var i=1<<r+1,o=e.correctErrors(t,n,i);e.verifyCodewordCount(t,i);var a=nh.decode(t,""+r);return a.setErrorsCorrected(o),a.setErasures(n.length),a},e.correctErrors=function(t,r,n){if(null!=r&&r.length>n/2+e.MAX_ERRORS||n<0||n>e.MAX_EC_CODEWORDS)throw Es.getChecksumInstance();return e.errorCorrection.decode(t,n,r)},e.verifyCodewordCount=function(e,t){if(e.length<4)throw Fs.getFormatInstance();var r=e[0];if(r>e.length)throw Fs.getFormatInstance();if(0===r){if(!(t<e.length))throw Fs.getFormatInstance();e[0]=e.length-t}},e.getBitCountForCodeword=function(e){for(var t=new Int32Array(8),r=0,n=t.length-1;!((1&e)!==r&&(r=1&e,--n<0));)t[n]++,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 kd,r=0;r<e.length;r++){t.format("Row %2d: ",r);for(var n=0;n<e[r].length;n++){var i=e[r][n];0===i.getValue().length?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 Dd,e}(),ah=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},sh=function(){function e(){}return e.prototype.decode=function(t,r){void 0===r&&(r=null);var n=e.decode(t,r,!1);if(null==n||0===n.length||null==n[0])throw Xs.getNotFoundInstance();return n[0]},e.prototype.decodeMultiple=function(t,r){void 0===r&&(r=null);try{return e.decode(t,r,!0)}catch(e){if(e instanceof Fs||e instanceof Es)throw Xs.getNotFoundInstance();throw e}},e.decode=function(t,r,n){var i,o,a=new Array,s=Ed.detectMultiple(t,r,n);try{for(var u=ah(s.getPoints()),c=u.next();!c.done;c=u.next()){var l=c.value,d=oh.decode(s.getBits(),l[4],l[5],l[6],l[7],e.getMinCodewordWidth(l),e.getMaxCodewordWidth(l)),h=new cu(d.getText(),d.getRawBytes(),void 0,l,du.PDF_417);h.putMetadata(fu.ERROR_CORRECTION_LEVEL,d.getECLevel());var f=d.getOther();null!=f&&h.putMetadata(fu.PDF417_EXTRA_METADATA,f),a.push(h)}}catch(e){i={error:e}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}return a.map(function(e){return e})},e.getMaxWidth=function(e,t){return null==e||null==t?0:Math.trunc(Math.abs(e.getX()-t.getX()))},e.getMinWidth=function(e,t){return null==e||null==t?Os.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])*wd.MODULES_IN_CODEWORD/wd.MODULES_IN_STOP_PATTERN),Math.max(e.getMaxWidth(t[1],t[5]),e.getMaxWidth(t[7],t[3])*wd.MODULES_IN_CODEWORD/wd.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])*wd.MODULES_IN_CODEWORD/wd.MODULES_IN_STOP_PATTERN),Math.min(e.getMinWidth(t[1],t[5]),e.getMinWidth(t[7],t[3])*wd.MODULES_IN_CODEWORD/wd.MODULES_IN_STOP_PATTERN)))},e.prototype.reset=function(){},e}(),uh=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ch=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return uh(t,e),t.kind="ReaderException",t}(ms),lh=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},dh=function(){function e(){}return e.prototype.decode=function(e,t){return this.setHints(t),this.decodeInternal(e)},e.prototype.decodeWithState=function(e){return null!==this.readers&&void 0!==this.readers||this.setHints(null),this.decodeInternal(e)},e.prototype.setHints=function(e){this.hints=e;var t=null!=e&&void 0!==e.get(Ps.TRY_HARDER),r=null==e?null:e.get(Ps.POSSIBLE_FORMATS),n=new Array;if(null!=r){var i=r.some(function(e){return e===du.UPC_A||e===du.UPC_E||e===du.EAN_13||e===du.EAN_8||e===du.CODABAR||e===du.CODE_39||e===du.CODE_93||e===du.CODE_128||e===du.ITF||e===du.RSS_14||e===du.RSS_EXPANDED});i&&!t&&n.push(new El(e)),r.includes(du.QR_CODE)&&n.push(new vd),r.includes(du.DATA_MATRIX)&&n.push(new zl),r.includes(du.AZTEC)&&n.push(new ju),r.includes(du.PDF_417)&&n.push(new sh),i&&t&&n.push(new El(e))}0===n.length&&(t||n.push(new El(e)),n.push(new vd),n.push(new zl),n.push(new ju),n.push(new sh),t&&n.push(new El(e))),this.readers=n},e.prototype.reset=function(){var e,t;if(null!==this.readers)try{for(var r=lh(this.readers),n=r.next();!n.done;n=r.next()){n.value.reset()}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},e.prototype.decodeInternal=function(e){var t,r;if(null===this.readers)throw new ch("No readers where selected, nothing can be read.");try{for(var n=lh(this.readers),i=n.next();!i.done;i=n.next()){var o=i.value;try{return o.decode(e,this.hints)}catch(e){if(e instanceof ch)continue}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}throw new Xs("No MultiFormat Readers were able to detect the code.")},e}(),hh=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){function t(t,r){void 0===t&&(t=null),void 0===r&&(r=500);var n=new dh;return n.setHints(t),e.call(this,n,r)||this}hh(t,e),t.prototype.decodeBitmap=function(e){return this.reader.decodeWithState(e)}}(uu);var fh=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){function t(t){return void 0===t&&(t=500),e.call(this,new sh,t)||this}fh(t,e)}(uu);var ph,gh=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){function t(t){return void 0===t&&(t=500),e.call(this,new vd,t)||this}gh(t,e)}(uu),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.DATA_MATRIX_COMPACT=3]="DATA_MATRIX_COMPACT",e[e.MIN_SIZE=4]="MIN_SIZE",e[e.MAX_SIZE=5]="MAX_SIZE",e[e.MARGIN=6]="MARGIN",e[e.PDF417_COMPACT=7]="PDF417_COMPACT",e[e.PDF417_COMPACTION=8]="PDF417_COMPACTION",e[e.PDF417_DIMENSIONS=9]="PDF417_DIMENSIONS",e[e.AZTEC_LAYERS=10]="AZTEC_LAYERS",e[e.QR_VERSION=11]="QR_VERSION",e[e.GS1_FORMAT=12]="GS1_FORMAT",e[e.FORCE_C40=13]="FORCE_C40"}(ph||(ph={}));var mh=ph,yh=function(){function e(e){this.field=e,this.cachedGenerators=[],this.cachedGenerators.push(new mu(e,Int32Array.from([1])))}return e.prototype.buildGenerator=function(e){var t=this.cachedGenerators;if(e>=t.length)for(var r=t[t.length-1],n=this.field,i=t.length;i<=e;i++){var o=r.multiply(new mu(n,Int32Array.from([1,n.exp(i-1+n.getGeneratorBase())])));t.push(o),r=o}return t[e]},e.prototype.encode=function(e,t){if(0===t)throw new ws("No error correction bytes");var r=e.length-t;if(r<=0)throw new ws("No data bytes provided");var n=this.buildGenerator(t),i=new Int32Array(r);xs.arraycopy(e,0,i,0,r);for(var o=new mu(this.field,i),a=(o=o.multiplyByMonomial(t,1)).divide(n)[1].getCoefficients(),s=t-a.length,u=0;u<s;u++)e[r+u]=0;xs.arraycopy(a,0,e,r+s,a.length)},e}(),vh=function(){function e(){}return e.applyMaskPenaltyRule1=function(t){return e.applyMaskPenaltyRule1Internal(t,!0)+e.applyMaskPenaltyRule1Internal(t,!1)},e.applyMaskPenaltyRule2=function(t){for(var r=0,n=t.getArray(),i=t.getWidth(),o=t.getHeight(),a=0;a<o-1;a++)for(var s=n[a],u=0;u<i-1;u++){var c=s[u];c===s[u+1]&&c===n[a+1][u]&&c===n[a+1][u+1]&&r++}return e.N2*r},e.applyMaskPenaltyRule3=function(t){for(var r=0,n=t.getArray(),i=t.getWidth(),o=t.getHeight(),a=0;a<o;a++)for(var s=0;s<i;s++){var u=n[a];s+6<i&&1===u[s]&&0===u[s+1]&&1===u[s+2]&&1===u[s+3]&&1===u[s+4]&&0===u[s+5]&&1===u[s+6]&&(e.isWhiteHorizontal(u,s-4,s)||e.isWhiteHorizontal(u,s+7,s+11))&&r++,a+6<o&&1===n[a][s]&&0===n[a+1][s]&&1===n[a+2][s]&&1===n[a+3][s]&&1===n[a+4][s]&&0===n[a+5][s]&&1===n[a+6][s]&&(e.isWhiteVertical(n,s,a-4,a)||e.isWhiteVertical(n,s,a+7,a+11))&&r++}return r*e.N3},e.isWhiteHorizontal=function(e,t,r){t=Math.max(t,0),r=Math.min(r,e.length);for(var n=t;n<r;n++)if(1===e[n])return!1;return!0},e.isWhiteVertical=function(e,t,r,n){r=Math.max(r,0),n=Math.min(n,e.length);for(var i=r;i<n;i++)if(1===e[i][t])return!1;return!0},e.applyMaskPenaltyRule4=function(t){for(var r=0,n=t.getArray(),i=t.getWidth(),o=t.getHeight(),a=0;a<o;a++)for(var s=n[a],u=0;u<i;u++)1===s[u]&&r++;var c=t.getHeight()*t.getWidth();return Math.floor(10*Math.abs(2*r-c)/c)*e.N4},e.getDataMaskBit=function(e,t,r){var n,i;switch(e){case 0:n=r+t&1;break;case 1:n=1&r;break;case 2:n=t%3;break;case 3:n=(r+t)%3;break;case 4:n=Math.floor(r/2)+Math.floor(t/3)&1;break;case 5:n=(1&(i=r*t))+i%3;break;case 6:n=(1&(i=r*t))+i%3&1;break;case 7:n=(i=r*t)%3+(r+t&1)&1;break;default:throw new ws("Invalid mask pattern: "+e)}return 0===n},e.applyMaskPenaltyRule1Internal=function(t,r){for(var n=0,i=r?t.getHeight():t.getWidth(),o=r?t.getWidth():t.getHeight(),a=t.getArray(),s=0;s<i;s++){for(var u=0,c=-1,l=0;l<o;l++){var d=r?a[s][l]:a[l][s];d===c?u++:(u>=5&&(n+=e.N1+(u-5)),u=1,c=d)}u>=5&&(n+=e.N1+(u-5))}return n},e.N1=3,e.N2=3,e.N3=40,e.N4=10,e}(),bh=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},wh=function(){function e(e,t){this.width=e,this.height=t;for(var r=new Array(t),n=0;n!==t;n++)r[n]=new Uint8Array(e);this.bytes=r}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,r){this.bytes[t][e]=r},e.prototype.setBoolean=function(e,t,r){this.bytes[t][e]=r?1:0},e.prototype.clear=function(e){var t,r;try{for(var n=bh(this.bytes),i=n.next();!i.done;i=n.next()){var o=i.value;Rs.fill(o,e)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var r=t;if(this.width!==r.width)return!1;if(this.height!==r.height)return!1;for(var n=0,i=this.height;n<i;++n)for(var o=this.bytes[n],a=r.bytes[n],s=0,u=this.width;s<u;++s)if(o[s]!==a[s])return!1;return!0},e.prototype.toString=function(){for(var e=new qs,t=0,r=this.height;t<r;++t){for(var n=this.bytes[t],i=0,o=this.width;i<o;++i)switch(n[i]){case 0:e.append(" 0");break;case 1:e.append(" 1");break;default:e.append(" ")}e.append("\n")}return e.toString()},e}(),_h=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 qs;return e.append("<<\n"),e.append(" mode: "),e.append(this.mode?this.mode.toString():"null"),e.append("\n ecLevel: "),e.append(this.ecLevel?this.ecLevel.toString():"null"),e.append("\n version: "),e.append(this.version?this.version.toString():"null"),e.append("\n maskPattern: "),e.append(this.maskPattern.toString()),this.matrix?(e.append("\n matrix:\n"),e.append(this.matrix.toString())):e.append("\n matrix: null\n"),e.append(">>\n"),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}(),Ah=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Eh=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ah(t,e),t.kind="WriterException",t}(ms),Ch=function(){function e(){}return e.clearMatrix=function(e){e.clear(255)},e.buildMatrix=function(t,r,n,i,o){e.clearMatrix(o),e.embedBasicPatterns(n,o),e.embedTypeInfo(r,i,o),e.maybeEmbedVersionInfo(n,o),e.embedDataBits(t,i,o)},e.embedBasicPatterns=function(t,r){e.embedPositionDetectionPatternsAndSeparators(r),e.embedDarkDotAtLeftBottomCorner(r),e.maybeEmbedPositionAdjustmentPatterns(t,r),e.embedTimingPatterns(r)},e.embedTypeInfo=function(t,r,n){var i=new ks;e.makeTypeInfoBits(t,r,i);for(var o=0,a=i.getSize();o<a;++o){var s=i.get(i.getSize()-1-o),u=e.TYPE_INFO_COORDINATES[o],c=u[0],l=u[1];if(n.setBoolean(c,l,s),o<8){var d=n.getWidth()-o-1,h=8;n.setBoolean(d,h,s)}else{d=8,h=n.getHeight()-7+(o-8);n.setBoolean(d,h,s)}}},e.maybeEmbedVersionInfo=function(t,r){if(!(t.getVersionNumber()<7)){var n=new ks;e.makeVersionInfoBits(t,n);for(var i=17,o=0;o<6;++o)for(var a=0;a<3;++a){var s=n.get(i);i--,r.setBoolean(o,r.getHeight()-11+a,s),r.setBoolean(r.getHeight()-11+a,o,s)}}},e.embedDataBits=function(t,r,n){for(var i=0,o=-1,a=n.getWidth()-1,s=n.getHeight()-1;a>0;){for(6===a&&(a-=1);s>=0&&s<n.getHeight();){for(var u=0;u<2;++u){var c=a-u;if(e.isEmpty(n.get(c,s))){var l=void 0;i<t.getSize()?(l=t.get(i),++i):l=!1,255!==r&&vh.getDataMaskBit(r,c,s)&&(l=!l),n.setBoolean(c,s,l)}}s+=o}s+=o=-o,a-=2}if(i!==t.getSize())throw new Eh("Not all bits consumed: "+i+"/"+t.getSize())},e.findMSBSet=function(e){return 32-Os.numberOfLeadingZeros(e)},e.calculateBCHCode=function(t,r){if(0===r)throw new ws("0 polynomial");var n=e.findMSBSet(r);for(t<<=n-1;e.findMSBSet(t)>=n;)t^=r<<e.findMSBSet(t)-n;return t},e.makeTypeInfoBits=function(t,r,n){if(!_h.isValidMaskPattern(r))throw new Eh("Invalid mask pattern");var i=t.getBits()<<3|r;n.appendBits(i,5);var o=e.calculateBCHCode(i,e.TYPE_INFO_POLY);n.appendBits(o,10);var a=new ks;if(a.appendBits(e.TYPE_INFO_MASK_PATTERN,15),n.xor(a),15!==n.getSize())throw new Eh("should not happen but we got: "+n.getSize())},e.makeVersionInfoBits=function(t,r){r.appendBits(t.getVersionNumber(),6);var n=e.calculateBCHCode(t.getVersionNumber(),e.VERSION_INFO_POLY);if(r.appendBits(n,12),18!==r.getSize())throw new Eh("should not happen but we got: "+r.getSize())},e.isEmpty=function(e){return 255===e},e.embedTimingPatterns=function(t){for(var r=8;r<t.getWidth()-8;++r){var n=(r+1)%2;e.isEmpty(t.get(r,6))&&t.setNumber(r,6,n),e.isEmpty(t.get(6,r))&&t.setNumber(6,r,n)}},e.embedDarkDotAtLeftBottomCorner=function(e){if(0===e.get(8,e.getHeight()-8))throw new Eh;e.setNumber(8,e.getHeight()-8,1)},e.embedHorizontalSeparationPattern=function(t,r,n){for(var i=0;i<8;++i){if(!e.isEmpty(n.get(t+i,r)))throw new Eh;n.setNumber(t+i,r,0)}},e.embedVerticalSeparationPattern=function(t,r,n){for(var i=0;i<7;++i){if(!e.isEmpty(n.get(t,r+i)))throw new Eh;n.setNumber(t,r+i,0)}},e.embedPositionAdjustmentPattern=function(t,r,n){for(var i=0;i<5;++i)for(var o=e.POSITION_ADJUSTMENT_PATTERN[i],a=0;a<5;++a)n.setNumber(t+a,r+i,o[a])},e.embedPositionDetectionPattern=function(t,r,n){for(var i=0;i<7;++i)for(var o=e.POSITION_DETECTION_PATTERN[i],a=0;a<7;++a)n.setNumber(t+a,r+i,o[a])},e.embedPositionDetectionPatternsAndSeparators=function(t){var r=e.POSITION_DETECTION_PATTERN[0].length;e.embedPositionDetectionPattern(0,0,t),e.embedPositionDetectionPattern(t.getWidth()-r,0,t),e.embedPositionDetectionPattern(0,t.getWidth()-r,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,r){if(!(t.getVersionNumber()<2))for(var n=t.getVersionNumber()-1,i=e.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[n],o=0,a=i.length;o!==a;o++){var s=i[o];if(s>=0)for(var u=0;u!==a;u++){var c=i[u];c>=0&&e.isEmpty(r.get(c,s))&&e.embedPositionAdjustmentPattern(c-2,s-2,r)}}},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}(),xh=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}(),Sh=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};!function(){function e(){}e.calculateMaskPenalty=function(e){return vh.applyMaskPenaltyRule1(e)+vh.applyMaskPenaltyRule2(e)+vh.applyMaskPenaltyRule3(e)+vh.applyMaskPenaltyRule4(e)},e.encode=function(t,r,n){void 0===n&&(n=null);var i=e.DEFAULT_BYTE_MODE_ENCODING,o=null!==n&&void 0!==n.get(mh.CHARACTER_SET);o&&(i=n.get(mh.CHARACTER_SET).toString());var a=this.chooseMode(t,i),s=new ks;if(a===nd.BYTE&&(o||e.DEFAULT_BYTE_MODE_ENCODING!==i)){var u=Us.getCharacterSetECIByName(i);void 0!==u&&this.appendECI(u,s)}this.appendModeInfo(a,s);var c,l=new ks;if(this.appendBytes(t,a,l,i),null!==n&&void 0!==n.get(mh.QR_VERSION)){var d=Number.parseInt(n.get(mh.QR_VERSION).toString(),10);c=Yl.getVersionForNumber(d);var h=this.calculateBitsNeeded(a,s,l,c);if(!this.willFit(h,c,r))throw new Eh("Data too big for requested version")}else c=this.recommendVersion(r,a,s,l);var f=new ks;f.appendBitArray(s);var p=a===nd.BYTE?l.getSizeInBytes():t.length;this.appendLengthInfo(p,c,a,f),f.appendBitArray(l);var g=c.getECBlocksForLevel(r),m=c.getTotalCodewords()-g.getTotalECCodewords();this.terminateBits(m,f);var y=this.interleaveWithECBytes(f,c.getTotalCodewords(),m,g.getNumBlocks()),v=new _h;v.setECLevel(r),v.setMode(a),v.setVersion(c);var b=c.getDimensionForVersion(),w=new wh(b,b),_=this.chooseMaskPattern(y,r,c,w);return v.setMaskPattern(_),Ch.buildMatrix(y,r,c,_,w),v.setMatrix(w),v},e.recommendVersion=function(e,t,r,n){var i=this.calculateBitsNeeded(t,r,n,Yl.getVersionForNumber(1)),o=this.chooseVersion(i,e),a=this.calculateBitsNeeded(t,r,n,o);return this.chooseVersion(a,e)},e.calculateBitsNeeded=function(e,t,r,n){return t.getSize()+e.getCharacterCountBits(n)+r.getSize()},e.getAlphanumericCode=function(t){return t<e.ALPHANUMERIC_TABLE.length?e.ALPHANUMERIC_TABLE[t]:-1},e.chooseMode=function(t,r){if(void 0===r&&(r=null),Us.SJIS.getName()===r&&this.isOnlyDoubleByteKanji(t))return nd.KANJI;for(var n=!1,i=!1,o=0,a=t.length;o<a;++o){var s=t.charAt(o);if(e.isDigit(s))n=!0;else{if(-1===this.getAlphanumericCode(s.charCodeAt(0)))return nd.BYTE;i=!0}}return i?nd.ALPHANUMERIC:n?nd.NUMERIC:nd.BYTE},e.isOnlyDoubleByteKanji=function(e){var t;try{t=Hs.encode(e,Us.SJIS)}catch(e){return!1}var r=t.length;if(r%2!=0)return!1;for(var n=0;n<r;n+=2){var i=255&t[n];if((i<129||i>159)&&(i<224||i>235))return!1}return!0},e.chooseMaskPattern=function(e,t,r,n){for(var i=Number.MAX_SAFE_INTEGER,o=-1,a=0;a<_h.NUM_MASK_PATTERNS;a++){Ch.buildMatrix(e,t,r,a,n);var s=this.calculateMaskPenalty(n);s<i&&(i=s,o=a)}return o},e.chooseVersion=function(t,r){for(var n=1;n<=40;n++){var i=Yl.getVersionForNumber(n);if(e.willFit(t,i,r))return i}throw new Eh("Data too big")},e.willFit=function(e,t,r){return t.getTotalCodewords()-t.getECBlocksForLevel(r).getTotalECCodewords()>=(e+7)/8},e.terminateBits=function(e,t){var r=8*e;if(t.getSize()>r)throw new Eh("data bits cannot fit in the QR Code"+t.getSize()+" > "+r);for(var n=0;n<4&&t.getSize()<r;++n)t.appendBit(!1);var i=7&t.getSize();if(i>0)for(n=i;n<8;n++)t.appendBit(!1);var o=e-t.getSizeInBytes();for(n=0;n<o;++n)t.appendBits(1&n?17:236,8);if(t.getSize()!==r)throw new Eh("Bits size does not equal capacity")},e.getNumDataBytesAndNumECBytesForBlockID=function(e,t,r,n,i,o){if(n>=r)throw new Eh("Block ID too large");var a=e%r,s=r-a,u=Math.floor(e/r),c=u+1,l=Math.floor(t/r),d=l+1,h=u-l,f=c-d;if(h!==f)throw new Eh("EC bytes mismatch");if(r!==s+a)throw new Eh("RS blocks mismatch");if(e!==(l+h)*s+(d+f)*a)throw new Eh("Total bytes mismatch");n<s?(i[0]=l,o[0]=h):(i[0]=d,o[0]=f)},e.interleaveWithECBytes=function(t,r,n,i){var o,a,s,u;if(t.getSizeInBytes()!==n)throw new Eh("Number of bits and data bytes does not match");for(var c=0,l=0,d=0,h=new Array,f=0;f<i;++f){var p=new Int32Array(1),g=new Int32Array(1);e.getNumDataBytesAndNumECBytesForBlockID(r,n,i,f,p,g);var m=p[0],y=new Uint8Array(m);t.toBytes(8*c,y,0,m);var v=e.generateECBytes(y,g[0]);h.push(new xh(y,v)),l=Math.max(l,m),d=Math.max(d,v.length),c+=p[0]}if(n!==c)throw new Eh("Data bytes does not match offset");var b=new ks;for(f=0;f<l;++f)try{for(var w=(o=void 0,Sh(h)),_=w.next();!_.done;_=w.next()){f<(y=_.value.getDataBytes()).length&&b.appendBits(y[f],8)}}catch(e){o={error:e}}finally{try{_&&!_.done&&(a=w.return)&&a.call(w)}finally{if(o)throw o.error}}for(f=0;f<d;++f)try{for(var A=(s=void 0,Sh(h)),E=A.next();!E.done;E=A.next()){f<(v=E.value.getErrorCorrectionBytes()).length&&b.appendBits(v[f],8)}}catch(e){s={error:e}}finally{try{E&&!E.done&&(u=A.return)&&u.call(A)}finally{if(s)throw s.error}}if(r!==b.getSizeInBytes())throw new Eh("Interleaving error: "+r+" and "+b.getSizeInBytes()+" differ.");return b},e.generateECBytes=function(e,t){for(var r=e.length,n=new Int32Array(r+t),i=0;i<r;i++)n[i]=255&e[i];new yh(wu.QR_CODE_FIELD_256).encode(n,t);var o=new Uint8Array(t);for(i=0;i<t;i++)o[i]=n[r+i];return o},e.appendModeInfo=function(e,t){t.appendBits(e.getBits(),4)},e.appendLengthInfo=function(e,t,r,n){var i=r.getCharacterCountBits(t);if(e>=1<<i)throw new Eh(e+" is bigger than "+((1<<i)-1));n.appendBits(e,i)},e.appendBytes=function(t,r,n,i){switch(r){case nd.NUMERIC:e.appendNumericBytes(t,n);break;case nd.ALPHANUMERIC:e.appendAlphanumericBytes(t,n);break;case nd.BYTE:e.append8BitBytes(t,n,i);break;case nd.KANJI:e.appendKanjiBytes(t,n);break;default:throw new Eh("Invalid mode: "+r)}},e.getDigit=function(e){return e.charCodeAt(0)-48},e.isDigit=function(t){var r=e.getDigit(t);return r>=0&&r<=9},e.appendNumericBytes=function(t,r){for(var n=t.length,i=0;i<n;){var o=e.getDigit(t.charAt(i));if(i+2<n){var a=e.getDigit(t.charAt(i+1)),s=e.getDigit(t.charAt(i+2));r.appendBits(100*o+10*a+s,10),i+=3}else if(i+1<n){a=e.getDigit(t.charAt(i+1));r.appendBits(10*o+a,7),i+=2}else r.appendBits(o,4),i++}},e.appendAlphanumericBytes=function(t,r){for(var n=t.length,i=0;i<n;){var o=e.getAlphanumericCode(t.charCodeAt(i));if(-1===o)throw new Eh;if(i+1<n){var a=e.getAlphanumericCode(t.charCodeAt(i+1));if(-1===a)throw new Eh;r.appendBits(45*o+a,11),i+=2}else r.appendBits(o,6),i++}},e.append8BitBytes=function(e,t,r){var n;try{n=Hs.encode(e,r)}catch(e){throw new Eh(e)}for(var i=0,o=n.length;i!==o;i++){var a=n[i];t.appendBits(a,8)}},e.appendKanjiBytes=function(e,t){var r;try{r=Hs.encode(e,Us.SJIS)}catch(e){throw new Eh(e)}for(var n=r.length,i=0;i<n;i+=2){var o=(255&r[i])<<8&4294967295|255&r[i+1],a=-1;if(o>=33088&&o<=40956?a=o-33088:o>=57408&&o<=60351&&(a=o-49472),-1===a)throw new Eh("Invalid byte sequence");var s=192*(a>>8)+(255&a);t.appendBits(s,13)}},e.appendECI=function(e,t){t.appendBits(nd.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=Us.UTF8.getName()}();var Ih=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){function t(t,r,n,i,o,a,s,u){var c=e.call(this,a,s)||this;if(c.yuvData=t,c.dataWidth=r,c.dataHeight=n,c.left=i,c.top=o,i+a>r||o+s>n)throw new ws("Crop rectangle does not fit within image data.");return u&&c.reverseHorizontal(a,s),c}Ih(t,e),t.prototype.getRow=function(e,t){if(e<0||e>=this.getHeight())throw new ws("Requested row is outside the image: "+e);var r=this.getWidth();(null==t||t.length<r)&&(t=new Uint8ClampedArray(r));var n=(e+this.top)*this.dataWidth+this.left;return xs.arraycopy(this.yuvData,n,t,0,r),t},t.prototype.getMatrix=function(){var e=this.getWidth(),t=this.getHeight();if(e===this.dataWidth&&t===this.dataHeight)return this.yuvData;var r=e*t,n=new Uint8ClampedArray(r),i=this.top*this.dataWidth+this.left;if(e===this.dataWidth)return xs.arraycopy(this.yuvData,i,n,0,r),n;for(var o=0;o<t;o++){var a=o*e;xs.arraycopy(this.yuvData,i,n,a,e),i+=this.dataWidth}return n},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(e,r,n,i){return new t(this.yuvData,this.dataWidth,this.dataHeight,this.left+e,this.top+r,n,i,!1)},t.prototype.renderThumbnail=function(){for(var e=this.getWidth()/t.THUMBNAIL_SCALE_FACTOR,r=this.getHeight()/t.THUMBNAIL_SCALE_FACTOR,n=new Int32Array(e*r),i=this.yuvData,o=this.top*this.dataWidth+this.left,a=0;a<r;a++){for(var s=a*e,u=0;u<e;u++){var c=255&i[o+u*t.THUMBNAIL_SCALE_FACTOR];n[s+u]=4278190080|65793*c}o+=this.dataWidth*t.THUMBNAIL_SCALE_FACTOR}return n},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 r=this.yuvData,n=0,i=this.top*this.dataWidth+this.left;n<t;n++,i+=this.dataWidth)for(var o=i+e/2,a=i,s=i+e-1;a<o;a++,s--){var u=r[a];r[a]=r[s],r[s]=u}},t.prototype.invert=function(){return new tu(this)},t.THUMBNAIL_SCALE_FACTOR=2}(Qs);var Th=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){function t(t,r,n,i,o,a,s){var u=e.call(this,r,n)||this;if(u.dataWidth=i,u.dataHeight=o,u.left=a,u.top=s,4===t.BYTES_PER_ELEMENT){for(var c=r*n,l=new Uint8ClampedArray(c),d=0;d<c;d++){var h=t[d],f=h>>16&255,p=h>>7&510,g=255&h;l[d]=(f+p+g)/4&255}u.luminances=l}else u.luminances=t;if(void 0===i&&(u.dataWidth=r),void 0===o&&(u.dataHeight=n),void 0===a&&(u.left=0),void 0===s&&(u.top=0),u.left+r>u.dataWidth||u.top+n>u.dataHeight)throw new ws("Crop rectangle does not fit within image data.");return u}Th(t,e),t.prototype.getRow=function(e,t){if(e<0||e>=this.getHeight())throw new ws("Requested row is outside the image: "+e);var r=this.getWidth();(null==t||t.length<r)&&(t=new Uint8ClampedArray(r));var n=(e+this.top)*this.dataWidth+this.left;return xs.arraycopy(this.luminances,n,t,0,r),t},t.prototype.getMatrix=function(){var e=this.getWidth(),t=this.getHeight();if(e===this.dataWidth&&t===this.dataHeight)return this.luminances;var r=e*t,n=new Uint8ClampedArray(r),i=this.top*this.dataWidth+this.left;if(e===this.dataWidth)return xs.arraycopy(this.luminances,i,n,0,r),n;for(var o=0;o<t;o++){var a=o*e;xs.arraycopy(this.luminances,i,n,a,e),i+=this.dataWidth}return n},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(e,r,n,i){return new t(this.luminances,n,i,this.dataWidth,this.dataHeight,this.left+e,this.top+r)},t.prototype.invert=function(){return new tu(this)}}(Qs);var Mh,Dh,Rh=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Oh=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Rh(t,e),t.forName=function(e){return this.getCharacterSetECIByName(e)},t}(Us),kh=function(){function e(){}return e.ISO_8859_1=Us.ISO8859_1,e}();Mh=function(e,t){for(var r=1,n=0;n<255;n++)t[n]=r,e[r]=n,(r*=2)>=256&&(r^=301);return{LOG:e,ALOG:t}}([],[]),Mh.LOG,Mh.ALOG,function(e){e[e.FORCE_NONE=0]="FORCE_NONE",e[e.FORCE_SQUARE=1]="FORCE_SQUARE",e[e.FORCE_RECTANGLE=2]="FORCE_RECTANGLE"}(Dh||(Dh={}));var Nh,Ph="[)>05",Bh="[)>06",Fh=function(){function e(){}return e.prototype.getEncodingMode=function(){return 0},e.prototype.encode=function(e){if($h.determineConsecutiveDigitCount(e.getMessage(),e.pos)>=2)e.writeCodeword(this.encodeASCIIDigits(e.getMessage().charCodeAt(e.pos),e.getMessage().charCodeAt(e.pos+1))),e.pos+=2;else{var t=e.getCurrentChar(),r=$h.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode());if(r!==this.getEncodingMode())switch(r){case 5:return e.writeCodeword(231),void e.signalEncoderChange(5);case 1:return e.writeCodeword(230),void e.signalEncoderChange(1);case 3:e.writeCodeword(238),e.signalEncoderChange(3);break;case 2:e.writeCodeword(239),e.signalEncoderChange(2);break;case 4:e.writeCodeword(240),e.signalEncoderChange(4);break;default:throw new Error("Illegal mode: "+r)}else $h.isExtendedASCII(t)?(e.writeCodeword(235),e.writeCodeword(t-128+1),e.pos++):(e.writeCodeword(t+1),e.pos++)}},e.prototype.encodeASCIIDigits=function(e,t){if($h.isDigit(e)&&$h.isDigit(t))return 10*(e-48)+(t-48)+130;throw new Error("not digits: "+e+t)},e}(),Lh=function(){function e(){}return e.prototype.getEncodingMode=function(){return 5},e.prototype.encode=function(e){var t=new qs;for(t.append(0);e.hasMoreCharacters();){var r=e.getCurrentChar();if(t.append(r),e.pos++,$h.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode())!==this.getEncodingMode()){e.signalEncoderChange(0);break}}var n=t.length()-1,i=e.getCodewordCount()+n+1;e.updateSymbolInfo(i);var o=e.getSymbolInfo().getDataCapacity()-i>0;if(e.hasMoreCharacters()||o)if(n<=249)t.setCharAt(0,Gs.getCharAt(n));else{if(!(n<=1555))throw new Error("Message length not in valid ranges: "+n);t.setCharAt(0,Gs.getCharAt(Math.floor(n/250)+249)),t.insert(1,Gs.getCharAt(n%250))}var a=0;for(r=t.length();a<r;a++)e.writeCodeword(this.randomize255State(t.charAt(a).charCodeAt(0),e.getCodewordCount()+1))},e.prototype.randomize255State=function(e,t){var r=e+(149*t%255+1);return r<=255?r:r-256},e}(),zh=function(){function e(){}return e.prototype.getEncodingMode=function(){return 1},e.prototype.encodeMaximal=function(e){for(var t=new qs,r=0,n=e.pos,i=0;e.hasMoreCharacters();){var o=e.getCurrentChar();e.pos++,r=this.encodeChar(o,t),t.length()%3==0&&(n=e.pos,i=t.length())}if(i!==t.length()){var a=Math.floor(t.length()/3*2),s=Math.floor(e.getCodewordCount()+a+1);e.updateSymbolInfo(s);var u=e.getSymbolInfo().getDataCapacity()-s,c=Math.floor(t.length()%3);(2===c&&2!==u||1===c&&(r>3||1!==u))&&(e.pos=n)}t.length()>0&&e.writeCodeword(230),this.handleEOD(e,t)},e.prototype.encode=function(e){for(var t=new qs;e.hasMoreCharacters();){var r=e.getCurrentChar();e.pos++;var n=this.encodeChar(r,t),i=2*Math.floor(t.length()/3),o=e.getCodewordCount()+i;e.updateSymbolInfo(o);var a=e.getSymbolInfo().getDataCapacity()-o;if(!e.hasMoreCharacters()){var s=new qs;for(t.length()%3==2&&2!==a&&(n=this.backtrackOneCharacter(e,t,s,n));t.length()%3==1&&(n>3||1!==a);)n=this.backtrackOneCharacter(e,t,s,n);break}if(t.length()%3==0)if($h.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode())!==this.getEncodingMode()){e.signalEncoderChange(0);break}}this.handleEOD(e,t)},e.prototype.backtrackOneCharacter=function(e,t,r,n){var i=t.length(),o=t.toString().substring(0,i-n);t.setLengthToZero(),t.append(o),e.pos--;var a=e.getCurrentChar();return n=this.encodeChar(a,r),e.resetSymbolInfo(),n},e.prototype.writeNextTriplet=function(e,t){e.writeCodewords(this.encodeToCodewords(t.toString()));var r=t.toString().substring(3);t.setLengthToZero(),t.append(r)},e.prototype.handleEOD=function(e,t){var r=Math.floor(t.length()/3*2),n=t.length()%3,i=e.getCodewordCount()+r;e.updateSymbolInfo(i);var o=e.getSymbolInfo().getDataCapacity()-i;if(2===n){for(t.append("\0");t.length()>=3;)this.writeNextTriplet(e,t);e.hasMoreCharacters()&&e.writeCodeword(254)}else if(1===o&&1===n){for(;t.length()>=3;)this.writeNextTriplet(e,t);e.hasMoreCharacters()&&e.writeCodeword(254),e.pos--}else{if(0!==n)throw new Error("Unexpected case. Please report!");for(;t.length()>=3;)this.writeNextTriplet(e,t);(o>0||e.hasMoreCharacters())&&e.writeCodeword(254)}e.signalEncoderChange(0)},e.prototype.encodeChar=function(e,t){if(e===" ".charCodeAt(0))return t.append(3),1;if(e>="0".charCodeAt(0)&&e<="9".charCodeAt(0))return t.append(e-48+4),1;if(e>="A".charCodeAt(0)&&e<="Z".charCodeAt(0))return t.append(e-65+14),1;if(e<" ".charCodeAt(0))return t.append(0),t.append(e),2;if(e<="/".charCodeAt(0))return t.append(1),t.append(e-33),2;if(e<="@".charCodeAt(0))return t.append(1),t.append(e-58+15),2;if(e<="_".charCodeAt(0))return t.append(1),t.append(e-91+22),2;if(e<=127)return t.append(2),t.append(e-96),2;t.append("1");var r=2;return r+=this.encodeChar(e-128,t)},e.prototype.encodeToCodewords=function(e){var t=1600*e.charCodeAt(0)+40*e.charCodeAt(1)+e.charCodeAt(2)+1,r=t/256,n=t%256,i=new qs;return i.append(r),i.append(n),i.toString()},e}(),Uh=function(){function e(){}return e.prototype.getEncodingMode=function(){return 4},e.prototype.encode=function(e){for(var t=new qs;e.hasMoreCharacters();){var r=e.getCurrentChar();if(this.encodeChar(r,t),e.pos++,t.length()>=4){e.writeCodewords(this.encodeToCodewords(t.toString()));var n=t.toString().substring(4);if(t.setLengthToZero(),t.append(n),$h.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode())!==this.getEncodingMode()){e.signalEncoderChange(0);break}}}t.append(Gs.getCharAt(31)),this.handleEOD(e,t)},e.prototype.handleEOD=function(e,t){try{var r=t.length();if(0===r)return;if(1===r){e.updateSymbolInfo();var n=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount(),i=e.getRemainingCharacters();if(i>n&&(e.updateSymbolInfo(e.getCodewordCount()+1),n=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount()),i<=n&&n<=2)return}if(r>4)throw new Error("Count must not exceed 4");var o=r-1,a=this.encodeToCodewords(t.toString()),s=!e.hasMoreCharacters()&&o<=2;if(o<=2)e.updateSymbolInfo(e.getCodewordCount()+o),(n=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount())>=3&&(s=!1,e.updateSymbolInfo(e.getCodewordCount()+a.length));s?(e.resetSymbolInfo(),e.pos-=o):e.writeCodewords(a)}finally{e.signalEncoderChange(0)}},e.prototype.encodeChar=function(e,t){e>=" ".charCodeAt(0)&&e<="?".charCodeAt(0)?t.append(e):e>="@".charCodeAt(0)&&e<="^".charCodeAt(0)?t.append(Gs.getCharAt(e-64)):$h.illegalCharacter(Gs.getCharAt(e))},e.prototype.encodeToCodewords=function(e){var t=e.length;if(0===t)throw new Error("StringBuilder must not be empty");var r=(e.charAt(0).charCodeAt(0)<<18)+((t>=2?e.charAt(1).charCodeAt(0):0)<<12)+((t>=3?e.charAt(2).charCodeAt(0):0)<<6)+(t>=4?e.charAt(3).charCodeAt(0):0),n=r>>16&255,i=r>>8&255,o=255&r,a=new qs;return a.append(n),t>=2&&a.append(i),t>=3&&a.append(o),a.toString()},e}(),jh=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Vh=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Hh=function(){function e(e,t,r,n,i,o,a,s){void 0===a&&(a=0),void 0===s&&(s=0),this.rectangular=e,this.dataCapacity=t,this.errorCodewords=r,this.matrixWidth=n,this.matrixHeight=i,this.dataRegions=o,this.rsBlockData=a,this.rsBlockError=s}return e.lookup=function(e,t,r,n,i){var o,a;void 0===t&&(t=0),void 0===r&&(r=null),void 0===n&&(n=null),void 0===i&&(i=!0);try{for(var s=Vh(qh),u=s.next();!u.done;u=s.next()){var c=u.value;if((1!==t||!c.rectangular)&&((2!==t||c.rectangular)&&(null==r||!(c.getSymbolWidth()<r.getWidth()||c.getSymbolHeight()<r.getHeight()))&&(null==n||!(c.getSymbolWidth()>n.getWidth()||c.getSymbolHeight()>n.getHeight()))&&e<=c.dataCapacity))return c}}catch(e){o={error:e}}finally{try{u&&!u.done&&(a=s.return)&&a.call(s)}finally{if(o)throw o.error}}if(i)throw new Error("Can't find a symbol arrangement that matches the message. Data codewords: "+e);return null},e.prototype.getHorizontalDataRegions=function(){switch(this.dataRegions){case 1:return 1;case 2:case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},e.prototype.getVerticalDataRegions=function(){switch(this.dataRegions){case 1:case 2:return 1;case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},e.prototype.getSymbolDataWidth=function(){return this.getHorizontalDataRegions()*this.matrixWidth},e.prototype.getSymbolDataHeight=function(){return this.getVerticalDataRegions()*this.matrixHeight},e.prototype.getSymbolWidth=function(){return this.getSymbolDataWidth()+2*this.getHorizontalDataRegions()},e.prototype.getSymbolHeight=function(){return this.getSymbolDataHeight()+2*this.getVerticalDataRegions()},e.prototype.getCodewordCount=function(){return this.dataCapacity+this.errorCodewords},e.prototype.getInterleavedBlockCount=function(){return this.rsBlockData?this.dataCapacity/this.rsBlockData:1},e.prototype.getDataCapacity=function(){return this.dataCapacity},e.prototype.getErrorCodewords=function(){return this.errorCodewords},e.prototype.getDataLengthForInterleavedBlock=function(e){return this.rsBlockData},e.prototype.getErrorLengthForInterleavedBlock=function(e){return this.rsBlockError},e}(),Gh=function(e){function t(){return e.call(this,!1,1558,620,22,22,36,-1,62)||this}return jh(t,e),t.prototype.getInterleavedBlockCount=function(){return 10},t.prototype.getDataLengthForInterleavedBlock=function(e){return e<=8?156:155},t}(Hh),qh=[new Hh(!1,3,5,8,8,1),new Hh(!1,5,7,10,10,1),new Hh(!0,5,7,16,6,1),new Hh(!1,8,10,12,12,1),new Hh(!0,10,11,14,6,2),new Hh(!1,12,12,14,14,1),new Hh(!0,16,14,24,10,1),new Hh(!1,18,14,16,16,1),new Hh(!1,22,18,18,18,1),new Hh(!0,22,18,16,10,2),new Hh(!1,30,20,20,20,1),new Hh(!0,32,24,16,14,2),new Hh(!1,36,24,22,22,1),new Hh(!1,44,28,24,24,1),new Hh(!0,49,28,22,14,2),new Hh(!1,62,36,14,14,4),new Hh(!1,86,42,16,16,4),new Hh(!1,114,48,18,18,4),new Hh(!1,144,56,20,20,4),new Hh(!1,174,68,22,22,4),new Hh(!1,204,84,24,24,4,102,42),new Hh(!1,280,112,14,14,16,140,56),new Hh(!1,368,144,16,16,16,92,36),new Hh(!1,456,192,18,18,16,114,48),new Hh(!1,576,224,20,20,16,144,56),new Hh(!1,696,272,22,22,16,174,68),new Hh(!1,816,336,24,24,16,136,56),new Hh(!1,1050,408,18,18,36,175,68),new Hh(!1,1304,496,20,20,36,163,62),new Gh],Wh=function(){function e(e){this.msg=e,this.pos=0,this.skipAtEnd=0;for(var t=e.split("").map(function(e){return e.charCodeAt(0)}),r=new qs,n=0,i=t.length;n<i;n++){var o=String.fromCharCode(255&t[n]);if("?"===o&&"?"!==e.charAt(n))throw new Error("Message contains characters outside ISO-8859-1 encoding.");r.append(o)}this.msg=r.toString(),this.shape=0,this.codewords=new qs,this.newEncoding=-1}return e.prototype.setSymbolShape=function(e){this.shape=e},e.prototype.setSizeConstraints=function(e,t){this.minSize=e,this.maxSize=t},e.prototype.getMessage=function(){return this.msg},e.prototype.setSkipAtEnd=function(e){this.skipAtEnd=e},e.prototype.getCurrentChar=function(){return this.msg.charCodeAt(this.pos)},e.prototype.getCurrent=function(){return this.msg.charCodeAt(this.pos)},e.prototype.getCodewords=function(){return this.codewords},e.prototype.writeCodewords=function(e){this.codewords.append(e)},e.prototype.writeCodeword=function(e){this.codewords.append(e)},e.prototype.getCodewordCount=function(){return this.codewords.length()},e.prototype.getNewEncoding=function(){return this.newEncoding},e.prototype.signalEncoderChange=function(e){this.newEncoding=e},e.prototype.resetEncoderSignal=function(){this.newEncoding=-1},e.prototype.hasMoreCharacters=function(){return this.pos<this.getTotalMessageCharCount()},e.prototype.getTotalMessageCharCount=function(){return this.msg.length-this.skipAtEnd},e.prototype.getRemainingCharacters=function(){return this.getTotalMessageCharCount()-this.pos},e.prototype.getSymbolInfo=function(){return this.symbolInfo},e.prototype.updateSymbolInfo=function(e){void 0===e&&(e=this.getCodewordCount()),(null==this.symbolInfo||e>this.symbolInfo.getDataCapacity())&&(this.symbolInfo=Hh.lookup(e,this.shape,this.minSize,this.maxSize,!0))},e.prototype.resetSymbolInfo=function(){this.symbolInfo=null},e}(),Kh=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Xh=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Kh(t,e),t.prototype.getEncodingMode=function(){return 3},t.prototype.encode=function(e){for(var t=new qs;e.hasMoreCharacters();){var r=e.getCurrentChar();if(e.pos++,this.encodeChar(r,t),t.length()%3==0)if(this.writeNextTriplet(e,t),$h.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode())!==this.getEncodingMode()){e.signalEncoderChange(0);break}}this.handleEOD(e,t)},t.prototype.encodeChar=function(e,t){switch(e){case 13:t.append(0);break;case"*".charCodeAt(0):t.append(1);break;case">".charCodeAt(0):t.append(2);break;case" ".charCodeAt(0):t.append(3);break;default:e>="0".charCodeAt(0)&&e<="9".charCodeAt(0)?t.append(e-48+4):e>="A".charCodeAt(0)&&e<="Z".charCodeAt(0)?t.append(e-65+14):$h.illegalCharacter(Gs.getCharAt(e))}return 1},t.prototype.handleEOD=function(e,t){e.updateSymbolInfo();var r=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount(),n=t.length();e.pos-=n,(e.getRemainingCharacters()>1||r>1||e.getRemainingCharacters()!==r)&&e.writeCodeword(254),e.getNewEncoding()<0&&e.signalEncoderChange(0)},t}(zh),Yh=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Zh=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Yh(t,e),t.prototype.getEncodingMode=function(){return 2},t.prototype.encodeChar=function(e,t){if(e===" ".charCodeAt(0))return t.append(3),1;if(e>="0".charCodeAt(0)&&e<="9".charCodeAt(0))return t.append(e-48+4),1;if(e>="a".charCodeAt(0)&&e<="z".charCodeAt(0))return t.append(e-97+14),1;if(e<" ".charCodeAt(0))return t.append(0),t.append(e),2;if(e<="/".charCodeAt(0))return t.append(1),t.append(e-33),2;if(e<="@".charCodeAt(0))return t.append(1),t.append(e-58+15),2;if(e>="[".charCodeAt(0)&&e<="_".charCodeAt(0))return t.append(1),t.append(e-91+22),2;if(e==="`".charCodeAt(0))return t.append(2),t.append(0),2;if(e<="Z".charCodeAt(0))return t.append(2),t.append(e-65+1),2;if(e<=127)return t.append(2),t.append(e-123+27),2;t.append("1");var r=2;return r+=this.encodeChar(e-128,t)},t}(zh),Jh=function(){function e(){}return e.randomize253State=function(e){var t=129+(149*e%253+1);return t<=254?t:t-254},e.encodeHighLevel=function(e,t,r,n,i){void 0===t&&(t=0),void 0===r&&(r=null),void 0===n&&(n=null),void 0===i&&(i=!1);var o=new zh,a=[new Fh,o,new Zh,new Xh,new Uh,new Lh],s=new Wh(e);s.setSymbolShape(t),s.setSizeConstraints(r,n),e.startsWith(Ph)&&e.endsWith("")?(s.writeCodeword(236),s.setSkipAtEnd(2),s.pos+=7):e.startsWith(Bh)&&e.endsWith("")&&(s.writeCodeword(237),s.setSkipAtEnd(2),s.pos+=7);var u=0;for(i&&(o.encodeMaximal(s),u=s.getNewEncoding(),s.resetEncoderSignal());s.hasMoreCharacters();)a[u].encode(s),s.getNewEncoding()>=0&&(u=s.getNewEncoding(),s.resetEncoderSignal());var c=s.getCodewordCount();s.updateSymbolInfo();var l=s.getSymbolInfo().getDataCapacity();c<l&&0!==u&&5!==u&&4!==u&&s.writeCodeword("þ");var d=s.getCodewords();for(d.length()<l&&d.append(129);d.length()<l;)d.append(this.randomize253State(d.length()+1));return s.getCodewords().toString()},e.lookAheadTest=function(e,t,r){var n=this.lookAheadTestIntern(e,t,r);if(3===r&&3===n){for(var i=Math.min(t+3,e.length),o=t;o<i;o++)if(!this.isNativeX12(e.charCodeAt(o)))return 0}else if(4===r&&4===n)for(i=Math.min(t+4,e.length),o=t;o<i;o++)if(!this.isNativeEDIFACT(e.charCodeAt(o)))return 0;return n},e.lookAheadTestIntern=function(e,t,r){if(t>=e.length)return r;var n;0===r?n=[0,1,1,1,1,1.25]:(n=[1,2,2,2,2,2.25])[r]=0;for(var i=0,o=new Uint8Array(6),a=[];;){if(t+i===e.length){Rs.fill(o,0),Rs.fill(a,0);var s=this.findMinimums(n,a,Os.MAX_VALUE,o),u=this.getMinimumCount(o);if(a[0]===s)return 0;if(1===u){if(o[5]>0)return 5;if(o[4]>0)return 4;if(o[2]>0)return 2;if(o[3]>0)return 3}return 1}var c=e.charCodeAt(t+i);if(i++,this.isDigit(c)?n[0]+=.5:this.isExtendedASCII(c)?(n[0]=Math.ceil(n[0]),n[0]+=2):(n[0]=Math.ceil(n[0]),n[0]++),this.isNativeC40(c)?n[1]+=2/3:this.isExtendedASCII(c)?n[1]+=8/3:n[1]+=4/3,this.isNativeText(c)?n[2]+=2/3:this.isExtendedASCII(c)?n[2]+=8/3:n[2]+=4/3,this.isNativeX12(c)?n[3]+=2/3:this.isExtendedASCII(c)?n[3]+=13/3:n[3]+=10/3,this.isNativeEDIFACT(c)?n[4]+=3/4:this.isExtendedASCII(c)?n[4]+=4.25:n[4]+=3.25,this.isSpecialB256(c)?n[5]+=4:n[5]++,i>=4){if(Rs.fill(o,0),Rs.fill(a,0),this.findMinimums(n,a,Os.MAX_VALUE,o),a[0]<this.min(a[5],a[1],a[2],a[3],a[4]))return 0;if(a[5]<a[0]||a[5]+1<this.min(a[1],a[2],a[3],a[4]))return 5;if(a[4]+1<this.min(a[5],a[1],a[2],a[3],a[0]))return 4;if(a[2]+1<this.min(a[5],a[1],a[4],a[3],a[0]))return 2;if(a[3]+1<this.min(a[5],a[1],a[4],a[2],a[0]))return 3;if(a[1]+1<this.min(a[0],a[5],a[4],a[2])){if(a[1]<a[3])return 1;if(a[1]===a[3]){for(var l=t+i+1;l<e.length;){var d=e.charCodeAt(l);if(this.isX12TermSep(d))return 3;if(!this.isNativeX12(d))break;l++}return 1}}}}},e.min=function(e,t,r,n,i){var o=Math.min(e,Math.min(t,Math.min(r,n)));return void 0===i?o:Math.min(o,i)},e.findMinimums=function(e,t,r,n){for(var i=0;i<6;i++){var o=t[i]=Math.ceil(e[i]);r>o&&(r=o,Rs.fill(n,0)),r===o&&(n[i]=n[i]+1)}return r},e.getMinimumCount=function(e){for(var t=0,r=0;r<6;r++)t+=e[r];return t||0},e.isDigit=function(e){return e>="0".charCodeAt(0)&&e<="9".charCodeAt(0)},e.isExtendedASCII=function(e){return e>=128&&e<=255},e.isNativeC40=function(e){return e===" ".charCodeAt(0)||e>="0".charCodeAt(0)&&e<="9".charCodeAt(0)||e>="A".charCodeAt(0)&&e<="Z".charCodeAt(0)},e.isNativeText=function(e){return e===" ".charCodeAt(0)||e>="0".charCodeAt(0)&&e<="9".charCodeAt(0)||e>="a".charCodeAt(0)&&e<="z".charCodeAt(0)},e.isNativeX12=function(e){return this.isX12TermSep(e)||e===" ".charCodeAt(0)||e>="0".charCodeAt(0)&&e<="9".charCodeAt(0)||e>="A".charCodeAt(0)&&e<="Z".charCodeAt(0)},e.isX12TermSep=function(e){return 13===e||e==="*".charCodeAt(0)||e===">".charCodeAt(0)},e.isNativeEDIFACT=function(e){return e>=" ".charCodeAt(0)&&e<="^".charCodeAt(0)},e.isSpecialB256=function(e){return!1},e.determineConsecutiveDigitCount=function(e,t){void 0===t&&(t=0);for(var r=e.length,n=t;n<r&&this.isDigit(e.charCodeAt(n));)n++;return n-t},e.illegalCharacter=function(e){var t=Os.toHexString(e.charCodeAt(0));throw t="0000".substring(0,4-t.length)+t,new Error("Illegal character: "+e+" (0x"+t+")")},e}(),$h=Jh,Qh=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ef=function(){function e(e){this.charset=e,this.name=e.name}return e.prototype.canEncode=function(e){try{return null!=Hs.encode(e,this.charset)}catch(e){return!1}},e}(),tf=function(){function e(e,t,r){var n,i,o,a,s,u;this.ENCODERS=["IBM437","ISO-8859-2","ISO-8859-3","ISO-8859-4","ISO-8859-5","ISO-8859-6","ISO-8859-7","ISO-8859-8","ISO-8859-9","ISO-8859-10","ISO-8859-11","ISO-8859-13","ISO-8859-14","ISO-8859-15","ISO-8859-16","windows-1250","windows-1251","windows-1252","windows-1256","Shift_JIS"].map(function(e){return new ef(Oh.forName(e))}),this.encoders=[];var c=[];c.push(new ef(kh.ISO_8859_1));for(var l=null!=t&&t.name.startsWith("UTF"),d=0;d<e.length;d++){var h=!1;try{for(var f=(n=void 0,Qh(c)),p=f.next();!p.done;p=f.next()){var g=p.value,m=e.charAt(d);if(m.charCodeAt(0)===r||g.canEncode(m)){h=!0;break}}}catch(e){n={error:e}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}if(!h)try{for(var y=(o=void 0,Qh(this.ENCODERS)),v=y.next();!v.done;v=y.next()){if((g=v.value).canEncode(e.charAt(d))){c.push(g),h=!0;break}}}catch(e){o={error:e}}finally{try{v&&!v.done&&(a=y.return)&&a.call(y)}finally{if(o)throw o.error}}h||(l=!0)}if(1!==c.length||l){this.encoders=[];var b=0;try{for(var w=Qh(c),_=w.next();!_.done;_=w.next()){g=_.value;this.encoders[b++]=g}}catch(e){s={error:e}}finally{try{_&&!_.done&&(u=w.return)&&u.call(w)}finally{if(s)throw s.error}}}else this.encoders=[c[0]];var A=-1;if(null!=t)for(d=0;d<this.encoders.length;d++)if(null!=this.encoders[d]&&t.name===this.encoders[d].name){A=d;break}this.priorityEncoderIndex=A}return e.prototype.length=function(){return this.encoders.length},e.prototype.getCharsetName=function(e){if(!(e<this.length()))throw new Error("index must be less than length");return this.encoders[e].name},e.prototype.getCharset=function(e){if(!(e<this.length()))throw new Error("index must be less than length");return this.encoders[e].charset},e.prototype.getECIValue=function(e){return this.encoders[e].charset.getValueIdentifier()},e.prototype.getPriorityEncoderIndex=function(){return this.priorityEncoderIndex},e.prototype.canEncode=function(e,t){if(!(t<this.length()))throw new Error("index must be less than length");return!0},e.prototype.encode=function(e,t){if(!(t<this.length()))throw new Error("index must be less than length");return Hs.encode(Gs.getCharAt(e),this.encoders[t].name)},e}(),rf=function(){function e(e,t,r){this.fnc1=r;var n=new tf(e,t,r);if(1===n.length())for(var i=0;i<this.bytes.length;i++){var o=e.charAt(i).charCodeAt(0);this.bytes[i]=o===r?1e3:o}else this.bytes=this.encodeMinimally(e,n,r)}return e.prototype.getFNC1Character=function(){return this.fnc1},e.prototype.length=function(){return this.bytes.length},e.prototype.haveNCharacters=function(e,t){if(e+t-1>=this.bytes.length)return!1;for(var r=0;r<t;r++)if(this.isECI(e+r))return!1;return!0},e.prototype.charAt=function(e){if(e<0||e>=this.length())throw new Error(""+e);if(this.isECI(e))throw new Error("value at "+e+" is not a character but an ECI");return this.isFNC1(e)?this.fnc1:this.bytes[e]},e.prototype.subSequence=function(e,t){if(e<0||e>t||t>this.length())throw new Error(""+e);for(var r=new qs,n=e;n<t;n++){if(this.isECI(n))throw new Error("value at "+n+" is not a character but an ECI");r.append(this.charAt(n))}return r.toString()},e.prototype.isECI=function(e){if(e<0||e>=this.length())throw new Error(""+e);return this.bytes[e]>255&&this.bytes[e]<=999},e.prototype.isFNC1=function(e){if(e<0||e>=this.length())throw new Error(""+e);return 1e3===this.bytes[e]},e.prototype.getECIValue=function(e){if(e<0||e>=this.length())throw new Error(""+e);if(!this.isECI(e))throw new Error("value at "+e+" is not an ECI but a character");return this.bytes[e]-256},e.prototype.addEdge=function(e,t,r){(null==e[t][r.encoderIndex]||e[t][r.encoderIndex].cachedTotalSize>r.cachedTotalSize)&&(e[t][r.encoderIndex]=r)},e.prototype.addEdges=function(e,t,r,n,i,o){var a=e.charAt(n).charCodeAt(0),s=0,u=t.length();t.getPriorityEncoderIndex()>=0&&(a===o||t.canEncode(a,t.getPriorityEncoderIndex()))&&(u=(s=t.getPriorityEncoderIndex())+1);for(var c=s;c<u;c++)(a===o||t.canEncode(a,c))&&this.addEdge(r,n+1,new nf(a,t,c,i,o))},e.prototype.encodeMinimally=function(e,t,r){var n=e.length,i=new(nf[n+1][t.length()]);this.addEdges(e,t,i,0,null,r);for(var o=1;o<=n;o++){for(var a=0;a<t.length();a++)null!=i[o][a]&&o<n&&this.addEdges(e,t,i,o,i[o][a],r);for(a=0;a<t.length();a++)i[o-1][a]=null}var s=-1,u=Os.MAX_VALUE;for(a=0;a<t.length();a++)if(null!=i[n][a]){var c=i[n][a];c.cachedTotalSize<u&&(u=c.cachedTotalSize,s=a)}if(s<0)throw new Error('Failed to encode "'+e+'"');for(var l=[],d=i[n][s];null!=d;){if(d.isFNC1())l.unshift(1e3);else{var h=t.encode(d.c,d.encoderIndex);for(o=h.length-1;o>=0;o--)l.unshift(255&h[o])}(null===d.previous?0:d.previous.encoderIndex)!==d.encoderIndex&&l.unshift(256+t.getECIValue(d.encoderIndex)),d=d.previous}var f=[];for(o=0;o<f.length;o++)f[o]=l[o];return f},e}(),nf=function(){function e(e,t,r,n,i){this.c=e,this.encoderSet=t,this.encoderIndex=r,this.previous=n,this.fnc1=i,this.c=e===i?1e3:e;var o=this.isFNC1()?1:t.encode(e,r).length;(null===n?0:n.encoderIndex)!==r&&(o+=3),null!=n&&(o+=n.cachedTotalSize),this.cachedTotalSize=o}return e.prototype.isFNC1=function(){return 1e3===this.c},e}(),of=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){e[e.ASCII=0]="ASCII",e[e.C40=1]="C40",e[e.TEXT=2]="TEXT",e[e.X12=3]="X12",e[e.EDF=4]="EDF",e[e.B256=5]="B256"}(Nh||(Nh={})),function(e){function t(t,r,n,i,o){var a=e.call(this,t,r,n)||this;return a.shape=i,a.macroId=o,a}of(t,e),t.prototype.getMacroId=function(){return this.macroId},t.prototype.getShapeHint=function(){return this.shape}}(rf);var af=function(){function e(e){this.previous=e}return e.prototype.getPrevious=function(){return this.previous},e}(),sf=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),uf=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.value=r,i.bitCount=n,i}return sf(t,e),t.prototype.appendTo=function(e,t){e.appendBits(this.value,this.bitCount)},t.prototype.add=function(e,r){return new t(this,e,r)},t.prototype.addBinaryShift=function(e,r){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new t(this,e,r)},t.prototype.toString=function(){var e=this.value&(1<<this.bitCount)-1;return e|=1<<this.bitCount,"<"+Os.toBinaryString(e|1<<this.bitCount).substring(1)+">"},t}(af),cf=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){function t(t,r,n){var i=e.call(this,t,0,0)||this;return i.binaryShiftStart=r,i.binaryShiftByteCount=n,i}cf(t,e),t.prototype.appendTo=function(e,t){for(var r=0;r<this.binaryShiftByteCount;r++)(0===r||31===r&&this.binaryShiftByteCount<=62)&&(e.appendBits(31,5),this.binaryShiftByteCount>62?e.appendBits(this.binaryShiftByteCount-31,16):0===r?e.appendBits(Math.min(this.binaryShiftByteCount,31),5):e.appendBits(this.binaryShiftByteCount-31,5)),e.appendBits(t[this.binaryShiftStart+r],8)},t.prototype.addBinaryShift=function(e,r){return new t(this,e,r)},t.prototype.toString=function(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}}(uf);new uf(null,0,0);var lf=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};!function(e){var t,r;try{for(var n=lf(e),i=n.next();!i.done;i=n.next()){var o=i.value;Rs.fill(o,-1)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}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}(Rs.createInt32Array(6,6)),function(e){var t=Gs.getCharCode(" "),r=Gs.getCharCode("."),n=Gs.getCharCode(",");e[0][t]=1;for(var i=Gs.getCharCode("Z"),o=Gs.getCharCode("A"),a=o;a<=i;a++)e[0][a]=a-o+2;e[1][t]=1;var s=Gs.getCharCode("z"),u=Gs.getCharCode("a");for(a=u;a<=s;a++)e[1][a]=a-u+2;e[2][t]=1;var c=Gs.getCharCode("9"),l=Gs.getCharCode("0");for(a=l;a<=c;a++)e[2][a]=a-l+2;e[2][n]=12,e[2][r]=13;for(var d=["\0"," ","","","","","","","","\b","\t","\n","\v","\f","\r","","","","","","@","\\","^","_","`","|","~",""],h=0;h<d.length;h++)e[3][Gs.getCharCode(d[h])]=h;var f=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(h=0;h<f.length;h++)Gs.getCharCode(f[h])>0&&(e[4][Gs.getCharCode(f[h])]=h)}(Rs.createInt32Array(5,256));var df=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),hf=function(e){function t(r){var n=e.call(this,r.width,r.height)||this;return n.canvas=r,n.tempCanvasElement=null,n.buffer=t.makeBufferFromCanvasImageData(r),n}return df(t,e),t.makeBufferFromCanvasImageData=function(e){var r;try{r=e.getContext("2d",{willReadFrequently:!0})}catch(t){r=e.getContext("2d")}if(!r)throw new Error("Couldn't get canvas context.");var n=r.getImageData(0,0,e.width,e.height);return t.toGrayscaleBuffer(n.data,e.width,e.height)},t.toGrayscaleBuffer=function(e,t,r){for(var n=new Uint8ClampedArray(t*r),i=0,o=0,a=e.length;i<a;i+=4,o++){var s=void 0;if(0===e[i+3])s=255;else s=306*e[i]+601*e[i+1]+117*e[i+2]+512>>10;n[o]=s}return n},t.prototype.getRow=function(e,t){if(e<0||e>=this.getHeight())throw new ws("Requested row is outside the image: "+e);var r=this.getWidth(),n=e*r;return null===t?t=this.buffer.slice(n,n+r):(t.length<r&&(t=new Uint8ClampedArray(r)),t.set(this.buffer.slice(n,n+r))),t},t.prototype.getMatrix=function(){return this.buffer},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(t,r,n,i){return e.prototype.crop.call(this,t,r,n,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 tu(this)},t.prototype.getTempCanvasElement=function(){if(null===this.tempCanvasElement){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 r=this.getTempCanvasElement();if(!r)throw new Error("Could not create a Canvas element.");var n=e*t.DEGREE_TO_RADIANS,i=this.canvas.width,o=this.canvas.height,a=Math.ceil(Math.abs(Math.cos(n))*i+Math.abs(Math.sin(n))*o),s=Math.ceil(Math.abs(Math.sin(n))*i+Math.abs(Math.cos(n))*o);r.width=a,r.height=s;var u=r.getContext("2d");if(!u)throw new Error("Could not create a Canvas Context element.");return u.translate(a/2,s/2),u.rotate(n),u.drawImage(this.canvas,i/-2,o/-2),this.buffer=t.makeBufferFromCanvasImageData(r),this},t.DEGREE_TO_RADIANS=Math.PI/180,t}(Qs);function ff(){return"undefined"!=typeof navigator}function pf(){return!!(ff()&&navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices)}var gf=function(){return gf=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},gf.apply(this,arguments)},mf=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,s)}u((n=n.apply(e,t||[])).next())})},yf=function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},vf=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},bf={delayBetweenScanAttempts:500,delayBetweenScanSuccess:500,tryPlayVideoTimeout:5e3},wf=function(){function e(e,t,r){void 0===t&&(t=new Map),void 0===r&&(r={}),this.reader=e,this.hints=t,this.options=gf(gf({},bf),r)}return Object.defineProperty(e.prototype,"possibleFormats",{set:function(e){this.hints.set(Ps.POSSIBLE_FORMATS,e)},enumerable:!1,configurable:!0}),e.addVideoSource=function(e,t){try{e.srcObject=t}catch(e){console.error("got interrupted by new loading request")}},e.mediaStreamSetTorch=function(e,t){return mf(this,void 0,void 0,function(){return yf(this,function(r){switch(r.label){case 0:return[4,e.applyConstraints({advanced:[{fillLightMode:t?"flash":"off",torch:!!t}]})];case 1:return r.sent(),[2]}})})},e.mediaStreamIsTorchCompatible=function(t){var r,n,i=t.getVideoTracks();try{for(var o=vf(i),a=o.next();!a.done;a=o.next()){var s=a.value;if(e.mediaStreamIsTorchCompatibleTrack(s))return!0}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.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 r=document.getElementById(e);if(!r)throw new vs("element with id '".concat(e,"' not found"));if(r.nodeName.toLowerCase()!==t.toLowerCase())throw new vs("element with id '".concat(e,"' must be an ").concat(t," element"));return r},e.createVideoElement=function(t){if(t instanceof HTMLVideoElement)return t;if("string"==typeof t)return e.getMediaElement(t,"video");if(!t&&"undefined"!=typeof document){var r=document.createElement("video");return r.width=200,r.height=200,r}throw new Error("Couldn't get videoElement from videoSource!")},e.prepareImageElement=function(t){if(t instanceof HTMLImageElement)return t;if("string"==typeof t)return e.getMediaElement(t,"img");if(void 0===t){var r=document.createElement("img");return r.width=200,r.height=200,r}throw new Error("Couldn't get imageElement from imageSource!")},e.prepareVideoElement=function(t){var r=e.createVideoElement(t);return r.setAttribute("autoplay","true"),r.setAttribute("muted","true"),r.setAttribute("playsinline","true"),r},e.isImageLoaded=function(e){return!!e.complete&&0!==e.naturalWidth},e.createBinaryBitmapFromCanvas=function(e){var t=new hf(e),r=new $s(t);return new _s(r)},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 new Error("Couldn't find the Source's dimensions!")},e.createCaptureCanvas=function(t){if(!t)throw new vs("Cannot create a capture canvas without a media element.");if("undefined"==typeof document)throw new Error('The page "Document" is undefined, make sure you\'re running in a browser.');var r=document.createElement("canvas"),n=e.getMediaElementDimensions(t),i=n.width,o=n.height;return r.style.width=i+"px",r.style.height=o+"px",r.width=i,r.height=o,r},e.tryPlayVideo=function(t){return mf(this,void 0,void 0,function(){var r;return yf(this,function(n){switch(n.label){case 0:if(null==t?void 0: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];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.play()];case 2:return n.sent(),[2,!0];case 3:return r=n.sent(),console.warn("It was not possible to play the video.",r),[2,!1];case 4:return[2]}})})},e.createCanvasFromMediaElement=function(t){var r=e.createCaptureCanvas(t),n=r.getContext("2d");if(!n)throw new Error("Couldn't find Canvas 2D Context.");return e.drawImageOnCanvas(n,t),r},e.createBinaryBitmapFromMediaElem=function(t){var r=e.createCanvasFromMediaElement(t);return e.createBinaryBitmapFromCanvas(r)},e.destroyImageElement=function(e){e.src="",e.removeAttribute("src"),e=void 0},e.listVideoInputDevices=function(){return mf(this,void 0,void 0,function(){var e,t,r,n,i,o,a,s,u,c,l,d;return yf(this,function(h){switch(h.label){case 0:if(!ff())throw new Error("Can't enumerate devices, navigator is not present.");if(!pf())throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:e=h.sent(),t=[];try{for(r=vf(e),n=r.next();!n.done;n=r.next())i=n.value,"videoinput"===(o="video"===i.kind?"videoinput":i.kind)&&(a=i.deviceId||i.id,s=i.label||"Video device ".concat(t.length+1),u=i.groupId,c={deviceId:a,label:s,kind:o,groupId:u},t.push(c))}catch(e){l={error:e}}finally{try{n&&!n.done&&(d=r.return)&&d.call(r)}finally{if(l)throw l.error}}return[2,t]}})})},e.findDeviceById=function(t){return mf(this,void 0,void 0,function(){var r;return yf(this,function(n){switch(n.label){case 0:return[4,e.listVideoInputDevices()];case 1:return(r=n.sent())?[2,r.find(function(e){return e.deviceId===t})]:[2]}})})},e.cleanVideoSource=function(e){if(e){try{e.srcObject=null}catch(t){e.src=""}e&&e.removeAttribute("src")}},e.releaseAllStreams=function(){0!==e.streamTracker.length&&e.streamTracker.forEach(function(e){e.getTracks().forEach(function(e){return e.stop()})}),e.streamTracker=[]},e.playVideoOnLoadAsync=function(t,r){return mf(this,void 0,void 0,function(){return yf(this,function(n){switch(n.label){case 0:return[4,e.tryPlayVideo(t)];case 1:return n.sent()?[2,!0]:[2,new Promise(function(n,i){var o=setTimeout(function(){e.isVideoPlaying(t)||(i(!1),t.removeEventListener("canplay",a))},r),a=function(){e.tryPlayVideo(t).then(function(e){clearTimeout(o),t.removeEventListener("canplay",a),n(e)})};t.addEventListener("canplay",a)})]}})})},e.attachStreamToVideo=function(t,r,n){return void 0===n&&(n=5e3),mf(this,void 0,void 0,function(){var i;return yf(this,function(o){switch(o.label){case 0:return i=e.prepareVideoElement(r),e.addVideoSource(i,t),[4,e.playVideoOnLoadAsync(i,n)];case 1:return o.sent(),[2,i]}})})},e._waitImageLoad=function(t){return new Promise(function(r,n){var i=setTimeout(function(){e.isImageLoaded(t)||(t.removeEventListener("load",o),n())},1e4),o=function(){clearTimeout(i),t.removeEventListener("load",o),r()};t.addEventListener("load",o)})},e.checkCallbackFnOrThrow=function(e){if(!e)throw new vs("`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 r=e.createCanvasFromMediaElement(t);return this.decodeFromCanvas(r)},e.prototype.decodeBitmap=function(e){return this.reader.decode(e,this.hints)},e.prototype.decodeFromCanvas=function(t){var r=e.createBinaryBitmapFromCanvas(t);return this.decodeBitmap(r)},e.prototype.decodeFromImageElement=function(t){return mf(this,void 0,void 0,function(){var r;return yf(this,function(n){switch(n.label){case 0:if(!t)throw new vs("An image element must be provided.");return r=e.prepareImageElement(t),[4,this._decodeOnLoadImage(r)];case 1:return[2,n.sent()]}})})},e.prototype.decodeFromImageUrl=function(t){return mf(this,void 0,void 0,function(){var r;return yf(this,function(n){switch(n.label){case 0:if(!t)throw new vs("An URL must be provided.");(r=e.prepareImageElement()).src=t,n.label=1;case 1:return n.trys.push([1,,3,4]),[4,this.decodeFromImageElement(r)];case 2:return[2,n.sent()];case 3:return e.destroyImageElement(r),[7];case 4:return[2]}})})},e.prototype.decodeFromConstraints=function(t,r,n){return mf(this,void 0,void 0,function(){var i,o;return yf(this,function(a){switch(a.label){case 0:return e.checkCallbackFnOrThrow(n),[4,this.getUserMedia(t)];case 1:i=a.sent(),a.label=2;case 2:return a.trys.push([2,4,,5]),[4,this.decodeFromStream(i,r,n)];case 3:return[2,a.sent()];case 4:throw o=a.sent(),e.disposeMediaStream(i),o;case 5:return[2]}})})},e.prototype.decodeFromStream=function(t,r,n){return mf(this,void 0,void 0,function(){var i,o,a,s,u,c,l,d,h=this;return yf(this,function(f){switch(f.label){case 0:return e.checkCallbackFnOrThrow(n),i=this.options.tryPlayVideoTimeout,[4,e.attachStreamToVideo(t,r,i)];case 1:return o=f.sent(),a=function(){e.disposeMediaStream(t),e.cleanVideoSource(o)},s=this.scan(o,n,a),u=t.getVideoTracks(),c=gf(gf({},s),{stop:function(){s.stop()},streamVideoConstraintsApply:function(e,t){return mf(this,void 0,void 0,function(){var r,n,i,o,a,s;return yf(this,function(c){switch(c.label){case 0:r=t?u.filter(t):u,c.label=1;case 1:c.trys.push([1,6,7,8]),n=vf(r),i=n.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=n.next(),[3,2];case 5:return[3,8];case 6:return o=c.sent(),a={error:o},[3,8];case 7:try{i&&!i.done&&(s=n.return)&&s.call(n)}finally{if(a)throw a.error}return[7];case 8:return[2]}})})},streamVideoConstraintsGet:function(e){return u.find(e).getConstraints()},streamVideoSettingsGet:function(e){return u.find(e).getSettings()},streamVideoCapabilitiesGet:function(e){return u.find(e).getCapabilities()}}),e.mediaStreamIsTorchCompatible(t)&&(l=null==u?void 0:u.find(function(t){return e.mediaStreamIsTorchCompatibleTrack(t)}),d=function(t){return mf(h,void 0,void 0,function(){return yf(this,function(r){switch(r.label){case 0:return[4,e.mediaStreamSetTorch(l,t)];case 1:return r.sent(),[2]}})})},c.switchTorch=d,c.stop=function(){return mf(h,void 0,void 0,function(){return yf(this,function(e){switch(e.label){case 0:return s.stop(),[4,d(!1)];case 1:return e.sent(),[2]}})})}),[2,c]}})})},e.prototype.decodeFromVideoDevice=function(t,r,n){return mf(this,void 0,void 0,function(){var i;return yf(this,function(o){switch(o.label){case 0:return e.checkCallbackFnOrThrow(n),i={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(i,r,n)];case 1:return[2,o.sent()]}})})},e.prototype.decodeFromVideoElement=function(t,r){return mf(this,void 0,void 0,function(){var n,i;return yf(this,function(o){switch(o.label){case 0:if(e.checkCallbackFnOrThrow(r),!t)throw new vs("A video element must be provided.");return n=e.prepareVideoElement(t),i=this.options.tryPlayVideoTimeout,[4,e.playVideoOnLoadAsync(n,i)];case 1:return o.sent(),[2,this.scan(n,r)]}})})},e.prototype.decodeFromVideoUrl=function(t,r){return mf(this,void 0,void 0,function(){var n,i,o;return yf(this,function(a){switch(a.label){case 0:if(e.checkCallbackFnOrThrow(r),!t)throw new vs("An URL must be provided.");return(n=e.prepareVideoElement()).src=t,i=function(){e.cleanVideoSource(n)},o=this.options.tryPlayVideoTimeout,[4,e.playVideoOnLoadAsync(n,o)];case 1:return a.sent(),[2,this.scan(n,r,i)]}})})},e.prototype.decodeOnceFromConstraints=function(e,t){return mf(this,void 0,void 0,function(){var r;return yf(this,function(n){switch(n.label){case 0:return[4,this.getUserMedia(e)];case 1:return r=n.sent(),[4,this.decodeOnceFromStream(r,t)];case 2:return[2,n.sent()]}})})},e.prototype.decodeOnceFromStream=function(t,r){return mf(this,void 0,void 0,function(){var n,i;return yf(this,function(o){switch(o.label){case 0:return n=Boolean(r),[4,e.attachStreamToVideo(t,r)];case 1:i=o.sent(),o.label=2;case 2:return o.trys.push([2,,4,5]),[4,this.scanOneResult(i)];case 3:return[2,o.sent()];case 4:return n||e.cleanVideoSource(i),[7];case 5:return[2]}})})},e.prototype.decodeOnceFromVideoDevice=function(e,t){return mf(this,void 0,void 0,function(){var r;return yf(this,function(n){switch(n.label){case 0:return r={video:e?{deviceId:{exact:e}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(r,t)];case 1:return[2,n.sent()]}})})},e.prototype.decodeOnceFromVideoElement=function(t){return mf(this,void 0,void 0,function(){var r,n;return yf(this,function(i){switch(i.label){case 0:if(!t)throw new vs("A video element must be provided.");return r=e.prepareVideoElement(t),n=this.options.tryPlayVideoTimeout,[4,e.playVideoOnLoadAsync(r,n)];case 1:return i.sent(),[4,this.scanOneResult(r)];case 2:return[2,i.sent()]}})})},e.prototype.decodeOnceFromVideoUrl=function(t){return mf(this,void 0,void 0,function(){var r,n;return yf(this,function(i){switch(i.label){case 0:if(!t)throw new vs("An URL must be provided.");(r=e.prepareVideoElement()).src=t,n=this.decodeOnceFromVideoElement(r),i.label=1;case 1:return i.trys.push([1,,3,4]),[4,n];case 2:return[2,i.sent()];case 3:return e.cleanVideoSource(r),[7];case 4:return[2]}})})},e.prototype.scanOneResult=function(e,t,r,n){var i=this;return void 0===t&&(t=!0),void 0===r&&(r=!0),void 0===n&&(n=!0),new Promise(function(o,a){i.scan(e,function(e,i,s){if(e)return o(e),void s.stop();if(i){if(i instanceof Xs&&t)return;if(i instanceof Es&&r)return;if(i instanceof Fs&&n)return;s.stop(),a(i)}})})},e.prototype.scan=function(t,r,n){var i=this;e.checkCallbackFnOrThrow(r);var o,a=e.createCaptureCanvas(t);try{o=a.getContext("2d",{willReadFrequently:!0})}catch(e){o=a.getContext("2d")}if(!o)throw new Error("Couldn't create canvas for visual element scan.");var s,u=function(){o=void 0,a=void 0},c=!1,l={stop:function(){c=!0,clearTimeout(s),u(),n&&n()}},d=function(){if(!c)try{e.drawImageOnCanvas(o,t);var h=i.decodeFromCanvas(a);r(h,void 0,l),s=setTimeout(d,i.options.delayBetweenScanSuccess)}catch(e){if(r(void 0,e,l),e instanceof Es||e instanceof Fs||e instanceof Xs)return void(s=setTimeout(d,i.options.delayBetweenScanAttempts));u(),n&&n(e)}};return d(),l},e.prototype._decodeOnLoadImage=function(t){return mf(this,void 0,void 0,function(){return yf(this,function(r){switch(r.label){case 0:return e.isImageLoaded(t)?[3,2]:[4,e._waitImageLoad(t)];case 1:r.sent(),r.label=2;case 2:return[2,this.decode(t)]}})})},e.prototype.getUserMedia=function(t){return mf(this,void 0,void 0,function(){var r;return yf(this,function(n){switch(n.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return r=n.sent(),e.streamTracker.push(r),[2,r]}})})},e.streamTracker=[],e}(),_f=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){function t(t,r){return e.call(this,new ju,t,r)||this}_f(t,e)}(wf);var Af=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){function t(t,r){return e.call(this,new El(t),t,r)||this}Af(t,e)}(wf);var Ef=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){function t(t,r){return e.call(this,new zl,t,r)||this}Ef(t,e)}(wf);var Cf=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),xf=function(e){function t(t,r){var n=this,i=new dh;return i.setHints(t),(n=e.call(this,i,t,r)||this).reader=i,n}return Cf(t,e),Object.defineProperty(t.prototype,"possibleFormats",{set:function(e){this.hints.set(Ps.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)},t}(wf),Sf=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){function t(t,r){return e.call(this,new sh,t,r)||this}Sf(t,e)}(wf);var If=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(e){function t(t,r){return e.call(this,new vd,t,r)||this}If(t,e)}(wf);const Tf=[du.PDF_417,du.QR_CODE];class Mf{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Tf;this.reader=new xf,this.reader.possibleFormats=e,cs("Barcode detector initialized",e.map(e=>du[e]))}getXYWidthHeight(e){if(!e||0===e.length)return{x:0,y:0,width:0,height:0};let t=1/0,r=-1/0,n=1/0,i=-1/0;for(const o of e){const e=o.getX(),a=o.getY();e<t&&(t=e),e>r&&(r=e),a<n&&(n=a),a>i&&(i=a)}return{x:t,y:n,width:r-t,height:i-n}}async detect(e){let t;if(e instanceof HTMLCanvasElement)t=e;else{t=document.createElement("canvas"),t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(!r)return cs("Warning: Unable to get 2D context for canvas."),[];null==r||r.drawImage(e,0,0)}try{const e=await this.reader.decodeFromCanvas(t);cs("Barcode detected:",e);const r=this.getXYWidthHeight(e.getResultPoints()),n={class:du[e.getBarcodeFormat()],score:1,extra:e.getText(),x:r.x,y:r.y,width:r.width,height:r.height};return cs("Barcode result:",n),[n]}catch(e){return cs("Barcode not detected"),"NotFoundException"!==(null==e?void 0:e.name)&&cs("Barcode detection error:",e),[]}}}var Df;!function(e){e.NOT_AVAILABLE="notAvailable",e.LOADING="loading",e.LOADED="loaded"}(Df||(Df={}));const Rf={[ls.DOCUMENT_DETECTOR]:{status:Df.LOADING},[ls.BLUR_GLARE_CLASSIFIER]:{status:Df.LOADING},[ls.FACE_LANDMARK]:{status:Df.LOADING}};let Of=null;function kf(){if(Of)return cs("Reusing existing barcode detector instance"),Of;try{return Of=new Mf,cs("Created new barcode detector instance"),Of}catch(e){throw cs("Error initializing barcode model",e),ss("Error initializing barcode model","barcode_model_not_supported","init"),e}}const Nf=[ls.DOCUMENT_DETECTOR,ls.BLUR_GLARE_CLASSIFIER],Pf=async()=>{let e=!1;for(;!e;){const t=Object.values(Rf).filter(e=>e.status===Df.NOT_AVAILABLE);if(t.length>0)throw new Error(`Model not available: ${t.join(", ")}`);if(e=Nf.every(e=>Rf[e].status===Df.LOADED),e)return!0;await new Promise(e=>setTimeout(e,100))}},Bf=e=>"function"==typeof e,Ff=function(e){};Fa.events.on(Fa.events.MODULE_INITIALIZED,function(){const{clientId:e,IDV:t}=Fa.moduleMetadata.getInitConfig();if(!e||!t)return!1;const r=(null==t?void 0:t.serverPath)&&(i=null==t?void 0:t.serverPath,o="/verify",(null==i?void 0:i.endsWith(o))?i.slice(0,i.length-o.length):i);var i,o;go.BASE=r||window.location.origin,$a.dispatch("setClientId",e),$a.dispatch("setRootElement",(null==t?void 0:t.rootElement)||"root-element"),$a.dispatch("setServerPath",null==t?void 0:t.serverPath),$a.dispatch("setLanguage",null==t?void 0:t.language),$a.dispatch("setCallback",null==t?void 0:t.callback),$a.dispatch("setConsentVersion",null==t?void 0:t.consentVersion),$a.dispatch("setMarkdownSupportText",null==t?void 0:t.markdownSupportText),$a.dispatch("setVideoCaptureSettings",null==t?void 0:t.videoCaptureSettings),$a.dispatch("setCdnHost",null==t?void 0:t.cdnHost),$a.dispatch("setIsImageSigningEnabled",null==t?void 0:t.isImageSigningEnabled),(null==t?void 0:t.callbacks)&&Wf(t);return $a.dispatch("setStartToken",null==t?void 0:t.startToken),Ya($a.state.clientId).then(e=>{!async function(e){if(null==e?void 0:e.autocapture_enabled){if("serviceWorker"in navigator)return $a.dispatch("setAutoCaptureSettings",{enabled:!0,settings:e.autocapture_settings}),cs("service worker available"),navigator.serviceWorker.addEventListener("message",e=>{if(e.data&&"MODEL_READY"===e.data.type){const t=e.data.modelName;Rf[t]={status:Df.LOADED,imageDimensions:e.data.imageDimensions,loadingStats:n(n({},e.data.stats),{},{modelName:t})}}else if(e.data&&"MODEL_LOAD_ERROR"===e.data.type){const t=e.data.modelName;Rf[t].status=Df.NOT_AVAILABLE,ss(`${e.data.modelName} error: ${e.data.error}`,"model_load_error","init")}}),void kf();ss("service worker not available","service_worker_not_available","init")}$a.dispatch("setAutoCaptureSettings",{enabled:!1,autocapture_settings:e.autocapture_settings})}(e)}),function(e){Ga({type:"init",step:e})}("init"),!0}),Fa.events.on(La,function(e){switch(as.handelEventData(e),qf(e),e.type){case"session-granted":Lf({session:$a.state.sessionId});break;case"session-id-acquired":zf({session:$a.state.sessionId});break;case"capture-image-result":Uf({session:$a.state.sessionId},e.imageType);break;case"start-verification-processing":jf({session:$a.state.sessionId});break;case"verification-complete":Vf({session:$a.state.sessionId});break;case"capture-error":case"failed-to-init-drs":case"api-request-error":Gf({session:$a.state.sessionId},e.errorCode,e.error);break;case"verification-recapture":Hf({session:$a.state.sessionId},e.reason)}});let Lf=Ff,zf=Ff,Uf=Ff,jf=Ff,Vf=Ff,Hf=Ff,Gf=Ff,qf=e=>{};const Wf=e=>{let{callbacks:t,callback:r}=e;Bf(t.sessionGranted)&&(Lf=t.sessionGranted),Bf(t.sessionStarted)&&(zf=t.sessionStarted),Bf(t.imageSubmitted)&&(Uf=t.imageSubmitted),Bf(t.processing)&&(jf=t.processing),Bf(t.completed)&&(Vf=t.completed),Bf(t.recapture)&&(Hf=t.recapture),Bf(t.error)&&(Gf=t.error),Bf(r)&&(qf=r)};async function Kf(e,t,r){go.HEADERS=xo(r,t);var n;return(await(n=e,Xa({method:"GET",url:`/verify/api/v1/verification/${n}/status`,path:{sid:n},errors:{404:"Session not found"}},"processing"))).body}function Xf(e){try{return JSON.parse(e)}catch(e){return console.error(e),null}}async function Yf(e,t,r,n){go.HEADERS=xo(t);const i=await(o={start_token:e,accessed_from_desktop:!1,client_type:bo.client_type.MOBILE_SDK,consent:{granted:!0,document_id:r},image_signing_public_key:n},Xa({method:"POST",url:"/verify/api/v1/verification/start",headers:{},body:o,mediaType:"application/json"},"init"));var o;return{sessionId:i.body.session_id,userToken:i.body.user_token,requiredImages:i.body.required_images}}async function Zf(e,t,r){let n,i,o;if(n)try{n=ja(Ua);const e=JSON.parse(n);i=e.sessionId,o=e.userToken}catch(e){}try{let a;if(o){a=(await Kf(i,o,r)).missing_images}else{const s=Fa.crypto.createCryptoBinding("sign"),u=await s.getPublicData(),c=await Yf(e,r,t,u.publicKey);i=c.sessionId,o=c.userToken,a=c.requiredImages,n=JSON.stringify({sessionId:i,userToken:o}),function(e,t){sessionStorage.setItem(e,t)}(Ua,n)}return{requiredImages:a,sessionId:i.toString(),userToken:o.toString()}}catch(e){throw console.log("Error starting session"),console.error(e),e}}function Jf(e){let{tagName:t,style:r,id:n="",className:i="",testid:o,options:a}=e;const s=document.createElement(t,a);return s.id=n,s.className=i,s.setAttribute("data-auto",o+"-auto"),Object.keys(r).forEach(e=>{s.style[e]=r[e]}),s}function $f(e,t){Array.isArray(t)?t.forEach(t=>{e.appendChild(t)}):e.appendChild(t)}const Qf={blur_message:"Please focus camera on the document before capturing",blur_title:"Blurred image",document_incorrect_position_message:"Please make sure the document is fully within the frame, and nothing covers it",document_incorrect_position_title:"Incorrect document position",document_not_found_message:"Make sure you capture a valid government issued ID",document_not_found_title:"Document not detected",document_not_matching_message:"Please make sure to capture the back side of the document",document_not_matching_title:"Back image mismatch",document_not_supported_message:"Please use a different government issued ID instead",document_not_supported_title:"Document not supported",capturing_in_progress_message:"Capturing, stay steady",capturing_in_progress_title:"Capturing in progress",face_not_found_message:"Ensure your face is not covered and fully visible",face_not_found_title:"Face not detected",glare_message:"Avoid any direct light reflecting with glare",glare_title:"Glare detected",main_title_document_back:"Back side",main_title_document_face:"Selfie",main_title_document_front:"Front side",obstructed_message:"Some of the document parts are covered or missing",obstructed_title:"Missing information",other_error_code_message:"Please try again",other_error_code_title:"An error occurred",page_header_document:"Scan document",loading_screen_small_title:"Preparing...",page_header_face:"Face Recognition",second_title_document_back:"Please place your document on a solid surface, back side up.",second_title_document_face:"Please position your face in the center of the oval below.",second_title_document_front:"Please place your document on a solid surface, photo side up.",wrong_document_side_message:"The wrong document side has been detected",wrong_document_side_title:"Wrong document side detected",face_angle_too_large_title:"your face is not directly aligned with the camera",face_angle_too_large_message:"Please take another photo with your face fully visible for accurate detection",face_close_to_border_title:"Your face is too close to the edge",face_close_to_border_message:"Please adjust your position and make sure your entire face is within the frame",face_too_small_title:"Your face is too distant from the edge",face_too_small_message:"Please move closer to the camera so your face is clearer and easier to detect",face_too_close_title:"Your face is too close ",face_too_close_message:"Please adjust your position and make sure your entire face is within the frame",face_cropped_title:"Your face is partially cropped",face_cropped_message:"Please adjust your position and make sure your entire face is within the frame for optimal",no_face_title:"Face not found",no_face_message:"Please move closer to the camera or adjust your position so your face is clearer and easier to detect",multi_face_title:"Multiple faces detected",multi_face_message:"Please make sure only one face is visible in the frame to proceed",blur_selfie_title:"The selfie is out of focus",blur_selfie_message:"Please try taking another one with clearer focus for better detection",glare_selfie_title:"Too much reflection in your selfie",glare_selfie_message:"Please try taking another photo with better lighting and without glare for accurate detection",closed_eyes_title:"It looks like your eyes are closed",closed_eyes_message:"Please retake the photo with your eyes open",face_occluded_title:"Your face is partially hidden",face_occluded_message:"Please take another photo with your face fully visible for accurate detection",face_rotated_title:"Your face is not directly aligned with the camera",face_rotated_message:"Please take another photo with your face fully visible for accurate detection",barcode_not_found_title:"We are having trouble capturing some important elements of your document, Please try placing it in a clearer spot",barcode_not_found_message:"We are having trouble capturing some important elements of your document, Please try placing it in a clearer spot",searching_document_autocapture:"Searching for document",capturing_document_autocapture:"Capturing, please hold steady",click_manual_autocapture:"Click to capture manually",glare_blur_issues_autocapture:"Please make sure there are no light reflections, and try again",doc_not_in_frame_issues_autocapture:"Please bring the document closer and ensure it is fully within the capture frame for a clear image.",doc_not_found_autocapture:"Looking for document",capturing_face_issue_closer:"Please move closer to the frame",second_title_face_autocapture:"Get ready! Your selfie will be auto-captured, or tap to capture it manually",capturing_face_autocapture3:"Capturing... please, hold steady for 3",capturing_face_autocapture2:"Capturing... please, hold steady for 2",capturing_face_autocapture1:"Capturing... please, hold steady for 1",selfie_approval_autocapture:"Great job! Approve your selfie to continue",approve_button:"Approve",retake_button:"Retake"};const ep=new class{constructor(e){this.translations=e,this.translations=new Proxy(this.translations,{get:function(e,t){return e[t]},set:function(e,t,r){return e[t]=r,!0}})}overrideLanguage(e){Object.assign(this.translations,e)}translate(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];let i=this.translations[e];return i||(i=e),i.replace(/{(\d+)}/g,function(e,t){return void 0!==r[t]?r[t]:e})}}(Qf),tp={en:Qf,es:{blur_message:"Favor enfoca la cámara en tú cédula antes de la captura",blur_title:"Imagen borrosa",document_incorrect_position_message:"Asegúrate de que la cédula esté completamente dentro del marco y nada la cubra",document_incorrect_position_title:"Posición incorrecta del documento",capturing_in_progress_title:"Capturando en progreso",capturing_in_progress_message:"Capturando, mantente estable",document_not_found_message:"Asegúrate de utilizar una cédula valida",document_not_found_title:"Cédula no detectada",document_not_matching_message:"Favor Asegúrate de capturar la parte trasera de tu cédula",document_not_matching_title:"Parte trasera no corresponde",document_not_supported_message:"Favor utliza tu cédula",document_not_supported_title:"Cédula no compatible",face_not_found_message:"Asegurase de no tapar su rostro",face_not_found_title:"Selfie no detectada",glare_message:"Evite luz directa que pueda generar brillo",glare_title:"Demasiado brillo",main_title_document_back:"Parte trasera de tu cédula",main_title_document_face:"Tómate un Selfie",main_title_document_front:"Parte frontal de tu cédula",obstructed_message:"Parte de la cédula documento no está visible o falta información",obstructed_title:"Falta información",other_error_code_message:"Intenta nuevamente",other_error_code_title:"Ha ocurrido un error",page_header_document:"Escanéa tu cédula",page_header_face:"Reconocimiento Facial",second_title_document_back:"Asegúrate de poner su cédula en una superfice plana con la parte trasera visible.",second_title_document_face:"Asegúrate de posicionar tu rostro en el centro del circulo.",second_title_document_front:"Asegúrate de poner su cédula en una superfice plana con la parte frontal visible.",wrong_document_side_message:"Lado incorrecto de tu cédula ha sido detectado",wrong_document_side_title:"Lado de tu cédula incorrecto",face_angle_too_large_title:"Tu rostro no está directamente alineado con la cámara.",face_angle_too_large_message:"Por favor, toma otra foto con tu rostro completamente visible para una detección precisa.",face_close_to_border_title:"Tu rostro está demasiado cerca del borde.",face_close_to_border_message:"Por favor, cambia la posicion de tu rostro y asegúrate de que todo tu rostro esté dentro del marco.",face_too_small_title:"Tu rostro está demasiado lejos del borde.",face_too_small_message:"Por favor, acércate más a la cámara para que tu rostro esté más claro y sea más fácil de detectar.",face_too_close_title:"Tu rostro está demasiado cerca",face_too_close_message:"Acomode la posición y asegúrese de que toda su rostro esté dentro del marco.",face_cropped_title:"Tu rostro está parcialmente recortado.",face_cropped_message:"Por favor, cambia tu posición y asegúrate de que todo tu rostro esté dentro del marco para una detección óptima.",no_face_title:"Rostro no encontrado.",no_face_message:"Por favor, acércate más a la cámara o ajusta tu posición para que tu rostro esté más claro y sea más fácil de detectar.",multi_face_title:"Se detectaron múltiples rostros.",multi_face_message:"Por favor, asegúrate de que solo haya un rostro visible en el marco para continuar.",blur_selfie_title:"El autorretrato está fuera de foco.",blur_selfie_message:"Por favor, intenta tomar una nueva imagen con un enfoque más claro para una mejor detección.",glare_selfie_title:"Demasiado reflejo en tu autorretrato.",glare_selfie_message:"Por favor, intenta tomar otra foto con una mejor iluminación y sin brillos para una detección precisa.",closed_eyes_title:"Parece que tienes los ojos cerrados.",closed_eyes_message:"Por favor, vuelve a tomar la foto con los ojos abiertos.",face_occluded_title:"Tu rostro está parcialmente oculto.",face_occluded_message:"Por favor, toma otra foto con tu rostro completamente visible para una detección precisa.",face_rotated_title:"Tu rostro está fuera de foco.",face_rotated_message:"Por favor, intenta tomar otro con un enfoque más claro para una mejor detección.",barcode_not_found_title:"Estamos teniendo problemas para capturar algunos elementos importantes de su documento, Intente colocarlo en un lugar más despejado.",barcode_not_found_message:"Estamos teniendo problemas para capturar algunos elementos importantes de su documento, Intente colocarlo en un lugar más despejado.",searching_document_autocapture:"Buscando la cedula",capturing_document_autocapture:"Capturando, por favor mantente quieto",click_manual_autocapture:"Haz clic para capturar manualmente",glare_blur_issues_autocapture:"Por favor, asegúrate de que no haya reflejos de luz antes de intentarlo de nuevo",doc_not_in_frame_issues_autocapture:"Por favor, acerque la cedula y asegúrese de que esté completamente dentro del marco de captura para obtener una imagen clara",second_title_face_autocapture:"¡Prepárate! Tu selfie se capturará automáticamente, o toca para capturarla manualmente",capturing_face_autocapture3:"Capturando... por favor, mantente quieto durante 3",capturing_face_autocapture2:"Capturando... por favor, mantente quieto durante 2",capturing_face_autocapture1:"Capturando... por favor, mantente quieto durante 1",selfie_approval_autocapture:"¡Buen trabajo! Aprueba tu selfie para continuar",approve_button:"Aprobar",retake_button:"Volver a tomar"},pt:{blur_message:"Por favor, foque a câmera no documento antes de capturar",blur_title:"Imagem borrada",document_incorrect_position_message:"Certifique-se de que o documento esteja totalmente dentro do quadro e nada o cubra",document_incorrect_position_title:"Posição incorreta do documento",document_not_found_message:"Certifique-se de capturar um documento válido emitido pelo governo",document_not_found_title:"Documento não detectado",document_not_matching_message:"Por favor, certifique-se de capturar o verso do documento",document_not_matching_title:"Imagem do verso incorreta",document_not_supported_message:"Por favor, utilize um documento diferente emitido pelo governo",document_not_supported_title:"Documento não suportado",capturing_in_progress_message:"Capturando, mantenha-se firme",capturing_in_progress_title:"Captura em andamento",face_not_found_message:"Certifique-se de que seu rosto não esteja coberto e esteja totalmente visível",face_not_found_title:"Rosto não detectado",glare_message:"Evite qualquer luz direta refletindo com brilho",glare_title:"Brilho detectado",main_title_document_back:"Verso",main_title_document_face:"Selfie",main_title_document_front:"Frente",obstructed_message:"Algumas partes do documento estão encobertas ou ausentes",obstructed_title:"Informações incompletas",other_error_code_message:"Por favor, tente novamente",other_error_code_title:"Ocorreu um eprro",page_header_document:"Digitalizar o documento",page_header_face:"Reconhecimento facial",second_title_document_back:"Coloque o documento em uma superfície sólida, com o verso voltado para cima.",second_title_document_face:"Por favor, posicione seu rosto no centro do oval abaixo.",second_title_document_front:"Coloque o documento em uma superfície sólida, com a foto voltada para cima.",wrong_document_side_message:"O lado errado do documento foi detectado",wrong_document_side_title:"Lado incorreto do documento identificado",face_angle_too_large_title:"Seu rosto não está diretamente alinhado com a câmera.",face_angle_too_large_message:"Tire outra foto com seu rosto totalmente visível para uma detecção precisa.",face_close_to_border_title:"Seu rosto está muito próximo da borda.",face_close_to_border_message:"Por favor, reposicione seu rosto e certifique-se de que todo o seu rosto esteja dentro da moldura.",face_too_small_title:"Seu rosto está muito longe da borda.",face_too_small_message:"Aproxime-se da câmera para que seu rosto fique mais claro e fácil de detectar.",face_too_close_title:"Seu rosto está muito perto",face_too_close_message:"Ajuste a posição e certifique-se de que todo o seu rosto esteja dentro da moldura.",face_cropped_title:"Seu rosto está parcialmente cortado.",face_cropped_message:"Mude sua posição e certifique-se de que todo o seu rosto esteja dentro do enquadramento para uma detecção ideal.",no_face_title:"Rosto não encontrado..",no_face_message:"Aproxime-se da câmera ou ajuste sua posição para que seu rosto fique mais claro e fácil de detectar.",multi_face_title:"Vários rostos foram detectados.",multi_face_message:"Certifique-se de que haja apenas um rosto visível no quadro para continuar.",blur_selfie_title:"O autorretrato está fora de foco.",blur_selfie_message:"Tente tirar uma nova imagem com foco mais claro para melhor detecção.",glare_selfie_title:"Muita reflexão em seu autorretrato.",glare_selfie_message:"Tente tirar outra foto com melhor iluminação e sem brilho para uma detecção precisa.",closed_eyes_title:"Parece que seus olhos estão fechados.",closed_eyes_message:"Por favor, tire a foto novamente com os olhos abertos.",face_occluded_title:"Seu rosto está parcialmente oculto.",face_occluded_message:"Tire outra foto com seu rosto totalmente visível para uma detecção precisa.",face_rotated_title:"Seu rosto está fora de foco.",face_rotated_message:"Por favor, tente pegar outro com foco mais claro para melhor detecção.",barcode_not_found_title:"Estamos tendo problemas para capturar alguns elementos importantes do seu documento, Experimente colocá-lo em um local mais claro.",barcode_not_found_message:"Estamos tendo problemas para capturar alguns elementos importantes do seu documento, Experimente colocá-lo em um local mais claro.",searching_document_autocapture:"Buscando o documento",capturing_document_autocapture:"Capturando, por favor mantenha-se imóvel",click_manual_autocapture:"Clique para capturar manualmente.",glare_blur_issues_autocapture:"Por favor, certifique-se de que não há reflexos de luz antes de tentar novamente",doc_not_in_frame_issues_autocapture:"Por favor, aproxime o documento e certifique-se de que está totalmente dentro da moldura de captura para uma imagem nítida",second_title_face_autocapture:"Prepare-se! Sua selfie será capturada automaticamente, ou toque para capturá-la manualmente",capturing_face_autocapture3:"Capturando... por favor, fique parado por 3",capturing_face_autocapture2:"Capturando... por favor, fique parado por 2",capturing_face_autocapture1:"Capturando... por favor, fique parado por 1",selfie_approval_autocapture:"Ótimo trabalho! Aprove sua selfie para continuar",approve_button:"Aprovar",retake_button:"Tirar novamente"},frCa:{blur_message:"Veuillez faire la mise au point de l’appareil photo sur le document avant de le capturer",blur_title:"Image floue",document_not_found_message:"Munissez-vous d’une pièce d’identité valide délivrée par le gouvernement",document_not_found_title:"Document non détecté",document_not_matching_message:"Veillez à capturer le verso du document",document_not_matching_title:"Non-concordance entre les images du recto et du verso",document_not_supported_message:"Veuillez utiliser une autre pièce d’identité délivrée par le gouvernement",document_not_supported_title:"Document non pris en charge",face_not_found_message:"Assurez-vous que votre visage n’est pas couvert et qu’il est entièrement visible",face_not_found_title:"Visage non détecté",glare_message:"Évitez la lumière directe qui pourrait se refléter sur le document",glare_title:"Reflet détecté",main_title_document_back:"Verso",main_title_document_face:"Égoportrait",main_title_document_front:"Face avant",obstructed_message:"Le document comporte des parties manquantes ou couvertes",obstructed_title:"Informations manquantes",other_error_code_message:"Veuillez réessayer",other_error_code_title:"Une erreur s’est produite",page_header_document:"Numériser le document",page_header_face:"Reconnaissance faciale",second_title_document_back:"Veuillez placer votre document sur une surface solide, le verso vers le haut.",second_title_document_face:"Veuillez positionner votre visage au centre de l’ovale ci-dessous.",second_title_document_front:"Veuillez placer votre document sur une surface solide, photo vers le haut.",wrong_document_side_message:"Le mauvais côté du document a été détecté",wrong_document_side_title:"Mauvais côté du document détecté",face_angle_too_large_title:"votre visage n’est pas directement aligné avec l’appareil photo",face_angle_too_large_message:"Veuillez prendre une autre photo avec votre visage entièrement visible pour une détection précise",face_close_to_border_title:"Votre visage est trop près du bord",face_close_to_border_message:"Veuillez ajuster votre position et vous assurer que l’ensemble de votre visage se trouve dans le cadre",face_too_small_title:"Votre visage est trop éloigné du bord",face_too_small_message:"Veuillez vous rapprocher de la caméra pour que votre visage soit plus clair et plus facile à détecter",face_too_close_title:"Votre visage est trop proche",face_too_close_message:"Veuillez ajuster votre position et vous assurer que l’ensemble de votre visage se trouve dans le cadre",face_cropped_title:"Votre visage est partiellement rogné",face_cropped_message:"Veuillez ajuster votre position et vous assurer que l’ensemble de votre visage se trouve dans le cadre pour optimiser",no_face_title:"Visage introuvable",no_face_message:"Veuillez vous rapprocher de la caméra ou ajuster votre position pour que votre visage soit plus clair et plus facile à détecter",multi_face_title:"Plusieurs visages détectés",multi_face_message:"Veuillez vous assurer qu’un seul visage est visible dans le cadre pour continuer",blur_selfie_title:"L’égoportrait n’est pas net",blur_selfie_message:"Essayez d’en prendre un autre avec une mise au point plus claire pour une meilleure détection",glare_selfie_title:"Trop de reflets sur votre égoportrait",glare_selfie_message:"Veuillez essayer de prendre une autre photo avec un meilleur éclairage et sans reflet pour une détection précise",closed_eyes_title:"Il semble que vos yeux soient fermés.",closed_eyes_message:"Veuillez reprendre la photo avec les yeux ouverts",face_occluded_title:"Votre visage est partiellement caché.",face_occluded_message:"Veuillez prendre une autre photo avec votre visage entièrement visible pour une détection précise",face_rotated_title:"votre visage n’est pas directement aligné avec l’appareil photo",face_rotated_message:"Veuillez prendre une autre photo avec votre visage entièrement visible pour une détection précise",barcode_not_found_title:"Nous avons des difficultés à capturer certains éléments importants de votre document. Veuillez essayer de le placer à un endroit plus clair",barcode_not_found_message:"Nous avons des difficultés à capturer certains éléments importants de votre document. Veuillez essayer de le placer à un endroit plus clair",searching_document_autocapture:"Recherche du document",capturing_document_autocapture:"Capture en cours, veuillez rester immobile",click_manual_autocapture:"Cliquez pour capturer manuellement",glare_blur_issues_autocapture:"Veuillez vous assurer qu’il n’y a pas de reflets de lumière avant de réessayer",doc_not_in_frame_issues_autocapture:"Veuillez rapprocher le document et assurez-vous qu’il soit entièrement dans le cadre de capture pour une image claire",second_title_face_autocapture:"Préparez-vous! Votre selfie sera capturé automatiquement, ou appuyez pour le capturer manuellement",capturing_face_autocapture3:"Capture... en cours, veuillez rester immobile pendant 3",capturing_face_autocapture2:"Capture... en cours, veuillez rester immobile pendant 2",capturing_face_autocapture1:"Capture... en cours, veuillez rester immobile pendant 1",selfie_approval_autocapture:"Bon travail! Approuvez votre selfie pour continuer",approve_button:"Approuver",retake_button:"Reprendre"}};const rp=async(e,t,r,n,i,o)=>{var a,s,u,c,l,d,h;go.HEADERS=xo(r,t);const f=wo.UAParser();let p;if($a.state.isImageSigningEnabled){const e=Fa.crypto.createCryptoBinding("sign");p=await e.sign(n.data)}const g=await(m=e,y={image:{format:n.format,image_type:o,content:n.data,capture_margins:n.captureMargins,signature:p},device_info:{model:null===(a=null==f?void 0:f.device)||void 0===a?void 0:a.model,type:null===(s=null==f?void 0:f.device)||void 0===s?void 0:s.type,manufacturer:null===(u=null==f?void 0:f.device)||void 0===u?void 0:u.vendor,os:null===(c=null==f?void 0:f.os)||void 0===c?void 0:c.name,os_version:null===(l=null==f?void 0:f.os)||void 0===l?void 0:l.version,browser:null===(d=null==f?void 0:f.browser)||void 0===d?void 0:d.name,browser_version:null===(h=null==f?void 0:f.browser)||void 0===h?void 0:h.version,used_camera:null==i?void 0:i.selectedCamera,cameras:null==i?void 0:i.camerasInfo}},Xa({method:"POST",url:"/verify/api/v1/verification/{sid}/images",path:{sid:m},body:y,mediaType:"application/json",errors:{400:"Request is malformed or missing required fields",401:"Access token is malformed, missing data, or expired",404:"Session not found",409:"All required images were successfully submitted"}},y.image.image_type));var m,y;const v=function(e,t){const r=[...e].find(e=>e.includes(t));return void 0!==r?r[1]:void 0}(g.headers,"x-ts-processing-time-ms");return"ok"!==g.body.feedback&&console.error("Error",g),{missing_images:g.body.missing_images,feedback:g.body.feedback,custom_feedback:g.body.custom_feedback,has_barcode:g.body.has_barcode,serverProcessingTime:v}},np=()=>{const e=document.getElementById("overlay-frame");if(e){const t=e.getBoundingClientRect(),r=(3840-screen.width)/2,n=(2160-screen.height)/2;return{top:n+t.top,bottom:n+t.bottom,right:r+t.right,left:r+t.left}}},ip=e=>["document_front","document_back"].includes(e)?"environment":"user";function op(e){switch(e){case"document_front":return yo.image_type.DOCUMENT_FRONT;case"document_back":return yo.image_type.DOCUMENT_BACK;case"selfie":return yo.image_type.SELFIE}}var ap={},sp={get exports(){return ap},set exports(e){ap=e}};sp.exports=function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t,r){r.d(t,"b",function(){return o}),r.d(t,"c",function(){return a});var n=r(1),i=r(7);r.d(t,"a",function(){return i.a}),r.d(t,"d",function(){return n.b});var o=n.a.FACING_MODES,a=n.a.IMAGE_TYPES},function(e,t,r){var n=r(6);r.d(t,"a",function(){return n.a});var i=r(2);r.d(t,"b",function(){return i.a})},function(e,t,r){function n(e,t){if(!(t>=0&&t<=1))throw new Error(t+" is invalid imageCompression, choose between: [0, 1]");if(!h.f.includes(e))throw new Error(e+" is invalid imageType, choose between: "+h.f.join(", "));return!0}function i(e,t){var r={};try{n(e,t),r.imageType=e,r.imageCompression=t}catch(e){console.error(e),console.error("default value of "+h.c.PNG+" is used"),r.imageType=h.c.PNG,r.imageCompression=null}return r}function o(){var e=window.navigator.platform,t=window.navigator.userAgent;return e||t}function a(){return"ontouchend"in document}function s(e,t,r){var n=e*parseFloat(r);return{imageWidth:n,imageHeight:t/(e/n)}}function u(e,t,r){return i(t,r).imageType===h.c.JPG?r?e.toDataURL(h.b[h.c.JPG],r):e.toDataURL(h.b[h.c.JPG]):e.toDataURL(h.b[t])}function c(e,t){return e||t}function l(){var e=o();if(/iPad|iPhone|iPod/.test(e))return!0;var t=a();return!(!/Mac/.test(e)||!t)}function d(){return{userAgent:window.navigator.userAgent,platform:window.navigator.platform,_getStringWithPlatform:o(),_getHasTouchEvents:a(),getIsIOS:l()}}t.c=s,t.b=u,t.e=c,t.d=l,t.a=d;var h=r(3)},function(e,t,r){function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,"e",function(){return o}),r.d(t,"a",function(){return a}),r.d(t,"f",function(){return s}),r.d(t,"c",function(){return u}),r.d(t,"b",function(){return c}),r.d(t,"d",function(){return l});var i,o=["user","environment"],a={USER:"user",ENVIRONMENT:"environment"},s=["jpg","png"],u={PNG:"png",JPG:"jpg"},c=(n(i={},"jpg","image/jpeg"),n(i,"png","image/png"),i),l={audio:!1,video:!0}},function(e,t,r){e.exports=r(5)},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);r.d(t,"FACING_MODES",function(){return n.b}),r.d(t,"IMAGE_TYPES",function(){return n.c}),r.d(t,"_getDebugPlatformInfo",function(){return n.d});var i=r(9);r.d(t,"downloadPhoto",function(){return i.a}),t.default=n.a},function(e,t,r){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}r.d(t,"a",function(){return s});var i=r(2),o=r(3),a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(){function e(){n(this,e)}return a(e,null,[{key:"getDataUri",value:function(e,t){var r=t.sizeFactor,n=t.imageType,o=t.imageCompression,a=t.isImageMirror,s=e.videoWidth,u=e.videoHeight,c=Object(i.c)(s,u,r),l=c.imageWidth,d=c.imageHeight,h=document.createElement("canvas");h.width=l,h.height=d;var f=h.getContext("2d");return a&&f.setTransform(-1,0,0,1,h.width,0),f.drawImage(e,0,0,l,d),Object(i.b)(h,n,o)}},{key:"getWindowURL",value:function(){return window.URL||window.webkitURL||window.mozURL||window.msURL}},{key:"getNavigatorMediaDevices",value:function(){var e=null,t=!(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia),r=!(!navigator.mozGetUserMedia&&!navigator.webkitGetUserMedia);if(t)e=navigator.mediaDevices;else if(r){var n=navigator.mozGetUserMedia||navigator.webkitGetUserMedia,i={getUserMedia:function(e){return new Promise(function(t,r){n.call(navigator,e,t,r)})}};e=Object.assign(n,i)}return e}},{key:"isSupportedFacingMode",value:function(){return e.getNavigatorMediaDevices().getSupportedConstraints().facingMode}},{key:"getIdealConstraints",value:function(t,r){if(!Object(i.e)(t,r))return o.d;var n=e.getNavigatorMediaDevices().getSupportedConstraints();if(!n.width||!n.height)return console.error("Constraint width or height not supported! fallback to default resolution"),o.d;var a=void 0,s=void 0;return t&&(o.e.includes(t)?a=t:s={exact:t}),{audio:!1,video:{facingMode:a,deviceId:s,width:r&&r.width,height:r&&r.height}}}},{key:"getMaxResolutionConstraints",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments[1];console.warn("getMaxResolutionConstraints() numberOfMaxResolutionTry:",r);var n=[{width:{min:640}},{width:{min:800}},{width:{min:900}},{width:{min:1024}},{width:{min:1080}},{width:{min:1280}},{width:{min:1920}},{width:{min:2560}},{width:{min:3840}}],o=e.getIdealConstraints(t,{});if(0===r)return Object(i.d)()?(console.warn("fallback to iOS constraints"),e.getIdealConstraints(t,{width:{min:640,ideal:3840},height:{min:480,ideal:2160}})):(o.video.advanced=n,o);if(r<n.length){var a=n.slice(0,-r);return o.video.advanced=a,o}return null}},{key:"FACING_MODES",get:function(){return o.a}},{key:"IMAGE_TYPES",get:function(){return o.c}}]),e}()},function(e,t,r){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}r.d(t,"a",function(){return u});var i=r(1),o=r(8),a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=i.a.IMAGE_TYPES.PNG,u=function(){function e(t){n(this,e),this.videoElement=t,this.stream=null,this.numberOfMaxResolutionTry=0,this.settings=null,this.cameras=[],this.windowURL=i.a.getWindowURL(),this.mediaDevices=i.a.getNavigatorMediaDevices()}return a(e,[{key:"_getStreamDevice",value:function(e,t){var r=this;return new Promise(function(n,o){var a=i.a.getIdealConstraints(e,t);r.mediaDevices.getUserMedia(a).then(function(e){r._gotStream(e),n(e)}).catch(function(e){o(e)})})}},{key:"_getStreamDeviceMaxResolution",value:function(e){var t=this,r=i.a.getMaxResolutionConstraints(e,this.numberOfMaxResolutionTry);if(null==r){var n={};return this._getStreamDevice(e,n)}return new Promise(function(n,i){t.mediaDevices.getUserMedia(r).then(function(e){t._gotStream(e),n(e)}).catch(function(r){setTimeout(function(){t.numberOfMaxResolutionTry+=1,t._getStreamDeviceMaxResolution(e).catch(function(){i(r)})},20)})})}},{key:"_setVideoSrc",value:function(e){if("srcObject"in this.videoElement)this.videoElement.srcObject=e;else{var t=this.windowURL.createObjectURL(e);this.videoElement.src=t}}},{key:"_setSettings",value:function(e){this.settings=null;var t=e&&e.getTracks?e.getTracks():[];t.length>0&&t[0].getSettings&&(this.settings=t[0].getSettings())}},{key:"_enumerateCamerasPromise",value:function(){var e=this;return new Promise(function(t,r){var n=[];e.mediaDevices.enumerateDevices().then(function(e){e.forEach(function(e){"videoinput"===e.kind&&e.deviceId&&n.push(e)}),t(n)}).catch(function(e){r(e)})})}},{key:"_gotStream",value:function(e){this.stream=e,this._setSettings(e),this._setVideoSrc(e)}},{key:"getCameraSettings",value:function(){return this.settings}},{key:"enumerateCameras",value:function(){var e=this;return this.stream?this._enumerateCamerasPromise():this.stopCamera().then(function(){}).catch(function(){}).then(function(){var t={video:!0};return e.mediaDevices.getUserMedia(t).then(function(e){setTimeout(function(){e.getTracks().forEach(function(e){e.stop()})},20)}).then(function(){}).catch(function(){}).then(function(){return e._enumerateCamerasPromise()})})}},{key:"startCamera",value:function(e,t){var r=this;return this.stopCamera().then(function(){}).catch(function(){}).then(function(){return r._getStreamDevice(e,t)})}},{key:"startCameraMaxResolution",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.numberOfMaxResolutionTry=0,this.stopCamera().then(function(){}).catch(function(){}).then(function(){return e._getStreamDeviceMaxResolution(t)})}},{key:"getDataUri",value:function(e){var t={sizeFactor:void 0===e.sizeFactor?o.c:e.sizeFactor,imageType:void 0===e.imageType?s:e.imageType,imageCompression:void 0===e.imageCompression?o.a:e.imageCompression,isImageMirror:void 0===e.isImageMirror?o.b:e.isImageMirror};return i.a.getDataUri(this.videoElement,t)}},{key:"stopCamera",value:function(){var e=this;return new Promise(function(t,r){e.stream&&(e.stream.getTracks().forEach(function(e){e.stop()}),e.videoElement.src="",e.stream=null,e._setSettings(null),t()),r(Error("no stream to stop!"))})}}]),e}()},function(e,t,r){r.d(t,"c",function(){return n}),r.d(t,"a",function(){return i}),r.d(t,"b",function(){return o});var n=1,i=null,o=!1},function(e,t,r){var n=r(10);r.d(t,"a",function(){return n.a})},function(e,t,r){function n(e){for(var t=atob(e.split(",")[1]),r=e.split(",")[0].split(":")[1].split(";")[0],n=new ArrayBuffer(t.length),i=new Uint8Array(n),o=0;o<t.length;o++)i[o]=t.charCodeAt(o);return new Blob([n],{type:r})}function i(e,t){return(e+="").length>=t?e:new Array(t-e.length+1).join("0")+e}function o(e){var t=c.c.PNG;return"image/jpeg"===e&&(t=c.c.JPG),t}function a(e,t,r){return e+"-"+i(t,4)+"."+o(r)}function s(e,t,r){window.URL=window.webkitURL||window.URL;var n=document.createElement("a");n.download=a(t,r,e.type),n.href=window.URL.createObjectURL(e);var i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(i)}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"photo",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;s(n(e),t,r)}t.a=u;var c=r(0)}]);var up=Z(ap);class cp{constructor(){this.currentStream=null,this.currentConstraints=null}static getInstance(){return cp.instance||(cp.instance=new cp),cp.instance}getStream(){return this.currentStream}isStreaming(){return this.currentStream&&this.currentStream.getTracks().some(e=>"live"===e.readyState)}stopStream(){this.currentStream&&(this.currentStream.getTracks().forEach(e=>e.stop()),this.currentStream=null)}areConstraintsEqual(e){return!!this.currentConstraints&&JSON.stringify(this.currentConstraints)===JSON.stringify(e)}async startNewStream(e){this.isStreaming()&&this.areConstraintsEqual(e)||(this.stopStream(),this.currentStream=await navigator.mediaDevices.getUserMedia(e),this.currentConstraints=e)}async enumerateDevices(){try{return await navigator.mediaDevices.enumerateDevices()}catch(e){throw console.error("Failed to enumerate devices:",e),e}}}const lp=[{os:{name:"Android"},label:"2 0"}];async function dp(){const e=(await async function(){const e=cp.getInstance();let t=await e.enumerateDevices();return t.filter(e=>"videoinput"===e.kind).every(e=>""===e.label)&&(await e.startNewStream({video:{facingMode:{ideal:"environment"}},audio:!1}),t=await e.enumerateDevices(),e.stopStream()),t}()).filter(e=>{if(!(null==e?void 0:e.label)||"videoinput"!==e.kind||""===e.label)return!1;const t=e.label.toLowerCase();return hp.some(e=>t.includes(e))}),t=wo.UAParser(),r=e.find(e=>lp.find(r=>r.os.name===t.os.name&&e.label.includes(r.label)));return r?{optionalCameras:e,selectedCamera:r}:{optionalCameras:e}}const hp=["rear","back","rück","arrière","trasera","trás","traseira","posteriore","后面","後面","背面","后置","後置","背置","задней","الخلفية","후","arka","achterzijde","หลัง","baksidan","bagside","sau","bak","tylny","takakamera","belakang","אחורית","πίσω","spate","hátsó","zadní","darrere","zadná","задня","stražnja","belakang","बैक","camera2 0, facing back"],fp={width:{min:640,max:3840,ideal:3840},height:{min:480,max:2160,ideal:2160},frameRate:30},pp={width:{min:640,max:1280,ideal:1280},height:{min:480,max:720,ideal:720},frameRate:30},gp=async e=>{var t,r;let n;return"environment"==e&&(n=await dp()),null!==(r=null===(t=null==n?void 0:n.selectedCamera)||void 0===t?void 0:t.deviceId)&&void 0!==r?r:e},mp=(e,t)=>{var r,n;return"user"===e?null!==(r=null==t?void 0:t.selfieVideoConstraints)&&void 0!==r?r:pp:null!==(n=null==t?void 0:t.environmentVideoConstraints)&&void 0!==n?n:fp},yp=e=>{const t=Jf({tagName:"video",style:{position:"absolute",zIndex:"0",top:"0",width:"100%",height:"100%",objectFit:"cover"},id:"video",testid:"video"});return t.style.transform="user"===e?"scaleX(-1)":"",t.autoplay=!0,t.muted=!0,t.setAttribute("playsinline","true"),t},vp={title:"other_error_code_title",message:"other_error_code_message"},bp={ok:vp,document_face_not_found:vp,restricted_criteria:vp,other:vp,glare:{title:"glare_title",message:"glare_message"},document_not_found:{title:"document_not_found_title",message:"document_not_found_message"},blur:{title:"blur_title",message:"blur_message"},document_not_supported:{title:"document_not_supported_title",message:"document_not_supported_message"},obstructed:{title:"obstructed_title",message:"obstructed_message"},document_not_matching:{title:"document_not_matching_title",message:"document_not_matching_message"},face_not_found:{title:"face_not_found_title",message:"face_not_found_message"},wrong_document_side:{title:"wrong_document_side_title",message:"wrong_document_side_message"},glare_selfie:{title:"glare_selfie_title",message:"glare_selfie_message"},blur_selfie:{title:"blur_selfie_title",message:"blur_selfie_message"},multi_face:{title:"multi_face_title",message:"multi_face_message"},face_rotated:{title:"face_rotated_title",message:"face_rotated_message"},face_too_small:{title:"face_too_small_title",message:"face_too_small_message"},face_too_close:{title:"face_too_close_title",message:"face_too_close_message"},closed_eyes:{title:"closed_eyes_title",message:"closed_eyes_message"},face_angle_too_large:{title:"face_angle_too_large_title",message:"face_angle_too_large_message"},face_close_to_border:{title:"face_close_to_border_title",message:"face_close_to_border_message"},face_occluded:{title:"face_occluded_title",message:"face_occluded_message"},face_cropped:{title:"face_cropped_title",message:"face_cropped_message"},barcode_not_found:{title:"barcode_not_found_title",message:"barcode_not_found_message"}},wp={loading_screen:{page:"page_header_document",title:"main_title_document_front",instructions:"loading_screen_small_title"},document_front:{page:"page_header_document",title:"main_title_document_front",instructions:"second_title_document_front"},document_back:{page:"page_header_document",title:"main_title_document_back",instructions:"second_title_document_back"},selfie:{page:"page_header_face",title:"main_title_document_face",instructions:"second_title_document_face"}},_p=(e,t)=>{const r=Jf({tagName:"div",style:{display:"flex",justifyContent:"center",flexDirection:"column",alignItems:"center",position:"relative",zIndex:"1",background:"transparent",boxShadow:"0 0 0 1000px rgb(0 0 0 / 50%)",borderStyle:"solid",borderWidth:"1px",borderColor:"white"},id:`overlay-frame ${e}`,testid:`overlay-frame ${e}`});if("environment"===e){!function(e){$f(e,Jf({tagName:"div",style:{position:"absolute",top:"-2px",left:"-2px",width:"20px",height:"20px",backgroundColor:"transparent",borderTopStyle:"solid",borderRightStyle:"none",borderBottomStyle:"none",borderLeftStyle:"solid",borderColor:"white",borderWidth:"4px"},id:"overlay-frame__top-left",testid:"overlay-frame__top-left"})),$f(e,Jf({tagName:"div",style:{position:"absolute",top:"-2px",right:"-2px",width:"20px",height:"20px",backgroundColor:"transparent",borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"none",borderLeftStyle:"none",borderColor:"white",borderWidth:"4px"},id:"overlay-frame__top-right",testid:"overlay-frame__top-right"})),$f(e,Jf({tagName:"div",style:{position:"absolute",bottom:"-2px",right:"-2px",width:"20px",height:"20px",backgroundColor:"transparent",borderTopStyle:"none",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"none",borderColor:"white",borderWidth:"4px"},id:"overlay-frame__bottom-right",testid:"overlay-frame__bottom-right"})),$f(e,Jf({tagName:"div",style:{position:"absolute",bottom:"-2px",left:"-2px",width:"20px",height:"20px",backgroundColor:"transparent",borderTopStyle:"none",borderRightStyle:"none",borderBottomStyle:"solid",borderLeftStyle:"solid",borderColor:"white",borderWidth:"4px"},id:"overlay-frame__bottom-left",testid:"overlay-frame__bottom-left"}))}(r);const e=.85*t.clientWidth;r.style.width=`${e}px`,r.style.height=.65*e+"px",r.style.maxHeight=.5*window.innerHeight+"px"}else{const e=t.clientWidth*(t.clientHeight<700?.8:.85);r.style.width=.8*e+"px",r.style.height=`${e}px`,r.style.minHeight=.8*e+"px",r.style.maxHeight=.5*window.innerHeight+"px",r.style.borderRadius="50%"}return r};const Ap=e=>{const t=document.createElementNS("http://www.w3.org/2000/svg","svg");return t.setAttribute("viewBox","0 0 68 68"),t.innerHTML=`<style>.spinner-autocapture circle {animation: rotate 1.5s linear infinite;} @keyframes rotate { 50% {stroke-dashoffset: 94; stroke-dasharray: 6 57; } 100% { stroke-dashoffset: 188; stroke-dasharray: 51 12; }} </style> <g class="spinner-autocapture"> <circle cx="34" cy="34" fill="none" r="30" stroke-width="4" stroke="${null!=e?e:"#fff"}" stroke-dasharray="51 12" stroke-linecap="round" stroke-dashoffset="0" /> </g>`,t};function Ep(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("width","16px"),e.setAttribute("height","16px"),e.innerHTML='\n <path d="M8 16C12.4187 16 16 12.4187 16 8C16 3.58125 12.4187 0 8 0C3.58125 0 0 3.58125 0 8C0 12.4187 3.58125 16 8 16ZM8 4C8.41562 4 8.75 4.33437 8.75 4.75V8.25C8.75 8.66562 8.41562 9 8 9C7.58437 9 7.25 8.66562 7.25 8.25V4.75C7.25 4.33437 7.58437 4 8 4ZM9 11C9 11.5531 8.55313 12 8 12C7.44688 12 7 11.5531 7 11C7 10.4469 7.44688 10 8 10C8.55313 10 9 10.4469 9 11Z" fill="#F2F2F2"/>\n ',e}const Cp={all:{color:"black",margin:"0"},1:{color:"white",fontSize:"var(--font-size-4xl)",fontWeight:"var(--font-weight-bold)"},2:{color:"white",fontSize:"var(--font-size-2xl)",fontWeight:"var(--font-weight-semibold)"},3:{color:"white",fontSize:"var(--font-size-xl)",fontWeight:"var(--font-weight-medium)"},4:{fontSize:"var(--font-size-lg)",fontWeight:"var(--font-weight-regular)"},5:{fontSize:"var(--font-size-md)",fontWeight:"var(--font-weight-light)"},6:{fontSize:"var(--font-size-sm)",fontWeight:"var(--font-weight-light)"}},xp=e=>{let{text:t,level:r=1,style:i={},id:o,testid:a}=e;const s=Jf({tagName:`h${r}`,style:n(n(n({},Cp.all),Cp[r]),i),id:o,testid:a});return s.textContent=t,s.id=o,s};var Sp,Ip={};let Tp=null;try{Tp=(Sp||(Sp=1,function(e,r){!function(e){function r(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function i(t){e.defaults=t}e.defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};const o={exec:()=>null};function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r="string"==typeof e?e:e.source;const n={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace(s.caret,"$1"),r=r.replace(e,i),n},getRegex:()=>new RegExp(r,t)};return n}const s={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10107}-\u{10133}\u{10140}-\u{10178}\u{1018A}\u{1018B}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E1}-\u{102FB}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{103A0}-\u{103C3}\u{103C8}-\u{103CF}\u{103D1}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{10570}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10858}-\u{10876}\u{10879}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{10940}-\u{10959}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A60}-\u{10A7E}\u{10A80}-\u{10A9F}\u{10AC0}-\u{10AC7}\u{10AC9}-\u{10AE4}\u{10AEB}-\u{10AEF}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D6F}-\u{10D85}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC7}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F54}\u{10F70}-\u{10F81}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{11003}-\u{11037}\u{11052}-\u{1106F}\u{11071}\u{11072}\u{11075}\u{11083}-\u{110AF}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11103}-\u{11126}\u{11136}-\u{1113F}\u{11144}\u{11147}\u{11150}-\u{11172}\u{11176}\u{11183}-\u{111B2}\u{111C1}-\u{111C4}\u{111D0}-\u{111DA}\u{111DC}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{1122B}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A8}\u{112B0}-\u{112DE}\u{112F0}-\u{112F9}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}\u{11350}\u{1135D}-\u{11361}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}\u{113D1}\u{113D3}\u{11400}-\u{11434}\u{11447}-\u{1144A}\u{11450}-\u{11459}\u{1145F}-\u{11461}\u{11480}-\u{114AF}\u{114C4}\u{114C5}\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115AE}\u{115D8}-\u{115DB}\u{11600}-\u{1162F}\u{11644}\u{11650}-\u{11659}\u{11680}-\u{116AA}\u{116B8}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{11730}-\u{1173B}\u{11740}-\u{11746}\u{11800}-\u{1182B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{1192F}\u{1193F}\u{11941}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D0}\u{119E1}\u{119E3}\u{11A00}\u{11A0B}-\u{11A32}\u{11A3A}\u{11A50}\u{11A5C}-\u{11A89}\u{11A9D}\u{11AB0}-\u{11AF8}\u{11BC0}-\u{11BE0}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2E}\u{11C40}\u{11C50}-\u{11C6C}\u{11C72}-\u{11C8F}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D89}\u{11D98}\u{11DA0}-\u{11DA9}\u{11DB0}-\u{11DDB}\u{11DE0}-\u{11DE9}\u{11EE0}-\u{11EF2}\u{11F02}\u{11F04}-\u{11F10}\u{11F12}-\u{11F33}\u{11F50}-\u{11F59}\u{11FB0}\u{11FC0}-\u{11FD4}\u{12000}-\u{12399}\u{12400}-\u{1246E}\u{12480}-\u{12543}\u{12F90}-\u{12FF0}\u{13000}-\u{1342F}\u{13441}-\u{13446}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\u{16130}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A70}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16B00}-\u{16B2F}\u{16B40}-\u{16B43}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D6C}\u{16D70}-\u{16D79}\u{16E40}-\u{16E96}\u{16EA0}-\u{16EB8}\u{16EBB}-\u{16ED3}\u{16F00}-\u{16F4A}\u{16F50}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF2}-\u{16FF6}\u{17000}-\u{18CD5}\u{18CFF}-\u{18D1E}\u{18D80}-\u{18DF2}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1CCF0}-\u{1CCF9}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1D7CE}-\u{1D7FF}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E2F0}-\u{1E2F9}\u{1E4D0}-\u{1E4EB}\u{1E4F0}-\u{1E4F9}\u{1E5D0}-\u{1E5ED}\u{1E5F0}-\u{1E5FA}\u{1E6C0}-\u{1E6DE}\u{1E6E0}-\u{1E6E2}\u{1E6E4}\u{1E6E5}\u{1E6E7}-\u{1E6ED}\u{1E6F0}-\u{1E6F4}\u{1E6FE}\u{1E6FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1EC71}-\u{1ECAB}\u{1ECAD}-\u{1ECAF}\u{1ECB1}-\u{1ECB4}\u{1ED01}-\u{1ED2D}\u{1ED2F}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{1F100}-\u{1F10C}\u{1FBF0}-\u{1FBF9}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B81D}\u{2B820}-\u{2CEAD}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{33479}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},u=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,c=/(?:[*+-]|\d{1,9}[.)])/,l=a(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,c).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),d=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,h=/(?!\s*\])(?:\\.|[^\[\]\\])+/,f=a(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",h).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),p=a(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,c).getRegex(),g="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",m=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,y=a("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",m).replace("tag",g).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),v=a(d).replace("hr",u).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",g).getRegex(),b={blockquote:a(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",v).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:f,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:u,html:y,lheading:l,list:p,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:v,table:o,text:/^[^\n]+/},w=a("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",u).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",g).getRegex(),_=n(n({},b),{},{table:w,paragraph:a(d).replace("hr",u).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",w).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",g).getRegex()}),A=n(n({},b),{},{html:a("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",m).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:o,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:a(d).replace("hr",u).replace("heading"," *#{1,6} *[^\n]").replace("lheading",l).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),E=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,C=/^( {2,}|\\)\n(?!\s*$)/,x="\\p{P}\\p{S}",S=a(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,x).getRegex(),I=a(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,x).getRegex(),T=a("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,x).getRegex(),M=a("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,x).getRegex(),D=a(/\\([punct])/,"gu").replace(/punct/g,x).getRegex(),R=a(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),O=a(m).replace("(?:--\x3e|$)","--\x3e").getRegex(),k=a("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",O).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),N=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,P=a(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",N).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),B=a(/^!?\[(label)\]\[(ref)\]/).replace("label",N).replace("ref",h).getRegex(),F=a(/^!?\[(ref)\](?:\[\])?/).replace("ref",h).getRegex(),L={_backpedal:o,anyPunctuation:D,autolink:R,blockSkip:/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,br:C,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:o,emStrongLDelim:I,emStrongRDelimAst:T,emStrongRDelimUnd:M,escape:E,link:P,nolink:F,punctuation:S,reflink:B,reflinkSearch:a("reflink|nolink(?!\\()","g").replace("reflink",B).replace("nolink",F).getRegex(),tag:k,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:o},z=n(n({},L),{},{link:a(/^!?\[(label)\]\((.*?)\)/).replace("label",N).getRegex(),reflink:a(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",N).getRegex()}),U=n(n({},L),{},{escape:a(E).replace("])","~|])").getRegex(),url:a(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),j=n(n({},U),{},{br:a(C).replace("{2,}","*").getRegex(),text:a(U.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),V={normal:b,gfm:_,pedantic:A},H={normal:L,gfm:U,breaks:j,pedantic:z},G={"&":"&","<":"<",">":">",'"':""","'":"'"},q=e=>G[e];function W(e,t){if(t){if(s.escapeTest.test(e))return e.replace(s.escapeReplace,q)}else if(s.escapeTestNoEncode.test(e))return e.replace(s.escapeReplaceNoEncode,q);return e}function K(e){try{e=encodeURI(e).replace(s.percentDecode,"%")}catch(e){return null}return e}function X(e,t){const r=e.replace(s.findPipe,(e,t,r)=>{let n=!1,i=t;for(;--i>=0&&"\\"===r[i];)n=!n;return n?"|":" |"}).split(s.splitPipe);let n=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace(s.slashPipe,"|");return r}function Y(e,t,r){const n=e.length;if(0===n)return"";let i=0;for(;i<n;){const o=e.charAt(n-i-1);if(o!==t||r){if(o===t||!r)break;i++}else i++}return e.slice(0,n-i)}function Z(e,t,r,n,i){const o=t.href,a=t.title||null,s=e[1].replace(i.other.outputLinkReplace,"$1");if("!"!==e[0].charAt(0)){n.state.inLink=!0;const e={type:"link",raw:r,href:o,title:a,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,e}return{type:"image",raw:r,href:o,title:a,text:s}}class J{constructor(r){t(this,"options",void 0),t(this,"rules",void 0),t(this,"lexer",void 0),this.options=r||e.defaults}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Y(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],r=function(e,t,r){const n=e.match(r.other.indentCodeCompensation);if(null===n)return t;const i=n[1];return t.split("\n").map(e=>{const t=e.match(r.other.beginningSpace);if(null===t)return e;const[n]=t;return n.length>=i.length?e.slice(i.length):e}).join("\n")}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){const t=Y(e,"#");this.options.pedantic?e=t.trim():t&&!this.rules.other.endingSpaceChar.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Y(t[0],"\n")}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=Y(t[0],"\n").split("\n"),r="",n="";const i=[];for(;e.length>0;){let t=!1;const o=[];let a;for(a=0;a<e.length;a++)if(this.rules.other.blockquoteStart.test(e[a]))o.push(e[a]),t=!0;else{if(t)break;o.push(e[a])}e=e.slice(a);const s=o.join("\n"),u=s.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}\n${s}`:s,n=n?`${n}\n${u}`:u;const c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,i,!0),this.lexer.state.top=c,0===e.length)break;const l=i[i.length-1];if("code"===(null==l?void 0:l.type))break;if("blockquote"===(null==l?void 0:l.type)){const t=l,o=t.raw+"\n"+e.join("\n"),a=this.blockquote(o);i[i.length-1]=a,r=r.substring(0,r.length-t.raw.length)+a.raw,n=n.substring(0,n.length-t.text.length)+a.text;break}if("list"!==(null==l?void 0:l.type));else{const t=l,o=t.raw+"\n"+e.join("\n"),a=this.list(o);i[i.length-1]=a,r=r.substring(0,r.length-l.raw.length)+a.raw,n=n.substring(0,n.length-t.raw.length)+a.raw,e=o.substring(i[i.length-1].raw.length).split("\n")}}return{type:"blockquote",raw:r,tokens:i,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim();const n=r.length>1,i={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");const o=this.rules.other.listItemRegex(r);let a=!1;for(;e;){let r=!1,n="",s="";if(!(t=o.exec(e)))break;if(this.rules.block.hr.test(e))break;n=t[0],e=e.substring(n.length);let u=t[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,e=>" ".repeat(3*e.length)),c=e.split("\n",1)[0],l=!u.trim(),d=0;if(this.options.pedantic?(d=2,s=u.trimStart()):l?d=t[1].length+1:(d=t[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=u.slice(d),d+=t[1].length),l&&this.rules.other.blankLine.test(c)&&(n+=c+"\n",e=e.substring(c.length+1),r=!0),!r){const t=this.rules.other.nextBulletRegex(d),r=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),o=this.rules.other.headingBeginRegex(d),a=this.rules.other.htmlBeginRegex(d);for(;e;){const h=e.split("\n",1)[0];let f;if(c=h,this.options.pedantic?(c=c.replace(this.rules.other.listReplaceNesting," "),f=c):f=c.replace(this.rules.other.tabCharGlobal," "),i.test(c))break;if(o.test(c))break;if(a.test(c))break;if(t.test(c))break;if(r.test(c))break;if(f.search(this.rules.other.nonSpaceChar)>=d||!c.trim())s+="\n"+f.slice(d);else{if(l)break;if(u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4)break;if(i.test(u))break;if(o.test(u))break;if(r.test(u))break;s+="\n"+c}l||c.trim()||(l=!0),n+=h+"\n",e=e.substring(h.length+1),u=f.slice(d)}}i.loose||(a?i.loose=!0:this.rules.other.doubleBlankLine.test(n)&&(a=!0));let h,f=null;this.options.gfm&&(f=this.rules.other.listIsTask.exec(s),f&&(h="[ ] "!==f[0],s=s.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:n,task:!!f,checked:h,loose:!1,text:s,tokens:[]}),i.raw+=n}i.items[i.items.length-1].raw=i.items[i.items.length-1].raw.trimEnd(),i.items[i.items.length-1].text=i.items[i.items.length-1].text.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){const t=i.items[e].tokens.filter(e=>"space"===e.type),r=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw));i.loose=r}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:r,title:n}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!this.rules.other.tableDelimiter.test(t[2]))return;const r=X(t[1]),n=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]&&t[3].trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===n.length){for(const e of n)this.rules.other.tableAlignRight.test(e)?o.align.push("right"):this.rules.other.tableAlignCenter.test(e)?o.align.push("center"):this.rules.other.tableAlignLeft.test(e)?o.align.push("left"):o.align.push(null);for(let e=0;e<r.length;e++)o.header.push({text:r[e],tokens:this.lexer.inline(r[e]),header:!0,align:o.align[e]});for(const e of i)o.rows.push(X(e,o.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:o.align[t]})));return o}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;const t=Y(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let r=0;for(let n=0;n<e.length;n++)if("\\"===e[n])n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&(r--,r<0))return n;return-1}(t[2],"()");if(e>-1){const r=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,r).trim(),t[3]=""}}let r=t[2],n="";if(this.options.pedantic){const e=this.rules.other.pedanticHrefTitle.exec(r);e&&(r=e[1],n=e[3])}else n=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(r=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?r.slice(1):r.slice(1,-1)),Z(t,{href:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r,title:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n},t[0],this.lexer,this.rules)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){const e=t[(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){const e=r[0].charAt(0);return{type:"text",raw:e,text:e}}return Z(r,e,r[0],this.lexer,this.rules)}}emStrong(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=this.rules.inline.emStrongLDelim.exec(e);if(n&&(!n[3]||!r.match(this.rules.other.unicodeAlphaNumeric))&&(!n[1]&&!n[2]||!r||this.rules.inline.punctuation.exec(r))){const r=[...n[0]].length-1;let i,o,a=r,s=0;const u="*"===n[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+r);null!=(n=u.exec(t));){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i)continue;if(o=[...i].length,n[3]||n[4]){a+=o;continue}if((n[5]||n[6])&&r%3&&!((r+o)%3)){s+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a+s);const t=[...n[0]][0].length,u=e.slice(0,r+n.index+t+o);if(Math.min(r,o)%2){const e=u.slice(1,-1);return{type:"em",raw:u,text:e,tokens:this.lexer.inlineTokens(e)}}const c=u.slice(2,-2);return{type:"strong",raw:u,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(e),n=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return r&&n&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,r;return"@"===t[2]?(e=t[1],r="mailto:"+e):(e=t[1],r=e),{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,i;if("@"===t[2])e=t[0],i="mailto:"+e;else{let o;do{var r,n;o=t[0],t[0]=null!==(r=null===(n=this.rules.inline._backpedal.exec(t[0]))||void 0===n?void 0:n[0])&&void 0!==r?r:""}while(o!==t[0]);e=t[0],i="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}}class ${constructor(r){t(this,"tokens",void 0),t(this,"options",void 0),t(this,"state",void 0),t(this,"tokenizer",void 0),t(this,"inlineQueue",void 0),this.tokens=[],this.tokens.links=Object.create(null),this.options=r||e.defaults,this.options.tokenizer=this.options.tokenizer||new J,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={other:s,block:V.normal,inline:H.normal};this.options.pedantic?(n.block=V.pedantic,n.inline=H.pedantic):this.options.gfm&&(n.block=V.gfm,this.options.breaks?n.inline=H.breaks:n.inline=H.gfm),this.tokenizer.rules=n}static get rules(){return{block:V,inline:H}}static lex(e,t){return new $(t).lex(e)}static lexInline(e,t){return new $(t).inlineTokens(e)}lex(e){e=e.replace(s.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){const t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e){let t,r,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(this.options.pedantic&&(e=e.replace(s.tabCharGlobal," ").replace(s.spaceLine,""));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(r=>!!(t=r.call({lexer:this},e,i))&&(e=e.substring(t.raw.length),i.push(t),!0))))if(t=this.tokenizer.space(e))e=e.substring(t.raw.length),1===t.raw.length&&i.length>0?i[i.length-1].raw+="\n":i.push(t);else if(t=this.tokenizer.code(e))e=e.substring(t.raw.length),r=i[i.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?i.push(t):(r.raw+="\n"+t.raw,r.text+="\n"+t.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(t=this.tokenizer.fences(e))e=e.substring(t.raw.length),i.push(t);else if(t=this.tokenizer.heading(e))e=e.substring(t.raw.length),i.push(t);else if(t=this.tokenizer.hr(e))e=e.substring(t.raw.length),i.push(t);else if(t=this.tokenizer.blockquote(e))e=e.substring(t.raw.length),i.push(t);else if(t=this.tokenizer.list(e))e=e.substring(t.raw.length),i.push(t);else if(t=this.tokenizer.html(e))e=e.substring(t.raw.length),i.push(t);else if(t=this.tokenizer.def(e))e=e.substring(t.raw.length),r=i[i.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title}):(r.raw+="\n"+t.raw,r.text+="\n"+t.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(t=this.tokenizer.table(e))e=e.substring(t.raw.length),i.push(t);else if(t=this.tokenizer.lheading(e))e=e.substring(t.raw.length),i.push(t);else{var a;if(n=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const r=e.slice(1);let i;this.options.extensions.startBlock.forEach(e=>{i=e.call({lexer:this},r),"number"==typeof i&&i>=0&&(t=Math.min(t,i))}),t<1/0&&t>=0&&(n=e.substring(0,t+1))}if(this.state.top&&(t=this.tokenizer.paragraph(n)))r=i[i.length-1],o&&"paragraph"===(null===(a=r)||void 0===a?void 0:a.type)?(r.raw+="\n"+t.raw,r.text+="\n"+t.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):i.push(t),o=n.length!==e.length,e=e.substring(t.raw.length);else if(t=this.tokenizer.text(e))e=e.substring(t.raw.length),r=i[i.length-1],r&&"text"===r.type?(r.raw+="\n"+t.raw,r.text+="\n"+t.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):i.push(t);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,i}inline(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e){let t,r,n,i,o,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],u=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(u));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(u=u.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(u));)u=u.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.anyPunctuation.exec(u));)u=u.slice(0,i.index)+"++"+u.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(o||(a=""),o=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(r=>!!(t=r.call({lexer:this},e,s))&&(e=e.substring(t.raw.length),s.push(t),!0))))if(t=this.tokenizer.escape(e))e=e.substring(t.raw.length),s.push(t);else if(t=this.tokenizer.tag(e))e=e.substring(t.raw.length),r=s[s.length-1],s.push(t);else if(t=this.tokenizer.link(e))e=e.substring(t.raw.length),s.push(t);else if(t=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(t.raw.length),r=s[s.length-1],r&&"text"===t.type&&"text"===r.type?(r.raw+=t.raw,r.text+=t.text):s.push(t);else if(t=this.tokenizer.emStrong(e,u,a))e=e.substring(t.raw.length),s.push(t);else if(t=this.tokenizer.codespan(e))e=e.substring(t.raw.length),s.push(t);else if(t=this.tokenizer.br(e))e=e.substring(t.raw.length),s.push(t);else if(t=this.tokenizer.del(e))e=e.substring(t.raw.length),s.push(t);else if(t=this.tokenizer.autolink(e))e=e.substring(t.raw.length),s.push(t);else if(this.state.inLink||!(t=this.tokenizer.url(e))){if(n=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const r=e.slice(1);let i;this.options.extensions.startInline.forEach(e=>{i=e.call({lexer:this},r),"number"==typeof i&&i>=0&&(t=Math.min(t,i))}),t<1/0&&t>=0&&(n=e.substring(0,t+1))}if(t=this.tokenizer.inlineText(n))e=e.substring(t.raw.length),"_"!==t.raw.slice(-1)&&(a=t.raw.slice(-1)),o=!0,r=s[s.length-1],r&&"text"===r.type?(r.raw+=t.raw,r.text+=t.text):s.push(t);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(t.raw.length),s.push(t);return s}}class Q{constructor(r){t(this,"options",void 0),t(this,"parser",void 0),this.options=r||e.defaults}space(e){return""}code(e){var t;let{text:r,lang:n,escaped:i}=e;const o=null===(t=(n||"").match(s.notSpaceStart))||void 0===t?void 0:t[0],a=r.replace(s.endingNewline,"")+"\n";return o?'<pre><code class="language-'+W(o)+'">'+(i?a:W(a,!0))+"</code></pre>\n":"<pre><code>"+(i?a:W(a,!0))+"</code></pre>\n"}blockquote(e){let{tokens:t}=e;return`<blockquote>\n${this.parser.parse(t)}</blockquote>\n`}html(e){let{text:t}=e;return t}heading(e){let{tokens:t,depth:r}=e;return`<h${r}>${this.parser.parseInline(t)}</h${r}>\n`}hr(e){return"<hr>\n"}list(e){const t=e.ordered,r=e.start;let n="";for(let t=0;t<e.items.length;t++){const r=e.items[t];n+=this.listitem(r)}const i=t?"ol":"ul";return"<"+i+(t&&1!==r?' start="'+r+'"':"")+">\n"+n+"</"+i+">\n"}listitem(e){let t="";if(e.task){const r=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&"paragraph"===e.tokens[0].type?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=r+" "+W(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>\n`}checkbox(e){let{checked:t}=e;return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){let{tokens:t}=e;return`<p>${this.parser.parseInline(t)}</p>\n`}table(e){let t="",r="";for(let t=0;t<e.header.length;t++)r+=this.tablecell(e.header[t]);t+=this.tablerow({text:r});let n="";for(let t=0;t<e.rows.length;t++){const i=e.rows[t];r="";for(let e=0;e<i.length;e++)r+=this.tablecell(i[e]);n+=this.tablerow({text:r})}return n&&(n=`<tbody>${n}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+n+"</table>\n"}tablerow(e){let{text:t}=e;return`<tr>\n${t}</tr>\n`}tablecell(e){const t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`</${r}>\n`}strong(e){let{tokens:t}=e;return`<strong>${this.parser.parseInline(t)}</strong>`}em(e){let{tokens:t}=e;return`<em>${this.parser.parseInline(t)}</em>`}codespan(e){let{text:t}=e;return`<code>${W(t,!0)}</code>`}br(e){return"<br>"}del(e){let{tokens:t}=e;return`<del>${this.parser.parseInline(t)}</del>`}link(e){let{href:t,title:r,tokens:n}=e;const i=this.parser.parseInline(n),o=K(t);if(null===o)return i;let a='<a href="'+(t=o)+'"';return r&&(a+=' title="'+W(r)+'"'),a+=">"+i+"</a>",a}image(e){let{href:t,title:r,text:n}=e;const i=K(t);if(null===i)return W(n);let o=`<img src="${t=i}" alt="${n}"`;return r&&(o+=` title="${W(r)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:W(e.text)}}class ee{strong(e){let{text:t}=e;return t}em(e){let{text:t}=e;return t}codespan(e){let{text:t}=e;return t}del(e){let{text:t}=e;return t}html(e){let{text:t}=e;return t}text(e){let{text:t}=e;return t}link(e){let{text:t}=e;return""+t}image(e){let{text:t}=e;return""+t}br(){return""}}class te{constructor(r){t(this,"options",void 0),t(this,"renderer",void 0),t(this,"textRenderer",void 0),this.options=r||e.defaults,this.options.renderer=this.options.renderer||new Q,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ee}static parse(e,t){return new te(t).parse(e)}static parseInline(e,t){return new te(t).parseInline(e)}parse(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r="";for(let n=0;n<e.length;n++){const i=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){r+=t||"";continue}}const o=i;switch(o.type){case"space":r+=this.renderer.space(o);continue;case"hr":r+=this.renderer.hr(o);continue;case"heading":r+=this.renderer.heading(o);continue;case"code":r+=this.renderer.code(o);continue;case"table":r+=this.renderer.table(o);continue;case"blockquote":r+=this.renderer.blockquote(o);continue;case"list":r+=this.renderer.list(o);continue;case"html":r+=this.renderer.html(o);continue;case"paragraph":r+=this.renderer.paragraph(o);continue;case"text":{let i=o,a=this.renderer.text(i);for(;n+1<e.length&&"text"===e[n+1].type;)i=e[++n],a+="\n"+this.renderer.text(i);r+=t?this.renderer.paragraph({type:"paragraph",raw:a,text:a,tokens:[{type:"text",raw:a,text:a,escaped:!0}]}):a;continue}default:{const e='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return r}parseInline(e,t){t=t||this.renderer;let r="";for(let n=0;n<e.length;n++){const i=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const e=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=e||"";continue}}const o=i;switch(o.type){case"escape":case"text":r+=t.text(o);break;case"html":r+=t.html(o);break;case"link":r+=t.link(o);break;case"image":r+=t.image(o);break;case"strong":r+=t.strong(o);break;case"em":r+=t.em(o);break;case"codespan":r+=t.codespan(o);break;case"br":r+=t.br(o);break;case"del":r+=t.del(o);break;default:{const e='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return r}}class re{constructor(r){t(this,"options",void 0),t(this,"block",void 0),this.options=r||e.defaults}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?$.lex:$.lexInline}provideParser(){return this.block?te.parse:te.parseInline}}t(re,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class ne{constructor(){t(this,"defaults",{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}),t(this,"options",this.setOptions),t(this,"parse",this.parseMarkdown(!0)),t(this,"parseInline",this.parseMarkdown(!1)),t(this,"Parser",te),t(this,"Renderer",Q),t(this,"TextRenderer",ee),t(this,"Lexer",$),t(this,"Tokenizer",J),t(this,"Hooks",re),this.use(...arguments)}walkTokens(e,t){let r=[];for(const i of e)switch(r=r.concat(t.call(this,i)),i.type){case"table":{const e=i;for(const n of e.header)r=r.concat(this.walkTokens(n.tokens,t));for(const n of e.rows)for(const e of n)r=r.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=i;r=r.concat(this.walkTokens(e.items,t));break}default:{var n;const e=i;null!==(n=this.defaults.extensions)&&void 0!==n&&null!==(n=n.childTokens)&&void 0!==n&&n[e.type]?this.defaults.extensions.childTokens[e.type].forEach(n=>{const i=e[n].flat(1/0);r=r.concat(this.walkTokens(i,t))}):e.tokens&&(r=r.concat(this.walkTokens(e.tokens,t)))}}return r}use(){const e=this.defaults.extensions||{renderers:{},childTokens:{}};for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return r.forEach(t=>{const r=n({},t);if(r.async=this.defaults.async||r.async||!1,t.extensions&&(t.extensions.forEach(t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){const r=e.renderers[t.name];e.renderers[t.name]=r?function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];let o=t.renderer.apply(this,n);return!1===o&&(o=r.apply(this,n)),o}:t.renderer}if("tokenizer"in t){if(!t.level||"block"!==t.level&&"inline"!==t.level)throw new Error("extension level must be 'block' or 'inline'");const r=e[t.level];r?r.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&("block"===t.level?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:"inline"===t.level&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)}),r.extensions=e),t.renderer){const e=this.defaults.renderer||new Q(this.defaults);for(const r in t.renderer){if(!(r in e))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;const n=r,i=t.renderer[n],o=e[n];e[n]=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];let a=i.apply(e,r);return!1===a&&(a=o.apply(e,r)),a||""}}r.renderer=e}if(t.tokenizer){const e=this.defaults.tokenizer||new J(this.defaults);for(const r in t.tokenizer){if(!(r in e))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;const n=r,i=t.tokenizer[n],o=e[n];e[n]=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];let a=i.apply(e,r);return!1===a&&(a=o.apply(e,r)),a}}r.tokenizer=e}if(t.hooks){const e=this.defaults.hooks||new re;for(const r in t.hooks){if(!(r in e))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;const n=r,i=t.hooks[n],o=e[n];re.passThroughHooks.has(r)?e[n]=t=>{if(this.defaults.async)return Promise.resolve(i.call(e,t)).then(t=>o.call(e,t));const r=i.call(e,t);return o.call(e,r)}:e[n]=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];let a=i.apply(e,r);return!1===a&&(a=o.apply(e,r)),a}}r.hooks=e}if(t.walkTokens){const e=this.defaults.walkTokens,n=t.walkTokens;r.walkTokens=function(t){let r=[];return r.push(n.call(this,t)),e&&(r=r.concat(e.call(this,t))),r}}this.defaults=n(n({},this.defaults),r)}),this}setOptions(e){return this.defaults=n(n({},this.defaults),e),this}lexer(e,t){return $.lex(e,null!=t?t:this.defaults)}parser(e,t){return te.parse(e,null!=t?t:this.defaults)}parseMarkdown(e){return(t,r)=>{const i=n({},r),o=n(n({},this.defaults),i),a=this.onError(!!o.silent,!!o.async);if(!0===this.defaults.async&&!1===i.async)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(null==t)return a(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);const s=o.hooks?o.hooks.provideLexer():e?$.lex:$.lexInline,u=o.hooks?o.hooks.provideParser():e?te.parse:te.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(t):t).then(e=>s(e,o)).then(e=>o.hooks?o.hooks.processAllTokens(e):e).then(e=>o.walkTokens?Promise.all(this.walkTokens(e,o.walkTokens)).then(()=>e):e).then(e=>u(e,o)).then(e=>o.hooks?o.hooks.postprocess(e):e).catch(a);try{o.hooks&&(t=o.hooks.preprocess(t));let e=s(t,o);o.hooks&&(e=o.hooks.processAllTokens(e)),o.walkTokens&&this.walkTokens(e,o.walkTokens);let r=u(e,o);return o.hooks&&(r=o.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+W(r.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(r);throw r}}}const ie=new ne;function oe(e,t){return ie.parse(e,t)}oe.options=oe.setOptions=function(e){return ie.setOptions(e),oe.defaults=ie.defaults,i(oe.defaults),oe},oe.getDefaults=r,oe.defaults=e.defaults,oe.use=function(){return ie.use(...arguments),oe.defaults=ie.defaults,i(oe.defaults),oe},oe.walkTokens=function(e,t){return ie.walkTokens(e,t)},oe.parseInline=ie.parseInline,oe.Parser=te,oe.parser=te.parse,oe.Renderer=Q,oe.TextRenderer=ee,oe.Lexer=$,oe.lexer=$.lex,oe.Tokenizer=J,oe.Hooks=re,oe.parse=oe;const ae=oe.options,se=oe.setOptions,ue=oe.use,ce=oe.walkTokens,le=oe.parseInline,de=oe,he=te.parse,fe=$.lex;e.Hooks=re,e.Lexer=$,e.Marked=ne,e.Parser=te,e.Renderer=Q,e.TextRenderer=ee,e.Tokenizer=J,e.getDefaults=r,e.lexer=fe,e.marked=oe,e.options=ae,e.parse=de,e.parseInline=le,e.parser=he,e.setOptions=se,e.use=ue,e.walkTokens=ce}(r)}(0,Ip)),Ip).marked}catch(e){console.log("marked is not supported",e)}const Mp=Tp,Dp=e=>{let{text:t,id:r,testid:n,clientHeight:i}=e;const o=!!i&&i<700,a=Jf({tagName:"div",style:{position:"relative",zIndex:"2",width:"100%",minHeight:o?"48px":"70px",textAlign:"center",backgroundColor:"#262626",display:"flex",justifyContent:"center",alignItems:"center"},id:r,testid:n});return $f(a,xp({text:t,level:o?6:5,style:{color:"white"}})),a};const Rp=e=>{const t=function(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("width","270"),e.setAttribute("height","175"),e.setAttribute("viewBox","40 60 250 140"),e.innerHTML='\n <g transform="matrix(1,0,0,1,0,0)"><g id="12" opacity="1" style="mix-blend-mode:normal"><g><defs><clipPath id="12_clipPath" x="-50%" y="-50%" width="200%" height="200%"><path d="M0,260v-260h333v260z" fill="white" clip-rule="nonzero"></path></clipPath></defs><g clip-path="url(#12_clipPath)"><g transform="matrix(1,0,0,1,48,60)"><g id="83287" opacity="1" style="mix-blend-mode:normal"><g><g><g transform="matrix(1,0,0,1,0,0)"><g id="83288" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83288_fill_path" d="M4,140c-2.20914,0 -4,-1.79086 -4,-4v-132c0,-2.20914 1.79086,-4 4,-4h228c2.20914,0 4,1.79086 4,4v132c0,2.20914 -1.79086,4 -4,4z" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path><defs><clipPath id="ligziij3rlyasnggflf" clipPathUnits="userSpaceOnUse"><path d="M4,140c-2.20914,0 -4,-1.79086 -4,-4v-132c0,-2.20914 1.79086,-4 4,-4h228c2.20914,0 4,1.79086 4,4v132c0,2.20914 -1.79086,4 -4,4z"></path></clipPath></defs><path id="83288_stroke_path" d="M4,140c-2.20914,0 -4,-1.79086 -4,-4v-132c0,-2.20914 1.79086,-4 4,-4h228c2.20914,0 4,1.79086 4,4v132c0,2.20914 -1.79086,4 -4,4z" fill="none" stroke="rgb(195, 205, 255)" stroke-width="4" stroke-linecap="butt" stroke-linejoin="butt" stroke-dasharray="0 0" stroke-opacity="1" clip-path="url(#ligziij3rlyasnggflf)"></path></g></g></g></g><g transform="matrix(1,0,0,1,97,116.5)"><g id="83289" opacity="0.4" style="mix-blend-mode:normal"><g><g><path id="83289_fill_path" d="M135,0l-135,23.5h135z" fill-rule="nonzero" fill="rgb(244, 247, 251)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,2,2)"><g id="83290" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83290_fill_path" d="M0,2c0,-1 1,-2 2,-2h228c1,0 2,1 2,2v18h-232z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(-1,0,0,-1,228.54000000000002,62.99940000000001)"><g id="83291" opacity="0.2" style="mix-blend-mode:lighten"><g><g><path id="83291_fill_path" d="M227,-0.00002l-227,60.99934l226.99998,0.00002z" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,24,42)"><g id="83292" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83292_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h109c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,143,42)"><g id="83293" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83293_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h65c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,24,58)"><g id="83294" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83294_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h64c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,98,58)"><g id="83295" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83295_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h86c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,194,58)"><g id="83296" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83296_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h14c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,24,74)"><g id="83297" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83297_fill_path" d="M1,6c-0.55228,0 -1,-0.44772 -1,-1v-4c0,-0.55228 0.44772,-1 1,-1h83c0.55228,0 1,0.44772 1,1v4c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(244, 247, 251)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,117,74)"><g id="83298" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83298_fill_path" d="M1,6c-0.55228,0 -1,-0.44772 -1,-1v-4c0,-0.55228 0.44772,-1 1,-1h38c0.55228,0 1,0.44772 1,1v4c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(244, 247, 251)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,165,74)"><g id="83299" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83299_fill_path" d="M1,6c-0.55228,0 -1,-0.44772 -1,-1v-4c0,-0.55228 0.44772,-1 1,-1h43c0.55228,0 1,0.44772 1,1v4c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,68,92)"><g id="83300" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83300_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,74,92)"><g id="83301" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83301_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,80,92)"><g id="83302" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83302_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,86,92)"><g id="83303" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83303_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,92,92)"><g id="83304" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83304_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,98,92)"><g id="83305" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83305_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,104,92)"><g id="83306" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83306_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,110,92)"><g id="83307" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83307_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,116,92)"><g id="83308" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83308_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,122,92)"><g id="83309" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83309_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,128,92)"><g id="83310" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83310_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,134,92)"><g id="83311" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83311_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,140,92)"><g id="83312" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83312_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,146,92)"><g id="83313" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83313_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,152,92)"><g id="83314" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83314_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,158,92)"><g id="83315" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83315_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,164,92)"><g id="83316" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83316_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,170,92)"><g id="83317" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83317_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h18c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,97,116)"><g id="83318" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83318_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h38c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,2,21)"><g id="83320" opacity="0.2" style="mix-blend-mode:normal"><g><g><path id="83320_fill_path" d="M0,118v-118h234v118z" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g></g></g></g></g><g transform="matrix(1,0,0,1,48,60)"><g id="83268" opacity="1" style="mix-blend-mode:normal"><g><g><g transform="matrix(1,0,0,1,0,0)"><g id="83269" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83269_fill_path" d="M4,140c-2.20914,0 -4,-1.79086 -4,-4v-132c0,-2.20914 1.79086,-4 4,-4h228c2.20914,0 4,1.79086 4,4v132c0,2.20914 -1.79086,4 -4,4z" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path><defs><clipPath id="ligziij4hmxrv43iz67" clipPathUnits="userSpaceOnUse"><path d="M4,140c-2.20914,0 -4,-1.79086 -4,-4v-132c0,-2.20914 1.79086,-4 4,-4h228c2.20914,0 4,1.79086 4,4v132c0,2.20914 -1.79086,4 -4,4z"></path></clipPath></defs><path id="83269_stroke_path" d="M4,140c-2.20914,0 -4,-1.79086 -4,-4v-132c0,-2.20914 1.79086,-4 4,-4h228c2.20914,0 4,1.79086 4,4v132c0,2.20914 -1.79086,4 -4,4z" fill="none" stroke="rgb(195, 205, 255)" stroke-width="4" stroke-linecap="butt" stroke-linejoin="butt" stroke-dasharray="0 0" stroke-opacity="1" clip-path="url(#ligziij4hmxrv43iz67)"></path></g></g></g></g><g transform="matrix(1,0,0,1,196,100)"><g id="83270" opacity="0.4" style="mix-blend-mode:normal"><g><g><defs><clipPath id="ligziij4roiiqcgytn" clipPathUnits="userSpaceOnUse"><path d="M24,12c0,1.2588 -0.198,2.5104 -0.5868,3.708c-0.3888,1.1976 -0.9648,2.3268 -1.7052,3.3456c-0.7404,1.0188 -1.6356,1.914 -2.6544,2.6544c-1.0188,0.7404 -2.148,1.3164 -3.3456,1.7052c-1.1976,0.3888 -2.4492,0.5868 -3.708,0.5868c-1.2588,0 -2.5104,-0.198 -3.708,-0.5868c-1.1976,-0.3888 -2.3268,-0.9648 -3.3456,-1.7052c-1.0188,-0.7404 -1.914,-1.6356 -2.6544,-2.6544c-0.7404,-1.0188 -1.3164,-2.148 -1.7052,-3.3456c-0.3888,-1.1976 -0.5868,-2.4492 -0.5868,-3.708c0,-1.2588 0.198,-2.5104 0.5868,-3.708c0.3888,-1.1976 0.9648,-2.3268 1.7052,-3.3456c0.7404,-1.0188 1.6356,-1.914 2.6544,-2.6544c1.0188,-0.7404 2.148,-1.3164 3.3456,-1.7052c1.1976,-0.3888 2.4492,-0.5868 3.708,-0.5868c1.2588,0 2.5104,0.198 3.708,0.5868c1.1976,0.3888 2.3268,0.9648 3.3456,1.7052c1.0188,0.7404 1.914,1.6356 2.6544,2.6544c0.7404,1.0188 1.3164,2.148 1.7052,3.3456c0.3888,1.1976 0.5868,2.4492 0.5868,3.708z"></path></clipPath></defs><path id="83270_stroke_path" d="M24,12c0,1.2588 -0.198,2.5104 -0.5868,3.708c-0.3888,1.1976 -0.9648,2.3268 -1.7052,3.3456c-0.7404,1.0188 -1.6356,1.914 -2.6544,2.6544c-1.0188,0.7404 -2.148,1.3164 -3.3456,1.7052c-1.1976,0.3888 -2.4492,0.5868 -3.708,0.5868c-1.2588,0 -2.5104,-0.198 -3.708,-0.5868c-1.1976,-0.3888 -2.3268,-0.9648 -3.3456,-1.7052c-1.0188,-0.7404 -1.914,-1.6356 -2.6544,-2.6544c-0.7404,-1.0188 -1.3164,-2.148 -1.7052,-3.3456c-0.3888,-1.1976 -0.5868,-2.4492 -0.5868,-3.708c0,-1.2588 0.198,-2.5104 0.5868,-3.708c0.3888,-1.1976 0.9648,-2.3268 1.7052,-3.3456c0.7404,-1.0188 1.6356,-1.914 2.6544,-2.6544c1.0188,-0.7404 2.148,-1.3164 3.3456,-1.7052c1.1976,-0.3888 2.4492,-0.5868 3.708,-0.5868c1.2588,0 2.5104,0.198 3.708,0.5868c1.1976,0.3888 2.3268,0.9648 3.3456,1.7052c1.0188,0.7404 1.914,1.6356 2.6544,2.6544c0.7404,1.0188 1.3164,2.148 1.7052,3.3456c0.3888,1.1976 0.5868,2.4492 0.5868,3.708z" fill="none" stroke="rgb(195, 205, 255)" stroke-width="10" stroke-linecap="butt" stroke-linejoin="butt" stroke-dasharray="0 0" stroke-opacity="1" clip-path="url(#ligziij4roiiqcgytn)"></path></g></g></g></g><g transform="matrix(1,0,0,1,98,98)"><g id="83271" opacity="0.4" style="mix-blend-mode:normal"><g><g><path id="83271_fill_path" d="M135,0l-135,40h135z" fill-rule="nonzero" fill="rgb(244, 247, 251)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,1,1)"><g id="83272" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83272_fill_path" d="M0,2c0,-1 1,-2 2,-2h229c1,0 2,1 2,2v18h-233z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,42,74.4508)"><g id="83273" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83273_fill_path" d="M18.00001,0h-8c-5.5225,0 -10.00001,4.47496 -10.00001,9.99992c0,1.09999 0.895,1.99998 2,1.99998h24.00002c1.1045,0 2,-0.89549 2,-1.99998c0,-5.52496 -4.475,-9.99992 -10.00001,-9.99992z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,47.5999,54.4509)"><g id="83274" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83274_fill_path" d="M17.306,8.653c0,0.9077 -0.1428,1.8102 -0.4232,2.6738c-0.2804,0.8636 -0.6957,1.6778 -1.2296,2.4124c-0.5339,0.7346 -1.1794,1.3801 -1.914,1.914c-0.7346,0.5339 -1.5488,0.9492 -2.4124,1.2296c-0.8636,0.2804 -1.7661,0.4232 -2.6738,0.4232c-0.9077,0 -1.8102,-0.1428 -2.6738,-0.4232c-0.8636,-0.2804 -1.6778,-0.6957 -2.4124,-1.2296c-0.7346,-0.5339 -1.3801,-1.1794 -1.914,-1.914c-0.5339,-0.7346 -0.9492,-1.5488 -1.2296,-2.4124c-0.2804,-0.8636 -0.4232,-1.7661 -0.4232,-2.6738c0,-0.9077 0.1428,-1.8102 0.4232,-2.6738c0.2804,-0.8636 0.6957,-1.6778 1.2296,-2.4124c0.5339,-0.7346 1.1794,-1.3801 1.914,-1.914c0.7346,-0.5339 1.5488,-0.9492 2.4124,-1.2296c0.8636,-0.2804 1.7661,-0.4232 2.6738,-0.4232c0.9077,0 1.8102,0.1428 2.6738,0.4232c0.8636,0.2804 1.6778,0.6957 2.4124,1.2296c0.7346,0.5339 1.3801,1.1794 1.914,1.914c0.5339,0.7346 0.9492,1.5488 1.2296,2.4124c0.2804,0.8636 0.4232,1.7661 0.4232,2.6738z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,32,48)"><g id="83275" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83275_fill_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path><path id="83275_stroke_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill="none" stroke="rgb(195, 205, 255)" stroke-width="2" stroke-linecap="butt" stroke-linejoin="butt" stroke-dasharray="0 0" stroke-opacity="1"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,-1,1,6.123233995736766e-17,32,94)"><g id="83276" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83276_fill_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path><path id="83276_stroke_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill="none" stroke="rgb(195, 205, 255)" stroke-width="2" stroke-linecap="butt" stroke-linejoin="butt" stroke-dasharray="0 0" stroke-opacity="1"></path></g></g></g></g><g transform="matrix(-1,2.4492935982947064e-16,-2.4492935982947064e-16,-1,79,94)"><g id="83277" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83277_fill_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path><path id="83277_stroke_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill="none" stroke="rgb(195, 205, 255)" stroke-width="2" stroke-linecap="butt" stroke-linejoin="butt" stroke-dasharray="0 0" stroke-opacity="1"></path></g></g></g></g><g transform="matrix(6.123233995736766e-17,1,-1,6.123233995736766e-17,79,48)"><g id="83278" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83278_fill_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path><path id="83278_stroke_path" d="M12,0c0,0 -7.7348,0 -8,0c-0.2652,0 -0.5204,0.0252 -0.7804,0.0768c-0.26,0.0516 -0.5052,0.126 -0.7504,0.2276c-0.2452,0.1016 -0.4712,0.2224 -0.6916,0.3696c-0.2204,0.1472 -0.4184,0.31 -0.606,0.4976c-0.1876,0.1876 -0.3504,0.3856 -0.4976,0.606c-0.1472,0.2204 -0.268,0.4464 -0.3696,0.6916c-0.1016,0.2452 -0.176,0.4904 -0.2276,0.7504c-0.0516,0.26 -0.0768,0.5152 -0.0768,0.7804c0,0.2652 0,8 0,8" fill="none" stroke="rgb(195, 205, 255)" stroke-width="2" stroke-linecap="butt" stroke-linejoin="butt" stroke-dasharray="0 0" stroke-opacity="1"></path></g></g></g></g><g transform="matrix(1,0,0,1,100,47)"><g id="83279" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83279_fill_path" d="M4,8c-2.20914,0 -4,-1.79086 -4,-4v0c0,-2.20914 1.79086,-4 4,-4v0c2.20914,0 4,1.79086 4,4v0c0,2.20914 -1.79086,4 -4,4z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,116,47)"><g id="83280" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83280_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h86c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,100,67)"><g id="83281" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83281_fill_path" d="M4,8c-2.20914,0 -4,-1.79086 -4,-4v0c0,-2.20914 1.79086,-4 4,-4v0c2.20914,0 4,1.79086 4,4v0c0,2.20914 -1.79086,4 -4,4z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,116,67)"><g id="83282" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83282_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h64c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,100,87)"><g id="83283" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83283_fill_path" d="M4,8c-2.20914,0 -4,-1.79086 -4,-4v0c0,-2.20914 1.79086,-4 4,-4v0c2.20914,0 4,1.79086 4,4v0c0,2.20914 -1.79086,4 -4,4z" fill-rule="nonzero" fill="rgb(105, 129, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,116,87)"><g id="83284" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83284_fill_path" d="M1,8c-0.55228,0 -1,-0.44772 -1,-1v-6c0,-0.55228 0.44772,-1 1,-1h51c0.55228,0 1,0.44772 1,1v6c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(195, 205, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,137,9)"><g id="83285" opacity="1" style="mix-blend-mode:normal"><g><g><path id="83285_fill_path" d="M1,4c-0.55228,0 -1,-0.44772 -1,-1v-2c0,-0.55228 0.44772,-1 1,-1h86c0.55228,0 1,0.44772 1,1v2c0,0.55228 -0.44772,1 -1,1z" fill-rule="nonzero" fill="rgb(244, 247, 251)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(-1,0,0,-1,92.4999,98.9985)"><g id="83286" opacity="0.2" style="mix-blend-mode:lighten"><g><g><path id="83286_fill_path" d="M90.49994,0l-90.49994,96.99852l90.49994,0.00002z" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g><g transform="matrix(1,0,0,1,0,20)"><g id="83319" opacity="0" style="mix-blend-mode:normal"><g><g><path id="83319_fill_path" d="M0,118v-118h234v118z" fill-rule="nonzero" fill="rgb(255, 255, 255)" fill-opacity="1" style="mix-blend-mode:NORMAL"></path></g></g></g></g></g></g></g></g></g></g></g></g><animateTransform href="#83287" attributeName="transform" type="translate" values="118 70;118 70;118 70;118 70;118 70" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.37;0.61;0.66;1" keySplines="0.0664 0.4423 0.15 1;0.0664 0.4423 0.1 1;0.0664 0.4423 0.1 1;0.5 0.35 0.1 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83287" attributeName="transform" type="scale" values="0 1;0 1;1.02 1;1 1;1 1" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.37;0.61;0.66;1" keySplines="0.0664 0.4423 0.15 1;0.0664 0.4423 0.1 1;0.0664 0.4423 0.1 1;0.5 0.35 0.1 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83287" attributeName="transform" type="translate" values="-118 -70;-118 -70;-118 -70;-118 -70;-118 -70" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.37;0.61;0.66;1" keySplines="0.0664 0.4423 0.15 1;0.0664 0.4423 0.1 1;0.0664 0.4423 0.1 1;0.5 0.35 0.1 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83291" attributeName="transform" type="translate" values="0 0;0 0;9.018099999999999 -4;9.018099999999999 -4" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.37;0.52;1" keySplines="0.42 0 0.15 1;0.42 0 0.15 1;0.5 0.35 0.15 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83291" attributeName="transform" type="translate" values="113.5 30.4997;113.5 30.4997;113.5 30.4997;113.5 30.4997" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.37;0.52;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.15 1;0.5 0.35 0.15 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83291" attributeName="transform" type="scale" values="-1 -1;-1 -1;-0.88 -0.88;-0.88 -0.88" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.37;0.52;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.15 1;0.5 0.35 0.15 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83291" attributeName="transform" type="translate" values="-113.5 -30.4997;-113.5 -30.4997;-113.5 -30.4997;-113.5 -30.4997" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.37;0.52;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.15 1;0.5 0.35 0.15 1" additive="sum" fill="freeze"></animateTransform><animate href="#83320" attributeName="opacity" values="0.2;0.2;0;0" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.39;0.43;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.15 1;0.5 0.35 0.15 1" additive="sum" fill="freeze"></animate><animateTransform href="#83268" attributeName="transform" type="translate" values="117 75;117 75;117 75;117 75" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.09;0.37;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.8 0.15;0.5 0.35 0.8 0.15" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83268" attributeName="transform" type="scale" values="1 1;1 1;0 1;0 1" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.09;0.37;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.8 0.15;0.5 0.35 0.8 0.15" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83268" attributeName="transform" type="translate" values="-117 -75;-117 -75;-117 -75;-117 -75" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.09;0.37;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.8 0.15;0.5 0.35 0.8 0.15" additive="sum" fill="freeze"></animateTransform><animate href="#83271_fill_path" attributeName="d" values="M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,0l-135,40h135z;M135,-0.0042l-135.0142,40.0042h135.0142z;M135,-0.0364l-135.1228,40.0364h135.1228z;M135,-0.0975l-135.3292,40.0975h135.3292z;M135,-0.1848l-135.6236,40.1848h135.6236z;M135,-0.2958l-135.9982,40.2958h135.9982z;M135,-0.4285l-136.4462,40.4285h136.4462z;M135,-0.5812l-136.9617,40.5812h136.9617z;M135,-0.7525l-137.5397,40.7525h137.5397z;M135,-0.941l-138.176,40.941h138.176z;M135,-1.1457l-138.8667,41.1457h138.8667z;M135,-1.3655l-139.6085,41.3655h139.6085z;M135,-1.5996l-140.3986,41.5996h140.3986z;M135,-1.8472l-141.2343,41.8472h141.2343z;M135,-2.1077l-142.1134,42.1077h142.1134z;M135,-2.3804l-143.0339,42.3804h143.0339z;M135,-2.6649l-143.994,42.6649h143.994z;M135,-2.9607l-144.9922,42.9607h144.9922z;M135,-3.2673l-146.0272,43.2673h146.0272z;M135,-3.5846l-147.0978,43.5846h147.0978z;M135,-3.9121l-148.2031,43.9121h148.2031z;M135,-4.2497l-149.3424,44.2497h149.3424z;M135,-4.5972l-150.5153,44.5972h150.5153z;M135,-4.9545l-151.7213,44.9545h151.7213z;M135,-5.3218l-152.9607,45.3218h152.9607z;M135,-5.6991l-154.2341,45.6991h154.2341z;M135,-6.0868l-155.5427,46.0868h155.5427z;M135,-6.4858l-156.8893,46.4858h156.8893z;M135,-6.898l-158.2804,46.898h158.2804z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z;M135,-7.1112l-159,47.1112h159z" dur="2.6s" repeatCount="indefinite" keyTimes="0;0.007692307692307693;0.015384615384615385;0.023076923076923078;0.03076923076923077;0.038461538461538464;0.046153846153846156;0.05384615384615385;0.06153846153846154;0.06923076923076923;0.07692307692307693;0.08461538461538462;0.09230769230769231;0.1;0.1076923076923077;0.11538461538461539;0.12307692307692308;0.13076923076923078;0.13846153846153847;0.14615384615384616;0.15384615384615385;0.16153846153846155;0.16923076923076924;0.17692307692307693;0.18461538461538463;0.19230769230769232;0.2;0.2076923076923077;0.2153846153846154;0.2230769230769231;0.23076923076923078;0.23846153846153847;0.24615384615384617;0.25384615384615383;0.26153846153846155;0.2692307692307692;0.27692307692307694;0.2846153846153846;0.2923076923076923;0.3;0.3076923076923077;0.3153846153846154;0.3230769230769231;0.33076923076923076;0.3384615384615385;0.34615384615384615;0.35384615384615387;0.36153846153846153;0.36923076923076925;0.3769230769230769;0.38461538461538464;0.3923076923076923;0.4;0.4076923076923077;0.4153846153846154;0.4230769230769231;0.4307692307692308;0.43846153846153846;0.4461538461538462;0.45384615384615384;0.46153846153846156;0.46923076923076923;0.47692307692307695;0.4846153846153846;0.49230769230769234;0.5;0.5076923076923077;0.5153846153846153;0.5230769230769231;0.5307692307692308;0.5384615384615384;0.5461538461538461;0.5538461538461539;0.5615384615384615;0.5692307692307692;0.5769230769230769;0.5846153846153846;0.5923076923076923;0.6;0.6076923076923076;0.6153846153846154;0.6230769230769231;0.6307692307692307;0.6384615384615384;0.6461538461538462;0.6538461538461539;0.6615384615384615;0.6692307692307692;0.676923076923077;0.6846153846153846;0.6923076923076923;0.7;0.7076923076923077;0.7153846153846154;0.7230769230769231;0.7307692307692307;0.7384615384615385;0.7461538461538462;0.7538461538461538;0.7615384615384615;0.7692307692307693;0.7769230769230769;0.7846153846153846;0.7923076923076923;0.8;0.8076923076923077;0.8153846153846154;0.823076923076923;0.8307692307692308;0.8384615384615385;0.8461538461538461;0.8538461538461538;0.8615384615384616;0.8692307692307693;0.8769230769230769;0.8846153846153846;0.8923076923076924;0.9;0.9076923076923077;0.9153846153846154;0.9230769230769231;0.9307692307692308;0.9384615384615385;0.9461538461538461;0.9538461538461539;0.9615384615384616;0.9692307692307692;0.9769230769230769;0.9846153846153847;0.9923076923076923;1" fill="freeze"></animate><animateTransform href="#83285" attributeName="transform" type="translate" values="88 2;88 2;88 2;88 2;88 2" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.12;0.27;0.33;1" keySplines="0.42 0 0.15 1;0.42 0 0.48 1;0.42 0 0.48 1;0.5 0.35 0.48 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83285" attributeName="transform" type="scale" values="0.98 1;0.98 1;1 1;0.96 1;0.96 1" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.12;0.27;0.33;1" keySplines="0.42 0 0.15 1;0.42 0 0.48 1;0.42 0 0.48 1;0.5 0.35 0.48 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83285" attributeName="transform" type="translate" values="-88 -2;-88 -2;-88 -2;-88 -2;-88 -2" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.12;0.27;0.33;1" keySplines="0.42 0 0.15 1;0.42 0 0.48 1;0.42 0 0.48 1;0.5 0.35 0.48 1" additive="sum" fill="freeze"></animateTransform><animateTransform href="#83286" attributeName="transform" type="translate" values="0 0;0 0;0 0;0 0" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.09;0.32;1" keySplines="0.42 0 0.15 1;0.42 0 1 1;0.5 0.35 1 1" additive="sum" fill="freeze"></animateTransform><animateTransform xlink:href="#83286" href="#83286" attributeName="transform" type="skewX" values="0;0;-4;-4" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.09;0.32;1" keySplines="0.42 0 0.15 1;0.42 0 1 1;0.5 0.35 1 1" additive="sum" fill="freeze"></animateTransform><animateTransform xlink:href="#83286" href="#83286" attributeName="transform" type="skewY" values="0;0;0;0" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.09;0.32;1" keySplines="0.42 0 0.15 1;0.42 0 1 1;0.5 0.35 1 1" additive="sum" fill="freeze"></animateTransform><animateTransform xlink:href="#83286" href="#83286" attributeName="transform" type="translate" values="0 0;0 0;0 0;0 0" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.09;0.32;1" keySplines="0.42 0 0.15 1;0.42 0 1 1;0.5 0.35 1 1" additive="sum" fill="freeze"></animateTransform><animate href="#83319" attributeName="opacity" values="0;0;0.18;0.18" dur="2.6s" repeatCount="indefinite" calcMode="spline" keyTimes="0;0.31;0.36;1" keySplines="0.5 0.35 0.15 1;0.5 0.35 0.15 1;0.5 0.35 0.15 1" additive="sum" fill="freeze"></animate>\n ',e}();return t.setAttribute("style","position: absolute; z-index: 1; opacity: 0; transition: opacity 0.5s ease-in-out;"),"document_back"===e&&(t.style.opacity="1",setTimeout(()=>{t.style.opacity="0"},5e3)),t};var Op;!function(e){e.INVALID="invalid",e.VALID="valid",e.ACCEPTED="accepted",e.REJECTED="rejected"}(Op||(Op={}));const kp="#ED3232",Np="#01B678",Pp="#FFF";const Bp=e=>{const t=document.createElement("canvas");t.width=e.videoWidth,t.height=e.videoHeight;return t.getContext("2d").drawImage(e,0,0,e.videoWidth,e.videoHeight),t};async function Fp(e){let{context:t,onDetect:r,frame:n,showError:i,isSelfie:o=!1}=e;const a=t.state.name;if(a===Op.REJECTED){i(function(e){switch(e){case Qa.DOCUMENT_DETECTION:return"searching_document_autocapture";case Qa.DOCUMENT_POSITION:return"doc_not_in_frame_issues_autocapture";case Qa.BARCODE_DETECTION:return mo.feedback.BARCODE_NOT_FOUND;case Qa.BLUR_DETECTION:return mo.feedback.BLUR;case Qa.GLARE_DETECTION:return mo.feedback.GLARE;case Qa.FACE_DETECTION:return mo.feedback.FACE_NOT_FOUND;case Qa.FACE_POSITION:return mo.feedback.FACE_TOO_SMALL}}(t.invalidFramesCause));Lp("border-color",t.invalidFramesCause===Qa.DOCUMENT_DETECTION?Pp:kp)}if(a===Op.VALID)if(o){Lp("border-color",Np);i(`capturing_face_autocapture${Math.ceil((t.validFramesThreshold-t.validFramesCounter)/t.validFramesThreshold*3)}`)}else i("capturing_in_progress_message"),Lp("border-color",Pp);a===Op.ACCEPTED&&(Lp("border-color",Pp),i(null),"function"==typeof navigator.vibrate&&navigator.vibrate(200),await r({frame:n,suspendedPreview:!0,context:t}))}function Lp(e,t){document.querySelectorAll('[id^="overlay-frame"]').forEach(r=>{r.style[e]=t})}function zp(e){let t,r,n,{captureFrame:i,object:o,videoWidth:a,videoHeight:s,deviceWidth:u,deviceHeight:c,threshold:l,iouThreshold:d=.85}=e;if(a/s>=u/c){n=c/s;const e=(a*n-u)/2;t=o.x*n-e,r=o.y*n}else{n=u/a;const e=(s*n-c)/2;t=o.x*n,r=o.y*n-e}const h=t+o.width*n,f=r+o.height*n;!function(e,t,r,n){var i,o;if(null===(o=null===(i=$a.state.autoCaptureSettings)||void 0===i?void 0:i.settings)||void 0===o?void 0:o.debug){const i=document.getElementById("image-preview-section"),o=document.getElementById("rectangle");if(o)o.style.width=`${r}px`,o.style.height=`${n}px`,o.style.left=`${e}px`,o.style.top=`${t}px`;else{const o=document.createElement("div");o.id="rectangle",o.style.position="absolute",o.style.border="1px solid yellow",o.style.width=`${r}px`,o.style.height=`${n}px`,o.style.left=`${e}px`,o.style.top=`${t}px`,i.appendChild(o)}}}(t,r,o.width*n,o.height*n);const p=function(e,t){const r=Math.max(e.left,t.left),n=Math.min(e.right,t.right),i=Math.max(e.top,t.top),o=n-r,a=Math.min(e.bottom,t.bottom)-i;if(o<=0||a<=0)return 0;const s=o*a;return s/((e.right-e.left)*(e.bottom-e.top)+(t.right-t.left)*(t.bottom-t.top)-s)}({top:i.top,left:i.left,bottom:i.bottom,right:i.right},{top:r,left:t,bottom:f,right:h}),g=p>d,m=o.width*n*(o.height*n)>l*(i.width*i.height);return g&&m}const Up=e=>{const t=function(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("width","64px"),e.setAttribute("height","64px"),e.innerHTML='\n <path d="M10.7202 25.9524C9.81992 25.9524 9.08331 25.2158 9.08331 24.3155V11.2202C9.08331 10.3199 9.81992 9.58333 10.7202 9.58333C11.6205 9.58333 12.3571 10.3199 12.3571 11.2202V20.6938C16.3675 14.0337 23.662 9.58333 32 9.58333C44.6553 9.58333 54.9166 19.8447 54.9166 32.5C54.9166 45.1553 44.6553 55.4167 32 55.4167C23.8257 55.4167 16.654 51.1403 12.5924 44.6949C11.9274 43.631 12.7357 42.3214 13.994 42.3214C14.6079 42.3214 15.1603 42.6488 15.4979 43.1603C18.9968 48.5621 25.0841 52.1429 32 52.1429C42.8445 52.1429 51.6428 43.3445 51.6428 32.5C51.6428 21.6555 42.8445 12.8571 32 12.8571C24.726 12.8571 18.383 16.8062 14.9864 22.6786H23.8155C24.7158 22.6786 25.4524 23.4152 25.4524 24.3155C25.4524 25.2158 24.7158 25.9524 23.8155 25.9524H10.7202Z" fill="#FF8B8B"/> \n ',e}(),r=Jf({tagName:"button",style:{zIndex:"2",width:"fit-content",display:"flex",flexDirection:"column",alignItems:"center",backgroundColor:"transparent",border:"none"},id:"retake-image",testid:"retake-image"});return $f(r,t),$f(r,xp({text:e||"Retake",level:2,style:{color:"#FF8B8B",margin:"0",maxWidth:"100px",textAlign:"center"},id:"retake-image-text"})),r};const jp=e=>{const t=function(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("width","64px"),e.setAttribute("height","64px"),e.innerHTML='\n <path d="M32.5 8.66666C38.6884 8.66666 44.6233 11.125 48.9992 15.5008C53.375 19.8767 55.8333 25.8116 55.8333 32C55.8333 38.1884 53.375 44.1233 48.9992 48.4992C44.6233 52.875 38.6884 55.3333 32.5 55.3333C26.3116 55.3333 20.3767 52.875 16.0009 48.4992C11.625 44.1233 9.16668 38.1884 9.16668 32C9.16668 25.8116 11.625 19.8767 16.0009 15.5008C20.3767 11.125 26.3116 8.66666 32.5 8.66666ZM32.5 58.6667C39.5725 58.6667 46.3552 55.8572 51.3562 50.8562C56.3572 45.8552 59.1667 39.0724 59.1667 32C59.1667 24.9276 56.3572 18.1448 51.3562 13.1438C46.3552 8.14284 39.5725 5.33333 32.5 5.33333C25.4276 5.33333 18.6448 8.14284 13.6438 13.1438C8.64286 18.1448 5.83334 24.9276 5.83334 32C5.83334 39.0724 8.64286 45.8552 13.6438 50.8562C18.6448 55.8572 25.4276 58.6667 32.5 58.6667ZM43.6771 26.5104C44.3229 25.8646 44.3229 24.8021 43.6771 24.1562C43.0313 23.5104 41.9688 23.5104 41.3229 24.1562L29.1667 36.3125L23.6771 30.8229C23.0313 30.1771 21.9688 30.1771 21.3229 30.8229C20.6771 31.4687 20.6771 32.5312 21.3229 33.1771L27.9896 39.8437C28.6354 40.4896 29.6979 40.4896 30.3438 39.8437L43.6771 26.5104Z" fill="#BBF7DD"/>\n ',e}(),r=Jf({tagName:"button",style:{zIndex:"2",width:"fit-content",display:"flex",flexDirection:"column",alignItems:"center",backgroundColor:"transparent",border:"none"},id:"approve-image",testid:"approve-image"});return $f(r,t),$f(r,xp({text:e||"Approve",level:2,style:{color:"#BBF7DD",margin:"0",maxWidth:"100px",textAlign:"center"},id:"check-circle-text"})),r},Vp=e=>{let{step:t,setImage:r,camera:n}=e;var i,o,a,s;const u=wp[t];(null===(i=$a.state.autoCaptureSettings)||void 0===i?void 0:i.enabled)&&"selfie"===t&&(u.instructions="second_title_face_autocapture");const c=((e,t)=>Jf({tagName:"div",style:{display:"flex",height:"100%",justifyContent:"space-between",flexDirection:"column",alignItems:"center"},id:e,testid:"document-capture",className:t}))("document-capture",t),l=Jf({tagName:"div",style:{position:"relative",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},id:"camera-hint-section",testid:"camera-hint-section"}),d=Jf({tagName:"div",style:{display:"flex",flexDirection:"column",alignItems:"center",width:"100%",height:"80%"},id:"central-container",testid:"central-container"}),h=document.getElementById($a.state.rootElementId);if(!h)throw new Error("Root element not found");const f=_p(ip(t),h);$f(l,Rp(t)),$f(l,f);const p=(()=>{const e=Jf({tagName:"div",style:{zIndex:"2",width:"80%",height:"50px",color:"white",display:"flex",alignItems:"center",backgroundColor:"#2E2E2E",justifyContent:"center",opacity:".9"},id:"loading-block",testid:"loading-block"}),t=Ep();return t.style.width="16px",t.style.height="16px",t.style.margin="0 10px",$f(e,t),$f(e,xp({text:"This may take a few seconds",level:5,style:{color:"white",margin:"0",width:"80%"},id:"image-loading-message"})),e})();$f(f,p),p.style.visibility="hidden";const g=Dp({text:ep.translate(u.page),id:"page-header",testid:"page-header",clientHeight:h.clientHeight}),m=(e=>{let{click:t,id:r,testid:n,color:i,withLoader:o}=e;if(o){const e=Ap();e.style.position="absolute",e.style.left="-7px",e.style.top="-7px",e.style.height="63px",e.style.width="63px";const o=Jf({tagName:"button",style:{position:"relative",width:"49px",height:"49px",backgroundColor:i||"white",border:"none",margin:"0 auto",borderRadius:"40px"},id:r+"-inner",testid:n+"-inner"});return $f(o,e),o.addEventListener("click",t),o}{const e=Jf({tagName:"button",style:{width:"65px",height:"65px",zIndex:"1",backgroundColor:"black",padding:"0",border:"solid 5px "+(i||"white"),borderRadius:"40px"},id:r+"-outer",testid:n+"-outer"});return $f(e,Jf({tagName:"div",style:{width:"49px",height:"49px",backgroundColor:i||"white",border:"none",margin:"0 auto",borderRadius:"40px"},id:r+"-inner",testid:n+"-inner"})),e.addEventListener("click",t),e}})({click:()=>r({frame:Bp(n.videoElement),suspendedPreview:!1}),id:"submit-image",testid:"submit-image",withLoader:null===(a=null===(o=$a.state)||void 0===o?void 0:o.autoCaptureSettings)||void 0===a?void 0:a.enabled}),y=((e,t)=>{const r=Jf({tagName:"div",style:{zIndex:"2",width:"70%",paddingBottom:"30px",backgroundColor:"transparent",justifyContent:"space-between",display:"none"},id:"approve-retake-block",testid:"approve-retake-block"}),n=jp(e);return $f(r,Up(t)),$f(r,n),r})(ep.translate("approve_button"),ep.translate("retake_button")),v=(e=>{let{title:t,text:r,clientHeight:n,customTextColor:i}=e;const o=n<700,a=Jf({tagName:"div",style:{position:"relative",zIndex:"2",padding:"0 25px",margin:o?"8px 0":"32px 0"},id:"page-info",testid:"page-info"}),s=xp({text:t,level:o?2:1,style:{color:i||"white",textAlign:"center",marginBottom:o?"4px":"10px"},id:"step-title"}),u=xp({text:r,level:o?6:5,style:{color:i||"white",textAlign:"center",height:"35px"},id:"step-instructions"});return $f(a,s),$f(a,u),a})({text:ep.translate(u.instructions),title:ep.translate(u.title),clientHeight:h.clientHeight}),b=(e=>{const t=e<700,r=Jf({tagName:"div",style:{zIndex:"2",width:"85%",display:"flex",flexDirection:$a.state.markdownSupportText?"column":"row",backgroundColor:"#2E2E2E",borderRadius:"4px",padding:"12px",visibility:"hidden",marginTop:"16px"},id:"error-block",testid:"error-block"}),n=Jf({tagName:"div",style:{display:"flex",flexDirection:"row",width:"100%",height:"inherit",alignItems:"center",paddingTop:"25px"},id:"image-error-block",testid:"image-error-block"}),i=Ep();i.style.width="16px",i.style.height="16px",i.style.margin="0 10px",$a.state.markdownSupportText?$f(n,i):$f(r,i);const o=$a.state.markdownSupportText&&null!=Mp?Mp.parse($a.state.markdownSupportText,{async:!1}):"",a=xp({text:"",level:t?6:5,style:{color:"white",margin:"0",width:"85%",fontWeight:"400",height:"fit-content"},id:"image-error-message"}),s=xp({text:"",level:5,style:{color:"white",margin:"0",width:"80%"},id:"image-error-support-message"});return o&&(s.innerHTML=o,$f(n,a)),$f(r,o?[n,s]:a),r})(h.clientHeight),w=(null===(s=$a.state.autoCaptureSettings)||void 0===s?void 0:s.enabled)?Ap():function(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("width","65"),e.setAttribute("height","65"),e.setAttribute("viewBox","0 0 24 24"),e.innerHTML='\n <path fill="#ffffff" d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" opacity=".25"/><path fill="#ffffff" d="M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z"><animateTransform attributeName="transform" type="rotate" dur="0.75s" values="0 12 12;360 12 12" repeatCount="indefinite"/></path>\n ',e}();w.style.display="none",$f(d,g),$f(d,v),$f(d,l),$f(d,b),$f(c,d);const _=Jf({tagName:"div",style:{width:"100%",margin:"10%",zIndex:"1",display:"flex",justifyContent:"center"},id:"trigger-section",testid:"trigger-section"});$f(_,w),$f(_,m),$f(_,y),$f(c,_),$f(c,n.videoElement);const A=Jf({tagName:"img",style:{display:"block",position:"absolute",objectFit:"cover",height:"100%",width:"100%",transform:"user"===ip(t)?"scaleX(-1)":""},id:"image-preview",testid:"image-preview"});const E=(e=>{const t=Jf({tagName:"div",style:{position:"absolute",height:"100%",width:"100%",objectFit:"cover"},id:"image-preview-section",testid:"image-preview-section"});return t.appendChild(e),t})(A);return $f(c,E),{component:c,setLoadingMode:e=>{var t;m.style.display="none",b.style.visibility="hidden",w.style.display="block",(null===(t=$a.state.autoCaptureSettings)||void 0===t?void 0:t.enabled)&&(w.style.height="63px",w.style.width="63px"),e&&(p.style.visibility="visible")},setApprovalRetakeButtons:e=>{let{approveAction:t,retakeAction:r}=e;var n,i;m.style.display="none",b.style.display="none",y.style.display="flex";const o=y.querySelector("#approve-image"),a=y.querySelector("#retake-image"),s=o.cloneNode(!0);null===(n=o.parentNode)||void 0===n||n.replaceChild(s,o),s.addEventListener("click",t);const u=a.cloneNode(!0);null===(i=a.parentNode)||void 0===i||i.replaceChild(u,a),u.addEventListener("click",r)},hideApprovalRetakeButtons:()=>{y.style.display="none",b.style.display="flex"},setPreviewImage:(e,t)=>{A.src=e,p.style.visibility="hidden",n.videoElement.style.display="none",m.style.display="none",b.style.visibility="hidden",E.style.display="block",w.style.display=t?"none":"block"},setLoadingComplete:()=>{w.style.display="none",p.style.visibility="hidden"},setAutoCapturingError:(e,t)=>{if(!e)return void(b.style.visibility="hidden");let r;r=e==mo.feedback.RESTRICTED_CRITERIA&&t?t:bp[e]?bp[e].message:ep.translate(e)!==e?e:bp.other.message,document.getElementById("image-error-message").innerHTML=ep.translate(r),b.style.visibility="visible"},enableVideoElement:()=>{m.style.display="block",n.videoElement.style.display="block",E.style.display="none",w.style.display="none"},setCapturingShowErrorMode:(e,t)=>{m.style.display="block",E.style.display="none",n.videoElement.style.display="block";const r=e==mo.feedback.RESTRICTED_CRITERIA,i=bp[e]||bp.other;document.getElementById("image-error-message").innerHTML=t&&r&&null!=Mp?Mp.parse(t,{async:!1}):ep.translate(i.message),b.style.visibility="visible",p.style.visibility="hidden"},setTitleInstructionsMidStep:e=>{let{title:t,instructions:r}=e;t&&(document.getElementById("step-title").innerHTML=ep.translate(t)),r&&(document.getElementById("step-instructions").innerHTML=ep.translate(r))}}};class Hp{constructor(){this.isValid=!0,this.failedStep=null,this.steps=[]}addStepResponse(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;t||(this.isValid=!1,this.failedStep=e),this.steps.push(new Gp(e,t,r))}}class Gp{constructor(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.duration=0,this.success=!0,this.step=e,this.success=t,this.duration=r}}class qp{constructor(){this.name=Op.ACCEPTED}async handleFrame(){return new Hp}}class Wp{constructor(){this.name=Op.VALID}async handleFrame(e){let{context:t,frame:r,deviceInfo:n,detectionStrategy:i}=e;const o=await i.validate({frame:r,deviceInfo:n});return o.isValid?(t.validFramesCounter++,t.validFramesCounter>=t.validFramesThreshold&&t.setState(new qp)):(t.validFramesCounter=0,t.invalidFramesCounter=1,t.invalidFramesCause=o.failedStep,t.setState(new Xp)),o}}class Kp{constructor(){this.name=Op.REJECTED}async handleFrame(e){let{context:t,frame:r,detectionStrategy:n,deviceInfo:i}=e;const o=await n.validate({frame:r,deviceInfo:i});return o.isValid?(t.invalidFramesCounter=0,t.validFramesCounter=1,t.setState(new Wp),o):t.invalidFramesCause!==o.failedStep?(t.invalidFramesCounter=1,t.invalidFramesCause=o.failedStep,t.setState(new Xp),o):(t.invalidFramesCounter++,o)}}class Xp{constructor(){this.name=Op.INVALID}async handleFrame(e){let{context:t,frame:r,detectionStrategy:n,deviceInfo:i}=e;const o=await n.validate({frame:r,deviceInfo:i});return o.isValid?(t.invalidFramesCounter=0,t.validFramesCounter=1,t.setState(new Wp)):t.invalidFramesCause!==o.failedStep?(t.invalidFramesCounter=1,t.invalidFramesCause=o.failedStep):(t.invalidFramesCounter++,t.invalidFramesCounter>=t.invalidFramesThreshold&&t.setState(new Kp)),o}}class Yp{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3;this.detectionStrategy=e,this.state=new Xp,this.validFramesCounter=0,this.invalidFramesCounter=0,this.invalidFramesCause=null,this.validFramesThreshold=t,this.invalidFramesThreshold=r}setState(e){this.state=e}async handleFrame(e){let{frame:t,deviceInfo:r}=e;return await this.state.handleFrame({context:this,frame:t,deviceInfo:r,detectionStrategy:this.detectionStrategy})}}async function Zp(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=function(e,t,r){const n=document.createElement("canvas"),i=t||{height:e.height,width:e.width},o=n.getContext("2d");n.width=i.width,n.height=i.height,r?null==o||o.drawImage(e,r.x,r.y,r.width,r.height,0,0,i.width,i.height):null==o||o.drawImage(e,0,0,i.width,i.height);const a=null==o?void 0:o.getImageData(0,0,i.width,i.height);return n.remove(),a}(t,arguments.length>3?arguments[3]:void 0,arguments.length>4?arguments[4]:void 0),o=await new Promise((o,a)=>{navigator.serviceWorker.ready.then(s=>{var u;const c=t=>{t.data.type===e+"_RESULT"&&(navigator.serviceWorker.removeEventListener("message",c),o(t.data.result)),t.data.type===e+"_ERROR"&&(navigator.serviceWorker.removeEventListener("message",c),ss(t.data.error.toString(),e,"error"),a(t.data.error))};navigator.serviceWorker.addEventListener("message",c),null===(u=s.active)||void 0===u||u.postMessage(n({type:e,imageData:i,height:t.height,width:t.width},r))})});return cs(`****** in web-SDK return result for ${e}`,o),o}async function Jp(e){if(e instanceof HTMLVideoElement&&e.paused)return[];return Zp("DETECT_DOCUMENT",e,{},Rf[ls.DOCUMENT_DETECTOR].imageDimensions)}async function $p(e,t){return Zp("BLUR_GLARE_CLASSIFY",e,{},Rf[ls.BLUR_GLARE_CLASSIFIER].imageDimensions,t)}class Qp{constructor(e){this.barcodeModel=null,this.hasBarcode=e,this.barcodeModel=kf()}async validate(e){let{frame:t,deviceInfo:r}=e;var n;const i=new Hp;let o=Date.now();const a=null===(n=await Jp(t))||void 0===n?void 0:n[0];let s=Date.now()-o;if(i.addStepResponse(Qa.DOCUMENT_DETECTION,void 0!==a,s),!a)return i;o=Date.now();const u=zp({captureFrame:document.getElementById("overlay-frame environment").getBoundingClientRect(),object:a,videoWidth:t.width,videoHeight:t.height,deviceWidth:r.width,deviceHeight:r.height,threshold:$a.state.autoCaptureSettings.settings.capture.documentBackSizeThreshold,iouThreshold:$a.state.autoCaptureSettings.settings.capture.documentBackIouThreshold});if(s=Date.now()-o,i.addStepResponse(Qa.DOCUMENT_POSITION,u,s),!u)return i;o=Date.now();const c=await $p(t,a);s=Date.now()-o;const l=c.some(e=>"blur"===e.class);if(i.addStepResponse(Qa.BLUR_DETECTION,!l,s),l)return i;const d=c.some(e=>"glare"===e.class);if(i.addStepResponse(Qa.GLARE_DETECTION,!d,s),d)return i;if(this.hasBarcode){o=Date.now();const e=await this.barcodeModel.detect(t);s=Date.now()-o;const r=(null==e?void 0:e.length)>0;if(i.addStepResponse(Qa.BARCODE_DETECTION,r,s),!r)return i}return i}}class eg{constructor(){this.durations=[],this.countSuccess=0,this.countFailed=0}}class tg{constructor(){this.frameHandleDurations=[],this.stableCounts=[0],this.stats=new Map,Object.values(Qa).forEach(e=>{this.stats.set(e,new eg)})}addStats(e,t){this.frameHandleDurations.push(t),e.isValid?this.stableCounts[this.stableCounts.length-1]++:this.stableCounts.push(0),e.steps.forEach(e=>{this.addStat(e.step,e.duration,e.success?1:0,e.success?0:1)})}addStat(e,t,r,n){const i=this.stats.get(e);if(!i)throw new Error(`Stat for step ${e} not found`);i.durations.push(t),i.countSuccess+=r,i.countFailed+=n}}let rg=!1;const ng=e=>{rg=e};class ig{async validate(e){let{frame:t,deviceInfo:r}=e;var n;const i=new Hp;let o=Date.now();const a=null===(n=await Jp(t))||void 0===n?void 0:n[0];let s=Date.now()-o;if(i.addStepResponse(Qa.DOCUMENT_DETECTION,void 0!==a,s),!a)return i;o=Date.now();const u=zp({captureFrame:document.getElementById("overlay-frame environment").getBoundingClientRect(),object:a,videoWidth:t.width,videoHeight:t.height,deviceWidth:r.width,deviceHeight:r.height,threshold:$a.state.autoCaptureSettings.settings.capture.documentFrontSizeThreshold,iouThreshold:$a.state.autoCaptureSettings.settings.capture.documentFrontIouThreshold});if(s=Date.now()-o,i.addStepResponse(Qa.DOCUMENT_POSITION,u,s),!u)return i;o=Date.now();const c=await $p(t,a);s=Date.now()-o;const l=c.some(e=>"blur"===e.class);if(i.addStepResponse(Qa.BLUR_DETECTION,!l,s),l)return i;const d=c.some(e=>"glare"===e.class);return i.addStepResponse(Qa.GLARE_DETECTION,!d,s),i}}let og=!1;const ag=e=>{og=e};class sg{async validate(e){let{frame:t,deviceInfo:r}=e;var n;const i=new Hp;let o=Date.now();const a=null===(n=await async function(e){return e instanceof HTMLVideoElement&&e.paused?[]:Zp("DETECT_FACE_LANDMARKS",e)}(t))||void 0===n?void 0:n[0];let s=Date.now()-o;if(i.addStepResponse(Qa.FACE_DETECTION,"face"===(null==a?void 0:a.class),s),!a)return i;o=Date.now();const u=zp({captureFrame:document.getElementById("overlay-frame user").getBoundingClientRect(),object:a,videoWidth:t.width,videoHeight:t.height,deviceWidth:r.width,deviceHeight:r.height,threshold:$a.state.autoCaptureSettings.settings.faceDetector.selfieSizeThreshold,iouThreshold:$a.state.autoCaptureSettings.settings.faceDetector.selfieIouThreshold});return s=Date.now()-o,i.addStepResponse(Qa.FACE_POSITION,u,s),i}}let ug=!1;const cg=e=>{ug=e};async function lg(e,t){var r,n,i,o;let a="camera-error";if("NotAllowedError"===t.name){a="Permission dismissed"===t.message?"camera-permission-dismissed":"camera-permission-denied";const s=is.createCameraNotAllowedEvent(t.message,e);await os(null===(r=$a.state)||void 0===r?void 0:r.step,null===(n=$a.state)||void 0===n?void 0:n.userToken,null===(i=$a.state)||void 0===i?void 0:i.sessionId,null===(o=$a.state)||void 0===o?void 0:o.clientId,s),$a.dispatch("setIsCapturingProcessStarted",!1)}Wa(e,a)}function dg(e){const t=(e=>{var t,r,n,i;const[o,a]=e.split(",");if(!o||!a)throw new Error("unable-to-parse-data-uri");const s=null===(n=null===(r=null===(t=o.split(";"))||void 0===t?void 0:t[0])||void 0===r?void 0:r.split(":"))||void 0===n?void 0:n[1];if(!s)throw new Error("unable-to-parse-data-uri");const u=null===(i=s.split("/"))||void 0===i?void 0:i[1];if(!u)throw new Error("unable-to-parse-data-uri");return{data:a,format:u}})(e);return{image:{data:t.data,format:t.format,captureMargins:np()}}}let hg=!1;const fg=async()=>{const e=await Kf($a.state.sessionId,$a.state.userToken,$a.state.clientId);pg(e)},pg=async e=>{var t;"expired"===(null==e?void 0:e.status)?Ka("processing","session-expired",`Session expired for session id: ${$a.state.sessionId}`):(null==e?void 0:e.missing_images)&&(null===(t=null==e?void 0:e.missing_images)||void 0===t?void 0:t.length)>0&&setTimeout(fg,3e3)},gg=e=>{let{step:t}=e;var r,n,i;const o=null===(n=null===(r=$a.state)||void 0===r?void 0:r.autoCaptureSettings)||void 0===n?void 0:n.enabled;let a=!1;const s=null===(i=$a.state)||void 0===i?void 0:i.videoCaptureSettings,u=(e=>{let t,r,n=!1;const i=yp(e),o=new up(i),a=async()=>{n&&(await o.stopCamera(),o.stream&&o.stream.getTracks().forEach(e=>{"live"==e.readyState&&e.stop()}),n=!1)};return{videoStream:r,startVideoFeed:async e=>{var i,s,u;n&&await a(),"environment"==e&&(t=await dp());const c=null!==(s=null===(i=null==t?void 0:t.selectedCamera)||void 0===i?void 0:i.deviceId)&&void 0!==s?s:e,l=mp(e,null===(u=$a.state)||void 0===u?void 0:u.videoCaptureSettings);cp.getInstance().stopStream(),r=await o.startCamera(c,l),n=!0},stopVideoFeed:a,videoElement:o.videoElement,getDataUri:o.getDataUri,getCameraInfo:()=>t}})(ip(t));!function(e){Ga({type:"page-load",step:e})}(t),fg();const c=Vp({step:t,setImage:l,camera:u});async function l(e){let{suspendedPreview:r=!1,frame:n,context:i}=e;n||(n=Bp(u.videoElement)),"document_front"===t&&ag(!1),"document_back"===t&&ng(!1),"selfie"===t&&cg(!1);const o=Date.now(),l=function(e){const t=e.getCameraInfo();return{selectedCamera:(null==t?void 0:t.selectedCamera)&&{label:t.selectedCamera.label},camerasInfo:(null==t?void 0:t.optionalCameras)&&t.optionalCameras.map(e=>({label:e.label}))}}(u);if(!a)return;c.setLoadingMode(null==s?void 0:s.showLoadingBlock);const f=(e=>e.toDataURL("image/jpeg"))(n);c.setPreviewImage(f,"selfie"===t),await u.stopVideoFeed(),"selfie"!==t?await h(r,f,l,o,null==i?void 0:i.stats):(c.setTitleInstructionsMidStep({instructions:"selfie_approval_autocapture"}),c.setApprovalRetakeButtons({approveAction:async()=>{c.hideApprovalRetakeButtons(),await h(r,f,l,o,null==i?void 0:i.stats)},retakeAction:()=>{c.hideApprovalRetakeButtons(),d()}}))}function d(){"selfie"===t&&c.setTitleInstructionsMidStep({instructions:"second_title_face_autocapture"}),u.startVideoFeed(ip(t)).then(()=>{a=!0,c.enableVideoElement(),o&&(c.setAutoCapturingError(null),f(t))}).catch(async e=>{throw await lg(t,e),e})}async function h(e,r,n,i,l){const h=[];!function(e){var r,n,i,o;const a=is.createUserActionEvent("capture_image",t,e);os(null===(r=$a.state)||void 0===r?void 0:r.step,null===(n=$a.state)||void 0===n?void 0:n.userToken,null===(i=$a.state)||void 0===i?void 0:i.sessionId,null===(o=$a.state)||void 0===o?void 0:o.clientId,a)}(l),function(e,t){Ga({type:"capture-image",imageType:t,step:e})}(t,op(t));try{const u=Date.now(),l=dg(r);a=!1,h.push(rp($a.state.sessionId,$a.state.userToken,$a.state.clientId,null==l?void 0:l.image,n,op(t))),h.push(e?new Promise(e=>setTimeout(e,500)):Promise.resolve(null)),c.setLoadingMode(null==s?void 0:s.showLoadingBlock);const f=(await Promise.all(h))[0];if(Object.prototype.hasOwnProperty.call(f,"has_barcode")&&(hg=f.has_barcode),async function(e){let{step:t,requestStartTime:r,imageProcessingStartTime:n,serverProcessingTime:i,userToken:o,sessionId:a,clientId:s}=e;const u=Date.now()-r,c=n?r-n:0,l=is.createUploadImageEvent(t,String(u),String(i),String(c));await os(t,o,a,s,l)}({step:t,requestStartTime:u,imageProcessingStartTime:i,serverProcessingTime:f.serverProcessingTime,userToken:$a.state.userToken,sessionId:$a.state.sessionId,clientId:$a.state.clientId}),$a.dispatch("setMissingImages",f.missing_images),c.setLoadingComplete(),function(e,t,r){Ga({type:"capture-image-result",imageType:t,feedback:r,step:e})}(t,op(t),f.feedback),"ok"!==f.feedback)return await async function(e){Lp("border-color",kp),o?c.setAutoCapturingError(e.feedback,e.custom_feedback):c.setCapturingShowErrorMode(e.feedback,e.custom_feedback),await new Promise(e=>setTimeout(e,1e3)),Lp("border-color",Pp)}(f),void d();Lp("border-color",Np),await new Promise(e=>setTimeout(e,750)),Lp("border-color",Pp),$a.dispatch("setStep",(e=>{let t;return t=e&&e.length>0?e.shift():"processing",t})($a.state.missingImages))}catch(e){c.setLoadingComplete(),c.setCapturingShowErrorMode(mo.feedback.OTHER),u.startVideoFeed(ip(t)).then(()=>{a=!0}).catch(async e=>{throw await lg(t,e),e}),Wa(t,"failed-to-submit-image")}}async function f(e){if("document_front"===e){for(;!a||u.videoElement.paused;)await new Promise(e=>setTimeout(e,100));return u.videoElement.onloadedmetadata=()=>{var e;cs("video dimensions (width, height, orientation): ",u.videoElement.videoWidth,u.videoElement.videoHeight,null===(e=null===window||void 0===window?void 0:window.screen)||void 0===e?void 0:e.orientation)},await async function(e){let{camera:t,onDetect:r,showError:n}=e;var i,o,a,s,u,c,l;const d=new Yp(new ig,null!==(a=null===(o=null===(i=$a.state.autoCaptureSettings.settings)||void 0===i?void 0:i.stability)||void 0===o?void 0:o.numStableFrames)&&void 0!==a?a:2),h=new tg;for(ag(!0);d.state.name!==Op.ACCEPTED&&og;){const e=Date.now(),i=Bp(t.videoElement),o={width:null!==(u=null===(s=t.videoElement.getBoundingClientRect())||void 0===s?void 0:s.width)&&void 0!==u?u:0,height:null!==(l=null===(c=t.videoElement.getBoundingClientRect())||void 0===c?void 0:c.height)&&void 0!==l?l:0},a=await d.handleFrame({frame:i,deviceInfo:o}),f=Date.now()-e+50;h.addStats(a,f),d.stats=h,await Fp({context:d,onDetect:r,showError:n,frame:i}),await new Promise(e=>setTimeout(e,50))}}({camera:u,onDetect:l,showError:c.setAutoCapturingError})}if("document_back"===e){for(;!a||u.videoElement.paused;)await new Promise(e=>setTimeout(e,100));return u.videoElement.onloadedmetadata=()=>{var e;cs("video dimensions (width, height, orientation): ",u.videoElement.videoWidth,u.videoElement.videoHeight,null===(e=null===window||void 0===window?void 0:window.screen)||void 0===e?void 0:e.orientation)},await async function(e){let{camera:t,onDetect:r,showError:n,hasBarcode:i}=e;var o,a,s,u,c,l,d;const h=new Yp(new Qp(i),null!==(s=null===(a=null===(o=$a.state.autoCaptureSettings.settings)||void 0===o?void 0:o.stability)||void 0===a?void 0:a.numStableFrames)&&void 0!==s?s:2);ng(!0);const f=new tg;for(;h.state.name!==Op.ACCEPTED&&rg;){const e=Date.now(),i=Bp(t.videoElement),o={width:null!==(c=null===(u=t.videoElement.getBoundingClientRect())||void 0===u?void 0:u.width)&&void 0!==c?c:0,height:null!==(d=null===(l=t.videoElement.getBoundingClientRect())||void 0===l?void 0:l.height)&&void 0!==d?d:0},a=await h.handleFrame({frame:i,deviceInfo:o}),s=Date.now()-e+50;f.addStats(a,s),h.stats=f,await Fp({context:h,onDetect:r,showError:n,frame:i}),await new Promise(e=>setTimeout(e,50))}}({camera:u,onDetect:l,showError:c.setAutoCapturingError,hasBarcode:hg})}if("selfie"===e){for(;!a||u.videoElement.paused;)await new Promise(e=>setTimeout(e,100));return u.videoElement.onloadedmetadata=()=>{var e;cs("video dimensions (width, height, orientation): ",u.videoElement.videoWidth,u.videoElement.videoHeight,null===(e=null===window||void 0===window?void 0:window.screen)||void 0===e?void 0:e.orientation)},await async function(e){let{camera:t,onDetect:r,showError:n}=e;var i,o,a,s;const u=new Yp(new sg,30);cg(!0);const c=new tg;for(;u.state.name!==Op.ACCEPTED&&ug;){const e=Date.now(),l=Bp(t.videoElement),d={width:null!==(o=null===(i=t.videoElement.getBoundingClientRect())||void 0===i?void 0:i.width)&&void 0!==o?o:0,height:null!==(s=null===(a=t.videoElement.getBoundingClientRect())||void 0===a?void 0:a.height)&&void 0!==s?s:0},h=await u.handleFrame({frame:l,deviceInfo:d}),f=Date.now()-e;c.addStats(h,f),u.stats=c,await Fp({context:u,onDetect:r,showError:n,frame:l,isSelfie:!0}),await new Promise(e=>setTimeout(e,50))}}({camera:u,onDetect:l,showError:c.setAutoCapturingError})}}return o&&f(t),(async e=>{var t,r,n,i;const o=is.createPageViewEvent(e);await os(null===(t=$a.state)||void 0===t?void 0:t.step,null===(r=$a.state)||void 0===r?void 0:r.userToken,null===(n=$a.state)||void 0===n?void 0:n.sessionId,null===(i=$a.state)||void 0===i?void 0:i.clientId,o)})(t),u.startVideoFeed(ip(t)).then(()=>{a=!0}).catch(async e=>{throw await lg(t,e),e}),c.component},mg=()=>{Ga({type:"start-verification-processing",step:$a.state.step}),qa("processing","processing",$a.state.sessionId);const e=yg("processing-verification");$f(e,Dp({text:"Processing Verification",id:"processing-verification-header",testid:"processing-verification-header"}));const t=async()=>{const e=await Kf($a.state.sessionId,$a.state.userToken,$a.state.clientId);i(e)},r=()=>{setTimeout(t,3e3)},n=async e=>{$a.dispatch("setStep",e.status),$a.dispatch("setStatus",e.status)},i=async e=>{var t,i;if($a.dispatch("setMissingImages",e.missing_images),e.status)if("complete"===(null==e?void 0:e.status)){cp.getInstance().stopStream();const r=is.createProcessingCompleteEvent();await os($a.state.step,$a.state.userToken,null===(t=$a.state)||void 0===t?void 0:t.sessionId,null===(i=$a.state)||void 0===i?void 0:i.clientId,r),n(e),qa("complete",e.status,$a.state.sessionId),function(e,t,r){Ga({type:"verification-complete",step:e,sessionId:t,callbackUrl:r})}("complete",$a.state.sessionId,e.callback_url),function(e){sessionStorage.removeItem(e)}(Ua)}else"recapture"===(null==e?void 0:e.status)?(n(e),$a.dispatch("setIsCapturingProcessStarted",!1),qa("recapture",e.status,$a.state.sessionId),function(e,t,r){Ga({type:"verification-recapture",step:e,sessionId:t,reason:r})}("recapture",e.status,e.recapture_reason)):"expired"===(null==e?void 0:e.status)?Ka("processing","session-expired",`Session expired for session id: ${$a.state.sessionId}`):r();else"processing"!==e.state&&(n(e),r())};return t(),e},yg=e=>Jf({tagName:"div",style:{display:"flex",height:"100%",justifyContent:"space-between",flexDirection:"column",alignItems:"center"},id:e,testid:"processing-verification"});function vg(e,t){var r;if(!e)return;null===(r=t.firstChild)||void 0===r||r.remove();const n=function(e){switch(e){case"processing":return mg;case"document_front":case"document_back":case"selfie":return gg;default:throw new Error("Invalid step")}}(e);$f(t,n({step:e}))}function bg(e){let{key:t,state:r}=e;const n=r.rootElementId,i=document.getElementById(n);"step"===t&&"complete"!==r.step&&"recapture"!==r.step&&vg(r.step,i),i&&"processing"===r.step&&(i.style.visibility="hidden")}function wg(){const e=Xf(ja(Ua));if(!Xf)throw console.log("Error restarting session, stored session data is invalid or missing"),new Error("Error restarting session, stored session data is invalid or missing");const t=e.sessionId,r=e.userToken;return $a.dispatch("setSessionId",t),$a.dispatch("setUserToken",r),{sessionId:t,userToken:r}}async function _g(){var e,t;if(null===(e=$a.state.autoCaptureSettings)||void 0===e?void 0:e.enabled){const e=Date.now();try{await Cg(),cs("all models loaded - auto-capture enabled")}catch(e){$a.dispatch("setAutoCaptureSettings",{enabled:!1,autocapture_settings:null===(t=$a.state.autoCaptureSettings)||void 0===t?void 0:t.settings}),cs("Model loading did not complete on time:",e);ss(`timed out loading models: ${Nf.filter(e=>Rf[e].status!==Df.LOADED).map(e=>e).join(", ")}`,"model_load_timeout","init")}const r=Object.values(Rf).filter(e=>e.status===Df.LOADED).map(e=>e.loadingStats);!async function(e,t){const r=is.createSdkInitEvent(e,t);await us("init",r)}(Date.now()-e,r)}}async function Ag(e){var t;try{await cp.getInstance().startNewStream({video:n(n({},mp("environment",null===(t=$a.state)||void 0===t?void 0:t.videoCaptureSettings)),{},{deviceId:await gp("environment")})}),function(e,t){Ga({type:"session-id-acquired",step:e,sessionId:t})}("init",e),function(e,t,r){const n=document.getElementById(r);n.style.visibility="visible",vg(e.shift(),n)}($a.state.missingImages,$a.state.sessionId,$a.state.rootElementId)}catch(e){await lg("init",e)}}async function Eg(e){let{status:t,sessionId:r,userToken:n,missingImages:i,rootElementId:o,language:a}=e;!function(e,t){Ga({type:"session-granted",step:e,sessionId:t})}("init",r),$a.dispatch("setStatus",t),$a.dispatch("setSessionId",r),$a.dispatch("setUserToken",n),$a.dispatch("setMissingImages",i),$a.dispatch("setRootElement",o),$a.dispatch("setLanguage",a),async function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en";ep.overrideLanguage(tp[r]||tp.en);let n=document.getElementById(t);if(!n){n=Jf({tagName:"div",style:{background:"#fff",position:"absolute",top:"0",left:"0",zIndex:"1",width:"100%",height:"100%",font:"inherit"},id:t,testid:"root"});const e=document.createElement("style");e.innerHTML=`\n @media only screen and (max-height: 576px) {\n #${t} #trigger-section {\n margin: 0 !important;\n }\n #${t} #page-header {\n height: 5% !important;\n }\n }\n `,$f(document.head,e),$f(document.body,n)}}($a.state.sessionId,$a.state.rootElementId,$a.state.language),function(){try{Fa.events.off(za,bg)}catch(e){}Fa.events.on(za,bg)}(),await _g(),await Ag(r)}const Cg=async()=>{const e=$a.state.autoCaptureSettings.settings.modelLoadingTimeout;return Promise.race([Pf(),new Promise((t,r)=>setTimeout(()=>r(new Error(`Model loading timed out after ${e} ms`)),e))])};async function xg(e){if($a.state.isCapturingProcessStarted)return void Wa($a.state.step,"trying-to-initialize-active-session");let t,r;if(e){const n=await async function(e){let t,r;try{const n=await Zf(e,$a.state.consentVersion,$a.state.clientId);return t=n.sessionId,r=n.userToken,$a.dispatch("setSessionId",t),$a.dispatch("setUserToken",r),{sessionId:t,userToken:r}}catch(e){throw console.log("Error starting session"),console.error(e),e}}(e);t=n.sessionId,r=n.userToken}else{const e=wg();t=e.sessionId,r=e.userToken}if(!t)return void Wa($a.state.step,"other");const{missing_images:n,status:i}=await Kf(t,r,$a.state.clientId);return $a.dispatch("setIsCapturingProcessStarted",!0),await Eg({status:i,sessionId:t,userToken:r,missingImages:n,rootElementId:$a.state.rootElementId,language:$a.state.language}),!0}async function Sg(){try{return await async function(){if("recapture"===$a.state.verificationStatus||"pending"===$a.state.verificationStatus){const{sessionId:e,userToken:t}=wg(),{missing_images:r,status:n}=await Kf(e,t,$a.state.clientId);return await Eg({status:n,sessionId:e,userToken:t,missingImages:r,rootElementId:$a.state.rootElementId,language:$a.state.language}),!0}Wa($a.state.step,"trying-to-initialize-active-session")}()}catch(e){throw console.log("Error restarting session"),console.error(e),e}}var Ig=Object.freeze({__proto__:null,recapture:Sg,restart:async function(){return Sg()},start:async function(e){try{return await xg(e)}catch(e){throw console.log("Error starting session"),console.error(e),e}},version:()=>Ao});class Tg{static arrayBufferToBase64(e){return btoa(String.fromCharCode(...new Uint8Array(e)))}static base64ToArrayBuffer(e){return Uint8Array.from(atob(e),e=>e.charCodeAt(0))}static stringToBase64(e){return btoa(e)}static jsonToBase64(e){const t=JSON.stringify(e);return btoa(t)}static base64ToJson(e){const t=atob(e);return JSON.parse(t)}}const Mg={log:console.log,error:console.error};var Dg,Rg;!function(e){e.NotInitialized="not_initialized",e.AuthenticationFailed="authentication_failed",e.AuthenticationAbortedTimeout="authentication_aborted_timeout",e.AuthenticationCanceled="webauthn_authentication_canceled",e.RegistrationFailed="registration_failed",e.AlreadyRegistered="username_already_registered",e.RegistrationAbortedTimeout="registration_aborted_timeout",e.RegistrationCanceled="webauthn_registration_canceled",e.AutofillAuthenticationAborted="autofill_authentication_aborted",e.AuthenticationProcessAlreadyActive="authentication_process_already_active",e.InvalidApprovalData="invalid_approval_data",e.FailedToInitCrossDeviceSession="cross_device_init_failed",e.FailedToGetCrossDeviceStatus="cross_device_status_failed",e.Unknown="unknown"}(Dg||(Dg={}));class Og extends Error{constructor(e,t){super(e),this.errorCode=Dg.NotInitialized,this.data=t}}class kg extends Og{constructor(e,t){super(null!=e?e:"WebAuthnSdk is not initialized",t),this.errorCode=Dg.NotInitialized}}class Ng extends Og{constructor(e,t){super(null!=e?e:"Authentication failed with an error",t),this.errorCode=Dg.AuthenticationFailed}}class Pg extends Og{constructor(e,t){super(null!=e?e:"Authentication was canceled by the user or got timeout",t),this.errorCode=Dg.AuthenticationCanceled}}class Bg extends Og{constructor(e,t){super(null!=e?e:"Registration failed with an error",t),this.errorCode=Dg.RegistrationFailed}}class Fg extends Og{constructor(e,t){super(null!=e?e:"Registration was canceled by the user or got timeout",t),this.errorCode=Dg.RegistrationCanceled}}class Lg extends Og{constructor(e){super(null!=e?e:"Autofill flow was aborted"),this.errorCode=Dg.AutofillAuthenticationAborted}}class zg extends Og{constructor(e){super(null!=e?e:"Operation was aborted by timeout"),this.errorCode=Dg.AutofillAuthenticationAborted}}class Ug extends Og{constructor(e){super(null!=e?e:"Passkey with this username is already registered with the relying party."),this.errorCode=Dg.AlreadyRegistered}}class jg extends Og{constructor(e,t){super(null!=e?e:"Authentication process is already active",t),this.errorCode=Dg.AuthenticationProcessAlreadyActive}}class Vg extends Og{constructor(e,t){super(null!=e?e:"Invalid approval data",t),this.errorCode=Dg.InvalidApprovalData}}class Hg extends Og{constructor(e,t){super(null!=e?e:"Failed to init cross device authentication",t),this.errorCode=Dg.FailedToInitCrossDeviceSession}}class Gg extends Og{constructor(e,t){super(null!=e?e:"Failed to get cross device status",t),this.errorCode=Dg.FailedToGetCrossDeviceStatus}}function qg(e){return e.errorCode&&Object.values(Dg).includes(e.errorCode)}!function(e){e[e.persistent=0]="persistent",e[e.session=1]="session"}(Rg||(Rg={}));class Wg{static get(e){return Wg.getStorageMedium(Wg.allowedKeys[e]).getItem(Wg.getStorageKey(e))||void 0}static set(e,t){return Wg.getStorageMedium(Wg.allowedKeys[e]).setItem(Wg.getStorageKey(e),t)}static remove(e){Wg.getStorageMedium(Wg.allowedKeys[e]).removeItem(Wg.getStorageKey(e))}static clear(e){for(const[t,r]of Object.entries(Wg.allowedKeys)){const n=t;e&&this.configurationKeys.includes(n)||Wg.getStorageMedium(r).removeItem(Wg.getStorageKey(n))}}static getStorageKey(e){return`WebAuthnSdk:${e}`}static getStorageMedium(e){return e===Rg.session?sessionStorage:localStorage}}Wg.allowedKeys={clientId:Rg.session},Wg.configurationKeys=["clientId"];class Kg{static isNewApiDomain(e){return e&&(this.newApiDomains.includes(e)||e.startsWith("api.")&&e.endsWith(".transmitsecurity.io"))}static dnsPrefetch(e){const t=document.createElement("link");t.rel="dns-prefetch",t.href=e,document.head.appendChild(t)}static preconnect(e,t){const r=document.createElement("link");r.rel="preconnect",r.href=e,t&&(r.crossOrigin="anonymous"),document.head.appendChild(r)}static warmupConnection(e){this.dnsPrefetch(e),this.preconnect(e,!1),this.preconnect(e,!0)}static init(e,t){var r,n;try{this._serverPath=new URL(t.serverPath),this.isNewApiDomain(null===(r=this._serverPath)||void 0===r?void 0:r.hostname)&&this.warmupConnection(this._serverPath.origin),this._apiPaths=null!==(n=t.webauthnApiPaths)&&void 0!==n?n:this.getDefaultPaths(),this._clientId=e,Wg.set("clientId",e)}catch(e){throw new kg("Invalid options.serverPath",{error:e})}}static getDefaultPaths(){var e;const t=this.isNewApiDomain(null===(e=this._serverPath)||void 0===e?void 0:e.hostname)?"/cis":"";return{startAuthentication:`${t}/v1/auth/webauthn/authenticate/start`,startRegistration:`${t}/v1/auth/webauthn/register/start`,initCrossDeviceAuthentication:`${t}/v1/auth/webauthn/cross-device/authenticate/init`,startCrossDeviceAuthentication:`${t}/v1/auth/webauthn/cross-device/authenticate/start`,startCrossDeviceRegistration:`${t}/v1/auth/webauthn/cross-device/register/start`,getCrossDeviceTicketStatus:`${t}/v1/auth/webauthn/cross-device/status`,attachDeviceToCrossDeviceSession:`${t}/v1/auth/webauthn/cross-device/attach-device`}}static getApiPaths(){return this._apiPaths}static async sendRequest(e,t,r){Mg.log(`[WebAuthn SDK] Calling ${t.method} ${e}...`);const n=new URL(this._serverPath);return n.pathname=e,r&&(n.search=r),fetch(n.toString(),t)}static async startRegistration(e){const t=await this.sendRequest(this._apiPaths.startRegistration,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n(n({client_id:this.getValidatedClientId(),username:e.username,display_name:e.displayName},e.timeout&&{timeout:e.timeout}),e.limitSingleCredentialToDevice&&{limit_single_credential_to_device:e.limitSingleCredentialToDevice}))});if(!(null==t?void 0:t.ok))throw new Ng("Failed to start registration",null==t?void 0:t.body);return await t.json()}static async startAuthentication(e){const t=await this.sendRequest(this._apiPaths.startAuthentication,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n(n(n({client_id:this.getValidatedClientId()},e.username&&{username:e.username}),e.approvalData&&{approval_data:e.approvalData}),e.timeout&&{timeout:e.timeout}))});if(!(null==t?void 0:t.ok))throw new Ng("Failed to start authentication",null==t?void 0:t.body);return await t.json()}static async initCrossDeviceAuthentication(e){const t=await this.sendRequest(this._apiPaths.initCrossDeviceAuthentication,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n(n({client_id:this.getValidatedClientId()},e.username&&{username:e.username}),e.approvalData&&{approval_data:e.approvalData}))});if(!(null==t?void 0:t.ok))throw new Hg(void 0,null==t?void 0:t.body);return await t.json()}static async getCrossDeviceTicketStatus(e){const t=await this.sendRequest(this._apiPaths.getCrossDeviceTicketStatus,{method:"GET"},`cross_device_ticket_id=${e.ticketId}`);if(!(null==t?void 0:t.ok))throw new Gg(void 0,null==t?void 0:t.body);return await t.json()}static async startCrossDeviceAuthentication(e){const t=await this.sendRequest(this._apiPaths.startCrossDeviceAuthentication,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cross_device_ticket_id:e.ticketId})});if(!(null==t?void 0:t.ok))throw new Ng("Failed to start cross device authentication",null==t?void 0:t.body);return await t.json()}static async startCrossDeviceRegistration(e){const t=await this.sendRequest(this._apiPaths.startCrossDeviceRegistration,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cross_device_ticket_id:e.ticketId})});if(!(null==t?void 0:t.ok))throw new Bg("Failed to start cross device registration",null==t?void 0:t.body);return await t.json()}static async attachDeviceToCrossDeviceSession(e){const t=await this.sendRequest(this._apiPaths.attachDeviceToCrossDeviceSession,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cross_device_ticket_id:e.ticketId})});if(!(null==t?void 0:t.ok))throw new Bg("Failed to attach device to cross device session",null==t?void 0:t.body);return await t.json()}static getValidatedClientId(){var e;const t=null!==(e=this._clientId)&&void 0!==e?e:Wg.get("clientId");if(!t)throw new kg("Missing clientId");return t}}var Xg,Yg,Zg,Jg;Kg.newApiDomains=["api.idsec-dev.com","api.idsec-stg.com"],function(e){e.InputAutofill="input-autofill",e.Modal="modal"}(Xg||(Xg={})),function(e){e.Pending="pending",e.Scanned="scanned",e.Success="success",e.Error="error",e.Timeout="timeout",e.Aborted="aborted"}(Yg||(Yg={})),function(e){e.toAuthenticationError=e=>qg(e)?e:"NotAllowedError"===e.name?new Pg:"OperationError"===e.name?new jg(e.message):"SecurityError"===e.name?new Ng(e.message):e===Dg.AuthenticationAbortedTimeout?new zg:"AbortError"===e.name||e===Dg.AutofillAuthenticationAborted?new Lg:new Ng("Something went wrong during authentication",{error:e}),e.toRegistrationError=e=>qg(e)?e:"NotAllowedError"===e.name?new Fg:"SecurityError"===e.name?new Bg(e.message):"InvalidStateError"===e.name?new Ug:e===Dg.RegistrationAbortedTimeout?new zg:new Bg("Something went wrong during registration",{error:e})}(Zg||(Zg={})),function(e){e.processCredentialRequestOptions=e=>n(n({},e),{},{challenge:Tg.base64ToArrayBuffer(e.challenge),allowCredentials:e.allowCredentials.map(e=>n(n({},e),{},{id:Tg.base64ToArrayBuffer(e.id)}))}),e.processCredentialCreationOptions=(e,t)=>{var r;const i=JSON.parse(JSON.stringify(e));return i.challenge=Tg.base64ToArrayBuffer(e.challenge),i.user.id=Tg.base64ToArrayBuffer(e.user.id),(null==t?void 0:t.limitSingleCredentialToDevice)&&(i.excludeCredentials=null===(r=e.excludeCredentials)||void 0===r?void 0:r.map(e=>n(n({},e),{},{id:Tg.base64ToArrayBuffer(e.id)}))),(null==t?void 0:t.registerAsDiscoverable)?(i.authenticatorSelection.residentKey="preferred",i.authenticatorSelection.requireResidentKey=!0):(i.authenticatorSelection.residentKey="discouraged",i.authenticatorSelection.requireResidentKey=!1),i.authenticatorSelection.authenticatorAttachment=(null==t?void 0:t.allowCrossPlatformAuthenticators)?void 0:"platform",i},e.encodeAuthenticationResult=e=>{const{authenticatorAttachment:t}=e,r=e.response;return{id:e.id,rawId:Tg.arrayBufferToBase64(e.rawId),response:{authenticatorData:Tg.arrayBufferToBase64(r.authenticatorData),clientDataJSON:Tg.arrayBufferToBase64(r.clientDataJSON),signature:Tg.arrayBufferToBase64(r.signature),userHandle:Tg.arrayBufferToBase64(r.userHandle)},authenticatorAttachment:t,type:e.type}},e.encodeRegistrationResult=e=>{const{authenticatorAttachment:t}=e,r=e.response;return{id:e.id,rawId:Tg.arrayBufferToBase64(e.rawId),response:{attestationObject:Tg.arrayBufferToBase64(r.attestationObject),clientDataJSON:Tg.arrayBufferToBase64(r.clientDataJSON)},authenticatorAttachment:t,type:e.type}}}(Jg||(Jg={}));class $g{async modal(e){try{const t=await this.performAuthentication(n(n({},e),{},{mediationType:Xg.Modal}));return Tg.jsonToBase64(t)}catch(e){throw Zg.toAuthenticationError(e)}}activateAutofill(e,t){const{onSuccess:r,onError:n,onReady:i}=e;this.performAuthentication({username:t,mediationType:Xg.InputAutofill,onReady:i}).then(e=>{r(Tg.jsonToBase64(e))}).catch(e=>{const t=Zg.toAuthenticationError(e);if(!n)throw t;n(t)})}abortAutofill(){this.abortController&&this.abortController.abort(Dg.AutofillAuthenticationAborted)}abortAuthentication(){this.abortController&&this.abortController.abort(Dg.AuthenticationAbortedTimeout)}async performAuthentication(e){var t,r;const n="crossDeviceTicketId"in e?await Kg.startCrossDeviceAuthentication({ticketId:e.crossDeviceTicketId}):await Kg.startAuthentication({username:e.username,timeout:null===(t=e.options)||void 0===t?void 0:t.timeout}),i=n.credential_request_options,o=Jg.processCredentialRequestOptions(i),a=this.getMediatedCredentialRequest(o,e.mediationType);e.mediationType===Xg.InputAutofill&&(null===(r=e.onReady)||void 0===r||r.call(e));const s=await navigator.credentials.get(a).catch(e=>{throw Zg.toAuthenticationError(e)});return{webauthnSessionId:n.webauthn_session_id,publicKeyCredential:Jg.encodeAuthenticationResult(s),userAgent:navigator.userAgent}}getMediatedCredentialRequest(e,t){const r={publicKey:e};return this.abortController=new AbortController,r.signal=this.abortController&&this.abortController.signal,t===Xg.InputAutofill?r.mediation="conditional":e.timeout&&setTimeout(()=>{this.abortAuthentication()},e.timeout),r}}class Qg{constructor(e,t){this.handler=e,this.intervalInMs=t}begin(){var e;this.intervalId=window.setInterval((e=this.handler,async function(){e.isRunning||(e.isRunning=!0,await e(...arguments),e.isRunning=!1)}),this.intervalInMs)}stop(){clearInterval(this.intervalId)}}const em=/^[A-Za-z0-9\-_.: ]*$/;function tm(e){if(e&&(!function(e){return Object.keys(e).length<=10}(e)||!function(e){const t=e=>"string"==typeof e,r=e=>em.test(e);return Object.keys(e).every(n=>t(n)&&t(e[n])&&r(n)&&r(e[n]))}(e)))throw Mg.error("Failed validating approval data"),new Vg("Provided approval data should have 10 properties max. Also, it should contain only \n alphanumeric characters, numbers, and the special characters: '-', '_', '.'")}class rm{constructor(e,t,r){this.authenticationHandler=e,this.registrationHandler=t,this.approvalHandler=r,this.init={registration:async e=>(this.ticketStatus=Yg.Pending,this.pollCrossDeviceSession(e.crossDeviceTicketId,e.handlers)),authentication:async e=>{const{username:t}=e,r=(await Kg.initCrossDeviceAuthentication(n({},t&&{username:t}))).cross_device_ticket_id;return this.ticketStatus=Yg.Pending,this.pollCrossDeviceSession(r,e.handlers)},approval:async e=>{const{username:t,approvalData:r}=e;tm(r);const n=(await Kg.initCrossDeviceAuthentication({username:t,approvalData:r})).cross_device_ticket_id;return this.ticketStatus=Yg.Pending,this.pollCrossDeviceSession(n,e.handlers)}},this.authenticate={modal:async e=>this.authenticationHandler.modal({crossDeviceTicketId:e})},this.approve={modal:async e=>this.approvalHandler.modal({crossDeviceTicketId:e})}}async register(e,t){return this.registrationHandler.register({crossDeviceTicketId:e},t)}async attachDevice(e){const t=await Kg.attachDeviceToCrossDeviceSession({ticketId:e});return n({status:t.status,startedAt:t.started_at},t.approval_data&&{approvalData:t.approval_data})}async pollCrossDeviceSession(e,t){return this.poller=new Qg(async()=>{var r,n;const i=await Kg.getCrossDeviceTicketStatus({ticketId:e}),o=i.status;if(o!==this.ticketStatus)switch(this.ticketStatus=o,o){case Yg.Scanned:await t.onDeviceAttach();break;case Yg.Error:case Yg.Timeout:case Yg.Aborted:await t.onFailure(i),null===(r=this.poller)||void 0===r||r.stop();break;case Yg.Success:if("onCredentialRegister"in t)await t.onCredentialRegister();else{if(!i.session_id)throw new Gg("Cross device session is complete without returning session_id",i);await t.onCredentialAuthenticate(i.session_id)}null===(n=this.poller)||void 0===n||n.stop()}},1e3),this.poller.begin(),setTimeout(()=>{var e;null===(e=this.poller)||void 0===e||e.stop(),t.onFailure({status:Yg.Timeout})},3e5),{crossDeviceTicketId:e,stop:()=>{var e;null===(e=this.poller)||void 0===e||e.stop()}}}}class nm{async register(e,t){this.abortController=new AbortController;const r=n({allowCrossPlatformAuthenticators:!("crossDeviceTicketId"in e),registerAsDiscoverable:!0},t);try{const n="crossDeviceTicketId"in e?await Kg.startCrossDeviceRegistration({ticketId:e.crossDeviceTicketId}):await Kg.startRegistration({username:e.username,displayName:(null==t?void 0:t.displayName)||e.username,timeout:null==t?void 0:t.timeout,limitSingleCredentialToDevice:null==t?void 0:t.limitSingleCredentialToDevice}),i=Jg.processCredentialCreationOptions(n.credential_creation_options,r);setTimeout(()=>{this.abortRegistration()},i.timeout);const o=await this.registerCredential(i),a={webauthnSessionId:n.webauthn_session_id,publicKeyCredential:o,userAgent:navigator.userAgent};return Tg.jsonToBase64(a)}catch(e){throw Zg.toRegistrationError(e)}}abortRegistration(){this.abortController&&this.abortController.abort(Dg.RegistrationAbortedTimeout)}async registerCredential(e){const t=await navigator.credentials.create({publicKey:e,signal:this.abortController&&this.abortController.signal}).catch(e=>{throw Zg.toRegistrationError(e)});return Jg.encodeRegistrationResult(t)}}class im{async modal(e){try{const t=await this.performApproval(e);return Tg.jsonToBase64(t)}catch(e){throw Zg.toAuthenticationError(e)}}async performApproval(e){"approvalData"in e&&tm(e.approvalData);const t="crossDeviceTicketId"in e?await Kg.startCrossDeviceAuthentication({ticketId:e.crossDeviceTicketId}):await Kg.startAuthentication({username:e.username,approvalData:e.approvalData}),r=t.credential_request_options,n=Jg.processCredentialRequestOptions(r),i=await navigator.credentials.get({publicKey:n}).catch(e=>{throw Zg.toAuthenticationError(e)});return{webauthnSessionId:t.webauthn_session_id,publicKeyCredential:Jg.encodeAuthenticationResult(i),userAgent:navigator.userAgent}}}class om{constructor(){this._initialized=!1,this._authenticationHandler=new $g,this._registrationHandler=new nm,this._approvalHandler=new im,this._crossDeviceHandler=new rm(this._authenticationHandler,this._registrationHandler,this._approvalHandler),this.authenticate={modal:async(e,t)=>(this.initCheck(),this._authenticationHandler.modal({username:e,options:t})),autofill:{activate:(e,t)=>(this.initCheck(),this._authenticationHandler.activateAutofill(e,t)),abort:()=>this._authenticationHandler.abortAutofill()}},this.approve={modal:async(e,t)=>(this.initCheck(),this._approvalHandler.modal({username:e,approvalData:t}))},this.register=async(e,t)=>(this.initCheck(),this._registrationHandler.register({username:e},t)),this.crossDevice={init:{registration:async e=>(this.initCheck(),this._crossDeviceHandler.init.registration(e)),authentication:async e=>(this.initCheck(),this._crossDeviceHandler.init.authentication(e)),approval:async e=>(this.initCheck(),this._crossDeviceHandler.init.approval(e))},authenticate:{modal:async e=>(this.initCheck(),this._crossDeviceHandler.authenticate.modal(e))},approve:{modal:async e=>(this.initCheck(),this._crossDeviceHandler.approve.modal(e))},register:async(e,t)=>(this.initCheck(),this._crossDeviceHandler.register(e,t)),attachDevice:async e=>(this.initCheck(),this._crossDeviceHandler.attachDevice(e))},this.isPlatformAuthenticatorSupported=async()=>{var e;try{return await(null===(e=om.StaticPublicKeyCredential)||void 0===e?void 0:e.isUserVerifyingPlatformAuthenticatorAvailable())}catch(e){return!1}},this.isAutofillSupported=async()=>{var e,t;return!(!(null===(e=om.StaticPublicKeyCredential)||void 0===e?void 0:e.isConditionalMediationAvailable)||!await(null===(t=om.StaticPublicKeyCredential)||void 0===t?void 0:t.isConditionalMediationAvailable()))}}async init(e,t){try{if(!e)throw new kg("Invalid clientId",{clientId:e});if(t.webauthnApiPaths){const e=Kg.getDefaultPaths();if(function(e,t){const r=new Set(e),n=new Set(t);return[...e.filter(e=>!n.has(e)),...t.filter(e=>!r.has(e))]}(Object.keys(t.webauthnApiPaths),Object.keys(e)).length)throw new kg("Invalid custom paths",{customApiPaths:t.webauthnApiPaths})}Kg.init(e,t),this._initialized=!0}catch(e){throw qg(e)?e:new kg("Failed to initialize SDK")}}getDefaultPaths(){return this.initCheck(),Kg.getDefaultPaths()}getApiPaths(){return this.initCheck(),Kg.getApiPaths()}initCheck(){if(!this._initialized)throw new kg}}om.StaticPublicKeyCredential=window.PublicKeyCredential;const am=new X("webauthn"),sm=new om;am.events.on(am.events.MODULE_INITIALIZED,()=>{var e;const t=am.moduleMetadata.getInitConfig();if(!(null===(e=null==t?void 0:t.webauthn)||void 0===e?void 0:e.serverPath))return;const{clientId:r,webauthn:i}=t;sm.init(r,n({},i))});const um={modal:async(e,t)=>(sm.initCheck(),sm.authenticate.modal(e,t)),autofill:{activate:(e,t)=>{sm.initCheck(),sm.authenticate.autofill.activate(e,t)},abort:()=>{sm.initCheck(),sm.authenticate.autofill.abort()}}},cm={modal:async(e,t)=>(sm.initCheck(),sm.approve.modal(e,t))};async function lm(e,t){return sm.initCheck(),sm.register(e,t)}const{crossDevice:dm}=sm,{isPlatformAuthenticatorSupported:hm}=sm,{isAutofillSupported:fm}=sm,{getDefaultPaths:pm}=sm;window.localWebAuthnSDK=sm;var gm=Object.freeze({__proto__:null,get WebauthnCrossDeviceStatus(){return Yg},approve:cm,authenticate:um,crossDevice:dm,getDefaultPaths:pm,isAutofillSupported:fm,isPlatformAuthenticatorSupported:hm,register:lm});const mm=new X("ido");var ym,vm,bm,wm,_m;!function(e){e[e.Debug=0]="Debug",e[e.Info=1]="Info",e[e.Warning=2]="Warning",e[e.Error=3]="Error"}(ym||(ym={})),function(e){e.InvalidInitOptions="invalid_initialization_options",e.NotInitialized="not_initialized",e.NoActiveJourney="no_active_journey",e.NetworkError="network_error",e.ClientResponseNotValid="client_response_not_valid",e.ServerError="server_error",e.InvalidState="invalid_state",e.InvalidCredentials="invalid_credentials",e.ExpiredOTPPasscode="expired_otp_passcode",e.ExpiredValidationPasscode="expired_validation_passcode",e.MaxResendReached="expired_otp_passcode"}(vm||(vm={})),function(e){e.ClientInput="client_input",e.Cancel="cancel",e.Fail="failure",e.Custom="custom",e.Resend="resend"}(bm||(bm={})),function(e){e.JourneySuccess="journey_success",e.ClientInputRequired="client_input_required",e.ClientInputUpdateRequired="client_input_update_required",e.JourneyRejection="journey_rejection"}(wm||(wm={})),function(e){e.Rejection="action:rejection",e.Success="action:success",e.Information="action:information",e.DebugBreak="action:debug_break",e.WaitForAnotherDevice="action:wait_for_another_device",e.CryptoBindingRegistration="action:crypto_binding_registration",e.CryptoBindingValidation="action:crypto_binding_validation",e.RegisterDeviceAction="transmit_platform_device_registration",e.ValidateDeviceAction="transmit_platform_device_validation",e.WebAuthnRegistration="action:webauthn_registration",e.DrsTriggerAction="action:drs_trigger_action",e.IdentityVerification="action:id_verification",e.EmailOTPAuthentication="transmit_platform_email_otp_authentication",e.SmsOTPAuthentication="transmit_platform_sms_otp_authentication",e.EmailValidation="transmit_platform_email_validation",e.SmsValidation="transmit_platform_sms_validation",e.TotpRegistration="transmit_platform_totp_registration",e.TransactionSigningTOTP="transmit_platform_transaction_signing_totp",e.InvokeIDP="invoke_idp",e.WebAuthnTransactionSigning="transmit_platform_transaction_signing_webauthn",e.SelectOrganization="transmit_platform_select_organization",e.MobileApproveAuthentication="transmit_platform_mobile_approve_authentication"}(_m||(_m={}));const Am="ts:idosdk:device",Em=new class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ym.Info;this.logLevel=e}setLogLevel(e){e<ym.Debug||e>ym.Error?this.error("Invalid log level"):this.logLevel=e}debug(e){this.logLevel<=ym.Debug&&console.debug(`[DEBUG] ${e}`)}info(e){this.logLevel<=ym.Info&&console.info(`[INFO] ${e}`)}warning(e){this.logLevel<=ym.Warning&&console.warn(`[WARNING] ${e}`)}error(e){this.logLevel<=ym.Error&&console.error(`[ERROR] ${e}`)}},Cm={[_m.CryptoBindingRegistration]:"input",[_m.CryptoBindingValidation]:"input",[_m.RegisterDeviceAction]:"data",[_m.ValidateDeviceAction]:"data"},xm="api/v2/",Sm={path:"auth/sso"},Im={path:"auth/anonymous_invoke"},Tm={path:"auth/assert"},Mm={path:"auth/poll"},Dm={path:"auth/create_debug_token"},Rm={path:"auth/key_exchange"},Om={headers:{mandatory:!0,dummy:[{type:"correlation_id",correlation_id:"337BFFE6BEE7D694B8FA41F42B00742CA537DC398F79369A3A60E04D0EB2E8E1"}]},data:{mandatory:!0,dummy:{collection_result:{metadata:{timestamp:(new Date).getTime()},content:{}},policy_request_id:"LoginWithMenu"},large_dummy:{metadata:{timestamp:1679422144431},content:{device_details:{logged_users:1,persistence_mode:"persistent",device_id:"8951bd7b67a959e7b12b5018816f9ce4",os_type:"Mac OS",os_version:"10.15.7",device_model:"Chrome 111.0.0.0"},location:{enabled:!1},capabilities:{fido2_user_verifying_platform_authenticator_available:!0,audio_acquisition_supported:!0,finger_print_supported:!1,image_acquisition_supported:!1,persistent_keys_supported:!0,face_id_key_bio_protection_supported:!1,fido_client_present:!1,fido2_client_present:!0,dyadic_present:!1,installed_plugins:[]},collector_state:{accounts:"disabled",devicedetails:"active",contacts:"disabled",owner:"disabled",software:"disabled",location:"disabled",locationcountry:"disabled",bluetooth:"disabled",externalsdkdetails:"active",hwauthenticators:"active",capabilities:"active",fidoauthenticators:"disabled",largedata:"active",localenrollments:"active",devicefingerprint:"active",apppermissions:"disabled"},local_enrollments:{}},fp2:{user_agent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36",webdriver:!0,language:"en-US",color_depth:30,device_memory:8,pixel_ratio:2,hardware_concurrency:12,screen_resolution:[1680,1050],available_screen_resolution:[1680,1025],timezone_offset:240,timezone:"America/New_York",session_storage:!0,local_storage:!0,indexed_db:!0,add_behavior:!1,open_database:!0,cpu_class:"not available",platform:"MacIntel",do_not_track:"not available",plugins:[["PDF Viewer","Portable Document Format",[["application/pdf","pdf"],["text/pdf","pdf"]]],["Chrome PDF Viewer","Portable Document Format",[["application/pdf","pdf"],["text/pdf","pdf"]]],["Chromium PDF Viewer","Portable Document Format",[["application/pdf","pdf"],["text/pdf","pdf"]]],["Microsoft Edge PDF Viewer","Portable Document Format",[["application/pdf","pdf"],["text/pdf","pdf"]]],["WebKit built-in PDF","Portable Document Format",[["application/pdf","pdf"],["text/pdf","pdf"]]]],canvas:["canvas winding:yes","canvas fp:data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAB9AAAADICAYAAACwGnoBAAAAAXNSR0IArs4c6QAAIABJREFUeF7s3XeYXVW9//H3Omdaeu+FGgiE9BDAgmIBQRRQ4eIP0JCQmdC8YgHrZRQLAooSSjIpRMpVCZciiIAiKhoIpEMoUtILKaS3KWf/nu8+e0/2nDkzc+bMmckMfNbz8Ejm7L3W2q8zwT8++/tdjlY+PLz+wAhgKHA0MBjoB/QEDq9j+6uAzcAGYDXwFvA6sMzh1of3eHjtgWHA8ZH/7Qa0q+Mfu3VfHf9sA14Flof/63B7q/fn5fY5cAefo5V/hdqeBCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQggTYh4FrbLj2844BPAh8FTg4C81xucyewBygAeuRy4uhcrwF/6sx7Tw3lwMKT6LDtNDr7T2Sxf26GvRjwAvBP4G84Z0tmNLxivIwufJ9d5Mpodb/v7zNiPY4EJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAE2rRAqwgUPbyTgC8AnwMsQG+TYz7wEPAYUGeaPQr4MPCh4BWBQTl7VFvSln4I52wrdQ4F6Dkz10QSkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkMD7SOCQBegenlV/XwpMCtqzt0nWrcDdwKygR3yjH+IU4LPBqwPWqD43w8J029IcnLMt1hgK0HODrFkkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIIH3l0D9AXppaR6lpZX+I0f/vQkGHt5w4EqgJJNprNf4GnYzgA7EcWxhPz0pyuTWjK7ZxgG6UehfW0mCchK0J6/Be18G7gCmN3ilPYER5jd4JacDnw/CdDvpPXXsPQDxOBQ2vL/IrdOAO3HOtuwPC9C3056uHDyiveHNte0rttCRXmW7c/PCSH1/F+r6LJt72ja5di8BCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCCBNidQO1CcNPNo4lU/Ak7AeTvwXAc8twbnHUdl3jhmT9qVzVN6eFZf/W3g4kzvf43tXMW/6EIBf2Ud/+YcRvAgD3E653F4ptOkve6fbOBbvEARcZ7lc3ydefyW//AHPsWZ1N1XfRlwM3Bfg6sngEWA5dZ2lHsjOtPb+wHWzN7C9C8DO3fD3Bdg4Ttw3blwZO8GV09zwb3ALUyZftyR3pbfn83L/IY/ZDNPm7vnGYbyKa6BWGI40y5/JesHmDTzMPIqLwGOwnPjgd9QVlLmzze5bAKxxEA8Z9+Y/ZpcR1nJarK5J+sN6kYJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSKApAjUD9MllZ+K8J/DcNLZ3/W/mXlBOaWmMDX2/h+duIBHry8zJ7zZmQQ+vF3B9UHXemFv5DE9QwvF+oD2L15nAMfyOt/3wvEcOqtBLeI632MEznM1G9tKP+3iCM9MG6JuAHwdV55k/hIXoM4PDzhsRoEcXOAGYAHxmG9w2tykBejjrHeNLrrvyZFa1ugB9PV1ZS1fGszJz4gyutGr7uYyluPD8IqZ+7UAGt6S/ZHLZTJx3P2Ulz/qBufPuJq+yH55rT2XeLGYUn+Z3aljfbwUwl7KSb5DNPVlvUDdKQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAJNETgYoF9+Zzeq4quAFfTfMJrSUkt/D47JZc/iuYnMnGzhYEbDw7sK+CnQOaMbUi7qzN0NVoRnM294z38zD6tyf5qz2EE5XZmTNkC/Hfi+FYJntZidkN7ICvR06/TfBX1+B788F07LqgK9eta8kmv4CBt4thVVoO8jnzP4b67mWc5nYVbSDd3kymhaC/eSaU+SiC1hRvF3KJ4+FHgN532RRGwjzvs35QXdmHPpdoqn3w+Mo6zkWLK5p6EH0ecSkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkECzCBwMFIunX+6fle25S5lRPKfWapfNOI5YYj0wFRjmH/+diC3Eeb8hlojjuespK3ma4um39NhUOOL5x88teKRy5cfWsofx9OYuXuUIOvFTTuQJVnMfb/lnmc/k1Fpnmr/Bdn7CYu7jTT7NQAbRgV9wEovYwu94iy9zNKczkASeP6+1Y99DJcfSlR8yhnbEeYxVzOYNJnIsv+YVzmAgP2AMv+Zl/swaulHA62ynH+15MhKg38h4/sMO/sVGPs3R/IfR/IUYYDXo9u7APvDPDv8Y0A74D/AOcDzwFrANOBGqW8yHAfoQ8IPh7UBfwDrap+a5Nu/rwA7ACqUtKG8PWFZrnfN/B+3PhQsLoO+L0KcSThqS/OfNjfDnRfCpkbBtF7z4Fpx0DCx8GzZuh48Ng9NtTTt9/hpgC0f564xlLOuYzT104ABv+d/Vx/xK8G104G7mMMDfc3JUEqOEi1nCIE7jDW7hQd6hJ5O5hE/xOt/lz2yiE9/jPJYxgE/yOpfzDwbzHj/lLJ7jaH++…brB0xZVAGAtqpyy+87fNf4HUyf1sNzSz83GXvYnYKXM6qTDBVhJ29tL7uzrJF+rcOC5Dy8Hq5efB1QGSkNdigBLnWXzB/zn10h7RWRj1hcaCpHOK7cB1fwKc4cvBQCWL6UDjnPuTG//1SRguT7Vqy8CqoAWMXRFBQBWRaE0X3bu9kH/avgtoVv6ndkDVJq9tRY7wErc8bOvknxFBt+/csByS787LgGqxK1PMj2AlaStg6TOvmLQv3JLv9f+FVAlbnnS6QGspO0VOXerbBaF/PoNfwNUiVttIj2AlbjNZ2+W9l2XgVXiNptJD2CZsZpEUUC/AgBLv4dkgAJmFABYZqwmURTQrwDA0u8hGaCAGQUAlhmrSRQF9CsAsPR7SAYoYEYBgGXGahJFAf0K/B9qEBa1B23aowAAAABJRU5ErkJggg==","extensions:ANGLE_instanced_arrays;EXT_blend_minmax;EXT_color_buffer_half_float;EXT_disjoint_timer_query;EXT_float_blend;EXT_frag_depth;EXT_shader_texture_lod;EXT_texture_compression_rgtc;EXT_texture_filter_anisotropic;EXT_sRGB;KHR_parallel_shader_compile;OES_element_index_uint;OES_fbo_render_mipmap;OES_standard_derivatives;OES_texture_float;OES_texture_float_linear;OES_texture_half_float;OES_texture_half_float_linear;OES_vertex_array_object;WEBGL_color_buffer_float;WEBGL_compressed_texture_s3tc;WEBGL_compressed_texture_s3tc_srgb;WEBGL_debug_renderer_info;WEBGL_debug_shaders;WEBGL_depth_texture;WEBGL_draw_buffers;WEBGL_lose_context;WEBGL_multi_draw","webgl aliased line width range:[1, 1]","webgl aliased point size range:[1, 8191]","webgl alpha bits:8","webgl antialiasing:yes","webgl blue bits:8","webgl depth bits:24","webgl green bits:8","webgl max anisotropy:16","webgl max combined texture image units:32","webgl max cube map texture size:16384","webgl max fragment uniform vectors:1024","webgl max render buffer size:16384","webgl max texture image units:16","webgl max texture size:16384","webgl max varying vectors:32","webgl max vertex attribs:16","webgl max vertex texture image units:16","webgl max vertex uniform vectors:1024","webgl max viewport dims:[16384, 16384]","webgl red bits:8","webgl renderer:WebKit WebGL","webgl shading language version:WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium)","webgl stencil bits:0","webgl vendor:WebKit","webgl version:WebGL 1.0 (OpenGL ES 2.0 Chromium)","webgl unmasked vendor:Google Inc. (ATI Technologies Inc.)","webgl unmasked renderer:ANGLE (ATI Technologies Inc., AMD Radeon Pro 560X OpenGL Engine, OpenGL 4.1)","webgl vertex shader high float precision:23","webgl vertex shader high float precision rangeMin:127","webgl vertex shader high float precision rangeMax:127","webgl vertex shader medium float precision:23","webgl vertex shader medium float precision rangeMin:127","webgl vertex shader medium float precision rangeMax:127","webgl vertex shader low float precision:23","webgl vertex shader low float precision rangeMin:127","webgl vertex shader low float precision rangeMax:127","webgl fragment shader high float precision:23","webgl fragment shader high float precision rangeMin:127","webgl fragment shader high float precision rangeMax:127","webgl fragment shader medium float precision:23","webgl fragment shader medium float precision rangeMin:127","webgl fragment shader medium float precision rangeMax:127","webgl fragment shader low float precision:23","webgl fragment shader low float precision rangeMin:127","webgl fragment shader low float precision rangeMax:127","webgl vertex shader high int precision:0","webgl vertex shader high int precision rangeMin:31","webgl vertex shader high int precision rangeMax:30","webgl vertex shader medium int precision:0","webgl vertex shader medium int precision rangeMin:31","webgl vertex shader medium int precision rangeMax:30","webgl vertex shader low int precision:0","webgl vertex shader low int precision rangeMin:31","webgl vertex shader low int precision rangeMax:30","webgl fragment shader high int precision:0","webgl fragment shader high int precision rangeMin:31","webgl fragment shader high int precision rangeMax:30","webgl fragment shader medium int precision:0","webgl fragment shader medium int precision rangeMin:31","webgl fragment shader medium int precision rangeMax:30","webgl fragment shader low int precision:0","webgl fragment shader low int precision rangeMin:31","webgl fragment shader low int precision rangeMax:30"],webgl_vendor_and_renderer:"Google Inc. (ATI Technologies Inc.)~ANGLE (ATI Technologies Inc., AMD Radeon Pro 560X OpenGL Engine, OpenGL 4.1)",ad_block:!1,has_lied_languages:!1,has_lied_resolution:!1,has_lied_os:!1,has_lied_browser:!1,touch_support:[0,!1,!1],fonts:["Andale Mono","Arial","Arial Black","Arial Hebrew","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","Comic Sans MS","Courier","Courier New","Geneva","Georgia","Helvetica","Helvetica Neue","Impact","LUCIDA GRANDE","Microsoft Sans Serif","Monaco","Palatino","Tahoma","Times","Times New Roman","Trebuchet MS","Verdana","Wingdings","Wingdings 2","Wingdings 3"],fonts_flash:"swf object not loaded",audio:"124.04347657808103",enumerate_devices:["id=;gid=;audioinput;","id=;gid=;videoinput;","id=;gid=;audiooutput;"]}},policy_request_id:"LoginWithMenu",params:{}}},km=[{"control_flow.0":["assertion_id","type"]}];class Nm extends Error{constructor(e,t){Em.error(`[ERROR] ${e}`),super(e),this.description=e,this.errorCode=t}static convertFromAssertionError(e){switch(e){case 28:return vm.ClientResponseNotValid;case 29:case 31:case 35:return vm.InvalidCredentials;case 30:return vm.ExpiredOTPPasscode;case 32:return vm.ExpiredValidationPasscode;case 33:return vm.MaxResendReached;default:return vm.ServerError}}}var Pm,Bm,Fm;!function(e){e.JsonRejection="Json Rejection",e.TextRejection="Text Rejection",e.UpdateAction="Update Action",e.NextAction="Next Action",e.JourneyEnd="Journey End"}(Pm||(Pm={})),function(e){e.Pending="pending",e.Completed="completed",e.Rejected="rejected"}(Bm||(Bm={})),function(e){e.Form="form",e.LoginForm="login_form",e.Rejection="rejection",e.Information="information",e.DebugBreak="debug_break",e.WaitForTicket="wait_for_ticket",e.DrsTriggerAction="transmit_acp",e.IdentityVerification="kyc",e.WebAuthnRegistration="transmit_platform_web_authn_registration"}(Fm||(Fm={}));var Lm={},zm="6.6.1",Um={},jm={},Vm={get exports(){return jm},set exports(e){jm=e}},Hm=J(Ia);!function(e){!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:Hm.Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function s(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function u(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a<o;a++){var s=e.charCodeAt(a)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,n):(this._parseBase(e,t,i),"le"===n&&this._initArray(this.toArray(),t,n)))},i.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},i.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===n)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,a=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=s(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=s(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,c=0,l=r;l<s;l+=n)c=u(e,l,l+n,t),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==a){var d=1;for(c=u(e,l,e.length,t),l=0;l<a;l++)d*=t;this.imuln(d),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this.strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c<n;c++){for(var l=u>>>26,d=67108863&u,h=Math.min(c,t.length-1),f=Math.max(0,c-e.length+1);f<=h;f++){var p=c-f|0;l+=(a=(i=0|e.words[p])*(o=0|t.words[f])+d)/67108864|0,d=67108863&a}r.words[c]=0|d,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);o=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),n=0!==o||a!==this.length-1?c[6-u.length]+u+n:u+n}for(0!==o&&(n=o.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var h=l[e],f=d[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(f).toString(e);n=(p=p.idivn(f)).isZero()?g+n:c[h-g.length]+g+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,c=new e(o),l=this.clone();if(u){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),c[s]=a;for(;s<o;s++)c[s]=0}else{for(s=0;s<o-i;s++)c[s]=0;for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),c[o-s-1]=a}return c},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},i.prototype.ior=function(e){return r(0===(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},i.prototype.iand=function(e){return r(0===(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},i.prototype.ixor=function(e){return r(0===(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return n>0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<<i:this.words[n]&~(1<<i),this.strip()},i.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a<n.length;a++)o=(t=(0|r.words[a])-(0|n.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<r.length;a++)o=(t=(0|r.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var f=function(e,t,r){var n,i,o,a=e.words,s=t.words,u=r.words,c=0,l=0|a[0],d=8191&l,h=l>>>13,f=0|a[1],p=8191&f,g=f>>>13,m=0|a[2],y=8191&m,v=m>>>13,b=0|a[3],w=8191&b,_=b>>>13,A=0|a[4],E=8191&A,C=A>>>13,x=0|a[5],S=8191&x,I=x>>>13,T=0|a[6],M=8191&T,D=T>>>13,R=0|a[7],O=8191&R,k=R>>>13,N=0|a[8],P=8191&N,B=N>>>13,F=0|a[9],L=8191&F,z=F>>>13,U=0|s[0],j=8191&U,V=U>>>13,H=0|s[1],G=8191&H,q=H>>>13,W=0|s[2],K=8191&W,X=W>>>13,Y=0|s[3],Z=8191&Y,J=Y>>>13,$=0|s[4],Q=8191&$,ee=$>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],de=8191&le,he=le>>>13,fe=0|s[9],pe=8191&fe,ge=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(c+(n=Math.imul(d,j))|0)+((8191&(i=(i=Math.imul(d,V))+Math.imul(h,j)|0))<<13)|0;c=((o=Math.imul(h,V))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,j),i=(i=Math.imul(p,V))+Math.imul(g,j)|0,o=Math.imul(g,V);var ye=(c+(n=n+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,q)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,q)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,j),i=(i=Math.imul(y,V))+Math.imul(v,j)|0,o=Math.imul(v,V),n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(g,G)|0,o=o+Math.imul(g,q)|0;var ve=(c+(n=n+Math.imul(d,K)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(h,K)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(w,j),i=(i=Math.imul(w,V))+Math.imul(_,j)|0,o=Math.imul(_,V),n=n+Math.imul(y,G)|0,i=(i=i+Math.imul(y,q)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,q)|0,n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(g,K)|0,o=o+Math.imul(g,X)|0;var be=(c+(n=n+Math.imul(d,Z)|0)|0)+((8191&(i=(i=i+Math.imul(d,J)|0)+Math.imul(h,Z)|0))<<13)|0;c=((o=o+Math.imul(h,J)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(E,j),i=(i=Math.imul(E,V))+Math.imul(C,j)|0,o=Math.imul(C,V),n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,q)|0,n=n+Math.imul(y,K)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,X)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,J)|0;var we=(c+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(S,j),i=(i=Math.imul(S,V))+Math.imul(I,j)|0,o=Math.imul(I,V),n=n+Math.imul(E,G)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,q)|0,n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,J)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,ee)|0;var _e=(c+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(h,re)|0))<<13)|0;c=((o=o+Math.imul(h,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(M,j),i=(i=Math.imul(M,V))+Math.imul(D,j)|0,o=Math.imul(D,V),n=n+Math.imul(S,G)|0,i=(i=i+Math.imul(S,q)|0)+Math.imul(I,G)|0,o=o+Math.imul(I,q)|0,n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(C,K)|0,o=o+Math.imul(C,X)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ne)|0;var Ae=(c+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(O,j),i=(i=Math.imul(O,V))+Math.imul(k,j)|0,o=Math.imul(k,V),n=n+Math.imul(M,G)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(D,G)|0,o=o+Math.imul(D,q)|0,n=n+Math.imul(S,K)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,J)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,ae)|0;var Ee=(c+(n=n+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(P,j),i=(i=Math.imul(P,V))+Math.imul(B,j)|0,o=Math.imul(B,V),n=n+Math.imul(O,G)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,q)|0,n=n+Math.imul(M,K)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(D,K)|0,o=o+Math.imul(D,X)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,J)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(g,ue)|0,o=o+Math.imul(g,ce)|0;var Ce=(c+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(L,j),i=(i=Math.imul(L,V))+Math.imul(z,j)|0,o=Math.imul(z,V),n=n+Math.imul(P,G)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,q)|0,n=n+Math.imul(O,K)|0,i=(i=i+Math.imul(O,X)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(D,Z)|0,o=o+Math.imul(D,J)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(C,re)|0,o=o+Math.imul(C,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(g,de)|0,o=o+Math.imul(g,he)|0;var xe=(c+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ge)|0)+Math.imul(h,pe)|0))<<13)|0;c=((o=o+Math.imul(h,ge)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(L,G),i=(i=Math.imul(L,q))+Math.imul(z,G)|0,o=Math.imul(z,q),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,X)|0,n=n+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(C,oe)|0,o=o+Math.imul(C,ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,n=n+Math.imul(y,de)|0,i=(i=i+Math.imul(y,he)|0)+Math.imul(v,de)|0,o=o+Math.imul(v,he)|0;var Se=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ge)|0)+Math.imul(g,pe)|0))<<13)|0;c=((o=o+Math.imul(g,ge)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(L,K),i=(i=Math.imul(L,X))+Math.imul(z,K)|0,o=Math.imul(z,X),n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(B,Z)|0,o=o+Math.imul(B,J)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(M,re)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,ae)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(C,ue)|0,o=o+Math.imul(C,ce)|0,n=n+Math.imul(w,de)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(_,de)|0,o=o+Math.imul(_,he)|0;var Ie=(c+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,ge)|0)+Math.imul(v,pe)|0))<<13)|0;c=((o=o+Math.imul(v,ge)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(L,Z),i=(i=Math.imul(L,J))+Math.imul(z,Z)|0,o=Math.imul(z,J),n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(I,ue)|0,o=o+Math.imul(I,ce)|0,n=n+Math.imul(E,de)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(C,de)|0,o=o+Math.imul(C,he)|0;var Te=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ge)|0)+Math.imul(_,pe)|0))<<13)|0;c=((o=o+Math.imul(_,ge)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(L,Q),i=(i=Math.imul(L,ee))+Math.imul(z,Q)|0,o=Math.imul(z,ee),n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,n=n+Math.imul(S,de)|0,i=(i=i+Math.imul(S,he)|0)+Math.imul(I,de)|0,o=o+Math.imul(I,he)|0;var Me=(c+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,ge)|0)+Math.imul(C,pe)|0))<<13)|0;c=((o=o+Math.imul(C,ge)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(L,re),i=(i=Math.imul(L,ne))+Math.imul(z,re)|0,o=Math.imul(z,ne),n=n+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,ae)|0,n=n+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,n=n+Math.imul(M,de)|0,i=(i=i+Math.imul(M,he)|0)+Math.imul(D,de)|0,o=o+Math.imul(D,he)|0;var De=(c+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,ge)|0)+Math.imul(I,pe)|0))<<13)|0;c=((o=o+Math.imul(I,ge)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,n=Math.imul(L,oe),i=(i=Math.imul(L,ae))+Math.imul(z,oe)|0,o=Math.imul(z,ae),n=n+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,ce)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,ce)|0,n=n+Math.imul(O,de)|0,i=(i=i+Math.imul(O,he)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,he)|0;var Re=(c+(n=n+Math.imul(M,pe)|0)|0)+((8191&(i=(i=i+Math.imul(M,ge)|0)+Math.imul(D,pe)|0))<<13)|0;c=((o=o+Math.imul(D,ge)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(L,ue),i=(i=Math.imul(L,ce))+Math.imul(z,ue)|0,o=Math.imul(z,ce),n=n+Math.imul(P,de)|0,i=(i=i+Math.imul(P,he)|0)+Math.imul(B,de)|0,o=o+Math.imul(B,he)|0;var Oe=(c+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,ge)|0)+Math.imul(k,pe)|0))<<13)|0;c=((o=o+Math.imul(k,ge)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(L,de),i=(i=Math.imul(L,he))+Math.imul(z,de)|0,o=Math.imul(z,he);var ke=(c+(n=n+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,ge)|0)+Math.imul(B,pe)|0))<<13)|0;c=((o=o+Math.imul(B,ge)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863;var Ne=(c+(n=Math.imul(L,pe))|0)+((8191&(i=(i=Math.imul(L,ge))+Math.imul(z,pe)|0))<<13)|0;return c=((o=Math.imul(z,ge))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=me,u[1]=ye,u[2]=ve,u[3]=be,u[4]=we,u[5]=_e,u[6]=Ae,u[7]=Ee,u[8]=Ce,u[9]=xe,u[10]=Se,u[11]=Ie,u[12]=Te,u[13]=Me,u[14]=De,u[15]=Re,u[16]=Oe,u[17]=ke,u[18]=Ne,0!==c&&(u[19]=c,r.length++),r};function p(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(f=h),i.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?f(this,e,t):n<63?h(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var a=i;i=0;for(var s=67108863&n,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var l=o-c,d=(0|e.words[l])*(0|t.words[c]),h=67108863&d;s=67108863&(h=h+s|0),i+=(a=(a=a+(d/67108864|0)|0)+(h>>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):p(this,e,t),r},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},g.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},g.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a<o;a++)n[a]=t[e[a]],i[a]=r[e[a]]},g.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,u=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),l=0;l<i;l+=s)for(var d=u,h=c,f=0;f<a;f++){var p=r[l+f],g=n[l+f],m=r[l+f+a],y=n[l+f+a],v=d*m-h*y;y=d*y+h*m,m=v,r[l+f]=p+m,n[l+f]=g+y,r[l+f+a]=p-m,n[l+f+a]=g-y,f!==s&&(v=u*d-c*h,h=u*h+c*d,d=v)}},g.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},g.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},g.prototype.convert13b=function(e,t,n,i){for(var o=0,a=0;a<t;a++)o+=0|e[a],n[2*a]=8191&o,o>>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<i;++a)n[a]=0;r(0===o),r(!(-8192&o))},g.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},g.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),a=new Array(n),s=new Array(n),u=new Array(n),c=new Array(n),l=new Array(n),d=new Array(n),h=r.words;h.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(t.words,t.length,c,n),this.transform(a,o,s,u,n,i),this.transform(c,o,l,d,n,i);for(var f=0;f<n;f++){var p=s[f]*l[f]-u[f]*d[f];u[f]=s[f]*d[f]+u[f]*l[f],s[f]=p}return this.conjugate(s,u,n),this.transform(s,u,h,o,n,i),this.conjugate(h,o,n),this.normalize13b(h,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),p(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,n=0;n<this.length;n++){var i=(0|this.words[n])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this.length=0===e?1:this.length,this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var o=r.sqr();n<t.length;n++,o=o.sqr())0!==t[n]&&(r=r.mul(o));return r},i.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,u=(0|this.words[t])-s<<n;this.words[t]=u|a,a=s>>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},i.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,n){var i;r("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,u=n;if(i-=a,i=Math.max(0,i),u){for(var c=0;c<a;c++)u.words[c]=this.words[c];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-o|d>>>o,l=d&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<<t;return!(this.length<=n)&&!!(this.words[n]&i)},i.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,n){var i,o,a=e.length+n;this._expand(a);var s=0;for(i=0;i<e.length;i++){o=(0|this.words[i+n])+s;var u=(0|e.words[i])*t;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+n]=67108863&o}for(;i<this.length-n;i++)s=(o=(0|this.words[i+n])+s)>>26,this.words[i+n]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!==(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var s,u=n.length-o.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var l=n.clone()._ishlnsubmul(o,1,u);0===l.negative&&(n=l,s&&(s.words[u]=1));for(var d=u-1;d>=0;d--){var h=67108864*(0|n.words[o.length+d])+(0|n.words[o.length+d-1]);for(h=Math.min(h/a|0,67108863),n._ishlnsubmul(o,h,d);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(o,1,d),n.isZero()||(n.negative^=1);s&&(s.words[d]=h)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),d=t.clone();!t.isZero();){for(var h=0,f=1;0===(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(l),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var p=0,g=1;0===(n.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(u)):(n.isub(t),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:n.iushln(c)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0===(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var d=0,h=1;0===(n.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return!(1&this.words[0])},i.prototype.isOdd=function(){return!(1&~this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=i,this;for(var o=i,a=n;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new A(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},n(v,y),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var a=0|e.words[i];e.words[i-10]=(a&r)<<4|o>>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(b,y),n(w,y),n(_,y),_.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new b;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return m[e]=t,t},A.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},A.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,o),h=this.pow(e,o.addn(1).iushrn(1)),f=this.pow(e,o),p=a;0!==f.cmp(s);){for(var g=f,m=0;0!==g.cmp(s);m++)g=g.redSqr();r(m<p);var y=this.pow(d,new i(1).iushln(p-m-1));h=h.redMul(y),d=y.redSqr(),f=f.redMul(d),p=m}return h},A.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},A.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var o=r[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var d=c>>l&1;o!==r[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4===++s||0===n&&0===l)&&(o=this.mul(o,r[a]),s=0,a=0)):s=0}u=26}return o},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new E(e)},n(E,A),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,Y)}(Vm);var Gm=qm;function qm(e,t){if(!e)throw new Error(t||"Assertion failed")}qm.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var Wm={};!function(e){var t=e;function r(e){return 1===e.length?"0"+e:e}function n(e){for(var t="",n=0;n<e.length;n++)t+=r(e[n].toString(16));return t}t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,a=255&i;o?r.push(o,a):r.push(a)}return r},t.zero2=r,t.toHex=n,t.encode=function(e,t){return"hex"===t?n(e):e}}(Wm),function(e){var t=e,r=jm,n=Gm,i=Wm;t.assert=n,t.toArray=i.toArray,t.zero2=i.zero2,t.toHex=i.toHex,t.encode=i.encode,t.getNAF=function(e,t,r){var n,i=new Array(Math.max(e.bitLength(),r)+1);for(n=0;n<i.length;n+=1)i[n]=0;var o=1<<t+1,a=e.clone();for(n=0;n<i.length;n++){var s,u=a.andln(o-1);a.isOdd()?(s=u>(o>>1)-1?(o>>1)-u:u,a.isubn(s)):s=0,i[n]=s,a.iushrn(1)}return i},t.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,u=e.andln(3)+i&3,c=t.andln(3)+o&3;3===u&&(u=-1),3===c&&(c=-1),a=1&u?3!==(n=e.andln(7)+i&7)&&5!==n||2!==c?u:-u:0,r[0].push(a),s=1&c?3!==(n=t.andln(7)+o&7)&&5!==n||2!==u?c:-c:0,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},t.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},t.parseBytes=function(e){return"string"==typeof e?t.toArray(e,"hex"):e},t.intFromLE=function(e){return new r(e,"hex","le")}}(Um);var Km,Xm={},Ym={get exports(){return Xm},set exports(e){Xm=e}},Zm=J(Object.freeze({__proto__:null,default:{}}));function Jm(e){this.rand=e}if(Ym.exports=function(e){return Km||(Km=new Jm(null)),Km.generate(e)},Xm.Rand=Jm,Jm.prototype.generate=function(e){return this._rand(e)},Jm.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?Jm.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?Jm.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(Jm.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var $m=Zm;if("function"!=typeof $m.randomBytes)throw new Error("Not supported");Jm.prototype._rand=function(e){return $m.randomBytes(e)}}catch(e){}var Qm={},ey=jm,ty=Um,ry=ty.getNAF,ny=ty.getJSF,iy=ty.assert;function oy(e,t){this.type=e,this.p=new ey(t.p,16),this.red=t.prime?ey.red(t.prime):ey.mont(this.p),this.zero=new ey(0).toRed(this.red),this.one=new ey(1).toRed(this.red),this.two=new ey(2).toRed(this.red),this.n=t.n&&new ey(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var ay=oy;function sy(e,t){this.curve=e,this.type=t,this.precomputed=null}oy.prototype.point=function(){throw new Error("Not implemented")},oy.prototype.validate=function(){throw new Error("Not implemented")},oy.prototype._fixedNafMul=function(e,t){iy(e.precomputed);var r=e._getDoubles(),n=ry(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var o,a,s=[];for(o=0;o<n.length;o+=r.step){a=0;for(var u=o+r.step-1;u>=o;u--)a=(a<<1)+n[u];s.push(a)}for(var c=this.jpoint(null,null,null),l=this.jpoint(null,null,null),d=i;d>0;d--){for(o=0;o<s.length;o++)(a=s[o])===d?l=l.mixedAdd(r.points[o]):a===-d&&(l=l.mixedAdd(r.points[o].neg()));c=c.add(l)}return c.toP()},oy.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,o=ry(t,r,this._bitLength),a=this.jpoint(null,null,null),s=o.length-1;s>=0;s--){for(var u=0;s>=0&&0===o[s];s--)u++;if(s>=0&&u++,a=a.dblp(u),s<0)break;var c=o[s];iy(0!==c),a="affine"===e.type?c>0?a.mixedAdd(i[c-1>>1]):a.mixedAdd(i[-c-1>>1].neg()):c>0?a.add(i[c-1>>1]):a.add(i[-c-1>>1].neg())}return"affine"===e.type?a.toP():a},oy.prototype._wnafMulAdd=function(e,t,r,n,i){var o,a,s,u=this._wnafT1,c=this._wnafT2,l=this._wnafT3,d=0;for(o=0;o<n;o++){var h=(s=t[o])._getNAFPoints(e);u[o]=h.wnd,c[o]=h.points}for(o=n-1;o>=1;o-=2){var f=o-1,p=o;if(1===u[f]&&1===u[p]){var g=[t[f],null,null,t[p]];0===t[f].y.cmp(t[p].y)?(g[1]=t[f].add(t[p]),g[2]=t[f].toJ().mixedAdd(t[p].neg())):0===t[f].y.cmp(t[p].y.redNeg())?(g[1]=t[f].toJ().mixedAdd(t[p]),g[2]=t[f].add(t[p].neg())):(g[1]=t[f].toJ().mixedAdd(t[p]),g[2]=t[f].toJ().mixedAdd(t[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],y=ny(r[f],r[p]);for(d=Math.max(y[0].length,d),l[f]=new Array(d),l[p]=new Array(d),a=0;a<d;a++){var v=0|y[0][a],b=0|y[1][a];l[f][a]=m[3*(v+1)+(b+1)],l[p][a]=0,c[f]=g}}else l[f]=ry(r[f],u[f],this._bitLength),l[p]=ry(r[p],u[p],this._bitLength),d=Math.max(l[f].length,d),d=Math.max(l[p].length,d)}var w=this.jpoint(null,null,null),_=this._wnafT4;for(o=d;o>=0;o--){for(var A=0;o>=0;){var E=!0;for(a=0;a<n;a++)_[a]=0|l[a][o],0!==_[a]&&(E=!1);if(!E)break;A++,o--}if(o>=0&&A++,w=w.dblp(A),o<0)break;for(a=0;a<n;a++){var C=_[a];0!==C&&(C>0?s=c[a][C-1>>1]:C<0&&(s=c[a][-C-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(o=0;o<n;o++)c[o]=null;return i?w:w.toP()},oy.BasePoint=sy,sy.prototype.eq=function(){throw new Error("Not implemented")},sy.prototype.validate=function(){return this.curve.validate(this)},oy.prototype.decodePoint=function(e,t){e=ty.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?iy(e[e.length-1]%2==0):7===e[0]&&iy(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},sy.prototype.encodeCompressed=function(e){return this.encode(e,!0)},sy.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},sy.prototype.encode=function(e,t){return ty.encode(this._encode(t),e)},sy.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},sy.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},sy.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},sy.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},sy.prototype._getBeta=function(){return null},sy.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var uy={},cy={get exports(){return uy},set exports(e){uy=e}};function ly(){throw new Error("setTimeout has not been defined")}function dy(){throw new Error("clearTimeout has not been defined")}var hy=ly,fy=dy;function py(e){if(hy===setTimeout)return setTimeout(e,0);if((hy===ly||!hy)&&setTimeout)return hy=setTimeout,setTimeout(e,0);try{return hy(e,0)}catch(t){try{return hy.call(null,e,0)}catch(t){return hy.call(this,e,0)}}}"function"==typeof So.setTimeout&&(hy=setTimeout),"function"==typeof So.clearTimeout&&(fy=clearTimeout);var gy,my=[],yy=!1,vy=-1;function by(){yy&&gy&&(yy=!1,gy.length?my=gy.concat(my):vy=-1,my.length&&wy())}function wy(){if(!yy){var e=py(by);yy=!0;for(var t=my.length;t;){for(gy=my,my=[];++vy<t;)gy&&gy[vy].run();vy=-1,t=my.length}gy=null,yy=!1,function(e){if(fy===clearTimeout)return clearTimeout(e);if((fy===dy||!fy)&&clearTimeout)return fy=clearTimeout,clearTimeout(e);try{return fy(e)}catch(t){try{return fy.call(null,e)}catch(t){return fy.call(this,e)}}}(e)}}function _y(e,t){this.fun=e,this.array=t}_y.prototype.run=function(){this.fun.apply(null,this.array)};function Ay(){}var Ey=Ay,Cy=Ay,xy=Ay,Sy=Ay,Iy=Ay,Ty=Ay,My=Ay;var Dy=So.performance||{},Ry=Dy.now||Dy.mozNow||Dy.msNow||Dy.oNow||Dy.webkitNow||function(){return(new Date).getTime()};var Oy=new Date;var ky={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];my.push(new _y(e,t)),1!==my.length||yy||py(wy)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:Ey,addListener:Cy,once:xy,off:Sy,removeListener:Iy,removeAllListeners:Ty,emit:My,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*Ry.call(Dy),r=Math.floor(t),n=Math.floor(t%1*1e9);return e&&(r-=e[0],(n-=e[1])<0&&(r--,n+=1e9)),[r,n]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-Oy)/1e3}},Ny=ky,Py="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e},By=/%[sdj%]/g;function Fy(e){if(!Qy(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(Vy(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,i=n.length,o=String(e).replace(By,function(e){if("%%"===e)return"%";if(r>=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),a=n[r];r<i;a=n[++r])Zy(a)||!nv(a)?o+=" "+a:o+=" "+Vy(a);return o}function Ly(e,t){if(tv(So.process))return function(){return Ly(e,t).apply(this,arguments)};if(!0===Ny.noDeprecation)return e;var r=!1;return function(){if(!r){if(Ny.throwDeprecation)throw new Error(t);Ny.traceDeprecation?console.trace(t):console.error(t),r=!0}return e.apply(this,arguments)}}var zy,Uy={};function jy(e){if(tv(zy)&&(zy=Ny.env.NODE_DEBUG||""),e=e.toUpperCase(),!Uy[e])if(new RegExp("\\b"+e+"\\b","i").test(zy)){Uy[e]=function(){var t=Fy.apply(null,arguments);console.error("%s %d: %s",e,0,t)}}else Uy[e]=function(){};return Uy[e]}function Vy(e,t){var r={seen:[],stylize:Gy};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),Yy(t)?r.showHidden=t:t&&fv(r,t),tv(r.showHidden)&&(r.showHidden=!1),tv(r.depth)&&(r.depth=2),tv(r.colors)&&(r.colors=!1),tv(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=Hy),qy(r,e,r.depth)}function Hy(e,t){var r=Vy.styles[t];return r?"["+Vy.colors[r][0]+"m"+e+"["+Vy.colors[r][1]+"m":e}function Gy(e,t){return e}function qy(e,t,r){if(e.customInspect&&t&&av(t.inspect)&&t.inspect!==Vy&&(!t.constructor||t.constructor.prototype!==t)){var n=t.inspect(r,e);return Qy(n)||(n=qy(e,n,r)),n}var i=function(e,t){if(tv(t))return e.stylize("undefined","undefined");if(Qy(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if($y(t))return e.stylize(""+t,"number");if(Yy(t))return e.stylize(""+t,"boolean");if(Zy(t))return e.stylize("null","null")}(e,t);if(i)return i;var o=Object.keys(t),a=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),ov(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return Wy(t);if(0===o.length){if(av(t)){var s=t.name?": "+t.name:"";return e.stylize("[Function"+s+"]","special")}if(rv(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(iv(t))return e.stylize(Date.prototype.toString.call(t),"date");if(ov(t))return Wy(t)}var u,c="",l=!1,d=["{","}"];(Xy(t)&&(l=!0,d=["[","]"]),av(t))&&(c=" [Function"+(t.name?": "+t.name:"")+"]");return rv(t)&&(c=" "+RegExp.prototype.toString.call(t)),iv(t)&&(c=" "+Date.prototype.toUTCString.call(t)),ov(t)&&(c=" "+Wy(t)),0!==o.length||l&&0!=t.length?r<0?rv(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),u=l?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a<s;++a)pv(t,String(a))?o.push(Ky(e,t,r,n,String(a),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(Ky(e,t,r,n,i,!0))}),o}(e,t,r,a,o):o.map(function(n){return Ky(e,t,r,a,n,l)}),e.seen.pop(),function(e,t,r){var n=e.reduce(function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(n>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(u,c,d)):d[0]+c+d[1]}function Wy(e){return"["+Error.prototype.toString.call(e)+"]"}function Ky(e,t,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),pv(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=Zy(r)?qy(e,u.value,null):qy(e,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),tv(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function Xy(e){return Array.isArray(e)}function Yy(e){return"boolean"==typeof e}function Zy(e){return null===e}function Jy(e){return null==e}function $y(e){return"number"==typeof e}function Qy(e){return"string"==typeof e}function ev(e){return"symbol"==typeof e}function tv(e){return void 0===e}function rv(e){return nv(e)&&"[object RegExp]"===cv(e)}function nv(e){return"object"==typeof e&&null!==e}function iv(e){return nv(e)&&"[object Date]"===cv(e)}function ov(e){return nv(e)&&("[object Error]"===cv(e)||e instanceof Error)}function av(e){return"function"==typeof e}function sv(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function uv(e){return Vo.isBuffer(e)}function cv(e){return Object.prototype.toString.call(e)}function lv(e){return e<10?"0"+e.toString(10):e.toString(10)}Vy.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},Vy.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};var dv=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function hv(){console.log("%s - %s",function(){var e=new Date,t=[lv(e.getHours()),lv(e.getMinutes()),lv(e.getSeconds())].join(":");return[e.getDate(),dv[e.getMonth()],t].join(" ")}(),Fy.apply(null,arguments))}function fv(e,t){if(!t||!nv(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}function pv(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var gv,mv={inherits:Py,_extend:fv,log:hv,isBuffer:uv,isPrimitive:sv,isFunction:av,isError:ov,isDate:iv,isObject:nv,isRegExp:rv,isUndefined:tv,isSymbol:ev,isString:Qy,isNumber:$y,isNullOrUndefined:Jy,isNull:Zy,isBoolean:Yy,isArray:Xy,inspect:Vy,deprecate:Ly,format:Fy,debuglog:jy},yv=J(Object.freeze({__proto__:null,_extend:fv,debuglog:jy,default:mv,deprecate:Ly,format:Fy,inherits:Py,inspect:Vy,isArray:Xy,isBoolean:Yy,isBuffer:uv,isDate:iv,isError:ov,isFunction:av,isNull:Zy,isNullOrUndefined:Jy,isNumber:$y,isObject:nv,isPrimitive:sv,isRegExp:rv,isString:Qy,isSymbol:ev,isUndefined:tv,log:hv})),vv={},bv={get exports(){return vv},set exports(e){vv=e}};!function(e){try{var t=yv;if("function"!=typeof t.inherits)throw"";e.exports=t.inherits}catch(t){e.exports=(gv||(gv=1,"function"==typeof Object.create?bv.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:bv.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}),vv)}}(cy);var wv=jm,_v=uy,Av=ay,Ev=Um.assert;function Cv(e){Av.call(this,"short",e),this.a=new wv(e.a,16).toRed(this.red),this.b=new wv(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}_v(Cv,Av);var xv=Cv;function Sv(e,t,r,n){Av.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new wv(t,16),this.y=new wv(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function Iv(e,t,r,n){Av.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new wv(0)):(this.x=new wv(t,16),this.y=new wv(r,16),this.z=new wv(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}Cv.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new wv(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new wv(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))?r=i[0]:(r=i[1],Ev(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new wv(e.a,16),b:new wv(e.b,16)}}):this._getEndoBasis(r)}}},Cv.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:wv.mont(e),r=new wv(2).toRed(t).redInvm(),n=r.redNeg(),i=new wv(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},Cv.prototype._getEndoBasis=function(e){for(var t,r,n,i,o,a,s,u,c,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,h=this.n.clone(),f=new wv(1),p=new wv(0),g=new wv(0),m=new wv(1),y=0;0!==d.cmpn(0);){var v=h.div(d);u=h.sub(v.mul(d)),c=g.sub(v.mul(f));var b=m.sub(v.mul(p));if(!n&&u.cmp(l)<0)t=s.neg(),r=f,n=u.neg(),i=c;else if(n&&2===++y)break;s=u,h=d,d=u,g=f,f=c,m=p,p=b}o=u.neg(),a=c;var w=n.sqr().add(i.sqr());return o.sqr().add(a.sqr()).cmp(w)>=0&&(o=t,a=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:i},{a:o,b:a}]},Cv.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},Cv.prototype.pointFromX=function(e,t){(e=new wv(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},Cv.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},Cv.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(t[o]),s=e[o],u=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),u=u.neg(!0)),n[2*o]=s,n[2*o+1]=u,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var c=this._wnafMulAdd(1,n,i,2*o,r),l=0;l<2*o;l++)n[l]=null,i[l]=null;return c},_v(Sv,Av.BasePoint),Cv.prototype.point=function(e,t,r){return new Sv(this,e,t,r)},Cv.prototype.pointFromJSON=function(e,t){return Sv.fromJSON(this,e,t)},Sv.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},Sv.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Sv.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},Sv.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Sv.prototype.isInfinity=function(){return this.inf},Sv.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},Sv.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},Sv.prototype.getX=function(){return this.x.fromRed()},Sv.prototype.getY=function(){return this.y.fromRed()},Sv.prototype.mul=function(e){return e=new wv(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},Sv.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},Sv.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},Sv.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},Sv.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},Sv.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},_v(Iv,Av.BasePoint),Cv.prototype.jpoint=function(e,t,r){return new Iv(this,e,t,r)},Iv.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},Iv.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Iv.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),l=c.redMul(s),d=n.redMul(c),h=u.redSqr().redIAdd(l).redISub(d).redISub(d),f=u.redMul(d.redISub(h)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,f,p)},Iv.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),l=r.redMul(u),d=s.redSqr().redIAdd(c).redISub(l).redISub(l),h=s.redMul(l.redISub(d)).redISub(i.redMul(c)),f=this.z.redMul(a);return this.curve.jpoint(d,h,f)},Iv.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,u=s.redSqr().redSqr(),c=a.redAdd(a);for(t=0;t<e;t++){var l=o.redSqr(),d=c.redSqr(),h=d.redSqr(),f=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(u)),p=o.redMul(d),g=f.redSqr().redISub(p.redAdd(p)),m=p.redISub(g),y=f.redMul(m);y=y.redIAdd(y).redISub(h);var v=c.redMul(s);t+1<e&&(u=u.redMul(h)),o=g,s=v,c=y}return this.curve.jpoint(o,c.redMul(i),s)},Iv.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},Iv.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n),u=s.redSqr().redISub(a).redISub(a),c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),e=u,t=s.redMul(a.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),d=this.y.redSqr(),h=d.redSqr(),f=this.x.redAdd(d).redSqr().redISub(l).redISub(h);f=f.redIAdd(f);var p=l.redAdd(l).redIAdd(l),g=p.redSqr(),m=h.redIAdd(h);m=(m=m.redIAdd(m)).redIAdd(m),e=g.redISub(f).redISub(f),t=p.redMul(f.redISub(e)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},Iv.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=s.redSqr().redISub(a).redISub(a);e=u;var c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),t=s.redMul(a.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),d=this.y.redSqr(),h=this.x.redMul(d),f=this.x.redSub(l).redMul(this.x.redAdd(l));f=f.redAdd(f).redIAdd(f);var p=h.redIAdd(h),g=(p=p.redIAdd(p)).redAdd(p);e=f.redSqr().redISub(g),r=this.y.redAdd(this.z).redSqr().redISub(d).redISub(l);var m=d.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=f.redMul(p.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,r)},Iv.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),a=r.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),u=t.redAdd(t),c=(u=u.redIAdd(u)).redMul(a),l=s.redSqr().redISub(c.redAdd(c)),d=c.redISub(l),h=a.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var f=s.redMul(d).redISub(h),p=r.redAdd(r).redMul(n);return this.curve.jpoint(l,f,p)},Iv.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(n),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var c=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(u),l=t.redMul(c);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.x.redMul(s).redISub(l);d=(d=d.redIAdd(d)).redIAdd(d);var h=this.y.redMul(c.redMul(u.redISub(c)).redISub(a.redMul(s)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var f=this.z.redAdd(a).redSqr().redISub(r).redISub(s);return this.curve.jpoint(d,h,f)},Iv.prototype.mul=function(e,t){return e=new wv(e,t),this.curve._wnafMul(this,e)},Iv.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},Iv.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},Iv.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},Iv.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Tv=jm,Mv=uy,Dv=ay,Rv=Um;function Ov(e){Dv.call(this,"mont",e),this.a=new Tv(e.a,16).toRed(this.red),this.b=new Tv(e.b,16).toRed(this.red),this.i4=new Tv(4).toRed(this.red).redInvm(),this.two=new Tv(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}Mv(Ov,Dv);var kv=Ov;function Nv(e,t,r){Dv.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Tv(t,16),this.z=new Tv(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}Ov.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},Mv(Nv,Dv.BasePoint),Ov.prototype.decodePoint=function(e,t){return this.point(Rv.toArray(e,t),1)},Ov.prototype.point=function(e,t){return new Nv(this,e,t)},Ov.prototype.pointFromJSON=function(e){return Nv.fromJSON(this,e)},Nv.prototype.precompute=function(){},Nv.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Nv.fromJSON=function(e,t){return new Nv(e,t[0],t[1]||e.one)},Nv.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Nv.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Nv.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},Nv.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Nv.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),u=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},Nv.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},Nv.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Nv.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Nv.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},Nv.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Nv.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var Pv=jm,Bv=uy,Fv=ay,Lv=Um.assert;function zv(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,Fv.call(this,"edwards",e),this.a=new Pv(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Pv(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Pv(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),Lv(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}Bv(zv,Fv);var Uv=zv;function jv(e,t,r,n,i){Fv.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new Pv(t,16),this.y=new Pv(r,16),this.z=n?new Pv(n,16):this.curve.one,this.t=i&&new Pv(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}zv.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},zv.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},zv.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},zv.prototype.pointFromX=function(e,t){(e=new Pv(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=n.redMul(i.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var s=a.fromRed().isOdd();return(t&&!s||!t&&s)&&(a=a.redNeg()),this.point(e,a)},zv.prototype.pointFromY=function(e,t){(e=new Pv(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),i=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=n.redMul(i.redInvm());if(0===o.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},zv.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},Bv(jv,Fv.BasePoint),zv.prototype.pointFromJSON=function(e){return jv.fromJSON(this,e)},zv.prototype.point=function(e,t,r,n){return new jv(this,e,t,r,n)},jv.fromJSON=function(e,t){return new jv(e,t[0],t[1],t[2])},jv.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},jv.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},jv.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),u=i.redMul(a),c=o.redMul(s),l=i.redMul(s),d=a.redMul(o);return this.curve.point(u,c,d,l)},jv.prototype._projDbl=function(){var e,t,r,n,i,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var c=(n=this.curve._mulA(s)).redAdd(u);this.zOne?(e=a.redSub(s).redSub(u).redMul(c.redSub(this.curve.two)),t=c.redMul(n.redSub(u)),r=c.redSqr().redSub(c).redSub(c)):(i=this.z.redSqr(),o=c.redSub(i).redISub(i),e=a.redSub(s).redISub(u).redMul(o),t=c.redMul(n.redSub(u)),r=c.redMul(o))}else n=s.redAdd(u),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(a.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(s.redISub(u)),r=n.redMul(o);return this.curve.point(e,t,r)},jv.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},jv.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),u=r.redAdd(t),c=o.redMul(a),l=s.redMul(u),d=o.redMul(u),h=a.redMul(s);return this.curve.point(c,l,h,d)},jv.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),c=i.redAdd(s),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),d=n.redMul(u).redMul(l);return this.curve.twisted?(t=n.redMul(c).redMul(a.redSub(this.curve._mulA(o))),r=u.redMul(c)):(t=n.redMul(c).redMul(a.redSub(o)),r=this.curve._mulC(u).redMul(c)),this.curve.point(d,t,r)},jv.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},jv.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},jv.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},jv.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},jv.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},jv.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},jv.prototype.getX=function(){return this.normalize(),this.x.fromRed()},jv.prototype.getY=function(){return this.normalize(),this.y.fromRed()},jv.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},jv.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},jv.prototype.toP=jv.prototype.normalize,jv.prototype.mixedAdd=jv.prototype.add,function(e){var t=e;t.base=ay,t.short=xv,t.mont=kv,t.edwards=Uv}(Qm);var Vv={},Hv={},Gv={},qv=Gm,Wv=uy;function Kv(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function Xv(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function Yv(e){return 1===e.length?"0"+e:e}function Zv(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}Gv.inherits=Wv,Gv.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var o=e.charCodeAt(i);o<128?r[n++]=o:o<2048?(r[n++]=o>>6|192,r[n++]=63&o|128):Kv(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},Gv.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=Yv(e[r].toString(16));return t},Gv.htonl=Xv,Gv.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=Xv(i)),r+=Zv(i.toString(16))}return r},Gv.zero2=Yv,Gv.zero8=Zv,Gv.join32=function(e,t,r,n){var i=r-t;qv(i%4==0);for(var o=new Array(i/4),a=0,s=t;a<o.length;a++,s+=4){var u;u="big"===n?e[s]<<24|e[s+1]<<16|e[s+2]<<8|e[s+3]:e[s+3]<<24|e[s+2]<<16|e[s+1]<<8|e[s],o[a]=u>>>0}return o},Gv.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},Gv.rotr32=function(e,t){return e>>>t|e<<32-t},Gv.rotl32=function(e,t){return e<<t|e>>>32-t},Gv.sum32=function(e,t){return e+t>>>0},Gv.sum32_3=function(e,t,r){return e+t+r>>>0},Gv.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},Gv.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},Gv.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o<n?1:0)+r+i;e[t]=a>>>0,e[t+1]=o},Gv.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},Gv.sum64_lo=function(e,t,r,n){return t+n>>>0},Gv.sum64_4_hi=function(e,t,r,n,i,o,a,s){var u=0,c=t;return u+=(c=c+n>>>0)<t?1:0,u+=(c=c+o>>>0)<o?1:0,e+r+i+a+(u+=(c=c+s>>>0)<s?1:0)>>>0},Gv.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},Gv.sum64_5_hi=function(e,t,r,n,i,o,a,s,u,c){var l=0,d=t;return l+=(d=d+n>>>0)<t?1:0,l+=(d=d+o>>>0)<o?1:0,l+=(d=d+s>>>0)<s?1:0,e+r+i+a+u+(l+=(d=d+c>>>0)<c?1:0)>>>0},Gv.sum64_5_lo=function(e,t,r,n,i,o,a,s,u,c){return t+n+o+s+c>>>0},Gv.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},Gv.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},Gv.shr64_hi=function(e,t,r){return e>>>r},Gv.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0};var Jv={},$v=Gv,Qv=Gm;function eb(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Jv.BlockHash=eb,eb.prototype.update=function(e,t){if(e=$v.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=$v.join32(e,0,e.length-r,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this},eb.prototype.digest=function(e){return this.update(this._pad()),Qv(null===this.pending),this._digest(e)},eb.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n};var tb={},rb={},nb=Gv.rotr32;function ib(e,t,r){return e&t^~e&r}function ob(e,t,r){return e&t^e&r^t&r}function ab(e,t,r){return e^t^r}rb.ft_1=function(e,t,r,n){return 0===e?ib(t,r,n):1===e||3===e?ab(t,r,n):2===e?ob(t,r,n):void 0},rb.ch32=ib,rb.maj32=ob,rb.p32=ab,rb.s0_256=function(e){return nb(e,2)^nb(e,13)^nb(e,22)},rb.s1_256=function(e){return nb(e,6)^nb(e,11)^nb(e,25)},rb.g0_256=function(e){return nb(e,7)^nb(e,18)^e>>>3},rb.g1_256=function(e){return nb(e,17)^nb(e,19)^e>>>10};var sb=Gv,ub=Jv,cb=rb,lb=sb.rotl32,db=sb.sum32,hb=sb.sum32_5,fb=cb.ft_1,pb=ub.BlockHash,gb=[1518500249,1859775393,2400959708,3395469782];function mb(){if(!(this instanceof mb))return new mb;pb.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}sb.inherits(mb,pb);var yb=mb;mb.blockSize=512,mb.outSize=160,mb.hmacStrength=80,mb.padLength=64,mb.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=lb(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4];for(n=0;n<r.length;n++){var c=~~(n/20),l=hb(lb(i,5),fb(c,o,a,s),u,r[n],gb[c]);u=s,s=a,a=lb(o,30),o=i,i=l}this.h[0]=db(this.h[0],i),this.h[1]=db(this.h[1],o),this.h[2]=db(this.h[2],a),this.h[3]=db(this.h[3],s),this.h[4]=db(this.h[4],u)},mb.prototype._digest=function(e){return"hex"===e?sb.toHex32(this.h,"big"):sb.split32(this.h,"big")};var vb=Gv,bb=Jv,wb=rb,_b=Gm,Ab=vb.sum32,Eb=vb.sum32_4,Cb=vb.sum32_5,xb=wb.ch32,Sb=wb.maj32,Ib=wb.s0_256,Tb=wb.s1_256,Mb=wb.g0_256,Db=wb.g1_256,Rb=bb.BlockHash,Ob=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function kb(){if(!(this instanceof kb))return new kb;Rb.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Ob,this.W=new Array(64)}vb.inherits(kb,Rb);var Nb=kb;kb.blockSize=512,kb.outSize=256,kb.hmacStrength=192,kb.padLength=64,kb.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=Eb(Db(r[n-2]),r[n-7],Mb(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4],c=this.h[5],l=this.h[6],d=this.h[7];for(_b(this.k.length===r.length),n=0;n<r.length;n++){var h=Cb(d,Tb(u),xb(u,c,l),this.k[n],r[n]),f=Ab(Ib(i),Sb(i,o,a));d=l,l=c,c=u,u=Ab(s,h),s=a,a=o,o=i,i=Ab(h,f)}this.h[0]=Ab(this.h[0],i),this.h[1]=Ab(this.h[1],o),this.h[2]=Ab(this.h[2],a),this.h[3]=Ab(this.h[3],s),this.h[4]=Ab(this.h[4],u),this.h[5]=Ab(this.h[5],c),this.h[6]=Ab(this.h[6],l),this.h[7]=Ab(this.h[7],d)},kb.prototype._digest=function(e){return"hex"===e?vb.toHex32(this.h,"big"):vb.split32(this.h,"big")};var Pb=Gv,Bb=Nb;function Fb(){if(!(this instanceof Fb))return new Fb;Bb.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Pb.inherits(Fb,Bb);var Lb=Fb;Fb.blockSize=512,Fb.outSize=224,Fb.hmacStrength=192,Fb.padLength=64,Fb.prototype._digest=function(e){return"hex"===e?Pb.toHex32(this.h.slice(0,7),"big"):Pb.split32(this.h.slice(0,7),"big")};var zb=Gv,Ub=Jv,jb=Gm,Vb=zb.rotr64_hi,Hb=zb.rotr64_lo,Gb=zb.shr64_hi,qb=zb.shr64_lo,Wb=zb.sum64,Kb=zb.sum64_hi,Xb=zb.sum64_lo,Yb=zb.sum64_4_hi,Zb=zb.sum64_4_lo,Jb=zb.sum64_5_hi,$b=zb.sum64_5_lo,Qb=Ub.BlockHash,ew=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function tw(){if(!(this instanceof tw))return new tw;Qb.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=ew,this.W=new Array(160)}zb.inherits(tw,Qb);var rw=tw;function nw(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function iw(e,t,r,n,i,o){var a=t&n^~t&o;return a<0&&(a+=4294967296),a}function ow(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function aw(e,t,r,n,i,o){var a=t&n^t&o^n&o;return a<0&&(a+=4294967296),a}function sw(e,t){var r=Vb(e,t,28)^Vb(t,e,2)^Vb(t,e,7);return r<0&&(r+=4294967296),r}function uw(e,t){var r=Hb(e,t,28)^Hb(t,e,2)^Hb(t,e,7);return r<0&&(r+=4294967296),r}function cw(e,t){var r=Vb(e,t,14)^Vb(e,t,18)^Vb(t,e,9);return r<0&&(r+=4294967296),r}function lw(e,t){var r=Hb(e,t,14)^Hb(e,t,18)^Hb(t,e,9);return r<0&&(r+=4294967296),r}function dw(e,t){var r=Vb(e,t,1)^Vb(e,t,8)^Gb(e,t,7);return r<0&&(r+=4294967296),r}function hw(e,t){var r=Hb(e,t,1)^Hb(e,t,8)^qb(e,t,7);return r<0&&(r+=4294967296),r}function fw(e,t){var r=Vb(e,t,19)^Vb(t,e,29)^Gb(e,t,6);return r<0&&(r+=4294967296),r}function pw(e,t){var r=Hb(e,t,19)^Hb(t,e,29)^qb(e,t,6);return r<0&&(r+=4294967296),r}tw.blockSize=1024,tw.outSize=512,tw.hmacStrength=192,tw.padLength=128,tw.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=fw(r[n-4],r[n-3]),o=pw(r[n-4],r[n-3]),a=r[n-14],s=r[n-13],u=dw(r[n-30],r[n-29]),c=hw(r[n-30],r[n-29]),l=r[n-32],d=r[n-31];r[n]=Yb(i,o,a,s,u,c,l,d),r[n+1]=Zb(i,o,a,s,u,c,l,d)}},tw.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],i=this.h[1],o=this.h[2],a=this.h[3],s=this.h[4],u=this.h[5],c=this.h[6],l=this.h[7],d=this.h[8],h=this.h[9],f=this.h[10],p=this.h[11],g=this.h[12],m=this.h[13],y=this.h[14],v=this.h[15];jb(this.k.length===r.length);for(var b=0;b<r.length;b+=2){var w=y,_=v,A=cw(d,h),E=lw(d,h),C=nw(d,h,f,p,g),x=iw(d,h,f,p,g,m),S=this.k[b],I=this.k[b+1],T=r[b],M=r[b+1],D=Jb(w,_,A,E,C,x,S,I,T,M),R=$b(w,_,A,E,C,x,S,I,T,M);w=sw(n,i),_=uw(n,i),A=ow(n,i,o,a,s),E=aw(n,i,o,a,s,u);var O=Kb(w,_,A,E),k=Xb(w,_,A,E);y=g,v=m,g=f,m=p,f=d,p=h,d=Kb(c,l,D,R),h=Xb(l,l,D,R),c=s,l=u,s=o,u=a,o=n,a=i,n=Kb(D,R,O,k),i=Xb(D,R,O,k)}Wb(this.h,0,n,i),Wb(this.h,2,o,a),Wb(this.h,4,s,u),Wb(this.h,6,c,l),Wb(this.h,8,d,h),Wb(this.h,10,f,p),Wb(this.h,12,g,m),Wb(this.h,14,y,v)},tw.prototype._digest=function(e){return"hex"===e?zb.toHex32(this.h,"big"):zb.split32(this.h,"big")};var gw=Gv,mw=rw;function yw(){if(!(this instanceof yw))return new yw;mw.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}gw.inherits(yw,mw);var vw=yw;yw.blockSize=1024,yw.outSize=384,yw.hmacStrength=192,yw.padLength=128,yw.prototype._digest=function(e){return"hex"===e?gw.toHex32(this.h.slice(0,12),"big"):gw.split32(this.h.slice(0,12),"big")},tb.sha1=yb,tb.sha224=Lb,tb.sha256=Nb,tb.sha384=vw,tb.sha512=rw;var bw={},ww=Gv,_w=Jv,Aw=ww.rotl32,Ew=ww.sum32,Cw=ww.sum32_3,xw=ww.sum32_4,Sw=_w.BlockHash;function Iw(){if(!(this instanceof Iw))return new Iw;Sw.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function Tw(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function Mw(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function Dw(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}ww.inherits(Iw,Sw),bw.ripemd160=Iw,Iw.blockSize=512,Iw.outSize=160,Iw.hmacStrength=192,Iw.padLength=64,Iw.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],o=this.h[3],a=this.h[4],s=r,u=n,c=i,l=o,d=a,h=0;h<80;h++){var f=Ew(Aw(xw(r,Tw(h,n,i,o),e[Rw[h]+t],Mw(h)),kw[h]),a);r=a,a=o,o=Aw(i,10),i=n,n=f,f=Ew(Aw(xw(s,Tw(79-h,u,c,l),e[Ow[h]+t],Dw(h)),Nw[h]),d),s=d,d=l,l=Aw(c,10),c=u,u=f}f=Cw(this.h[1],i,l),this.h[1]=Cw(this.h[2],o,d),this.h[2]=Cw(this.h[3],a,s),this.h[3]=Cw(this.h[4],r,u),this.h[4]=Cw(this.h[0],n,c),this.h[0]=f},Iw.prototype._digest=function(e){return"hex"===e?ww.toHex32(this.h,"little"):ww.split32(this.h,"little")};var Rw=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Ow=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],kw=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Nw=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],Pw=Gv,Bw=Gm;function Fw(e,t,r){if(!(this instanceof Fw))return new Fw(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(Pw.toArray(t,r))}var Lw,zw,Uw=Fw;Fw.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),Bw(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},Fw.prototype.update=function(e,t){return this.inner.update(e,t),this},Fw.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},function(e){var t=e;t.utils=Gv,t.common=Jv,t.sha=tb,t.ripemd=bw,t.hmac=Uw,t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160}(Hv),function(e){var t,r=e,n=Hv,i=Qm,o=Um.assert;function a(e){"short"===e.type?this.curve=new i.short(e):"edwards"===e.type?this.curve=new i.edwards(e):this.curve=new i.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var n=new a(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:n}),n}})}r.PresetCurve=a,s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:n.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:n.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:n.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:n.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:n.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{t=zw?Lw:(zw=1,Lw={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}})}catch(e){t=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:n.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",t]})}(Vv);var jw=Hv,Vw=Wm,Hw=Gm;function Gw(e){if(!(this instanceof Gw))return new Gw(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=Vw.toArray(e.entropy,e.entropyEnc||"hex"),r=Vw.toArray(e.nonce,e.nonceEnc||"hex"),n=Vw.toArray(e.pers,e.persEnc||"hex");Hw(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var qw=Gw;Gw.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},Gw.prototype._hmac=function(){return new jw.hmac(this.hash,this.K)},Gw.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},Gw.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=Vw.toArray(e,t),r=Vw.toArray(r,n),Hw(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},Gw.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=Vw.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length<e;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var o=i.slice(0,e);return this._update(r),this._reseed++,Vw.encode(o,t)};var Ww=jm,Kw=Um.assert;function Xw(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var Yw=Xw;Xw.fromPublic=function(e,t,r){return t instanceof Xw?t:new Xw(e,{pub:t,pubEnc:r})},Xw.fromPrivate=function(e,t,r){return t instanceof Xw?t:new Xw(e,{priv:t,privEnc:r})},Xw.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},Xw.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},Xw.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},Xw.prototype._importPrivate=function(e,t){this.priv=new Ww(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},Xw.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?Kw(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||Kw(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},Xw.prototype.derive=function(e){return e.validate()||Kw(e.validate(),"public point not validated"),e.mul(this.priv).getX()},Xw.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},Xw.prototype.verify=function(e,t,r){return this.ec.verify(e,t,this,void 0,r)},Xw.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var Zw=jm,Jw=Um,$w=Jw.assert;function Qw(e,t){if(e instanceof Qw)return e;this._importDER(e,t)||($w(e.r&&e.s,"Signature without r or s"),this.r=new Zw(e.r,16),this.s=new Zw(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var e_=Qw;function t_(){this.place=0}function r_(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;if(0===e[t.place])return!1;for(var i=0,o=0,a=t.place;o<n;o++,a++)i<<=8,i|=e[a],i>>>=0;return!(i<=127)&&(t.place=a,i)}function n_(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function i_(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}Qw.prototype._importDER=function(e,t){e=Jw.toArray(e,t);var r=new t_;if(48!==e[r.place++])return!1;var n=r_(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=r_(e,r);if(!1===i)return!1;if(128&e[r.place])return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=r_(e,r);if(!1===a)return!1;if(e.length!==a+r.place)return!1;if(128&e[r.place])return!1;var s=e.slice(r.place,a+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new Zw(o),this.s=new Zw(s),this.recoveryParam=null,!0},Qw.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=n_(t),r=n_(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];i_(n,t.length),(n=n.concat(t)).push(2),i_(n,r.length);var i=n.concat(r),o=[48];return i_(o,i.length),o=o.concat(i),Jw.encode(o,e)};var o_=jm,a_=qw,s_=Vv,u_=Xm,c_=Um.assert,l_=Yw,d_=e_;function h_(e){if(!(this instanceof h_))return new h_(e);"string"==typeof e&&(c_(Object.prototype.hasOwnProperty.call(s_,e),"Unknown curve "+e),e=s_[e]),e instanceof s_.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var f_=h_;h_.prototype.keyPair=function(e){return new l_(this,e)},h_.prototype.keyFromPrivate=function(e,t){return l_.fromPrivate(this,e,t)},h_.prototype.keyFromPublic=function(e,t){return l_.fromPublic(this,e,t)},h_.prototype.genKeyPair=function(e){e||(e={});for(var t=new a_({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||u_(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new o_(2));;){var i=new o_(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},h_.prototype._truncateToN=function(e,t,r){var n;if(o_.isBN(e)||"number"==typeof e)n=(e=new o_(e,16)).byteLength();else if("object"==typeof e)n=e.length,e=new o_(e,16);else{var i=e.toString();n=i.length+1>>>1,e=new o_(i,16)}"number"!=typeof r&&(r=8*n);var o=r-this.n.bitLength();return o>0&&(e=e.ushrn(o)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},h_.prototype.sign=function(e,t,r,n){if("object"==typeof r&&(n=r,r=null),n||(n={}),"string"!=typeof e&&"number"!=typeof e&&!o_.isBN(e)){c_("object"==typeof e&&e&&"number"==typeof e.length,"Expected message to be an array-like, a hex string, or a BN instance"),c_(e.length>>>0===e.length);for(var i=0;i<e.length;i++)c_((255&e[i])===e[i])}t=this.keyFromPrivate(t,r),e=this._truncateToN(e,!1,n.msgBitLength),c_(!e.isNeg(),"Can not sign a negative message");var o=this.n.byteLength(),a=t.getPrivate().toArray("be",o),s=e.toArray("be",o);c_(new o_(s).eq(e),"Can not sign message");for(var u=new a_({hash:this.hash,entropy:a,nonce:s,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new o_(1)),l=0;;l++){var d=n.k?n.k(l):new o_(u.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(c)>=0)){var h=this.g.mul(d);if(!h.isInfinity()){var f=h.getX(),p=f.umod(this.n);if(0!==p.cmpn(0)){var g=d.invm(this.n).mul(p.mul(t.getPrivate()).iadd(e));if(0!==(g=g.umod(this.n)).cmpn(0)){var m=(h.getY().isOdd()?1:0)|(0!==f.cmp(p)?2:0);return n.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),m^=1),new d_({r:p,s:g,recoveryParam:m})}}}}}},h_.prototype.verify=function(e,t,r,n,i){i||(i={}),e=this._truncateToN(e,!1,i.msgBitLength),r=this.keyFromPublic(r,n);var o=(t=new d_(t,"hex")).r,a=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,u=a.invm(this.n),c=u.mul(e).umod(this.n),l=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),l)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(c,r.getPublic(),l)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},h_.prototype.recoverPubKey=function(e,t,r,n){c_((3&r)===r,"The recovery param is more than two bits"),t=new d_(t,n);var i=this.n,o=new o_(e),a=t.r,s=t.s,u=1&r,c=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");a=c?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var l=t.r.invm(i),d=i.sub(o).mul(l).umod(i),h=s.mul(l).umod(i);return this.g.mulAdd(d,a,h)},h_.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new d_(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var p_=Um,g_=p_.assert,m_=p_.parseBytes,y_=p_.cachedProperty;function v_(e,t){this.eddsa=e,this._secret=m_(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=m_(t.pub)}v_.fromPublic=function(e,t){return t instanceof v_?t:new v_(e,{pub:t})},v_.fromSecret=function(e,t){return t instanceof v_?t:new v_(e,{secret:t})},v_.prototype.secret=function(){return this._secret},y_(v_,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),y_(v_,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),y_(v_,"privBytes",function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n}),y_(v_,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),y_(v_,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),y_(v_,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),v_.prototype.sign=function(e){return g_(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},v_.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},v_.prototype.getSecret=function(e){return g_(this._secret,"KeyPair is public only"),p_.encode(this.secret(),e)},v_.prototype.getPublic=function(e){return p_.encode(this.pubBytes(),e)};var b_=v_,w_=jm,__=Um,A_=__.assert,E_=__.cachedProperty,C_=__.parseBytes;function x_(e,t){this.eddsa=e,"object"!=typeof t&&(t=C_(t)),Array.isArray(t)&&(A_(t.length===2*e.encodingLength,"Signature has invalid size"),t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),A_(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof w_&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}E_(x_,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),E_(x_,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),E_(x_,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),E_(x_,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),x_.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},x_.prototype.toHex=function(){return __.encode(this.toBytes(),"hex").toUpperCase()};var S_=x_,I_=Hv,T_=Vv,M_=Um,D_=M_.assert,R_=M_.parseBytes,O_=b_,k_=S_;function N_(e){if(D_("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof N_))return new N_(e);e=T_[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=I_.sha512}var P_=N_;N_.prototype.sign=function(e,t){e=R_(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),s=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:s,Rencoded:o})},N_.prototype.verify=function(e,t,r){if(e=R_(e),(t=this.makeSignature(t)).S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},N_.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return M_.intFromLE(e.digest()).umod(this.curve.n)},N_.prototype.keyFromPublic=function(e){return O_.fromPublic(this,e)},N_.prototype.keyFromSecret=function(e){return O_.fromSecret(this,e)},N_.prototype.makeSignature=function(e){return e instanceof k_?e:new k_(this,e)},N_.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},N_.prototype.decodePoint=function(e){var t=(e=M_.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=!!(128&e[t]),i=M_.intFromLE(r);return this.curve.pointFromY(i,n)},N_.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},N_.prototype.decodeInt=function(e){return M_.intFromLE(e)},N_.prototype.isPoint=function(e){return e instanceof this.pointClass},function(e){var t=e;t.version=zm,t.utils=Um,t.rand=Xm,t.curve=Qm,t.curves=Vv,t.ec=f_,t.eddsa=P_}(Lm);var B_,F_,L_={},z_={get exports(){return L_},set exports(e){L_=e}};
|
|
2
2
|
/*! MIT License. Copyright 2015-2018 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */
|
|
3
|
-
!function(e,t){!function(t){function i(e){return parseInt(e)===e}function r(e){if(!i(e.length))return!1;for(var t=0;t<e.length;t++)if(!i(e[t])||e[t]<0||e[t]>255)return!1;return!0}function n(e,t){if(e.buffer&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!r(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(i(e.length)&&r(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function a(e){return new Uint8Array(e)}function o(e,t,i,r,n){null==r&&null==n||(e=e.slice?e.slice(r,n):Array.prototype.slice.call(e,r,n)),t.set(e,i)}var s,c={toBytes:function(e){var t=[],i=0;for(e=encodeURI(e);i<e.length;){var r=e.charCodeAt(i++);37===r?(t.push(parseInt(e.substr(i,2),16)),i+=2):t.push(r)}return n(t)},fromBytes:function(e){for(var t=[],i=0;i<e.length;){var r=e[i];r<128?(t.push(String.fromCharCode(r)),i++):r>191&&r<224?(t.push(String.fromCharCode((31&r)<<6|63&e[i+1])),i+=2):(t.push(String.fromCharCode((15&r)<<12|(63&e[i+1])<<6|63&e[i+2])),i+=3)}return t.join("")}},d=(s="0123456789abcdef",{toBytes:function(e){for(var t=[],i=0;i<e.length;i+=2)t.push(parseInt(e.substr(i,2),16));return t},fromBytes:function(e){for(var t=[],i=0;i<e.length;i++){var r=e[i];t.push(s[(240&r)>>4]+s[15&r])}return t.join("")}}),u={16:10,24:12,32:14},l=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],h=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],f=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],p=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],g=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],m=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],b=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],v=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],y=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],_=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],w=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],x=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],A=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],E=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],S=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function k(e){for(var t=[],i=0;i<e.length;i+=4)t.push(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]);return t}var M=function e(t){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:n(t,!0)}),this._prepare()};M.prototype._prepare=function(){var e=u[this.key.length];if(null==e)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var t=0;t<=e;t++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var i,r=4*(e+1),n=this.key.length/4,a=k(this.key);for(t=0;t<n;t++)i=t>>2,this._Ke[i][t%4]=a[t],this._Kd[e-i][t%4]=a[t];for(var o,s=0,c=n;c<r;){if(o=a[n-1],a[0]^=h[o>>16&255]<<24^h[o>>8&255]<<16^h[255&o]<<8^h[o>>24&255]^l[s]<<24,s+=1,8!=n)for(t=1;t<n;t++)a[t]^=a[t-1];else{for(t=1;t<n/2;t++)a[t]^=a[t-1];o=a[n/2-1],a[n/2]^=h[255&o]^h[o>>8&255]<<8^h[o>>16&255]<<16^h[o>>24&255]<<24;for(t=n/2+1;t<n;t++)a[t]^=a[t-1]}for(t=0;t<n&&c<r;)d=c>>2,f=c%4,this._Ke[d][f]=a[t],this._Kd[e-d][f]=a[t++],c++}for(var d=1;d<e;d++)for(var f=0;f<4;f++)o=this._Kd[d][f],this._Kd[d][f]=x[o>>24&255]^A[o>>16&255]^E[o>>8&255]^S[255&o]},M.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,i=[0,0,0,0],r=k(e),n=0;n<4;n++)r[n]^=this._Ke[0][n];for(var o=1;o<t;o++){for(n=0;n<4;n++)i[n]=p[r[n]>>24&255]^g[r[(n+1)%4]>>16&255]^m[r[(n+2)%4]>>8&255]^b[255&r[(n+3)%4]]^this._Ke[o][n];r=i.slice()}var s,c=a(16);for(n=0;n<4;n++)s=this._Ke[t][n],c[4*n]=255&(h[r[n]>>24&255]^s>>24),c[4*n+1]=255&(h[r[(n+1)%4]>>16&255]^s>>16),c[4*n+2]=255&(h[r[(n+2)%4]>>8&255]^s>>8),c[4*n+3]=255&(h[255&r[(n+3)%4]]^s);return c},M.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,i=[0,0,0,0],r=k(e),n=0;n<4;n++)r[n]^=this._Kd[0][n];for(var o=1;o<t;o++){for(n=0;n<4;n++)i[n]=v[r[n]>>24&255]^y[r[(n+3)%4]>>16&255]^_[r[(n+2)%4]>>8&255]^w[255&r[(n+1)%4]]^this._Kd[o][n];r=i.slice()}var s,c=a(16);for(n=0;n<4;n++)s=this._Kd[t][n],c[4*n]=255&(f[r[n]>>24&255]^s>>24),c[4*n+1]=255&(f[r[(n+3)%4]>>16&255]^s>>16),c[4*n+2]=255&(f[r[(n+2)%4]>>8&255]^s>>8),c[4*n+3]=255&(f[255&r[(n+1)%4]]^s);return c};var C=function e(t){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new M(t)};C.prototype.encrypt=function(e){if((e=n(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=a(e.length),i=a(16),r=0;r<e.length;r+=16)o(e,i,0,r,r+16),o(i=this._aes.encrypt(i),t,r);return t},C.prototype.decrypt=function(e){if((e=n(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=a(e.length),i=a(16),r=0;r<e.length;r+=16)o(e,i,0,r,r+16),o(i=this._aes.decrypt(i),t,r);return t};var I=function e(t,i){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",i){if(16!=i.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else i=a(16);this._lastCipherblock=n(i,!0),this._aes=new M(t)};I.prototype.encrypt=function(e){if((e=n(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=a(e.length),i=a(16),r=0;r<e.length;r+=16){o(e,i,0,r,r+16);for(var s=0;s<16;s++)i[s]^=this._lastCipherblock[s];this._lastCipherblock=this._aes.encrypt(i),o(this._lastCipherblock,t,r)}return t},I.prototype.decrypt=function(e){if((e=n(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=a(e.length),i=a(16),r=0;r<e.length;r+=16){o(e,i,0,r,r+16),i=this._aes.decrypt(i);for(var s=0;s<16;s++)t[r+s]=i[s]^this._lastCipherblock[s];o(e,this._lastCipherblock,0,r,r+16)}return t};var D=function e(t,i,r){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",i){if(16!=i.length)throw new Error("invalid initialation vector size (must be 16 size)")}else i=a(16);r||(r=1),this.segmentSize=r,this._shiftRegister=n(i,!0),this._aes=new M(t)};D.prototype.encrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var t,i=n(e,!0),r=0;r<i.length;r+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var a=0;a<this.segmentSize;a++)i[r+a]^=t[a];o(this._shiftRegister,this._shiftRegister,0,this.segmentSize),o(i,this._shiftRegister,16-this.segmentSize,r,r+this.segmentSize)}return i},D.prototype.decrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var t,i=n(e,!0),r=0;r<i.length;r+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var a=0;a<this.segmentSize;a++)i[r+a]^=t[a];o(this._shiftRegister,this._shiftRegister,0,this.segmentSize),o(e,this._shiftRegister,16-this.segmentSize,r,r+this.segmentSize)}return i};var T=function e(t,i){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",i){if(16!=i.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else i=a(16);this._lastPrecipher=n(i,!0),this._lastPrecipherIndex=16,this._aes=new M(t)};T.prototype.encrypt=function(e){for(var t=n(e,!0),i=0;i<t.length;i++)16===this._lastPrecipherIndex&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),t[i]^=this._lastPrecipher[this._lastPrecipherIndex++];return t},T.prototype.decrypt=T.prototype.encrypt;var R=function e(t){if(!(this instanceof e))throw Error("Counter must be instanitated with `new`");0===t||t||(t=1),"number"==typeof t?(this._counter=a(16),this.setValue(t)):this.setBytes(t)};R.prototype.setValue=function(e){if("number"!=typeof e||parseInt(e)!=e)throw new Error("invalid counter value (must be an integer)");if(e>Number.MAX_SAFE_INTEGER)throw new Error("integer value out of safe range");for(var t=15;t>=0;--t)this._counter[t]=e%256,e=parseInt(e/256)},R.prototype.setBytes=function(e){if(16!=(e=n(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},R.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var z=function e(t,i){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",i instanceof R||(i=new R(i)),this._counter=i,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new M(t)};z.prototype.encrypt=function(e){for(var t=n(e,!0),i=0;i<t.length;i++)16===this._remainingCounterIndex&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),t[i]^=this._remainingCounter[this._remainingCounterIndex++];return t},z.prototype.decrypt=z.prototype.encrypt;var B={AES:M,Counter:R,ModeOfOperation:{ecb:C,cbc:I,cfb:D,ofb:T,ctr:z},utils:{hex:d,utf8:c},padding:{pkcs7:{pad:function(e){var t=16-(e=n(e,!0)).length%16,i=a(e.length+t);o(e,i);for(var r=e.length;r<i.length;r++)i[r]=t;return i},strip:function(e){if((e=n(e,!0)).length<16)throw new Error("PKCS#7 invalid length");var t=e[e.length-1];if(t>16)throw new Error("PKCS#7 padding byte out of range");for(var i=e.length-t,r=0;r<t;r++)if(e[i+r]!==t)throw new Error("PKCS#7 invalid padding byte");var s=a(i);return o(e,s,0,0,i),s}}},_arrayTest:{coerceArray:n,createArray:a,copyArray:o}};e.exports=B}()}(cp);class dp{getExchangeRequestHeader(){if(!this.kp){const e={entropy:this.generateRandomHexString(192),entropyEnc:"hex"};this.kp=this.ec.genKeyPair(e)}return{type:"key_exchange",scheme:3,y:this.jsArrayToBase64(this.kp.getPublic().encode("array",!1))}}async processExchangeResponseHeader(e){if(e.scheme!=this.scheme)throw"Unsupported crypto scheme "+e.scheme;this.sessionId=e.crypto_session_id;const t=this.kp.derive(this.ec.keyFromPublic(atob(e.y)).getPublic()).toArray("be",32),i=new Uint8Array(t),r=await crypto.subtle.digest("SHA-256",i);this.aesKey=Array.from(new Uint8Array(r))}isReady(){return!(!this.aesKey||!this.sessionId)}decryptResponse(e){let t=null;if(e.headers.forEach((function(e){"encryption"==e.type&&(t=e)})),t){const i=this.base64ToJsArray(t.iv),r=new sp.ModeOfOperation.cbc(this.aesKey,i),n=this.base64ToJsArray(e.data),a=r.decrypt(n);let o=sp.utils.utf8.fromBytes(a);o=this.pkcs7Unpad(o),e.data=JSON.parse(o)}return e}encryptRequest(e){const t=this.generateRandomHexString(32),i=sp.utils.hex.toBytes(t),r={type:"encryption",iv:this.hexToBase64(t),crypto_session_id:this.sessionId},n=e.headers.map((e=>this.encryptStringToBase64(JSON.stringify(e),i))),a=JSON.stringify(e.data),o=this.encryptStringToBase64(a,i);e.headers=[r],e.enc_headers=n,e.data=o}encryptStringToBase64(e,t){const i=new sp.ModeOfOperation.cbc(this.aesKey,t),r=sp.utils.utf8.toBytes(e),n=this.pkcs7Pad(r),a=[...i.encrypt(n)];return this.jsArrayToBase64(a)}toJson(){return{scheme:3,session_id:this.sessionId,key:this.jsArrayToBase64(this.aesKey)}}static fromJson(e){return new dp(e)}jsArrayToBase64(e){let t="";for(let i=0;i<e.length;i++)t+=String.fromCharCode(e[i]);return btoa(t)}base64ToJsArray(e){const t=atob(e),i=[];for(let e=0;e<t.length;e++)i.push(t.charCodeAt(e));return i}pkcs7Pad(e){const t=16-e.length%16,i=new Uint8Array(e.length+t);i.set(e,0);for(let r=0;r<t;r++)i[e.length+r]=t;return i}pkcs7Unpad(e){try{const t=e.charCodeAt(e.length-1);if(t<1||t>16)throw new pp(`Invalid padding length: ${t}`);if(e.length<t)throw new pp("Input string shorter than padding length");for(let i=1;i<=t;i++){if(e.charCodeAt(e.length-i)!==t)throw new pp("Invalid padding values")}return e.slice(0,-t)}catch(e){if(e instanceof pp)throw e;throw new pp(`Failed to unpad data: ${e instanceof Error?e.message:String(e)}`)}}constructor(e){if(this.scheme=3,this.ecCurveName="p256",this.ec=new mu.ec(this.ecCurveName),e&&(this.sessionId=e.session_id,this.aesKey=this.base64ToJsArray(e.key),!this.isReady()))throw new Error("Internal: Can't deserialize crypto session")}generateRandomHexString(e){const t=new Uint8Array(e);crypto.getRandomValues(t);let i="";const r=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];for(let e=0;e<t.length;e++){i+=r[15&t[e]]}return i}hexToBase64(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";let i=0,r=0,n="";for(let a=0;a<e.length;a++)if(i=(i<<4)+parseInt(e[a],16),r+=4,r>=6){n+=t[i>>r-6],r-=6,i&=255>>8-r}if(r){n+=t[i<<6-r]}for(;n.length%4;)n+="=";return n}}class up{constructor(e,t){this.encrypted=e,this.cryptoSession=t}isReady(){var e;return(null===(e=this.cryptoSession)||void 0===e?void 0:e.isReady())||!1}async exchangeKeyAndEncryptRequest(e,t,i,r,n,a){if(!t.isReady()){const i=["aid","clientId"],n=new URLSearchParams(Array.from(r.searchParams.entries()).filter((e=>{let[t,r]=e;return i.includes(t)})));await t.performKeyExchange(e,n)}return t.promisePossiblyEncryptedTransportRequest(new fp(i,r,n.data,n.headers,a))}async performKeyExchange(e,t){const r={r:"Hello Encrypted World"},n=new URL(e+du.path+"?"+t.toString()),a=new fp("POST",n,r,[],{"Content-Type":"application/json"}),o=this.promisePossiblyEncryptedTransportRequest(a);let s;const c=await fetch(o.url.toString(),{body:JSON.stringify(null==o?void 0:o.body),method:"POST",headers:o.headers,credentials:"include"});if(!c.ok)throw new Error("Request failed");let d;s=i(i({data:await c.json()},c),{},{headers:c.headers});try{d=s.data}catch(e){throw new Error(`Unsupported resposne format: ${e}`)}await this.postprocessResponse(d),d=this.possiblyDecryptResponse(d);const u=d.data;if(JSON.stringify(u)!==JSON.stringify(r))throw new Error("Key exchange failed");return Promise.resolve()}async postprocessResponse(e){var t;if(e.headers){const i=e.headers.find((e=>"key_exchange"==e.type));if(i)return null===(t=this.cryptoSession)||void 0===t?void 0:t.processExchangeResponseHeader(i)}}promisePossiblyEncryptedTransportRequest(e){const t={headers:e.envelopeHeaders,data:e.body};return this.encryptEnvelopedMessageIfNeeded(t),new lp(e.url.toString(),e.method,t,void 0,e.httpHeaders)}possiblyDecryptResponse(e){return this.cryptoSession&&(e=this.cryptoSession.decryptResponse(e)),e}encryptEnvelopedMessageIfNeeded(e){var t;const i=this.generateKeyExchangeHeaderIfNeeded();(null===(t=this.cryptoSession)||void 0===t?void 0:t.isReady())&&this.cryptoSession.encryptRequest(e),i&&e.headers.push(i)}generateKeyExchangeHeaderIfNeeded(){return this.encrypted&&!this.cryptoSession?(this.cryptoSession=new dp,this.cryptoSession.getExchangeRequestHeader()):null}}class lp{constructor(e,t,i,r,n){this.url=e,this.httpMethod=t,this.body=i,this.params=r,this.headers=n}}class hp{addEnvelopeHeader(e){this._envelopeHeaders.push(e)}get method(){return this._requestMethod}get url(){return this._url}get body(){return this._requestBody}get envelopeHeaders(){return this._envelopeHeaders}get httpHeaders(){return this._httpHeaders}constructor(e,t,i,r,n){if(!t||!i)throw new Error("Internal - Invalid arguments for constructing session message");this._requestMethod=e,this._url=t,this._requestBody=i,this._envelopeHeaders=r||[],this._httpHeaders=n}}class fp extends hp{static from(e,t,i,r){return new fp(e,t,i.data,i.headers,r)}}class pp extends Error{constructor(e){super(e),this.name="PaddingError",Object.setPrototypeOf(this,pp.prototype)}}class gp{constructor(e){this.urlBaseString=e+"/"+ru}convertHttpResponseToRawServiceResponse(e){const{status:t,statusText:i,body:r}=e;return this.rawFrom(t,i,r)}rawFrom(e,t,i){const{error_code:r,error_message:n,headers:a,data:o}=i;return{status:e,statusText:t,error_code:r,error_message:n,headers:a,data:this.buildAggregatedData(o)}}buildAggregatedData(e){switch(null==e?void 0:e.state){case pu.Pending:lu.forEach((t=>{const[[r,n]]=Object.entries(t),a=((e,t,i)=>{if(!e||"object"!=typeof e)return i;const r=Array.isArray(t)?t:t.split(".");let n=e;for(let e=0;e<r.length;e++)if(n=n[r[e]],void 0===n)return i;return n})(e,r);if(a){const t={};n.forEach((e=>{e in a&&(t[e]=a[e])})),e=i(i({},e),t)}}));break;case pu.Rejected:e.type=gu.Rejection}return e}async sendRequest(e,t,r,n){if(!(this.urlBaseString.toString().length>ru.length&&e))throw new Error("bad input");const a=new URL(this.urlBaseString);a.pathname+=e,tu.debug(`Got Full URL: ${a.toString()}`),Object.keys(t).map((e=>a.searchParams.append(e,t[e]))),tu.debug(`Request body: ${r}`);let o=new lp(a.toString(),"POST",r,a.searchParams,{"Content-type":"application/json;charset=UTF-8"});try{n.encrypted&&(o=await n.exchangeKeyAndEncryptRequest(this.urlBaseString,n,o.httpMethod,new URL(o.url),o.body,o.headers));const e=await fetch(o.url.toString(),{body:JSON.stringify(o.body),method:"POST",headers:o.headers,credentials:"include"});let t;const r=await e.json();if(n.encrypted){const e=r;n.postprocessResponse(e),t=n.possiblyDecryptResponse(e)}else t=r;return this.convertHttpResponseToRawServiceResponse(i(i({},e),{},{body:t}))}catch(e){throw new hu("Error occurred while retrieving response from server",Yd.NetworkError)}}}!function(e){e.Active="Active",e.Success="Journey Ended with Success",e.Rejected="Journey Ended with Rejection",e.Aborted="Journey aborted by client"}(ap||(ap={})),function(e){e.ClientSdk="Client SDK Journey",e.SSO="SSO Journey"}(op||(op={}));class mp extends up{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0;super(r,n),this.journeyType=e,this.sdkData=t,this.additionalParams=i,this.encrypted=r,this.cryptoSession=n,this.state=ap.Active}getQueryParams(){let e={};return this.deviceId&&(e.did=this.deviceId),this.sessionId&&(e.sid=this.sessionId),e}getInternalHeaders(){const e=[];return this.userId&&e.push({type:"uid",uid:this.userId}),e}toJson(){var e;return{journeyType:this.journeyType,challenge:this.challenge,assertionId:this.assertionId,userId:this.userId,sessionId:this.sessionId,deviceId:this.deviceId,actionType:this.actionType,additionalParams:this.additionalParams,sdkData:this.sdkData,encrypted:this.encrypted,cryptoSession:null===(e=this.cryptoSession)||void 0===e?void 0:e.toJson()}}getInvocationData(){const e=uu.data.dummy;return this.additionalParams&&Object.keys(this.additionalParams).length>0&&(e.params=this.additionalParams),this.sdkData&&Object.keys(this.sdkData).length>0&&(e.sdk_data=this.sdkData),e}complete(){if(this.isCompletedState())throw Error(`Cannot complete an already completed journey. Current state: ${this.state.toString()}`);this.challenge=void 0,this.state=ap.Success,this.cryptoSession=void 0}reject(){if(this.isCompletedState())throw Error(`Cannot reject an already completed journey. Current state: ${this.state.toString()}`);this.challenge=void 0,this.state=ap.Rejected,this.cryptoSession=void 0}abort(){if(this.isCompletedState())throw Error(`Cannot abort an already completed journey. Current state: ${this.state.toString()}`);this.challenge=void 0,this.state=ap.Aborted,this.cryptoSession=void 0}active(){if(this.isCompletedState())throw Error(`Cannot run a completed journey. Current state: ${this.state.toString()}`);this.state=ap.Active}isCompletedState(){return this.state===ap.Success||this.state===ap.Rejected||this.state===ap.Aborted}}class bp extends mp{constructor(e,t,i){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4?arguments[4]:void 0;if(super(op.ClientSdk,t,i,r,n),this.journeyId=e,!this.journeyId)throw Error("Journey ID must be provided")}getInvocationData(){const e=super.getInvocationData();return e.policy_request_id=this.journeyId,e}getInvocationPath(){return au.path}toJson(){return i(i({},super.toJson()),{},{journeyId:this.journeyId})}}class vp extends mp{constructor(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;super(op.SSO,t,{},i,r),this.interactionId=e}getInvocationPath(){return nu.path}getQueryParams(){return i(i({},super.getQueryParams()),{},{ssoInteractionId:this.interactionId})}toJson(){return i(i({},super.toJson()),{},{interactionId:this.interactionId})}}const yp=["assertion_id","type","escapes","form_id","vendor_name"],_p=[...yp,"challenge","assertion_error_code","assertion_error_message","assertions_complete","state","control_flow","rejection_data"],wp={[Qd.Cancel]:Qd.Cancel,[Qd.Fail]:Qd.Fail},xp=["data"],Ap=["json_data"];class Ep{constructor(e){var t,i,r;this.rawResponse=e;const[{escapes:n,form_id:a}]=null!==(i=null===(t=e.data)||void 0===t?void 0:t.control_flow)&&void 0!==i?i:[{}];this.escapes=n,this.data=null!==(r=e.data)&&void 0!==r?r:{},this.formId=a}generateServiceResponse(e,t){var r,n;const a=this.getType(),o=this.getJourneyStepId(e);return i(i({type:a,journeyStepId:o,errorData:this.getErrorData(),data:this.getData(o),clientResponseOptions:this.getClientResponseActions()},t),{},{redirectUrl:null===(n=null===(r=this.data)||void 0===r?void 0:r.data)||void 0===n?void 0:n.url})}getActionType(){return this.data.type}getChallenge(){return this.data.challenge}getAssertionId(){return this.data.assertion_id}getJourneyState(){var e,t,i;let r;if((null===(e=this.rawResponse)||void 0===e?void 0:e.status)>=400)r=fu.TextRejection;else switch(this.data.state){case pu.Completed:r=fu.JourneyEnd;break;case pu.Rejected:r=fu.JsonRejection;break;case pu.Pending:r=(null===(i=null===(t=this.rawResponse)||void 0===t?void 0:t.data)||void 0===i?void 0:i.control_flow)?fu.NextAction:fu.UpdateAction;break;default:r=fu.JsonRejection}return r}getType(){let e=Xd.JourneyRejection;return this.data.assertions_complete?e=Xd.JourneySuccess:this.data.state===pu.Pending?e=Xd.ClientInputRequired:16==this.data.assertion_error_code?e=Xd.ClientInputUpdateRequired:4001===this.rawResponse.error_code&&(e=Xd.JourneyRejection),e}getData(e){var t,r;const[n]=null!==(t=this.data.control_flow)&&void 0!==t?t:[{}],o=null!==(r=this.data)&&void 0!==r?r:{},{data:s}=o,c=a(o,xp),d=null!=s?s:{},{json_data:u}=d,l=a(d,Ap);return this.removeFields(n,yp),this.data=i(i(i(i(i({},c),n),u&&{json_data:u}),Object.keys(l).length&&{data:l}),this.rejectionReason&&{rejectionReason:this.rejectionReason}),this.removeFields(this.data,_p),this.manipulateDataForJourneyStep(e),this.data}manipulateDataForJourneyStep(e){e===eu.InvokeIDP&&(this.data.authorization_url=this.generateAuthorizationUrlFromResponseData(this.data),delete this.data.authorization_parameters,delete this.data.authorization_endpoint)}generateAuthorizationUrlFromResponseData(e){const{authorization_endpoint:t,authorization_parameters:i}=e,r=Object.keys(i).map((e=>{const t=i[e]instanceof Object?JSON.stringify(i[e]):i[e];return`${e}=${encodeURIComponent(t)}`})).join("&"),n=new URL(t);return n.search=r,n}getErrorData(){if(this.data.assertion_error_code&&0!=this.data.assertion_error_code){const e=hu.convertFromAssertionError(this.data.assertion_error_code);return new hu(this.data.assertion_error_message,e)}}removeFields(e,t){for(const i of t)i in e&&delete e[i]}getJourneyStepId(e){const t=this.getType();if(t===Xd.JourneyRejection)return this.rejectionReason=this.rawResponse.error_message,eu.Rejection;if(t===Xd.JourneySuccess)return eu.Success;switch(e){case gu.Form:case gu.LoginForm:return this.formIdToStepId()||this.formId||e;case gu.Information:return eu.Information;case gu.DebugBreak:return eu.DebugBreak;case gu.WaitForTicket:return eu.WaitForAnotherDevice;case gu.Rejection:return eu.Rejection;case gu.DrsTriggerAction:return eu.DrsTriggerAction;case gu.IdentityVerification:return eu.IdentityVerification;case gu.WebAuthnRegistration:return eu.WebAuthnRegistration;default:return e||""}}formIdToStepId(){return this.formId}getClientResponseActions(){var e;const t={[Qd.ClientInput]:{type:Qd.ClientInput,id:"client_input",label:"Client Input"}};return null===(e=this.escapes)||void 0===e||e.forEach((e=>{let{id:r,display_name:n,schema:a}=e;var o;const s=null!==(o=wp[r])&&void 0!==o?o:Qd.Custom;t[r]=i({type:s,id:r,label:n||r},a&&{schema:a})})),t}}class Sp extends Error{constructor(){super("Missing response data")}}class kp extends Error{constructor(e,t){super("Action of type "+e+" cannot have response from type "+t)}}const Mp=new T("ido","sdkDataDB",1);async function Cp(e){try{return await Mp.get("sdkDataStore",e)}catch(e){console.error("Error retrieving SDK data:",e)}}const Ip=new class{constructor(){this.correlationId="",this.getIdentifier=(e,t)=>{var i;const r=null===(i=e.headers.find((e=>t in e)))||void 0===i?void 0:i[t];return tu.debug(`Getting identifier ${t} from response, value: ${r}`),r}}async init(e,t){if(!e||!t)throw new hu("Invalid initialization configuration",Yd.InvalidInitOptions);const{serverPath:i,logLevel:r,pollingTimeout:n,resource:a,locale:o}=t;if(!i)throw new hu("Invalid initialization options",Yd.InvalidInitOptions);tu.setLogLevel(null!=r?r:Zd.Info),this.pollingTimeout=null!=n?n:3,this.clientId=e,a&&(this.resource=a),o&&(this.locale=o),this.serverPath=i,this.api=new gp(this.serverPath),tu.info("IdoSdk initialized successfully")}async startJourney(e,t){var i,r;const{additionalParams:n,correlationId:a}=null!=t?t:{};this.correlationId=null!=a?a:crypto.randomUUID();const o=await Cp("sdk_data"),s=(null===(i=this.journey)||void 0===i?void 0:i.encrypted)||(null==t?void 0:t.encrypted)||!1,c=(null===(r=this.journey)||void 0===r?void 0:r.isReady())?this.journey.cryptoSession:void 0,d=new bp(e,o,n,s,c);return this.invokeJourney(d)}async startSsoJourney(e,t){var i,r;this.correlationId=e;const n=await Cp("sdk_data"),a=(null===(i=this.journey)||void 0===i?void 0:i.encrypted)||(null==t?void 0:t.encrypted)||!1,o=(null===(r=this.journey)||void 0===r?void 0:r.isReady())?this.journey.cryptoSession:void 0,s=new vp(e,n,a,o);return this.invokeJourney(s)}async submitClientResponse(e,t){var i,r,n,a,o,s,c;if(!this.journey)throw new hu("Error occurred while trying to submit client response since no journey is active",Yd.NoActiveJourney);const d={assertion_id:null===(i=this.journey)||void 0===i?void 0:i.assertionId,action:null===(r=this.journey)||void 0===r?void 0:r.actionType,assert:"action",input:t};if((null==t?void 0:t.fch)||(d.fch=null===(n=this.journey)||void 0===n?void 0:n.challenge),e===Qd.ClientInput)switch(null===(a=this.lastServiceResponse)||void 0===a?void 0:a.journeyStepId){case eu.CryptoBindingRegistration:case eu.RegisterDeviceAction:case eu.CryptoBindingValidation:case eu.ValidateDeviceAction:await this.handleCryptoBindingStep(d);break;case eu.WaitForAnotherDevice:return await this.handleWaitForAnotherDeviceAction(d);case eu.DrsTriggerAction:case eu.IdentityVerification:case eu.WebAuthnRegistration:case eu.SmsOTPAuthentication:case eu.EmailOTPAuthentication:case eu.EmailValidation:case eu.SmsValidation:case eu.WebAuthnTransactionSigning:case eu.SelectOrganization:this.handleDataAction(d,t);break;case eu.TotpRegistration:this.handleDataAction(d,{});break;case eu.InvokeIDP:case eu.MobileApproveAuthentication:this.handleDataAction(d,t)}else if(e===Qd.Resend)switch(null===(o=this.lastServiceResponse)||void 0===o?void 0:o.journeyStepId){case eu.SmsOTPAuthentication:case eu.EmailOTPAuthentication:case eu.EmailValidation:case eu.SmsValidation:case eu.MobileApproveAuthentication:this.handleResendAssertion(d);break;default:throw new kp(null===(s=this.lastServiceResponse)||void 0===s?void 0:s.journeyStepId,e)}else Qd.Cancel,this.handleClientResponseOption(e,t,d);try{let e={headers:await this.getInternalHeaders(),data:d};const t=await(null===(c=this.api)||void 0===c?void 0:c.sendRequest(ou.path,this.getQueryParams(),e,this.journey));if(!t)throw new Sp;return await this.handleServiceResponse(t)}catch(e){throw this.rejectJourney(),e}}handleClientResponseOption(e,t,i){delete i.input,i.assert="escape",i.data={escape_id:e,escape_params:t}}handleResendAssertion(e){delete e.input,delete e.data,e.assert="resend"}async handleCryptoBindingStep(e){const t=Wd.crypto.createCryptoBinding("sign"),i=await this.handleCryptoBindingFieldValue(t);this.handleCryptoBindingActionPayload(e,i)}handleCryptoBindingActionPayload(e,t){const r=iu[this.lastServiceResponse.journeyStepId];e[r]=i(i({},e[r]),{},{"ts:idosdk:device":t})}handleDataAction(e,t){delete e.input,e.assert="data",e.data=t}async handleCryptoBindingFieldValue(e){var t,i,r,n,a,o,s,c,d;switch(null===(t=this.lastServiceResponse)||void 0===t?void 0:t.journeyStepId){case eu.CryptoBindingRegistration:case eu.RegisterDeviceAction:const{keyIdentifier:t,publicKey:u}=null!==(i=await e.getPublicData())&&void 0!==i?i:{};return{platform_device_id:t,platform_device_key:u};case eu.CryptoBindingValidation:case eu.ValidateDeviceAction:const{keyIdentifier:l}=null!==(r=await e.getPublicData())&&void 0!==r?r:{};return{platform_device_id:l,signature:await e.sign(null!==(s=null===(o=null===(a=null===(n=this.lastServiceResponse)||void 0===n?void 0:n.data)||void 0===a?void 0:a.app_data)||void 0===o?void 0:o.challenge)&&void 0!==s?s:null===(d=null===(c=this.lastServiceResponse)||void 0===c?void 0:c.data)||void 0===d?void 0:d.device_challenge)}}}async handleWaitForAnotherDeviceAction(e){var t,i,r,n;const a=await this.getInternalHeaders(),o=await(null===(t=this.api)||void 0===t?void 0:t.sendRequest(su.path,this.getQueryParams(),{headers:a,data:{polling_timeout:this.pollingTimeout,ticket_id:null===(i=this.lastServiceResponse)||void 0===i?void 0:i.data.raw_ticket_id,type:"ticket"}},this.journey));if(!0===(null===(r=null==o?void 0:o.data)||void 0===r?void 0:r.change_detected)){const t=await(null===(n=this.api)||void 0===n?void 0:n.sendRequest(ou.path,this.getQueryParams(),{headers:a,data:e},this.journey));if(!t)throw new Sp;return this.handleServiceResponse(t)}return this.lastServiceResponse}async handleServiceResponse(e){var t,r,n,a,o,s;const c=new Ep(e),d=c.getJourneyState();this.handleJourneyState(d),(null===(r=null===(t=e.data)||void 0===t?void 0:t.data)||void 0===r?void 0:r.sdk_data)&&(await async function(e,t){try{const r=i(i({},await Cp(e)),t);await Mp.put("sdkDataStore",e,r)}catch(e){console.error("Error saving SDK data:",e)}}("sdk_data",e.data.data.sdk_data),delete e.data.data.sdk_data),this.journey.assertionId=null!==(n=c.getAssertionId())&&void 0!==n?n:this.journey.assertionId,this.journey.actionType=null!==(a=c.getActionType())&&void 0!==a?a:this.journey.actionType,this.journey.challenge=null!==(o=c.getChallenge())&&void 0!==o?o:this.journey.challenge;const{clientResponseOptions:u,data:l}=null!==(s=this.lastServiceResponse)&&void 0!==s?s:{},h=d===fu.UpdateAction?{clientResponseOptions:u,data:l}:{};let f=c.generateServiceResponse(this.journey.actionType,h);switch(this.lastServiceResponse=f,f.journeyStepId){case eu.ValidateDeviceAction:case eu.RegisterDeviceAction:if(d!==fu.NextAction)throw new Error(`Journey rejected on ${f.journeyStepId} device action, with ${f.errorData}`);f=await this.submitClientResponse(Qd.ClientInput,f.data);break;default:this.handleJourneySuccess(f)}return f}handleJourneySuccess(e){var t,i;null===(i=null===(t=e.data)||void 0===t?void 0:t.data)||void 0===i||i.url,e.type===Xd.JourneySuccess&&(e.token=e.data.token,delete e.data.token)}serializeState(){if(!this.lastServiceResponse||!this.journey)throw new hu("Error occurred while trying to serialize state since no journey is active",Yd.NoActiveJourney);return btoa(encodeURIComponent(JSON.stringify({journey:this.journey.toJson(),serviceResponse:this.lastServiceResponse})))}restoreFromSerializedState(e){var t;const{journey:i,serviceResponse:r}=JSON.parse(decodeURIComponent(null!==(t=atob(e))&&void 0!==t?t:{}));if(!i||!r)throw new hu("Invalid serialized state",Yd.InvalidState);if(this.lastServiceResponse=r,this.journey=function(e){let t,i;switch(e.cryptoSession&&(i=dp.fromJson(e.cryptoSession)),e.journeyType){case op.ClientSdk:t=new bp(e.journeyId,e.sdkData,e.additionalParams,e.encrypted,i);break;case op.SSO:t=new vp(e.interactionId,e.sdkData,e.encrypted,i);break;default:throw Error(`error when trying to deserialize Journey Json - unknown journey type ${e.journeyType}`)}return t.challenge=e.challenge,t.assertionId=e.assertionId,t.userId=e.userId,t.sessionId=e.sessionId,t.deviceId=e.deviceId,t.actionType=e.actionType,t}(i),this.journey.encrypted&&!this.journey.isReady())throw new hu("Failed to restore encryption context after redirection",Yd.InvalidState);return this.correlationId=i.correlationId,r}async getInternalHeaders(){const e=[];this.journey&&e.push(...this.journey.getInternalHeaders()),this.correlationId&&e.push({type:"correlation_id",correlation_id:this.correlationId});const t=await this.getDeviceHeader();return t&&e.push(t),e}async getDeviceHeader(){var e,t;try{const i=Wd.crypto.createCryptoBinding("sign"),{keyIdentifier:r,publicKey:n}=null!==(e=await i.getPublicData())&&void 0!==e?e:{};return r&&n?{type:"device",device:{device_key_id:r,device_public_key:n,device_type:"web",device_os:navigator.platform.toLowerCase(),device_os_version:(null===(t=navigator.userAgent.match(/(?:Version|Edge|Chrome|Firefox|Safari)\/(\d+\.\d+)/))||void 0===t?void 0:t[1])||"unknown",device_manufacturer:navigator.vendor||"unknown",device_model:navigator.platform||"unknown"}}:null}catch(e){return tu.error("Failed to create device header"),null}}getQueryParams(){var e,t;const r=i({aid:"default_application",clientId:this.clientId,locale:window.navigator.language||"en-US"},this.journey?this.journey.getQueryParams():{});return(null===(e=this.journey)||void 0===e?void 0:e.deviceId)&&(r.did=this.journey.deviceId),(null===(t=this.journey)||void 0===t?void 0:t.sessionId)&&(r.sid=this.journey.sessionId),this.resource&&(r.resource=this.resource),this.locale&&(r.locale=this.locale),r}async invokeJourney(e){var t,i,r;this.journey=e;const n=await this.getInternalHeaders(),a={data:e.getInvocationData(),headers:n};try{const e=await(null===(i=null===(t=null===window||void 0===window?void 0:window.tsPlatform)||void 0===t?void 0:t.drs)||void 0===i?void 0:i.getSessionToken());e&&a.headers.push(this.buildDrsSessionTokenSdkHeader(e))}catch(e){tu.warning(`Could not obtain DRS session token: ${e}`)}try{const t=await(null===(r=this.api)||void 0===r?void 0:r.sendRequest(e.getInvocationPath(),this.getQueryParams(),a,this.journey));if(!t)throw new Sp;return e.userId=this.getIdentifier(t,"uid"),e.sessionId=this.getIdentifier(t,"session_id"),e.deviceId=this.getIdentifier(t,"device_id"),e.active(),this.handleServiceResponse(t)}catch(e){throw this.rejectJourney(),e}}buildDrsSessionTokenSdkHeader(e){return{type:"drs_session_token",drs_session_token:{token:e}}}handleJourneyState(e){switch(e){case fu.TextRejection:case fu.JsonRejection:this.rejectJourney();break;case fu.JourneyEnd:this.completeJourney();break;case fu.NextAction:case fu.UpdateAction:break;default:throw Error(`Unhandled service response state: ${e}`)}}completeJourney(){var e;null===(e=this.journey)||void 0===e||e.complete()}rejectJourney(){var e;null===(e=this.journey)||void 0===e||e.reject()}async generateDebugPin(){var e;if(!this.journey)throw new hu("Error occurred while trying to generate debug pin since no journey is active",Yd.NoActiveJourney);const t=await this.getInternalHeaders(),i=await(null===(e=this.api)||void 0===e?void 0:e.sendRequest(cu.path,this.getQueryParams(),{headers:t,data:{}},this.journey));if(!i)throw new Sp;return i.data.debug_pin}};Wd.events.on(Wd.events.MODULE_INITIALIZED,(async()=>{var e;const t=Wd.moduleMetadata.getInitConfig();if(!(null===(e=null==t?void 0:t.ido)||void 0===e?void 0:e.serverPath))return;const{clientId:i,ido:r}=t;await Ip.init(i,r)})),function(){var e,t;const i="undefined"!=typeof window&&"undefined"!=typeof document;if("undefined"!=typeof globalThis&&void 0!==globalThis.process&&(null===(t=null===(e=globalThis.process)||void 0===e?void 0:e.versions)||void 0===t?void 0:t.node)&&!i)throw new Error("\n🚫 @TransmitSecurity/web-sdk is a BROWSER-ONLY package.\n\n❌ Node.js environments are not supported.\n✅ Use this package in web browsers only.\n\nFor more information, visit: https://github.com/transmitsecurity-dev/ciam-web-sdk#browser-only\n");i||console.warn("⚠️ @TransmitSecurity/web-sdk: Browser environment not detected. Some features may not work correctly.")}();const Dp={drs:la,idv:sd};var Tp=new class{constructor(){this.factories=Dp,Object.assign(this,la),Object.assign(this,sd)}};return e.PACKAGE_VERSION="1.16.2",e.default=Tp,e.drs=la,e.ido=Ip,e.idv=sd,e.initialize=m,e.webauthn=Gd,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
|
|
3
|
+
!function(e){!function(){function t(e){return parseInt(e)===e}function r(e){if(!t(e.length))return!1;for(var r=0;r<e.length;r++)if(!t(e[r])||e[r]<0||e[r]>255)return!1;return!0}function n(e,n){if(e.buffer&&"Uint8Array"===e.name)return n&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!r(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(t(e.length)&&r(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function i(e){return new Uint8Array(e)}function o(e,t,r,n,i){null==n&&null==i||(e=e.slice?e.slice(n,i):Array.prototype.slice.call(e,n,i)),t.set(e,r)}var a,s={toBytes:function(e){var t=[],r=0;for(e=encodeURI(e);r<e.length;){var i=e.charCodeAt(r++);37===i?(t.push(parseInt(e.substr(r,2),16)),r+=2):t.push(i)}return n(t)},fromBytes:function(e){for(var t=[],r=0;r<e.length;){var n=e[r];n<128?(t.push(String.fromCharCode(n)),r++):n>191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}},u=(a="0123456789abcdef",{toBytes:function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},fromBytes:function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];t.push(a[(240&n)>>4]+a[15&n])}return t.join("")}}),c={16:10,24:12,32:14},l=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],d=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],h=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],f=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],p=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],g=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],m=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],y=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],v=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],b=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],w=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],_=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],A=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],E=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],C=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function x(e){for(var t=[],r=0;r<e.length;r+=4)t.push(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]);return t}var S=function(e){if(!(this instanceof S))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:n(e,!0)}),this._prepare()};S.prototype._prepare=function(){var e=c[this.key.length];if(null==e)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var t=0;t<=e;t++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var r,n=4*(e+1),i=this.key.length/4,o=x(this.key);for(t=0;t<i;t++)r=t>>2,this._Ke[r][t%4]=o[t],this._Kd[e-r][t%4]=o[t];for(var a,s=0,u=i;u<n;){if(a=o[i-1],o[0]^=d[a>>16&255]<<24^d[a>>8&255]<<16^d[255&a]<<8^d[a>>24&255]^l[s]<<24,s+=1,8!=i)for(t=1;t<i;t++)o[t]^=o[t-1];else{for(t=1;t<i/2;t++)o[t]^=o[t-1];a=o[i/2-1],o[i/2]^=d[255&a]^d[a>>8&255]<<8^d[a>>16&255]<<16^d[a>>24&255]<<24;for(t=i/2+1;t<i;t++)o[t]^=o[t-1]}for(t=0;t<i&&u<n;)h=u>>2,f=u%4,this._Ke[h][f]=o[t],this._Kd[e-h][f]=o[t++],u++}for(var h=1;h<e;h++)for(var f=0;f<4;f++)a=this._Kd[h][f],this._Kd[h][f]=_[a>>24&255]^A[a>>16&255]^E[a>>8&255]^C[255&a]},S.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,r=[0,0,0,0],n=x(e),o=0;o<4;o++)n[o]^=this._Ke[0][o];for(var a=1;a<t;a++){for(o=0;o<4;o++)r[o]=f[n[o]>>24&255]^p[n[(o+1)%4]>>16&255]^g[n[(o+2)%4]>>8&255]^m[255&n[(o+3)%4]]^this._Ke[a][o];n=r.slice()}var s,u=i(16);for(o=0;o<4;o++)s=this._Ke[t][o],u[4*o]=255&(d[n[o]>>24&255]^s>>24),u[4*o+1]=255&(d[n[(o+1)%4]>>16&255]^s>>16),u[4*o+2]=255&(d[n[(o+2)%4]>>8&255]^s>>8),u[4*o+3]=255&(d[255&n[(o+3)%4]]^s);return u},S.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,r=[0,0,0,0],n=x(e),o=0;o<4;o++)n[o]^=this._Kd[0][o];for(var a=1;a<t;a++){for(o=0;o<4;o++)r[o]=y[n[o]>>24&255]^v[n[(o+3)%4]>>16&255]^b[n[(o+2)%4]>>8&255]^w[255&n[(o+1)%4]]^this._Kd[a][o];n=r.slice()}var s,u=i(16);for(o=0;o<4;o++)s=this._Kd[t][o],u[4*o]=255&(h[n[o]>>24&255]^s>>24),u[4*o+1]=255&(h[n[(o+3)%4]>>16&255]^s>>16),u[4*o+2]=255&(h[n[(o+2)%4]>>8&255]^s>>8),u[4*o+3]=255&(h[255&n[(o+1)%4]]^s);return u};var I=function(e){if(!(this instanceof I))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new S(e)};I.prototype.encrypt=function(e){if((e=n(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=i(e.length),r=i(16),a=0;a<e.length;a+=16)o(e,r,0,a,a+16),o(r=this._aes.encrypt(r),t,a);return t},I.prototype.decrypt=function(e){if((e=n(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=i(e.length),r=i(16),a=0;a<e.length;a+=16)o(e,r,0,a,a+16),o(r=this._aes.decrypt(r),t,a);return t};var T=function(e,t){if(!(this instanceof T))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else t=i(16);this._lastCipherblock=n(t,!0),this._aes=new S(e)};T.prototype.encrypt=function(e){if((e=n(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=i(e.length),r=i(16),a=0;a<e.length;a+=16){o(e,r,0,a,a+16);for(var s=0;s<16;s++)r[s]^=this._lastCipherblock[s];this._lastCipherblock=this._aes.encrypt(r),o(this._lastCipherblock,t,a)}return t},T.prototype.decrypt=function(e){if((e=n(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=i(e.length),r=i(16),a=0;a<e.length;a+=16){o(e,r,0,a,a+16),r=this._aes.decrypt(r);for(var s=0;s<16;s++)t[a+s]=r[s]^this._lastCipherblock[s];o(e,this._lastCipherblock,0,a,a+16)}return t};var M=function(e,t,r){if(!(this instanceof M))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 size)")}else t=i(16);r||(r=1),this.segmentSize=r,this._shiftRegister=n(t,!0),this._aes=new S(e)};M.prototype.encrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var t,r=n(e,!0),i=0;i<r.length;i+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var a=0;a<this.segmentSize;a++)r[i+a]^=t[a];o(this._shiftRegister,this._shiftRegister,0,this.segmentSize),o(r,this._shiftRegister,16-this.segmentSize,i,i+this.segmentSize)}return r},M.prototype.decrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var t,r=n(e,!0),i=0;i<r.length;i+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var a=0;a<this.segmentSize;a++)r[i+a]^=t[a];o(this._shiftRegister,this._shiftRegister,0,this.segmentSize),o(e,this._shiftRegister,16-this.segmentSize,i,i+this.segmentSize)}return r};var D=function(e,t){if(!(this instanceof D))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else t=i(16);this._lastPrecipher=n(t,!0),this._lastPrecipherIndex=16,this._aes=new S(e)};D.prototype.encrypt=function(e){for(var t=n(e,!0),r=0;r<t.length;r++)16===this._lastPrecipherIndex&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),t[r]^=this._lastPrecipher[this._lastPrecipherIndex++];return t},D.prototype.decrypt=D.prototype.encrypt;var R=function(e){if(!(this instanceof R))throw Error("Counter must be instanitated with `new`");0===e||e||(e=1),"number"==typeof e?(this._counter=i(16),this.setValue(e)):this.setBytes(e)};R.prototype.setValue=function(e){if("number"!=typeof e||parseInt(e)!=e)throw new Error("invalid counter value (must be an integer)");if(e>Number.MAX_SAFE_INTEGER)throw new Error("integer value out of safe range");for(var t=15;t>=0;--t)this._counter[t]=e%256,e=parseInt(e/256)},R.prototype.setBytes=function(e){if(16!=(e=n(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},R.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var O=function(e,t){if(!(this instanceof O))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",t instanceof R||(t=new R(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new S(e)};O.prototype.encrypt=function(e){for(var t=n(e,!0),r=0;r<t.length;r++)16===this._remainingCounterIndex&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),t[r]^=this._remainingCounter[this._remainingCounterIndex++];return t},O.prototype.decrypt=O.prototype.encrypt;var k={AES:S,Counter:R,ModeOfOperation:{ecb:I,cbc:T,cfb:M,ofb:D,ctr:O},utils:{hex:u,utf8:s},padding:{pkcs7:{pad:function(e){var t=16-(e=n(e,!0)).length%16,r=i(e.length+t);o(e,r);for(var a=e.length;a<r.length;a++)r[a]=t;return r},strip:function(e){if((e=n(e,!0)).length<16)throw new Error("PKCS#7 invalid length");var t=e[e.length-1];if(t>16)throw new Error("PKCS#7 padding byte out of range");for(var r=e.length-t,a=0;a<t;a++)if(e[r+a]!==t)throw new Error("PKCS#7 invalid padding byte");var s=i(r);return o(e,s,0,0,r),s}}},_arrayTest:{coerceArray:n,createArray:i,copyArray:o}};e.exports=k}()}(z_);class U_{getExchangeRequestHeader(){if(!this.kp){const e={entropy:this.generateRandomHexString(192),entropyEnc:"hex"};this.kp=this.ec.genKeyPair(e)}return{type:"key_exchange",scheme:3,y:this.jsArrayToBase64(this.kp.getPublic().encode("array",!1))}}async processExchangeResponseHeader(e){if(e.scheme!=this.scheme)throw"Unsupported crypto scheme "+e.scheme;this.sessionId=e.crypto_session_id;const t=this.kp.derive(this.ec.keyFromPublic(atob(e.y)).getPublic()).toArray("be",32),r=new Uint8Array(t),n=await crypto.subtle.digest("SHA-256",r);this.aesKey=Array.from(new Uint8Array(n))}isReady(){return!(!this.aesKey||!this.sessionId)}decryptResponse(e){let t=null;if(e.headers.forEach(function(e){"encryption"==e.type&&(t=e)}),t){const r=this.base64ToJsArray(t.iv),n=new L_.ModeOfOperation.cbc(this.aesKey,r),i=this.base64ToJsArray(e.data),o=n.decrypt(i);let a=L_.utils.utf8.fromBytes(o);a=this.pkcs7Unpad(a),e.data=JSON.parse(a)}return e}encryptRequest(e){const t=this.generateRandomHexString(32),r=L_.utils.hex.toBytes(t),n={type:"encryption",iv:this.hexToBase64(t),crypto_session_id:this.sessionId},i=e.headers.map(e=>this.encryptStringToBase64(JSON.stringify(e),r)),o=JSON.stringify(e.data),a=this.encryptStringToBase64(o,r);e.headers=[n],e.enc_headers=i,e.data=a}encryptStringToBase64(e,t){const r=new L_.ModeOfOperation.cbc(this.aesKey,t),n=L_.utils.utf8.toBytes(e),i=this.pkcs7Pad(n),o=[...r.encrypt(i)];return this.jsArrayToBase64(o)}toJson(){return{scheme:3,session_id:this.sessionId,key:this.jsArrayToBase64(this.aesKey)}}static fromJson(e){return new U_(e)}jsArrayToBase64(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}base64ToJsArray(e){const t=atob(e),r=[];for(let e=0;e<t.length;e++)r.push(t.charCodeAt(e));return r}pkcs7Pad(e){const t=16-e.length%16,r=new Uint8Array(e.length+t);r.set(e,0);for(let n=0;n<t;n++)r[e.length+n]=t;return r}pkcs7Unpad(e){try{const t=e.charCodeAt(e.length-1);if(t<1||t>16)throw new q_(`Invalid padding length: ${t}`);if(e.length<t)throw new q_("Input string shorter than padding length");for(let r=1;r<=t;r++){if(e.charCodeAt(e.length-r)!==t)throw new q_("Invalid padding values")}return e.slice(0,-t)}catch(e){if(e instanceof q_)throw e;throw new q_(`Failed to unpad data: ${e instanceof Error?e.message:String(e)}`)}}constructor(e){if(this.scheme=3,this.ecCurveName="p256",this.ec=new Lm.ec(this.ecCurveName),e&&(this.sessionId=e.session_id,this.aesKey=this.base64ToJsArray(e.key),!this.isReady()))throw new Error("Internal: Can't deserialize crypto session")}generateRandomHexString(e){const t=new Uint8Array(e);crypto.getRandomValues(t);let r="";const n=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];for(let e=0;e<t.length;e++){r+=n[15&t[e]]}return r}hexToBase64(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";let r=0,n=0,i="";for(let o=0;o<e.length;o++)if(r=(r<<4)+parseInt(e[o],16),n+=4,n>=6){i+=t[r>>n-6],n-=6,r&=255>>8-n}if(n){i+=t[r<<6-n]}for(;i.length%4;)i+="=";return i}}class j_{constructor(e,t){this.encrypted=e,this.cryptoSession=t}isReady(){var e;return(null===(e=this.cryptoSession)||void 0===e?void 0:e.isReady())||!1}async exchangeKeyAndEncryptRequest(e,t,r,n,i,o){if(!t.isReady()){const r=["aid","clientId"],i=new URLSearchParams(Array.from(n.searchParams.entries()).filter(e=>{let[t,n]=e;return r.includes(t)}));await t.performKeyExchange(e,i)}return t.promisePossiblyEncryptedTransportRequest(new G_(r,n,i.data,i.headers,o))}async performKeyExchange(e,t){const r={r:"Hello Encrypted World"},i=new URL(e+Rm.path+"?"+t.toString()),o=new G_("POST",i,r,[],{"Content-Type":"application/json"}),a=this.promisePossiblyEncryptedTransportRequest(o);let s;const u=await fetch(a.url.toString(),{body:JSON.stringify(null==a?void 0:a.body),method:"POST",headers:a.headers,credentials:"include"});if(!u.ok)throw new Error("Request failed");let c;s=n(n({data:await u.json()},u),{},{headers:u.headers});try{c=s.data}catch(e){throw new Error(`Unsupported resposne format: ${e}`)}await this.postprocessResponse(c),c=this.possiblyDecryptResponse(c);const l=c.data;if(JSON.stringify(l)!==JSON.stringify(r))throw new Error("Key exchange failed");return Promise.resolve()}async postprocessResponse(e){var t;if(e.headers){const r=e.headers.find(e=>"key_exchange"==e.type);if(r)return null===(t=this.cryptoSession)||void 0===t?void 0:t.processExchangeResponseHeader(r)}}promisePossiblyEncryptedTransportRequest(e){const t={headers:e.envelopeHeaders,data:e.body};return this.encryptEnvelopedMessageIfNeeded(t),new V_(e.url.toString(),e.method,t,void 0,e.httpHeaders)}possiblyDecryptResponse(e){return this.cryptoSession&&(e=this.cryptoSession.decryptResponse(e)),e}encryptEnvelopedMessageIfNeeded(e){var t;const r=this.generateKeyExchangeHeaderIfNeeded();(null===(t=this.cryptoSession)||void 0===t?void 0:t.isReady())&&this.cryptoSession.encryptRequest(e),r&&e.headers.push(r)}generateKeyExchangeHeaderIfNeeded(){return this.encrypted&&!this.cryptoSession?(this.cryptoSession=new U_,this.cryptoSession.getExchangeRequestHeader()):null}}class V_{constructor(e,t,r,n,i){this.url=e,this.httpMethod=t,this.body=r,this.params=n,this.headers=i}}class H_{addEnvelopeHeader(e){this._envelopeHeaders.push(e)}get method(){return this._requestMethod}get url(){return this._url}get body(){return this._requestBody}get envelopeHeaders(){return this._envelopeHeaders}get httpHeaders(){return this._httpHeaders}constructor(e,t,r,n,i){if(!t||!r)throw new Error("Internal - Invalid arguments for constructing session message");this._requestMethod=e,this._url=t,this._requestBody=r,this._envelopeHeaders=n||[],this._httpHeaders=i}}class G_ extends H_{static from(e,t,r,n){return new G_(e,t,r.data,r.headers,n)}}class q_ extends Error{constructor(e){super(e),this.name="PaddingError",Object.setPrototypeOf(this,q_.prototype)}}class W_{constructor(e){this.urlBaseString=e+"/"+xm}convertHttpResponseToRawServiceResponse(e){const{status:t,statusText:r,body:n}=e;return this.rawFrom(t,r,n)}rawFrom(e,t,r){const{error_code:n,error_message:i,headers:o,data:a}=r;return{status:e,statusText:t,error_code:n,error_message:i,headers:o,data:this.buildAggregatedData(a)}}buildAggregatedData(e){switch(null==e?void 0:e.state){case Bm.Pending:km.forEach(t=>{const[[r,i]]=Object.entries(t),o=((e,t,r)=>{if(!e||"object"!=typeof e)return r;const n=Array.isArray(t)?t:t.split(".");let i=e;for(let e=0;e<n.length;e++)if(i=i[n[e]],void 0===i)return r;return i})(e,r);if(o){const t={};i.forEach(e=>{e in o&&(t[e]=o[e])}),e=n(n({},e),t)}});break;case Bm.Rejected:e.type=Fm.Rejection}return e}async sendRequest(e,t,r,i){if(!(this.urlBaseString.toString().length>7&&e))throw new Error("bad input");const o=new URL(this.urlBaseString);o.pathname+=e,Em.debug(`Got Full URL: ${o.toString()}`),Object.keys(t).map(e=>o.searchParams.append(e,t[e])),Em.debug(`Request body: ${r}`);let a=new V_(o.toString(),"POST",r,o.searchParams,{"Content-type":"application/json;charset=UTF-8"});try{i.encrypted&&(a=await i.exchangeKeyAndEncryptRequest(this.urlBaseString,i,a.httpMethod,new URL(a.url),a.body,a.headers));const e=await fetch(a.url.toString(),{body:JSON.stringify(a.body),method:"POST",headers:a.headers,credentials:"include"});let t;const r=await e.json();if(i.encrypted){const e=r;i.postprocessResponse(e),t=i.possiblyDecryptResponse(e)}else t=r;return this.convertHttpResponseToRawServiceResponse(n(n({},e),{},{body:t}))}catch(e){throw new Nm("Error occurred while retrieving response from server",vm.NetworkError)}}}!function(e){e.Active="Active",e.Success="Journey Ended with Success",e.Rejected="Journey Ended with Rejection",e.Aborted="Journey aborted by client"}(B_||(B_={})),function(e){e.ClientSdk="Client SDK Journey",e.SSO="SSO Journey"}(F_||(F_={}));class K_ extends j_{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;super(n,i),this.journeyType=e,this.sdkData=t,this.additionalParams=r,this.encrypted=n,this.cryptoSession=i,this.state=B_.Active}getQueryParams(){let e={};return this.deviceId&&(e.did=this.deviceId),this.sessionId&&(e.sid=this.sessionId),e}getInternalHeaders(){const e=[];return this.userId&&e.push({type:"uid",uid:this.userId}),e}toJson(){var e;return{journeyType:this.journeyType,challenge:this.challenge,assertionId:this.assertionId,userId:this.userId,sessionId:this.sessionId,deviceId:this.deviceId,actionType:this.actionType,additionalParams:this.additionalParams,sdkData:this.sdkData,encrypted:this.encrypted,cryptoSession:null===(e=this.cryptoSession)||void 0===e?void 0:e.toJson()}}getInvocationData(){const e=Om.data.dummy;return this.additionalParams&&Object.keys(this.additionalParams).length>0&&(e.params=this.additionalParams),this.sdkData&&Object.keys(this.sdkData).length>0&&(e.sdk_data=this.sdkData),e}complete(){if(this.isCompletedState())throw Error(`Cannot complete an already completed journey. Current state: ${this.state.toString()}`);this.challenge=void 0,this.state=B_.Success,this.cryptoSession=void 0}reject(){if(this.isCompletedState())throw Error(`Cannot reject an already completed journey. Current state: ${this.state.toString()}`);this.challenge=void 0,this.state=B_.Rejected,this.cryptoSession=void 0}abort(){if(this.isCompletedState())throw Error(`Cannot abort an already completed journey. Current state: ${this.state.toString()}`);this.challenge=void 0,this.state=B_.Aborted,this.cryptoSession=void 0}active(){if(this.isCompletedState())throw Error(`Cannot run a completed journey. Current state: ${this.state.toString()}`);this.state=B_.Active}isCompletedState(){return this.state===B_.Success||this.state===B_.Rejected||this.state===B_.Aborted}}class X_ extends K_{constructor(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4?arguments[4]:void 0;if(super(F_.ClientSdk,t,r,n,i),this.journeyId=e,!this.journeyId)throw Error("Journey ID must be provided")}getInvocationData(){const e=super.getInvocationData();return e.policy_request_id=this.journeyId,e}getInvocationPath(){return Im.path}toJson(){return n(n({},super.toJson()),{},{journeyId:this.journeyId})}}class Y_ extends K_{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3?arguments[3]:void 0;super(F_.SSO,t,{},r,n),this.interactionId=e}getInvocationPath(){return Sm.path}getQueryParams(){return n(n({},super.getQueryParams()),{},{ssoInteractionId:this.interactionId})}toJson(){return n(n({},super.toJson()),{},{interactionId:this.interactionId})}}const Z_=["assertion_id","type","escapes","form_id","vendor_name"],J_=[...Z_,"challenge","assertion_error_code","assertion_error_message","assertions_complete","state","control_flow","rejection_data"],$_={[bm.Cancel]:bm.Cancel,[bm.Fail]:bm.Fail},Q_=["data"],eA=["json_data"];class tA{constructor(e){var t,r,n;this.rawResponse=e;const[{escapes:i,form_id:o}]=null!==(r=null===(t=e.data)||void 0===t?void 0:t.control_flow)&&void 0!==r?r:[{}];this.escapes=i,this.data=null!==(n=e.data)&&void 0!==n?n:{},this.formId=o}generateServiceResponse(e,t){var r,i;const o=this.getType(),a=this.getJourneyStepId(e);return n(n({type:o,journeyStepId:a,errorData:this.getErrorData(),data:this.getData(a),clientResponseOptions:this.getClientResponseActions()},t),{},{redirectUrl:null===(i=null===(r=this.data)||void 0===r?void 0:r.data)||void 0===i?void 0:i.url})}getActionType(){return this.data.type}getChallenge(){return this.data.challenge}getAssertionId(){return this.data.assertion_id}getJourneyState(){var e,t,r;let n;if((null===(e=this.rawResponse)||void 0===e?void 0:e.status)>=400)n=Pm.TextRejection;else switch(this.data.state){case Bm.Completed:n=Pm.JourneyEnd;break;case Bm.Rejected:n=Pm.JsonRejection;break;case Bm.Pending:n=(null===(r=null===(t=this.rawResponse)||void 0===t?void 0:t.data)||void 0===r?void 0:r.control_flow)?Pm.NextAction:Pm.UpdateAction;break;default:n=Pm.JsonRejection}return n}getType(){let e=wm.JourneyRejection;return this.data.assertions_complete?e=wm.JourneySuccess:this.data.state===Bm.Pending?e=wm.ClientInputRequired:16==this.data.assertion_error_code?e=wm.ClientInputUpdateRequired:4001===this.rawResponse.error_code&&(e=wm.JourneyRejection),e}getData(e){var t,r;const[o]=null!==(t=this.data.control_flow)&&void 0!==t?t:[{}],a=null!==(r=this.data)&&void 0!==r?r:{},{data:s}=a,u=i(a,Q_),c=null!=s?s:{},{json_data:l}=c,d=i(c,eA);return this.removeFields(o,Z_),this.data=n(n(n(n(n({},u),o),l&&{json_data:l}),Object.keys(d).length&&{data:d}),this.rejectionReason&&{rejectionReason:this.rejectionReason}),this.removeFields(this.data,J_),this.manipulateDataForJourneyStep(e),this.data}manipulateDataForJourneyStep(e){e===_m.InvokeIDP&&(this.data.authorization_url=this.generateAuthorizationUrlFromResponseData(this.data),delete this.data.authorization_parameters,delete this.data.authorization_endpoint)}generateAuthorizationUrlFromResponseData(e){const{authorization_endpoint:t,authorization_parameters:r}=e,n=Object.keys(r).map(e=>{const t=r[e]instanceof Object?JSON.stringify(r[e]):r[e];return`${e}=${encodeURIComponent(t)}`}).join("&"),i=new URL(t);return i.search=n,i}getErrorData(){if(this.data.assertion_error_code&&0!=this.data.assertion_error_code){const e=Nm.convertFromAssertionError(this.data.assertion_error_code);return new Nm(this.data.assertion_error_message,e)}}removeFields(e,t){for(const r of t)r in e&&delete e[r]}getJourneyStepId(e){const t=this.getType();if(t===wm.JourneyRejection)return this.rejectionReason=this.rawResponse.error_message,_m.Rejection;if(t===wm.JourneySuccess)return _m.Success;switch(e){case Fm.Form:case Fm.LoginForm:return this.formIdToStepId()||this.formId||e;case Fm.Information:return _m.Information;case Fm.DebugBreak:return _m.DebugBreak;case Fm.WaitForTicket:return _m.WaitForAnotherDevice;case Fm.Rejection:return _m.Rejection;case Fm.DrsTriggerAction:return _m.DrsTriggerAction;case Fm.IdentityVerification:return _m.IdentityVerification;case Fm.WebAuthnRegistration:return _m.WebAuthnRegistration;default:return e||""}}formIdToStepId(){return this.formId}getClientResponseActions(){var e;const t={[bm.ClientInput]:{type:bm.ClientInput,id:"client_input",label:"Client Input"}};return null===(e=this.escapes)||void 0===e||e.forEach(e=>{let{id:r,display_name:i,schema:o}=e;var a;const s=null!==(a=$_[r])&&void 0!==a?a:bm.Custom;t[r]=n({type:s,id:r,label:i||r},o&&{schema:o})}),t}}class rA extends Error{constructor(){super("Missing response data")}}class nA extends Error{constructor(e,t){super("Action of type "+e+" cannot have response from type "+t)}}const iA=new M("ido","sdkDataDB",1);async function oA(e){try{return await iA.get("sdkDataStore",e)}catch(e){console.error("Error retrieving SDK data:",e)}}const aA=new class{constructor(){this.correlationId="",this.getIdentifier=(e,t)=>{var r;const n=null===(r=e.headers.find(e=>t in e))||void 0===r?void 0:r[t];return Em.debug(`Getting identifier ${t} from response, value: ${n}`),n}}async init(e,t){if(!e||!t)throw new Nm("Invalid initialization configuration",vm.InvalidInitOptions);const{serverPath:r,logLevel:n,pollingTimeout:i,resource:o,locale:a}=t;if(!r)throw new Nm("Invalid initialization options",vm.InvalidInitOptions);Em.setLogLevel(null!=n?n:ym.Info),this.pollingTimeout=null!=i?i:3,this.clientId=e,o&&(this.resource=o),a&&(this.locale=a),this.serverPath=r,this.api=new W_(this.serverPath),Em.info("IdoSdk initialized successfully")}async startJourney(e,t){var r,n;const{additionalParams:i,correlationId:o}=null!=t?t:{};this.correlationId=null!=o?o:crypto.randomUUID();const a=await oA("sdk_data"),s=(null===(r=this.journey)||void 0===r?void 0:r.encrypted)||(null==t?void 0:t.encrypted)||!1,u=(null===(n=this.journey)||void 0===n?void 0:n.isReady())?this.journey.cryptoSession:void 0,c=new X_(e,a,i,s,u);return this.invokeJourney(c)}async startSsoJourney(e,t){var r,n;this.correlationId=e;const i=await oA("sdk_data"),o=(null===(r=this.journey)||void 0===r?void 0:r.encrypted)||(null==t?void 0:t.encrypted)||!1,a=(null===(n=this.journey)||void 0===n?void 0:n.isReady())?this.journey.cryptoSession:void 0,s=new Y_(e,i,o,a);return this.invokeJourney(s)}async submitClientResponse(e,t){var r,n,i,o,a,s,u;if(!this.journey)throw new Nm("Error occurred while trying to submit client response since no journey is active",vm.NoActiveJourney);const c={assertion_id:null===(r=this.journey)||void 0===r?void 0:r.assertionId,action:null===(n=this.journey)||void 0===n?void 0:n.actionType,assert:"action",input:t};if((null==t?void 0:t.fch)||(c.fch=null===(i=this.journey)||void 0===i?void 0:i.challenge),e===bm.ClientInput)switch(null===(o=this.lastServiceResponse)||void 0===o?void 0:o.journeyStepId){case _m.CryptoBindingRegistration:case _m.RegisterDeviceAction:case _m.CryptoBindingValidation:case _m.ValidateDeviceAction:await this.handleCryptoBindingStep(c);break;case _m.WaitForAnotherDevice:return await this.handleWaitForAnotherDeviceAction(c);case _m.DrsTriggerAction:case _m.IdentityVerification:case _m.WebAuthnRegistration:case _m.SmsOTPAuthentication:case _m.EmailOTPAuthentication:case _m.EmailValidation:case _m.SmsValidation:case _m.WebAuthnTransactionSigning:case _m.SelectOrganization:this.handleDataAction(c,t);break;case _m.TotpRegistration:this.handleDataAction(c,{});break;case _m.InvokeIDP:case _m.MobileApproveAuthentication:this.handleDataAction(c,t)}else if(e===bm.Resend)switch(null===(a=this.lastServiceResponse)||void 0===a?void 0:a.journeyStepId){case _m.SmsOTPAuthentication:case _m.EmailOTPAuthentication:case _m.EmailValidation:case _m.SmsValidation:case _m.MobileApproveAuthentication:this.handleResendAssertion(c);break;default:throw new nA(null===(s=this.lastServiceResponse)||void 0===s?void 0:s.journeyStepId,e)}else bm.Cancel,this.handleClientResponseOption(e,t,c);try{let e={headers:await this.getInternalHeaders(),data:c};const t=await(null===(u=this.api)||void 0===u?void 0:u.sendRequest(Tm.path,this.getQueryParams(),e,this.journey));if(!t)throw new rA;return await this.handleServiceResponse(t)}catch(e){throw this.rejectJourney(),e}}handleClientResponseOption(e,t,r){delete r.input,r.assert="escape",r.data={escape_id:e,escape_params:t}}handleResendAssertion(e){delete e.input,delete e.data,e.assert="resend"}async handleCryptoBindingStep(e){const t=mm.crypto.createCryptoBinding("sign"),r=await this.handleCryptoBindingFieldValue(t);this.handleCryptoBindingActionPayload(e,r)}handleCryptoBindingActionPayload(e,t){const r=Cm[this.lastServiceResponse.journeyStepId];e[r]=n(n({},e[r]),{},{[Am]:t})}handleDataAction(e,t){delete e.input,e.assert="data",e.data=t}async handleCryptoBindingFieldValue(e){var t,r,n,i,o,a,s,u,c;switch(null===(t=this.lastServiceResponse)||void 0===t?void 0:t.journeyStepId){case _m.CryptoBindingRegistration:case _m.RegisterDeviceAction:const{keyIdentifier:t,publicKey:l}=null!==(r=await e.getPublicData())&&void 0!==r?r:{};return{platform_device_id:t,platform_device_key:l};case _m.CryptoBindingValidation:case _m.ValidateDeviceAction:const{keyIdentifier:d}=null!==(n=await e.getPublicData())&&void 0!==n?n:{};return{platform_device_id:d,signature:await e.sign(null!==(s=null===(a=null===(o=null===(i=this.lastServiceResponse)||void 0===i?void 0:i.data)||void 0===o?void 0:o.app_data)||void 0===a?void 0:a.challenge)&&void 0!==s?s:null===(c=null===(u=this.lastServiceResponse)||void 0===u?void 0:u.data)||void 0===c?void 0:c.device_challenge)}}}async handleWaitForAnotherDeviceAction(e){var t,r,n,i;const o=await this.getInternalHeaders(),a=await(null===(t=this.api)||void 0===t?void 0:t.sendRequest(Mm.path,this.getQueryParams(),{headers:o,data:{polling_timeout:this.pollingTimeout,ticket_id:null===(r=this.lastServiceResponse)||void 0===r?void 0:r.data.raw_ticket_id,type:"ticket"}},this.journey));if(!0===(null===(n=null==a?void 0:a.data)||void 0===n?void 0:n.change_detected)){const t=await(null===(i=this.api)||void 0===i?void 0:i.sendRequest(Tm.path,this.getQueryParams(),{headers:o,data:e},this.journey));if(!t)throw new rA;return this.handleServiceResponse(t)}return this.lastServiceResponse}async handleServiceResponse(e){var t,r,i,o,a,s;const u=new tA(e),c=u.getJourneyState();this.handleJourneyState(c),(null===(r=null===(t=e.data)||void 0===t?void 0:t.data)||void 0===r?void 0:r.sdk_data)&&(await async function(e,t){try{const r=n(n({},await oA(e)),t);await iA.put("sdkDataStore",e,r)}catch(e){console.error("Error saving SDK data:",e)}}("sdk_data",e.data.data.sdk_data),delete e.data.data.sdk_data),this.journey.assertionId=null!==(i=u.getAssertionId())&&void 0!==i?i:this.journey.assertionId,this.journey.actionType=null!==(o=u.getActionType())&&void 0!==o?o:this.journey.actionType,this.journey.challenge=null!==(a=u.getChallenge())&&void 0!==a?a:this.journey.challenge;const{clientResponseOptions:l,data:d}=null!==(s=this.lastServiceResponse)&&void 0!==s?s:{},h=c===Pm.UpdateAction?{clientResponseOptions:l,data:d}:{};let f=u.generateServiceResponse(this.journey.actionType,h);switch(this.lastServiceResponse=f,f.journeyStepId){case _m.ValidateDeviceAction:case _m.RegisterDeviceAction:if(c!==Pm.NextAction)throw new Error(`Journey rejected on ${f.journeyStepId} device action, with ${f.errorData}`);f=await this.submitClientResponse(bm.ClientInput,f.data);break;default:this.handleJourneySuccess(f)}return f}handleJourneySuccess(e){var t,r;null===(r=null===(t=e.data)||void 0===t?void 0:t.data)||void 0===r||r.url,e.type===wm.JourneySuccess&&(e.token=e.data.token,delete e.data.token)}serializeState(){if(!this.lastServiceResponse||!this.journey)throw new Nm("Error occurred while trying to serialize state since no journey is active",vm.NoActiveJourney);return btoa(encodeURIComponent(JSON.stringify({journey:this.journey.toJson(),serviceResponse:this.lastServiceResponse})))}restoreFromSerializedState(e){var t;const{journey:r,serviceResponse:n}=JSON.parse(decodeURIComponent(null!==(t=atob(e))&&void 0!==t?t:{}));if(!r||!n)throw new Nm("Invalid serialized state",vm.InvalidState);if(this.lastServiceResponse=n,this.journey=function(e){let t,r;switch(e.cryptoSession&&(r=U_.fromJson(e.cryptoSession)),e.journeyType){case F_.ClientSdk:t=new X_(e.journeyId,e.sdkData,e.additionalParams,e.encrypted,r);break;case F_.SSO:t=new Y_(e.interactionId,e.sdkData,e.encrypted,r);break;default:throw Error(`error when trying to deserialize Journey Json - unknown journey type ${e.journeyType}`)}return t.challenge=e.challenge,t.assertionId=e.assertionId,t.userId=e.userId,t.sessionId=e.sessionId,t.deviceId=e.deviceId,t.actionType=e.actionType,t}(r),this.journey.encrypted&&!this.journey.isReady())throw new Nm("Failed to restore encryption context after redirection",vm.InvalidState);return this.correlationId=r.correlationId,n}async getInternalHeaders(){const e=[];this.journey&&e.push(...this.journey.getInternalHeaders()),this.correlationId&&e.push({type:"correlation_id",correlation_id:this.correlationId});const t=await this.getDeviceHeader();return t&&e.push(t),e}async getDeviceHeader(){var e,t;try{const r=mm.crypto.createCryptoBinding("sign"),{keyIdentifier:n,publicKey:i}=null!==(e=await r.getPublicData())&&void 0!==e?e:{};return n&&i?{type:"device",device:{device_key_id:n,device_public_key:i,device_type:"web",device_os:navigator.platform.toLowerCase(),device_os_version:(null===(t=navigator.userAgent.match(/(?:Version|Edge|Chrome|Firefox|Safari)\/(\d+\.\d+)/))||void 0===t?void 0:t[1])||"unknown",device_manufacturer:navigator.vendor||"unknown",device_model:navigator.platform||"unknown"}}:null}catch(e){return Em.error("Failed to create device header"),null}}getQueryParams(){var e,t;const r=n({aid:"default_application",clientId:this.clientId,locale:window.navigator.language||"en-US"},this.journey?this.journey.getQueryParams():{});return(null===(e=this.journey)||void 0===e?void 0:e.deviceId)&&(r.did=this.journey.deviceId),(null===(t=this.journey)||void 0===t?void 0:t.sessionId)&&(r.sid=this.journey.sessionId),this.resource&&(r.resource=this.resource),this.locale&&(r.locale=this.locale),r}async invokeJourney(e){var t,r,n;this.journey=e;const i=await this.getInternalHeaders(),o={data:e.getInvocationData(),headers:i};try{const e=await(null===(r=null===(t=null===window||void 0===window?void 0:window.tsPlatform)||void 0===t?void 0:t.drs)||void 0===r?void 0:r.getSessionToken());e&&o.headers.push(this.buildDrsSessionTokenSdkHeader(e))}catch(e){Em.warning(`Could not obtain DRS session token: ${e}`)}try{const t=await(null===(n=this.api)||void 0===n?void 0:n.sendRequest(e.getInvocationPath(),this.getQueryParams(),o,this.journey));if(!t)throw new rA;return e.userId=this.getIdentifier(t,"uid"),e.sessionId=this.getIdentifier(t,"session_id"),e.deviceId=this.getIdentifier(t,"device_id"),e.active(),this.handleServiceResponse(t)}catch(e){throw this.rejectJourney(),e}}buildDrsSessionTokenSdkHeader(e){return{type:"drs_session_token",drs_session_token:{token:e}}}handleJourneyState(e){switch(e){case Pm.TextRejection:case Pm.JsonRejection:this.rejectJourney();break;case Pm.JourneyEnd:this.completeJourney();break;case Pm.NextAction:case Pm.UpdateAction:break;default:throw Error(`Unhandled service response state: ${e}`)}}completeJourney(){var e;null===(e=this.journey)||void 0===e||e.complete()}rejectJourney(){var e;null===(e=this.journey)||void 0===e||e.reject()}async generateDebugPin(){var e;if(!this.journey)throw new Nm("Error occurred while trying to generate debug pin since no journey is active",vm.NoActiveJourney);const t=await this.getInternalHeaders(),r=await(null===(e=this.api)||void 0===e?void 0:e.sendRequest(Dm.path,this.getQueryParams(),{headers:t,data:{}},this.journey));if(!r)throw new rA;return r.data.debug_pin}};mm.events.on(mm.events.MODULE_INITIALIZED,async()=>{var e;const t=mm.moduleMetadata.getInitConfig();if(!(null===(e=null==t?void 0:t.ido)||void 0===e?void 0:e.serverPath))return;const{clientId:r,ido:n}=t;await aA.init(r,n)});return e.PACKAGE_VERSION="1.17.1",e.authenticate=um,e.crossDevice=dm,e.drs=fo,e.getDefaultPaths=pm,e.ido=aA,e.idv=Ig,e.initialize=g,e.isAutofillSupported=fm,e.isPlatformAuthenticatorSupported=hm,e.register=lm,e.webauthn=gm,e}({});
|