idmission-web-sdk 2.1.20 → 2.1.21

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.
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom/client"),require("platform"),require("styled-components"),require("tus-js-client"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","react-dom/client","platform","styled-components","tus-js-client","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Sdk2={},e.React,e.ReactDOM,e.platform,e.styled,e.tusJsClient,e.ReactDOM)}(this,(function(e,t,n,r,o,i,a){"use strict";function s(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var u=s(t),c=s(n),l=function(e,t){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},l(e,t)};function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var f=function(){return f=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},f.apply(this,arguments)};function p(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function h(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function m(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}function g(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function v(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}"function"==typeof SuppressedError&&SuppressedError;var y,b,x="2.1.20";function C(){return"undefined"!=typeof window&&void 0!==window.platform?window.platform:r}function w(e){return h(this,void 0,void 0,(function(){return m(this,(function(t){return e.indexOf("blob:")>=0?[2,new Promise((function(t,n){fetch(e).then((function(e){if(!e.ok)throw new Error("Failed to fetch Blob content");return e.blob()})).then((function(e){var r=new FileReader;r.onload=function(){var e=r.result?r.result.split(",")[1]:"";t(e)},r.onerror=function(){r.abort(),n(new Error("Error converting blob to base64"))},r.readAsDataURL(e)})).catch((function(e){n(e)}))}))]:[2,e.replace(/^data:image\/(png|jpeg);base64,/,"")]}))}))}function E(e){return e.replace(/^data:.*;base64,/,"")}function k(e){var t,n;return null!==(n=null===(t=e.match(/^(data:.*;base64),/))||void 0===t?void 0:t[1])&&void 0!==n?n:""}function D(e){return new Promise((function(t){var n=new FileReader;n.onloadend=function(){return t(n.result)},n.readAsDataURL(e)}))}!function(e){e.NONE="NONE",e.ENROLL="ENROLL",e.IDENTIFY="IDENTIFY",e.VALIDATE="VALIDATE",e.VERIFY="VERIFY"}(y||(y={})),function(e){e.READY="READY",e.SUBMITTING="SUBMITTING",e.SUBMITTED="SUBMITTED",e.FAILED="FAILED"}(b||(b={}));var M={prod:"https://api.idmission.com",demo:"https://apidemo.idmission.com"};function T(e,t){var n=M[e];if(!n)throw new Error("unrecognized SubmissionEnvironment ".concat(e));return n}function I(e,t){void 0===t&&(t=!1);var n={"Content-Type":"application/json","X-Send-Base64-Documents":t?"1":"0",Origin:"*"};return e&&(n["X-Session-Id"]=e),n}function S(e,t){var n,r,o=t.geolocationResult,i={selfie:t.selfieCaptureAttempts,front:t.idFrontCaptureAttempts,back:t.idBackCaptureAttempts,isRealIDCheckRequired:"false",sdkVersion:"WebSDK_".concat(x),Resolution:"undefined"!=typeof window?"".concat(window.innerWidth," x ").concat(window.innerHeight):"unknown"},a=C();a&&(i.os=null===(n=a.os)||void 0===n?void 0:n.family,i.osVersion=null===(r=a.os)||void 0===r?void 0:r.version,i.browserVersion="".concat(a.name," ").concat(a.version)),o&&(i.GeoLocation=JSON.stringify(o)),e.additionalData.metadata=JSON.stringify(i)}function N(e){return new Promise((function(t){var n=new FileReader;n.onloadend=function(){t(E(n.result))},fetch(e).then((function(e){return e.blob()})).then((function(e){return n.readAsDataURL(e)}))}))}var A,L=o.div(A||(A=v(["\n ","\n\n ","\n\n &.flex {\n display: flex;\n }\n\n &.padded {\n box-sizing: border-box;\n padding: 16px 24px;\n }\n"],["\n ","\n\n ","\n\n &.flex {\n display: flex;\n }\n\n &.padded {\n box-sizing: border-box;\n padding: 16px 24px;\n }\n"])),(function(e){var t;return!1===e.theme.isFullscreen?"":"\n position: fixed;\n top: 0;\n left: 0;\n width: var(--app-width);\n height: calc(\n var(--app-height) - ".concat(null!==(t=e.$heightOffset)&&void 0!==t?t:0,"px\n );\n overflow-x: hidden;\n overflow-y: auto;\n ")}),(function(e){return e.theme.fontFamily?"font-family: ".concat(e.theme.fontFamily,";"):""})),O=t.forwardRef((function(e,n){var r=e.children,o=e.className,i=e.heightOffset,a=void 0===i?0:i,s=e.style,u=e.onClick,c=t.useState(!1),l=c[0],d=c[1];return t.useEffect((function(){if("undefined"!=typeof window){d(!1);var e=function(){var e=document.documentElement;e.style.setProperty("--app-width","".concat(window.innerWidth,"px")),e.style.setProperty("--app-height","".concat(window.innerHeight,"px"))};return window.addEventListener("resize",e),e(),d(!0),function(){window.removeEventListener("resize",e)}}}),[]),t.createElement(L,{ref:n,style:s,onClick:u,className:o,$heightOffset:a},l&&r)}));O.displayName="PageContainer";var R,F,P,U,_=o(O)(R||(R=v(["\n background: ",";\n ","\n z-index: 10000;\n"],["\n background: ",";\n ","\n z-index: 10000;\n"])),(function(e){return e.theme.background?"".concat(e.theme.background):"white"}),(function(e){return e.theme.textColor?"color: ".concat(e.theme.textColor,";"):""})),j=o.div(F||(F=v(["\n text-align: ",";\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n max-height: var(--app-height);\n height: 100%;\n ","\n"],["\n text-align: ",";\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n max-height: var(--app-height);\n height: 100%;\n ","\n"])),(function(e){var t;return null!==(t=e.theme.textAlign)&&void 0!==t?t:"center"}),(function(e){return e.theme.padding?"box-sizing: border-box; padding: ".concat(e.theme.padding,";"):""})),B=o.div(P||(P=v(["\n position: relative;\n display: flex;\n flex-grow: 1;\n padding-bottom: 25px;\n max-width: var(--app-width);\n max-height: var(--app-height);\n overflow: hidden;\n\n & > img,\n & > svg {\n margin: 0 auto;\n width: max-content;\n max-width: 100%;\n max-height: 100%;\n aspect-ratio: initial;\n object-fit: contain;\n display: block;\n }\n"],["\n position: relative;\n display: flex;\n flex-grow: 1;\n padding-bottom: 25px;\n max-width: var(--app-width);\n max-height: var(--app-height);\n overflow: hidden;\n\n & > img,\n & > svg {\n margin: 0 auto;\n width: max-content;\n max-width: 100%;\n max-height: 100%;\n aspect-ratio: initial;\n object-fit: contain;\n display: block;\n }\n"]))),z=o.div(U||(U=v(["\n display: flex;\n margin: auto;\n\n & > div {\n max-height: calc(100vh - 320px);\n\n & > img {\n width: 100%;\n max-height: 100%;\n height: auto;\n object-fit: contain;\n }\n }\n"],["\n display: flex;\n margin: auto;\n\n & > div {\n max-height: calc(100vh - 320px);\n\n & > img {\n width: 100%;\n max-height: 100%;\n height: auto;\n object-fit: contain;\n }\n }\n"])));function G(){return G=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},G.apply(null,arguments)}var V="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function W(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function q(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}function H(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];"string"==typeof n[0]&&(n[0]="react-i18next:: "+n[0]),(e=console).warn.apply(e,n)}}var Y={};function Z(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];"string"==typeof t[0]&&Y[t[0]]||("string"==typeof t[0]&&(Y[t[0]]=new Date),H.apply(void 0,t))}var Q=function(e,t){return function(){if(e.isInitialized)t();else{var n=function(){setTimeout((function(){e.off("initialized",n)}),0),t()};e.on("initialized",n)}}};function $(e,t,n){e.loadNamespaces(t,Q(e,n))}function X(e,t,n,r){"string"==typeof n&&(n=[n]),n.forEach((function(t){e.options.ns.indexOf(t)<0&&e.options.ns.push(t)})),e.loadLanguages(t,Q(e,r))}var K,J=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,ee={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},te=function(e){return ee[e]},ne={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:function(e){return e.replace(J,te)}};var re={type:"3rdParty",init:function(e){!function(){ne=G({},ne,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}(e.options.react),function(e){K=e}(e)}},oe=t.createContext(),ie=function(){function e(){this.usedNamespaces={}}var t=e.prototype;return t.addUsedNamespaces=function(e){var t=this;e.forEach((function(e){t.usedNamespaces[e]||(t.usedNamespaces[e]=!0)}))},t.getUsedNamespaces=function(){return Object.keys(this.usedNamespaces)},e}(),ae=function(e,n){var r=t.useRef();return t.useEffect((function(){r.current=e}),[e,n]),r.current};function se(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.i18n,o=t.useContext(oe)||{},i=o.defaultNS,a=r||o.i18n||K;if(a&&!a.reportNamespaces&&(a.reportNamespaces=new ie),!a){Z("You will need to pass in an i18next instance by using initReactI18next");var s=function(e,t){return"string"==typeof t?t:t&&"object"==typeof t&&"string"==typeof t.defaultValue?t.defaultValue:Array.isArray(e)?e[e.length-1]:e},u=[s,{},!1];return u.t=s,u.i18n={},u.ready=!1,u}a.options.react&&void 0!==a.options.react.wait&&Z("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var c=G({},ne,a.options.react,n),l=c.useSuspense,d=c.keyPrefix,f=e||i||a.options&&a.options.defaultNS;f="string"==typeof f?[f]:f||["translation"],a.reportNamespaces.addUsedNamespaces&&a.reportNamespaces.addUsedNamespaces(f);var p=(a.isInitialized||a.initializedStoreOnce)&&f.every((function(e){return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.languages&&t.languages.length?void 0!==t.options.ignoreJSONStructure?t.hasLoadedNamespace(e,{lng:n.lng,precheck:function(t,r){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}):function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.languages[0],o=!!t.options&&t.options.fallbackLng,i=t.languages[t.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state[e+"|"+n];return-1===r||2===r};return!(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e)||!t.hasResourceBundle(r,e)&&t.services.backendConnector.backend&&(!t.options.resources||t.options.partialBundledLanguages)&&(!a(r,e)||o&&!a(i,e)))}(e,t,n):(Z("i18n.languages were undefined or empty",t.languages),!0)}(e,a,c)}));function h(){return a.getFixedT(n.lng||null,"fallback"===c.nsMode?f:f[0],d)}var m=t.useState(h),g=m[0],v=m[1],y=f.join();n.lng&&(y=""+n.lng+y);var b=ae(y),x=t.useRef(!0);t.useEffect((function(){var e=c.bindI18n,t=c.bindI18nStore;function r(){x.current&&v(h)}return x.current=!0,p||l||(n.lng?X(a,n.lng,f,(function(){x.current&&v(h)})):$(a,f,(function(){x.current&&v(h)}))),p&&b&&b!==y&&x.current&&v(h),e&&a&&a.on(e,r),t&&a&&a.store.on(t,r),function(){x.current=!1,e&&a&&e.split(" ").forEach((function(e){return a.off(e,r)})),t&&a&&t.split(" ").forEach((function(e){return a.store.off(e,r)}))}}),[a,y]);var C=t.useRef(!0);t.useEffect((function(){x.current&&!C.current&&v(h),C.current=!1}),[a,d]);var w=[g,a,p];if(w.t=g,w.i18n=a,w.ready=p,p)return w;if(!p&&!l)return w;throw new Promise((function(e){n.lng?X(a,n.lng,f,(function(){return e()})):$(a,f,(function(){return e()}))}))}var ue,ce,le=function(e){var n=e.children,r=e.className,o=e.colors,i=void 0===o?{}:o,a=e.disabled,s=e.finished,u=e.onClick,c=e.style,l=e.variant,d=void 0===l?"primary":l,f=t.useRef(null),p=t.useRef(null),h=t.useState(!1),m=h[0],g=h[1];return t.useEffect((function(){var e;if(!m&&!s)return Promise.resolve().then((function(){return XC})).then((function(t){if(f.current){p.current=t.create(f.current),p.current.start(),g(!0);var n=0;e=setInterval((function(){var e;n<.9&&(n+=.1),null===(e=p.current)||void 0===e||e.setProgress(n)}),250)}})),function(){var t;null===(t=p.current)||void 0===t||t.remove(),clearInterval(e)}}),[s,m]),t.useEffect((function(){var e;m&&s&&(null===(e=p.current)||void 0===e||e.stop())}),[s,m]),t.createElement(de,{className:"ladda-button ".concat(r," ").concat(a?"disabled":""),"data-style":"expand-right",disabled:a,ref:f,onClick:u,$backgroundColor:i.backgroundColor,$textColor:i.textColor,$disabledBackgroundColor:i.loadingBackgroundColor,$disabledTextColor:i.loadingTextColor,$variant:d,style:c},t.createElement("span",{className:"ladda-label"},n))},de=o.button(ue||(ue=v(["\n ","\n\n /*!\n * Ladda\n * http://lab.hakim.se/ladda\n * MIT licensed\n *\n * Copyright (C) 2018 Hakim El Hattab, http://hakim.se\n */\n @keyframes ladda-spinner-line-fade {\n 0%,\n 100% {\n opacity: 0.22;\n }\n 1% {\n opacity: 1;\n }\n }\n\n position: relative;\n\n .ladda-spinner {\n position: absolute;\n z-index: 2;\n display: inline-block;\n width: 32px;\n top: 50%;\n margin-top: 0;\n opacity: 0;\n pointer-events: none;\n }\n .ladda-label {\n position: relative;\n z-index: 3;\n }\n .ladda-progress {\n position: absolute;\n width: 0;\n height: 100%;\n left: 0;\n top: 0;\n background: rgba(0, 0, 0, 0.2);\n display: none;\n transition: 0.1s linear all !important;\n }\n &[data-loading] .ladda-progress {\n display: block;\n }\n\n transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;\n\n .ladda-spinner,\n .ladda-label {\n transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;\n }\n &[data-style='zoom-in'],\n &[data-style='zoom-in'] .ladda-spinner,\n &[data-style='zoom-in'] .ladda-label,\n &[data-style='zoom-out'],\n &[data-style='zoom-out'] .ladda-spinner,\n &[data-style='zoom-out'] .ladda-label {\n transition: 0.3s ease all !important;\n }\n &[data-style='expand-right'] .ladda-spinner {\n right: -6px;\n }\n &[data-style='expand-right'][data-size='s'] .ladda-spinner,\n &[data-style='expand-right'][data-size='xs'] .ladda-spinner {\n right: -12px;\n }\n &[data-style='expand-right'][data-loading] {\n padding-right: 56px;\n }\n &[data-style='expand-right'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='expand-right'][data-loading][data-size='s'],\n &[data-style='expand-right'][data-loading][data-size='xs'] {\n padding-right: 40px;\n }\n &[data-style='expand-left'] .ladda-spinner {\n left: 26px;\n }\n &[data-style='expand-left'][data-size='s'] .ladda-spinner,\n &[data-style='expand-left'][data-size='xs'] .ladda-spinner {\n left: 4px;\n }\n &[data-style='expand-left'][data-loading] {\n padding-left: 56px;\n }\n &[data-style='expand-left'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='expand-left'][data-loading][data-size='s'],\n &[data-style='expand-left'][data-loading][data-size='xs'] {\n padding-left: 40px;\n }\n &[data-style='expand-up'] {\n overflow: hidden;\n }\n &[data-style='expand-up'] .ladda-spinner {\n top: -32px;\n left: 50%;\n margin-left: 0;\n }\n &[data-style='expand-up'][data-loading] {\n padding-top: 54px;\n }\n &[data-style='expand-up'][data-loading] .ladda-spinner {\n opacity: 1;\n top: 26px;\n margin-top: 0;\n }\n &[data-style='expand-up'][data-loading][data-size='s'],\n &[data-style='expand-up'][data-loading][data-size='xs'] {\n padding-top: 32px;\n }\n &[data-style='expand-up'][data-loading][data-size='s'] .ladda-spinner,\n &[data-style='expand-up'][data-loading][data-size='xs'] .ladda-spinner {\n top: 4px;\n }\n &[data-style='expand-down'] {\n overflow: hidden;\n }\n &[data-style='expand-down'] .ladda-spinner {\n top: 62px;\n left: 50%;\n margin-left: 0;\n }\n &[data-style='expand-down'][data-size='s'] .ladda-spinner,\n &[data-style='expand-down'][data-size='xs'] .ladda-spinner {\n top: 40px;\n }\n &[data-style='expand-down'][data-loading] {\n padding-bottom: 54px;\n }\n &[data-style='expand-down'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='expand-down'][data-loading][data-size='s'],\n &[data-style='expand-down'][data-loading][data-size='xs'] {\n padding-bottom: 32px;\n }\n &[data-style='slide-left'] {\n overflow: hidden;\n }\n &[data-style='slide-left'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-left'] .ladda-spinner {\n left: 100%;\n margin-left: 0;\n }\n &[data-style='slide-left'][data-loading] .ladda-label {\n opacity: 0;\n left: -100%;\n }\n &[data-style='slide-left'][data-loading] .ladda-spinner {\n opacity: 1;\n left: 50%;\n }\n &[data-style='slide-right'] {\n overflow: hidden;\n }\n &[data-style='slide-right'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-right'] .ladda-spinner {\n right: 100%;\n margin-left: 0;\n left: 16px;\n }\n [dir='rtl'] &[data-style='slide-right'] .ladda-spinner {\n right: auto;\n }\n &[data-style='slide-right'][data-loading] .ladda-label {\n opacity: 0;\n left: 100%;\n }\n &[data-style='slide-right'][data-loading] .ladda-spinner {\n opacity: 1;\n left: 50%;\n }\n &[data-style='slide-up'] {\n overflow: hidden;\n }\n &[data-style='slide-up'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-up'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n margin-top: 1em;\n }\n &[data-style='slide-up'][data-loading] .ladda-label {\n opacity: 0;\n top: -1em;\n }\n &[data-style='slide-up'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-top: 0;\n }\n &[data-style='slide-down'] {\n overflow: hidden;\n }\n &[data-style='slide-down'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-down'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n margin-top: -2em;\n }\n &[data-style='slide-down'][data-loading] .ladda-label {\n opacity: 0;\n top: 1em;\n }\n &[data-style='slide-down'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-top: 0;\n }\n &[data-style='zoom-out'] {\n overflow: hidden;\n }\n &[data-style='zoom-out'] .ladda-spinner {\n left: 50%;\n margin-left: 32px;\n transform: scale(2.5);\n }\n &[data-style='zoom-out'] .ladda-label {\n position: relative;\n display: inline-block;\n }\n &[data-style='zoom-out'][data-loading] .ladda-label {\n opacity: 0;\n transform: scale(0.5);\n }\n &[data-style='zoom-out'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-left: 0;\n transform: none;\n }\n &[data-style='zoom-in'] {\n overflow: hidden;\n }\n &[data-style='zoom-in'] .ladda-spinner {\n left: 50%;\n margin-left: -16px;\n transform: scale(0.2);\n }\n &[data-style='zoom-in'] .ladda-label {\n position: relative;\n display: inline-block;\n }\n &[data-style='zoom-in'][data-loading] .ladda-label {\n opacity: 0;\n transform: scale(2.2);\n }\n &[data-style='zoom-in'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-left: 0;\n transform: none;\n }\n &[data-style='contract'] {\n overflow: hidden;\n width: 100px;\n }\n &[data-style='contract'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n }\n &[data-style='contract'][data-loading] {\n border-radius: 50%;\n width: 52px;\n }\n &[data-style='contract'][data-loading] .ladda-label {\n opacity: 0;\n }\n &[data-style='contract'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='contract-overlay'] {\n overflow: hidden;\n width: 100px;\n box-shadow: 0px 0px 0px 2000px rgba(0, 0, 0, 0);\n }\n &[data-style='contract-overlay'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n }\n &[data-style='contract-overlay'][data-loading] {\n border-radius: 50%;\n width: 52px;\n box-shadow: 0px 0px 0px 2000px rgba(0, 0, 0, 0.8);\n }\n &[data-style='contract-overlay'][data-loading] .ladda-label {\n opacity: 0;\n }\n &[data-style='contract-overlay'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n [dir='rtl'] .ladda-spinner > div {\n left: 25% !important;\n }\n"],["\n ","\n\n /*!\n * Ladda\n * http://lab.hakim.se/ladda\n * MIT licensed\n *\n * Copyright (C) 2018 Hakim El Hattab, http://hakim.se\n */\n @keyframes ladda-spinner-line-fade {\n 0%,\n 100% {\n opacity: 0.22;\n }\n 1% {\n opacity: 1;\n }\n }\n\n position: relative;\n\n .ladda-spinner {\n position: absolute;\n z-index: 2;\n display: inline-block;\n width: 32px;\n top: 50%;\n margin-top: 0;\n opacity: 0;\n pointer-events: none;\n }\n .ladda-label {\n position: relative;\n z-index: 3;\n }\n .ladda-progress {\n position: absolute;\n width: 0;\n height: 100%;\n left: 0;\n top: 0;\n background: rgba(0, 0, 0, 0.2);\n display: none;\n transition: 0.1s linear all !important;\n }\n &[data-loading] .ladda-progress {\n display: block;\n }\n\n transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;\n\n .ladda-spinner,\n .ladda-label {\n transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;\n }\n &[data-style='zoom-in'],\n &[data-style='zoom-in'] .ladda-spinner,\n &[data-style='zoom-in'] .ladda-label,\n &[data-style='zoom-out'],\n &[data-style='zoom-out'] .ladda-spinner,\n &[data-style='zoom-out'] .ladda-label {\n transition: 0.3s ease all !important;\n }\n &[data-style='expand-right'] .ladda-spinner {\n right: -6px;\n }\n &[data-style='expand-right'][data-size='s'] .ladda-spinner,\n &[data-style='expand-right'][data-size='xs'] .ladda-spinner {\n right: -12px;\n }\n &[data-style='expand-right'][data-loading] {\n padding-right: 56px;\n }\n &[data-style='expand-right'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='expand-right'][data-loading][data-size='s'],\n &[data-style='expand-right'][data-loading][data-size='xs'] {\n padding-right: 40px;\n }\n &[data-style='expand-left'] .ladda-spinner {\n left: 26px;\n }\n &[data-style='expand-left'][data-size='s'] .ladda-spinner,\n &[data-style='expand-left'][data-size='xs'] .ladda-spinner {\n left: 4px;\n }\n &[data-style='expand-left'][data-loading] {\n padding-left: 56px;\n }\n &[data-style='expand-left'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='expand-left'][data-loading][data-size='s'],\n &[data-style='expand-left'][data-loading][data-size='xs'] {\n padding-left: 40px;\n }\n &[data-style='expand-up'] {\n overflow: hidden;\n }\n &[data-style='expand-up'] .ladda-spinner {\n top: -32px;\n left: 50%;\n margin-left: 0;\n }\n &[data-style='expand-up'][data-loading] {\n padding-top: 54px;\n }\n &[data-style='expand-up'][data-loading] .ladda-spinner {\n opacity: 1;\n top: 26px;\n margin-top: 0;\n }\n &[data-style='expand-up'][data-loading][data-size='s'],\n &[data-style='expand-up'][data-loading][data-size='xs'] {\n padding-top: 32px;\n }\n &[data-style='expand-up'][data-loading][data-size='s'] .ladda-spinner,\n &[data-style='expand-up'][data-loading][data-size='xs'] .ladda-spinner {\n top: 4px;\n }\n &[data-style='expand-down'] {\n overflow: hidden;\n }\n &[data-style='expand-down'] .ladda-spinner {\n top: 62px;\n left: 50%;\n margin-left: 0;\n }\n &[data-style='expand-down'][data-size='s'] .ladda-spinner,\n &[data-style='expand-down'][data-size='xs'] .ladda-spinner {\n top: 40px;\n }\n &[data-style='expand-down'][data-loading] {\n padding-bottom: 54px;\n }\n &[data-style='expand-down'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='expand-down'][data-loading][data-size='s'],\n &[data-style='expand-down'][data-loading][data-size='xs'] {\n padding-bottom: 32px;\n }\n &[data-style='slide-left'] {\n overflow: hidden;\n }\n &[data-style='slide-left'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-left'] .ladda-spinner {\n left: 100%;\n margin-left: 0;\n }\n &[data-style='slide-left'][data-loading] .ladda-label {\n opacity: 0;\n left: -100%;\n }\n &[data-style='slide-left'][data-loading] .ladda-spinner {\n opacity: 1;\n left: 50%;\n }\n &[data-style='slide-right'] {\n overflow: hidden;\n }\n &[data-style='slide-right'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-right'] .ladda-spinner {\n right: 100%;\n margin-left: 0;\n left: 16px;\n }\n [dir='rtl'] &[data-style='slide-right'] .ladda-spinner {\n right: auto;\n }\n &[data-style='slide-right'][data-loading] .ladda-label {\n opacity: 0;\n left: 100%;\n }\n &[data-style='slide-right'][data-loading] .ladda-spinner {\n opacity: 1;\n left: 50%;\n }\n &[data-style='slide-up'] {\n overflow: hidden;\n }\n &[data-style='slide-up'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-up'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n margin-top: 1em;\n }\n &[data-style='slide-up'][data-loading] .ladda-label {\n opacity: 0;\n top: -1em;\n }\n &[data-style='slide-up'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-top: 0;\n }\n &[data-style='slide-down'] {\n overflow: hidden;\n }\n &[data-style='slide-down'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-down'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n margin-top: -2em;\n }\n &[data-style='slide-down'][data-loading] .ladda-label {\n opacity: 0;\n top: 1em;\n }\n &[data-style='slide-down'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-top: 0;\n }\n &[data-style='zoom-out'] {\n overflow: hidden;\n }\n &[data-style='zoom-out'] .ladda-spinner {\n left: 50%;\n margin-left: 32px;\n transform: scale(2.5);\n }\n &[data-style='zoom-out'] .ladda-label {\n position: relative;\n display: inline-block;\n }\n &[data-style='zoom-out'][data-loading] .ladda-label {\n opacity: 0;\n transform: scale(0.5);\n }\n &[data-style='zoom-out'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-left: 0;\n transform: none;\n }\n &[data-style='zoom-in'] {\n overflow: hidden;\n }\n &[data-style='zoom-in'] .ladda-spinner {\n left: 50%;\n margin-left: -16px;\n transform: scale(0.2);\n }\n &[data-style='zoom-in'] .ladda-label {\n position: relative;\n display: inline-block;\n }\n &[data-style='zoom-in'][data-loading] .ladda-label {\n opacity: 0;\n transform: scale(2.2);\n }\n &[data-style='zoom-in'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-left: 0;\n transform: none;\n }\n &[data-style='contract'] {\n overflow: hidden;\n width: 100px;\n }\n &[data-style='contract'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n }\n &[data-style='contract'][data-loading] {\n border-radius: 50%;\n width: 52px;\n }\n &[data-style='contract'][data-loading] .ladda-label {\n opacity: 0;\n }\n &[data-style='contract'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='contract-overlay'] {\n overflow: hidden;\n width: 100px;\n box-shadow: 0px 0px 0px 2000px rgba(0, 0, 0, 0);\n }\n &[data-style='contract-overlay'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n }\n &[data-style='contract-overlay'][data-loading] {\n border-radius: 50%;\n width: 52px;\n box-shadow: 0px 0px 0px 2000px rgba(0, 0, 0, 0.8);\n }\n &[data-style='contract-overlay'][data-loading] .ladda-label {\n opacity: 0;\n }\n &[data-style='contract-overlay'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n [dir='rtl'] .ladda-spinner > div {\n left: 25% !important;\n }\n"])),(function(e){var t,n,r,o,i,a,s,u,c,l,d,f,p,h,m,g,v,y,b,x;return"bootstrap"===(null===(t=e.theme.buttons)||void 0===t?void 0:t.style)&&"\n border-radius: 0;\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n text-transform: none;\n -webkit-appearance: button;\n \n &:not(:disabled),\n &[type='button']:not(:disabled),\n &[type='reset']:not(:disabled),\n &[type='submit']:not(:disabled) {\n cursor: pointer;\n }\n \n &:focus:not(:focus-visible) {\n outline: 0;\n }\n \n --bs-btn-padding-x: 0.75rem;\n --bs-btn-padding-y: 0.375rem;\n --bs-btn-font-family: ;\n --bs-btn-font-size: 1rem;\n --bs-btn-font-weight: 400;\n --bs-btn-line-height: 1.5;\n --bs-btn-color: var(--bs-body-color);\n --bs-btn-bg: transparent;\n --bs-btn-border-width: var(--bs-border-width);\n --bs-btn-border-color: transparent;\n --bs-btn-border-radius: var(--bs-border-radius);\n --bs-btn-hover-border-color: transparent;\n --bs-btn-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15),\n 0 1px 1px rgba(0, 0, 0, 0.075);\n --bs-btn-disabled-opacity: 0.65;\n --bs-btn-focus-box-shadow: 0 0 0 0.25rem\n rgba(var(--bs-btn-focus-shadow-rgb), 0.5);\n display: inline-block;\n padding: var(--bs-btn-padding-y) var(--bs-btn-padding-x);\n font-family: var(--bs-btn-font-family);\n font-size: var(--bs-btn-font-size);\n font-weight: var(--bs-btn-font-weight);\n line-height: var(--bs-btn-line-height);\n color: var(--bs-btn-color);\n text-align: center;\n text-decoration: none;\n vertical-align: middle;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n border: var(--bs-btn-border-width) solid var(--bs-btn-border-color);\n border-radius: var(--bs-btn-border-radius);\n background-color: var(--bs-btn-bg);\n //transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,\n // border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n \n @media (prefers-reduced-motion: reduce) {\n transition: none;\n }\n \n &:hover {\n filter: brightness(1.15);\n }\n \n &:focus-visible {\n color: var(--bs-btn-hover-color);\n background-color: var(--bs-btn-hover-bg);\n border-color: var(--bs-btn-hover-border-color);\n outline: 0;\n box-shadow: var(--bs-btn-focus-box-shadow);\n }\n \n &:disabled,\n &.disabled,\n fieldset:disabled & {\n color: var(--bs-btn-disabled-color);\n pointer-events: none;\n background-color: var(--bs-btn-disabled-bg);\n border-color: var(--bs-btn-disabled-border-color);\n opacity: var(--bs-btn-disabled-opacity);\n }\n \n --bs-btn-color: ".concat(null!==(a=null!==(n=e.$textColor)&&void 0!==n?n:null===(i=null===(r=e.theme.buttons)||void 0===r?void 0:r[null!==(o=e.$variant)&&void 0!==o?o:"primary"])||void 0===i?void 0:i.textColor)&&void 0!==a?a:"#fff",";\n --bs-btn-bg: ").concat(null!==(d=null!==(s=e.$backgroundColor)&&void 0!==s?s:null===(l=null===(u=e.theme.buttons)||void 0===u?void 0:u[null!==(c=e.$variant)&&void 0!==c?c:"primary"])||void 0===l?void 0:l.backgroundColor)&&void 0!==d?d:"#0d6efd",";\n --bs-btn-border-color: var(--bs-btn-bg);\n --bs-btn-focus-shadow-rgb: 49, 132, 253;\n --bs-btn-active-color: #fff;\n --bs-btn-active-bg: #0a58ca;\n --bs-btn-active-border-color: #0a53be;\n --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);\n --bs-btn-disabled-color: ").concat(null!==(m=null!==(f=e.$disabledTextColor)&&void 0!==f?f:null===(h=null===(p=e.theme.buttons)||void 0===p?void 0:p.loading)||void 0===h?void 0:h.textColor)&&void 0!==m?m:"#fff",";\n --bs-btn-disabled-bg: ").concat(null!==(b=null!==(g=e.$disabledBackgroundColor)&&void 0!==g?g:null===(y=null===(v=e.theme.buttons)||void 0===v?void 0:v.loading)||void 0===y?void 0:y.backgroundColor)&&void 0!==b?b:"gray",";\n --bs-btn-disabled-border-color: ").concat(null!==(x=e.$disabledBackgroundColor)&&void 0!==x?x:"#0d6efd",";\n \n --bs-btn-padding-y: 14px;\n --bs-btn-padding-x: 1rem;\n --bs-btn-font-size: 18px;\n --bs-btn-border-radius: 4px;\n ")})),fe=function(e){var n=e.accessBlockedImageUrl,r=se().t,o=t.useContext(_e).retryLocationAccess;return t.createElement(_,null,t.createElement("div",{style:{display:"flex",height:"100%"}},t.createElement(j,{style:{maxWidth:500,height:"auto",margin:"auto"}},t.createElement(B,{style:{flexGrow:0}},t.createElement("img",{src:n,alt:""})),t.createElement("h3",null,r("Your location access is disabled")),t.createElement("p",{style:{lineHeight:1.5,marginBottom:50}},r("This application requires access to your location to continue. Please accept the permission once prompted by the browser. If the browser does not prompt for location permissions, you must go to settings and provide location access to the current browser.")),t.createElement(le,{variant:"primary",onClick:o,style:{width:200,marginLeft:"auto",marginRight:"auto"},finished:!0},r("Retry")))))},pe=function(e){function t(t){var n=e.call(this,t.statusMessage)||this;return n.status=t,n}return d(t,e),t}(Error),he=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return d(t,e),t}(Error),me=function(e){function t(t,n){var r=e.call(this,t.message)||this;return r.err=t,r.host=n,r}return d(t,e),t}(Error),ge=function(e){var n=e.error;return t.createElement(_,null,t.createElement(j,{style:{justifyContent:"center"}},n instanceof he?t.createElement(ye,{error:n,onRetry:e.onRetry}):t.createElement(ve,{error:n})))},ve=function(e){var n=e.error,r=(0,se().t)("We're sorry, an unexpected error has occurred.");return t.createElement(t.Fragment,null,t.createElement("h3",{style:{marginBottom:8}},r),n.status.statusCode&&t.createElement("p",{style:{marginBottom:0}},t.createElement("code",null,"Status: ",n.status.statusCode)),t.createElement("p",{style:{marginBottom:0}},"Message: ",t.createElement("code",null,n.message)),n.status.errorData&&t.createElement("p",{style:{marginBottom:0}},"Data: ",t.createElement("code",null,n.status.errorData)))},ye=function(e){var n=e.onRetry,r=se().t,o=r("Network unreachable"),i=r("We're having trouble reaching our services, please check your connection and try again."),a=r("Retry");return t.createElement(t.Fragment,null,t.createElement("h3",{style:{marginBottom:8}},o),t.createElement("p",{style:{marginBottom:0}},i),n&&t.createElement("div",{style:{marginTop:32}},t.createElement(le,{variant:"warning",finished:!0,onClick:n},a)))},be=function(){return t.createElement(_,null,t.createElement(j,{style:{justifyContent:"center"}},t.createElement("h3",{style:{marginBottom:8}},"IDmission WebSDK failed to load"),t.createElement("p",{style:{marginBottom:0}},"Required property ",t.createElement("code",null,"sessionId")," is missing."),t.createElement("p",{style:{lineHeight:"1.5rem"}},"Please refer to the"," ",t.createElement("a",{href:"https://www.npmjs.com/package/idmission-web-sdk#getting-started",target:"_blank",rel:"noreferrer"},"Getting Started")," ","section of the documentation for information on how to use your credentials to generate a valid session for your IDmission account. Every usage of the IDmission WebSDK must be authorized with a valid session from IDmission's servers.")))},xe=function(e){var n=e.message;return t.createElement(_,null,t.createElement(j,{style:{justifyContent:"center"}},t.createElement("h3",{style:{marginBottom:8}},"IDmission WebSDK failed to load"),t.createElement("p",{style:{marginBottom:0}},"Required property ",t.createElement("code",null,"sessionId")," is not valid",n&&" (".concat(n,")"),"."),t.createElement("p",{style:{lineHeight:"1.5rem"}},"Please refer to the"," ",t.createElement("a",{href:"https://www.npmjs.com/package/idmission-web-sdk#getting-started",target:"_blank",rel:"noreferrer"},"Getting Started")," ","section of the documentation for information on how to use your credentials to generate a valid session for your IDmission account. Every usage of the IDmission WebSDK must be authorized with a valid session from IDmission's servers.")))},Ce=function(){return t.createElement(_,null,t.createElement(j,{style:{justifyContent:"center"}},t.createElement("h3",{style:{marginBottom:8}},"IDmission WebSDK failed to load"),t.createElement("p",{style:{marginBottom:0}},"Required property ",t.createElement("code",null,"authUrl")," comes from an unrecognized issuer."),t.createElement("p",{style:{marginBottom:0,lineHeight:"1.5rem"}},"Ensure you are generating a fresh session for each request to the IDmission WebSDK."),t.createElement("p",{style:{lineHeight:"1.5rem"}},"Please refer to the"," ",t.createElement("a",{href:"https://www.npmjs.com/package/idmission-web-sdk#getting-started",target:"_blank",rel:"noreferrer"},"Getting Started")," ","section of the documentation for information on how to use your credentials to generate a valid session for your IDmission account. Every usage of the IDmission WebSDK must be authorized with a valid session from IDmission's servers.")))},we=function(e){var n=e.error,r=e.onRetry,o=(0,se().t)("Retry");return t.createElement(_,null,t.createElement(j,{style:{justifyContent:"center"}},t.createElement("h3",{style:{marginBottom:8}},"IDmission WebSDK failed to load"),t.createElement("p",{style:{marginBottom:0}},(null==n?void 0:n.host)?t.createElement(t.Fragment,null,"Failed to reach ",t.createElement("code",null,n.host),"."):t.createElement(t.Fragment,null,"Failed to validate ",t.createElement("code",null,"sessionId"),".")),(null==n?void 0:n.message)&&t.createElement("p",{style:{marginBottom:0,lineHeight:"1.5rem"}},t.createElement("code",null,n.message)),t.createElement("p",{style:{marginBottom:0,lineHeight:"1.5rem"}},"Please ensure that IDmission's servers can be reached. If you believe you have reached this page in error, please contact us at"," ",t.createElement("a",{href:"mailto:support@idmission.com"},"support@idmission.com"),"."),r&&t.createElement("div",{style:{marginTop:32}},t.createElement(le,{variant:"warning",finished:!0,onClick:r},o))))},Ee=o.div(ce||(ce=v(["\n display: inline-block;\n width: ","px;\n height: ","px;\n margin: auto;\n\n &:after {\n content: ' ';\n display: block;\n width: ","px;\n height: ","px;\n margin: 8px;\n border-radius: 50%;\n border: ","px solid\n ",";\n border-color: "," transparent\n "," transparent;\n animation: lds-dual-ring 1.2s linear infinite;\n box-sizing: content-box;\n }\n\n @keyframes lds-dual-ring {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"],["\n display: inline-block;\n width: ","px;\n height: ","px;\n margin: auto;\n\n &:after {\n content: ' ';\n display: block;\n width: ","px;\n height: ","px;\n margin: 8px;\n border-radius: 50%;\n border: ","px solid\n ",";\n border-color: "," transparent\n "," transparent;\n animation: lds-dual-ring 1.2s linear infinite;\n box-sizing: content-box;\n }\n\n @keyframes lds-dual-ring {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"])),(function(e){var t=e.$size;return null!=t?t:80}),(function(e){var t=e.$size;return null!=t?t:80}),(function(e){var t=e.$size;return(null!=t?t:80)-16}),(function(e){var t=e.$size;return(null!=t?t:80)-16}),(function(e){var t=e.$thickness;return null!=t?t:6}),(function(e){var t=e.$color;return null!=t?t:"#888"}),(function(e){var t=e.$color;return null!=t?t:"#888"}),(function(e){var t=e.$color;return null!=t?t:"#888"}));e.defaultAuthUrl="https://portal-api.idmission.com";var ke=["https://portal-api.idmission.com","https://portal-api-uat.idmission.com","https://portal-api-demo.idmission.com","https://portal-api-dev.idmission.com","http://localhost:10000"];var De,Me={authUrl:e.defaultAuthUrl,sessionCheckState:"READY"},Te=t.createContext(Me),Ie=t.createContext((function(){})),Se=function(e,t){switch(t.type){case"setSessionId":return f(f({},e),{sessionId:t.payload});case"setCheckState":return f(f({},e),{sessionCheckState:t.payload});case"setError":return f(f({},e),{sessionCheckState:"ERROR",authError:t.payload});case"retry":return f(f({},e),{sessionCheckState:"READY",authError:void 0,sessionId:void 0});default:return e}};function Ne(n){var r,o=n.authUrl,i=n.children,a=function(n,r){var o=this;void 0===n&&(n=e.defaultAuthUrl);var i=t.useReducer(Se,f(f({},Me),{authUrl:n})),a=i[0],s=i[1],u=a.sessionId,c=a.sessionCheckState;return t.useEffect((function(){if(!ke.includes(n))return s({type:"setCheckState",payload:"AUTH_URL_NOT_ALLOWED"})}),[n]),t.useEffect((function(){if("READY"===c)if(u)s({type:"setCheckState",payload:"RUNNING"}),h(o,void 0,void 0,(function(){var e,t,r,o,i;return m(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,fetch("".concat(n,"/portal.sessions.v1.SessionsService/ValidateSession"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:u})})];case 1:return[4,(e=a.sent()).json()];case 2:return t=a.sent(),r=t.valid,o=t.message,e.ok||s({type:"setError",payload:new me(new Error(o),n)}),s({type:"setCheckState",payload:r?"PASSED":"FAILED"}),[3,4];case 3:return i=a.sent(),s({type:"setError",payload:new me(i,n)}),[3,4];case 4:return[2]}}))}));else{if(!r)return s({type:"setCheckState",payload:"MISSING"});if("string"==typeof r)return s({type:"setSessionId",payload:r});r instanceof Function&&r().then((function(e){s({type:"setSessionId",payload:e})})).catch((function(e){s({type:"setError",payload:new me(e,n)})}))}}),[n,c,u,r]),[a,s]}(void 0===o?e.defaultAuthUrl:o,n.sessionId),s=a[0],u=a[1];return"MISSING"===s.sessionCheckState?t.createElement(be,null):"FAILED"===s.sessionCheckState?t.createElement(xe,{message:null===(r=s.authError)||void 0===r?void 0:r.message}):"AUTH_URL_NOT_ALLOWED"===s.sessionCheckState?t.createElement(Ce,null):"ERROR"===s.sessionCheckState?t.createElement(we,{error:s.authError,onRetry:function(){return u({type:"retry"})}}):"READY"===s.sessionCheckState||"RUNNING"===s.sessionCheckState?t.createElement(O,{className:"flex"},t.createElement(Ee,null)):t.createElement(Te.Provider,{value:s},t.createElement(Ie.Provider,{value:u},i))}!function(e){e[e.Off=0]="Off",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Info=3]="Info",e[e.Debug=4]="Debug"}(De||(De={}));var Ae=De.Warn;function Le(e){var n;t.useEffect((function(){var e=Ae;if(n!==e)return Ae=n,function(){Ae=e}}),[n=e?De.Debug:Ae])}function Oe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];Ae<De.Info||console.log.apply(console,e)}function Re(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];Ae<De.Warn||console.warn.apply(console,e)}function Fe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];Ae<De.Error||console.error.apply(console,e)}e.defaultSubmissionUrl="https://portal-api.idmission.com/swagger";var Pe="https://portal-api.idmission.com/files/";function Ue(t){!function(t){if(!ke.includes(t))throw new Error("invalid auth url");e.defaultAuthUrl=t}(t),function(t){e.defaultSubmissionUrl=t}(t+"/swagger"),function(e){Pe=e}(t+"/files/")}var _e=t.createContext({submit:function(){return h(void 0,void 0,void 0,(function(){return m(this,(function(e){return[2,null]}))}))},submissionStatus:b.READY,submissionRequest:null,submissionResponse:null,submissionError:null,submissionEnvironment:"prod",idFrontImage:null,idBackImage:null,passportImage:null,selfieImage:null,signatureData:null,signatureVideoUrl:null,idCaptureVideoUrl:null,idCaptureVideoIdFrontImage:null,idCaptureVideoIdBackImage:null,idCaptureVideoAudioUrl:null,idCaptureVideoAudioStartsAt:null,additionalDocuments:null,setIdFrontImage:function(){return null},setIdBackImage:function(){return null},setPassportImage:function(){return null},setSelfieImage:function(){return null},setSignatureData:function(){return null},setSignatureVideoUrl:function(){return null},setIdCaptureVideoUrl:function(){return null},setIdCaptureVideoIdFrontImage:function(){return null},setIdCaptureVideoIdBackImage:function(){return null},setIdCaptureVideoAudioUrl:function(){return null},setIdCaptureVideoAudioStartsAt:function(){return null},setExpectedAudioText:function(){return null},setAdditionalDocuments:function(){return null},uploadDocument:Promise.resolve,logIdFrontCaptureAttempt:function(){return null},logIdBackCaptureAttempt:function(){return null},logSelfieCaptureAttempt:function(){return null},livenessCheckRequest:null,checkLiveness:function(){return h(void 0,void 0,void 0,(function(){return m(this,(function(e){throw new Error("checkLiveness is not implemented")}))}))},retryLocationAccess:function(){return null}}),je=function(n){var r=n.action,o=n.children,a=n.submissionUrl,s=void 0===a?e.defaultSubmissionUrl:a,u=n.environment,c=void 0===u?"prod":u,l=n.companyId,d=n.enrollmentId,p=n.personalData,v=n.cardData,x=n.idData,C=n.bypassAgeValidation,k=void 0!==C&&C,M=n.bypassNameMatching,A=void 0===M||M,L=n.needImmediateResponse,O=void 0!==L&&L,R=n.manualReviewRequired,F=void 0!==R&&R,P=n.idBackImageRequired,U=void 0===P||P,_=n.idImageResolutionCheck,j=void 0===_||_,B=n.verifyIdWithExternalDatabases,z=void 0!==B&&B,G=n.deduplicationEnabled,V=void 0!==G&&G,W=n.deduplicationSynchronous,q=void 0!==W&&W,H=n.idCardForFaceMatch,Y=n.geolocationEnabled,Z=void 0===Y||Y,Q=n.geolocationRequired,$=void 0!==Q&&Q,X=n.webhooksEnabled,K=void 0!==X&&X,J=n.webhooksClientTraceId,ee=n.webhooksStripSpecialCharacters,te=void 0===ee||ee,ne=n.webhooksSendInputImages,re=void 0!==ne&&ne,oe=n.webhooksSendProcessedImages,ie=void 0!==oe&&oe,ae=n.webhooksFireOnReview,se=void 0!==ae&&ae,ue=n.customerDataMatchConfig,ce=n.precapturedDocuments,le=n.documentServiceUrl,de=void 0===le?Pe:le,me=n.sendBase64DocumentsInSwaggerProxy,ve=void 0!==me&&me,ye=n.onSubmit,be=n.onBeforeSubmit,xe=n.onBeforeLivenessCheck,Ce=n.onBeforeDocumentUpload,we=n.onDocumentUploadProgress,Ee=n.onDocumentUploaded,ke=n.onDocumentUploadFailed,De=n.onResponseReceived,Me=n.onRequestFailure,Se=n.clientRequestID,Ne=function(){var e=t.useContext(Te),n=t.useContext(Ie);if(!e||!n)throw new Error("useAuthContext cannot be used without AuthStateProvider");return[e,n]}()[0].sessionId,Ae=t.useState(b.READY),Le=Ae[0],Re=Ae[1],Fe=t.useState(null),Ue=Fe[0],je=Fe[1],Be=t.useState(null),ze=Be[0],Ge=Be[1],Ve=t.useState(null),We=Ve[0],qe=Ve[1],He=t.useState(null),Ye=He[0],Ze=He[1],Qe=t.useState(null),$e=Qe[0],Xe=Qe[1],Ke=t.useState(null),Je=Ke[0],et=Ke[1],tt=t.useState(null),nt=tt[0],rt=tt[1],ot=t.useState(null),it=ot[0],at=ot[1],st=t.useState(null),ut=st[0],ct=st[1],lt=t.useState(null),dt=lt[0],ft=lt[1],pt=t.useState(null),ht=pt[0],mt=pt[1],gt=t.useState(null),vt=gt[0],yt=gt[1],bt=t.useState(null),xt=bt[0],Ct=bt[1],wt=t.useState(null),Et=wt[0],kt=wt[1],Dt=t.useState(null),Mt=Dt[0],Tt=Dt[1],It=t.useState(null),St=It[0],Nt=It[1],At=t.useState(null),Lt=At[0],Ot=At[1],Rt=t.useState(null),Ft=Rt[0],Pt=Rt[1],Ut=t.useState(null),_t=Ut[0],jt=Ut[1],Bt=t.useState(0),zt=Bt[0],Gt=Bt[1],Vt=t.useState(!1),Wt=Vt[0],qt=Vt[1],Ht=t.useState([]),Yt=Ht[0],Zt=Ht[1],Qt=t.useState([]),$t=Qt[0],Xt=Qt[1],Kt=t.useState([]),Jt=Kt[0],en=Kt[1],tn=t.useCallback((function(e){Zt((function(t){return g(g([],t,!0),[e],!1)}))}),[]),nn=t.useCallback((function(e){Xt((function(t){return g(g([],t,!0),[e],!1)}))}),[]),rn=t.useCallback((function(e){en((function(t){return g(g([],t,!0),[e],!1)}))}),[]);t.useEffect((function(){(null==ce?void 0:ce.selfie)&&ct(E(ce.selfie.imageData))}),[null==ce?void 0:ce.selfie]);var on=t.useCallback((function(e,t){return new Promise((function(n,r){return h(void 0,void 0,void 0,(function(){var o,a,s;return m(this,(function(u){switch(u.label){case 0:return o="string"==typeof e?function(e){for(var t=e.split(";base64,"),n=t[0].split(":")[1],r=window.atob(t[1]),o=new Uint8Array(r.length),i=0;i<r.length;++i)o[i]=r.charCodeAt(i);return new Blob([o],{type:n})}(e):e,(a=Ce)?[4,null==Ce?void 0:Ce(o,t)]:[3,2];case 1:a=!1===u.sent(),u.label=2;case 2:return a?[2,n(D(o))]:(s=function(e,t){return new(void 0!==window.tus?window.tus.Upload:i.Upload)(e,t)}(o,{endpoint:de,retryDelays:[0,1e3,1e3,1e3,3e3,5e3,1e4,2e4],headers:{"X-Session-Id":Ne},metadata:t||{filetype:o.type},onProgress:function(e,n){null==we||we({bytesUploaded:e,bytesTotal:n,percentage:(e/n*100).toFixed(2)+"%",metadata:t})},onSuccess:function(){var e,r="urn:documentsv1:"+(null===(e=s.url.split("/files/").pop())||void 0===e?void 0:e.split("+").shift());null==Ee||Ee(r,t),n(r)},onError:function(e){Oe("Failed because: "+e),null==ke||ke(e,t),r(e)}}),s.findPreviousUploads().then((function(e){e.length&&s.resumeFromPreviousUpload(e[0]),s.start()})),[2])}}))}))}))}),[Ce,de,Ne,we,Ee,ke]),an=t.useCallback((function(){return h(void 0,void 0,void 0,(function(){function e(e,t){return h(this,arguments,void 0,(function(e,t,n){return void 0===n&&(n="image/jpeg"),m(this,(function(r){switch(r.label){case 0:return de?(e.startsWith("data:")||(e="data:".concat(n,";base64,").concat(e)),[4,on(e,{filename:t,filetype:n})]):[2,e];case 1:return[2,r.sent()]}}))}))}var t,n,r,o,i,a,s,u,c,g;return m(this,(function(y){switch(y.label){case 0:return s={idFrontImage:Je,idBackImage:nt,passportImage:it,selfieImage:ut},(n=ht)?[4,N(ht)]:[3,2];case 1:n=y.sent(),y.label=2;case 2:return s.signatureVideo=n,(r=vt)?[4,N(vt)]:[3,4];case 3:r=y.sent(),y.label=4;case 4:return s.idCaptureVideo=r,(o=Mt)?[4,N(Mt)]:[3,6];case 5:o=y.sent(),y.label=6;case 6:return s.idCaptureVideoAudio=o,s.idCaptureVideoIdFrontImage=xt,s.idCaptureVideoIdBackImage=Et,t=s,dt&&(t.signatureImage=null==dt?void 0:dt.fileContent),de?[4,Promise.all(Object.keys(t).map((function(n){return h(void 0,void 0,void 0,(function(){var r,o;return m(this,(function(i){switch(i.label){case 0:return t[n]?(r=t,o=n,[4,e(t[n],n)]):[3,2];case 1:r[o]=i.sent(),i.label=2;case 2:return[2]}}))}))})))]:[3,8];case 7:y.sent(),y.label=8;case 8:return i={securityData:{userName:"",password:"",merchantId:0},customerData:{idData:f({idType:"NSP",idCountry:"NSP",idState:""},x)},additionalData:{uniqueRequestId:(new Date).getTime().toString(),manualReviewRequired:F?"Y":"N",bypassAgeValidation:k?"Y":"N",bypassNameMatching:A?"Y":"N",postDataAPIRequired:K?"Y":"N",postDataOnReviewRequired:se?"Y":"N",sendInputImagesInPost:re?"Y":"N",sendProcessedImagesInPost:ie?"Y":"N",needImmediateResponse:O?"Y":"N",deDuplicationRequired:V?"Y":"N",deduplicationSynchronous:q?"Y":"N",verifyDataWithHost:z?"Y":"N",idBackImageRequired:U?"Y":"N",stripSpecialCharacters:te?"Y":"N",idImageResolutionCheck:j?"Y":"N",customerDataMatchConfig:ue}},Se&&(i.additionalData.clientRequestID=Se),t.idFrontImage&&(i.customerData.idData.idImageFront=t.idFrontImage),t.idBackImage&&(i.customerData.idData.idImageBack=t.idBackImage),t.passportImage&&(i.customerData.idData.idImageFront=t.passportImage),t.selfieImage&&(i.customerData.biometricData={selfie:t.selfieImage}),l&&(i.employee={companyId:l}),p&&(i.customerData.personalData=p),v&&(i.customerData.cardData=v),d&&((u=i.customerData).personalData||(u.personalData={}),i.customerData.personalData.uniqueNumber=d),J&&(i.additionalData.clientTraceId=J),dt&&(i.customerData.signatureData={signatureImage:JSON.stringify(dt)},t.signatureVideo&&(i.customerData.signatureData.signatureVideo=t.signatureVideo)),Ft&&(i.customerData.additionalDocuments=Ft.map((function(e){return f(f({},e),{additionalDocument:JSON.stringify(f(f({},e.additionalDocument),{uniqueId:i.additionalData.uniqueRequestId}))})}))),t.idCaptureVideo&&((c=i.customerData).biometricData||(c.biometricData={}),i.customerData.biometricData.videoData=t.idCaptureVideo),t.idCaptureVideoAudio&&((g=i.customerData).biometricData||(g.biometricData={}),i.customerData.biometricData.voiceData=t.idCaptureVideoAudio,i.customerData.biometricData.voiceStartTime=null!=St?St:void 0,i.customerData.biometricData.expectedAudioText=null!=Lt?Lt:void 0),t.idCaptureVideoIdFrontImage&&(i.customerData.idData.videoIdImageFront=t.idCaptureVideoIdFrontImage),t.idCaptureVideoIdBackImage&&(i.customerData.idData.videoIdImageBack=t.idCaptureVideoIdBackImage),S(i,{selfieCaptureAttempts:Jt,idFrontCaptureAttempts:Yt,idBackCaptureAttempts:$t,geolocationResult:_t}),be?[4,be(i)]:[3,10];case 9:(a=y.sent())&&(i=a),y.label=10;case 10:return[2,i]}}))}))}),[Ft,k,A,v,Se,l,ue,V,q,de,d,Lt,_t,$t,nt,U,St,Mt,Et,xt,vt,x,Yt,Je,j,F,O,be,it,p,Jt,ut,dt,ht,on,z,J,K,se,re,ie,te]),sn=t.useCallback((function(){return h(void 0,void 0,void 0,(function(){var e,t,n,o,i,a,u,l,d,f;return m(this,(function(p){switch(p.label){case 0:if(r===y.NONE)return e={status:{statusCode:"000"},resultData:{}},Re(b.SUBMITTED),Ge(e),[2,e];Re(b.SUBMITTING),p.label=1;case 1:return p.trys.push([1,7,,8]),[4,an()];case 2:return t=p.sent(),n=s||T(c),o=function(e,t,n){switch(e){case y.ENROLL:return t?"/v4/customer/enroll":"/v4/customer/enroll-biometrics";case y.IDENTIFY:return"/v4/customer/identify";case y.VALIDATE:return n?"/v4/customer/validate-id-match-face":"/v4/customer/validate-id";case y.VERIFY:return"/v4/customer/verify";default:throw new Error("unrecognized SubmissionAction ".concat(e))}}(r,!!(Je||nt||it),!!ut),[4,fetch(n+o,{method:"POST",headers:I(Ne,ve),body:JSON.stringify(t)}).catch((function(e){throw new he(e.message)}))];case 3:return(i=p.sent())&&i.ok?[3,5]:[4,null==i?void 0:i.text()];case 4:if(!(a=p.sent())||"Load failed"===a)throw new he(a);throw new pe({statusCode:null!==(f=null==i?void 0:i.statusText)&&void 0!==f?f:"???",statusMessage:a});case 5:return[4,i.json()];case 6:if("000"!==(u=p.sent()).status.statusCode)throw new pe(u.status);return je(t),Ge(u),Re(b.SUBMITTED),null==De||De(u,t),[2,u];case 7:throw l=p.sent(),d=l,Re(b.FAILED),qe(l instanceof pe||l instanceof he?l:"Load failed"===d.message?new he:new pe({statusCode:"",statusMessage:d.message})),Ze((function(){return["VERIFY","IDENTIFY"].includes(r)?function(){return null}:sn})),null==Me||Me(d),d;case 8:return[2]}}))}))}),[r,an,s,c,Je,nt,it,ut,Ne,ve,De,Me]),un=t.useCallback((function(){return h(void 0,void 0,void 0,(function(){var e;return m(this,(function(t){switch(t.label){case 0:return ye?(e=ye,[4,an()]):[3,2];case 1:return[2,e.apply(void 0,[t.sent()])];case 2:return[4,sn()];case 3:return[2,t.sent()]}}))}))}),[an,sn,ye]),cn=t.useCallback((function(e){return h(void 0,void 0,void 0,(function(){var t,n,r,o,i,a,u,l,d,f,p;return m(this,(function(h){switch(h.label){case 0:return h.trys.push([0,8,,9]),d={securityData:{userName:"",password:"",merchantId:0}},f={},p={},[4,w(e)];case 1:return d.customerData=(f.biometricData=(p.selfie=h.sent(),p),f),d.additionalData={uniqueRequestId:(new Date).getTime().toString(),stripSpecialCharacters:te?"Y":"N",estimateAge:"N",predictGender:"N"},t=d,Se&&(t.additionalData.clientRequestID=Se),H&&(t.customerData.idData={idImageFront:H},t.customerData.additionalData={uniqueRequestId:t.additionalData.uniqueRequestId}),S(t,{selfieCaptureAttempts:Jt,idFrontCaptureAttempts:Yt,idBackCaptureAttempts:$t,geolocationResult:_t}),Xe(t),xe?[4,xe(t)]:[3,3];case 2:(n=h.sent())&&(t=n),h.label=3;case 3:return r=s||T(c),void 0===(m=!!H)&&(m=!1),[4,fetch(r+(m?"/v4/customer/match-id-face":"/v4/customer/live-check"),{method:"POST",headers:I(Ne,ve),body:JSON.stringify(t)}).catch((function(e){throw new he(e.message)}))];case 4:return(o=h.sent()).ok?[3,6]:[4,o.text()];case 5:if(!(i=h.sent())||"Load failed"===i)throw new he(i);throw new pe({statusCode:o.statusText,statusMessage:i});case 6:return[4,o.json()];case 7:if("000"!==(a=h.sent()).status.statusCode)throw new pe(a.status);return Ge(a),[2,a];case 8:throw u=h.sent(),l=u,Re(b.FAILED),qe(u instanceof pe||u instanceof he?u:"Load failed"===l.message?new he:new pe({statusCode:"",statusMessage:l.message})),Ze((function(){return function(){return null}})),null==Me||Me(l),l;case 9:return[2]}var m}))}))}),[te,Se,H,Jt,Yt,$t,_t,xe,s,c,Ne,ve,Me]),ln=t.useCallback((function(){Gt((function(e){return e+1}))}),[]);t.useEffect((function(){Z&&(Oe("making geolocation attempt",zt),navigator.geolocation.getCurrentPosition((function(e){jt(e),qt(!1)}),(function(e){if(1!==e.code)throw new Error(e.message);qt(!0)})))}),[zt,Z,$]);var dn=t.useCallback((function(){Ye&&(qe(null),Re(b.READY),Ye())}),[Ye]);return t.createElement(_e.Provider,{value:{submit:un,submissionStatus:Le,submissionRequest:Ue,submissionResponse:ze,submissionError:We,submissionEnvironment:c,idFrontImage:Je,idBackImage:nt,passportImage:it,selfieImage:ut,signatureData:dt,signatureVideoUrl:ht,idCaptureVideoUrl:vt,idCaptureVideoIdFrontImage:xt,idCaptureVideoIdBackImage:Et,idCaptureVideoAudioUrl:Mt,idCaptureVideoAudioStartsAt:St,additionalDocuments:Ft,setIdFrontImage:et,setIdBackImage:rt,setPassportImage:at,setSelfieImage:ct,setSignatureData:ft,setSignatureVideoUrl:mt,setIdCaptureVideoUrl:yt,setIdCaptureVideoIdFrontImage:Ct,setIdCaptureVideoIdBackImage:kt,setIdCaptureVideoAudioUrl:Tt,setIdCaptureVideoAudioStartsAt:Nt,setExpectedAudioText:Ot,setAdditionalDocuments:Pt,uploadDocument:on,logIdFrontCaptureAttempt:tn,logIdBackCaptureAttempt:nn,logSelfieCaptureAttempt:rn,livenessCheckRequest:$e,checkLiveness:cn,retryLocationAccess:ln}},$&&Wt?t.createElement(fe,null):o,We&&t.createElement(ge,{error:We,onRetry:dn}))};function Be(e,t,n){return e[t]?e[t][0]?e[t][0][n]:e[t][n]:"contentBoxSize"===t?e.contentRect["inlineSize"===n?"width":"height"]:void 0}function ze(e){void 0===e&&(e={});var n=e.onResize,r=t.useRef(void 0);r.current=n;var o=e.round||Math.round,i=t.useRef(),a=t.useState({width:void 0,height:void 0}),s=a[0],u=a[1],c=t.useRef(!1);t.useEffect((function(){return c.current=!1,function(){c.current=!0}}),[]);var l=t.useRef({width:void 0,height:void 0}),d=function(e,n){var r=t.useRef(null),o=t.useRef(null);o.current=n;var i=t.useRef(null);t.useEffect((function(){a()}));var a=t.useCallback((function(){var t=o.current,n=i.current||(t?t instanceof Element?t:t.current:null);r.current&&r.current.element===n&&r.current.subscriber===e||(r.current&&r.current.cleanup&&r.current.cleanup(),r.current={element:n,subscriber:e,cleanup:n?e(n):void 0})}),[e]);return t.useEffect((function(){return function(){r.current&&r.current.cleanup&&(r.current.cleanup(),r.current=null)}}),[]),t.useCallback((function(e){i.current=e,a()}),[a])}(t.useCallback((function(t){return i.current&&i.current.box===e.box&&i.current.round===o||(i.current={box:e.box,round:o,instance:new ResizeObserver((function(t){var n=t[0],i="border-box"===e.box?"borderBoxSize":"device-pixel-content-box"===e.box?"devicePixelContentBoxSize":"contentBoxSize",a=Be(n,i,"inlineSize"),s=Be(n,i,"blockSize"),d=a?o(a):void 0,f=s?o(s):void 0;if(l.current.width!==d||l.current.height!==f){var p={width:d,height:f};l.current.width=d,l.current.height=f,r.current?r.current(p):c.current||u(p)}}))}),i.current.instance.observe(t,{box:e.box}),function(){i.current&&i.current.instance.unobserve(t)}}),[e.box,o]),e.ref);return t.useMemo((function(){return{ref:d,width:s.width,height:s.height}}),[d,s.width,s.height])}var Ge,Ve=o.canvas(Ge||(Ge=v(["\n display: none;\n"],["\n display: none;\n"])));function We(e,t,n,r){if(e){var o=e.getContext("2d");if(o){if(!n||!r){var i=function(e){var t=e.width,n=e.height;return e instanceof HTMLImageElement&&(t=e.naturalWidth,n=e.naturalHeight),e instanceof HTMLVideoElement&&(t=e.videoWidth,n=e.videoHeight),[t,n]}(t);n||(n=i[0]),r||(r=i[1])}e.width=n,e.height=r,o.drawImage(t,0,0,n,r)}}}function qe(e){var t;null===(t=null==e?void 0:e.getContext("2d"))||void 0===t||t.clearRect(0,0,null==e?void 0:e.width,null==e?void 0:e.height)}function He(e){return h(this,arguments,void 0,(function(e,t){var n,r;return void 0===t&&(t=!1),m(this,(function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia({video:{facingMode:{exact:e}},audio:t})];case 1:return n=o.sent(),[4,navigator.mediaDevices.enumerateDevices()];case 2:return r=o.sent().filter((function(e){return"videoinput"===e.kind})),n.getVideoTracks().forEach((function(e){e.enabled=!1,e.stop()})),n=null,[2,r]}}))}))}var Ye,Ze,Qe=["front","avant","anteriore","cameraaanvoorzijde","kamerapåframsidan","forsidekamera","kamerapåforsiden","aparatprzedni","etukamera","kameradepan","ÖnKamera","cameramặttrước","camerăfață","prednákamera","prednjakamera","előlapikamera","přednífotoaparát","μπροστινήκάμερα","переднякамера","передняякамера","преднакамера","алдыңғыкамера","מצלמה קדמית","الكاميرا الأمامية","फ़्रंटकैमरा","前置相机","前置鏡頭","前面カメラ","전면카메라","กล้องด้านหน้า"].map((function(e){return e.toLocaleLowerCase().split(" ").join("")})),$e=["back","rear","posterior","trasera","traseira","arrière","rückkamera","fotocamera(posteriore)","cameraaanachterzijde","kamerapåbaksidan","kamerapåbaksiden","bagsidekamera","aparattylny","takakamera","arkakamera","kamerabelakang","cameramặtsau","camerăspate","stražnjakamera","zadnákamera","hátoldalikamera","zadnífotoaparát","πίσωκάμερα","заднякамера","Задняякамера","заднакамера","артқыкамера","מצלמה אחורית","الكاميرا الخلفية","बैककैमरा","后置相机","後置鏡頭","背面カメラ","후면카메라","กล้องด้านหลัง"].map((function(e){return e.toLocaleLowerCase().split(" ").join("")})),Xe=["backdualwidecamera","backultrawidecamera","ultraampliaposterior","ultra-angulartraseira","ultragrandeangulartraseira","ultragrandangle","ultragranangular","ultra-weitwinkelkamera","ultra-grandangolo","ultrabredecameraaanachterzijde","ultravidvinkelkamerapåbaksidan","ultravidvinkelkameraetpåbagsiden","ultravidvinkelkamerabak","ultragenişkameraarkayüzü","ultralaajakulmainentakakamera","tylnyaparatultraszerokokątny","cameracựcrộngmặtsau","camerăcuobiectivultra‑superangularspate","ultraszéleslátószögűkamera","kameraultralebarbelakang","stražnjaultraširokakamera","zadníultraširokoúhlýfotoaparát","ultraširokouhlá","πίσωυπερευρείακάμερα","заднянадширококутнакамера","Задняясверхширокоугольнаякамера","Задна свръх широкоъгълна камера","артқыультракеңбұрыштыкамера","מצלמה אולטרה רחבה אחורית","كاميرا خلفية عريضة جدًا","बैकअल्ट्रावाइडकैमरा","后置超广角相机","後置超廣角鏡頭相機","背面超広角カメラ","후면울트라와이드카메라","กล้องด้านหลังอัลตร้าไวด์"].map((function(e){return e.toLocaleLowerCase().split(" ").join("")})),Ke=function(e,t){var n=e instanceof MediaDeviceInfo?Je(e):e;return("string"==typeof t?[t]:t).some((function(e){return n.includes(e)}))},Je=function(e){return e.label.toLocaleLowerCase().split(" ").join("")};function et(){Ye&&(Oe("releasing camera access..."),Ye.release(),Ye=void 0)}function tt(e){var n=void 0===e?{}:e,r=n.requestAccessAutomatically,o=void 0===r||r,i=n.preferFrontFacingCamera,a=void 0!==i&&i,s=n.preferContinuityCamera,u=void 0===s||s,c=n.requireMicrophoneAccess,l=void 0!==c&&c,d=n.maxVideoWidth,f=void 0===d?1920:d,p=n.maxFps,v=n.debugMode,y=void 0!==v&&v,b=t.useRef(null),x=t.useRef([]),w=t.useRef(null),E=t.useState(!1),k=E[0],D=E[1],M=t.useState(!1),T=M[0],I=M[1],S=t.useState(null),N=S[0],A=S[1],L=t.useState(null),O=L[0],R=L[1],F=t.useState(!1),P=F[0],U=F[1],_=t.useState(!1),j=_[0],B=_[1],z=t.useState(u),G=z[0],V=z[1],W=t.useState(!1),q=W[0],H=W[1],Y=t.useState(!1),Z=Y[0],Q=Y[1],$=t.useState(!1),X=$[0],K=$[1],J=b.current;t.useEffect((function(){var e=x.current.slice(-1)[0];J&&J!==e&&(Oe("adding video to stack",J),x.current.push(J))}),[J]);var ee=t.useCallback((function(e){Oe("removing video from stack",e),x.current=x.current.filter((function(t){return t!==e})),b.current=x.current.slice(-1)[0],Oe("new videoRef is",b.current)}),[]);t.useEffect((function(){y&&Oe("iphone continuity camera allowed changed",G),et(),w.current=null,U(!1)}),[y,G]);var te=t.useCallback((function(){return h(this,void 0,void 0,(function(){var e,t,n,r,o,i,s;return m(this,(function(u){switch(u.label){case 0:D(!1),Q(!1),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,He()];case 2:return e=u.sent(),t=void 0,y&&Oe("availableCameras",e),n=C(),y&&Oe("platformDetails",n),q||(null==n?void 0:n.os)&&"OS X"!==n.os.family?("Android"===(null===(i=null==n?void 0:n.os)||void 0===i?void 0:i.family)||e.every((function(e){return e.label.startsWith("camera2 ")})))&&(e=e.sort((function(e,t){return e.label.toLowerCase().localeCompare(t.label.toLowerCase())})),y&&Oe("cameras have been sorted",e)):(r=e.find((function(e){return Ke(e,"iphone")})),B(!!r),r&&G&&(t=r)),a&&(t=e.find((function(e){return Ke(e,Qe)}))),t||(t=e.find((function(e){return Ke(e,"backtriplecamera")}))),t||(t=e.find((function(e){return Ke(e,"backdualcamera")}))),t||(t=e.find((function(e){return Ke(e,$e)&&!Ke(e,Xe)}))),t||(t=e.find((function(e){return Ke(e,$e)}))),!a&&"iOS"===(null===(s=null==n?void 0:n.os)||void 0===s?void 0:s.family)&&e.length>0&&(t||(t=e[1])),t||(t=e[0]),y&&Oe("selectedCamera",t),A(t),[3,4];case 3:if("NotAllowedError"!==(o=u.sent()).name)throw Fe("camera access encountered some other error",o),o;return Fe("camera access has been blocked by the user",o),Q(!0),[3,4];case 4:return[2]}}))}))}),[y,G,q,a]);t.useEffect((function(){o&&!Z&&te().catch(Fe)}),[Z,o,te]),t.useEffect((function(){var e;if(N){var t=function(){et(),w.current=null,U(!1)};return(null===(e=navigator.mediaDevices)||void 0===e?void 0:e.getUserMedia)?(h(this,void 0,void 0,(function(){var e,t,n,r;return m(this,(function(o){switch(o.label){case 0:e={audio:!1,video:{deviceId:{exact:N.deviceId},width:{ideal:f},aspectRatio:1.777777778,frameRate:{}}},p&&(e.video.frameRate={max:p}),t=null,o.label=1;case 1:return o.trys.push([1,3,,4]),[4,navigator.mediaDevices.getUserMedia(e)];case 2:return t=o.sent(),[3,4];case 3:return"NotAllowedError"===o.sent().name?(G?(B(!1),H(!0)):Q(!0),[2]):[3,4];case 4:if(t)return[3,8];o.label=5;case 5:return o.trys.push([5,7,,8]),[4,navigator.mediaDevices.getUserMedia({audio:!1,video:!0})];case 6:return t=o.sent(),Oe("opened stream with no width and height constraints"),[3,8];case 7:return o.sent(),Oe("cannot open stream at all"),[3,8];case 8:if(!t)throw new Error("failed to open camera");return n=function(){j&&G?(Oe("someone unplugged the continuity camera"),et(),w.current=null,B(!1),H(!0),A(null)):(Oe("someone unplugged the webcam"),et(),w.current=null,U(!1),Q(!0))},null===(r=b.current)||void 0===r||r.addEventListener("ended",n),t.getVideoTracks().forEach((function(e){e.onended=n})),w.current=function(e,t,n){et(),Oe("obtaining camera access...");var r=e.getVideoTracks()[0].getSettings(),o=r.width,i=r.height,a=t.toLocaleLowerCase().split(" ").join(""),s=Ke(a,g(g(g([],$e,!0),Xe,!0),["iphone"],!1));return o||(o=0),i||(i=0),Ye={label:t,stream:e,width:o,height:i,isRearFacing:s,release:function(){e.getTracks().forEach((function(e){e.enabled=!1,e.stop()})),n&&(n.pause(),n.srcObject=null,n.src="")}},n&&(n.srcObject=e),Ye}(t,N.label,b.current),[2]}}))})),t):t}}),[G,j,p,f,N]),t.useEffect((function(){D(!1),N&&P&&D(N&&P)}),[P,N]);var ne=t.useCallback((function(){return h(this,void 0,void 0,(function(){var e;return m(this,(function(t){switch(t.label){case 0:I(!1),K(!1),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,navigator.mediaDevices.getUserMedia({audio:!0,video:!1})];case 2:return e=t.sent(),Ze=e,R(e),I(!0),e.getAudioTracks().forEach((function(e){e.onended=function(){K(!0)}})),[3,4];case 3:return t.sent(),K(!0),[3,4];case 4:return[2]}}))}))}),[]);t.useEffect((function(){if(l&&!X)return ne().catch(Fe),function(){!function(){var e;Ze&&(Oe("releasing microphone access..."),null===(e=Ze.stop)||void 0===e||e.call(Ze),Ze.getAudioTracks().forEach((function(e){var t;null===(t=e.stop)||void 0===t||t.call(e)})),Ze=void 0)}(),R(null),I(!1)}}),[X,ne,l]);var re=t.useCallback((function(){return h(this,void 0,void 0,(function(){var e;return m(this,(function(t){switch(t.label){case 0:return w.current?"undefined"==typeof ImageCapture?[3,2]:[4,new ImageCapture(w.current.stream.getTracks()[0]).takePhoto()]:[2,null];case 1:return[2,t.sent()];case 2:return b.current?(We(e=document.createElement("canvas"),b.current),[2,new Promise((function(t){return e.toBlob(t)}))]):[2,null]}}))}))}),[]);return t.useMemo((function(){return{videoRef:b,videoDevice:N,videoLoaded:P,setVideoLoaded:U,onVideoUnmounted:ee,cameraRef:w,cameraReady:k,cameraAccessDenied:Z,requestCameraAccess:te,releaseCameraAccess:et,iphoneContinuityCameraAvailable:j,iphoneContinuityCameraAllowed:G,setIphoneContinuityCameraAllowed:V,takePhoto:re,audioStream:O,microphoneReady:T,microphoneAccessDenied:X,requestMicrophoneAccess:ne}}),[O,Z,k,G,j,X,T,ee,te,ne,re,N,P])}var nt=t.createContext({videoRef:{current:null},videoDevice:null,videoLoaded:!1,cameraRef:{current:null},cameraReady:!1,cameraAccessDenied:!1,requestCameraAccess:function(){return null},releaseCameraAccess:function(){return null},iphoneContinuityCameraAvailable:!1,iphoneContinuityCameraAllowed:!0,setIphoneContinuityCameraAllowed:function(){return null},takePhoto:function(){return Promise.resolve(null)},setVideoLoaded:function(){return null},onVideoUnmounted:function(){return null},audioStream:null,microphoneReady:!1,microphoneAccessDenied:!1,requestMicrophoneAccess:function(){return null}}),rt=function(e){var n=e.children,r=e.requestAccessAutomatically,o=e.preferFrontFacingCamera,i=e.preferContinuityCamera,a=e.requireMicrophoneAccess,s=e.maxVideoWidth,u=e.onCameraAccessDenied,c=e.onMicrophoneAccessDenied,l=e.debugMode,d=tt({requestAccessAutomatically:void 0===r||r,preferFrontFacingCamera:void 0!==o&&o,preferContinuityCamera:void 0===i||i,requireMicrophoneAccess:void 0!==a&&a,maxVideoWidth:void 0===s?1920:s,maxFps:e.maxFps,debugMode:void 0!==l&&l});t.useEffect((function(){d.cameraAccessDenied&&(null==u||u())}),[d.cameraAccessDenied,u]),t.useEffect((function(){d.microphoneAccessDenied&&(null==c||c())}),[d.microphoneAccessDenied,c]);var f=d.releaseCameraAccess;return t.useEffect((function(){return function(){f()}}),[f]),t.createElement(nt.Provider,{value:d},n)};function ot(e){return ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ot(e)}function it(e){var t=function(e,t){if("object"!=ot(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=ot(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==ot(t)?t:t+""}function at(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,it(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function st(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function ut(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){st(i,r,o,a,s,"next",e)}function s(e){st(i,r,o,a,s,"throw",e)}a(void 0)}))}}function ct(e,t){return ct=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ct(e,t)}function lt(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ct(e,t)}function dt(e){return dt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},dt(e)}function ft(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ft=function(){return!!e})()}function pt(e){var t="function"==typeof Map?new Map:void 0;return pt=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(ft())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&ct(o,n.prototype),o}(e,arguments,dt(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),ct(n,e)},pt(e)}var ht={exports:{}},mt={exports:{}};!function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(mt);var gt=mt.exports;!function(e){var t=gt.default;function n(){e.exports=n=function(){return o},e.exports.__esModule=!0,e.exports.default=e.exports;var r,o={},i=Object.prototype,a=i.hasOwnProperty,s=Object.defineProperty||function(e,t,n){e[t]=n.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",d=u.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(r){f=function(e,t,n){return e[t]=n}}function p(e,t,n,r){var o=Object.create((t&&t.prototype instanceof x?t:x).prototype),i=new O(r||[]);return s(o,"_invoke",{value:S(e,n,i)}),o}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}o.wrap=p;var m="suspendedStart",g="suspendedYield",v="executing",y="completed",b={};function x(){}function C(){}function w(){}var E={};f(E,c,(function(){return this}));var k=Object.getPrototypeOf,D=k&&k(k(R([])));D&&D!==i&&a.call(D,c)&&(E=D);var M=w.prototype=x.prototype=Object.create(E);function T(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,n){function r(o,i,s,u){var c=h(e[o],e,i);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==t(d)&&a.call(d,"__await")?n.resolve(d.__await).then((function(e){r("next",e,s,u)}),(function(e){r("throw",e,s,u)})):n.resolve(d).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,u)}))}u(c.arg)}var o;s(this,"_invoke",{value:function(e,t){function i(){return new n((function(n,o){r(e,t,n,o)}))}return o=o?o.then(i,i):i()}})}function S(e,t,n){var o=m;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:r,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=N(s,n);if(u){if(u===b)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var c=h(e,t,n);if("normal"===c.type){if(o=n.done?y:g,c.arg===b)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=y,n.method="throw",n.arg=c.arg)}}}function N(e,t){var n=t.method,o=e.iterator[n];if(o===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=r,N(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var i=h(o,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,b;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,b):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,b)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function R(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function t(){for(;++o<e.length;)if(a.call(e,o))return t.value=e[o],t.done=!1,t;return t.value=r,t.done=!0,t};return i.next=i}}throw new TypeError(t(e)+" is not iterable")}return C.prototype=w,s(M,"constructor",{value:w,configurable:!0}),s(w,"constructor",{value:C,configurable:!0}),C.displayName=f(w,d,"GeneratorFunction"),o.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===C||"GeneratorFunction"===(t.displayName||t.name))},o.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,f(e,d,"GeneratorFunction")),e.prototype=Object.create(M),e},o.awrap=function(e){return{__await:e}},T(I.prototype),f(I.prototype,l,(function(){return this})),o.AsyncIterator=I,o.async=function(e,t,n,r,i){void 0===i&&(i=Promise);var a=new I(p(e,t,n,r),i);return o.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},T(M),f(M,d,"Generator"),f(M,c,(function(){return this})),f(M,"toString",(function(){return"[object Generator]"})),o.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},o.values=R,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(L),!e)for(var t in this)"t"===t.charAt(0)&&a.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=r)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,o){return s.type="throw",s.arg=e,t.next=n,o&&(t.method="next",t.arg=r),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=a.call(i,"catchLoc"),c=a.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),L(n),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;L(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:R(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),b}},o}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(ht);var vt=(0,ht.exports)(),yt=vt;try{regeneratorRuntime=vt}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=vt:Function("r","regeneratorRuntime = r")(vt)}var bt=W(yt);function xt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ct(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ct(e,t):void 0}}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ct(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var wt,Et,kt="undefined"!=typeof self?self:{};function Dt(e){e:{for(var t=["CLOSURE_FLAGS"],n=kt,r=0;r<t.length;r++)if(null==(n=n[t[r]])){t=null;break e}t=n}return null!=(e=t&&t[e])&&e}function Mt(){throw Error("Invalid UTF8")}function Tt(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var It,St="undefined"!=typeof TextDecoder,Nt="undefined"!=typeof TextEncoder;function At(e){if(Nt)e=(It||(It=new TextEncoder)).encode(e);else{for(var t=0,n=new Uint8Array(3*e.length),r=0;r<e.length;r++){var o=e.charCodeAt(r);if(128>o)n[t++]=o;else{if(2048>o)n[t++]=o>>6|192;else{if(55296<=o&&57343>=o){if(56319>=o&&r<e.length){var i=e.charCodeAt(++r);if(56320<=i&&57343>=i){n[t++]=(o=1024*(o-55296)+i-56320+65536)>>18|240,n[t++]=o>>12&63|128,n[t++]=o>>6&63|128,n[t++]=63&o|128;continue}r--}o=65533}n[t++]=o>>12|224,n[t++]=o>>6&63|128}n[t++]=63&o|128}}e=t===n.length?n:n.subarray(0,t)}return e}var Lt,Ot=Dt(610401301),Rt=Dt(188588736),Ft=kt.navigator;function Pt(e){return!!Ot&&!!Lt&&Lt.brands.some((function(t){var n=t.brand;return n&&-1!=n.indexOf(e)}))}function Ut(e){var t;return(t=kt.navigator)&&(t=t.userAgent)||(t=""),-1!=t.indexOf(e)}function _t(){return!!Ot&&!!Lt&&0<Lt.brands.length}function jt(){return _t()?Pt("Chromium"):(Ut("Chrome")||Ut("CriOS"))&&!(!_t()&&Ut("Edge"))||Ut("Silk")}function Bt(e){return Bt[" "](e),e}Lt=Ft&&Ft.userAgentData||null,Bt[" "]=function(){};var zt=!_t()&&(Ut("Trident")||Ut("MSIE"));!Ut("Android")||jt(),jt(),Ut("Safari")&&(jt()||!_t()&&Ut("Coast")||!_t()&&Ut("Opera")||!_t()&&Ut("Edge")||(_t()?Pt("Microsoft Edge"):Ut("Edg/"))||_t()&&Pt("Opera"));var Gt={},Vt=null;function Wt(){if(!Vt){Vt={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));Gt[n]=r;for(var o=0;o<r.length;o++){var i=r[o];void 0===Vt[i]&&(Vt[i]=o)}}}}var qt="undefined"!=typeof Uint8Array,Ht=!zt&&"function"==typeof btoa;function Yt(e){if(!Ht){var t;void 0===t&&(t=0),Wt(),t=Gt[t];for(var n=Array(Math.floor(e.length/3)),r=t[64]||"",o=0,i=0;o<e.length-2;o+=3){var a=e[o],s=e[o+1],u=e[o+2],c=t[a>>2];n[i++]=c+(a=t[(3&a)<<4|s>>4])+(s=t[(15&s)<<2|u>>6])+(u=t[63&u])}switch(c=0,u=r,e.length-o){case 2:u=t[(15&(c=e[o+1]))<<2]||r;case 1:n[i]=t[(e=e[o])>>2]+t[(3&e)<<4|c>>4]+u+r}return n.join("")}for(t="",n=0,r=e.length-10240;n<r;)t+=String.fromCharCode.apply(null,e.subarray(n,n+=10240));return t+=String.fromCharCode.apply(null,n?e.subarray(n):e),btoa(t)}var Zt,Qt=/[-_.]/g,$t={"-":"+",_:"/",".":"="};function Xt(e){return $t[e]||""}function Kt(e){if(!Ht)return function(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var r=new Uint8Array(n),o=0;return function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),o=Vt[n];if(null!=o)return o;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}Wt();for(var r=0;;){var o=n(-1),i=n(0),a=n(64),s=n(64);if(64===s&&-1===o)break;t(o<<2|i>>4),64!=a&&(t(i<<4&240|a>>2),64!=s&&t(a<<6&192|s))}}(e,(function(e){r[o++]=e})),o!==n?r.subarray(0,o):r}(e);Qt.test(e)&&(e=e.replace(Qt,Xt)),e=atob(e);for(var t=new Uint8Array(e.length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}function Jt(e){return qt&&null!=e&&e instanceof Uint8Array}function en(){return Zt||(Zt=new Uint8Array(0))}var tn,nn={};function rn(e){if(e!==nn)throw Error("illegal external caller")}function on(){return tn||(tn=new sn(null,nn))}function an(e){rn(nn);var t=e.g;return null==(t=null==t||Jt(t)?t:"string"==typeof t?Kt(t):null)?t:e.g=t}var sn=function(){function e(e,t){if(rn(t),this.g=e,null!=e&&0===e.length)throw Error("ByteString should be constructed with non-empty values")}return e.prototype.h=function(){var e=an(this);return e?new Uint8Array(e):en()},e}();function un(e,t){return Error("Invalid wire type: "+e+" (at position "+t+")")}function cn(){return Error("Failed to read varint, encoding is invalid.")}function ln(e,t){return Error("Tried to read past the end of the data "+t+" > "+e)}function dn(e){if("string"==typeof e)return{buffer:Kt(e),P:!1};if(Array.isArray(e))return{buffer:new Uint8Array(e),P:!1};if(e.constructor===Uint8Array)return{buffer:e,P:!1};if(e.constructor===ArrayBuffer)return{buffer:new Uint8Array(e),P:!1};if(e.constructor===sn)return{buffer:an(e)||en(),P:!0};if(e instanceof Uint8Array)return{buffer:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),P:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function fn(){return"function"==typeof BigInt}var pn,hn="function"==typeof Uint8Array.prototype.slice,mn=0,gn=0;function vn(e){var t=0>e,n=(e=Math.abs(e))>>>0;if(e=Math.floor((e-n)/4294967296),t){var r=Dn(n,e);e=r[1],n=r[0]}mn=n>>>0,gn=e>>>0}function yn(e){var t=pn||(pn=new DataView(new ArrayBuffer(8)));t.setFloat32(0,+e,!0),gn=0,mn=t.getUint32(0,!0)}function bn(e,t){return 4294967296*t+(e>>>0)}function xn(e,t){var n=2147483648&t;return n&&(t=~t>>>0,0==(e=1+~e>>>0)&&(t=t+1>>>0)),e=bn(e,t),n?-e:e}function Cn(e,t){if(e>>>=0,2097151>=(t>>>=0))var n=""+(4294967296*t+e);else fn()?n=""+(BigInt(t)<<BigInt(32)|BigInt(e)):(e=(16777215&e)+6777216*(n=16777215&(e>>>24|t<<8))+6710656*(t=t>>16&65535),n+=8147497*t,t*=2,1e7<=e&&(n+=Math.floor(e/1e7),e%=1e7),1e7<=n&&(t+=Math.floor(n/1e7),n%=1e7),n=t+wn(n)+wn(e));return n}function wn(e){return e=String(e),"0000000".slice(e.length)+e}function En(){var e=mn,t=gn;if(2147483648&t)if(fn())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{var n=Dn(e,t);e="-"+Cn(n[0],n[1])}else e=Cn(e,t);return e}function kn(e){if(16>e.length)vn(Number(e));else if(fn())e=BigInt(e),mn=Number(e&BigInt(4294967295))>>>0,gn=Number(e>>BigInt(32)&BigInt(4294967295));else{var t=+("-"===e[0]);gn=mn=0;for(var n=e.length,r=t,o=(n-t)%6+t;o<=n;r=o,o+=6){var i=Number(e.slice(r,o));gn*=1e6,4294967296<=(mn=1e6*mn+i)&&(gn+=Math.trunc(mn/4294967296),gn>>>=0,mn>>>=0)}if(t){var a=Dn(mn,gn);mn=a[0],gn=a[1]}}}function Dn(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}function Mn(e,t){var n,r=0,o=0,i=0,a=e.h,s=e.g;do{r|=(127&(n=a[s++]))<<i,i+=7}while(32>i&&128&n);for(32<i&&(o|=(127&n)>>4),i=3;32>i&&128&n;i+=7)o|=(127&(n=a[s++]))<<i;if(Rn(e,s),128>n)return t(r>>>0,o>>>0);throw cn()}function Tn(e){for(var t=0,n=e.g,r=n+10,o=e.h;n<r;){var i=o[n++];if(t|=i,!(128&i))return Rn(e,n),!!(127&t)}throw cn()}function In(e){var t=e.h,n=e.g,r=t[n++],o=127&r;if(128&r&&(o|=(127&(r=t[n++]))<<7,128&r&&(o|=(127&(r=t[n++]))<<14,128&r&&(o|=(127&(r=t[n++]))<<21,128&r&&(o|=(r=t[n++])<<28,128&r&&128&t[n++]&&128&t[n++]&&128&t[n++]&&128&t[n++]&&128&t[n++])))))throw cn();return Rn(e,n),o}function Sn(e){return In(e)>>>0}function Nn(e){var t=e.h,n=e.g,r=t[n],o=t[n+1],i=t[n+2];return t=t[n+3],Rn(e,e.g+4),(r|o<<8|i<<16|t<<24)>>>0}function An(e){var t=Nn(e);e=2*(t>>31)+1;var n=t>>>23&255;return t&=8388607,255==n?t?NaN:1/0*e:0==n?e*Math.pow(2,-149)*t:e*Math.pow(2,n-150)*(t+Math.pow(2,23))}function Ln(e){return In(e)}function On(e,t,n){var r=(void 0===n?{}:n).ca;e.ca=void 0!==r&&r,t&&(t=dn(t),e.h=t.buffer,e.m=t.P,e.j=0,e.l=e.h.length,e.g=e.j)}function Rn(e,t){if(e.g=t,t>e.l)throw ln(e.l,t)}function Fn(e,t){if(0>t)throw Error("Tried to read a negative byte length: "+t);var n=e.g,r=n+t;if(r>e.l)throw ln(t,e.l-n);return e.g=r,n}function Pn(e,t){if(0==t)return on();var n=Fn(e,t);return e.ca&&e.m?n=e.h.subarray(n,n+t):(e=e.h,n=n===(t=n+t)?en():hn?e.slice(n,t):new Uint8Array(e.subarray(n,t))),0==n.length?on():new sn(n,nn)}var Un=[];function _n(e){var t=e.g;if(t.g==t.l)return!1;e.l=e.g.g;var n=Sn(e.g);if(t=n>>>3,!(0<=(n&=7)&&5>=n))throw un(n,e.l);if(1>t)throw Error("Invalid field number: "+t+" (at position "+e.l+")");return e.m=t,e.h=n,!0}function jn(e){switch(e.h){case 0:0!=e.h?jn(e):Tn(e.g);break;case 1:Rn(e=e.g,e.g+8);break;case 2:if(2!=e.h)jn(e);else{var t=Sn(e.g);Rn(e=e.g,e.g+t)}break;case 5:Rn(e=e.g,e.g+4);break;case 3:for(t=e.m;;){if(!_n(e))throw Error("Unmatched start-group tag: stream EOF");if(4==e.h){if(e.m!=t)throw Error("Unmatched end-group tag");break}jn(e)}break;default:throw un(e.h,e.l)}}function Bn(e,t,n){var r=e.g.l,o=Sn(e.g),i=e.g.g+o,a=i-r;if(0>=a&&(e.g.l=i,n(t,e,void 0,void 0,void 0),a=i-e.g.g),a)throw Error("Message parsing ended unexpectedly. Expected to read "+o+" bytes, instead read "+(o-a)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=i,e.g.l=r,t}function zn(e){var t=Sn(e.g),n=Fn(e=e.g,t);if(e=e.h,St){var r,o=e;(r=Et)||(r=Et=new TextDecoder("utf-8",{fatal:!0})),t=n+t,o=0===n&&t===o.length?o:o.subarray(n,t);try{var i=r.decode(o)}catch(e){if(void 0===wt){try{r.decode(new Uint8Array([128]))}catch(e){}try{r.decode(new Uint8Array([97])),wt=!0}catch(e){wt=!1}}throw!wt&&(Et=void 0),e}}else{t=(i=n)+t,n=[];for(var a,s=null;i<t;){var u=e[i++];128>u?n.push(u):224>u?i>=t?Mt():(a=e[i++],194>u||128!=(192&a)?(i--,Mt()):n.push((31&u)<<6|63&a)):240>u?i>=t-1?Mt():128!=(192&(a=e[i++]))||224===u&&160>a||237===u&&160<=a||128!=(192&(r=e[i++]))?(i--,Mt()):n.push((15&u)<<12|(63&a)<<6|63&r):244>=u?i>=t-2?Mt():128!=(192&(a=e[i++]))||a-144+(u<<28)>>30||128!=(192&(r=e[i++]))||128!=(192&(o=e[i++]))?(i--,Mt()):(u=(7&u)<<18|(63&a)<<12|(63&r)<<6|63&o,n.push(55296+((u-=65536)>>10&1023),56320+(1023&u))):Mt(),8192<=n.length&&(s=Tt(s,n),n.length=0)}i=Tt(s,n)}return i}function Gn(e){var t=Sn(e.g);return Pn(e.g,t)}function Vn(e,t,n){var r=Sn(e.g);for(r=e.g.g+r;e.g.g<r;)n.push(t(e.g))}var Wn=[];function qn(e){return e?/^\d+$/.test(e)?(kn(e),new Yn(mn,gn)):null:Hn||(Hn=new Yn(0,0))}var Hn,Yn=function(e,t){this.h=e>>>0,this.g=t>>>0};function Zn(e){return e?/^-?\d+$/.test(e)?(kn(e),new $n(mn,gn)):null:Qn||(Qn=new $n(0,0))}var Qn,$n=function(e,t){this.h=e>>>0,this.g=t>>>0};function Xn(e,t,n){for(;0<n||127<t;)e.g.push(127&t|128),t=(t>>>7|n<<25)>>>0,n>>>=7;e.g.push(t)}function Kn(e,t){for(;127<t;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function Jn(e,t){if(0<=t)Kn(e,t);else{for(var n=0;9>n;n++)e.g.push(127&t|128),t>>=7;e.g.push(1)}}function er(e,t){e.g.push(t>>>0&255),e.g.push(t>>>8&255),e.g.push(t>>>16&255),e.g.push(t>>>24&255)}function tr(e,t){0!==t.length&&(e.l.push(t),e.h+=t.length)}function nr(e,t,n){Kn(e.g,8*t+n)}function rr(e,t){return nr(e,t,2),t=e.g.end(),tr(e,t),t.push(e.h),t}function or(e,t){var n=t.pop();for(n=e.h+e.g.length()-n;127<n;)t.push(127&n|128),n>>>=7,e.h++;t.push(n),e.h++}function ir(e,t,n){nr(e,t,2),Kn(e.g,n.length),tr(e,e.g.end()),tr(e,n)}function ar(e,t,n,r){null!=n&&(t=rr(e,t),r(n,e),or(e,t))}var sr=function(e,t,n,r){this.g=e,this.h=t,this.l=n,this.pa=r};function ur(e){return Array.prototype.slice.call(e)}function cr(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():e}var lr=cr(),dr=cr("0di"),fr=cr("2ex"),pr=lr?function(e,t){e[lr]|=t}:function(e,t){void 0!==e.g?e.g|=t:Object.defineProperties(e,{g:{value:t,configurable:!0,writable:!0,enumerable:!1}})},hr=lr?function(e,t){e[lr]&=~t}:function(e,t){void 0!==e.g&&(e.g&=~t)};function mr(e,t,n){return n?e|t:e&~t}var gr=lr?function(e){return 0|e[lr]}:function(e){return 0|e.g},vr=lr?function(e){return e[lr]}:function(e){return e.g},yr=lr?function(e,t){return e[lr]=t,e}:function(e,t){return void 0!==e.g?e.g=t:Object.defineProperties(e,{g:{value:t,configurable:!0,writable:!0,enumerable:!1}}),e};function br(e){return pr(e,34),e}function xr(e,t){yr(t,-14591&e)}function Cr(e,t){yr(t,-14557&e|34)}function wr(e){return 0==(e=e>>14&1023)?536870912:e}var Er,kr={},Dr={};function Mr(e){return!(!e||"object"!=typeof e||e.Ja!==Dr)}function Tr(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&e.constructor===Object}function Ir(e,t,n){if(null!=e)if("string"==typeof e)e=e?new sn(e,nn):on();else if(e.constructor!==sn)if(Jt(e))e=e.length?new sn(n?e:new Uint8Array(e),nn):on();else{if(!t)throw Error();e=void 0}return e}function Sr(e,t,n){if(!Array.isArray(e)||e.length)return!1;var r=gr(e);return!!(1&r)||!(!t||!(Array.isArray(t)?t.includes(n):t.has(n)))&&(yr(e,1|r),!0)}var Nr=[];function Ar(e){if(2&e)throw Error()}yr(Nr,55),Er=Object.freeze(Nr);var Lr,Or,Rr,Fr=function(){function e(e,t,n){this.l=0,this.g=e,this.h=t,this.m=n}var t=e.prototype;return t.next=function(){if(this.l<this.g.length){var e=this.g[this.l++];return{done:!1,value:this.h?this.h.call(this.m,e):e}}return{done:!0,value:void 0}},t[Symbol.iterator]=function(){return new e(this.g,this.h,this.m)},e}();function Pr(e,t){(t=Lr?t[Lr]:void 0)&&(e[Lr]=ur(t))}function Ur(e,t){e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity=t}function _r(){var e=Error();Ur(e,"incident"),function(e){kt.setTimeout((function(){throw e}),0)}(e)}function jr(e){return Ur(e=Error(e),"warning"),e}function Br(e){return null==e||"number"==typeof e?e:"NaN"===e||"Infinity"===e||"-Infinity"===e?Number(e):void 0}function zr(e){return null==e||"boolean"==typeof e?e:"number"==typeof e?!!e:void 0}Object.freeze(new function(){}),Object.freeze(new function(){});var Gr,Vr,Wr,qr=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Hr(e){var t=typeof e;return"number"===t?Number.isFinite(e):"string"===t&&qr.test(e)}function Yr(e){if(null==e)return e;if("string"==typeof e){if(!e)return;e=+e}return"number"==typeof e&&Number.isFinite(e)?0|e:void 0}function Zr(e){if(null==e)return e;if("string"==typeof e){if(!e)return;e=+e}return"number"==typeof e&&Number.isFinite(e)?e>>>0:void 0}function Qr(e){return"-"!==e[0]&&(20>e.length||20===e.length&&184467>Number(e.substring(0,6)))}function $r(e){return"-"===e[0]?20>e.length||20===e.length&&-922337<Number(e.substring(0,7)):19>e.length||19===e.length&&922337>Number(e.substring(0,6))}function Xr(e){return e=Math.trunc(e),Number.isSafeInteger(e)||(vn(e),e=xn(mn,gn)),e}function Kr(e){var t=Math.trunc(Number(e));return Number.isSafeInteger(t)?String(t):(-1!==(t=e.indexOf("."))&&(e=e.substring(0,t)),$r(e)||(kn(e),e=En()),e)}function Jr(e){return null==e?e:Hr(e)?"number"==typeof e?Xr(e):Kr(e):void 0}function eo(e){if("string"!=typeof e)throw Error();return e}function to(e){if(null!=e&&"string"!=typeof e)throw Error();return e}function no(e){return null==e||"string"==typeof e?e:void 0}function ro(e,t,n,r){if(null!=e&&"object"==typeof e&&e.X===kr)return e;if(!Array.isArray(e))return n?2&r?(e=t[dr])?t=e:(br((e=new t).s),t=t[dr]=e):t=new t:t=void 0,t;var o=n=gr(e);return 0===o&&(o|=32&r),(o|=2&r)!==n&&yr(e,o),new t(e)}function oo(e,t,n){if(t){var r=!!r;if(!Hr(t=e))throw jr("int64");"string"==typeof t?r=Kr(t):r?(r=Math.trunc(t),Number.isSafeInteger(r)?r=String(r):$r(t=String(r))?r=t:(vn(r),r=En())):r=Xr(t)}else r=Jr(e);return"string"==typeof(n=null==(e=r)?n?0:void 0:e)&&(r=+n,Number.isSafeInteger(r))?r:n}function io(e){switch(typeof e){case"boolean":return Vr||(Vr=[0,void 0,!0]);case"number":return 0<e?void 0:0===e?Wr||(Wr=[0,void 0]):[-e,void 0];case"string":return[0,e];case"object":return e}}function ao(e,t){return so(e,t[0],t[1])}function so(e,t,n){if(null==e&&(e=Gr),Gr=void 0,null==e){var r=96;n?(e=[n],r|=512):e=[],t&&(r=-16760833&r|(1023&t)<<14)}else{if(!Array.isArray(e))throw Error("narr");if(2048&(r=gr(e)))throw Error("farr");if(64&r)return e;if(r|=64,n&&(r|=512,n!==e[0]))throw Error("mid");e:{var o=(n=e).length;if(o){var i=o-1;if(Tr(n[i])){if(1024<=(t=i-(+!!(512&(r|=256))-1)))throw Error("pvtlmt");r=-16760833&r|(1023&t)<<14;break e}}if(t){if(1024<(t=Math.max(t,o-(+!!(512&r)-1))))throw Error("spvt");r=-16760833&r|(1023&t)<<14}}}return yr(e,r),e}var uo={},co=function(){try{return Bt(new(function(e){function t(){return e.call(this)||this}return lt(t,e),t}(pt(Map)))),!1}catch(e){return!0}}(),lo=function(){function e(){this.g=new Map}var t=e.prototype;return t.get=function(e){return this.g.get(e)},t.set=function(e,t){return this.g.set(e,t),this.size=this.g.size,this},t.delete=function(e){return e=this.g.delete(e),this.size=this.g.size,e},t.clear=function(){this.g.clear(),this.size=this.g.size},t.has=function(e){return this.g.has(e)},t.entries=function(){return this.g.entries()},t.keys=function(){return this.g.keys()},t.values=function(){return this.g.values()},t.forEach=function(e,t){return this.g.forEach(e,t)},t[Symbol.iterator]=function(){return this.entries()},e}();function fo(e){return e}function po(e){if(2&e.N)throw Error("Cannot mutate an immutable Map")}var ho,mo=function(e){function t(t,n,r,o){var i;void 0===r&&(r=fo),void 0===o&&(o=fo),i=e.call(this)||this;var a=gr(t);yr(t,a|=64),i.N=a,i.U=n,i.S=r,i.Z=i.U?go:o;for(var s=0;s<t.length;s++){var u=t[s],c=r(u[0],!1,!0),l=u[1];n?void 0===l&&(l=null):l=o(u[1],!1,!0,void 0,void 0,a),e.prototype.set.call(i,c,l)}return i}lt(t,e);var n=t.prototype;return n.oa=function(e){if(void 0===e&&(e=vo),0!==this.size)return this.Y(e)},n.Y=function(t){void 0===t&&(t=vo);for(var n,r=[],o=e.prototype.entries.call(this);!(n=o.next()).done;)(n=n.value)[0]=t(n[0]),n[1]=t(n[1]),r.push(n);return r},n.clear=function(){po(this),e.prototype.clear.call(this)},n.delete=function(t){return po(this),e.prototype.delete.call(this,this.S(t,!0,!1))},n.entries=function(){var e=this.na();return new Fr(e,yo,this)},n.keys=function(){return this.Ia()},n.values=function(){var e=this.na();return new Fr(e,mo.prototype.get,this)},n.forEach=function(t,n){var r=this;e.prototype.forEach.call(this,(function(e,o){t.call(n,r.get(o),o,r)}))},n.set=function(t,n){return po(this),null==(t=this.S(t,!0,!1))?this:null==n?(e.prototype.delete.call(this,t),this):e.prototype.set.call(this,t,this.Z(n,!0,!0,this.U,!1,this.N))},n.Oa=function(t){var n=this.S(t[0],!1,!0);t=t[1],t=this.U?void 0===t?null:t:this.Z(t,!1,!0,void 0,!1,this.N),e.prototype.set.call(this,n,t)},n.has=function(t){return e.prototype.has.call(this,this.S(t,!1,!1))},n.get=function(t){t=this.S(t,!1,!1);var n=e.prototype.get.call(this,t);if(void 0!==n){var r=this.U;return r?((r=this.Z(n,!1,!0,r,this.ta,this.N))!==n&&e.prototype.set.call(this,t,r),r):n}},n.na=function(){return Array.from(e.prototype.keys.call(this))},n.Ia=function(){return e.prototype.keys.call(this)},n[Symbol.iterator]=function(){return this.entries()},t}(co?(Object.setPrototypeOf(lo.prototype,Map.prototype),Object.defineProperties(lo.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),lo):function(e){function t(){return e.call(this)||this}return lt(t,e),t}(pt(Map)));function go(e,t,n,r,o,i){return e=ro(e,r,n,i),o&&(e=To(e)),e}function vo(e){return e}function yo(e){return[e,this.get(e)]}function bo(){return ho||(ho=new mo(br([]),void 0,void 0,void 0,uo))}function xo(e,t,n,r,o){if(null!=e){if(Array.isArray(e))e=Sr(e,void 0,0)?void 0:o&&2&gr(e)?e:Co(e,t,n,void 0!==r,o);else if(Tr(e)){var i={};for(var a in e)i[a]=xo(e[a],t,n,r,o);e=i}else e=t(e,r);return e}}function Co(e,t,n,r,o){var i=r||n?gr(e):0;r=r?!!(32&i):void 0;for(var a=ur(e),s=0;s<a.length;s++)a[s]=xo(a[s],t,n,r,o);return n&&(Pr(a,e),n(i,a)),a}function wo(e){return xo(e,Eo,void 0,void 0,!1)}function Eo(e){return e.X===kr?e.toJSON():e instanceof mo?e.oa(wo):function(e){switch(typeof e){case"number":return isFinite(e)?e:String(e);case"boolean":return e?1:0;case"object":if(e)if(Array.isArray(e)){if(Sr(e,void 0,0))return}else{if(Jt(e))return Yt(e);if(e instanceof sn){var t=e.g;return null==t?"":"string"==typeof t?t:e.g=Yt(t)}if(e instanceof mo)return e.oa()}}return e}(e)}function ko(e,t,n){if(void 0===n&&(n=Cr),null!=e){if(qt&&e instanceof Uint8Array)return t?e:new Uint8Array(e);if(Array.isArray(e)){var r=gr(e);return 2&r||(t&&(t=0===r||!!(32&r)&&!(64&r||!(16&r))),e=t?yr(e,-12293&r|34):Co(e,ko,4&r?Cr:n,!0,!0)),e}return e.X===kr?e=2&(r=vr(n=e.s))?e:Do(e,n,r,!0):e instanceof mo&&!(2&e.N)&&(n=br(e.Y(ko)),e=new mo(n,e.U,e.S,e.Z)),e}}function Do(e,t,n,r){return e=e.constructor,Gr=t=Mo(t,n,r),t=new e(t),Gr=void 0,t}function Mo(e,t,n){var r=n||2&t?Cr:xr,o=!!(32&t);return e=function(e,t,n){var r=ur(e),o=r.length,i=256&t?r[o-1]:void 0;for(o+=i?-1:0,t=512&t?1:0;t<o;t++)r[t]=n(r[t]);if(i)for(var a in t=r[t]={},i)t[a]=n(i[a]);return Pr(r,e),r}(e,t,(function(e){return ko(e,o,r)})),pr(e,32|(n?2:0)),e}function To(e){var t=e.s,n=vr(t);return 2&n?Do(e,t,n,!1):e}function Io(e,t,n,r){return!(4&t)||null!=n}function So(e,t){return Ao(e=e.s,vr(e),t)}function No(e,t,n,r){if(!(0>(t=r+(+!!(512&t)-1))||t>=e.length||t>=n))return e[t]}function Ao(e,t,n,r){if(-1===n)return null;var o,i=wr(t);return n>=i?256&t?e[e.length-1][n]:void 0:r&&256&t&&null!=(r=e[e.length-1][n])?(No(e,t,i,n)&&null!=fr&&(4<=(t=(e=null!=(o=Rr)?o:Rr={})[fr]||0)||(e[fr]=t+1,_r())),r):No(e,t,i,n)}function Lo(e,t,n,r){var o=e.s,i=vr(o);return Ar(i),Oo(o,i,t,n,r),e}function Oo(e,t,n,r,o){var i=wr(t);if(n>=i||o){var a=t;if(256&t)o=e[e.length-1];else{if(null==r)return a;o=e[i+(+!!(512&t)-1)]={},a|=256}return o[n]=r,n<i&&(e[n+(+!!(512&t)-1)]=void 0),a!==t&&yr(e,a),a}return e[n+(+!!(512&t)-1)]=r,256&t&&n in(e=e[e.length-1])&&delete e[n],t}function Ro(e,t,n,r,o){var i=2&t,a=Ao(e,t,n,o);Array.isArray(a)||(a=Er);var s=!(2&r);r=!(1&r);var u=!!(32&t),c=gr(a);return 0!==c||!u||i||s?1&c||yr(a,c|=1):yr(a,c|=33),i?(e=!1,2&c||(br(a),e=!!(4&c)),(r||e)&&Object.freeze(a)):(i=!!(2&c)||!!(2048&c),r&&i?(a=ur(a),r=1,u&&!s&&(r|=32),yr(a,r),Oo(e,t,n,a,o)):s&&32&c&&!i&&hr(a,32)),a}function Fo(e,t){var n=vr(e=e.s),r=Ao(e,n,t),o=Br(r);return null!=o&&o!==r&&Oo(e,n,t,o),o}function Po(e){var t=vr(e=e.s),n=Ao(e,t,1),r=Ir(n,!0,!!(34&t));return null!=r&&r!==n&&Oo(e,t,1,r),r}function Uo(e,t,n){var r=e.s,o=vr(r),i=2&o?1:2,a=_o(r,o,t),s=gr(a);if(Io(0,s,void 0)){(4&s||Object.isFrozen(a))&&(a=ur(a),s=ti(s,o),o=Oo(r,o,t,a));for(var u=e=0;e<a.length;e++){var c=n(a[e]);null!=c&&(a[u++]=c)}u<e&&(a.length=u),s=mr(s=jo(s,o),20,!0),s=mr(s,4096,!1),s=mr(s,8192,!1),yr(a,s),2&s&&Object.freeze(a)}return Bo(s)||(n=s,(s=(e=1===i||4===i&&!!(32&s))?mr(s,2,!0):ni(s,o,!1))!==n&&yr(a,s),e&&Object.freeze(a)),2===i&&Bo(s)&&(a=ur(a),s=ni(s=ti(s,o),o,!1),yr(a,s),Oo(r,o,t,a)),a}function _o(e,t,n){return e=Ao(e,t,n),Array.isArray(e)?e:Er}function jo(e,t){return 0===e&&(e=ti(e,t)),mr(e,1,!0)}function Bo(e){return!!(2&e)&&!!(4&e)||!!(2048&e)}function zo(e){e=ur(e);for(var t=0;t<e.length;t++){var n=e[t]=ur(e[t]);Array.isArray(n[1])&&(n[1]=br(n[1]))}return e}function Go(e,t,n){var r=e.s,o=vr(r);if(Ar(o),null==n)Oo(r,o,t);else{var i,a=gr(n),s=a,u=!!(2&a)||Object.isFrozen(n);if((i=!u)&&(i=!1),Io(0,a))for(a=21,u&&(n=ur(n),s=0,a=ni(a=ti(a,o),o,!0)),e=0;e<n.length;e++)n[e]=eo(n[e]);i&&(n=ur(n),s=0,a=ni(a=ti(a,o),o,!0)),a!==s&&yr(n,a),Oo(r,o,t,n)}}function Vo(e,t,n,r){var o=vr(e=e.s);Ar(o),Oo(e,o,t,("0"===r?0===Number(n):n===r)?void 0:n)}function Wo(e,t,n,r){var o=vr(e);Ar(o),e=Ro(e,o,t,2),r=n(r,!!(4&(t=gr(e)))&&!!(4096&t)),e.push(r)}function qo(e){return e}function Ho(e,t){return Yo(e=e.s,vr(e),zs)===t?t:-1}function Yo(e,t,n){for(var r=0,o=0;o<n.length;o++){var i=n[o];null!=Ao(e,t,i)&&(0!==r&&(t=Oo(e,t,r)),r=i)}return r}function Zo(e,t,n,r){var o=vr(e);Ar(o);var i,a=Ao(e,o,n,r);if(null!=a&&a.X===kr)return(t=To(a))!==a&&Oo(e,o,n,t,r),t.s;if(Array.isArray(a)){var s=gr(a);i=ao(i=2&s?Mo(a,s,!1):a,t)}else i=ao(void 0,t);return i!==a&&Oo(e,o,n,i,r),i}function Qo(e,t,n,r){var o=vr(e=e.s),i=Ao(e,o,n,r);return(t=ro(i,t,!1,o))!==i&&null!=t&&Oo(e,o,n,t,r),t}function $o(e,t,n,r){if(void 0===r&&(r=!1),null==(t=Qo(e,t,n,r)))return t;var o=vr(e=e.s);if(!(2&o)){var i=To(t);i!==t&&Oo(e,o,n,t=i,r)}return t}function Xo(e,t,n,r,o,i){var a=2,s=!!(2&t);a=s?1:a,o=!!o,i&&(i=!s),s=_o(e,t,r);var u=gr(s),c=!!(4&u);if(!c){var l=s,d=t,f=!!(2&(u=jo(u,t)));f&&(d=mr(d,2,!0));for(var p=!f,h=!0,m=0,g=0;m<l.length;m++){var v=ro(l[m],n,!1,d);if(v instanceof n){if(!f){var y=!!(2&gr(v.s));p&&(p=!y),h&&(h=y)}l[g++]=v}}g<m&&(l.length=g),u=mr(u,4,!0),u=mr(u,16,h),u=mr(u,8,p),yr(l,u),f&&Object.freeze(l)}if(i&&!(8&u||!s.length&&(1===a||4===a&&32&u))){for(Bo(u)&&(s=ur(s),u=ti(u,t),t=Oo(e,t,r,s)),n=s,i=u,l=0;l<n.length;l++)(u=n[l])!==(d=To(u))&&(n[l]=d);i=mr(i,8,!0),i=mr(i,16,!n.length),yr(n,i),u=i}return Bo(u)||(n=u,(u=(i=1===a||4===a&&!!(32&u))?mr(u,!s.length||16&u&&(!c||32&u)?2:2048,!0):ni(u,t,o))!==n&&yr(s,u),i&&Object.freeze(s)),2===a&&Bo(u)&&(s=ur(s),u=ni(u=ti(u,t),t,o),yr(s,u),Oo(e,t,r,s)),s}function Ko(e,t,n){var r=vr(e=e.s);return Xo(e,r,t,n,!1,!(2&r))}function Jo(e,t,n,r,o){return null==r&&(r=void 0),Lo(e,n,r,o)}function ei(e,t,n,r){null==r&&(r=void 0);var o=vr(e=e.s);Ar(o),(n=Yo(e,o,n))&&n!==t&&null!=r&&(o=Oo(e,o,n)),Oo(e,o,t,r)}function ti(e,t){return e=mr(e,2,!!(2&t)),e=mr(e,32,!0),mr(e,2048,!1)}function ni(e,t,n){return 32&t&&n||(e=mr(e,32,!1)),e}function ri(e,t,n,r){var o=vr(e=e.s);Ar(o),t=Xo(e,o,n,t,!0),n=null!=r?r:new n,t.push(n),2&gr(n.s)?hr(t,8):hr(t,16)}function oi(e,t){return Yr(So(e,t))}function ii(e,t){return null!=e?e:t}function ai(e,t){return ii(Fo(e,t),0)}function si(e,t){return ii(no(So(e,t)),"")}function ui(e,t,n){if(null!=n&&"boolean"!=typeof n)throw e=typeof n,Error("Expected boolean but got "+("object"!=e?e:n?Array.isArray(n)?"array":e:"null")+": "+n);Lo(e,t,n)}function ci(e,t,n){if(null!=n){if("number"!=typeof n)throw jr("int32");if(!Number.isFinite(n))throw jr("int32");n|=0}Lo(e,t,n)}function li(e,t,n){if(null!=n&&"number"!=typeof n)throw Error("Value of float/double field must be a number, found "+typeof n+": "+n);Lo(e,t,n)}function di(e,t,n){t.g?t.m(e,t.g,t.h,n,!0):t.m(e,t.h,n,!0)}mo.prototype.toJSON=void 0,mo.prototype.Ja=Dr;var fi=function(){function e(e,t){this.s=so(e,t)}var t=e.prototype;return t.toJSON=function(){return pi(this,Co(this.s,Eo,void 0,void 0,!1),!0)},t.l=function(){var e=Wu;return e.g?e.l(this,e.g,e.h,!0):e.l(this,e.h,e.defaultValue,!0)},t.clone=function(){var e=this.s;return Do(this,e,vr(e),!1)},t.P=function(){return!!(2&gr(this.s))},e}();function pi(e,t,n){var r,o,i=Rt?void 0:e.constructor.B,a=vr(n?e.s:t);if(!(e=t.length))return t;if(Tr(n=t[e-1])){e:{var s=n,u={},c=!1;for(var l in s){var d=s[l];if(Array.isArray(d)){var f=d;(Sr(d,i,+l)||Mr(d)&&0===d.size)&&(d=null),d!=f&&(c=!0)}null!=d?u[l]=d:c=!0}if(c){for(var p in u){s=u;break e}s=null}}s!=n&&(r=!0),e--}for(l=+!!(512&a)-1;0<e&&(n=t[p=e-1],p-=l,null==n||Sr(n,i,p)||Mr(n)&&0===n.size);e--)o=!0;return r||o?(t=Array.prototype.slice.call(t,0,e),s&&t.push(s),t):t}function hi(e){return Array.isArray(e)?e[0]instanceof sr?e:[ma,e]:[e,void 0]}function mi(e,t){if(Array.isArray(t)){var n=gr(t);if(4&n)return t;for(var r=0,o=0;r<t.length;r++){var i=e(t[r]);null!=i&&(t[o++]=i)}return o<r&&(t.length=o),yr(t,-12289&n|5),2&n&&Object.freeze(t),t}}fi.prototype.X=kr,fi.prototype.toString=function(){return pi(this,this.s,!1).toString()};var gi=Symbol();function vi(e){var t=e[gi];if(!t){var n=Di(e),r=Ui(e),o=r.l;t=o?function(e,t){return o(e,t,r)}:function(e,t){for(;_n(t)&&4!=t.h;){var o=t.m,i=r[o];if(!i){var a=r.ea;a&&(a=a[o])&&(i=r[o]=yi(a))}i&&i(t,e,o)||(o=(i=t).l,jn(i),i.ia?i=void 0:(a=i.g.g-o,i.g.g=o,i=Pn(i.g,a)),o=e,i&&(Lr||(Lr=Symbol()),(a=o[Lr])?a.push(i):o[Lr]=[i]))}n===bi||n===xi||n.j||(e[Or||(Or=Symbol())]=n)},e[gi]=t}return t}function yi(e){var t=(e=hi(e))[0].g;if(e=e[1]){var n=vi(e),r=Ui(e).T;return function(e,o,i){return t(e,o,i,r,n)}}return t}var bi,xi,Ci=function(){},wi=Symbol();function Ei(e,t,n){var r,o=n[1];if(o){var i=o[wi];r=i?i.T:io(o[0]),e[t]=null!=i?i:o}r&&r===Vr?(e.g||(e.g=new Set)).add(t):n[0]&&(e.h||(e.h=new Set)).add(t)}function ki(e,t){return[e.l,!t||0<t[0]?void 0:t]}function Di(e){var t=e[wi];if(t)return t;if(!(t=Ti(e,e[wi]=new Ci,ki,ki,Ei)).ea&&!t.h&&!t.g){var n=!0;for(var r in t)isNaN(r)||(n=!1);n?(io(e[0])===Vr?xi?t=xi:((t=new Ci).T=io(!0),t=xi=t):t=bi||(bi=new Ci),t=e[wi]=t):t.j=!0}return t}function Mi(e,t,n){e[t]=n}function Ti(e,t,n,r,o){void 0===o&&(o=Mi),t.T=io(e[0]);var i=0,a=e[++i];a&&a.constructor===Object&&(t.ea=a,"function"==typeof(a=e[++i])&&(t.l=a,t.m=e[++i],a=e[++i]));for(var s={};Array.isArray(a)&&"number"==typeof a[0]&&0<a[0];){for(var u=0;u<a.length;u++)s[a[u]]=a;a=e[++i]}for(u=1;void 0!==a;){var c=void 0;"number"==typeof a&&(u+=a,a=e[++i]);var l=void 0;if(a instanceof sr?c=a:(c=ga,i--),c.pa){a=e[++i],l=e;var d=i;"function"==typeof a&&(a=a(),l[d]=a),l=a}for(d=u+1,"number"==typeof(a=e[++i])&&0>a&&(d-=a,a=e[++i]);u<d;u++){var f=s[u];o(t,u,l?r(c,l,f):n(c,f))}}return t}var Ii=Symbol();function Si(e){var t=e[Ii];if(!t){var n=Oi(e);t=function(e,t){return Bi(e,t,n)},e[Ii]=t}return t}var Ni=Symbol();function Ai(e){return e.h}function Li(e,t){var n,r,o=e.h;return function(e,i,a){return o(e,i,a,r||(r=Oi(t).T),n||(n=Si(t)))}}function Oi(e){var t=e[Ni];return t||(t=Ti(e,e[Ni]={},Ai,Li),_i(e),t)}var Ri=Symbol();function Fi(e,t){var n=e.g;return t?function(e,r,o){return n(e,r,o,t)}:n}function Pi(e,t,n){var r,o,i=e.g;return function(e,a,s){return i(e,a,s,o||(o=Ui(t).T),r||(r=vi(t)),n)}}function Ui(e){var t=e[Ri];return t||(Di(e),t=Ti(e,e[Ri]={},Fi,Pi),_i(e),t)}function _i(e){Ri in e&&wi in e&&Ni in e&&(e.length=0)}function ji(e,t){var n=e[t];if(n)return n;if((n=e.ea)&&(n=n[t])){var r=(n=hi(n))[0].h;if(n=n[1]){var o=Si(n),i=Oi(n).T;n=(n=e.m)?n(i,o):function(e,t,n){return r(e,t,n,i,o)}}else n=r;return e[t]=n}}function Bi(e,t,n){for(var r=vr(e),o=+!!(512&r)-1,i=e.length,a=512&r?1:0,s=i+(256&r?-1:0);a<s;a++){var u=e[a];if(null!=u){var c=a-o,l=ji(n,c);l&&l(t,u,c)}}if(256&r)for(var d in r=e[i-1])o=+d,Number.isNaN(o)||null!=(i=r[d])&&(s=ji(n,o))&&s(t,i,o);if(e=Lr?e[Lr]:void 0)for(tr(t,t.g.end()),n=0;n<e.length;n++)tr(t,an(e[n])||en())}function zi(e,t){return new sr(e,t,!1,!1)}function Gi(e,t){return new sr(e,t,!0,!1)}function Vi(e,t){return new sr(e,t,!1,!0)}function Wi(e,t,n){Oo(e,vr(e),t,n)}var qi=Vi((function(e,t,n,r,o){return 2===e.h&&(e=Bn(e,ao([void 0,void 0],r),o),Ar(r=vr(t)),(o=Ao(t,r,n))instanceof mo?2&o.N?((o=o.Y()).push(e),Oo(t,r,n,o)):o.Oa(e):Array.isArray(o)?(2&gr(o)&&Oo(t,r,n,o=zo(o)),o.push(e)):Oo(t,r,n,[e]),!0)}),(function(e,t,n,r,o){if(t instanceof mo)t.forEach((function(t,i){ar(e,n,ao([i,t],r),o)}));else if(Array.isArray(t))for(var i=0;i<t.length;i++){var a=t[i];Array.isArray(a)&&ar(e,n,ao(a,r),o)}}));function Hi(e,t,n){e:if(null!=t){if(Hr(t)){if("string"==typeof t){t=Kr(t);break e}if("number"==typeof t){t=Xr(t);break e}}t=void 0}null!=t&&("string"==typeof t&&Zn(t),null!=t&&(nr(e,n,0),"number"==typeof t?(e=e.g,vn(t),Xn(e,mn,gn)):(n=Zn(t),Xn(e.g,n.h,n.g))))}function Yi(e,t,n){null!=(t=Yr(t))&&null!=t&&(nr(e,n,0),Jn(e.g,t))}function Zi(e,t,n){null!=(t=zr(t))&&(nr(e,n,0),e.g.g.push(t?1:0))}function Qi(e,t,n){null!=(t=no(t))&&ir(e,n,At(t))}function $i(e,t,n,r,o){ar(e,n,t instanceof fi?t.s:Array.isArray(t)?ao(t,r):void 0,o)}function Xi(e,t,n){null!=(t=null==t||"string"==typeof t||Jt(t)||t instanceof sn?t:void 0)&&ir(e,n,dn(t).buffer)}function Ki(e,t,n){return(5===e.h||2===e.h)&&(t=Ro(t,vr(t),n,2,!1),2==e.h?Vn(e,An,t):t.push(An(e.g)),!0)}var Ji,ea=zi((function(e,t,n){if(1!==e.h)return!1;var r=e.g;e=Nn(r);var o=Nn(r);r=2*(o>>31)+1;var i=o>>>20&2047;return e=4294967296*(1048575&o)+e,Wi(t,n,2047==i?e?NaN:1/0*r:0==i?r*Math.pow(2,-1074)*e:r*Math.pow(2,i-1075)*(e+4503599627370496)),!0}),(function(e,t,n){null!=(t=Br(t))&&(nr(e,n,1),e=e.g,(n=pn||(pn=new DataView(new ArrayBuffer(8)))).setFloat64(0,+t,!0),mn=n.getUint32(0,!0),gn=n.getUint32(4,!0),er(e,mn),er(e,gn))})),ta=zi((function(e,t,n){return 5===e.h&&(Wi(t,n,An(e.g)),!0)}),(function(e,t,n){null!=(t=Br(t))&&(nr(e,n,5),e=e.g,yn(t),er(e,mn))})),na=Gi(Ki,(function(e,t,n){if(null!=(t=mi(Br,t)))for(var r=0;r<t.length;r++){var o=e,i=t[r];null!=i&&(nr(o,n,5),o=o.g,yn(i),er(o,mn))}})),ra=Gi(Ki,(function(e,t,n){if(null!=(t=mi(Br,t))&&t.length){nr(e,n,2),Kn(e.g,4*t.length);for(var r=0;r<t.length;r++)n=e.g,yn(t[r]),er(n,mn)}})),oa=zi((function(e,t,n){return 0===e.h&&(Wi(t,n,Mn(e.g,xn)),!0)}),Hi),ia=zi((function(e,t,n){return 0===e.h&&(Wi(t,n,0===(e=Mn(e.g,xn))?void 0:e),!0)}),Hi),aa=zi((function(e,t,n){return 0===e.h&&(Wi(t,n,Mn(e.g,bn)),!0)}),(function(e,t,n){e:if(null!=t){if(Hr(t)){if("string"==typeof t){var r=Math.trunc(Number(t));Number.isSafeInteger(r)&&0<=r?t=String(r):(-1!==(r=t.indexOf("."))&&(t=t.substring(0,r)),Qr(t)||(kn(t),t=Cn(mn,gn)));break e}if("number"==typeof t){t=0<=(t=Math.trunc(t))&&Number.isSafeInteger(t)?t:function(e){if(0>e){vn(e);var t=Cn(mn,gn);return e=Number(t),Number.isSafeInteger(e)?e:t}return Qr(String(e))?e:(vn(e),bn(mn,gn))}(t);break e}}t=void 0}null!=t&&("string"==typeof t&&qn(t),null!=t&&(nr(e,n,0),"number"==typeof t?(e=e.g,vn(t),Xn(e,mn,gn)):(n=qn(t),Xn(e.g,n.h,n.g))))})),sa=zi((function(e,t,n){return 0===e.h&&(Wi(t,n,In(e.g)),!0)}),Yi),ua=Gi((function(e,t,n){return(0===e.h||2===e.h)&&(t=Ro(t,vr(t),n,2,!1),2==e.h?Vn(e,In,t):t.push(In(e.g)),!0)}),(function(e,t,n){if(null!=(t=mi(Yr,t))&&t.length){n=rr(e,n);for(var r=0;r<t.length;r++)Jn(e.g,t[r]);or(e,n)}})),ca=zi((function(e,t,n){return 0===e.h&&(Wi(t,n,0===(e=In(e.g))?void 0:e),!0)}),Yi),la=zi((function(e,t,n){return 0===e.h&&(Wi(t,n,Tn(e.g)),!0)}),Zi),da=zi((function(e,t,n){return 0===e.h&&(Wi(t,n,!1===(e=Tn(e.g))?void 0:e),!0)}),Zi),fa=Gi((function(e,t,n){return 2===e.h&&(Wo(t,n,qo,e=zn(e)),!0)}),(function(e,t,n){if(null!=(t=mi(no,t)))for(var r=0;r<t.length;r++){var o=t[r];null!=o&&ir(e,n,At(o))}})),pa=zi((function(e,t,n){return 2===e.h&&(Wi(t,n,""===(e=zn(e))?void 0:e),!0)}),Qi),ha=zi((function(e,t,n){return 2===e.h&&(Wi(t,n,zn(e)),!0)}),Qi),ma=Vi((function(e,t,n,r,o){return 2===e.h&&(Bn(e,Zo(t,r,n,!0),o),!0)}),$i),ga=Vi((function(e,t,n,r,o){return 2===e.h&&(Bn(e,Zo(t,r,n),o),!0)}),$i);Ji=new sr((function(e,t,n,r,o){if(2!==e.h)return!1;r=ao(void 0,r);var i=vr(t);Ar(i);var a=Ro(t,i,n,3);return i=vr(t),4&gr(a)&&(a=ur(a),yr(a,-2079&gr(a)|1),Oo(t,i,n,a)),a.push(r),Bn(e,r,o),!0}),(function(e,t,n,r,o){if(Array.isArray(t))for(var i=0;i<t.length;i++)$i(e,t[i],n,r,o)}),!0,!0);var va=Vi((function(e,t,n,r,o,i){if(2!==e.h)return!1;var a=vr(t);return Ar(a),(i=Yo(t,a,i))&&n!==i&&Oo(t,a,i),Bn(e,t=Zo(t,r,n),o),!0}),$i),ya=zi((function(e,t,n){return 2===e.h&&(Wi(t,n,Gn(e)),!0)}),Xi),ba=Gi((function(e,t,n){return(0===e.h||2===e.h)&&(t=Ro(t,vr(t),n,2,!1),2==e.h?Vn(e,Sn,t):t.push(Sn(e.g)),!0)}),(function(e,t,n){if(null!=(t=mi(Zr,t)))for(var r=0;r<t.length;r++){var o=e,i=t[r];null!=i&&(nr(o,n,0),Kn(o.g,i))}})),xa=zi((function(e,t,n){return 0===e.h&&(Wi(t,n,In(e.g)),!0)}),(function(e,t,n){null!=(t=Yr(t))&&(t=parseInt(t,10),nr(e,n,0),Jn(e.g,t))})),Ca=Gi((function(e,t,n){return(0===e.h||2===e.h)&&(t=Ro(t,vr(t),n,2,!1),2==e.h?Vn(e,Ln,t):t.push(In(e.g)),!0)}),(function(e,t,n){if(null!=(t=mi(Yr,t))&&t.length){n=rr(e,n);for(var r=0;r<t.length;r++)Jn(e.g,t[r]);or(e,n)}})),wa=function(e,t){this.h=e,this.g=t,this.l=$o,this.m=Jo,this.defaultValue=void 0};function Ea(e,t){return new wa(e,t)}function ka(e,t){return function(n,r){if(Wn.length){var o=Wn.pop();o.o(r),On(o.g,n,r),n=o}else n=new(function(){function e(e,t){if(Un.length){var n=Un.pop();On(n,e,t),e=n}else e=new(function(){function e(e,t){this.h=null,this.m=!1,this.g=this.l=this.j=0,On(this,e,t)}return e.prototype.clear=function(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.ca=!1},e}())(e,t);this.g=e,this.l=this.g.g,this.h=this.m=-1,this.o(t)}return e.prototype.o=function(e){var t=(void 0===e?{}:e).ia;this.ia=void 0!==t&&t},e}())(n,r);try{var i=new e,a=i.s;vi(t)(a,n);var s=i}finally{n.g.clear(),n.m=-1,n.h=-1,100>Wn.length&&Wn.push(n)}return s}}function Da(e){return function(){var t=new function(){this.l=[],this.h=0,this.g=new(function(){function e(){this.g=[]}var t=e.prototype;return t.length=function(){return this.g.length},t.end=function(){var e=this.g;return this.g=[],e},e}())};Bi(this.s,t,Oi(e)),tr(t,t.g.end());for(var n=new Uint8Array(t.h),r=t.l,o=r.length,i=0,a=0;a<o;a++){var s=r[a];n.set(s,i),i+=s.length}return t.l=[n],n}}var Ma=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Ta=[0,pa,zi((function(e,t,n){return 2===e.h&&(Wi(t,n,(e=Gn(e))===on()?void 0:e),!0)}),(function(e,t,n){if(null!=t){if(t instanceof fi){var r=t.Qa;return void(r&&(t=r(t),null!=t&&ir(e,n,dn(t).buffer)))}if(Array.isArray(t))return}Xi(e,t,n)}))],Ia=[0,ha],Sa=[0,sa,xa,la,-1,ua,xa,-1],Na=[0,la,-1],Aa=function(e){function t(){return e.call(this)||this}return lt(t,e),t}(fi);Aa.B=[6];var La=[0,la,ha,la,xa,-1,Ca,ha,-1,Na,xa],Oa=[0,ha,-2],Ra=function(e){function t(){return e.call(this)||this}return lt(t,e),t}(fi),Fa=[0],Pa=[0,sa,la,-4],Ua=function(e){function t(t){return e.call(this,t,2)||this}return lt(t,e),t}(fi),_a={},ja=[-2,_a,la];_a[336783863]=[0,ha,la,-1,sa,[0,[1,2,3,4,5,6],va,Fa,va,La,va,Oa,va,Pa,va,Sa,va,[0,ha]],Ia,la,[0,[1,3],[2,4],va,[0,ua],-1,va,[0,fa],-1,Ji,[0,ha,-1]],ha];var Ba=[0,pa,da],za=[0,ia,-1,da,-3,ia,ua,pa,ca,ia,-1,da,ca,da,-2,pa],Ga=[-1,{}],Va=[0,ha,1,Ga],Wa=[0,ha,fa,Ga];function qa(e,t){Vo(e,2,to(t),"")}function Ha(e,t){Wo(e.s,3,eo,t)}function Ya(e,t){Wo(e.s,4,eo,t)}var Za=function(e){function t(t){return e.call(this,t,500)||this}return lt(t,e),t.prototype.o=function(e){return Jo(this,0,7,e)},t}(fi);Za.B=[3,4,5,6,8,13,17,1005];var Qa=[-500,pa,-1,fa,-3,ja,Ji,Ta,ca,-1,Va,Wa,Ji,Ba,pa,za,ca,fa,987,fa],$a=[0,pa,-1,Ga],Xa=[-500,ha,-1,[-1,{}],998,ha],Ka=[-500,ha,fa,-1,[-2,{},la],997,fa,-1],Ja=[-500,ha,fa,Ga,998,fa];function es(e,t){ri(e,1,Za,t)}function ts(e,t){Wo(e.s,10,eo,t)}function ns(e,t){Wo(e.s,15,eo,t)}var rs=function(e){function t(t){return e.call(this,t,500)||this}return lt(t,e),t.prototype.o=function(e){return Jo(this,0,1001,e)},t}(fi);rs.B=[1,6,7,9,10,15,16,17,14,1002];var os=[-500,Ji,Qa,4,Ji,Xa,Ji,Ka,ca,Ji,Ja,fa,ca,Va,Wa,Ji,$a,fa,-2,za,pa,-1,da,979,Ga,Ji,Ta],is=ka(rs,os);rs.prototype.g=Da(os);var as=[0,Ji,[0,sa,-2]],ss=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),us=[0,sa,ta,ha,-1],cs=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t.prototype.g=function(){return Ko(this,ss,1)},t}(fi);cs.B=[1];var ls=[0,Ji,us],ds=ka(cs,ls),fs=[0,sa,ta],ps=[0,sa,-1,as],hs=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),ms=[0,sa,-3],gs=[0,ta,-3],vs=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),ys=[0,ta,-1,ha,ta],bs=function(e){function t(t){return e.call(this,t)||this}lt(t,e);var n=t.prototype;return n.h=function(){return $o(this,hs,2)},n.g=function(){return Ko(this,vs,5)},t}(fi);bs.B=[5];var xs=[0,xa,ms,gs,ps,Ji,ys],Cs=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi);Cs.B=[1,2,3,8,9];var ws=ka(Cs,[0,fa,ua,ra,xs,ha,-1,oa,Ji,fs,fa,oa]),Es=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),ks=[0,ta,-4],Ds=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi);Ds.B=[1];var Ms=ka(Ds,[0,Ji,ks]),Ts=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Is=[0,ta,-4],Ss=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi);Ss.B=[1];var Ns=ka(Ss,[0,Ji,Is]),As=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi);As.B=[3];var Ls=[0,sa,-1,ra,xa],Os=function(e){function t(){return e.call(this)||this}return lt(t,e),t}(fi);Os.prototype.g=Da([0,ta,-4,oa]);var Rs=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Fs=[0,1,sa,ha,ls],Ps=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi);Ps.B=[1];var Us=ka(Ps,[0,Ji,Fs,oa]),_s=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi);_s.B=[1];var js=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t.prototype.qa=function(){var e=Po(this);return null==e?on():e},t}(fi),Bs=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),zs=[1,2],Gs=[0,zs,va,[0,ra],va,[0,ya],sa,ha],Vs=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi);Vs.B=[1];var Ws=ka(Vs,[0,Ji,Gs,oa]),qs=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi);qs.B=[4,5];var Hs=[0,ha,sa,ta,fa,-1],Ys=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Zs=[0,la,-1],Qs=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),$s=[1,2,3,4,5],Xs=function(e){function t(t){return e.call(this,t)||this}lt(t,e);var n=t.prototype;return n.g=function(){return null!=Po(this)},n.h=function(){return null!=no(So(this,2))},t}(fi),Ks=[0,ya,ha,[0,sa,oa,-1],[0,aa,oa]],Js=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t.prototype.g=function(){var e;return null!=(e=zr(So(this,2)))&&e},t}(fi),eu=[0,Ks,la,[0,$s,va,Pa,va,La,va,Sa,va,Fa,va,Oa],xa],tu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),nu=[0,eu,ta,-1,sa],ru=Ea(502141897,tu);_a[502141897]=nu;var ou=[0,Ks];_a[512499200]=ou;var iu=[0,ou];_a[515723506]=iu;var au=ka(function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),[0,[0,xa,-1,na,ba],Ls]),su=[0,eu];_a[508981768]=su;var uu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),cu=[0,eu,ta,su,la],lu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),du=[0,eu,nu,cu,ta,iu];_a[508968149]=cu;var fu=Ea(508968150,lu);_a[508968150]=du;var pu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),hu=Ea(513916220,pu);_a[513916220]=[0,eu,du,sa];var mu=function(e){function t(t){return e.call(this,t)||this}lt(t,e);var n=t.prototype;return n.h=function(){return $o(this,qs,2)},n.g=function(){Lo(this,2)},t}(fi),gu=[0,eu,Hs];_a[478825465]=gu;var vu=[0,eu];_a[478825422]=vu;var yu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),bu=[0,eu,vu,gu,-1],xu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Cu=[0,eu,ta,sa],wu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Eu=[0,eu,ta],ku=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Du=[0,eu,Cu,Eu,ta],Mu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Tu=[0,eu,Du,bu];_a[463370452]=bu,_a[464864288]=Cu,_a[474472470]=Eu;var Iu=Ea(462713202,ku);_a[462713202]=Du;var Su=Ea(479097054,Mu);_a[479097054]=Tu;var Nu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Au=[0,eu],Lu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Ou=[0,eu,ta,-1,sa];_a[514774813]=Ou;var Ru=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Fu=[0,eu,ta,la];_a[518928384]=Fu;var Pu=function(e){function t(){return e.call(this)||this}return lt(t,e),t}(fi);Pu.prototype.g=Da([0,eu,Eu,Au,nu,cu,Ou,Fu]);var Uu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),_u=Ea(456383383,Uu);_a[456383383]=[0,eu,Hs];var ju=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Bu=Ea(476348187,ju);_a[476348187]=[0,eu,Zs];var zu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Gu=[0,xa,-1],Vu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi);Vu.B=[3];var Wu=Ea(458105876,function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t.prototype.g=function(){var e=this.s,t=vr(e),n=2&t;return e=function(e,t,n){var r=Vu,o=2&t,i=!1;if(null==n){if(o)return bo();n=[]}else if(n.constructor===mo){if(!(2&n.N)||o)return n;n=n.Y()}else Array.isArray(n)?i=!!(2&gr(n)):n=[];if(o){if(!n.length)return bo();i||(i=!0,br(n))}else i&&(i=!1,n=zo(n));return i||(64&gr(n)?hr(n,32):32&t&&pr(n,32)),Oo(e,t,2,r=new mo(n,r,oo,void 0),!1),r}(e,t,Ao(e,t,2)),null==e||!n&&Vu&&(e.ta=!0),e},t}(fi));_a[458105876]=[0,Gu,qi,[!0,oa,[0,ha,-1,fa]]];var qu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Hu=Ea(458105758,qu);_a[458105758]=[0,eu,ha,Gu];var Yu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi);Yu.B=[5,6];var Zu=Ea(443442058,Yu);_a[443442058]=[0,eu,ha,sa,ta,fa,-1];var Qu,$u=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Xu=Ea(516587230,$u);function Ku(e,t){return t=t?t.clone():new qs,void 0!==e.displayNamesLocale?Lo(t,1,to(e.displayNamesLocale)):void 0===e.displayNamesLocale&&Lo(t,1),void 0!==e.maxResults?ci(t,2,e.maxResults):"maxResults"in e&&Lo(t,2),void 0!==e.scoreThreshold?li(t,3,e.scoreThreshold):"scoreThreshold"in e&&Lo(t,3),void 0!==e.categoryAllowlist?Go(t,4,e.categoryAllowlist):"categoryAllowlist"in e&&Lo(t,4),void 0!==e.categoryDenylist?Go(t,5,e.categoryDenylist):"categoryDenylist"in e&&Lo(t,5),t}function Ju(e,t,n){return void 0===t&&(t=-1),void 0===n&&(n=""),{categories:e.map((function(e){var t,n,r,o;return{index:null!=(t=ii(oi(e,1),0))?t:-1,score:null!=(n=ai(e,2))?n:0,categoryName:null!=(r=si(e,3))?r:"",displayName:null!=(o=si(e,4))?o:""}})),headIndex:t,headName:n}}function ec(e){for(var t,n,r,o,i,a,s=Uo(e,3,Br),u=Uo(e,2,Yr),c=Uo(e,1,no),l=Uo(e,9,no),d={categories:[],keypoints:[]},f=0;f<s.length;f++){var p,h,m;d.categories.push({score:s[f],index:null!=(p=u[f])?p:-1,categoryName:null!=(h=c[f])?h:"",displayName:null!=(m=l[f])?m:""})}if((s=null==(t=$o(e,bs,4))?void 0:t.h())&&(d.boundingBox={originX:null!=(n=oi(s,1))?n:0,originY:null!=(r=oi(s,2))?r:0,width:null!=(o=oi(s,3))?o:0,height:null!=(i=oi(s,4))?i:0,angle:0}),null!=(a=$o(e,bs,4))&&a.g().length)for(var g,v=xt($o(e,bs,4).g());!(g=v()).done;){var y,b,x,C,w=g.value;d.keypoints.push({x:null!=(y=Fo(w,1))?y:0,y:null!=(b=Fo(w,2))?b:0,score:null!=(x=Fo(w,4))?x:0,label:null!=(C=no(So(w,3)))?C:""})}return d}function tc(e){for(var t,n=[],r=xt(Ko(e,Ts,1));!(t=r()).done;){var o,i,a,s,u=t.value;n.push({x:null!=(o=ai(u,1))?o:0,y:null!=(i=ai(u,2))?i:0,z:null!=(a=ai(u,3))?a:0,visibility:null!=(s=ai(u,4))?s:0})}return n}function nc(e){for(var t,n=[],r=xt(Ko(e,Es,1));!(t=r()).done;){var o,i,a,s,u=t.value;n.push({x:null!=(o=ai(u,1))?o:0,y:null!=(i=ai(u,2))?i:0,z:null!=(a=ai(u,3))?a:0,visibility:null!=(s=ai(u,4))?s:0})}return n}function rc(e){return Array.from(e,(function(e){return 127<e?e-256:e}))}function oc(e,t){if(e.length!==t.length)throw Error("Cannot compute cosine similarity between embeddings of different sizes ("+e.length+" vs. "+t.length+").");for(var n=0,r=0,o=0,i=0;i<e.length;i++)n+=e[i]*t[i],r+=e[i]*e[i],o+=t[i]*t[i];if(0>=r||0>=o)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return n/Math.sqrt(r*o)}_a[516587230]=[0,eu,Ou,Fu,ta];var ic=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);function ac(){return sc.apply(this,arguments)}function sc(){return(sc=ut(bt.mark((function e(){return bt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==Qu){e.next=10;break}return e.prev=1,e.next=4,WebAssembly.instantiate(ic);case 4:Qu=!0,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),Qu=!1;case 10:return e.abrupt("return",Qu);case 11:case"end":return e.stop()}}),e,null,[[1,7]])})))).apply(this,arguments)}function uc(e,t){return cc.apply(this,arguments)}function cc(){return cc=ut(bt.mark((function e(t,n){var r;return bt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===n&&(n=""),e.next=3,ac();case 3:if(!e.sent){e.next=7;break}e.t0="wasm_internal",e.next=8;break;case 7:e.t0="wasm_nosimd_internal";case 8:return e.abrupt("return",{wasmLoaderPath:n+"/"+t+"_"+(r=e.t0)+".js",wasmBinaryPath:n+"/"+t+"_"+r+".wasm"});case 10:case"end":return e.stop()}}),e)}))),cc.apply(this,arguments)}var lc=function(){};function dc(){var e=navigator;return!("undefined"==typeof OffscreenCanvas||function(e){return void 0===e&&(e=navigator),(e=e.userAgent).includes("Safari")&&!e.includes("Chrome")}(e)&&!((e=e.userAgent.match(/Version\/([\d]+).*Safari/))&&1<=e.length&&17<=Number(e[1])))}function fc(e){return pc.apply(this,arguments)}function pc(){return pc=ut(bt.mark((function e(t){var n;return bt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"==typeof importScripts){e.next=3;break}return n=document.createElement("script"),e.abrupt("return",(n.src=t.toString(),n.crossOrigin="anonymous",new Promise((function(e,t){n.addEventListener("load",(function(){e()}),!1),n.addEventListener("error",(function(e){t(e)}),!1),document.body.appendChild(n)}))));case 3:importScripts(t.toString());case 4:case"end":return e.stop()}}),e)}))),pc.apply(this,arguments)}function hc(e){return void 0!==e.videoWidth?[e.videoWidth,e.videoHeight]:void 0!==e.naturalWidth?[e.naturalWidth,e.naturalHeight]:void 0!==e.displayWidth?[e.displayWidth,e.displayHeight]:[e.width,e.height]}function mc(e,t,n){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),n(t=e.i.stringToNewUTF8(t)),e.i._free(t)}function gc(e,t,n){if(!e.i.canvas)throw Error("No OpenGL canvas configured.");if(n?e.i._bindTextureToStream(n):e.i._bindTextureToCanvas(),!(n=e.i.canvas.getContext("webgl2")||e.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");e.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),e.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);var r=hc(t),o=r[0],i=r[1];return!e.l||o===e.i.canvas.width&&i===e.i.canvas.height||(e.i.canvas.width=o,e.i.canvas.height=i),[o,i]}function vc(e,t,n){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");for(var r=new Uint32Array(t.length),o=0;o<t.length;o++)r[o]=e.i.stringToNewUTF8(t[o]);t=e.i._malloc(4*r.length),e.i.HEAPU32.set(r,t>>2),n(t);for(var i,a=xt(r);!(i=a()).done;){e.i._free(i.value)}e.i._free(t)}function yc(e,t,n){e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=n}function bc(e,t,n){var r=[];e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=function(e,t,o){t?(n(r,o),r=[]):r.push(e)}}function xc(e,t,n,r){return Cc.apply(this,arguments)}function Cc(){return Cc=ut(bt.mark((function e(t,n,r,o){return bt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,function(){var e=ut(bt.mark((function e(t,n,r,o,i){return bt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=n,!e.t0){e.next=4;break}return e.next=4,fc(n);case 4:if(self.ModuleFactory){e.next=6;break}throw Error("ModuleFactory not set.");case 6:if(e.t1=r,!e.t1){e.next=11;break}return e.next=10,fc(r);case 10:e.t1=!self.ModuleFactory;case 11:if(!e.t1){e.next=13;break}throw Error("ModuleFactory not set.");case 13:return self.Module&&i&&((n=self.Module).locateFile=i.locateFile,i.mainScriptUrlOrBlob&&(n.mainScriptUrlOrBlob=i.mainScriptUrlOrBlob)),e.next=16,self.ModuleFactory(self.Module||i);case 16:return i=e.sent,self.ModuleFactory=self.Module=void 0,e.abrupt("return",new t(i,o));case 19:case"end":return e.stop()}}),e)})));return function(t,n,r,o,i){return e.apply(this,arguments)}}()(t,r.wasmLoaderPath,r.assetLoaderPath,n,{locateFile:function(e){return e.endsWith(".wasm")?r.wasmBinaryPath.toString():r.assetBinaryPath&&e.endsWith(".data")?r.assetBinaryPath.toString():e}});case 2:return t=e.sent,e.next=5,t.o(o);case 5:return e.abrupt("return",t);case 6:case"end":return e.stop()}}),e)}))),Cc.apply(this,arguments)}function wc(e,t){var n=$o(e.baseOptions,Xs,1)||new Xs;"string"==typeof t?(Lo(n,2,to(t)),Lo(n,1)):t instanceof Uint8Array&&(Lo(n,1,Ir(t,!1,!1)),Lo(n,2)),Jo(e.baseOptions,0,1,n)}function Ec(e){try{var t=e.K.length;if(1===t)throw Error(e.K[0].message);if(1<t)throw Error("Encountered multiple errors: "+e.K.map((function(e){return e.message})).join(", "))}finally{e.K=[]}}function kc(e,t){e.J=Math.max(e.J,t)}function Dc(e,t){e.C=new Za,qa(e.C,"PassThroughCalculator"),Ha(e.C,"free_memory"),Ya(e.C,"free_memory_unused_out"),ts(t,"free_memory"),es(t,e.C)}function Mc(e,t){Ha(e.C,t),Ya(e.C,t+"_unused_out")}function Tc(e){e.g.addBoolToStream(!0,"free_memory",e.J)}lc.forVisionTasks=function(e){return uc("vision",e)},lc.forTextTasks=function(e){return uc("text",e)},lc.forGenAiExperimentalTasks=function(e){return uc("genai_experimental",e)},lc.forGenAiTasks=function(e){return uc("genai",e)},lc.forAudioTasks=function(e){return uc("audio",e)},lc.isSimdSupported=function(){return ac()};var Ic=function(){function e(e){this.g=e,this.K=[],this.J=0,this.g.setAutoRenderToScreen(!1)}var t=e.prototype;return t.l=function(e,t){var n,r=this;if(void 0===t&&(t=!0),t){var o,i,a,s,u,c,l=e.baseOptions||{};if(null!=(o=e.baseOptions)&&o.modelAssetBuffer&&null!=(i=e.baseOptions)&&i.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(null!=(a=$o(this.baseOptions,Xs,1))&&a.g()||null!=(s=$o(this.baseOptions,Xs,1))&&s.h()||null!=(u=e.baseOptions)&&u.modelAssetBuffer||null!=(c=e.baseOptions)&&c.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(e,t){var n=$o(e.baseOptions,Qs,3);if(!n){var r=n=new Qs,o=new Ra;ei(r,4,$s,o)}"delegate"in t&&("GPU"===t.delegate?(t=n,r=new Aa,ei(t,2,$s,r)):(t=n,r=new Ra,ei(t,4,$s,r))),Jo(e.baseOptions,0,3,n)}(this,l),l.modelAssetPath)return fetch(l.modelAssetPath.toString()).then((function(e){if(e.ok)return e.arrayBuffer();throw Error("Failed to fetch model: "+l.modelAssetPath+" ("+e.status+")")})).then((function(e){try{r.g.i.FS_unlink("/model.dat")}catch(e){}r.g.i.FS_createDataFile("/","model.dat",new Uint8Array(e),!0,!1,!1),wc(r,"/model.dat"),r.m(),r.L()}));if(l.modelAssetBuffer instanceof Uint8Array)wc(this,l.modelAssetBuffer);else if(l.modelAssetBuffer)return(n=ut(bt.mark((function e(t){var n,r,o,i,a,s,u;return bt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=[],r=0;case 2:return e.next=4,t.read();case 4:if(i=(o=e.sent).value,!o.done){e.next=9;break}return e.abrupt("break",12);case 9:n.push(i),r+=i.length;case 10:e.next=2;break;case 12:if(0!==n.length){e.next=14;break}return e.abrupt("return",new Uint8Array(0));case 14:if(1!==n.length){e.next=16;break}return e.abrupt("return",n[0]);case 16:for(t=new Uint8Array(r),r=0,a=0,s=n;a<s.length;a++)t.set(u=s[a],r),r+=u.length;return e.abrupt("return",t);case 19:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})(l.modelAssetBuffer).then((function(e){wc(r,e),r.m(),r.L()}))}return this.m(),this.L(),Promise.resolve()},t.L=function(){},t.fa=function(){var e;if(this.g.fa((function(t){e=is(t)})),!e)throw Error("Failed to retrieve CalculatorGraphConfig");return e},t.setGraph=function(e,t){var n=this;this.g.attachErrorListener((function(e,t){n.K.push(Error(t))})),this.g.Ma(),this.g.setGraph(e,t),this.C=void 0,Ec(this)},t.finishProcessing=function(){this.g.finishProcessing(),Ec(this)},t.close=function(){this.C=void 0,this.g.closeGraph()},e}();function Sc(e,t){if(!e)throw Error("Unable to obtain required WebGL resource: "+t);return e}Ic.prototype.close=Ic.prototype.close,function(e,t){e=e.split(".");var n,r=kt;e[0]in r||void 0===r.execScript||r.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}("TaskRunner",Ic);var Nc=function(){function e(e,t,n,r){this.g=e,this.h=t,this.m=n,this.l=r}var t=e.prototype;return t.bind=function(){this.g.bindVertexArray(this.h)},t.close=function(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)},e}();function Ac(e,t,n){var r=e.g;if(n=Sc(r.createShader(n),"Failed to create WebGL shader"),r.shaderSource(n,t),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw Error("Could not compile WebGL shader: "+r.getShaderInfoLog(n));return r.attachShader(e.h,n),n}function Lc(e,t){var n=e.g,r=Sc(n.createVertexArray(),"Failed to create vertex array");n.bindVertexArray(r);var o=Sc(n.createBuffer(),"Failed to create buffer");n.bindBuffer(n.ARRAY_BUFFER,o),n.enableVertexAttribArray(e.K),n.vertexAttribPointer(e.K,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW);var i=Sc(n.createBuffer(),"Failed to create buffer");return n.bindBuffer(n.ARRAY_BUFFER,i),n.enableVertexAttribArray(e.J),n.vertexAttribPointer(e.J,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array(t?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.bindVertexArray(null),new Nc(n,r,o,i)}function Oc(e,t){if(e.g){if(t!==e.g)throw Error("Cannot change GL context once initialized")}else e.g=t}function Rc(e,t,n,r){return Oc(e,t),e.h||(e.m(),e.D()),n?(e.v||(e.v=Lc(e,!0)),n=e.v):(e.A||(e.A=Lc(e,!1)),n=e.A),t.useProgram(e.h),n.bind(),e.l(),e=r(),n.g.bindVertexArray(null),e}function Fc(e,t,n){return Oc(e,t),e=Sc(t.createTexture(),"Failed to create texture"),t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,null!=n?n:t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,null!=n?n:t.LINEAR),t.bindTexture(t.TEXTURE_2D,null),e}function Pc(e,t,n){Oc(e,t),e.u||(e.u=Sc(t.createFramebuffer(),"Failed to create framebuffe.")),t.bindFramebuffer(t.FRAMEBUFFER,e.u),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,n,0)}function Uc(e){var t;null==(t=e.g)||t.bindFramebuffer(e.g.FRAMEBUFFER,null)}var _c=function(){function e(){}var t=e.prototype;return t.H=function(){return"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D inputTexture;\n void main() {\n gl_FragColor = texture2D(inputTexture, vTex);\n }\n "},t.m=function(){var e=this.g;if(this.h=Sc(e.createProgram(),"Failed to create WebGL program"),this.ba=Ac(this,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",e.VERTEX_SHADER),this.aa=Ac(this,this.H(),e.FRAGMENT_SHADER),e.linkProgram(this.h),!e.getProgramParameter(this.h,e.LINK_STATUS))throw Error("Error during program linking: "+e.getProgramInfoLog(this.h));this.K=e.getAttribLocation(this.h,"aVertex"),this.J=e.getAttribLocation(this.h,"aTex")},t.D=function(){},t.l=function(){},t.close=function(){if(this.h){var e=this.g;e.deleteProgram(this.h),e.deleteShader(this.ba),e.deleteShader(this.aa)}this.u&&this.g.deleteFramebuffer(this.u),this.A&&this.A.close(),this.v&&this.v.close()},e}();function jc(e,t){switch(t){case 0:return e.g.find((function(e){return e instanceof Uint8Array}));case 1:return e.g.find((function(e){return e instanceof Float32Array}));case 2:return e.g.find((function(e){return"undefined"!=typeof WebGLTexture&&e instanceof WebGLTexture}));default:throw Error("Type is not supported: "+t)}}function Bc(e){var t=jc(e,1);if(!t){if(t=jc(e,0))t=new Float32Array(t).map((function(e){return e/255}));else{t=new Float32Array(e.width*e.height);var n=Gc(e),r=Wc(e);if(Pc(r,n,zc(e)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in self.document){r=new Float32Array(e.width*e.height*4),n.readPixels(0,0,e.width,e.height,n.RGBA,n.FLOAT,r);for(var o=0,i=0;o<t.length;++o,i+=4)t[o]=r[i]}else n.readPixels(0,0,e.width,e.height,n.RED,n.FLOAT,t)}e.g.push(t)}return t}function zc(e){var t=jc(e,2);if(!t){var n=Gc(e);t=qc(e);var r=Bc(e),o=Vc(e);n.texImage2D(n.TEXTURE_2D,0,o,e.width,e.height,0,n.RED,n.FLOAT,r),Hc(e)}return t}function Gc(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=Sc(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function Vc(e){if(e=Gc(e),!Yc)if(e.getExtension("EXT_color_buffer_float")&&e.getExtension("OES_texture_float_linear")&&e.getExtension("EXT_float_blend"))Yc=e.R32F;else{if(!e.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");Yc=e.R16F}return Yc}function Wc(e){return e.l||(e.l=new _c),e.l}function qc(e){var t=Gc(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);var n=jc(e,2);return n||(n=Fc(Wc(e),t,e.m?t.LINEAR:t.NEAREST),e.g.push(n),e.j=!0),t.bindTexture(t.TEXTURE_2D,n),n}function Hc(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}var Yc,Zc=function(){function e(e,t,n,r,o,i,a){this.g=e,this.m=t,this.j=n,this.canvas=r,this.l=o,this.width=i,this.height=a,this.j&&0==--Qc&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}var t=e.prototype;return t.Ha=function(){return!!jc(this,0)},t.la=function(){return!!jc(this,1)},t.R=function(){return!!jc(this,2)},t.ka=function(){return(e=jc(this,0))||(e=Bc(this),e=new Uint8Array(e.map((function(e){return 255*e}))),this.g.push(e)),e;var e},t.ja=function(){return Bc(this)},t.O=function(){return zc(this)},t.clone=function(){for(var e,t=this,n=[],r=function(){var r,o=e.value;if(o instanceof Uint8Array)r=new Uint8Array(o);else if(o instanceof Float32Array)r=new Float32Array(o);else{if(!(o instanceof WebGLTexture))throw Error("Type is not supported: "+o);var i=Gc(t),a=Wc(t);i.activeTexture(i.TEXTURE1),r=Fc(a,i,t.m?i.LINEAR:i.NEAREST),i.bindTexture(i.TEXTURE_2D,r);var s=Vc(t);i.texImage2D(i.TEXTURE_2D,0,s,t.width,t.height,0,i.RED,i.FLOAT,null),i.bindTexture(i.TEXTURE_2D,null),Pc(a,i,r),Rc(a,i,!1,(function(){qc(t),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.drawArrays(i.TRIANGLE_FAN,0,4),Hc(t)})),Uc(a),Hc(t)}n.push(r)},o=xt(this.g);!(e=o()).done;)r();return new Zc(n,this.m,this.R(),this.canvas,this.l,this.width,this.height)},t.close=function(){this.j&&Gc(this).deleteTexture(jc(this,2)),Qc=-1},e}();Zc.prototype.close=Zc.prototype.close,Zc.prototype.clone=Zc.prototype.clone,Zc.prototype.getAsWebGLTexture=Zc.prototype.O,Zc.prototype.getAsFloat32Array=Zc.prototype.ja,Zc.prototype.getAsUint8Array=Zc.prototype.ka,Zc.prototype.hasWebGLTexture=Zc.prototype.R,Zc.prototype.hasFloat32Array=Zc.prototype.la,Zc.prototype.hasUint8Array=Zc.prototype.Ha;var Qc=250;function $c(e,t){switch(t){case 0:return e.g.find((function(e){return e instanceof ImageData}));case 1:return e.g.find((function(e){return"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap}));case 2:return e.g.find((function(e){return"undefined"!=typeof WebGLTexture&&e instanceof WebGLTexture}));default:throw Error("Type is not supported: "+t)}}function Xc(e){var t=$c(e,0);if(!t){t=Jc(e);var n=el(e),r=new Uint8Array(e.width*e.height*4);Pc(n,t,Kc(e)),t.readPixels(0,0,e.width,e.height,t.RGBA,t.UNSIGNED_BYTE,r),Uc(n),t=new ImageData(new Uint8ClampedArray(r.buffer),e.width,e.height),e.g.push(t)}return t}function Kc(e){var t=$c(e,2);if(!t){var n=Jc(e);t=tl(e);var r=$c(e,1)||Xc(e);n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,r),nl(e)}return t}function Jc(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when iniitializing the image.");return e.h||(e.h=Sc(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function el(e){return e.l||(e.l=new _c),e.l}function tl(e){var t=Jc(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);var n=$c(e,2);return n||(n=Fc(el(e),t),e.g.push(n),e.m=!0),t.bindTexture(t.TEXTURE_2D,n),n}function nl(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}function rl(e){var t=Jc(e);return Rc(el(e),t,!0,(function(){return function(e,t){var n=e.canvas;if(n.width===e.width&&n.height===e.height)return t();var r=n.width,o=n.height;return n.width=e.width,n.height=e.height,e=t(),n.width=r,n.height=o,e}(e,(function(){if(t.bindFramebuffer(t.FRAMEBUFFER,null),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),!(e.canvas instanceof OffscreenCanvas))throw Error("Conversion to ImageBitmap requires that the MediaPipe Tasks is initialized with an OffscreenCanvas");return e.canvas.transferToImageBitmap()}))}))}var ol=function(){function e(e,t,n,r,o,i,a){this.g=e,this.j=t,this.m=n,this.canvas=r,this.l=o,this.width=i,this.height=a,(this.j||this.m)&&0==--il&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources.")}var t=e.prototype;return t.Ga=function(){return!!$c(this,0)},t.ma=function(){return!!$c(this,1)},t.R=function(){return!!$c(this,2)},t.Ea=function(){return Xc(this)},t.Da=function(){var e=$c(this,1);return e||(Kc(this),tl(this),e=rl(this),nl(this),this.g.push(e),this.j=!0),e},t.O=function(){return Kc(this)},t.clone=function(){for(var e,t=this,n=[],r=function(){var r,o=e.value;if(o instanceof ImageData)r=new ImageData(o.data,t.width,t.height);else if(o instanceof WebGLTexture){var i=Jc(t),a=el(t);i.activeTexture(i.TEXTURE1),r=Fc(a,i),i.bindTexture(i.TEXTURE_2D,r),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,t.width,t.height,0,i.RGBA,i.UNSIGNED_BYTE,null),i.bindTexture(i.TEXTURE_2D,null),Pc(a,i,r),Rc(a,i,!1,(function(){tl(t),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.drawArrays(i.TRIANGLE_FAN,0,4),nl(t)})),Uc(a),nl(t)}else{if(!(o instanceof ImageBitmap))throw Error("Type is not supported: "+o);Kc(t),tl(t),r=rl(t),nl(t)}n.push(r)},o=xt(this.g);!(e=o()).done;)r();return new ol(n,this.ma(),this.R(),this.canvas,this.l,this.width,this.height)},t.close=function(){this.j&&$c(this,1).close(),this.m&&Jc(this).deleteTexture($c(this,2)),il=-1},e}();ol.prototype.close=ol.prototype.close,ol.prototype.clone=ol.prototype.clone,ol.prototype.getAsWebGLTexture=ol.prototype.O,ol.prototype.getAsImageBitmap=ol.prototype.Da,ol.prototype.getAsImageData=ol.prototype.Ea,ol.prototype.hasWebGLTexture=ol.prototype.R,ol.prototype.hasImageBitmap=ol.prototype.ma,ol.prototype.hasImageData=ol.prototype.Ga;var il=250;function al(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.map((function(e){return{start:e[0],end:e[1]}}))}var sl,ul=function(e){return function(e){function t(){return e.apply(this,arguments)||this}return lt(t,e),t.prototype.Ma=function(){this.i._registerModelResourcesGraphService()},t}(e)}((sl=function(){function e(e,t){this.l=!0,this.i=e,this.g=null,this.h=0,this.m="function"==typeof this.i._addIntToInputStream,void 0!==t?this.i.canvas=t:dc()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}var t=e.prototype;return t.initializeGraph=function(){var e=ut(bt.mark((function e(t){var n;return bt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t);case 2:return e.next=4,e.sent.arrayBuffer();case 4:n=e.sent,t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(n),t);case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.setGraphFromString=function(e){this.setGraph((new TextEncoder).encode(e),!1)},t.setGraph=function(e,t){var n=e.length,r=this.i._malloc(n);this.i.HEAPU8.set(e,r),t?this.i._changeBinaryGraph(n,r):this.i._changeTextGraph(n,r),this.i._free(r)},t.configureAudio=function(e,t,n,r,o){var i=this;this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),mc(this,r||"input_audio",(function(r){mc(i,o=o||"audio_header",(function(o){i.i._configureAudio(r,o,e,t,n)}))}))},t.setAutoResizeCanvas=function(e){this.l=e},t.setAutoRenderToScreen=function(e){this.i._setAutoRenderToScreen(e)},t.setGpuBufferVerticalFlip=function(e){this.i.gpuOriginForWebTexturesIsBottomLeft=e},t.fa=function(e){var t=this;yc(this,"__graph_config__",(function(t){e(t)})),mc(this,"__graph_config__",(function(e){t.i._getGraphConfig(e,void 0)})),delete this.i.simpleListeners.__graph_config__},t.attachErrorListener=function(e){this.i.errorListener=e},t.attachEmptyPacketListener=function(e,t){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[e]=t},t.addAudioToStream=function(e,t,n){this.addAudioToStreamWithShape(e,0,0,t,n)},t.addAudioToStreamWithShape=function(e,t,n,r,o){var i=this,a=4*e.length;this.h!==a&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(a),this.h=a),this.i.HEAPF32.set(e,this.g/4),mc(this,r,(function(e){i.i._addAudioToInputStream(i.g,t,n,e,o)}))},t.addGpuBufferToStream=function(e,t,n){var r=this;mc(this,t,(function(t){var o=gc(r,e,t);r.i._addBoundTextureToStream(t,o[0],o[1],n)}))},t.addBoolToStream=function(e,t,n){var r=this;mc(this,t,(function(t){r.i._addBoolToInputStream(e,t,n)}))},t.addDoubleToStream=function(e,t,n){var r=this;mc(this,t,(function(t){r.i._addDoubleToInputStream(e,t,n)}))},t.addFloatToStream=function(e,t,n){var r=this;mc(this,t,(function(t){r.i._addFloatToInputStream(e,t,n)}))},t.addIntToStream=function(e,t,n){var r=this;mc(this,t,(function(t){r.i._addIntToInputStream(e,t,n)}))},t.addUintToStream=function(e,t,n){var r=this;mc(this,t,(function(t){r.i._addUintToInputStream(e,t,n)}))},t.addStringToStream=function(e,t,n){var r=this;mc(this,t,(function(t){mc(r,e,(function(e){r.i._addStringToInputStream(e,t,n)}))}))},t.addStringRecordToStream=function(e,t,n){var r=this;mc(this,t,(function(t){vc(r,Object.keys(e),(function(o){vc(r,Object.values(e),(function(i){r.i._addFlatHashMapToInputStream(o,i,Object.keys(e).length,t,n)}))}))}))},t.addProtoToStream=function(e,t,n,r){var o=this;mc(this,n,(function(n){mc(o,t,(function(t){var i=o.i._malloc(e.length);o.i.HEAPU8.set(e,i),o.i._addProtoToInputStream(i,e.length,t,n,r),o.i._free(i)}))}))},t.addEmptyPacketToStream=function(e,t){var n=this;mc(this,e,(function(e){n.i._addEmptyPacketToInputStream(e,t)}))},t.addBoolVectorToStream=function(e,t,n){var r=this;mc(this,t,(function(t){var o=r.i._allocateBoolVector(e.length);if(!o)throw Error("Unable to allocate new bool vector on heap.");for(var i,a=xt(e);!(i=a()).done;){r.i._addBoolVectorEntry(o,i.value)}r.i._addBoolVectorToInputStream(o,t,n)}))},t.addDoubleVectorToStream=function(e,t,n){var r=this;mc(this,t,(function(t){var o=r.i._allocateDoubleVector(e.length);if(!o)throw Error("Unable to allocate new double vector on heap.");for(var i,a=xt(e);!(i=a()).done;){r.i._addDoubleVectorEntry(o,i.value)}r.i._addDoubleVectorToInputStream(o,t,n)}))},t.addFloatVectorToStream=function(e,t,n){var r=this;mc(this,t,(function(t){var o=r.i._allocateFloatVector(e.length);if(!o)throw Error("Unable to allocate new float vector on heap.");for(var i,a=xt(e);!(i=a()).done;){r.i._addFloatVectorEntry(o,i.value)}r.i._addFloatVectorToInputStream(o,t,n)}))},t.addIntVectorToStream=function(e,t,n){var r=this;mc(this,t,(function(t){var o=r.i._allocateIntVector(e.length);if(!o)throw Error("Unable to allocate new int vector on heap.");for(var i,a=xt(e);!(i=a()).done;){r.i._addIntVectorEntry(o,i.value)}r.i._addIntVectorToInputStream(o,t,n)}))},t.addUintVectorToStream=function(e,t,n){var r=this;mc(this,t,(function(t){var o=r.i._allocateUintVector(e.length);if(!o)throw Error("Unable to allocate new unsigned int vector on heap.");for(var i,a=xt(e);!(i=a()).done;){r.i._addUintVectorEntry(o,i.value)}r.i._addUintVectorToInputStream(o,t,n)}))},t.addStringVectorToStream=function(e,t,n){var r=this;mc(this,t,(function(t){var o=r.i._allocateStringVector(e.length);if(!o)throw Error("Unable to allocate new string vector on heap.");for(var i,a=xt(e);!(i=a()).done;){mc(r,i.value,(function(e){r.i._addStringVectorEntry(o,e)}))}r.i._addStringVectorToInputStream(o,t,n)}))},t.addBoolToInputSidePacket=function(e,t){var n=this;mc(this,t,(function(t){n.i._addBoolToInputSidePacket(e,t)}))},t.addDoubleToInputSidePacket=function(e,t){var n=this;mc(this,t,(function(t){n.i._addDoubleToInputSidePacket(e,t)}))},t.addFloatToInputSidePacket=function(e,t){var n=this;mc(this,t,(function(t){n.i._addFloatToInputSidePacket(e,t)}))},t.addIntToInputSidePacket=function(e,t){var n=this;mc(this,t,(function(t){n.i._addIntToInputSidePacket(e,t)}))},t.addUintToInputSidePacket=function(e,t){var n=this;mc(this,t,(function(t){n.i._addUintToInputSidePacket(e,t)}))},t.addStringToInputSidePacket=function(e,t){var n=this;mc(this,t,(function(t){mc(n,e,(function(e){n.i._addStringToInputSidePacket(e,t)}))}))},t.addProtoToInputSidePacket=function(e,t,n){var r=this;mc(this,n,(function(n){mc(r,t,(function(t){var o=r.i._malloc(e.length);r.i.HEAPU8.set(e,o),r.i._addProtoToInputSidePacket(o,e.length,t,n),r.i._free(o)}))}))},t.addBoolVectorToInputSidePacket=function(e,t){var n=this;mc(this,t,(function(t){var r=n.i._allocateBoolVector(e.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(var o,i=xt(e);!(o=i()).done;){n.i._addBoolVectorEntry(r,o.value)}n.i._addBoolVectorToInputSidePacket(r,t)}))},t.addDoubleVectorToInputSidePacket=function(e,t){var n=this;mc(this,t,(function(t){var r=n.i._allocateDoubleVector(e.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(var o,i=xt(e);!(o=i()).done;){n.i._addDoubleVectorEntry(r,o.value)}n.i._addDoubleVectorToInputSidePacket(r,t)}))},t.addFloatVectorToInputSidePacket=function(e,t){var n=this;mc(this,t,(function(t){var r=n.i._allocateFloatVector(e.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(var o,i=xt(e);!(o=i()).done;){n.i._addFloatVectorEntry(r,o.value)}n.i._addFloatVectorToInputSidePacket(r,t)}))},t.addIntVectorToInputSidePacket=function(e,t){var n=this;mc(this,t,(function(t){var r=n.i._allocateIntVector(e.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(var o,i=xt(e);!(o=i()).done;){n.i._addIntVectorEntry(r,o.value)}n.i._addIntVectorToInputSidePacket(r,t)}))},t.addUintVectorToInputSidePacket=function(e,t){var n=this;mc(this,t,(function(t){var r=n.i._allocateUintVector(e.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(var o,i=xt(e);!(o=i()).done;){n.i._addUintVectorEntry(r,o.value)}n.i._addUintVectorToInputSidePacket(r,t)}))},t.addStringVectorToInputSidePacket=function(e,t){var n=this;mc(this,t,(function(t){var r=n.i._allocateStringVector(e.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(var o,i=xt(e);!(o=i()).done;){mc(n,o.value,(function(e){n.i._addStringVectorEntry(r,e)}))}n.i._addStringVectorToInputSidePacket(r,t)}))},t.attachBoolListener=function(e,t){var n=this;yc(this,e,t),mc(this,e,(function(e){n.i._attachBoolListener(e)}))},t.attachBoolVectorListener=function(e,t){var n=this;bc(this,e,t),mc(this,e,(function(e){n.i._attachBoolVectorListener(e)}))},t.attachIntListener=function(e,t){var n=this;yc(this,e,t),mc(this,e,(function(e){n.i._attachIntListener(e)}))},t.attachIntVectorListener=function(e,t){var n=this;bc(this,e,t),mc(this,e,(function(e){n.i._attachIntVectorListener(e)}))},t.attachUintListener=function(e,t){var n=this;yc(this,e,t),mc(this,e,(function(e){n.i._attachUintListener(e)}))},t.attachUintVectorListener=function(e,t){var n=this;bc(this,e,t),mc(this,e,(function(e){n.i._attachUintVectorListener(e)}))},t.attachDoubleListener=function(e,t){var n=this;yc(this,e,t),mc(this,e,(function(e){n.i._attachDoubleListener(e)}))},t.attachDoubleVectorListener=function(e,t){var n=this;bc(this,e,t),mc(this,e,(function(e){n.i._attachDoubleVectorListener(e)}))},t.attachFloatListener=function(e,t){var n=this;yc(this,e,t),mc(this,e,(function(e){n.i._attachFloatListener(e)}))},t.attachFloatVectorListener=function(e,t){var n=this;bc(this,e,t),mc(this,e,(function(e){n.i._attachFloatVectorListener(e)}))},t.attachStringListener=function(e,t){var n=this;yc(this,e,t),mc(this,e,(function(e){n.i._attachStringListener(e)}))},t.attachStringVectorListener=function(e,t){var n=this;bc(this,e,t),mc(this,e,(function(e){n.i._attachStringVectorListener(e)}))},t.attachProtoListener=function(e,t,n){var r=this;yc(this,e,t),mc(this,e,(function(e){r.i._attachProtoListener(e,n||!1)}))},t.attachProtoVectorListener=function(e,t,n){var r=this;bc(this,e,t),mc(this,e,(function(e){r.i._attachProtoVectorListener(e,n||!1)}))},t.attachAudioListener=function(e,t,n){var r=this;this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),yc(this,e,(function(e,n){e=new Float32Array(e.buffer,e.byteOffset,e.length/4),t(e,n)})),mc(this,e,(function(e){r.i._attachAudioListener(e,n||!1)}))},t.finishProcessing=function(){this.i._waitUntilIdle()},t.closeGraph=function(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0},e}(),function(e){function t(){return e.apply(this,arguments)||this}lt(t,e);var n=t.prototype;return n.sa=function(e,t,n){var r=this;mc(this,t,(function(t){var o=gc(r,e,t);r.ha._addBoundTextureAsImageToStream(t,o[0],o[1],n)}))},n.W=function(e,t){var n=this;yc(this,e,t),mc(this,e,(function(e){n.ha._attachImageListener(e)}))},n.da=function(e,t){var n=this;bc(this,e,t),mc(this,e,(function(e){n.ha._attachImageVectorListener(e)}))},at(t,[{key:"ha",get:function(){return this.i}}])}(sl))),cl=function(e){function t(){return e.apply(this,arguments)||this}return lt(t,e),t}(ul);function ll(e,t,n){return dl.apply(this,arguments)}function dl(){return dl=ut(bt.mark((function e(t,n,r){var o;return bt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",function(){var e=ut(bt.mark((function e(t,n,r,o){return bt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",xc(t,n,r,o));case 1:case"end":return e.stop()}}),e)})));return function(t,n,r,o){return e.apply(this,arguments)}}()(t,null!=(o=r.canvas)?o:dc()?void 0:document.createElement("canvas"),n,r));case 1:case"end":return e.stop()}}),e)}))),dl.apply(this,arguments)}function fl(e,t,n,r){if(e.V){var o,i,a=new Os;if(null!=(o=n)&&o.regionOfInterest){if(!e.ra)throw Error("This task doesn't support region-of-interest.");var s=n.regionOfInterest;if(s.left>=s.right||s.top>=s.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(0>s.left||0>s.top||1<s.right||1<s.bottom)throw Error("Expected RectF values to be in [0,1].");li(a,1,(s.left+s.right)/2),li(a,2,(s.top+s.bottom)/2),li(a,4,s.right-s.left),li(a,3,s.bottom-s.top)}else li(a,1,.5),li(a,2,.5),li(a,4,1),li(a,3,1);if(null!=(i=n)&&i.rotationDegrees){var u,c;if(0!=(null==(u=n)?void 0:u.rotationDegrees)%90)throw Error("Expected rotation to be a multiple of 90°.");if(li(a,5,-Math.PI*n.rotationDegrees/180),0!=(null==(c=n)?void 0:c.rotationDegrees)%180){var l=hc(t),d=l[0],f=l[1];n=ai(a,3)*f/d,s=ai(a,4)*d/f,li(a,4,n),li(a,3,s)}}e.g.addProtoToStream(a.g(),"mediapipe.NormalizedRect",e.V,r)}e.g.sa(t,e.ba,null!=r?r:performance.now()),e.finishProcessing()}function pl(e,t,n){var r;if(null!=(r=e.baseOptions)&&r.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");fl(e,t,n,e.J+1)}function hl(e,t,n,r){var o;if(null==(o=e.baseOptions)||!o.g())throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");fl(e,t,n,r)}function ml(e,t,n,r){var o=t.data,i=t.width,a=i*(t=t.height);if((o instanceof Uint8Array||o instanceof Float32Array)&&o.length!==a)throw Error("Unsupported channel count: "+o.length/a);return e=new Zc([o],n,!1,e.g.i.canvas,e.M,i,t),r?e.clone():e}var gl=function(e){function t(t,n,r,o){var i;return(i=e.call(this,t)||this).g=t,i.ba=n,i.V=r,i.ra=o,i.M=new _c,i}lt(t,e);var n=t.prototype;return n.l=function(t,n){if(void 0===n&&(n=!0),"runningMode"in t&&ui(this.baseOptions,2,!!t.runningMode&&"IMAGE"!==t.runningMode),void 0!==t.canvas&&this.g.i.canvas!==t.canvas)throw Error("You must create a new task to reset the canvas.");return e.prototype.l.call(this,t,n)},n.close=function(){this.M.close(),e.prototype.close.call(this)},t}(Ic);gl.prototype.close=gl.prototype.close;var vl=function(e){function t(t,n){var r;return(r=e.call(this,new cl(t,n),"image_in","norm_rect_in",!1)||this).j={detections:[]},Jo(t=r.h=new tu,0,1,n=new Js),li(r.h,2,.5),li(r.h,3,.3),r}lt(t,e);var n=t.prototype;return n.o=function(e){var t,n;return"minDetectionConfidence"in e&&li(this.h,2,null!=(t=e.minDetectionConfidence)?t:.5),"minSuppressionThreshold"in e&&li(this.h,3,null!=(n=e.minSuppressionThreshold)?n:.3),this.l(e)},n.F=function(e,t){return this.j={detections:[]},pl(this,e,t),this.j},n.G=function(e,t,n){return this.j={detections:[]},hl(this,e,n,t),this.j},n.m=function(){var e=this,t=new rs;ts(t,"image_in"),ts(t,"norm_rect_in"),ns(t,"detections");var n=new Ua;di(n,ru,this.h);var r=new Za;qa(r,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),Ha(r,"IMAGE:image_in"),Ha(r,"NORM_RECT:norm_rect_in"),Ya(r,"DETECTIONS:detections"),r.o(n),es(t,r),this.g.attachProtoVectorListener("detections",(function(t,n){for(var r,o=xt(t);!(r=o()).done;){t=ws(r.value),e.j.detections.push(ec(t))}kc(e,n)})),this.g.attachEmptyPacketListener("detections",(function(t){kc(e,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)},at(t,[{key:"baseOptions",get:function(){return $o(this.h,Js,1)},set:function(e){Jo(this.h,0,1,e)}}])}(gl);vl.prototype.detectForVideo=vl.prototype.G,vl.prototype.detect=vl.prototype.F,vl.prototype.setOptions=vl.prototype.o,vl.createFromModelPath=function(){var e=ut(bt.mark((function e(t,n){return bt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",ll(vl,t,{baseOptions:{modelAssetPath:n}}));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),vl.createFromModelBuffer=function(e,t){return ll(vl,e,{baseOptions:{modelAssetBuffer:t}})},vl.createFromOptions=function(e,t){return ll(vl,e,t)};var yl=al([61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]),bl=al([263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]),xl=al([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),Cl=al([474,475],[475,476],[476,477],[477,474]),wl=al([33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]),El=al([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),kl=al([469,470],[470,471],[471,472],[472,469]),Dl=al([10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]),Ml=[].concat(yl,bl,xl,wl,El,Dl),Tl=al([127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]);function Il(e){e.u={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var Sl=function(e){function t(t,n){var r;return(r=e.call(this,new cl(t,n),"image_in","norm_rect",!1)||this).u={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},r.outputFacialTransformationMatrixes=r.outputFaceBlendshapes=!1,Jo(t=r.h=new lu,0,1,n=new Js),r.H=new uu,Jo(r.h,0,3,r.H),r.j=new tu,Jo(r.h,0,2,r.j),ci(r.j,4,1),li(r.j,2,.5),li(r.H,2,.5),li(r.h,4,.5),r}lt(t,e);var n=t.prototype;return n.o=function(e){var t,n,r,o;return"numFaces"in e&&ci(this.j,4,null!=(t=e.numFaces)?t:1),"minFaceDetectionConfidence"in e&&li(this.j,2,null!=(n=e.minFaceDetectionConfidence)?n:.5),"minTrackingConfidence"in e&&li(this.h,4,null!=(r=e.minTrackingConfidence)?r:.5),"minFacePresenceConfidence"in e&&li(this.H,2,null!=(o=e.minFacePresenceConfidence)?o:.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in e&&(this.outputFacialTransformationMatrixes=!!e.outputFacialTransformationMatrixes),this.l(e)},n.F=function(e,t){return Il(this),pl(this,e,t),this.u},n.G=function(e,t,n){return Il(this),hl(this,e,n,t),this.u},n.m=function(){var e=this,t=new rs;ts(t,"image_in"),ts(t,"norm_rect"),ns(t,"face_landmarks");var n=new Ua;di(n,fu,this.h);var r=new Za;qa(r,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),Ha(r,"IMAGE:image_in"),Ha(r,"NORM_RECT:norm_rect"),Ya(r,"NORM_LANDMARKS:face_landmarks"),r.o(n),es(t,r),this.g.attachProtoVectorListener("face_landmarks",(function(t,n){for(var r,o=xt(t);!(r=o()).done;){t=Ns(r.value),e.u.faceLandmarks.push(tc(t))}kc(e,n)})),this.g.attachEmptyPacketListener("face_landmarks",(function(t){kc(e,t)})),this.outputFaceBlendshapes&&(ns(t,"blendshapes"),Ya(r,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",(function(t,n){if(e.outputFaceBlendshapes)for(var r,o=xt(t);!(r=o()).done;){var i;t=ds(r.value),e.u.faceBlendshapes.push(Ju(null!=(i=t.g())?i:[]))}kc(e,n)})),this.g.attachEmptyPacketListener("blendshapes",(function(t){kc(e,t)}))),this.outputFacialTransformationMatrixes&&(ns(t,"face_geometry"),Ya(r,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",(function(t,n){if(e.outputFacialTransformationMatrixes)for(var r,o=xt(t);!(r=o()).done;){var i,a,s;(t=$o(au(r.value),As,2))&&e.u.facialTransformationMatrixes.push({rows:null!=(i=ii(oi(t,1),0))?i:0,columns:null!=(a=ii(oi(t,2),0))?a:0,data:null!=(s=Uo(t,3,Br).slice())?s:[]})}kc(e,n)})),this.g.attachEmptyPacketListener("face_geometry",(function(t){kc(e,t)}))),t=t.g(),this.setGraph(new Uint8Array(t),!0)},at(t,[{key:"baseOptions",get:function(){return $o(this.h,Js,1)},set:function(e){Jo(this.h,0,1,e)}}])}(gl);Sl.prototype.detectForVideo=Sl.prototype.G,Sl.prototype.detect=Sl.prototype.F,Sl.prototype.setOptions=Sl.prototype.o,Sl.createFromModelPath=function(e,t){return ll(Sl,e,{baseOptions:{modelAssetPath:t}})},Sl.createFromModelBuffer=function(e,t){return ll(Sl,e,{baseOptions:{modelAssetBuffer:t}})},Sl.createFromOptions=function(e,t){return ll(Sl,e,t)},Sl.FACE_LANDMARKS_LIPS=yl,Sl.FACE_LANDMARKS_LEFT_EYE=bl,Sl.FACE_LANDMARKS_LEFT_EYEBROW=xl,Sl.FACE_LANDMARKS_LEFT_IRIS=Cl,Sl.FACE_LANDMARKS_RIGHT_EYE=wl,Sl.FACE_LANDMARKS_RIGHT_EYEBROW=El,Sl.FACE_LANDMARKS_RIGHT_IRIS=kl,Sl.FACE_LANDMARKS_FACE_OVAL=Dl,Sl.FACE_LANDMARKS_CONTOURS=Ml,Sl.FACE_LANDMARKS_TESSELATION=Tl;var Nl=function(e){function t(t,n){var r;return Jo(t=(r=e.call(this,new cl(t,n),"image_in","norm_rect",!0)||this).j=new pu,0,1,n=new Js),r}lt(t,e);var n=t.prototype;return n.o=function(t){return e.prototype.l.call(this,t)},n.Pa=function(e,t,n){var r="function"!=typeof t?t:{};if(this.h="function"==typeof t?t:n,pl(this,e,null!=r?r:{}),!this.h)return this.u},n.m=function(){var e=this,t=new rs;ts(t,"image_in"),ts(t,"norm_rect"),ns(t,"stylized_image");var n=new Ua;di(n,hu,this.j);var r=new Za;qa(r,"mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"),Ha(r,"IMAGE:image_in"),Ha(r,"NORM_RECT:norm_rect"),Ya(r,"STYLIZED_IMAGE:stylized_image"),r.o(n),es(t,r),this.g.W("stylized_image",(function(t,n){var r=!e.h,o=t.data,i=t.width,a=i*(t=t.height);if(o instanceof Uint8Array)if(o.length===3*a){for(var s=new Uint8ClampedArray(4*a),u=0;u<a;++u)s[4*u]=o[3*u],s[4*u+1]=o[3*u+1],s[4*u+2]=o[3*u+2],s[4*u+3]=255;o=new ImageData(s,i,t)}else{if(o.length!==4*a)throw Error("Unsupported channel count: "+o.length/a);o=new ImageData(new Uint8ClampedArray(o.buffer,o.byteOffset,o.length),i,t)}else if(!(o instanceof WebGLTexture))throw Error("Unsupported format: "+o.constructor.name);i=new ol([o],!1,!1,e.g.i.canvas,e.M,i,t),e.u=r=r?i.clone():i,e.h&&e.h(r),kc(e,n)})),this.g.attachEmptyPacketListener("stylized_image",(function(t){e.u=null,e.h&&e.h(null),kc(e,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)},at(t,[{key:"baseOptions",get:function(){return $o(this.j,Js,1)},set:function(e){Jo(this.j,0,1,e)}}])}(gl);Nl.prototype.stylize=Nl.prototype.Pa,Nl.prototype.setOptions=Nl.prototype.o,Nl.createFromModelPath=function(e,t){return ll(Nl,e,{baseOptions:{modelAssetPath:t}})},Nl.createFromModelBuffer=function(e,t){return ll(Nl,e,{baseOptions:{modelAssetBuffer:t}})},Nl.createFromOptions=function(e,t){return ll(Nl,e,t)};var Al=al([0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]);function Ll(e){e.gestures=[],e.landmarks=[],e.worldLandmarks=[],e.handedness=[]}function Ol(e){return 0===e.gestures.length?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:e.gestures,landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handedness:e.handedness,handednesses:e.handedness}}function Rl(e,t){void 0===t&&(t=!0);for(var n,r=[],o=xt(e);!(n=o()).done;){var i=ds(n.value);e=[];for(var a,s=xt(i.g());!(a=s()).done;){var u,c,l,d=a.value;i=t&&null!=oi(d,1)?ii(oi(d,1),0):-1,e.push({score:null!=(u=ai(d,2))?u:0,index:i,categoryName:null!=(c=si(d,3))?c:"",displayName:null!=(l=si(d,4))?l:""})}r.push(e)}return r}var Fl=function(e){function t(t,n){var r;return(r=e.call(this,new cl(t,n),"image_in","norm_rect",!1)||this).gestures=[],r.landmarks=[],r.worldLandmarks=[],r.handedness=[],Jo(t=r.v=new Mu,0,1,n=new Js),r.A=new ku,Jo(r.v,0,2,r.A),r.u=new wu,Jo(r.A,0,3,r.u),r.h=new xu,Jo(r.A,0,2,r.h),r.j=new yu,Jo(r.v,0,3,r.j),li(r.h,2,.5),li(r.A,4,.5),li(r.u,2,.5),r}lt(t,e);var n=t.prototype;return n.o=function(e){var t,n,r,o,i,a,s;if(ci(this.h,3,null!=(t=e.numHands)?t:1),"minHandDetectionConfidence"in e&&li(this.h,2,null!=(n=e.minHandDetectionConfidence)?n:.5),"minTrackingConfidence"in e&&li(this.A,4,null!=(r=e.minTrackingConfidence)?r:.5),"minHandPresenceConfidence"in e&&li(this.u,2,null!=(o=e.minHandPresenceConfidence)?o:.5),e.cannedGesturesClassifierOptions){var u,c=new mu,l=c,d=Ku(e.cannedGesturesClassifierOptions,null==(u=$o(this.j,mu,3))?void 0:u.h());Jo(l,0,2,d),Jo(this.j,0,3,c)}else void 0===e.cannedGesturesClassifierOptions&&(null==(i=$o(this.j,mu,3))||i.g());return e.customGesturesClassifierOptions?(Jo(l=c=new mu,0,2,d=Ku(e.customGesturesClassifierOptions,null==(a=$o(this.j,mu,4))?void 0:a.h())),Jo(this.j,0,4,c)):void 0===e.customGesturesClassifierOptions&&(null==(s=$o(this.j,mu,4))||s.g()),this.l(e)},n.Ka=function(e,t){return Ll(this),pl(this,e,t),Ol(this)},n.La=function(e,t,n){return Ll(this),hl(this,e,n,t),Ol(this)},n.m=function(){var e=this,t=new rs;ts(t,"image_in"),ts(t,"norm_rect"),ns(t,"hand_gestures"),ns(t,"hand_landmarks"),ns(t,"world_hand_landmarks"),ns(t,"handedness");var n=new Ua;di(n,Su,this.v);var r=new Za;qa(r,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),Ha(r,"IMAGE:image_in"),Ha(r,"NORM_RECT:norm_rect"),Ya(r,"HAND_GESTURES:hand_gestures"),Ya(r,"LANDMARKS:hand_landmarks"),Ya(r,"WORLD_LANDMARKS:world_hand_landmarks"),Ya(r,"HANDEDNESS:handedness"),r.o(n),es(t,r),this.g.attachProtoVectorListener("hand_landmarks",(function(t,n){for(var r,o=xt(t);!(r=o()).done;){for(var i,a=[],s=xt(Ko(t=Ns(r.value),Ts,1));!(i=s()).done;){var u,c,l,d,f=i.value;a.push({x:null!=(u=ai(f,1))?u:0,y:null!=(c=ai(f,2))?c:0,z:null!=(l=ai(f,3))?l:0,visibility:null!=(d=ai(f,4))?d:0})}e.landmarks.push(a)}kc(e,n)})),this.g.attachEmptyPacketListener("hand_landmarks",(function(t){kc(e,t)})),this.g.attachProtoVectorListener("world_hand_landmarks",(function(t,n){for(var r,o=xt(t);!(r=o()).done;){for(var i,a=[],s=xt(Ko(t=Ms(r.value),Es,1));!(i=s()).done;){var u,c,l,d,f=i.value;a.push({x:null!=(u=ai(f,1))?u:0,y:null!=(c=ai(f,2))?c:0,z:null!=(l=ai(f,3))?l:0,visibility:null!=(d=ai(f,4))?d:0})}e.worldLandmarks.push(a)}kc(e,n)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(function(t){kc(e,t)})),this.g.attachProtoVectorListener("hand_gestures",(function(t,n){var r;(r=e.gestures).push.apply(r,Rl(t,!1)),kc(e,n)})),this.g.attachEmptyPacketListener("hand_gestures",(function(t){kc(e,t)})),this.g.attachProtoVectorListener("handedness",(function(t,n){var r;(r=e.handedness).push.apply(r,Rl(t)),kc(e,n)})),this.g.attachEmptyPacketListener("handedness",(function(t){kc(e,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)},at(t,[{key:"baseOptions",get:function(){return $o(this.v,Js,1)},set:function(e){Jo(this.v,0,1,e)}}])}(gl);function Pl(e){return{landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handednesses:e.handedness,handedness:e.handedness}}Fl.prototype.recognizeForVideo=Fl.prototype.La,Fl.prototype.recognize=Fl.prototype.Ka,Fl.prototype.setOptions=Fl.prototype.o,Fl.createFromModelPath=function(e,t){return ll(Fl,e,{baseOptions:{modelAssetPath:t}})},Fl.createFromModelBuffer=function(e,t){return ll(Fl,e,{baseOptions:{modelAssetBuffer:t}})},Fl.createFromOptions=function(e,t){return ll(Fl,e,t)},Fl.HAND_CONNECTIONS=Al;var Ul=function(e){function t(t,n){var r;return(r=e.call(this,new cl(t,n),"image_in","norm_rect",!1)||this).landmarks=[],r.worldLandmarks=[],r.handedness=[],Jo(t=r.j=new ku,0,1,n=new Js),r.u=new wu,Jo(r.j,0,3,r.u),r.h=new xu,Jo(r.j,0,2,r.h),ci(r.h,3,1),li(r.h,2,.5),li(r.u,2,.5),li(r.j,4,.5),r}lt(t,e);var n=t.prototype;return n.o=function(e){var t,n,r,o;return"numHands"in e&&ci(this.h,3,null!=(t=e.numHands)?t:1),"minHandDetectionConfidence"in e&&li(this.h,2,null!=(n=e.minHandDetectionConfidence)?n:.5),"minTrackingConfidence"in e&&li(this.j,4,null!=(r=e.minTrackingConfidence)?r:.5),"minHandPresenceConfidence"in e&&li(this.u,2,null!=(o=e.minHandPresenceConfidence)?o:.5),this.l(e)},n.F=function(e,t){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],pl(this,e,t),Pl(this)},n.G=function(e,t,n){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],hl(this,e,n,t),Pl(this)},n.m=function(){var e=this,t=new rs;ts(t,"image_in"),ts(t,"norm_rect"),ns(t,"hand_landmarks"),ns(t,"world_hand_landmarks"),ns(t,"handedness");var n=new Ua;di(n,Iu,this.j);var r=new Za;qa(r,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),Ha(r,"IMAGE:image_in"),Ha(r,"NORM_RECT:norm_rect"),Ya(r,"LANDMARKS:hand_landmarks"),Ya(r,"WORLD_LANDMARKS:world_hand_landmarks"),Ya(r,"HANDEDNESS:handedness"),r.o(n),es(t,r),this.g.attachProtoVectorListener("hand_landmarks",(function(t,n){for(var r,o=xt(t);!(r=o()).done;){t=Ns(r.value),e.landmarks.push(tc(t))}kc(e,n)})),this.g.attachEmptyPacketListener("hand_landmarks",(function(t){kc(e,t)})),this.g.attachProtoVectorListener("world_hand_landmarks",(function(t,n){for(var r,o=xt(t);!(r=o()).done;){t=Ms(r.value),e.worldLandmarks.push(nc(t))}kc(e,n)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(function(t){kc(e,t)})),this.g.attachProtoVectorListener("handedness",(function(t,n){for(var r,o=e.handedness,i=o.push,a=[],s=xt(t);!(r=s()).done;){for(var u,c=[],l=xt((t=ds(r.value)).g());!(u=l()).done;){var d,f,p,h,m=u.value;c.push({score:null!=(d=ai(m,2))?d:0,index:null!=(f=ii(oi(m,1),0))?f:-1,categoryName:null!=(p=si(m,3))?p:"",displayName:null!=(h=si(m,4))?h:""})}a.push(c)}i.call.apply(i,[o].concat(a)),kc(e,n)})),this.g.attachEmptyPacketListener("handedness",(function(t){kc(e,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)},at(t,[{key:"baseOptions",get:function(){return $o(this.j,Js,1)},set:function(e){Jo(this.j,0,1,e)}}])}(gl);Ul.prototype.detectForVideo=Ul.prototype.G,Ul.prototype.detect=Ul.prototype.F,Ul.prototype.setOptions=Ul.prototype.o,Ul.createFromModelPath=function(e,t){return ll(Ul,e,{baseOptions:{modelAssetPath:t}})},Ul.createFromModelBuffer=function(e,t){return ll(Ul,e,{baseOptions:{modelAssetBuffer:t}})},Ul.createFromOptions=function(e,t){return ll(Ul,e,t)},Ul.HAND_CONNECTIONS=Al;var _l=al([0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]);function jl(e){e.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function Bl(e){try{if(!e.I)return e.h;e.I(e.h)}finally{Tc(e)}}function zl(e,t){e=Ns(e),t.push(tc(e))}var Gl=function(e){function t(t,n){var r;return(r=e.call(this,new cl(t,n),"input_frames_image",null,!1)||this).h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},r.outputPoseSegmentationMasks=r.outputFaceBlendshapes=!1,Jo(t=r.A=new Pu,0,1,n=new Js),r.u=new wu,Jo(r.A,0,2,r.u),r.aa=new Nu,Jo(r.A,0,3,r.aa),r.j=new tu,Jo(r.A,0,4,r.j),r.H=new uu,Jo(r.A,0,5,r.H),r.v=new Lu,Jo(r.A,0,6,r.v),r.D=new Ru,Jo(r.A,0,7,r.D),li(r.j,2,.5),li(r.j,3,.3),li(r.H,2,.5),li(r.v,2,.5),li(r.v,3,.3),li(r.D,2,.5),li(r.u,2,.5),r}lt(t,e);var n=t.prototype;return n.o=function(e){var t,n,r,o,i,a,s;return"minFaceDetectionConfidence"in e&&li(this.j,2,null!=(t=e.minFaceDetectionConfidence)?t:.5),"minFaceSuppressionThreshold"in e&&li(this.j,3,null!=(n=e.minFaceSuppressionThreshold)?n:.3),"minFacePresenceConfidence"in e&&li(this.H,2,null!=(r=e.minFacePresenceConfidence)?r:.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"minPoseDetectionConfidence"in e&&li(this.v,2,null!=(o=e.minPoseDetectionConfidence)?o:.5),"minPoseSuppressionThreshold"in e&&li(this.v,3,null!=(i=e.minPoseSuppressionThreshold)?i:.3),"minPosePresenceConfidence"in e&&li(this.D,2,null!=(a=e.minPosePresenceConfidence)?a:.5),"outputPoseSegmentationMasks"in e&&(this.outputPoseSegmentationMasks=!!e.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in e&&li(this.u,2,null!=(s=e.minHandLandmarksConfidence)?s:.5),this.l(e)},n.F=function(e,t,n){var r="function"!=typeof t?t:{};return this.I="function"==typeof t?t:n,jl(this),pl(this,e,r),Bl(this)},n.G=function(e,t,n,r){var o="function"!=typeof n?n:{};return this.I="function"==typeof n?n:r,jl(this),hl(this,e,o,t),Bl(this)},n.m=function(){var e=this,t=new rs;ts(t,"input_frames_image"),ns(t,"pose_landmarks"),ns(t,"pose_world_landmarks"),ns(t,"face_landmarks"),ns(t,"left_hand_landmarks"),ns(t,"left_hand_world_landmarks"),ns(t,"right_hand_landmarks"),ns(t,"right_hand_world_landmarks");var n=new Ua,r=new Ma;Vo(r,1,to("type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),""),function(e,t){if(null!=t)if(Array.isArray(t))Lo(e,2,Co(t,Eo,void 0,void 0,!1));else{if(!("string"==typeof t||t instanceof sn||Jt(t)))throw Error("invalid value in Any.value field: "+t+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");Vo(e,2,Ir(t,!1,!1),on())}}(r,this.A.g());var o=new Za;qa(o,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),ri(o,8,Ma,r),Ha(o,"IMAGE:input_frames_image"),Ya(o,"POSE_LANDMARKS:pose_landmarks"),Ya(o,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),Ya(o,"FACE_LANDMARKS:face_landmarks"),Ya(o,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),Ya(o,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),Ya(o,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),Ya(o,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),o.o(n),es(t,o),Dc(this,t),this.g.attachProtoListener("pose_landmarks",(function(t,n){zl(t,e.h.poseLandmarks),kc(e,n)})),this.g.attachEmptyPacketListener("pose_landmarks",(function(t){kc(e,t)})),this.g.attachProtoListener("pose_world_landmarks",(function(t,n){var r=e.h.poseWorldLandmarks;t=Ms(t),r.push(nc(t)),kc(e,n)})),this.g.attachEmptyPacketListener("pose_world_landmarks",(function(t){kc(e,t)})),this.outputPoseSegmentationMasks&&(Ya(o,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),Mc(this,"pose_segmentation_mask"),this.g.W("pose_segmentation_mask",(function(t,n){e.h.poseSegmentationMasks=[ml(e,t,!0,!e.I)],kc(e,n)})),this.g.attachEmptyPacketListener("pose_segmentation_mask",(function(t){e.h.poseSegmentationMasks=[],kc(e,t)}))),this.g.attachProtoListener("face_landmarks",(function(t,n){zl(t,e.h.faceLandmarks),kc(e,n)})),this.g.attachEmptyPacketListener("face_landmarks",(function(t){kc(e,t)})),this.outputFaceBlendshapes&&(ns(t,"extra_blendshapes"),Ya(o,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",(function(t,n){var r,o=e.h.faceBlendshapes;e.outputFaceBlendshapes&&(t=ds(t),o.push(Ju(null!=(r=t.g())?r:[]))),kc(e,n)})),this.g.attachEmptyPacketListener("extra_blendshapes",(function(t){kc(e,t)}))),this.g.attachProtoListener("left_hand_landmarks",(function(t,n){zl(t,e.h.leftHandLandmarks),kc(e,n)})),this.g.attachEmptyPacketListener("left_hand_landmarks",(function(t){kc(e,t)})),this.g.attachProtoListener("left_hand_world_landmarks",(function(t,n){var r=e.h.leftHandWorldLandmarks;t=Ms(t),r.push(nc(t)),kc(e,n)})),this.g.attachEmptyPacketListener("left_hand_world_landmarks",(function(t){kc(e,t)})),this.g.attachProtoListener("right_hand_landmarks",(function(t,n){zl(t,e.h.rightHandLandmarks),kc(e,n)})),this.g.attachEmptyPacketListener("right_hand_landmarks",(function(t){kc(e,t)})),this.g.attachProtoListener("right_hand_world_landmarks",(function(t,n){var r=e.h.rightHandWorldLandmarks;t=Ms(t),r.push(nc(t)),kc(e,n)})),this.g.attachEmptyPacketListener("right_hand_world_landmarks",(function(t){kc(e,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)},at(t,[{key:"baseOptions",get:function(){return $o(this.A,Js,1)},set:function(e){Jo(this.A,0,1,e)}}])}(gl);Gl.prototype.detectForVideo=Gl.prototype.G,Gl.prototype.detect=Gl.prototype.F,Gl.prototype.setOptions=Gl.prototype.o,Gl.createFromModelPath=function(e,t){return ll(Gl,e,{baseOptions:{modelAssetPath:t}})},Gl.createFromModelBuffer=function(e,t){return ll(Gl,e,{baseOptions:{modelAssetBuffer:t}})},Gl.createFromOptions=function(e,t){return ll(Gl,e,t)},Gl.HAND_CONNECTIONS=Al,Gl.POSE_CONNECTIONS=_l,Gl.FACE_LANDMARKS_LIPS=yl,Gl.FACE_LANDMARKS_LEFT_EYE=bl,Gl.FACE_LANDMARKS_LEFT_EYEBROW=xl,Gl.FACE_LANDMARKS_LEFT_IRIS=Cl,Gl.FACE_LANDMARKS_RIGHT_EYE=wl,Gl.FACE_LANDMARKS_RIGHT_EYEBROW=El,Gl.FACE_LANDMARKS_RIGHT_IRIS=kl,Gl.FACE_LANDMARKS_FACE_OVAL=Dl,Gl.FACE_LANDMARKS_CONTOURS=Ml,Gl.FACE_LANDMARKS_TESSELATION=Tl;var Vl=function(e){function t(t,n){var r;return(r=e.call(this,new cl(t,n),"input_image","norm_rect",!0)||this).j={classifications:[]},Jo(t=r.h=new Uu,0,1,n=new Js),r}lt(t,e);var n=t.prototype;return n.o=function(e){return Jo(this.h,0,2,Ku(e,$o(this.h,qs,2))),this.l(e)},n.ua=function(e,t){return this.j={classifications:[]},pl(this,e,t),this.j},n.va=function(e,t,n){return this.j={classifications:[]},hl(this,e,n,t),this.j},n.m=function(){var e=this,t=new rs;ts(t,"input_image"),ts(t,"norm_rect"),ns(t,"classifications");var n=new Ua;di(n,_u,this.h);var r=new Za;qa(r,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),Ha(r,"IMAGE:input_image"),Ha(r,"NORM_RECT:norm_rect"),Ya(r,"CLASSIFICATIONS:classifications"),r.o(n),es(t,r),this.g.attachProtoListener("classifications",(function(t,n){e.j=function(e){var t={classifications:Ko(e,Rs,1).map((function(e){var t,n;return Ju(null!=(t=null==(n=$o(e,cs,4))?void 0:n.g())?t:[],ii(oi(e,2),0),si(e,3))}))};return null!=Jr(So(e,2))&&(t.timestampMs=ii(Jr(So(e,2)),0)),t}(Us(t)),kc(e,n)})),this.g.attachEmptyPacketListener("classifications",(function(t){kc(e,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)},at(t,[{key:"baseOptions",get:function(){return $o(this.h,Js,1)},set:function(e){Jo(this.h,0,1,e)}}])}(gl);Vl.prototype.classifyForVideo=Vl.prototype.va,Vl.prototype.classify=Vl.prototype.ua,Vl.prototype.setOptions=Vl.prototype.o,Vl.createFromModelPath=function(e,t){return ll(Vl,e,{baseOptions:{modelAssetPath:t}})},Vl.createFromModelBuffer=function(e,t){return ll(Vl,e,{baseOptions:{modelAssetBuffer:t}})},Vl.createFromOptions=function(e,t){return ll(Vl,e,t)};var Wl=function(e){function t(t,n){var r;return(r=e.call(this,new cl(t,n),"image_in","norm_rect",!0)||this).h=new ju,r.embeddings={embeddings:[]},Jo(t=r.h,0,1,n=new Js),r}lt(t,e);var n=t.prototype;return n.o=function(e){var t=this.h,n=$o(this.h,Ys,2);return n=n?n.clone():new Ys,void 0!==e.l2Normalize?ui(n,1,e.l2Normalize):"l2Normalize"in e&&Lo(n,1),void 0!==e.quantize?ui(n,2,e.quantize):"quantize"in e&&Lo(n,2),Jo(t,0,2,n),this.l(e)},n.Ba=function(e,t){return pl(this,e,t),this.embeddings},n.Ca=function(e,t,n){return hl(this,e,n,t),this.embeddings},n.m=function(){var e=this,t=new rs;ts(t,"image_in"),ts(t,"norm_rect"),ns(t,"embeddings_out");var n=new Ua;di(n,Bu,this.h);var r=new Za;qa(r,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),Ha(r,"IMAGE:image_in"),Ha(r,"NORM_RECT:norm_rect"),Ya(r,"EMBEDDINGS:embeddings_out"),r.o(n),es(t,r),this.g.attachProtoListener("embeddings_out",(function(t,n){t=Ws(t),e.embeddings=function(e){return{embeddings:Ko(e,Bs,1).map((function(e){var t,n,r={headIndex:null!=(t=ii(oi(e,3),0))?t:-1,headName:null!=(n=si(e,4))?n:""};if(void 0!==Qo(e,_s,Ho(e,1)))e=Uo(e=$o(e,_s,Ho(e,1)),1,Br),r.floatEmbedding=e.slice();else{var o,i,a=new Uint8Array(0);r.quantizedEmbedding=null!=(o=null==(i=$o(e,js,Ho(e,2)))||null==(i=i.qa())?void 0:i.h())?o:a}return r})),timestampMs:ii(Jr(So(e,2)),0)}}(t),kc(e,n)})),this.g.attachEmptyPacketListener("embeddings_out",(function(t){kc(e,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)},at(t,[{key:"baseOptions",get:function(){return $o(this.h,Js,1)},set:function(e){Jo(this.h,0,1,e)}}])}(gl);Wl.cosineSimilarity=function(e,t){if(e.floatEmbedding&&t.floatEmbedding)e=oc(e.floatEmbedding,t.floatEmbedding);else{if(!e.quantizedEmbedding||!t.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");e=oc(rc(e.quantizedEmbedding),rc(t.quantizedEmbedding))}return e},Wl.prototype.embedForVideo=Wl.prototype.Ca,Wl.prototype.embed=Wl.prototype.Ba,Wl.prototype.setOptions=Wl.prototype.o,Wl.createFromModelPath=function(e,t){return ll(Wl,e,{baseOptions:{modelAssetPath:t}})},Wl.createFromModelBuffer=function(e,t){return ll(Wl,e,{baseOptions:{modelAssetBuffer:t}})},Wl.createFromOptions=function(e,t){return ll(Wl,e,t)};var ql=function(){function e(e,t,n){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=n}return e.prototype.close=function(){var e,t;null!=(e=this.confidenceMasks)&&e.forEach((function(e){e.close()})),null==(t=this.categoryMask)||t.close()},e}();function Hl(e){e.categoryMask=void 0,e.confidenceMasks=void 0,e.qualityScores=void 0}function Yl(e){try{var t=new ql(e.confidenceMasks,e.categoryMask,e.qualityScores);if(!e.j)return t;e.j(t)}finally{Tc(e)}}ql.prototype.close=ql.prototype.close;var Zl=function(e){function t(t,n){var r;return(r=e.call(this,new cl(t,n),"image_in","norm_rect",!1)||this).u=[],r.outputCategoryMask=!1,r.outputConfidenceMasks=!0,r.h=new qu,r.v=new zu,Jo(r.h,0,3,r.v),Jo(t=r.h,0,1,n=new Js),r}lt(t,e);var n=t.prototype;return n.o=function(t){var n,r;return void 0!==t.displayNamesLocale?Lo(this.h,2,to(t.displayNamesLocale)):"displayNamesLocale"in t&&Lo(this.h,2),"outputCategoryMask"in t&&(this.outputCategoryMask=null!=(n=t.outputCategoryMask)&&n),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=null==(r=t.outputConfidenceMasks)||r),e.prototype.l.call(this,t)},n.L=function(){!function(e,t,n){var r=Ko(e.fa(),Za,1).filter((function(e){return si(e,1).includes("mediapipe.tasks.TensorsToSegmentationCalculator")}));if(e.u=[],1<r.length)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");1===r.length&&(null!=(t=null==(n=$o(r[0],Ua,7))||null==(n=n.l())?void 0:n.g())?t:new Map).forEach((function(t,n){e.u[Number(n)]=si(t,1)}))}(this)},n.ga=function(e,t,n){var r="function"!=typeof t?t:{};return this.j="function"==typeof t?t:n,Hl(this),pl(this,e,r),Yl(this)},n.Na=function(e,t,n,r){var o="function"!=typeof n?n:{};return this.j="function"==typeof n?n:r,Hl(this),hl(this,e,o,t),Yl(this)},n.Fa=function(){return this.u},n.m=function(){var e=this,t=new rs;ts(t,"image_in"),ts(t,"norm_rect");var n=new Ua;di(n,Hu,this.h);var r=new Za;qa(r,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),Ha(r,"IMAGE:image_in"),Ha(r,"NORM_RECT:norm_rect"),r.o(n),es(t,r),Dc(this,t),this.outputConfidenceMasks&&(ns(t,"confidence_masks"),Ya(r,"CONFIDENCE_MASKS:confidence_masks"),Mc(this,"confidence_masks"),this.g.da("confidence_masks",(function(t,n){e.confidenceMasks=t.map((function(t){return ml(e,t,!0,!e.j)})),kc(e,n)})),this.g.attachEmptyPacketListener("confidence_masks",(function(t){e.confidenceMasks=[],kc(e,t)}))),this.outputCategoryMask&&(ns(t,"category_mask"),Ya(r,"CATEGORY_MASK:category_mask"),Mc(this,"category_mask"),this.g.W("category_mask",(function(t,n){e.categoryMask=ml(e,t,!1,!e.j),kc(e,n)})),this.g.attachEmptyPacketListener("category_mask",(function(t){e.categoryMask=void 0,kc(e,t)}))),ns(t,"quality_scores"),Ya(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(function(t,n){e.qualityScores=t,kc(e,n)})),this.g.attachEmptyPacketListener("quality_scores",(function(t){e.categoryMask=void 0,kc(e,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)},at(t,[{key:"baseOptions",get:function(){return $o(this.h,Js,1)},set:function(e){Jo(this.h,0,1,e)}}])}(gl);Zl.prototype.getLabels=Zl.prototype.Fa,Zl.prototype.segmentForVideo=Zl.prototype.Na,Zl.prototype.segment=Zl.prototype.ga,Zl.prototype.setOptions=Zl.prototype.o,Zl.createFromModelPath=function(e,t){return ll(Zl,e,{baseOptions:{modelAssetPath:t}})},Zl.createFromModelBuffer=function(e,t){return ll(Zl,e,{baseOptions:{modelAssetBuffer:t}})},Zl.createFromOptions=function(e,t){return ll(Zl,e,t)};var Ql=function(){function e(e,t,n){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=n}return e.prototype.close=function(){var e,t;null!=(e=this.confidenceMasks)&&e.forEach((function(e){e.close()})),null==(t=this.categoryMask)||t.close()},e}();Ql.prototype.close=Ql.prototype.close;var $l=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Xl=[0,sa,-2],Kl=[0,ea,-3,la],Jl=[0,ea,-3,la,ea,-1],ed=[0,Jl],td=[0,ed,Xl],nd=[0,Jl,Xl],rd=[0,Jl,sa,-1],od=[0,rd,Xl],id=[0,ea,-3,la,Xl,-1],ad=[0,ea,-3,la,xa],sd=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),ud=[0,ea,-1,la],cd=function(e){function t(){return e.call(this)||this}return lt(t,e),t}(fi);cd.B=[1];var ld=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),dd=[1,2,3,4,5,6,7,8,9,10,14,15],fd=[0,dd,va,Jl,va,nd,va,ed,va,td,va,ud,va,ad,va,Kl,va,[0,ha,ea,-2,la,sa,la,-1,2,ea,Xl],va,rd,va,od,ea,Xl,ha,va,id,va,[0,Ji,ud]],pd=[0,ha,sa,-1,la],hd=function(e){function t(){return e.call(this)||this}return lt(t,e),t}(fi);hd.B=[1],hd.prototype.g=Da([0,Ji,fd,ha,pd]);var md=function(e){function t(t,n){var r;return(r=e.call(this,new cl(t,n),"image_in","norm_rect_in",!1)||this).outputCategoryMask=!1,r.outputConfidenceMasks=!0,r.h=new qu,r.v=new zu,Jo(r.h,0,3,r.v),Jo(t=r.h,0,1,n=new Js),r}lt(t,e);var n=t.prototype;return n.o=function(t){var n,r;return"outputCategoryMask"in t&&(this.outputCategoryMask=null!=(n=t.outputCategoryMask)&&n),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=null==(r=t.outputConfidenceMasks)||r),e.prototype.l.call(this,t)},n.ga=function(e,t,n,r){var o="function"!=typeof n?n:{};this.j="function"==typeof n?n:r,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,n=this.J+1,r=new hd;var i=new ld,a=new $l;if(ci(a,1,255),Jo(i,0,12,a),t.keypoint&&t.scribble)throw Error("Cannot provide both keypoint and scribble.");if(t.keypoint){var s=new sd;ui(s,3,!0),li(s,1,t.keypoint.x),li(s,2,t.keypoint.y),ei(i,5,dd,s)}else{if(!t.scribble)throw Error("Must provide either a keypoint or a scribble.");for(var u,c=xt((a=new cd,t.scribble));!(u=c()).done;)s=u.value,ui(t=new sd,3,!0),li(t,1,s.x),li(t,2,s.y),ri(a,1,sd,t);ei(i,15,dd,a)}ri(r,1,ld,i),this.g.addProtoToStream(r.g(),"drishti.RenderData","roi_in",n),pl(this,e,o);e:{try{var l=new Ql(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var d=l;break e}this.j(l)}finally{Tc(this)}d=void 0}return d},n.m=function(){var e=this,t=new rs;ts(t,"image_in"),ts(t,"roi_in"),ts(t,"norm_rect_in");var n=new Ua;di(n,Hu,this.h);var r=new Za;qa(r,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"),Ha(r,"IMAGE:image_in"),Ha(r,"ROI:roi_in"),Ha(r,"NORM_RECT:norm_rect_in"),r.o(n),es(t,r),Dc(this,t),this.outputConfidenceMasks&&(ns(t,"confidence_masks"),Ya(r,"CONFIDENCE_MASKS:confidence_masks"),Mc(this,"confidence_masks"),this.g.da("confidence_masks",(function(t,n){e.confidenceMasks=t.map((function(t){return ml(e,t,!0,!e.j)})),kc(e,n)})),this.g.attachEmptyPacketListener("confidence_masks",(function(t){e.confidenceMasks=[],kc(e,t)}))),this.outputCategoryMask&&(ns(t,"category_mask"),Ya(r,"CATEGORY_MASK:category_mask"),Mc(this,"category_mask"),this.g.W("category_mask",(function(t,n){e.categoryMask=ml(e,t,!1,!e.j),kc(e,n)})),this.g.attachEmptyPacketListener("category_mask",(function(t){e.categoryMask=void 0,kc(e,t)}))),ns(t,"quality_scores"),Ya(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(function(t,n){e.qualityScores=t,kc(e,n)})),this.g.attachEmptyPacketListener("quality_scores",(function(t){e.categoryMask=void 0,kc(e,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)},at(t,[{key:"baseOptions",get:function(){return $o(this.h,Js,1)},set:function(e){Jo(this.h,0,1,e)}}])}(gl);md.prototype.segment=md.prototype.ga,md.prototype.setOptions=md.prototype.o,md.createFromModelPath=function(e,t){return ll(md,e,{baseOptions:{modelAssetPath:t}})},md.createFromModelBuffer=function(e,t){return ll(md,e,{baseOptions:{modelAssetBuffer:t}})},md.createFromOptions=function(e,t){return ll(md,e,t)};var gd=function(e){function t(t,n){var r;return(r=e.call(this,new cl(t,n),"input_frame_gpu","norm_rect",!1)||this).j={detections:[]},Jo(t=r.h=new Yu,0,1,n=new Js),r}lt(t,e);var n=t.prototype;return n.o=function(e){return void 0!==e.displayNamesLocale?Lo(this.h,2,to(e.displayNamesLocale)):"displayNamesLocale"in e&&Lo(this.h,2),void 0!==e.maxResults?ci(this.h,3,e.maxResults):"maxResults"in e&&Lo(this.h,3),void 0!==e.scoreThreshold?li(this.h,4,e.scoreThreshold):"scoreThreshold"in e&&Lo(this.h,4),void 0!==e.categoryAllowlist?Go(this.h,5,e.categoryAllowlist):"categoryAllowlist"in e&&Lo(this.h,5),void 0!==e.categoryDenylist?Go(this.h,6,e.categoryDenylist):"categoryDenylist"in e&&Lo(this.h,6),this.l(e)},n.F=function(e,t){return this.j={detections:[]},pl(this,e,t),this.j},n.G=function(e,t,n){return this.j={detections:[]},hl(this,e,n,t),this.j},n.m=function(){var e=this,t=new rs;ts(t,"input_frame_gpu"),ts(t,"norm_rect"),ns(t,"detections");var n=new Ua;di(n,Zu,this.h);var r=new Za;qa(r,"mediapipe.tasks.vision.ObjectDetectorGraph"),Ha(r,"IMAGE:input_frame_gpu"),Ha(r,"NORM_RECT:norm_rect"),Ya(r,"DETECTIONS:detections"),r.o(n),es(t,r),this.g.attachProtoVectorListener("detections",(function(t,n){for(var r,o=xt(t);!(r=o()).done;){t=ws(r.value),e.j.detections.push(ec(t))}kc(e,n)})),this.g.attachEmptyPacketListener("detections",(function(t){kc(e,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)},at(t,[{key:"baseOptions",get:function(){return $o(this.h,Js,1)},set:function(e){Jo(this.h,0,1,e)}}])}(gl);gd.prototype.detectForVideo=gd.prototype.G,gd.prototype.detect=gd.prototype.F,gd.prototype.setOptions=gd.prototype.o,gd.createFromModelPath=function(){var e=ut(bt.mark((function e(t,n){return bt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",ll(gd,t,{baseOptions:{modelAssetPath:n}}));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),gd.createFromModelBuffer=function(e,t){return ll(gd,e,{baseOptions:{modelAssetBuffer:t}})},gd.createFromOptions=function(e,t){return ll(gd,e,t)};var vd=function(){function e(e,t,n){this.landmarks=e,this.worldLandmarks=t,this.segmentationMasks=n}return e.prototype.close=function(){var e;null==(e=this.segmentationMasks)||e.forEach((function(e){e.close()}))},e}();function yd(e){e.landmarks=[],e.worldLandmarks=[],e.segmentationMasks=void 0}function bd(e){try{var t=new vd(e.landmarks,e.worldLandmarks,e.segmentationMasks);if(!e.j)return t;e.j(t)}finally{Tc(e)}}vd.prototype.close=vd.prototype.close;var xd=function(e){function t(t,n){var r;return(r=e.call(this,new cl(t,n),"image_in","norm_rect",!1)||this).landmarks=[],r.worldLandmarks=[],r.outputSegmentationMasks=!1,Jo(t=r.h=new $u,0,1,n=new Js),r.D=new Ru,Jo(r.h,0,3,r.D),r.v=new Lu,Jo(r.h,0,2,r.v),ci(r.v,4,1),li(r.v,2,.5),li(r.D,2,.5),li(r.h,4,.5),r}lt(t,e);var n=t.prototype;return n.o=function(e){var t,n,r,o,i;return"numPoses"in e&&ci(this.v,4,null!=(t=e.numPoses)?t:1),"minPoseDetectionConfidence"in e&&li(this.v,2,null!=(n=e.minPoseDetectionConfidence)?n:.5),"minTrackingConfidence"in e&&li(this.h,4,null!=(r=e.minTrackingConfidence)?r:.5),"minPosePresenceConfidence"in e&&li(this.D,2,null!=(o=e.minPosePresenceConfidence)?o:.5),"outputSegmentationMasks"in e&&(this.outputSegmentationMasks=null!=(i=e.outputSegmentationMasks)&&i),this.l(e)},n.F=function(e,t,n){var r="function"!=typeof t?t:{};return this.j="function"==typeof t?t:n,yd(this),pl(this,e,r),bd(this)},n.G=function(e,t,n,r){var o="function"!=typeof n?n:{};return this.j="function"==typeof n?n:r,yd(this),hl(this,e,o,t),bd(this)},n.m=function(){var e=this,t=new rs;ts(t,"image_in"),ts(t,"norm_rect"),ns(t,"normalized_landmarks"),ns(t,"world_landmarks"),ns(t,"segmentation_masks");var n=new Ua;di(n,Xu,this.h);var r=new Za;qa(r,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),Ha(r,"IMAGE:image_in"),Ha(r,"NORM_RECT:norm_rect"),Ya(r,"NORM_LANDMARKS:normalized_landmarks"),Ya(r,"WORLD_LANDMARKS:world_landmarks"),r.o(n),es(t,r),Dc(this,t),this.g.attachProtoVectorListener("normalized_landmarks",(function(t,n){e.landmarks=[];for(var r,o=xt(t);!(r=o()).done;){t=Ns(r.value),e.landmarks.push(tc(t))}kc(e,n)})),this.g.attachEmptyPacketListener("normalized_landmarks",(function(t){e.landmarks=[],kc(e,t)})),this.g.attachProtoVectorListener("world_landmarks",(function(t,n){e.worldLandmarks=[];for(var r,o=xt(t);!(r=o()).done;){t=Ms(r.value),e.worldLandmarks.push(nc(t))}kc(e,n)})),this.g.attachEmptyPacketListener("world_landmarks",(function(t){e.worldLandmarks=[],kc(e,t)})),this.outputSegmentationMasks&&(Ya(r,"SEGMENTATION_MASK:segmentation_masks"),Mc(this,"segmentation_masks"),this.g.da("segmentation_masks",(function(t,n){e.segmentationMasks=t.map((function(t){return ml(e,t,!0,!e.j)})),kc(e,n)})),this.g.attachEmptyPacketListener("segmentation_masks",(function(t){e.segmentationMasks=[],kc(e,t)}))),t=t.g(),this.setGraph(new Uint8Array(t),!0)},at(t,[{key:"baseOptions",get:function(){return $o(this.h,Js,1)},set:function(e){Jo(this.h,0,1,e)}}])}(gl);xd.prototype.detectForVideo=xd.prototype.G,xd.prototype.detect=xd.prototype.F,xd.prototype.setOptions=xd.prototype.o,xd.createFromModelPath=function(e,t){return ll(xd,e,{baseOptions:{modelAssetPath:t}})},xd.createFromModelBuffer=function(e,t){return ll(xd,e,{baseOptions:{modelAssetBuffer:t}})},xd.createFromOptions=function(e,t){return ll(xd,e,t)},xd.POSE_CONNECTIONS=_l;var Cd="https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.7/wasm",wd=!1;function Ed(){return h(this,void 0,void 0,(function(){function e(e){e.detail.url===t&&(Hd.visionRuntime=tf([t]),document.dispatchEvent(new CustomEvent("idmission.preloadProgress.visionRuntime",{detail:Hd.visionRuntime})))}var t;return m(this,(function(n){switch(n.label){case 0:if(wd)return[2,new Promise((function(e){setInterval((function(){wd||e()}),100)}))];wd=!0,t="".concat(Cd,"/vision_wasm_internal.wasm"),document.addEventListener("idmission.preloadProgress",e),n.label=1;case 1:return n.trys.push([1,,3,4]),[4,Yd(t)];case 2:return n.sent(),[3,4];case 3:return document.removeEventListener("idmission.preloadProgress",e),wd=!1,[7];case 4:return[2]}}))}))}function kd(e,t,n,r,o,i,a){if(void 0===i&&(i=.92),!e||!t||!n)return"";var s=e.getContext("2d"),u=t.getContext("2d"),c=n.getContext("2d");if(!s||!u||!c)throw new Error("could not get 2d context");e.width=r.width,e.height=r.height,s.putImageData(r,0,0);var l=o.box,d=l.width,f=.6*r.height-d,p=Math.max(0,l.xMin-f/2);r.height>r.width?(t.width=r.width,t.height=r.height,u.drawImage(e,0,0,t.width,t.height)):(t.width=d+f,t.height=r.height,u.drawImage(e,p,0,t.width,t.height,0,0,t.width,t.height)),n.height=null!=a?a:t.height,n.width=t.width*(n.height/t.height),null==c||c.drawImage(t,0,0,n.width,n.height);var h=n.toDataURL("image/jpeg",i);return Oe("cropToShoulders size",(new TextEncoder).encode(h).length),qe(e),qe(t),qe(n),h}function Dd(e,t,n){n||(n=document.createElement("canvas"));var r=n.getContext("2d");if(!r)throw new Error("could not get 2d context");var o=t.xMin,i=t.yMin,a=t.width,s=t.height;return n.width=a,n.height=s,r.drawImage(e,o,i,a,s,0,0,a,s),n}var Md="https://websdk-cdn-dev.idmission.com/assets/models/selfiesegmenter20240524/selfie_segmenter.tflite",Td=256440.32,Id=(new Date).getTime(),Sd=f({},{probeState:"notProbed",delegate:"GPU",networkTier:"untested",networkSpeed:0,networkTestTime:0});function Nd(){return h(this,void 0,void 0,(function(){return m(this,(function(e){switch(e.label){case 0:return"probed"===Sd.probeState?[2]:"probing"===Sd.probeState?[2,new Promise((function(e){setInterval((function(){"probed"===Sd.probeState&&e()}),100)}))]:(Sd.probeState="probing",[4,Ed()]);case 1:e.sent(),e.label=2;case 2:return e.trys.push([2,4,9,10]),Oe("Model Probing: testing GPU capabilities..."),[4,Ad("GPU")];case 3:return e.sent(),Oe("Model Probing: GPU is capable."),[3,10];case 4:Re("Model Probing: GPU delegate could not be loaded",e.sent()),Sd.delegate="CPU",e.label=5;case 5:return e.trys.push([5,7,,8]),Oe("Model Probing: testing CPU capabilities..."),[4,Ad("CPU")];case 6:return e.sent(),Oe("Model Probing: CPU is capable."),[3,8];case 7:return Re("Model Probing: CPU delegate could not be loaded",e.sent()),Sd.delegate="NONE",[3,8];case 8:return[3,10];case 9:return Sd.probeState="probed",[7];case 10:return[2]}}))}))}function Ad(){return h(this,arguments,void 0,(function(e,t){var n,r,o,i,a,s,u;return void 0===e&&(e="GPU"),void 0===t&&(t=1e4),m(this,(function(c){switch(c.label){case 0:n="".concat(Md,"?_=").concat(Id),r=new Date,c.label=1;case 1:return c.trys.push([1,3,,4]),[4,Promise.race([Yd(n),Ld(t)])];case 2:return c.sent(),[3,4];case 3:return Fe("speed test failed",c.sent()),Sd.networkTier="unusable",[2];case 4:return o=((new Date).getTime()-r.getTime())/1e3,Sd.networkTestTime||(Sd.networkTestTime=o),Sd.networkSpeed||(Sd.networkSpeed=Td/o),Sd.networkTier=o<.5?"fast":o<2?"medium":"slow",Oe("Model Probing: network speed",(Sd.networkSpeed/1024/1024).toFixed(3),"Mbps"),Oe("Model Probing: network test took",o),Oe("Model Probing: network tier",Sd.networkTier),s=(a=Zl).createFromOptions,[4,lc.forVisionTasks(Cd)];case 5:return[4,s.apply(a,[c.sent(),{baseOptions:{modelAssetPath:n,delegate:e}}])];case 6:return i=c.sent(),u=document.createElement("canvas"),i.segment(u),u.remove(),[2]}}))}))}function Ld(e){return new Promise((function(t,n){setTimeout((function(){n(new Error("gave up after reaching maximum time allowed"))}),e)}))}function Od(e){var t,n,r,o,i,a,s,u;return{xMin:null!==(t=null==e?void 0:e.originX)&&void 0!==t?t:0,xMax:(null!==(n=null==e?void 0:e.originX)&&void 0!==n?n:0)+(null!==(r=null==e?void 0:e.width)&&void 0!==r?r:0),yMin:null!==(o=null==e?void 0:e.originY)&&void 0!==o?o:0,yMax:(null!==(i=null==e?void 0:e.originY)&&void 0!==i?i:0)+(null!==(a=null==e?void 0:e.height)&&void 0!==a?a:0),width:null!==(s=null==e?void 0:e.width)&&void 0!==s?s:0,height:null!==(u=null==e?void 0:e.height)&&void 0!==u?u:0}}function Rd(e,t){return void 0===t&&(t=100),new Promise((function(n){var r,o;if((null!==(o=null===(r=e.current)||void 0===r?void 0:r.readyState)&&void 0!==o?o:0)>=2)return n();var i=setInterval((function(){var t,r;(null!==(r=null===(t=e.current)||void 0===t?void 0:t.readyState)&&void 0!==r?r:0)>=2&&(clearInterval(i),n())}),t)}))}var Fd="https://websdk-cdn-dev.idmission.com/assets/models/focusmp20240619/model_fp16.tflite",Pd=45e3,Ud={};function _d(e){var n=e.modelPath,r=void 0===n?Fd:n,o=e.modelLoadTimeoutMs,i=void 0===o?Pd:o,a=e.onModelError,s=t.useRef(null),u=t.useState(!1),c=u[0],l=u[1],d=t.useState(0),f=d[0],p=d[1],g=t.useState(null),v=g[0],y=g[1],b=t.useContext(nt).videoRef;return t.useEffect((function(){var e=this;function t(e){p(ef(e.detail))}l(!1),document.addEventListener("idmission.preloadProgress.focus",t);var n=setTimeout((function(){y(new Error("Model loading time limit exceeded."))}),i);return function(e){return h(this,void 0,void 0,(function(){var t,n,r,o,i;return m(this,(function(a){switch(a.label){case 0:return t="".concat(e),Ud[t]?[2,Ud[t]]:[4,Kd()];case 1:if(a.sent(),"NONE"===Sd.delegate)throw new Error("No available delegate for focus detector.");return n=Ud,r=t,i=(o=Vl).createFromOptions,[4,lc.forVisionTasks(Cd)];case 2:return[4,i.apply(o,[a.sent(),{baseOptions:{modelAssetPath:e,delegate:Sd.delegate},runningMode:"VIDEO"}])];case 3:return n[r]=a.sent(),[2,Ud[t]]}}))}))}(r).then((function(t){return h(e,void 0,void 0,(function(){return m(this,(function(e){switch(e.label){case 0:return s.current=t,p(100),clearTimeout(n),[4,Rd(b)];case 1:return e.sent(),t.classifyForVideo(b.current,performance.now()),l(!0),[2]}}))}))})).catch((function(e){y(e)})).finally((function(){clearTimeout(n)})),function(){clearTimeout(n),document.removeEventListener("idmission.preloadProgress.focus",t)}}),[r,i,b]),t.useEffect((function(){v&&(null==a||a(v))}),[v,a]),{model:s,ready:c,modelDownloadProgress:f,modelError:v}}function jd(e,t,n,r,o){var i,a,s,u,c,l=new Date,d=function(e,t,n,r){if(!r)return e;var o=Dd(e,r,t),i=[r.width,r.height],a=i[0],s=i[1];if(s<=a)return o;var u=n.getContext("2d");return u?(n.width=s,n.height=a,u.clearRect(0,0,n.width,n.height),u.translate(n.width/2,n.height/2),u.rotate(1.5708),u.drawImage(o,-a/2,-s/2),n):o}(t,n,r,o),f=e.classifyForVideo(d,performance.now()),p=null!==(c=null===(u=null===(s=null===(a=null===(i=null==f?void 0:f.classifications)||void 0===i?void 0:i[0])||void 0===a?void 0:a.categories)||void 0===s?void 0:s.find((function(e){return"focused"===e.categoryName})))||void 0===u?void 0:u.score)&&void 0!==c?c:0;return{score:p,predictionTime:(new Date).getTime()-l.getTime()}}(function(){var e;function t(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var n="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e};var r=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof V&&V];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var o=r;e=e.split(".");for(var i=0;i<e.length-1;i++){var a=e[i];if(!(a in o))break e;o=o[a]}(t=t(i=o[e=e[e.length-1]]))!=i&&null!=t&&n(o,e,{configurable:!0,writable:!0,value:t})}}function i(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function a(e){var n="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];return n?n.call(e):{next:t(e)}}function s(e){if(!(e instanceof Array)){e=a(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}o("Symbol",(function(e){function t(e,t){this.g=e,n(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var r="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",o=0;return function e(n){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(r+(n||"")+"_"+o++,n)}})),o("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var o="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),a=0;a<o.length;a++){var s=r[o[a]];"function"==typeof s&&"function"!=typeof s.prototype[e]&&n(s.prototype,e,{configurable:!0,writable:!0,value:function(){return i(t(this))}})}return e}));var u,c="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)u=Object.setPrototypeOf;else{var l;e:{var d={};try{d.__proto__={a:!0},l=d.a;break e}catch(e){}l=!1}u=l?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var f=u;function p(e,t){if(e.prototype=c(t.prototype),e.prototype.constructor=e,f)f(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n];e.na=t.prototype}function h(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.u=this.o=0,this.j=null}function m(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function g(e,t){e.j={da:t,ea:!0},e.g=e.o||e.u}function v(e,t,n){return e.g=n,{value:t}}function y(e){this.g=new h,this.h=e}function b(e,t,n,r){try{var o=t.call(e.g.i,n);if(!(o instanceof Object))throw new TypeError("Iterator result "+o+" is not an object");if(!o.done)return e.g.l=!1,o;var i=o.value}catch(t){return e.g.i=null,g(e.g,t),x(e)}return e.g.i=null,r.call(e.g,i),x(e)}function x(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,g(e.g,t)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.ea)throw t.da;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function C(e){this.next=function(t){return m(e.g),e.g.i?t=b(e,e.g.i.next,t,e.g.s):(e.g.s(t),t=x(e)),t},this.throw=function(t){return m(e.g),e.g.i?t=b(e,e.g.i.throw,t,e.g.s):(g(e.g,t),t=x(e)),t},this.return=function(t){return function(e,t){m(e.g);var n=e.g.i;return n?b(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),x(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function w(e){return function(e){function t(t){return e.next(t)}function n(t){return e.throw(t)}return new Promise((function(r,o){!function e(i){i.done?r(i.value):Promise.resolve(i.value).then(t,n).then(e,o)}(e.next())}))}(new C(new y(e)))}h.prototype.s=function(e){this.h=e},h.prototype.return=function(e){this.j={return:e},this.g=this.u},o("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.s=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function o(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var i=r.setTimeout;n.prototype.i=function(e){i(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.D),reject:e(this.l)}},t.prototype.D=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.H(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.A(e):this.o(e)}},t.prototype.A=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.I(t,e):this.o(e)},t.prototype.l=function(e){this.u(2,e)},t.prototype.o=function(e){this.u(1,e)},t.prototype.u=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.G(),this.B()},t.prototype.G=function(){var e=this;i((function(){if(e.C()){var t=r.console;void 0!==t&&t.error(e.i)}}),1)},t.prototype.C=function(){if(this.s)return!1;var e=r.CustomEvent,t=r.Event,n=r.dispatchEvent;return void 0===n||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=r.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.B=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)s.h(this.g[e]);this.g=null}};var s=new n;return t.prototype.H=function(e){var t=this.j();e.M(t.resolve,t.reject)},t.prototype.I=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function r(e,t){return"function"==typeof e?function(t){try{o(e(t))}catch(e){i(e)}}:t}var o,i,a=new t((function(e,t){o=e,i=t}));return this.M(r(e,o),r(n,i)),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.M=function(e,t){function n(){switch(r.h){case 1:e(r.i);break;case 2:t(r.i);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?s.h(n):this.g.push(n),this.s=!0},t.resolve=o,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var r=a(e),i=r.next();!i.done;i=r.next())o(i.value).M(t,n)}))},t.all=function(e){var n=a(e),r=n.next();return r.done?o([]):new t((function(e,t){function i(t){return function(n){a[t]=n,0==--s&&e(a)}}var a=[],s=0;do{a.push(void 0),s++,o(r.value).M(i(a.length-1),t),r=n.next()}while(!r.done)}))},t}));var E="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e};o("Object.assign",(function(e){return e||E})),o("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),o("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var r=n.length;for(0>(t=t||0)&&(t=Math.max(t+r,0));t<r;t++){var o=n[t];if(o===e||Object.is(o,e))return!0}return!1}})),o("String.prototype.includes",(function(e){return e||function(e,t){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(e,t||0)}})),o("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,r=!1,o={next:function(){if(!r&&n<e.length){var o=n++;return{value:t(o,e[o]),done:!1}}return r=!0,{done:!0,value:void 0}}};return o[Symbol.iterator]=function(){return o},o}(this,(function(e){return e}))}}));var k=this||self;function D(e,t){e=e.split(".");var n,r=k;e[0]in r||void 0===r.execScript||r.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}function M(){throw Error("Invalid UTF8")}function T(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var I,S,N="undefined"!=typeof TextDecoder,A="undefined"!=typeof TextEncoder,L={},O=null;function R(e){var t;void 0===t&&(t=0),P(),t=L[t];for(var n=Array(Math.floor(e.length/3)),r=t[64]||"",o=0,i=0;o<e.length-2;o+=3){var a=e[o],s=e[o+1],u=e[o+2],c=t[a>>2];n[i++]=c+(a=t[(3&a)<<4|s>>4])+(s=t[(15&s)<<2|u>>6])+(u=t[63&u])}switch(c=0,u=r,e.length-o){case 2:u=t[(15&(c=e[o+1]))<<2]||r;case 1:n[i]=t[(e=e[o])>>2]+t[(3&e)<<4|c>>4]+u+r}return n.join("")}function F(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var r=new Uint8Array(n),o=0;return function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),o=O[n];if(null!=o)return o;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}P();for(var r=0;;){var o=n(-1),i=n(0),a=n(64),s=n(64);if(64===s&&-1===o)break;t(o<<2|i>>4),64!=a&&(t(i<<4&240|a>>2),64!=s&&t(a<<6&192|s))}}(e,(function(e){r[o++]=e})),o!==n?r.subarray(0,o):r}function P(){if(!O){O={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));L[n]=r;for(var o=0;o<r.length;o++){var i=r[o];void 0===O[i]&&(O[i]=o)}}}}var U,_="function"==typeof Uint8Array;function j(e){return _&&null!=e&&e instanceof Uint8Array}function B(e){if(this.L=e,null!==e&&0===e.length)throw Error("ByteString should be constructed with non-empty values")}var z="function"==typeof Uint8Array.prototype.slice,G=0;function W(e,t){return Error("Invalid wire type: "+e+" (at position "+t+")")}function q(){return Error("Failed to read varint, encoding is invalid.")}function H(e,t){t=void 0!==(t=void 0===t?{}:t).v&&t.v,this.h=null,this.g=this.i=this.j=0,this.v=t,e&&Y(this,e)}function Y(e,t){e.h=function(e,t){if(e.constructor===Uint8Array)return e;if(e.constructor===ArrayBuffer)return new Uint8Array(e);if(e.constructor===Array)return new Uint8Array(e);if(e.constructor===String)return F(e);if(e.constructor===B)return!t&&(t=e.L)&&t.constructor===Uint8Array?t:(t=null==(t=e.L)||j(t)?t:"string"==typeof t?F(t):null,(e=e.L=t)?new Uint8Array(e):U||(U=new Uint8Array(0)));if(e instanceof Uint8Array)return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, or Array of numbers")}(t,e.v),e.j=0,e.i=e.h.length,e.g=e.j}function Z(e){if(e.g>e.i)throw Error("Tried to read past the end of the data "+e.g+" > "+e.i)}function Q(e){var t=e.h,n=t[e.g],r=127&n;if(128>n)return e.g+=1,Z(e),r;if(r|=(127&(n=t[e.g+1]))<<7,128>n)return e.g+=2,Z(e),r;if(r|=(127&(n=t[e.g+2]))<<14,128>n)return e.g+=3,Z(e),r;if(r|=(127&(n=t[e.g+3]))<<21,128>n)return e.g+=4,Z(e),r;if(n=t[e.g+4],e.g+=5,r|=(15&n)<<28,128>n)return Z(e),r;if(128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++])throw q();return Z(e),r}H.prototype.reset=function(){this.g=this.j};var $=[];function X(){this.g=[]}function K(e,t){for(;127<t;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function J(e){var t={},n=void 0!==t.W&&t.W;this.l={v:void 0!==t.v&&t.v},this.W=n,t=this.l,$.length?(n=$.pop(),t&&(n.v=t.v),e&&Y(n,e),e=n):e=new H(e,t),this.g=e,this.j=this.g.g,this.h=this.i=-1}function ee(e){var t=e.g;if(t.g==t.i)return!1;e.j=e.g.g;var n=Q(e.g)>>>0;if(t=n>>>3,!(0<=(n&=7)&&5>=n))throw W(n,e.j);if(1>t)throw Error("Invalid field number: "+t+" (at position "+e.j+")");return e.i=t,e.h=n,!0}function te(e){switch(e.h){case 0:if(0!=e.h)te(e);else e:{for(var t=(e=e.g).g,n=t+10;t<n;)if(!(128&e.h[t++])){e.g=t,Z(e);break e}throw q()}break;case 1:(e=e.g).g+=8,Z(e);break;case 2:2!=e.h?te(e):(t=Q(e.g)>>>0,(e=e.g).g+=t,Z(e));break;case 5:(e=e.g).g+=4,Z(e);break;case 3:for(t=e.i;;){if(!ee(e))throw Error("Unmatched start-group tag: stream EOF");if(4==e.h){if(e.i!=t)throw Error("Unmatched end-group tag");break}te(e)}break;default:throw W(e.h,e.j)}}X.prototype.length=function(){return this.g.length},X.prototype.end=function(){var e=this.g;return this.g=[],e},J.prototype.reset=function(){this.g.reset(),this.j=this.g.g,this.h=this.i=-1};var ne=[];function re(){this.i=[],this.h=0,this.g=new X}function oe(e,t){0!==t.length&&(e.i.push(t),e.h+=t.length)}var ie="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol(void 0):void 0;function ae(e,t){Object.isFrozen(e)||(ie?e[ie]|=t:void 0!==e.N?e.N|=t:Object.defineProperties(e,{N:{value:t,configurable:!0,writable:!0,enumerable:!1}}))}function se(e){var t;return null==(t=ie?e[ie]:e.N)?0:t}function ue(e){return ae(e,1),e}function ce(e){return!!Array.isArray(e)&&!!(2&se(e))}function le(e){if(!Array.isArray(e))throw Error("cannot mark non-array as immutable");ae(e,2)}function de(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&e.constructor===Object}var fe=Object.freeze(ue([]));function pe(e){if(ce(e.m))throw Error("Cannot mutate an immutable Message")}var he,me="undefined"!=typeof Symbol&&void 0!==Symbol.hasInstance;function ge(e){return{value:e,configurable:!1,writable:!1,enumerable:!1}}function ve(e,t,n){return-1===t?null:t>=e.i?e.g?e.g[t]:void 0:void 0!==n&&n&&e.g&&null!=(n=e.g[t])?n:e.m[t+e.h]}function ye(e,t,n,r){r=void 0!==r&&r,pe(e),t<e.i&&!r?e.m[t+e.h]=n:(e.g||(e.g=e.m[e.i+e.h]={}))[t]=n}function be(e,t,n,r){n=void 0===n||n;var o=ve(e,t,r=void 0!==r&&r);return null==o&&(o=fe),ce(e.m)?n&&(le(o),Object.freeze(o)):(o===fe||ce(o))&&ye(e,t,o=ue(o.slice()),r),o}function xe(e,t,n){return null==(e=null==(e=ve(e,t))?e:+e)?void 0===n?0:n:e}function Ce(e,t,n,r){e.j||(e.j={});var o=ce(e.m),i=e.j[n];if(!i){r=be(e,n,!0,void 0!==r&&r),i=[],o=o||ce(r);for(var a=0;a<r.length;a++)i[a]=new t(r[a]),o&&le(i[a].m);o&&(le(i),Object.freeze(i)),e.j[n]=i}return i}function we(e,t,n,r,o){var i=void 0!==i&&i;return pe(e),i=Ce(e,n,t,i),n=r||new n,e=be(e,t),null!=o?(i.splice(o,0,n),e.splice(o,0,n.m)):(i.push(n),e.push(n.m)),n}function Ee(e,t){return null==(e=ve(e,t))?0:e}function ke(e,t){return null==(e=ve(e,t))?"":e}function De(e){var t=Ie;return Te(e,t=void 0===t?Se:t)}function Me(e,t){if(null!=e){if(Array.isArray(e))e=Te(e,t);else if(de(e)){var n,r={};for(n in e)r[n]=Me(e[n],t);e=r}else e=t(e);return e}}function Te(e,t){for(var n=e.slice(),r=0;r<n.length;r++)n[r]=Me(n[r],t);return Array.isArray(e)&&1&se(e)&&ue(n),n}function Ie(e){return e&&"object"==typeof e&&e.toJSON?e.toJSON():(e=function(e){switch(typeof e){case"number":return isFinite(e)?e:String(e);case"object":if(e&&!Array.isArray(e)){if(j(e))return R(e);if(e instanceof B){var t=e.L;return t=null==t||"string"==typeof t?t:_&&t instanceof Uint8Array?R(t):null,(e.L=t)||""}}}return e}(e),Array.isArray(e)?De(e):e)}function Se(e){return j(e)?new Uint8Array(e):e}function Ne(e,t,n){e||(e=he),he=null;var r=this.constructor.h;if(e||(e=r?[r]:[]),this.h=(r?0:-1)-(this.constructor.g||0),this.j=void 0,this.m=e,e=(r=this.m.length)-1,r&&de(r=this.m[e])?(this.i=e-this.h,this.g=r):void 0!==t&&-1<t?(this.i=Math.max(t,e+1-this.h),this.g=void 0):this.i=Number.MAX_VALUE,n)for(t=0;t<n.length;t++)if((e=n[t])<this.i)(r=this.m[e+=this.h])?Array.isArray(r)&&ue(r):this.m[e]=fe;else{var o=(r=this.g||(this.g=this.m[this.i+this.h]={}))[e];o?Array.isArray(o)&&ue(o):r[e]=fe}}function Ae(){Ne.apply(this,arguments)}if(Ne.prototype.toJSON=function(){return De(this.m)},Ne.prototype.toString=function(){return this.m.toString()},p(Ae,Ne),me){var Le={};Object.defineProperties(Ae,(Le[Symbol.hasInstance]=ge((function(){throw Error("Cannot perform instanceof checks for MutableMessage")})),Le))}function Oe(e,t,n){if(n){var r,o={};for(r in n){var i=n[r],a=i.ha;a||(o.F=i.la||i.fa.P,i.aa?(o.U=Be(i.aa),a=function(e){return function(t,n,r){return e.F(t,n,r,e.U)}}(o)):i.ca?(o.T=ze(i.X.g,i.ca),a=function(e){return function(t,n,r){return e.F(t,n,r,e.T)}}(o)):a=o.F,i.ha=a),a(t,e,i.X),o={F:o.F,U:o.U,T:o.T}}}!function(e,t){if(t=t.ba){oe(e,e.g.end());for(var n=0;n<t.length;n++)oe(e,t[n])}}(t,e)}var Re=Symbol();function Fe(e,t,n){return e[Re]||(e[Re]=function(e,r){return t(e,r,n)})}function Pe(e){var t=e[Re];if(!t){var n=Je(e);t=function(e,t){return et(e,t,n)},e[Re]=t}return t}function Ue(e){var t=function(e){var t=e.aa;return t?Pe(t):(t=e.ka)?Fe(e.X.g,t,e.ca):void 0}(e),n=e.X,r=e.fa.O;return t?function(e,o){return r(e,o,n,t)}:function(e,t){return r(e,t,n)}}function _e(e,t,n,r,o,i){var a=0;for((e=e()).length&&"number"!=typeof e[0]&&(n(t,e[0]),a++);a<e.length;){n=e[a++];for(var s=a+1;s<e.length&&"number"!=typeof e[s];)s++;var u=e[a++];switch(s-=a){case 0:r(t,n,u);break;case 1:r(t,n,u,e[a++]);break;case 2:o(t,n,u,e[a++],e[a++]);break;case 3:s=e[a++];var c=e[a++],l=e[a++];Array.isArray(l)?o(t,n,u,s,c,l):i(t,n,u,s,c,l);break;case 4:i(t,n,u,e[a++],e[a++],e[a++],e[a++]);break;default:throw Error("unexpected number of binary field arguments: "+s)}}return t}var je=Symbol();function Be(e){var t=e[je];if(!t){var n=Ye(e);t=function(e,t){return nt(e,t,n)},e[je]=t}return t}function ze(e,t){var n=e[je];return n||(n=function(e,n){return Oe(e,n,t)},e[je]=n),n}var Ge=Symbol();function Ve(e,t){e.push(t)}function We(e,t,n){e.push(t,n.P)}function qe(e,t,n,r,o){var i=Be(o),a=n.P;e.push(t,(function(e,t,n){return a(e,t,n,r,i)}))}function He(e,t,n,r,o,i){var a=ze(r,i),s=n.P;e.push(t,(function(e,t,n){return s(e,t,n,r,a)}))}function Ye(e){var t=e[Ge];return t||_e(e,e[Ge]=[],Ve,We,qe,He)}var Ze=Symbol();function Qe(e,t){e[0]=t}function $e(e,t,n,r){var o=n.O;e[t]=r?function(e,t,n){return o(e,t,n,r)}:o}function Xe(e,t,n,r,o,i){var a=n.O,s=Pe(o);e[t]=function(e,t,n){return a(e,t,n,r,s,i)}}function Ke(e,t,n,r,o,i,a){var s=n.O,u=Fe(r,o,i);e[t]=function(e,t,n){return s(e,t,n,r,u,a)}}function Je(e){var t=e[Ze];return t||_e(e,e[Ze]={},Qe,$e,Xe,Ke)}function et(e,t,n){for(;ee(t)&&4!=t.h;){var r=t.i,o=n[r];if(!o){var i=n[0];i&&(i=i[r])&&(o=n[r]=Ue(i))}if(!(o&&o(t,e,r)||(o=t,r=e,i=o.j,te(o),o.W))){var a=o.g.h;o=i===(o=o.g.g)?U||(U=new Uint8Array(0)):z?a.slice(i,o):new Uint8Array(a.subarray(i,o)),(i=r.ba)?i.push(o):r.ba=[o]}}return e}function tt(e,t,n){if(ne.length){var r=ne.pop();e&&(Y(r.g,e),r.i=-1,r.h=-1),e=r}else e=new J(e);try{return et(new t,e,Je(n))}finally{(t=e.g).h=null,t.j=0,t.i=0,t.g=0,t.v=!1,e.i=-1,e.h=-1,100>ne.length&&ne.push(e)}}function nt(e,t,n){for(var r=n.length,o=1==r%2,i=o?1:0;i<r;i+=2)(0,n[i+1])(t,e,n[i]);Oe(e,t,o?n[0]:void 0)}function rt(e,t){var n=new re;nt(e,n,Ye(t)),oe(n,n.g.end()),e=new Uint8Array(n.h);for(var r=(t=n.i).length,o=0,i=0;i<r;i++){var a=t[i];e.set(a,o),o+=a.length}return n.i=[e],e}function ot(e,t){return{O:e,P:t}}var it=ot((function(e,t,n){if(5!==e.h)return!1;var r=(e=e.g).h[e.g],o=e.h[e.g+1],i=e.h[e.g+2],a=e.h[e.g+3];return e.g+=4,Z(e),e=2*((o=(r|o<<8|i<<16|a<<24)>>>0)>>31)+1,r=o>>>23&255,o&=8388607,ye(t,n,255==r?o?NaN:Infinity*e:0==r?e*Math.pow(2,-149)*o:e*Math.pow(2,r-150)*(o+Math.pow(2,23))),!0}),(function(e,t,n){if(null!=(t=ve(t,n))){K(e.g,8*n+5),e=e.g;var r=t;0===(r=(n=0>r?1:0)?-r:r)?0<1/r?G=0:G=2147483648:isNaN(r)?G=2147483647:34028234663852886e22<r?G=(n<<31|2139095040)>>>0:11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),G=(n<<31|r)>>>0):(t=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-t),16777216<=(r=Math.round(8388608*r))&&++t,G=(n<<31|t+127<<23|8388607&r)>>>0),e.g.push((n=G)>>>0&255),e.g.push(n>>>8&255),e.g.push(n>>>16&255),e.g.push(n>>>24&255)}})),at=ot((function(e,t,n){if(0!==e.h)return!1;for(var r=e.g,o=128,i=0,a=e=0;4>a&&128<=o;a++)o=r.h[r.g++],Z(r),i|=(127&o)<<7*a;if(128<=o&&(o=r.h[r.g++],Z(r),i|=(127&o)<<28,e|=(127&o)>>4),128<=o)for(a=0;5>a&&128<=o;a++)o=r.h[r.g++],Z(r),e|=(127&o)<<7*a+3;if(!(128>o))throw q();return r=i>>>0,(e=2147483648&(o=e>>>0))&&(o=~o>>>0,0==(r=1+~r>>>0)&&(o=o+1>>>0)),r=4294967296*o+(r>>>0),ye(t,n,e?-r:r),!0}),(function(e,t,n){if(null!=(t=ve(t,n))&&null!=t){K(e.g,8*n),e=e.g;var r=t;for(n=0>r,t=(r=Math.abs(r))>>>0,r=Math.floor((r-t)/4294967296),r>>>=0,n&&(r=~r>>>0,4294967295<(t=1+(~t>>>0))&&(t=0,4294967295<++r&&(r=0))),n=G=t,t=r;0<t||127<n;)e.g.push(127&n|128),n=(n>>>7|t<<25)>>>0,t>>>=7;e.g.push(n)}})),st=ot((function(e,t,n){return 0===e.h&&(ye(t,n,Q(e.g)),!0)}),(function(e,t,n){if(null!=(t=ve(t,n))&&null!=t)if(K(e.g,8*n),e=e.g,0<=(n=t))K(e,n);else{for(t=0;9>t;t++)e.g.push(127&n|128),n>>=7;e.g.push(1)}})),ut=ot((function(e,t,n){if(2!==e.h)return!1;var r,o=Q(e.g)>>>0,i=(e=e.g).g;if(e.g+=o,Z(e),e=e.h,N)(r=I)||(r=I=new TextDecoder("utf-8",{fatal:!0})),r=r.decode(e.subarray(i,i+o));else{o=i+o;for(var a,s,u,c=[],l=null;i<o;)128>(a=e[i++])?c.push(a):224>a?i>=o?M():(s=e[i++],194>a||128!=(192&s)?(i--,M()):c.push((31&a)<<6|63&s)):240>a?i>=o-1?M():128!=(192&(s=e[i++]))||224===a&&160>s||237===a&&160<=s||128!=(192&(r=e[i++]))?(i--,M()):c.push((15&a)<<12|(63&s)<<6|63&r):244>=a?i>=o-2?M():128!=(192&(s=e[i++]))||s-144+(a<<28)>>30||128!=(192&(r=e[i++]))||128!=(192&(u=e[i++]))?(i--,M()):(a=(7&a)<<18|(63&s)<<12|(63&r)<<6|63&u,c.push(55296+((a-=65536)>>10&1023),56320+(1023&a))):M(),8192<=c.length&&(l=T(l,c),c.length=0);r=T(l,c)}return ye(t,n,r),!0}),(function(e,t,n){if(null!=(t=ve(t,n))){var r=!1;if(r=void 0!==r&&r,A){if(r&&/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(t))throw Error("Found an unpaired surrogate");t=(S||(S=new TextEncoder)).encode(t)}else{for(var o=0,i=new Uint8Array(3*t.length),a=0;a<t.length;a++){var s=t.charCodeAt(a);if(128>s)i[o++]=s;else{if(2048>s)i[o++]=s>>6|192;else{if(55296<=s&&57343>=s){if(56319>=s&&a<t.length){var u=t.charCodeAt(++a);if(56320<=u&&57343>=u){i[o++]=(s=1024*(s-55296)+u-56320+65536)>>18|240,i[o++]=s>>12&63|128,i[o++]=s>>6&63|128,i[o++]=63&s|128;continue}a--}if(r)throw Error("Found an unpaired surrogate");s=65533}i[o++]=s>>12|224,i[o++]=s>>6&63|128}i[o++]=63&s|128}}t=i.subarray(0,o)}K(e.g,8*n+2),K(e.g,t.length),oe(e,e.g.end()),oe(e,t)}})),ct=ot((function(e,t,n,r,o){if(2!==e.h)return!1;t=we(t,n,r),n=e.g.i,r=Q(e.g)>>>0;var i=e.g.g+r,a=i-n;if(0>=a&&(e.g.i=i,o(t,e),a=i-e.g.g),a)throw Error("Message parsing ended unexpectedly. Expected to read "+r+" bytes, instead read "+(r-a)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=i,e.g.i=n,!0}),(function(e,t,n,r,o){if(null!=(t=Ce(t,r,n)))for(r=0;r<t.length;r++){var i=e;K(i.g,8*n+2);var a=i.g.end();oe(i,a),a.push(i.h),i=a,o(t[r],e),a=e;var s=i.pop();for(s=a.h+a.g.length()-s;127<s;)i.push(127&s|128),s>>>=7,a.h++;i.push(s),a.h++}}));function lt(){Ae.apply(this,arguments)}if(p(lt,Ae),me){var dt={};Object.defineProperties(lt,(dt[Symbol.hasInstance]=ge(Object[Symbol.hasInstance]),dt))}function ft(e){lt.call(this,e)}function pt(){return[1,st,2,it,3,ut,4,ut]}function ht(e){lt.call(this,e,-1,gt)}function mt(){return[1,ct,ft,pt]}p(ft,lt),p(ht,lt),ht.prototype.addClassification=function(e,t){return we(this,1,ft,e,t),this};var gt=[1];function vt(e){lt.call(this,e)}function yt(){return[1,it,2,it,3,it,4,it,5,it]}function bt(e){lt.call(this,e,-1,Ct)}function xt(){return[1,ct,vt,yt]}p(vt,lt),p(bt,lt);var Ct=[1];function wt(e){lt.call(this,e)}function Et(){return[1,it,2,it,3,it,4,it,5,it,6,at]}p(wt,lt);var kt=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],Dt=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],Mt=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],Tt=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],It=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],St=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],Nt=[].concat(s(kt),s(Dt),s(Mt),s(Tt),s(It),s(St));function At(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function Lt(e){return Ce(e,ft,1).map((function(e){return{index:Ee(e,1),ga:xe(e,2),label:null!=ve(e,3)?ke(e,3):void 0,displayName:null!=ve(e,4)?ke(e,4):void 0}}))}function Ot(e){return{x:xe(e,1),y:xe(e,2),z:xe(e,3),visibility:null!=ve(e,4)?xe(e,4):void 0}}function Rt(e,t){this.h=e,this.g=t,this.l=0}function Ft(e,t,n){return function(e,t){var n=e.g;if(void 0===e.o){var r=At(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),o=At(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),i=n.createProgram();if(n.attachShader(i,r),n.attachShader(i,o),n.linkProgram(i),!n.getProgramParameter(i,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(i));r=e.o=i,n.useProgram(r),o=n.getUniformLocation(r,"sampler0"),e.j={K:n.getAttribLocation(r,"aVertex"),J:n.getAttribLocation(r,"aTex"),ma:o},e.u=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.u),n.enableVertexAttribArray(e.j.K),n.vertexAttribPointer(e.j.K,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.enableVertexAttribArray(e.j.J),n.vertexAttribPointer(e.j.J,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(o,0)}r=e.j,n.useProgram(e.o),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.h.bindTexture2d(t.glName),n.enableVertexAttribArray(r.K),n.bindBuffer(n.ARRAY_BUFFER,e.u),n.vertexAttribPointer(r.K,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.J),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.vertexAttribPointer(r.J,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(r.K),n.disableVertexAttribArray(r.J),n.bindBuffer(n.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(e,t),"function"==typeof e.g.canvas.transferToImageBitmap?Promise.resolve(e.g.canvas.transferToImageBitmap()):n?Promise.resolve(e.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(e.g.canvas):(void 0===e.i&&(e.i=document.createElement("canvas")),new Promise((function(t){e.i.height=e.g.canvas.height,e.i.width=e.g.canvas.width,e.i.getContext("2d",{}).drawImage(e.g.canvas,0,0,e.g.canvas.width,e.g.canvas.height),t(e.i)})))}function Pt(e){this.g=e}var Ut=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function _t(e,t){return t+e}function jt(e,t){window[e]=t}function Bt(e){if(this.g=e,this.listeners={},this.j={},this.H={},this.o={},this.u={},this.I=this.s=this.Z=!0,this.D=Promise.resolve(),this.Y="",this.C={},this.locateFile=e&&e.locateFile||_t,"object"==typeof window)var t=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if("undefined"==typeof location)throw Error("solutions can only be loaded on a web page or in a web worker");t=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.$=t,e.options)for(var n=(t=a(Object.keys(e.options))).next();!n.done;n=t.next()){var r=e.options[n=n.value].default;void 0!==r&&(this.j[n]="function"==typeof r?r():r)}}function zt(e){var t,n,r,o,i,a,u,c,l,d,f;return w((function(p){switch(p.g){case 1:return e.Z?(t=void 0===e.g.files?[]:"function"==typeof e.g.files?e.g.files(e.j):e.g.files,v(p,w((function(e){switch(e.g){case 1:return e.o=2,v(e,WebAssembly.instantiate(Ut),4);case 4:e.g=3,e.o=0;break;case 2:return e.o=0,e.j=null,e.return(!1);case 3:return e.return(!0)}})),2)):p.return();case 2:if(n=p.h,"object"==typeof window)return jt("createMediapipeSolutionsWasm",{locateFile:e.locateFile}),jt("createMediapipeSolutionsPackedAssets",{locateFile:e.locateFile}),a=t.filter((function(e){return void 0!==e.data})),u=t.filter((function(e){return void 0===e.data})),c=Promise.all(a.map((function(t){var n=Gt(e,t.url);if(void 0!==t.path){var r=t.path;n=n.then((function(t){return e.overrideFile(r,t),Promise.resolve(t)}))}return n}))),l=Promise.all(u.map((function(t){return void 0===t.simd||t.simd&&n||!t.simd&&!n?function(e){var t=document.createElement("script");return t.setAttribute("src",e),t.setAttribute("crossorigin","anonymous"),new Promise((function(e){t.addEventListener("load",(function(){e()}),!1),t.addEventListener("error",(function(){e()}),!1),document.body.appendChild(t)}))}(e.locateFile(t.url,e.$)):Promise.resolve()}))).then((function(){var t,n,r;return w((function(o){if(1==o.g)return t=window.createMediapipeSolutionsWasm,n=window.createMediapipeSolutionsPackedAssets,r=e,v(o,t(n),2);r.h=o.h,o.g=0}))})),d=w((function(t){return e.g.graph&&e.g.graph.url?t=v(t,Gt(e,e.g.graph.url),0):(t.g=0,t=void 0),t})),v(p,Promise.all([l,c,d]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return r=t.filter((function(e){return void 0===e.simd||e.simd&&n||!e.simd&&!n})).map((function(t){return e.locateFile(t.url,e.$)})),importScripts.apply(null,s(r)),o=e,v(p,createMediapipeSolutionsWasm(Module),6);case 6:o.h=p.h,e.l=new OffscreenCanvas(1,1),e.h.canvas=e.l,i=e.h.GL.createContext(e.l,{antialias:!1,alpha:!1,ja:"undefined"!=typeof WebGL2RenderingContext?2:1}),e.h.GL.makeContextCurrent(i),p.g=4;break;case 7:if(e.l=document.createElement("canvas"),!(f=e.l.getContext("webgl2",{}))&&!(f=e.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),p.return();e.G=f,e.h.canvas=e.l,e.h.createContext(e.l,!0,!0,{});case 4:e.i=new e.h.SolutionWasm,e.Z=!1,p.g=0}}))}function Gt(e,t){var n,r;return w((function(o){return t in e.H?o.return(e.H[t]):(n=e.locateFile(t,""),r=fetch(n).then((function(e){return e.arrayBuffer()})),e.H[t]=r,o.return(r))}))}function Vt(e,t,n){var r,o,i,s,u,c,l,d,f,p,h,m;return w((function(g){switch(g.g){case 1:if(!n)return g.return(t);for(r={},o=0,i=a(Object.keys(n)),s=i.next();!s.done;s=i.next())"string"!=typeof(u=n[s.value])&&"texture"===u.type&&void 0!==t[u.stream]&&++o;1<o&&(e.I=!1),c=a(Object.keys(n)),s=c.next();case 2:if(s.done){g.g=4;break}if("string"==typeof(d=n[l=s.value]))return h=r,m=l,v(g,function(e,t,n){var r;return w((function(o){return"number"==typeof n||n instanceof Uint8Array||n instanceof e.h.Uint8BlobList?o.return(n):n instanceof e.h.Texture2dDataOut?((r=e.u[t])||(r=new Rt(e.h,e.G),e.u[t]=r),o.return(Ft(r,n,e.I))):o.return(void 0)}))}(e,l,t[d]),14);if(f=t[d.stream],"detection_list"===d.type){if(f){for(var y=f.getRectList(),b=f.getLandmarksList(),x=f.getClassificationsList(),C=[],E=0;E<y.size();++E){var k=tt(y.get(E),wt,Et);k={boundingBox:{xCenter:xe(k,1),yCenter:xe(k,2),height:xe(k,3),width:xe(k,4),rotation:xe(k,5,0),rectId:Ee(k,6)},landmarks:Ce(tt(b.get(E),bt,xt),vt,1).map(Ot),V:Lt(tt(x.get(E),ht,mt))},C.push(k)}y=C}else y=[];r[l]=y,g.g=7;break}if("proto_list"===d.type){if(f){for(y=Array(f.size()),b=0;b<f.size();b++)y[b]=f.get(b);f.delete()}else y=[];r[l]=y,g.g=7;break}if(void 0===f){g.g=3;break}if("float_list"===d.type){r[l]=f,g.g=7;break}if("proto"===d.type){r[l]=f,g.g=7;break}if("texture"!==d.type)throw Error("Unknown output config type: '"+d.type+"'");return(p=e.u[l])||(p=new Rt(e.h,e.G),e.u[l]=p),v(g,Ft(p,f,e.I),13);case 13:r[l]=g.h;case 7:d.transform&&r[l]&&(r[l]=d.transform(r[l])),g.g=3;break;case 14:h[m]=g.h;case 3:s=c.next(),g.g=2;break;case 4:return g.return(r)}}))}function Wt(e,t){for(var n=t.name||"$",r=[].concat(s(t.wants)),o=new e.h.StringList,i=a(t.wants),u=i.next();!u.done;u=i.next())o.push_back(u.value);i=e.h.PacketListener.implement({onResults:function(o){for(var i={},a=0;a<t.wants.length;++a)i[r[a]]=o.get(a);var s=e.listeners[n];s&&(e.D=Vt(e,i,t.outs).then((function(n){n=s(n);for(var o=0;o<t.wants.length;++o){var a=i[r[o]];"object"==typeof a&&a.hasOwnProperty&&a.hasOwnProperty("delete")&&a.delete()}n&&(e.D=n)})))}}),e.i.attachMultiListener(o,i),o.delete()}function qt(e){var t=this,n={url:"face_detection_short.binarypb"},r={type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}};this.g=new Bt({locateFile:(e=e||{}).locateFile,files:[{data:!0,url:"face_detection_short.binarypb"},{data:!0,url:"face_detection_short_range.tflite"},{simd:!0,url:"face_detection_solution_simd_wasm_bin.js"},{simd:!1,url:"face_detection_solution_wasm_bin.js"}],graph:n,listeners:[{wants:["detections","image_transformed"],outs:{image:"image_transformed",detections:{type:"detection_list",stream:"detections"}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"object"==typeof window&&void 0!==window.navigator&&("iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document)},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},model:{type:0,onChange:function(e){var o,i,s,u;return w((function(c){switch(c.g){case 1:o=a("short"===e?["face_detection_short_range.tflite"]:["face_detection_full_range_sparse.tflite"]),i=o.next();case 2:if(i.done){c.g=4;break}return u="third_party/mediapipe/modules/face_detection/"+(s=i.value),v(c,Gt(t.g,s),5);case 5:t.g.overrideFile(u,c.h),i=o.next(),c.g=2;break;case 4:return n.url="short"===e?"face_detection_short.binarypb":"face_detection_full.binarypb",r.graphOptionXref.calculatorName="short"===e?"facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator":"facedetectionfullrangegpu__facedetectionfullrangecommon__TensorsToDetectionsCalculator",c.return(!0)}}))}},minDetectionConfidence:r}})}(e=Bt.prototype).close=function(){return this.i&&this.i.delete(),Promise.resolve()},e.reset=function(){var e=this;return w((function(t){e.i&&(e.i.reset(),e.o={},e.u={}),t.g=0}))},e.setOptions=function(e,t){var n=this;if(t=t||this.g.options){for(var r=[],o=[],i={},s=a(Object.keys(e)),u=s.next();!u.done;i={R:i.R,S:i.S},u=s.next()){var c=u.value;c in this.j&&this.j[c]===e[c]||(this.j[c]=e[c],void 0!==(u=t[c])&&(u.onChange&&(i.R=u.onChange,i.S=e[c],r.push(function(e){return function(){return w((function(t){if(1==t.g)return v(t,e.R(e.S),2);!0===t.h&&(n.s=!0),t.g=0}))}}(i))),u.graphOptionXref&&(c={valueNumber:1===u.type?e[c]:0,valueBoolean:0===u.type&&e[c],valueString:2===u.type?e[c]:""},u=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),u.graphOptionXref),c),o.push(u))))}0===r.length&&0===o.length||(this.s=!0,this.B=(void 0===this.B?[]:this.B).concat(o),this.A=(void 0===this.A?[]:this.A).concat(r))}},e.initialize=function(){var e=this;return w((function(t){return 1==t.g?v(t,zt(e),2):3!=t.g?v(t,function(e){var t,n,r,o,i,s;return w((function(u){if(1==u.g)return e.g.graph&&e.g.graph.url&&e.Y===e.g.graph.url?u.return():(e.s=!0,e.g.graph&&e.g.graph.url?(e.Y=e.g.graph.url,v(u,Gt(e,e.g.graph.url),3)):void(u.g=2));for(2!=u.g&&e.i.loadGraph(u.h),t=a(Object.keys(e.C)),n=t.next();!n.done;n=t.next())e.i.overrideFile(r=n.value,e.C[r]);if(e.C={},e.g.listeners)for(o=a(e.g.listeners),i=o.next();!i.done;i=o.next())Wt(e,i.value);s=e.j,e.j={},e.setOptions(s),u.g=0}))}(e),3):v(t,function(e){var t,n,r,o,i;return w((function(s){switch(s.g){case 1:if(!e.s)return s.return();if(!e.A){s.g=2;break}t=a(e.A),n=t.next();case 3:if(n.done){s.g=5;break}return v(s,(0,n.value)(),4);case 4:n=t.next(),s.g=3;break;case 5:e.A=void 0;case 2:if(e.B){for(r=new e.h.GraphOptionChangeRequestList,o=a(e.B),i=o.next();!i.done;i=o.next())r.push_back(i.value);e.i.changeOptions(r),r.delete(),e.B=void 0}e.s=!1,s.g=0}}))}(e),0)}))},e.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.C[e]=t},e.clearOverriddenFiles=function(){this.C={},this.i&&this.i.clearOverriddenFiles()},e.send=function(e,t){var n,r,o,i,s,u,c,l,d,f=this;return w((function(p){switch(p.g){case 1:return f.g.inputs?(n=1e3*(null==t?performance.now():t),v(p,f.D,2)):p.return();case 2:return v(p,f.initialize(),3);case 3:for(r=new f.h.PacketDataList,o=a(Object.keys(e)),i=o.next();!i.done;i=o.next())if(u=f.g.inputs[s=i.value]){e:{var h=e[s];switch(u.type){case"video":var m=f.o[u.stream];if(m||(m=new Rt(f.h,f.G),f.o[u.stream]=m),0===m.l&&(m.l=m.h.createTexture()),"undefined"!=typeof HTMLVideoElement&&h instanceof HTMLVideoElement)var g=h.videoWidth,y=h.videoHeight;else"undefined"!=typeof HTMLImageElement&&h instanceof HTMLImageElement?(g=h.naturalWidth,y=h.naturalHeight):(g=h.width,y=h.height);y={glName:m.l,width:g,height:y},(g=m.g).canvas.width=y.width,g.canvas.height=y.height,g.activeTexture(g.TEXTURE0),m.h.bindTexture2d(m.l),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,h),m.h.bindTexture2d(0),m=y;break e;case"detections":for((m=f.o[u.stream])||(m=new Pt(f.h),f.o[u.stream]=m),m.data||(m.data=new m.g.DetectionListData),m.data.reset(h.length),y=0;y<h.length;++y){var b=m.data,x=b.setBoundingBox,C=y,w=(g=h[y]).boundingBox,E=new wt;if(ye(E,1,w.xCenter),ye(E,2,w.yCenter),ye(E,3,w.height),ye(E,4,w.width),ye(E,5,w.rotation),ye(E,6,w.rectId),w=rt(E,Et),x.call(b,C,w),g.landmarks)for(b=0;b<g.landmarks.length;++b){var k=!!(E=g.landmarks[b]).visibility;C=(x=m.data).addNormalizedLandmark,w=y,E=Object.assign(Object.assign({},E),{visibility:k?E.visibility:0}),ye(k=new vt,1,E.x),ye(k,2,E.y),ye(k,3,E.z),E.visibility&&ye(k,4,E.visibility),E=rt(k,yt),C.call(x,w,E)}if(g.V)for(b=0;b<g.V.length;++b)C=(x=m.data).addClassification,w=y,E=g.V[b],ye(k=new ft,2,E.ga),E.index&&ye(k,1,E.index),E.label&&ye(k,3,E.label),E.displayName&&ye(k,4,E.displayName),E=rt(k,pt),C.call(x,w,E)}m=m.data;break e;default:m={}}}switch(c=m,l=u.stream,u.type){case"video":r.pushTexture2d(Object.assign(Object.assign({},c),{stream:l,timestamp:n}));break;case"detections":(d=c).stream=l,d.timestamp=n,r.pushDetectionList(d);break;default:throw Error("Unknown input config type: '"+u.type+"'")}}return f.i.send(r),v(p,f.D,4);case 4:r.delete(),p.g=0}}))},e.onResults=function(e,t){this.listeners[t||"$"]=e},D("Solution",Bt),D("OptionType",{BOOL:0,NUMBER:1,ia:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(e=qt.prototype).close=function(){return this.g.close(),Promise.resolve()},e.onResults=function(e){this.g.onResults(e)},e.initialize=function(){var e=this;return w((function(t){return v(t,e.g.initialize(),0)}))},e.reset=function(){this.g.reset()},e.send=function(e){var t=this;return w((function(n){return v(n,t.g.send(e),0)}))},e.setOptions=function(e){this.g.setOptions(e)},D("FaceDetection",qt),D("FACEDETECTION_LIPS",kt),D("FACEDETECTION_LEFT_EYE",Dt),D("FACEDETECTION_LEFT_EYEBROW",Mt),D("FACEDETECTION_RIGHT_EYE",Tt),D("FACEDETECTION_RIGHT_EYEBROW",It),D("FACEDETECTION_FACE_OVAL",St),D("FACEDETECTION_CONTOURS",Nt),D("FACEDETECTION_TESSELATION",[[127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]]),D("VERSION","0.4.1646425229")}).call(V);var Bd,zd="https://websdk-cdn-dev.idmission.com/assets/models/blazeface20240207/blaze_face_short_range.tflite",Gd=45e3;function Vd(){return h(this,void 0,void 0,(function(){var e,t;return m(this,(function(n){switch(n.label){case 0:return Bd?[2,Bd]:[4,Jd()];case 1:if(n.sent(),"NONE"===Sd.delegate)throw new Error("No available delegate for face detector.");return t=(e=vl).createFromOptions,[4,lc.forVisionTasks(Cd)];case 2:return[4,t.apply(e,[n.sent(),{baseOptions:{modelAssetPath:zd,delegate:Sd.delegate},runningMode:"VIDEO"}])];case 3:return[2,Bd=n.sent()]}}))}))}var Wd=function(e){return h(void 0,[e],void 0,(function(e){var t,n=e.documentDetectionModel,r=void 0===n||n,o=e.focusModel,i=void 0===o||o,a=e.faceDetectionModel,s=void 0===a||a;return m(this,(function(e){switch(e.label){case 0:return[4,Nd()];case 1:return e.sent(),t=[],r&&t.push(Xd),i&&t.push(Kd),s&&t.push(Jd),[4,Promise.all(t)];case 2:return e.sent(),[2]}}))}))},qd={},Hd={visionRuntime:{loaded:0,total:0},documentDetection:{loaded:0,total:0},focus:{loaded:0,total:0},faceDetection:{loaded:0,total:0}};function Yd(e){return h(this,void 0,void 0,(function(){var t;return m(this,(function(n){return t=new XMLHttpRequest,[2,new Promise((function(n){t.addEventListener("progress",(function(t){t.lengthComputable&&(qd[e]=t,document.dispatchEvent(new CustomEvent("idmission.preloadProgress",{detail:{url:e,loaded:t.loaded,total:t.total}})))})),t.addEventListener("loadend",(function(){n(4===t.readyState&&200===t.status)})),t.open("GET",e,!0),t.send()}))]}))}))}var Zd=!1,Qd=!1,$d=!1;function Xd(){return h(this,void 0,void 0,(function(){function e(e){t.includes(e.detail.url)&&(Hd.documentDetection=tf(t),document.dispatchEvent(new CustomEvent("idmission.preloadProgress.documentDetection",{detail:Hd.documentDetection})))}var t;return m(this,(function(n){switch(n.label){case 0:return Zd?[2,new Promise((function(e){setInterval((function(){Zd||e()}),100)}))]:(Zd=!0,[4,Nd()]);case 1:if(n.sent(),"NONE"===Sd.delegate)throw new Error("No available delegate for document detector.");t=[nf],document.addEventListener("idmission.preloadProgress",e),n.label=2;case 2:return n.trys.push([2,,4,5]),[4,Promise.all(t.map(Yd))];case 3:return n.sent(),[3,5];case 4:return document.removeEventListener("idmission.preloadProgress",e),Zd=!1,[7];case 5:return[2]}}))}))}function Kd(){return h(this,void 0,void 0,(function(){function e(e){t.includes(e.detail.url)&&(Hd.focus=tf(t),document.dispatchEvent(new CustomEvent("idmission.preloadProgress.focus",{detail:Hd.focus})))}var t;return m(this,(function(n){switch(n.label){case 0:return Qd?[2,new Promise((function(e){setInterval((function(){Qd||e()}),100)}))]:(Qd=!0,[4,Nd()]);case 1:if(n.sent(),"NONE"===Sd.delegate)throw new Error("No available delegate for document detector.");t=[Fd],document.addEventListener("idmission.preloadProgress",e),n.label=2;case 2:return n.trys.push([2,,4,5]),[4,Promise.all(t.map(Yd))];case 3:return n.sent(),[3,5];case 4:return document.removeEventListener("idmission.preloadProgress",e),Qd=!1,[7];case 5:return[2]}}))}))}function Jd(){return h(this,void 0,void 0,(function(){function e(e){t.includes(e.detail.url)&&(Hd.faceDetection=tf(t),document.dispatchEvent(new CustomEvent("idmission.preloadProgress.faceDetection",{detail:Hd.faceDetection})))}var t;return m(this,(function(n){switch(n.label){case 0:return $d?[2,new Promise((function(e){setInterval((function(){$d||e()}),100)}))]:($d=!0,[4,Nd()]);case 1:if(n.sent(),"NONE"===Sd.delegate)throw new Error("No available delegate for document detector.");t=[zd],document.addEventListener("idmission.preloadProgress",e),n.label=2;case 2:return n.trys.push([2,,4,5]),[4,Promise.all(t.map(Yd))];case 3:return n.sent(),[3,5];case 4:return document.removeEventListener("idmission.preloadProgress",e),$d=!1,[7];case 5:return[2]}}))}))}function ef(e){return e.total>0?Math.round(100*e.loaded/e.total):0}function tf(e){return e.reduce((function(e,t){var n=qd[t];return n?(e.loaded+=n.loaded,e.total+=n.total,e):e}),{loaded:0,total:0})}var nf="https://websdk-cdn-dev.idmission.com/assets/models/docdetectmp20240802/model_fp16.tflite",rf=.1,of=45e3,af={idCardFront:"ID card front",idCardBack:"ID card back",passport:"Passport",none:"None"},sf={};function uf(e){var n=e.modelPath,r=void 0===n?nf:n,o=e.modelLoadTimeoutMs,i=void 0===o?of:o,a=e.scoreThreshold,s=void 0===a?rf:a,u=e.onModelError,c=t.useRef(null),l=t.useState(!1),d=l[0],f=l[1],p=t.useState(0),g=p[0],v=p[1],y=t.useState(null),b=y[0],x=y[1],C=t.useContext(nt).videoRef;return t.useEffect((function(){var e=this;function t(e){v(ef(e.detail))}f(!1),document.addEventListener("idmission.preloadProgress.documentDetection",t);var n=setTimeout((function(){x(new Error("Model loading time limit exceeded."))}),i);return function(){return h(this,arguments,void 0,(function(e,t){var n,r,o,i,a;return void 0===e&&(e=nf),void 0===t&&(t=rf),m(this,(function(s){switch(s.label){case 0:return n="".concat(e,":").concat(t),sf[n]?[2,sf[n]]:[4,Xd()];case 1:if(s.sent(),"NONE"===Sd.delegate)throw new Error("No available delegate for document detector.");return r=sf,o=n,a=(i=gd).createFromOptions,[4,lc.forVisionTasks(Cd)];case 2:return[4,a.apply(i,[s.sent(),{baseOptions:{modelAssetPath:e,delegate:Sd.delegate},scoreThreshold:t,runningMode:"VIDEO"}])];case 3:return r[o]=s.sent(),[2,sf[n]]}}))}))}(r,s).then((function(t){return h(e,void 0,void 0,(function(){return m(this,(function(e){switch(e.label){case 0:return c.current=t,v(100),clearTimeout(n),[4,Rd(C)];case 1:return e.sent(),t.detectForVideo(C.current,performance.now()),f(!0),[2]}}))}))})).catch((function(e){x(e)})).finally((function(){clearTimeout(n)})),function(){clearTimeout(n),document.removeEventListener("idmission.preloadProgress.documentDetection",t)}}),[i,r,s,C]),t.useEffect((function(){b&&(null==u||u(b))}),[b,u]),{detector:c,ready:d,modelDownloadProgress:g,modelError:b,setModelError:x}}function cf(e,t){return h(this,void 0,void 0,(function(){var n,r,o,i,a;return m(this,(function(s){n=new Date;try{return r=e.detectForVideo(t,performance.now()),o=(new Date).getTime()-n.getTime(),i=t.width,a=t.height,[2,f(f({},r),{time:o,frameWidth:i,frameHeight:a})]}catch(e){Fe("caught object detection error",e)}return[2,null]}))}))}function lf(e,t){var n,r,o,i,a,s,u,c=e.detections,l=e.frameWidth,d=e.frameHeight,f=e.time,p=function(e){var t={};return e.forEach((function(e,n){e&&(t[e.label]||(t[e.label]=[0,-1]),e.score>t[e.label][0]&&(t[e.label]=[e.score,n]))})),Object.keys(t).map((function(n){return e[t[n][1]]})).filter((function(e){return!!e}))}(c.map((function(e){var t,n=null===(t=e.categories)||void 0===t?void 0:t[0];return{label:null==n?void 0:n.categoryName,score:null==n?void 0:n.score,box:Od(e.boundingBox)}}))),h=c.length>0&&!c.some((function(e){var t=e.boundingBox;return Object.values(null!=t?t:{}).some((function(e){return e>0}))})),m=p.find((function(e){return"Document"===e.label})),g=p.find((function(e){return"Document back"===e.label})),v=p.find((function(e){return"Passport page"===e.label})),y=null!==(n=null==m?void 0:m.score)&&void 0!==n?n:0,b=null!==(r=null==g?void 0:g.score)&&void 0!==r?r:0,x=null!==(o=null==v?void 0:v.score)&&void 0!==o?o:0,C=y>=(null!==(i=t.idCardFront)&&void 0!==i?i:0),w=b>=(null!==(a=t.idCardBack)&&void 0!==a?a:0),E=x>=(null!==(s=t.passport)&&void 0!==s?s:0),k=E?v:w?g:m,D=E?t.passport:w?t.idCardBack:t.idCardFront,M=null!==(u=null==k?void 0:k.score)&&void 0!==u?u:0,T=M>=(null!=D?D:0),I="none";E?I="passport":w?I="idCardBack":T&&(I="idCardFront");var S=!1;if(k){var N=k.box,A=N.xMin,L=N.yMin,O=N.width;S=L>20&&L+N.height+20<d&&(A>20||A<20&&A+O>.8*l)&&A+O+20<l}var R=!1;if(k){var F=[k.box.width/l,k.box.height/d];R=F[0]>.85||F[1]>.85}return{detectedObjects:p,detectionScore:M,detectionTime:f,detectionThresholdMet:T,detectedDocumentType:I,idCardFrontDetectionScore:y,idCardFrontDetectionThresholdMet:C,idCardBackDetectionScore:b,idCardBackDetectionThresholdMet:w,passportDetectionScore:x,passportDetectionThresholdMet:E,bestDocument:k,documentInBounds:S,documentTooClose:R,frameWidth:l,frameHeight:d,allZero:h}}function df(e,n){var r=n.throttleMs,o=void 0===r?0:r,i=n.autoStart,a=void 0!==i&&i,s=t.useState(!1),u=s[0],c=s[1],l=t.useRef(0),d=t.useRef(0);t.useEffect((function(){if(u){var t,n=l.current;return function r(){return h(this,void 0,void 0,(function(){return m(this,(function(i){switch(i.label){case 0:return n!==l.current?[2]:[4,e(d.current)];case 1:return i.sent(),t=setTimeout((function(){d.current=requestAnimationFrame(r)}),null!=o?o:0),[2]}}))}))}().then(),function(){l.current+=1,d.current&&cancelAnimationFrame(d.current),t&&clearTimeout(t)}}}),[e,u,o]);var f=t.useCallback((function(){c(!0)}),[]),p=t.useCallback((function(){l.current+=1,c(!1)}),[]);return t.useEffect((function(){return a&&f(),function(){p()}}),[a,f,p]),{start:f,stop:p}}var ff=t.createContext({startDocumentDetection:function(){return null},stopDocumentDetection:function(){return null},documentDetectionModelReady:!1,documentDetectionModelDownloadProgress:0,documentDetectionModelError:null,onDocumentDetected:function(){return null},detectionTime:0,documentDetectionThresholds:{},setDocumentDetectionThresholds:function(){return null},documentDetectionLastPredictionCanvas:{current:null},clearDocumentDetectionLastPredictionCanvas:function(){return null}});function pf(e){var n=this,r=e.autoStart,o=void 0===r||r,i=e.children,a=e.throttleMs,s=e.documentDetectionModelPath,c=void 0===s?nf:s,l=e.documentDetectionModelScoreThreshold,d=void 0===l?rf:l,f=e.documentDetectionModelLoadTimeoutMs,p=void 0===f?of:f,g=e.onDocumentDetectionModelError,v=t.useContext(nt),y=v.videoRef,b=v.videoLoaded,x=v.cameraReady,C=t.useRef(null),w=t.useRef(),E=t.useState({}),k=E[0],D=E[1],M=t.useState(0),T=M[0],I=M[1],S=t.useState(0),N=S[0],A=S[1],L=t.useState(0),O=L[0],R=L[1],F=t.useRef(0),P=uf({modelPath:c,modelLoadTimeoutMs:p,scoreThreshold:d,onModelError:g}),U=P.detector,_=P.ready,j=P.modelDownloadProgress,B=P.modelError,z=P.setModelError,G=df(t.useCallback((function(e){return h(n,void 0,void 0,(function(){var t,n,r,o,i,a,s;return m(this,(function(u){switch(u.label){case 0:return b&&x&&_&&y.current&&U.current&&C.current?(t=F.current,r=y.current.videoHeight,C.current.width=n=y.current.videoWidth,C.current.height=r,(o=C.current.getContext("2d"))&&4===y.current.readyState?t!==F.current?[2]:(o.drawImage(y.current,0,0,n,r),[4,cf(U.current,C.current)]):[3,3]):[2];case 1:return(i=u.sent())?((a=lf(i,k)).frameId=e,I(i.time),Oe(a),a.allZero&&A((function(e){return e+1})),t!==F.current?[2]:[4,null===(s=w.current)||void 0===s?void 0:s.call(w,a)]):[3,3];case 2:u.sent(),u.label=3;case 3:return[2]}}))}))}),[x,U,k,_,b,y]),{throttleMs:a,autoStart:o}),V=G.start,W=G.stop;t.useEffect((function(){N>=2&&z(new Error("model is returning all zeroes"))}),[z,N]);var q=t.useCallback((function(e){w.current=e}),[]),H=t.useCallback((function(){F.current+=1,R((function(e){return e+1}))}),[]),Y=t.useMemo((function(){return{startDocumentDetection:V,stopDocumentDetection:W,documentDetectionModelReady:_,documentDetectionModelError:B,documentDetectionModelDownloadProgress:j,onDocumentDetected:q,detectionTime:T,documentDetectionThresholds:k,setDocumentDetectionThresholds:D,documentDetectionLastPredictionCanvas:C,clearDocumentDetectionLastPredictionCanvas:H}}),[V,W,_,B,j,q,T,k,H]);return u.createElement(ff.Provider,{value:Y},u.createElement(Ve,{key:O,ref:C}),i)}var hf=t.createContext({focusModelReady:!1,focusModelDownloadProgress:0,focusModelError:null,focusThresholds:{},setFocusThresholds:function(){return null},makeFocusPrediction:function(){return null},focusPredictionTime:0});function mf(e){var n=e.children,r=e.focusModelPath,o=void 0===r?Fd:r,i=e.focusModelLoadTimeoutMs,a=void 0===i?Pd:i,s=e.onFocusModelError,u=e.showCanvases,c=void 0!==u&&u,l=t.useRef(null),d=t.useRef(null),f=t.useState({}),p=f[0],h=f[1],m=t.useState(0),g=m[0],v=m[1],y=_d({modelPath:o,modelLoadTimeoutMs:a,onModelError:s}),b=y.model,x=y.ready,C=y.modelDownloadProgress,w=y.modelError,E=t.useCallback((function(e,t){if(!b.current)return null;var n=jd(b.current,e,l.current,d.current,t);return v(n.predictionTime),n}),[b]),k=t.useMemo((function(){return{focusModelReady:x,focusModelDownloadProgress:C,focusModelError:w,makeFocusPrediction:E,focusPredictionTime:g,focusThresholds:p,setFocusThresholds:h}}),[g,p,E,C,w,x]);return t.createElement(hf.Provider,{value:k},t.createElement(Ve,{ref:d,style:c?{display:"block"}:void 0}),t.createElement(Ve,{ref:l,style:c?{display:"block"}:void 0}),n)}function gf(e){if(e||"undefined"!=typeof navigator&&null!=navigator){if(e||(e=navigator),"ReactNative"===e.product)return!0;var t=e.userAgent||e.vendor||("undefined"!=typeof window?window.opera:"");if(!t){return e.userAgentData&&e.userAgentData.mobile}return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}return!1}var vf=gf(),yf={detection:{idCardFront:.8,idCardBack:.8,passport:.5},focus:{idCardFront:{desktop:0,mobile:.3},idCardBack:{desktop:0,mobile:.3},passport:{desktop:0,mobile:.3}}},bf=t.createContext({ready:!1,start:function(){return null},stop:function(){return null},modelDownloadProgress:0,modelError:null,thresholds:yf,setThresholds:function(){return null},onPredictionMade:function(){return null},detectionTime:0,focusPredictionTime:0,bestFrameDetails:null,getBestFrame:function(){return null},resetBestFrame:function(){return null},requiredDocumentType:"none",setRequiredDocumentType:function(){return null}});function xf(e){var n=e.children,r=e.onModelError,o=t.useContext(ff),i=o.documentDetectionModelReady,a=o.documentDetectionModelDownloadProgress,s=o.startDocumentDetection,u=o.stopDocumentDetection,c=o.documentDetectionLastPredictionCanvas,l=o.clearDocumentDetectionLastPredictionCanvas,d=o.onDocumentDetected,p=o.detectionTime,g=o.documentDetectionThresholds,v=o.setDocumentDetectionThresholds,y=o.documentDetectionModelError,b=t.useContext(hf),x=b.focusModelReady,C=b.focusModelDownloadProgress,w=b.makeFocusPrediction,E=b.focusThresholds,k=b.setFocusThresholds,D=b.focusPredictionTime,M=b.focusModelError,T=t.useRef(),I=t.useState(null),S=I[0],N=I[1],A=t.useRef(null),L=t.useRef(0),O=t.useRef(0),R=t.useState("none"),F=R[0],P=R[1],U=t.useMemo((function(){return f(f({},g),{focus:E})}),[g,E]),_=t.useCallback((function(e){e.detection&&v(e.detection),e.focus&&k(e.focus)}),[v,k]);t.useEffect((function(){var e=this;d((function(t){return h(e,void 0,void 0,(function(){var e,n,r,o,i,a,s,u,l,d,p,h,g;return m(this,(function(m){return c.current?(e=O.current,n=0,r=0,o=!1,("none"===F||t.detectedDocumentType===F||(null===(u=F.includes)||void 0===u?void 0:u.call(F,t.detectedDocumentType)))&&"none"!==t.detectedDocumentType&&t.detectionThresholdMet&&t.documentInBounds&&!t.documentTooClose&&((i=w(c.current,null===(l=t.bestDocument)||void 0===l?void 0:l.box))&&(r=i.score,n=i.predictionTime),a=null===(d=U.focus)||void 0===d?void 0:d[t.detectedDocumentType],s=null!==(p=vf?null==a?void 0:a.mobile:null==a?void 0:a.desktop)&&void 0!==p?p:0,o=r>=s,L.current<=r&&e===O.current&&(L.current=r,We(A.current,c.current),N({boundingBox:null===(h=t.bestDocument)||void 0===h?void 0:h.box,documentType:t.detectedDocumentType,detectionScore:t.detectionScore,focusScore:r}))),null===(g=T.current)||void 0===g||g.call(T,f(f({},t),{focusScore:r,focusPredictionTime:n,focusThresholdMet:o})),[2]):[2]}))}))}))}),[c,w,d,F,U.focus]);var j=null!=y?y:M;t.useEffect((function(){j&&(null==r||r(j))}),[j,r]);var B=t.useCallback((function(e){T.current=e}),[]),z=t.useCallback((function(){return S&&A.current?f(f({},S),{canvas:A.current}):null}),[S]),G=t.useState(0),V=G[0],W=G[1],q=t.useCallback((function(){O.current+=1,W((function(e){return e+1})),l(),N(null),L.current=0}),[l]);t.useEffect((function(){F&&q()}),[F,q]);var H=t.useMemo((function(){return{ready:i&&x,modelDownloadProgress:(a+C)/2,modelError:j,start:s,stop:u,thresholds:U,setThresholds:_,onPredictionMade:B,detectionTime:p,focusPredictionTime:D,getBestFrame:z,resetBestFrame:q,bestFrameDetails:S,requiredDocumentType:F,setRequiredDocumentType:P}}),[S,p,a,i,C,x,D,z,j,B,F,q,_,s,u,U]);return t.createElement(bf.Provider,{value:H},t.createElement(Ve,{key:V,ref:A}),n)}function Cf(e){var n=e.children,r=p(e,["children"]);return t.createElement(pf,f({},r),t.createElement(mf,f({},r),t.createElement(xf,f({},r),n)))}function wf(e,n,r){var o=this,i=t.useRef(null),a=t.useRef(0),s=t.useRef(null),u=t.useRef([]),c=t.useRef(),l=t.useRef(),d=t.useRef(e),f=t.useRef(!0);d.current=e;var p="undefined"!=typeof window,h=!n&&0!==n&&p;if("function"!=typeof e)throw new TypeError("Expected a function");n=+n||0;var m=!!(r=r||{}).leading,g=!("trailing"in r)||!!r.trailing,v="maxWait"in r,y="debounceOnServer"in r&&!!r.debounceOnServer,b=v?Math.max(+r.maxWait||0,n):null;t.useEffect((function(){return f.current=!0,function(){f.current=!1}}),[]);var x=t.useMemo((function(){var e=function(e){var t=u.current,n=c.current;return u.current=c.current=null,a.current=e,l.current=d.current.apply(n,t)},t=function(e,t){h&&cancelAnimationFrame(s.current),s.current=h?requestAnimationFrame(e):setTimeout(e,t)},r=function(e){if(!f.current)return!1;var t=e-i.current;return!i.current||t>=n||t<0||v&&e-a.current>=b},x=function(t){return s.current=null,g&&u.current?e(t):(u.current=c.current=null,l.current)},C=function e(){var o=Date.now();if(r(o))return x(o);if(f.current){var s=n-(o-i.current),u=v?Math.min(s,b-(o-a.current)):s;t(e,u)}},w=function(){if(p||y){var d=Date.now(),h=r(d);if(u.current=[].slice.call(arguments),c.current=o,i.current=d,h){if(!s.current&&f.current)return a.current=i.current,t(C,n),m?e(i.current):l.current;if(v)return t(C,n),e(i.current)}return s.current||t(C,n),l.current}};return w.cancel=function(){s.current&&(h?cancelAnimationFrame(s.current):clearTimeout(s.current)),a.current=0,u.current=i.current=c.current=s.current=null},w.isPending=function(){return!!s.current},w.flush=function(){return s.current?x(Date.now()):l.current},w}),[m,v,n,b,g,h,p,y]);return x}var Ef=["idCardFront","idCardBack","passport","selfie"],kf={idCardFront:["idCardFront"],idCardBack:["idCardBack"],passport:["passport"],idCard:["idCardFront","idCardBack"],idCardAndPassport:["idCardFront","idCardBack","passport"],idCardOrPassport:["idCardFront","idCardBack","passport"]};function Df(e){return"idCardOrPassport"===e?1:kf[e].length}var Mf={initialDrawComplete:!1,redrawing:!1,guideRectX:0,guideRectY:0,guideRectWidth:0,guideRectHeight:0,guideRectOffsetTop:0,guideImageWidth:0,guideImageHeight:0,pageWidth:0,pageHeight:0,videoWidth:0,videoHeight:0,detectedObjects:[],bestDocument:void 0,detectedDocumentType:"none",detectionThresholdMet:!1,documentInBounds:!1,documentTooClose:!1,flipRequired:!1,backDetectedFirst:!1,idCardFrontDetectionScore:0,idCardFrontDetectionThresholdMet:!1,idCardBackDetectionScore:0,idCardBackDetectionThresholdMet:!1,passportDetectionScore:0,passportDetectionThresholdMet:!1,focusScore:0,focusThresholdMet:!1,isGoodFrame:!1,goodFramesCount:0,goodFramesThreshold:3,goodFramesThresholdMet:!1,lastFrameCapturedAt:null,frameCaptureRate:0,capturing:!1,captureFailed:!1,imageUrl:null,captureState:"capturing",capturedDocuments:{},captureRequirement:"idCardOrPassport",requestedDocumentType:"idCardFront",allowIdCardBackToFrontCapture:!1,operationStartedAt:null,captureStartedAt:null},Tf=t.createContext(Mf),If=t.createContext((function(){})),Sf=function(e,t){var n,r;switch(t.type){case"configureWizard":var o=t.payload,i=o.captureRequirement,a=o.precapturedDocuments,s=o.allowIdCardBackToFrontCapture,u=f(f({},e),{captureRequirement:i,allowIdCardBackToFrontCapture:null!=s&&s});if("idCardBack"===i&&(u.requestedDocumentType="idCardBack"),"passport"===i&&(u.requestedDocumentType="passport"),a)for(var c=0,l=Ef;c<l.length;c++){var d=l[c],p=a[d];p&&(u.requestedDocumentType=d,u=Sf(u,{type:"documentCaptured",payload:p}))}return u.operationStartedAt=new Date,u;case"setRequiredDocumentType":return f(f({},e),{requiredDocumentType:t.payload});case"redrawRequested":return f(f({},e),{redrawing:!0,guideRectX:0,guideRectY:0,guideRectWidth:0,guideRectHeight:0,guideRectOffsetTop:0});case"redrawInProgress":return f(f({},e),{redrawing:!1,guideRectX:0,guideRectY:0,guideRectWidth:0,guideRectHeight:0,guideRectOffsetTop:0});case"redrawCompleted":return f(f(f({},e),t.payload),{initialDrawComplete:!0});case"pageRendered":return f(f({},e),t.payload);case"guideImageLoaded":return f(f({},e),{guideImageWidth:t.payload.width,guideImageHeight:t.payload.height});case"objectsDetected":var h=t.payload.prediction,m=h.detectedObjects,g=h.detectionThresholdMet,v=h.detectedDocumentType,y=h.idCardFrontDetectionScore,b=h.idCardFrontDetectionThresholdMet,x=h.idCardBackDetectionScore,C=h.idCardBackDetectionThresholdMet,w=h.passportDetectionScore,E=h.passportDetectionThresholdMet,k=h.bestDocument,D=h.documentInBounds,M=h.documentTooClose,T=h.focusScore,I=h.focusThresholdMet,S=h.frameWidth,N=h.frameHeight,A=new Date,L=0,O=e.goodFramesThreshold;e.lastFrameCapturedAt&&(L=1e3/(A.getTime()-e.lastFrameCapturedAt.getTime()))>0&&(O=Math.ceil(3*L));var R=!e.allowIdCardBackToFrontCapture&&"idCardBack"===e.requestedDocumentType&&"idCardFront"===v,F=e.allowIdCardBackToFrontCapture?"idCardBack"in e.capturedDocuments&&"idCardBack"===v:e.requestedDocumentType.includes("idCardFront")&&"idCardBack"===v,P=g&&D&&!M&&!R&&!F&&I,U=e.goodFramesCount;P&&(U+=1);var _=U>=O,j=e.requestedDocumentType;return e.captureRequirement.includes("idCard")&&e.allowIdCardBackToFrontCapture&&("idCardFront"!==v||"idCardFront"===e.requestedDocumentType||"idCardFront"in e.capturedDocuments?"idCardBack"!==v||"idCardBack"===e.requestedDocumentType||"idCardBack"in e.capturedDocuments||(j="idCardBack"):j="idCardFront"),"idCardOrPassport"===e.captureRequirement&&("passport"===v&&"passport"!==e.requestedDocumentType&&(j="passport"),"passport"===j&&w<.3&&(j="idCardFront"in e.capturedDocuments?"idCardBack":"idCardFront")),f(f({},e),{videoWidth:S,videoHeight:N,detectedObjects:m,bestDocument:k,requestedDocumentType:j,detectedDocumentType:v,detectionThresholdMet:g,documentInBounds:D,documentTooClose:M,flipRequired:R,backDetectedFirst:F,idCardFrontDetectionScore:y,idCardFrontDetectionThresholdMet:b,idCardBackDetectionScore:x,idCardBackDetectionThresholdMet:C,passportDetectionScore:w,passportDetectionThresholdMet:E,focusScore:T,focusThresholdMet:I,isGoodFrame:P,goodFramesCount:U,goodFramesThreshold:O,goodFramesThresholdMet:_,lastFrameCapturedAt:A,frameCaptureRate:L});case"captureStarted":return f(f({},e),{captureStartedAt:new Date,capturing:!1,captureFailed:!1});case"capturing":return f(f({},e),{capturing:!0,captureFailed:!1});case"captured":return f(f({},e),{capturing:!1,captureFailed:!1});case"frameCaptured":return f(f({},e),{imageUrl:t.payload.imageUrl});case"captureFailed":return f(f({},e),{capturing:!1,captureFailed:!0});case"documentCaptured":var B=f(f({},e),{capturing:!1,captureFailed:!1,goodFramesCount:0,capturedDocuments:f(f({},e.capturedDocuments),(n={},n[t.payload.documentType]=t.payload,n))}),z=kf[e.captureRequirement].filter((function(e){return!(e in B.capturedDocuments)}));return"idCardOrPassport"===e.captureRequirement&&(z="passport"===e.requestedDocumentType?[]:z.filter((function(e){return"passport"!==e}))),0===z.length?B.captureState="complete":(B.requestedDocumentType=z[0],("idCardFront"===e.requestedDocumentType&&"idCardBack"===B.requestedDocumentType||"idCardBack"===e.requestedDocumentType&&"idCardFront"===B.requestedDocumentType)&&(B.captureState="requestingFlip",B.idCardFrontDetectionThresholdMet=!1,B.idCardBackDetectionThresholdMet=!1,B.passportDetectionThresholdMet=!1)),B;case"documentCapturedManually":var G=f(f({},e),{capturedDocuments:f(f({},e.capturedDocuments),(r={},r[e.requestedDocumentType]=f(f({},t.payload),{width:0,height:0}),r))});z=kf[e.captureRequirement].filter((function(e){return!(e in G.capturedDocuments)}));return"idCardOrPassport"===e.captureRequirement&&(z="passport"===e.requestedDocumentType?[]:z.filter((function(e){return"passport"!==e}))),0===z.length?G.captureState="complete":(G.requestedDocumentType=z[0],("idCardFront"===e.requestedDocumentType&&"idCardBack"===G.requestedDocumentType||"idCardBack"===e.requestedDocumentType&&"idCardFront"===G.requestedDocumentType)&&(G.captureState="requestingFlip",G.idCardFrontDetectionThresholdMet=!1,G.idCardBackDetectionThresholdMet=!1,G.passportDetectionThresholdMet=!1)),G;case"flipRequestCompleted":return f(f({},e),{captureState:"capturing"});case"resetWizard":return f(f({},Mf),{captureRequirement:e.captureRequirement,allowIdCardBackToFrontCapture:e.allowIdCardBackToFrontCapture});default:return e}},Nf=function(e){var n=e.children,r=t.useReducer(Sf,Mf),o=r[0],i=r[1],a=wf((function(){i({type:"redrawRequested"})}),500);return t.useLayoutEffect((function(){if("undefined"!=typeof window)return window.addEventListener("resize",a),function(){window.removeEventListener("resize",a)}}),[a]),t.createElement(Tf.Provider,{value:o},t.createElement(If.Provider,{value:i},n))},Af=function(){var e=t.useContext(Tf),n=t.useContext(If);if(!e||!n)throw new Error("useIdCaptureState cannot be used without IdCaptureStateProvider");return[e,n]};function Lf(e){var n=t.createElement(Of,null,e.children),r=document.getElementById("idmission-above-guides-content");return r?a.createPortal(n,r):n}var Of=o.span(_f||(_f=v(["\n font-size: 16px;\n font-family: monospace;\n position: absolute;\n left: 20px;\n bottom: 20px;\n margin-right: 20px;\n padding: 8px;\n color: limegreen;\n background: rgba(0, 0, 0, 0.5);\n z-index: 10002;\n"],["\n font-size: 16px;\n font-family: monospace;\n position: absolute;\n left: 20px;\n bottom: 20px;\n margin-right: 20px;\n padding: 8px;\n color: limegreen;\n background: rgba(0, 0, 0, 0.5);\n z-index: 10002;\n"]))),Rf=o.div(jf||(jf=v(["\n position: absolute;\n z-index: 1001;\n width: 100%;\n height: 100%;\n max-width: 100%;\n max-height: 100%;\n overflow: hidden;\n ","\n"],["\n position: absolute;\n z-index: 1001;\n width: 100%;\n height: 100%;\n max-width: 100%;\n max-height: 100%;\n overflow: hidden;\n ","\n"])),(function(e){return e.$flipX?"transform: scaleX(-1);":""})),Ff=o.div(Bf||(Bf=v(["\n font: 10px monospace;\n position: absolute;\n border: 3px solid ",";\n color: ",";\n ","\n"],["\n font: 10px monospace;\n position: absolute;\n border: 3px solid ",";\n color: ",";\n ","\n"])),(function(e){var t=e.$color;return null!=t?t:"green"}),(function(e){var t=e.$color;return null!=t?t:"green"}),(function(e){return e.$flipX?"transform: scaleX(-1);":""})),Pf=o.div(zf||(zf=v(["\n position: absolute;\n width: 4px;\n height: 4px;\n border: 2px solid ",";\n font: 10px monospace;\n color: ",";\n border-radius: 50%;\n ","\n"],["\n position: absolute;\n width: 4px;\n height: 4px;\n border: 2px solid ",";\n font: 10px monospace;\n color: ",";\n border-radius: 50%;\n ","\n"])),(function(e){var t=e.$color;return null!=t?t:"red"}),(function(e){var t=e.$color;return null!=t?t:"red"}),(function(e){return e.$flipX?"transform: scaleX(-1);":""}));function Uf(e){var n=e.enabled,r=void 0===n||n,o=e.pageWidth,i=e.pageHeight,a=e.videoWidth,s=e.videoHeight;return t.useMemo((function(){var e=!1,t=0,n=0,u=0,c=0;return r&&((e=o/i<a/s)?u=((t=a*(i/s))-o)/2:c=((n=s*(o/a))-i)/2),{horizontal:e,pageWidth:o,pageHeight:i,videoWidth:a,videoHeight:s,scaledWidth:t,scaledHeight:n,xOffset:u,yOffset:c}}),[r,i,o,s,a])}var _f,jf,Bf,zf,Gf=function(e){var n=e.scaling,r=e.$flipX,o=e.children,i=Af()[0];return t.createElement(Rf,{id:"debug-overlay-div",$flipX:r,style:{top:i.guideRectY,left:i.guideRectX,width:i.guideRectWidth||(null==n?void 0:n.pageWidth),height:i.guideRectHeight||(null==n?void 0:n.pageHeight)}},o)};function Vf(e){var n,r,o,i,a=e.obj,s=e.color,u=e.scaling,c=u.pageWidth,l=u.pageHeight,d=u.videoWidth,f=u.videoHeight,p=u.scaledWidth,h=u.scaledHeight;return d&&f&&c&&l?(u.horizontal?(n=a.box.yMin/f*l,r=a.box.xMin/d*p-u.xOffset,o=a.box.width/d*p,i=a.box.height/f*l):(n=a.box.yMin/f*h-u.yOffset,r=a.box.xMin/d*c,o=a.box.width/d*c,i=a.box.height/f*h),t.createElement(Ff,{$flipX:e.flipX,$color:void 0===s?"green":s,style:{top:n,left:r,width:o,height:i}})):t.createElement(t.Fragment,null)}function Wf(e){var n,r,o,i,a=e.face,s=e.flipX,u=e.color,c=e.scaling,l=c.pageWidth,d=c.pageHeight,f=c.videoWidth,p=c.videoHeight,h=c.scaledWidth,m=c.scaledHeight;return f&&p&&l&&d?(c.horizontal?(n=a.box.yMin/p*d,r=a.box.xMin/f*h-c.xOffset,o=a.box.width/f*h,i=a.box.height/p*d):(n=a.box.yMin/p*m-c.yOffset,r=a.box.xMin/f*l,o=a.box.width/f*l,i=a.box.height/p*m),t.createElement(t.Fragment,null,t.createElement(Ff,{$flipX:s,$color:void 0===u?"green":u,style:{top:n,left:r,width:o,height:i}}),a.keypoints.map((function(e,n){return t.createElement(qf,{key:n,point:e,scaling:c,flipX:s})})))):t.createElement(t.Fragment,null)}function qf(e){var n,r,o=e.point,i=e.color,a=e.scaling,s=a.videoWidth,u=a.videoHeight;return a.horizontal?(n=o.x/s*a.scaledWidth-a.xOffset,r=o.y/u*a.pageHeight):(n=o.x/s*a.pageWidth,r=o.y/u*a.scaledHeight-a.yOffset),t.createElement(Pf,{$flipX:e.flipX,$color:void 0===i?"red":i,style:{top:r-=2,left:n-=2}})}var Hf=[],Yf=Hf.forEach,Zf=Hf.slice;var Qf=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,$f=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};n&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+60*n*1e3)),r&&(o.domain=r),document.cookie=function(e,t,n){var r=n||{};r.path=r.path||"/";var o=encodeURIComponent(t),i="".concat(e,"=").concat(o);if(r.maxAge>0){var a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");i+="; Max-Age=".concat(Math.floor(a))}if(r.domain){if(!Qf.test(r.domain))throw new TypeError("option domain is invalid");i+="; Domain=".concat(r.domain)}if(r.path){if(!Qf.test(r.path))throw new TypeError("option path is invalid");i+="; Path=".concat(r.path)}if(r.expires){if("function"!=typeof r.expires.toUTCString)throw new TypeError("option expires is invalid");i+="; Expires=".concat(r.expires.toUTCString())}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i}(e,encodeURIComponent(t),o)},Xf=function(e){for(var t="".concat(e,"="),n=document.cookie.split(";"),r=0;r<n.length;r++){for(var o=n[r];" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(t))return o.substring(t.length,o.length)}return null},Kf={name:"cookie",lookup:function(e){var t;if(e.lookupCookie&&"undefined"!=typeof document){var n=Xf(e.lookupCookie);n&&(t=n)}return t},cacheUserLanguage:function(e,t){t.lookupCookie&&"undefined"!=typeof document&&$f(t.lookupCookie,e,t.cookieMinutes,t.cookieDomain,t.cookieOptions)}},Jf={name:"querystring",lookup:function(e){var t;if("undefined"!=typeof window){var n=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));for(var r=n.substring(1).split("&"),o=0;o<r.length;o++){var i=r[o].indexOf("=");if(i>0)r[o].substring(0,i)===e.lookupQuerystring&&(t=r[o].substring(i+1))}}return t}},ep=null,tp=function(){if(null!==ep)return ep;try{ep="undefined"!==window&&null!==window.localStorage;var e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){ep=!1}return ep},np={name:"localStorage",lookup:function(e){var t;if(e.lookupLocalStorage&&tp()){var n=window.localStorage.getItem(e.lookupLocalStorage);n&&(t=n)}return t},cacheUserLanguage:function(e,t){t.lookupLocalStorage&&tp()&&window.localStorage.setItem(t.lookupLocalStorage,e)}},rp=null,op=function(){if(null!==rp)return rp;try{rp="undefined"!==window&&null!==window.sessionStorage;var e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){rp=!1}return rp},ip={name:"sessionStorage",lookup:function(e){var t;if(e.lookupSessionStorage&&op()){var n=window.sessionStorage.getItem(e.lookupSessionStorage);n&&(t=n)}return t},cacheUserLanguage:function(e,t){t.lookupSessionStorage&&op()&&window.sessionStorage.setItem(t.lookupSessionStorage,e)}},ap={name:"navigator",lookup:function(e){var t=[];if("undefined"!=typeof navigator){if(navigator.languages)for(var n=0;n<navigator.languages.length;n++)t.push(navigator.languages[n]);navigator.userLanguage&&t.push(navigator.userLanguage),navigator.language&&t.push(navigator.language)}return t.length>0?t:void 0}},sp={name:"htmlTag",lookup:function(e){var t,n=e.htmlTag||("undefined"!=typeof document?document.documentElement:null);return n&&"function"==typeof n.getAttribute&&(t=n.getAttribute("lang")),t}},up={name:"path",lookup:function(e){var t;if("undefined"!=typeof window){var n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(n instanceof Array)if("number"==typeof e.lookupFromPathIndex){if("string"!=typeof n[e.lookupFromPathIndex])return;t=n[e.lookupFromPathIndex].replace("/","")}else t=n[0].replace("/","")}return t}},cp={name:"subdomain",lookup:function(e){var t="number"==typeof e.lookupFromSubdomainIndex?e.lookupFromSubdomainIndex+1:1,n="undefined"!=typeof window&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[t]}};var lp=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return at(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e||{languageUtils:{}},this.options=function(e){return Yf.call(Zf.call(arguments,1),(function(t){if(t)for(var n in t)void 0===e[n]&&(e[n]=t[n])})),e}(t,this.options||{},{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:function(e){return e}}),"string"==typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=function(e){return e.replace("-","_")}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(Kf),this.addDetector(Jf),this.addDetector(np),this.addDetector(ip),this.addDetector(ap),this.addDetector(sp),this.addDetector(up),this.addDetector(cp)}},{key:"addDetector",value:function(e){return this.detectors[e.name]=e,this}},{key:"detect",value:function(e){var t=this;e||(e=this.options.order);var n=[];return e.forEach((function(e){if(t.detectors[e]){var r=t.detectors[e].lookup(t.options);r&&"string"==typeof r&&(r=[r]),r&&(n=n.concat(r))}})),n=n.map((function(e){return t.options.convertDetectedLanguage(e)})),this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}},{key:"cacheUserLanguage",value:function(e,t){var n=this;t||(t=this.options.caches),t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach((function(t){n.detectors[t]&&n.detectors[t].cacheUserLanguage(e,n.options)})))}}]),e}();function dp(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return fp(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fp(e,t):void 0}}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function fp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}lp.type="languageDetector";var pp={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},hp=function(){function e(e){this.init(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}var t=e.prototype;return t.init=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||pp,this.options=t,this.debug=t.debug},t.log=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)},t.warn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)},t.error=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")},t.deprecate=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)},t.forward=function(e,t,n,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]=""+n+this.prefix+" "+e[0]),this.logger[t](e))},t.create=function(t){return new e(this.logger,G({},{prefix:this.prefix+":"+t+":"},this.options))},t.clone=function(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new e(this.logger,t)},e}(),mp=new hp,gp=function(){function e(){this.observers={}}var t=e.prototype;return t.on=function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]||(n.observers[e]=new Map);var r=n.observers[e].get(t)||0;n.observers[e].set(t,r+1)})),this},t.off=function(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])},t.emit=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.observers[e]&&Array.from(this.observers[e].entries()).forEach((function(e){for(var t=e[0],r=e[1],o=0;o<r;o++)t.apply(void 0,n)}));this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach((function(t){for(var r=t[0],o=t[1],i=0;i<o;i++)r.apply(r,[e].concat(n))}))},e}();function vp(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function yp(e){return null==e?"":""+e}var bp=/###/g;function xp(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(bp,"."):e}function o(){return!e||"string"==typeof e}for(var i="string"!=typeof t?t:t.split("."),a=0;a<i.length-1;){if(o())return{};var s=r(i[a]);!e[s]&&n&&(e[s]=new n),e=Object.prototype.hasOwnProperty.call(e,s)?e[s]:{},++a}return o()?{}:{obj:e,k:r(i[a])}}function Cp(e,t,n){var r=xp(e,t,Object),o=r.obj,i=r.k;if(void 0===o&&1!==t.length){for(var a=t[t.length-1],s=t.slice(0,t.length-1),u=xp(e,s,Object);void 0===u.obj&&s.length;)a=s[s.length-1]+"."+a,(u=xp(e,s=s.slice(0,s.length-1),Object))&&u.obj&&void 0!==u.obj[u.k+"."+a]&&(u.obj=void 0);u.obj[u.k+"."+a]=n}else o[i]=n}function wp(e,t){var n=xp(e,t),r=n.obj;if(r)return r[n.k]}function Ep(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):Ep(e[r],t[r],n):e[r]=t[r]);return e}function kp(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Dp={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function Mp(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return Dp[e]})):e}var Tp=[" ",",","?","!",";"],Ip=new(function(){function e(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}return e.prototype.getRegExp=function(e){var t=this.regExpMap.get(e);if(void 0!==t)return t;var n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n},e}())(20);function Sp(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),o=e,i=0;i<r.length;){if(!o||"object"!=typeof o)return;for(var a=void 0,s="",u=i;u<r.length;++u)if(u!==i&&(s+=n),void 0!==(a=o[s+=r[u]])){if(["string","number","boolean"].indexOf(typeof a)>-1&&u<r.length-1)continue;i+=u-i+1;break}o=a}return o}}function Np(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}var Ap=function(e){function t(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return(n=e.call(this)||this).data=t||{},n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),void 0===n.options.ignoreJSONStructure&&(n.options.ignoreJSONStructure=!0),n}lt(t,e);var n=t.prototype;return n.addNamespaces=function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)},n.removeNamespaces=function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)},n.getResource=function(e,t,n){var r,o,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,s=void 0!==i.ignoreJSONStructure?i.ignoreJSONStructure:this.options.ignoreJSONStructure;if(e.indexOf(".")>-1)r=e.split(".");else if(r=[e,t],n)if(Array.isArray(n))(o=r).push.apply(o,n);else if("string"==typeof n&&a){var u;(u=r).push.apply(u,n.split(a))}else r.push(n);var c=wp(this.data,r);return!c&&!t&&!n&&e.indexOf(".")>-1&&(e=r[0],t=r[1],n=r.slice(2).join(".")),c||!s||"string"!=typeof n?c:Sp(this.data&&this.data[e]&&this.data[e][t],n,a)},n.addResource=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(r=t,t=(a=e.split("."))[1]),this.addNamespaces(t),Cp(this.data,a,r),o.silent||this.emit("added",e,t,n,r)},n.addResources=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var o in n)("string"==typeof n[o]||Array.isArray(n[o]))&&this.addResource(e,t,o,n[o],{silent:!0});r.silent||this.emit("added",e,t,n)},n.addResourceBundle=function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1,skipCopy:!1},a=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var s=wp(this.data,a)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Ep(s,n,o):s=G({},s,n),Cp(this.data,a,s),i.silent||this.emit("added",e,t,n)},n.removeResourceBundle=function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)},n.hasResourceBundle=function(e,t){return void 0!==this.getResource(e,t)},n.getResourceBundle=function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?G({},{},this.getResource(e,t)):this.getResource(e,t)},n.getDataByLanguage=function(e){return this.data[e]},n.hasLanguageSomeTranslations=function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))},n.toJSON=function(){return this.data},t}(gp),Lp={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,o){var i=this;return e.forEach((function(e){i.processors[e]&&(t=i.processors[e].process(t,n,r,o))})),t}},Op={},Rp=function(e){function t(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(e,t,n){e.forEach((function(e){t[e]&&(n[e]=t[e])}))}(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,n=e.call(this)||this),n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=mp.create("translator"),n}lt(t,e);var n=t.prototype;return n.changeLanguage=function(e){e&&(this.language=e)},n.exists=function(e){if(null==e)return!1;var t=this.resolve(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}});return t&&void 0!==t.res},n.extractFromKey=function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS||[],i=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";var r=Tp.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===r.length)return!0;var o=Ip.getRegExp("("+r.map((function(e){return"?"===e?"\\?":e})).join("|")+")"),i=!o.test(e);if(!i){var a=e.indexOf(n);a>0&&!o.test(e.substring(0,a))&&(i=!0)}return i}(e,n,r));if(i&&!a){var s=e.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:e,namespaces:o};var u=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(u[0])>-1)&&(o=u.shift()),e=u.join(r)}return"string"==typeof o&&(o=[o]),{key:e,namespaces:o}},n.translate=function(e,n,r){var o=this;if("object"!=typeof n&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof n&&(n=G({},n)),n||(n={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var i=void 0!==n.returnDetails?n.returnDetails:this.options.returnDetails,a=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,s=this.extractFromKey(e[e.length-1],n),u=s.key,c=s.namespaces,l=c[c.length-1],d=n.lng||this.language,f=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(f){var p=n.nsSeparator||this.options.nsSeparator;return i?{res:""+l+p+u,usedKey:u,exactUsedKey:u,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:""+l+p+u}return i?{res:u,usedKey:u,exactUsedKey:u,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:u}var h=this.resolve(e,n),m=h&&h.res,g=h&&h.usedKey||u,v=h&&h.exactUsedKey||u,y=Object.prototype.toString.apply(m),b=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject;if(x&&m&&("string"!=typeof m&&"boolean"!=typeof m&&"number"!=typeof m)&&["[object Number]","[object Function]","[object RegExp]"].indexOf(y)<0&&("string"!=typeof b||!Array.isArray(m))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var C=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,m,G({},n,{ns:c})):"key '"+u+" ("+this.language+")' returned an object instead of string.";return i?(h.res=C,h.usedParams=this.getUsedParamsDetails(n),h):C}if(a){var w=Array.isArray(m),E=w?[]:{},k=w?v:g;for(var D in m)if(Object.prototype.hasOwnProperty.call(m,D)){var M=""+k+a+D;E[D]=this.translate(M,G({},n,{joinArrays:!1,ns:c})),E[D]===M&&(E[D]=m[D])}m=E}}else if(x&&"string"==typeof b&&Array.isArray(m))(m=m.join(b))&&(m=this.extendTranslation(m,e,n,r));else{var T=!1,I=!1,S=void 0!==n.count&&"string"!=typeof n.count,N=t.hasDefaultValue(n),A=S?this.pluralResolver.getSuffix(d,n.count,n):"",L=n.ordinal&&S?this.pluralResolver.getSuffix(d,n.count,{ordinal:!1}):"",O=S&&!n.ordinal&&0===n.count&&this.pluralResolver.shouldUseIntlApi(),R=O&&n["defaultValue"+this.options.pluralSeparator+"zero"]||n["defaultValue"+A]||n["defaultValue"+L]||n.defaultValue;!this.isValidLookup(m)&&N&&(T=!0,m=R),this.isValidLookup(m)||(I=!0,m=u);var F=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&I?void 0:m,P=N&&R!==m&&this.options.updateMissing;if(I||T||P){if(this.logger.log(P?"updateKey":"missingKey",d,l,u,P?R:m),a){var U=this.resolve(u,G({},n,{keySeparator:!1}));U&&U.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var _=[],j=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&j&&j[0])for(var B=0;B<j.length;B++)_.push(j[B]);else"all"===this.options.saveMissingTo?_=this.languageUtils.toResolveHierarchy(n.lng||this.language):_.push(n.lng||this.language);var z=function(e,t,r){var i=N&&r!==m?r:F;o.options.missingKeyHandler?o.options.missingKeyHandler(e,l,t,i,P,n):o.backendConnector&&o.backendConnector.saveMissing&&o.backendConnector.saveMissing(e,l,t,i,P,n),o.emit("missingKey",e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&S?_.forEach((function(e){var t=o.pluralResolver.getSuffixes(e,n);O&&n["defaultValue"+o.options.pluralSeparator+"zero"]&&t.indexOf(o.options.pluralSeparator+"zero")<0&&t.push(o.options.pluralSeparator+"zero"),t.forEach((function(t){z([e],u+t,n["defaultValue"+t]||R)}))})):z(_,u,R))}m=this.extendTranslation(m,e,n,h,r),I&&m===u&&this.options.appendNamespaceToMissingKey&&(m=l+":"+u),(I||T)&&this.options.parseMissingKeyHandler&&(m="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?l+":"+u:u,T?m:void 0):this.options.parseMissingKeyHandler(m))}return i?(h.res=m,h.usedParams=this.getUsedParamsDetails(n),h):m},n.extendTranslation=function(e,t,n,r,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,G({},this.options.interpolation.defaultVariables,n),n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(G({},n,{interpolation:G({},this.options.interpolation,n.interpolation)}));var a,s="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(s){var u=e.match(this.interpolator.nestingRegexp);a=u&&u.length}var c=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(c=G({},this.options.interpolation.defaultVariables,c)),e=this.interpolator.interpolate(e,c,n.lng||this.language||r.usedLng,n),s){var l=e.match(this.interpolator.nestingRegexp);a<(l&&l.length)&&(n.nest=!1)}!n.lng&&"v1"!==this.options.compatibilityAPI&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return o&&o[0]===r[0]&&!n.context?(i.logger.warn("It seems you are nesting recursively key: "+r[0]+" in key: "+t[0]),null):i.translate.apply(i,r.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var d=n.postProcess||this.options.postProcess,f="string"==typeof d?[d]:d;return null!=e&&f&&f.length&&!1!==n.applyPostProcessor&&(e=Lp.handle(f,e,t,this.options&&this.options.postProcessPassResolved?G({i18nResolved:G({},r,{usedParams:this.getUsedParamsDetails(n)})},n):n,this)),e},n.resolve=function(e){var t,n,r,o,i,a=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!a.isValidLookup(t)){var u=a.extractFromKey(e,s),c=u.key;n=c;var l=u.namespaces;a.options.fallbackNS&&(l=l.concat(a.options.fallbackNS));var d=void 0!==s.count&&"string"!=typeof s.count,f=d&&!s.ordinal&&0===s.count&&a.pluralResolver.shouldUseIntlApi(),p=void 0!==s.context&&("string"==typeof s.context||"number"==typeof s.context)&&""!==s.context,h=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);l.forEach((function(e){a.isValidLookup(t)||(i=e,!Op[h[0]+"-"+e]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(i)&&(Op[h[0]+"-"+e]=!0,a.logger.warn('key "'+n+'" for languages "'+h.join(", ")+'" won\'t get resolved as namespace "'+i+'" was not yet loaded',"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),h.forEach((function(n){if(!a.isValidLookup(t)){o=n;var i,u=[c];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(u,c,n,e,s);else{var l;d&&(l=a.pluralResolver.getSuffix(n,s.count,s));var h=a.options.pluralSeparator+"zero",m=a.options.pluralSeparator+"ordinal"+a.options.pluralSeparator;if(d&&(u.push(c+l),s.ordinal&&0===l.indexOf(m)&&u.push(c+l.replace(m,a.options.pluralSeparator)),f&&u.push(c+h)),p){var g=""+c+a.options.contextSeparator+s.context;u.push(g),d&&(u.push(g+l),s.ordinal&&0===l.indexOf(m)&&u.push(g+l.replace(m,a.options.pluralSeparator)),f&&u.push(g+h))}}for(;i=u.pop();)a.isValidLookup(t)||(r=i,t=a.getResource(n,e,i,s))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}},n.isValidLookup=function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)},n.getResource=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)},n.getUsedParamsDetails=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.replace&&"string"!=typeof e.replace,n=t?e.replace:e;if(t&&void 0!==e.count&&(n.count=e.count),this.options.interpolation.defaultVariables&&(n=G({},this.options.interpolation.defaultVariables,n)),!t){n=G({},n);for(var r,o=dp(["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"]);!(r=o()).done;){delete n[r.value]}}return n},t.hasDefaultValue=function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,12)&&void 0!==e[n])return!0;return!1},t}(gp);function Fp(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Pp=function(){function e(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=mp.create("languageUtils")}var t=e.prototype;return t.getScriptPartFromCode=function(e){if(!(e=Np(e))||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))},t.getLanguagePartFromCode=function(e){if(!(e=Np(e))||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])},t.formatLanguageCode=function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Fp(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Fp(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=Fp(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e},t.isSupportedCode=function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1},t.getBestMatchFromCodes=function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){return e===r?e:e.indexOf("-")<0&&r.indexOf("-")<0?void 0:e.indexOf("-")>0&&r.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===r||0===e.indexOf(r)&&r.length>1?e:void 0}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null},t.getFallbackCodes=function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]},t.toResolveHierarchy=function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),o=[],i=function(e){e&&(n.isSupportedCode(e)?o.push(e):n.logger.warn("rejecting language code not found in supportedLngs: "+e))};return"string"==typeof e&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):"string"==typeof e&&i(this.formatLanguageCode(e)),r.forEach((function(e){o.indexOf(e)<0&&i(n.formatLanguageCode(e))})),o},e}(),Up=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],_p={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},jp=["v1","v2","v3"],Bp=["v4"],zp={zero:0,one:1,two:2,few:3,many:4,other:5};var Gp=function(){function e(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=n,this.logger=mp.create("pluralResolver"),this.options.compatibilityJSON&&!Bp.includes(this.options.compatibilityJSON)||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(t={},Up.forEach((function(e){e.lngs.forEach((function(n){t[n]={numbers:e.nr,plurals:_p[e.fc]}}))})),t)}var t=e.prototype;return t.addRule=function(e,t){this.rules[e]=t},t.getRule=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(Np("dev"===e?"en":e),{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]},t.needsPlural=function(e){var t=this.getRule(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return this.shouldUseIntlApi()?t&&t.resolvedOptions().pluralCategories.length>1:t&&t.numbers.length>1},t.getPluralFormsOfKey=function(e,t){return this.getSuffixes(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).map((function(e){return""+t+e}))},t.getSuffixes=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((function(e,t){return zp[e]-zp[t]})).map((function(e){return t.options.prepend+(n.ordinal?"ordinal"+t.options.prepend:"")+e})):r.numbers.map((function(r){return t.getSuffix(e,r,n)})):[]},t.getSuffix=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?this.options.prepend+(n.ordinal?"ordinal"+this.options.prepend:"")+r.select(t):this.getSuffixRetroCompatible(r,t):(this.logger.warn("no plural rule found for: "+e),"")},t.getSuffixRetroCompatible=function(e,t){var n=this,r=e.plurals(e.noAbs?t:Math.abs(t)),o=e.numbers[r];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var i=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_"+o.toString():i():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?i():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()},t.shouldUseIntlApi=function(){return!jp.includes(this.options.compatibilityJSON)},e}();function Vp(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=function(e,t,n){var r=wp(e,n);return void 0!==r?r:wp(t,n)}(e,t,n);return!i&&o&&"string"==typeof n&&void 0===(i=Sp(e,n,r))&&(i=Sp(t,n,r)),i}var Wp=function(){function e(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=mp.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||function(e){return e},this.init(e)}var t=e.prototype;return t.init=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation,n=t.escape,r=t.escapeValue,o=t.useRawValueToEscape,i=t.prefix,a=t.prefixEscaped,s=t.suffix,u=t.suffixEscaped,c=t.formatSeparator,l=t.unescapeSuffix,d=t.unescapePrefix,f=t.nestingPrefix,p=t.nestingPrefixEscaped,h=t.nestingSuffix,m=t.nestingSuffixEscaped,g=t.nestingOptionsSeparator,v=t.maxReplaces,y=t.alwaysFormat;this.escape=void 0!==n?n:Mp,this.escapeValue=void 0===r||r,this.useRawValueToEscape=void 0!==o&&o,this.prefix=i?kp(i):a||"{{",this.suffix=s?kp(s):u||"}}",this.formatSeparator=c||",",this.unescapePrefix=l?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":l||"",this.nestingPrefix=f?kp(f):p||kp("$t("),this.nestingSuffix=h?kp(h):m||kp(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=v||1e3,this.alwaysFormat=void 0!==y&&y,this.resetRegExp()},t.reset=function(){this.options&&this.init(this.options)},t.resetRegExp=function(){var e=function(e,t){return e&&e.source===t?(e.lastIndex=0,e):new RegExp(t,"g")};this.regexp=e(this.regexp,this.prefix+"(.+?)"+this.suffix),this.regexpUnescape=e(this.regexpUnescape,""+this.prefix+this.unescapePrefix+"(.+?)"+this.unescapeSuffix+this.suffix),this.nestingRegexp=e(this.nestingRegexp,this.nestingPrefix+"(.+?)"+this.nestingSuffix)},t.interpolate=function(e,t,n,r){var o,i,a,s=this,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var l=function(e){if(e.indexOf(s.formatSeparator)<0){var o=Vp(t,u,e,s.options.keySeparator,s.options.ignoreJSONStructure);return s.alwaysFormat?s.format(o,void 0,n,G({},r,t,{interpolationkey:e})):o}var i=e.split(s.formatSeparator),a=i.shift().trim(),c=i.join(s.formatSeparator).trim();return s.format(Vp(t,u,a,s.options.keySeparator,s.options.ignoreJSONStructure),c,n,G({},r,t,{interpolationkey:a}))};this.resetRegExp();var d=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,f=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return c(s.escapeValue?s.escape(e):e)}}].forEach((function(t){for(a=0;o=t.regex.exec(e);){var n=o[1].trim();if(void 0===(i=l(n)))if("function"==typeof d){var u=d(e,o,r);i="string"==typeof u?u:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))i="";else{if(f){i=o[0];continue}s.logger.warn("missed to pass in variable "+n+" for interpolating "+e),i=""}else"string"==typeof i||s.useRawValueToEscape||(i=yp(i));var c=t.safeValue(i);if(e=e.replace(o[0],c),f?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,++a>=s.maxReplaces)break}})),e},t.nest=function(e,t){var n,r,o,i=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function s(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp(n+"[ ]*{")),i="{"+r[1];e=r[0];var a=(i=this.interpolate(i,o)).match(/'/g),s=i.match(/"/g);(a&&a.length%2==0&&!s||s.length%2!=0)&&(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o=G({},t,o))}catch(t){return this.logger.warn("failed parsing options string in nesting for key "+e,t),""+e+n+i}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,e}for(;n=this.nestingRegexp.exec(e);){var u=[];(o=(o=G({},a)).replace&&"string"!=typeof o.replace?o.replace:o).applyPostProcessor=!1,delete o.defaultValue;var c=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var l=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=l.shift(),u=l,c=!0}if((r=t(s.call(this,n[1].trim(),o),o))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=yp(r)),r||(this.logger.warn("missed to resolve "+n[1]+" for nesting "+e),r=""),c&&(r=u.reduce((function(e,t){return i.format(e,t,a.lng,G({},a,{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e},e}();function qp(e){var t={};return function(n,r,o){var i=r+JSON.stringify(o),a=t[i];return a||(a=e(Np(r),o),t[i]=a),a(n)}}var Hp=function(){function e(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=mp.create("formatter"),this.options=e,this.formats={number:qp((function(e,t){var n=new Intl.NumberFormat(e,G({},t));return function(e){return n.format(e)}})),currency:qp((function(e,t){var n=new Intl.NumberFormat(e,G({},t,{style:"currency"}));return function(e){return n.format(e)}})),datetime:qp((function(e,t){var n=new Intl.DateTimeFormat(e,G({},t));return function(e){return n.format(e)}})),relativetime:qp((function(e,t){var n=new Intl.RelativeTimeFormat(e,G({},t));return function(e){return n.format(e,t.range||"day")}})),list:qp((function(e,t){var n=new Intl.ListFormat(e,G({},t));return function(e){return n.format(e)}}))},this.init(e)}var t=e.prototype;return t.init=function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||","},t.add=function(e,t){this.formats[e.toLowerCase().trim()]=t},t.addCached=function(e,t){this.formats[e.toLowerCase().trim()]=qp(t)},t.format=function(e,t,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=t.split(this.formatSeparator).reduce((function(e,t){var i=function(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var o=r[1].substring(0,r[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach((function(e){if(e){var t=e.split(":"),r=t[0],o=t.slice(1).join(":").trim().replace(/^'+|'+$/g,""),i=r.trim();n[i]||(n[i]=o),"false"===o&&(n[i]=!1),"true"===o&&(n[i]=!0),isNaN(o)||(n[i]=parseInt(o,10))}}))}return{formatName:t,formatOptions:n}}(t),a=i.formatName,s=i.formatOptions;if(r.formats[a]){var u=e;try{var c=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{};u=r.formats[a](e,c.locale||c.lng||o.locale||o.lng||n,G({},s,o,c))}catch(e){r.logger.warn(e)}return u}return r.logger.warn("there was no format function for "+a),e}),e);return i},e}();var Yp=function(e){function t(t,n,r){var o,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return(o=e.call(this)||this).backend=t,o.store=n,o.services=r,o.languageUtils=r.languageUtils,o.options=i,o.logger=mp.create("backendConnector"),o.waitingReads=[],o.maxParallelReads=i.maxParallelReads||10,o.readingCalls=0,o.maxRetries=i.maxRetries>=0?i.maxRetries:5,o.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(r,i.backend,i),o}lt(t,e);var n=t.prototype;return n.queueLoad=function(e,t,n,r){var o=this,i={},a={},s={},u={};return e.forEach((function(e){var r=!0;t.forEach((function(t){var s=e+"|"+t;!n.reload&&o.store.hasResourceBundle(e,t)?o.state[s]=2:o.state[s]<0||(1===o.state[s]?void 0===a[s]&&(a[s]=!0):(o.state[s]=1,r=!1,void 0===a[s]&&(a[s]=!0),void 0===i[s]&&(i[s]=!0),void 0===u[t]&&(u[t]=!0)))})),r||(s[e]=!0)})),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(u)}},n.loaded=function(e,t,n){var r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),n&&this.store.addResourceBundle(o,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2;var a={};this.queue.forEach((function(n){!function(e,t,n){var r=xp(e,t,Object),o=r.obj,i=r.k;o[i]=o[i]||[],o[i].push(n)}(n.loaded,[o],i),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((function(e){a[e]||(a[e]={});var t=n.loaded[e];t.length&&t.forEach((function(t){void 0===a[e][t]&&(a[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(e){return!e.done}))},n.read=function(e,t,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads)this.waitingReads.push({lng:e,ns:t,fcName:n,tried:o,wait:i,callback:a});else{this.readingCalls++;var s=function(s,u){if(r.readingCalls--,r.waitingReads.length>0){var c=r.waitingReads.shift();r.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}s&&u&&o<r.maxRetries?setTimeout((function(){r.read.call(r,e,t,n,o+1,2*i,a)}),i):a(s,u)},u=this.backend[n].bind(this.backend);if(2!==u.length)return u(e,t,s);try{var c=u(e,t);c&&"function"==typeof c.then?c.then((function(e){return s(null,e)})).catch(s):s(null,c)}catch(e){s(e)}}},n.prepareLoading=function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var i=this.queueLoad(e,t,r,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach((function(e){n.loadOne(e)}))},n.load=function(e,t,n){this.prepareLoading(e,t,{},n)},n.reload=function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)},n.loadOne=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),o=r[0],i=r[1];this.read(o,i,"read",void 0,void 0,(function(r,a){r&&t.logger.warn(n+"loading namespace "+i+" for language "+o+" failed",r),!r&&a&&t.logger.log(n+"loaded namespace "+i+" for language "+o,a),t.loaded(e,r,a)}))},n.saveMissing=function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn('did not save key "'+n+'" as the namespace "'+t+'" was not yet loaded',"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(null!=n&&""!==n){if(this.backend&&this.backend.create){var s=G({},i,{isUpdate:o}),u=this.backend.create.bind(this.backend);if(u.length<6)try{var c;(c=5===u.length?u(e,t,n,r,s):u(e,t,n,r))&&"function"==typeof c.then?c.then((function(e){return a(null,e)})).catch(a):a(null,c)}catch(e){a(e)}else u(e,t,n,r,a,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}},t}(gp);function Zp(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"==typeof e[1]&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function Qp(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function $p(){}var Xp=function(e){function t(){var t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if((t=e.call(this)||this).options=Qp(r),t.services={},t.logger=mp,t.modules={external:[]},n=t,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((function(e){"function"==typeof n[e]&&(n[e]=n[e].bind(n))})),o&&!t.isInitialized&&!r.isClone){if(!t.options.initImmediate)return t.init(r,o),t||function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t);setTimeout((function(){t.init(r,o)}),0)}return t}lt(t,e);var n=t.prototype;return n.init=function(){var e=this,t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,"function"==typeof n&&(r=n,n={}),!n.defaultNS&&!1!==n.defaultNS&&n.ns&&("string"==typeof n.ns?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));var o=Zp();function i(e){return e?"function"==typeof e?new e:e:null}if(this.options=G({},o,this.options,Qp(n)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=G({},o.interpolation,this.options.interpolation)),void 0!==n.keySeparator&&(this.options.userDefinedKeySeparator=n.keySeparator),void 0!==n.nsSeparator&&(this.options.userDefinedNsSeparator=n.nsSeparator),!this.options.isClone){var a;mp.init(this.modules.logger?i(this.modules.logger):null,this.options),this.modules.formatter?a=this.modules.formatter:"undefined"!=typeof Intl&&(a=Hp);var s=new Pp(this.options);this.store=new Ap(this.options.resources,this.options);var u=this.services;u.logger=mp,u.resourceStore=this.store,u.languageUtils=s,u.pluralResolver=new Gp(s,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!a||this.options.interpolation.format&&this.options.interpolation.format!==o.interpolation.format||(u.formatter=i(a),u.formatter.init(u,this.options),this.options.interpolation.format=u.formatter.format.bind(u.formatter)),u.interpolator=new Wp(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new Yp(i(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",(function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];t.emit.apply(t,[e].concat(r))})),this.modules.languageDetector&&(u.languageDetector=i(this.modules.languageDetector),u.languageDetector.init&&u.languageDetector.init(u,this.options.detection,this.options)),this.modules.i18nFormat&&(u.i18nFormat=i(this.modules.i18nFormat),u.i18nFormat.init&&u.i18nFormat.init(this)),this.translator=new Rp(this.services,this.options),this.translator.on("*",(function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];t.emit.apply(t,[e].concat(r))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.format=this.options.interpolation.format,r||(r=$p),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&"dev"!==c[0]&&(this.options.lng=c[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((function(n){e[n]=function(){var e;return(e=t.store)[n].apply(e,arguments)}}));["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((function(n){e[n]=function(){var e;return(e=t.store)[n].apply(e,arguments),t}}));var l=vp(),d=function(){var t=function(t,n){e.isInitializing=!1,e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),l.resolve(n),r(t,n)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?d():setTimeout(d,0),l},n.loadResources=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$p,r="string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&"cimode"===r.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return n();var o=[],i=function(e){e&&("cimode"!==e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){"cimode"!==e&&o.indexOf(e)<0&&o.push(e)})))};if(r)i(r);else this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((function(e){return i(e)}));this.options.preload&&this.options.preload.forEach((function(e){return i(e)})),this.services.backendConnector.load(o,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),n(e)}))}else n(null)},n.reloadResources=function(e,t,n){var r=vp();return e||(e=this.languages),t||(t=this.options.ns),n||(n=$p),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r},n.use=function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Lp.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this},n.setResolvedLanguage=function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t<this.languages.length;t++){var n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}},n.changeLanguage=function(e,t){var n=this,r=this;this.isLanguageChangingTo=e;var o=vp();this.emit("languageChanging",e);var i=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},a=function(a){e||a||!n.services.languageDetector||(a=[]);var s="string"==typeof a?a:n.services.languageUtils.getBestMatchFromCodes(a);s&&(n.language||i(s),n.translator.language||n.translator.changeLanguage(s),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage&&n.services.languageDetector.cacheUserLanguage(s)),n.loadResources(s,(function(e){!function(e,a){a?(i(a),n.translator.changeLanguage(a),n.isLanguageChangingTo=void 0,n.emit("languageChanged",a),n.logger.log("languageChanged",a)):n.isLanguageChangingTo=void 0,o.resolve((function(){return r.t.apply(r,arguments)})),t&&t(e,(function(){return r.t.apply(r,arguments)}))}(e,s)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e):a(this.services.languageDetector.detect()),o},n.getFixedT=function(e,t,n){var r=this,o=function(e,t){var i;if("object"!=typeof t){for(var a=arguments.length,s=new Array(a>2?a-2:0),u=2;u<a;u++)s[u-2]=arguments[u];i=r.options.overloadTranslationOptionHandler([e,t].concat(s))}else i=G({},t);i.lng=i.lng||o.lng,i.lngs=i.lngs||o.lngs,i.ns=i.ns||o.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||n||o.keyPrefix);var c,l=r.options.keySeparator||".";return c=i.keyPrefix&&Array.isArray(e)?e.map((function(e){return""+i.keyPrefix+l+e})):i.keyPrefix?""+i.keyPrefix+l+e:e,r.t(c,i)};return"string"==typeof e?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o},n.t=function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)},n.exists=function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)},n.setDefaultNamespace=function(e){this.options.defaultNS=e},n.hasLoadedNamespace=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=n.lng||this.resolvedLanguage||this.languages[0],o=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state[e+"|"+n];return-1===r||2===r};if(n.precheck){var s=n.precheck(this,a);if(void 0!==s)return s}return!!this.hasResourceBundle(r,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!a(r,e)||o&&!a(i,e)))},n.loadNamespaces=function(e,t){var n=this,r=vp();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())},n.loadLanguages=function(e,t){var n=this,r=vp();"string"==typeof e&&(e=[e]);var o=this.options.preload||[],i=e.filter((function(e){return o.indexOf(e)<0&&n.services.languageUtils.isSupportedCode(e)}));return i.length?(this.options.preload=o.concat(i),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())},n.dir=function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";var t=this.services&&this.services.languageUtils||new Pp(Zp());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"},t.createInstance=function(){return new t(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)},n.cloneInstance=function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$p,o=n.forkResourceStore;o&&delete n.forkResourceStore;var i=G({},this.options,n,{isClone:!0}),a=new t(i);void 0===n.debug&&void 0===n.prefix||(a.logger=a.logger.clone(n));return["store","services","language"].forEach((function(t){a[t]=e[t]})),a.services=G({},this.services),a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},o&&(a.store=new Ap(this.store.data,i),a.services.resourceStore=a.store),a.translator=new Rp(a.services,i),a.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];a.emit.apply(a,[e].concat(n))})),a.init(i,r),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a},n.toJSON=function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}},t}(gp),Kp=Xp.createInstance();Kp.createInstance=Xp.createInstance;var Jp={en:{translation:{}},es:{translation:{"Use your device camera to capture your ID":"Para capturar la identificación hay que utilizar la cámara del dispositivo.","Use your iPhone as a webcam":"Usar el iPhone como cámara web","Models warming up...":"Cargando modelos...","Camera initializing...":"Inicializando la cámara...","Camera access blocked":"Acceso bloqueado a la cámara","Location access blocked":"Acceso bloqueado a la localización",Continue:"Continuar","Processing...":"Procesando...","Your camera permission is disabled":"El permiso de la cámara está desactivado","This application requires access to your camera to continue. Please accept the permission once prompted by the browser. If the browser does not prompt for camera permissions, you must go to settings and provide camera access to the current browser.":"Esta aplicación requiere el acceso a la cámara para continuar. Hay que aceptar el permiso una vez que se muestre la ventana en el explorador. Si no aparece la ventana para otorgar permisos, entonces hay que dirigirse a Configuración y otorgar el permiso a la cámara en el explorador actual.","Your microphone permission is disabled":"El permiso de la micrófono está desactivado","This application requires access to your microphone to continue. Please accept the permission once prompted by the browser. If the browser does not prompt for microphone permissions, you must go to settings and provide microphone access to the current browser.":"Esta aplicación requiere tener acceso al micrófono para continuar. Hay que aceptar el permiso una vez que se muestre la ventana en el explorador. Si no aparece la ventana para otorgar permisos, entonces hay que dirigirse a Configuración y otorgar el permiso al micrófono en el explorador actual.","Your location permission is disabled":"El permiso de la localización está desactivado","This application requires access to your location to continue. Please accept the permission once prompted by the browser. If the browser does not prompt for location permissions, you must go to settings and provide location access to the current browser.":"Esta aplicación requiere el acceso a la localización para continuar. Hay que aceptar el permiso una vez que se muestre la ventana en el explorador. Si no aparece la ventana para otorgar permisos, entonces hay que dirigirse a Configuración y otorgar el permiso a la localización en el explorador actual.",Retry:"Reintentar","Scan the front of ID":"Escanear el frente de la ID","Scan the back of ID":"Escanear el reverso de la ID","Scan the ID page of passport":"Escanear la página de datos del pasaporte","ID Card Front":"Frente de la ID","ID Card Back":"Reverso de la ID",Passport:"Pasaporte","Document not detected":"No se ha detectado el documento","Document is not centered":"Documento no centrado","Document too close, please back up":"Documento muy cerca, favor de alejarse","Document out of focus – try improving the lighting":"Documento no enfocado - hay que tratar de mejorar la iluminación","ID card front detected - please flip your ID card":"Anverso de ID detectado, por favor voltea tu identificación","ID card back detected - please flip your ID card":"Reverso de ID detectado, por favor voltea tu identificación","Document detected, hold still...":"Se ha detectado el documento, no moverse por favor...","ID card front detected, hold still...":"Anverso de ID detectado, no mover...","ID card back detected, hold still...":"Reverso de ID detectado, no mover...","Passport detected, hold still...":"Pasaporte detectado, no mover...","Capturing...":"Capturando...","Capture failed!":"Falló la captura","Please flip your ID card...":"Por favor voltea la identificación...","ID card front captured.":"Se ha capturado el frente de la identificación.","ID card back captured.":"Se ha capturado el reverso de la identificación.","ID Capture Successful":"Captura Exitosa de ID","Verify the entire ID was captured clearly with no glare.":"Hay que verificar que toda la ID se vea completa y sin reflejos.",Submit:"Enviar","Submitting...":"Enviando...","Use your device camera to capture your face":"Hay que utilizar la cámara del dispositivo para capturar el rostro","Remove Sunglasses & Hat":"Hay que quitarse lentes y/o la gorra","Avoid Excessive Backlighting":"Hay que evitar demasiada luz en el fondo","Hold still for a few seconds...":"Hay que permanecer quieto por unos segundos...","Look straight into the camera...":"Hay que mirar directamente a la cámara...","Move back...":"Hay que hacerse hacia atrás..","Move forward...":"Hay que hacerse hacia adelante...","Move to the center...":"Hay que moverse hacia el centro...","Please remove your eye coverings (sunglasses, eye patch, etc.)...":"Hay que quitarse lo que cubre los ojos (lentes, parche, etc.)...","Please remove your head coverings (hat, scarf, etc.)...":"Hay que quitarse lo que cubre la cabeza (gorra, mascada, etc.)...","Please remove your mask...":"Hay que quitarse el cubrebocas...","Live face not detected, please try again":"Rostro vivo no detectado. Por favor hay que intentar de nuevo.",Exit:"Salir","Face liveness has been verified!":"Se ha verificado la Prueba de Vida en rostro!",Done:"Terminar","Customer has been identified!":"¡Se ha identificado al cliente!","Customer not found":"Cliente no encontrado","Additional document capture":"Captura de otro documento",Next:"Siguiente","Please sign the box below":"Por favor, hay que firmar en el recuadro de abajo",Accept:"Aceptar",Clear:"Borrar","Video signature has been successfully captured!":"La video firma ha sido exitosa.","Network unreachable":"No hay conexión a internet.","We're having trouble reaching our services, please check your connection and try again.":"Estamos teniendo problemas para alcanzar nuestros servicios, por favor verificar la conexión a internet e intentar de nuevo.","We're sorry, an unexpected error has occurred.":"Lo sentimos, se ha producido un error inesperado.","Document Capture":"Captura de documento",Capture:"Capturar","Retry capture":"Reintentar la captura",Upload:"Enviar","Uploading...":"Procesando...","Upload succeeded!":"Proceso completo!","Display the front of your ID card...":"Hay que mostrar el frente de la identificación...","Display the back of your ID card...":"Hay que mostrar el reverso de la identificación...","Please move your face to the center...":"Por favor, hay que mover la cabeza hacia el centro...","Searching for ID card...":"Localizando la identificación...","Please read the following text aloud":"Hay que leer el siguiente texto en voz alta","Video ID has been successfully captured!":"Video ID capturado exitosamente!","ID Front Image":"Frente de ID","ID Back Image":"Reverso de ID","We're having some trouble.":"Se ha presentado un problema.","On-device capture guidance failed, please capture a selfie manually.":"La captura automática para toma de selfie falló. Por favor, hay que tomarse la selfie manualmente.","Verifying...":"Verificando....","Please capture the front of your ID card.":"Hay que capturar el frente de la identificación.","Please capture the back of your ID card.":"Hay que capturar el reverso de la identificación.","Please capture the front of your ID card, or the ID page of your passport.":"Hay que capturar el frente de la identificación o la página de datos del pasaporte.","Please capture the back of your ID card, or click Done if submitting a passport.":"Hay que capturar el reverso de la identificación o hay que presionar el botón de Terminar si se trata de un pasaporte.","Please capture the ID page of your passport.":"Hay que capturar la página de datos del pasaporte.","On-device capture guidance failed, please capture a photo of your ID card manually.":"La captura automática falló. Por favor hay que tomar una foto de la identificación manualmente.","On-device capture guidance failed, please capture a photo of your passport manually.":"La captura automática falló. Por favor hay que tomar una foto de la pasaporte manualmente.","On-device capture guidance failed, please capture photos of your ID card and passport manually.":"La captura automática falló. Por favor hay que tomar una foto de la identificación y del pasaporte manualmente.","On-device capture guidance failed, please capture photos of your ID card or passport manually.":"La captura automática falló. Por favor hay que tomar una foto de la identificación o del pasaporte manualmente.","Capture ID page of passport":"Captura pasaporte (página de la foto)","Capture back of ID card":"Captura del reverso","Downloading...":"Descargando...","Accessing camera...":"Accediendo a la cámara","Camera ready":"Cámara está lista","Loading guided capture experience...":"Cargando la experiencia guiada para la captura....","Guided capture experience ready":"La experiencia guiada está lista","Let's Go!":"Vamos!"}}};var eh=function(e){var n=se().i18n;t.useEffect((function(){"auto"!==e?n.changeLanguage(e):n.changeLanguage()}),[n,e])};function th(e,t,n,r){if("string"==typeof n)return n;if("object"==typeof n){var o=n;if(o[t])return o[t];var i=t.split("-")[0];if(o[i])return o[i]}return e(r)}function nh(e,n){var r=se(),o=r.t,i=r.i18n;return t.useMemo((function(){return th(o,i.language,e,n)}),[n,i.language,o,e])}function rh(e,n){var r=se(),o=r.t,i=r.i18n;return t.useMemo((function(){return f(f({},e),Object.keys(n).reduce((function(t,r){var a;return f(f({},t),((a={})[r]=th(o,i.language,null==e?void 0:e[r],n[r]),a))}),{}))}),[n,i.language,o,e])}var oh,ih,ah,sh,uh,ch,lh,dh,fh=o.div(oh||(oh=v(["\n position: absolute;\n top: calc(",");\n ","\n font-weight: bold;\n width: 100%;\n display: flex;\n"],["\n position: absolute;\n top: calc(",");\n ","\n font-weight: bold;\n width: 100%;\n display: flex;\n"])),(function(e){var t=e.$top;return null!=t?t:"10vh"}),(function(e){var t=e.$bottom;return t?"bottom: ".concat(t,";"):""})),ph=function(e){var n=t.createElement(fh,f({},e)),r=document.getElementById("idmission-above-guides-content");return r?a.createPortal(n,r):n},hh=o.div(ih||(ih=v(["\n margin-left: auto;\n margin-right: auto;\n background: ",";\n color: ",";\n padding: 10px 12px 8px;\n border-radius: 8px;\n z-index: 10001;\n"],["\n margin-left: auto;\n margin-right: auto;\n background: ",";\n color: ",";\n padding: 10px 12px 8px;\n border-radius: 8px;\n z-index: 10001;\n"])),(function(e){var t,n,r,o,i,a;return null!==(a=null!==(t=e.$background)&&void 0!==t?t:null===(i=null===(r=null===(n=e.theme)||void 0===n?void 0:n.guidanceMessages)||void 0===r?void 0:r[null!==(o=e.$variant)&&void 0!==o?o:"default"])||void 0===i?void 0:i.backgroundColor)&&void 0!==a?a:"#ccc"}),(function(e){var t,n,r,o,i,a;return null!==(a=null!==(t=e.$textColor)&&void 0!==t?t:null===(i=null===(r=null===(n=e.theme)||void 0===n?void 0:n.guidanceMessages)||void 0===r?void 0:r[null!==(o=e.$variant)&&void 0!==o?o:"default"])||void 0===i?void 0:i.textColor)&&void 0!==a?a:"black"})),mh="https://websdk-cdn-dev.idmission.com/assets",gh=function(e){var n,r,i,a,s,u,c,l,d=e.requiredDocumentType,f=e.thresholds,p=void 0===f?yf:f,h=e.guidanceMessage,m=e.guidanceSatisfied,g=e.onCapture,v=e.assets,y=void 0===v?{}:v,b=e.classNames,x=void 0===b?{}:b,C=e.colors,w=void 0===C?{}:C,E=e.verbiage,k=void 0===E?{}:E,D=e.debugMode,M=void 0!==D&&D,T=ze(),I=T.ref,S=T.width,N=void 0===S?1:S,A=T.height,L=void 0===A?1:A,R=Af(),F=R[0],P=R[1],U=t.useContext(nt).cameraRef,_=t.useContext(bf),j=_.ready,B=_.setThresholds,z=_.detectionTime,G=_.focusPredictionTime,V=_.getBestFrame;t.useEffect((function(){B(p)}),[p,B]),t.useEffect((function(){d&&P({type:"setRequiredDocumentType",payload:d})}),[P,d]),t.useEffect((function(){P({type:"pageRendered",payload:{pageWidth:N,pageHeight:L}})}),[P,L,N]);var W=F.goodFramesThresholdMet&&!F.capturing&&vh(F.captureStartedAt)>=3e3;t.useEffect((function(){if(W){P({type:"capturing"});var e=V();if(!e)return Oe("uh oh, i did not get a photo"),void P({type:"captureFailed"});var t=e.canvas,n=e.documentType,r=e.boundingBox,o=e.detectionScore,i=e.focusScore,a=t.width,s=t.height,u=t.toDataURL("image/jpeg",.95);P({type:"frameCaptured",payload:{imageUrl:u}});var c="passport"===n?"passport":F.requestedDocumentType;setTimeout((function(){var e,t=(new Date).getTime()-(null!==(e=F.captureStartedAt)&&void 0!==e?e:new Date).getTime();null==g||g(u,a,s,c,{autoCapture:"Y",captureTime:t,boundingBox:r,bestDetectionScore:o,bestFocusScore:i}),P({type:"captured"})}),0)}}),[P,V,g,W,F.captureStartedAt,F.requestedDocumentType]),y.portraitGuidesImageUrl||(y.portraitGuidesImageUrl="".concat(mh,"/Shieldout-IDCard-Front-SVG-Portrait-2.svg")),y.landscapeGuidesImageUrl||(y.landscapeGuidesImageUrl="".concat(mh,"/Shieldout-IDCard-Front-SVG-Landscape-2.svg"));var q=o.useTheme();w.guideBoxUnsatisfiedColor||(w.guideBoxUnsatisfiedColor=null!==(i=null===(r=null===(n=q.idCapture)||void 0===n?void 0:n.guideBox)||void 0===r?void 0:r.unsatisfiedColor)&&void 0!==i?i:"white"),w.guideBoxSatisfiedColor||(w.guideBoxSatisfiedColor=null!==(u=null===(s=null===(a=q.idCapture)||void 0===a?void 0:a.guideBox)||void 0===s?void 0:s.satisfiedColor)&&void 0!==u?u:"green");var H=rh(k,{instructionText:"Scan the front of ID",processingIdCardText:"ID card front captured.",guidanceSatisfiedText:"".concat(af[F.detectedDocumentType]," detected, hold still..."),guidancePleaseFlipText:"ID card front detected - please flip your ID card",guidanceBackDetectedFirstText:"ID card back detected - please flip your ID card",guidanceTooBlurryText:"Document out of focus – try improving the lighting",guidanceNotCenteredText:"Document is not centered",guidanceTooCloseText:"Document too close, please back up",guidanceNotDetectedText:"Document not detected"}),Y=Uf({enabled:M,pageWidth:F.guideRectWidth,pageHeight:F.guideRectHeight,videoWidth:F.videoWidth,videoHeight:F.videoHeight}),Z=F.isGoodFrame;return"boolean"==typeof m&&(Z=m),h||(h=Z?H.guidanceSatisfiedText:F.detectionThresholdMet?F.backDetectedFirst?H.guidanceBackDetectedFirstText:F.flipRequired?H.guidancePleaseFlipText:F.documentInBounds?F.documentTooClose?H.guidanceTooCloseText:F.focusThresholdMet?"":H.guidanceTooBlurryText:H.guidanceNotCenteredText:H.guidanceNotDetectedText),t.createElement(O,{ref:I,className:"flex ".concat(null!==(c=x.container)&&void 0!==c?c:"")},""!==h&&t.createElement(ph,{$top:"",$bottom:"12.5dvh",className:x.guidanceMessageContainer},t.createElement(hh,{$variant:Z?"positive":"default",className:x.guidanceMessage},h)),M&&t.createElement(Gf,{$flipX:!(null===(l=U.current)||void 0===l?void 0:l.isRearFacing),scaling:Y},F.detectedObjects.map((function(e,n){var r;return t.createElement(Vf,{key:n,obj:e,scaling:Y,flipX:!(null===(r=U.current)||void 0===r?void 0:r.isRearFacing)})}))),M&&t.createElement(Lf,null,U.current?t.createElement(t.Fragment,null,"✅ Camera: ",U.current.label," (",U.current.width,"x",U.current.height,")"):"❌ Camera not ready",t.createElement("br",null),F.frameCaptureRate>.75?"✅":"👎"," Frame Rate:"," ",Math.round(1e3*(F.frameCaptureRate+Number.EPSILON))/1e3," ","fps (",z,"ms doc detect, ",G,"ms focus)",t.createElement("br",null),j?t.createElement(t.Fragment,null,F.detectionThresholdMet?"✅":"❌"," Detected Document Type: ",F.detectedDocumentType,t.createElement("br",null),F.idCardFrontDetectionThresholdMet?"✅":"❌"," ID Card Front Score: ",F.idCardFrontDetectionScore.toFixed(3),t.createElement("br",null),F.idCardBackDetectionThresholdMet?"✅":"❌"," ID Card Back Score: ",F.idCardBackDetectionScore.toFixed(3),t.createElement("br",null),F.passportDetectionThresholdMet?"✅":"❌"," Passport Score: ",F.passportDetectionScore.toFixed(3),t.createElement("br",null),F.focusThresholdMet?"✅":"❌"," Focus Score:"," ",F.focusScore.toFixed(3),t.createElement("br",null),F.documentInBounds?"✅":"❌"," Document In Bounds",t.createElement("br",null),F.goodFramesThresholdMet?"✅":"❌"," Good Frame Count:"," ",F.goodFramesCount,"/",F.goodFramesThreshold):t.createElement(t.Fragment,null,"❌ Models not ready")))},vh=function(e){return e?Math.abs((new Date).getTime()-e.getTime()):0},yh=function(e){var n,r=e.assets,o=void 0===r?{}:r,i=e.classNames,a=void 0===i?{}:i,s=e.colors,u=void 0===s?{}:s,c=e.verbiage,l=void 0===c?{}:c,d=t.useContext(nt).requestCameraAccess;o.imageUrl||(o.imageUrl=mh+"/camera-disable-icon.png");var f=rh(l,{headingText:"Your camera permission is disabled",descriptionText:"This application requires access to your camera to continue. Please accept the permission once prompted by the browser. If the browser does not prompt for camera permissions, you must go to settings and provide camera access to the current browser.",retryBtnText:"Retry"});return t.createElement(_,{className:"flex ".concat(null!==(n=a.container)&&void 0!==n?n:"")},t.createElement(bh,{className:a.inner},t.createElement(xh,{className:a.imageContainer},t.createElement("img",{src:o.imageUrl,alt:"",className:a.image})),t.createElement("h3",{className:a.heading},f.headingText),t.createElement(Ch,{className:a.description},f.descriptionText),t.createElement(wh,{variant:"warning",onClick:d,colors:u.retryBtn,className:a.retryBtn,finished:!0},f.retryBtnText)))},bh=o(j)(ah||(ah=v(["\n max-width: 500px;\n height: auto;\n margin: auto;\n"],["\n max-width: 500px;\n height: auto;\n margin: auto;\n"]))),xh=o(B)(sh||(sh=v(["\n flex-grow: 0;\n"],["\n flex-grow: 0;\n"]))),Ch=o.p(uh||(uh=v(["\n line-height: 1.5;\n margin-bottom: 50px;\n"],["\n line-height: 1.5;\n margin-bottom: 50px;\n"]))),wh=o(le)(ch||(ch=v(["\n width: 200px;\n margin: 0 auto;\n"],["\n width: 200px;\n margin: 0 auto;\n"]))),Eh=o.button(lh||(lh=v(["\n position: absolute;\n top: 12px;\n right: 12px;\n font-size: 20px;\n width: 32px;\n height: 32px;\n font-family: monospace;\n z-index: 1002;\n border: none;\n border-radius: 4px;\n background: #ccc;\n cursor: pointer;\n padding: 8px;\n box-sizing: border-box;\n display: flex;\n\n &:hover {\n background: #ddd;\n }\n\n & > svg {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n"],["\n position: absolute;\n top: 12px;\n right: 12px;\n font-size: 20px;\n width: 32px;\n height: 32px;\n font-family: monospace;\n z-index: 1002;\n border: none;\n border-radius: 4px;\n background: #ccc;\n cursor: pointer;\n padding: 8px;\n box-sizing: border-box;\n display: flex;\n\n &:hover {\n background: #ddd;\n }\n\n & > svg {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n"]))),kh=function(e){return t.createElement(Eh,{onClick:e.onClick,className:e.className},t.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"19.3 19.3 25.499999999999996 25.499999999999996",enableBackground:"new 0 0 64 64",width:16,height:16},t.createElement("g",{id:"close-outline-bot_x5F_s1g1_x5F_s2g2_x5F_s3g1_x5F_s4g1"},t.createElement("line",{fill:"none",stroke:"#000000",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",x1:"19.75",y1:"44.25",x2:"44.25",y2:"19.75"})),t.createElement("g",{id:"close-outline-top_x5F_s1g1_x5F_s2g2_x5F_s3g1_x5F_s4g1"},t.createElement("line",{fill:"none",stroke:"#000000",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",x1:"44.25",y1:"44.25",x2:"19.75",y2:"19.75"}))))},Dh=o.div(dh||(dh=v(["\n display: flex;\n gap: 0 15px;\n justify-content: center;\n"],["\n display: flex;\n gap: 0 15px;\n justify-content: center;\n"])));function Mh(e){var n=window.innerHeight>window.innerWidth;return t.createElement(n?Ih:Th,f({},e))}function Th(e){var n,r,i,a,s,u,c=e.width,l=void 0===c?698:c,d=e.height,f=void 0===d?452:d,p=e.className,h=t.useState(0),m=h[0],g=h[1];t.useEffect((function(){var e=setInterval((function(){g((function(e){return(e+1)%7}))}),1e3);return function(){clearInterval(e)}}),[]);var v=o.useTheme(),y=null!==(i=null===(r=null===(n=v.idCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.loadingGraphicAccentColor)&&void 0!==i?i:"var(--idm-color-positive-600)",b=null!==(u=null===(s=null===(a=v.idCapture)||void 0===a?void 0:a.loadingOverlay)||void 0===s?void 0:s.loadingGraphicAccentOpacity)&&void 0!==u?u:.2;return t.createElement("div",{style:{display:"flex",width:"100%",height:"100%"}},t.createElement("svg",{className:p,width:l,height:f,viewBox:"0 0 698 452",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{margin:"auto",transform:"scale(".concat(m>1?1:1===m?1.25:.75,")"),transition:"transform 0.2s linear, border-width 0.2s linear",border:"".concat(m>=5?10:0,"px solid ").concat(y)}},t.createElement("g",{filter:1===m?"url(#filter0_f_91_884)":void 0},t.createElement("path",{d:"M10 0.5L688 0.5C693.247 0.5 697.5 4.75329 697.5 10L697.5 442C697.5 447.246 693.247 451.5 688 451.5L9.99999 451.5C4.75328 451.5 0.5 447.246 0.5 442L0.5 9.99998C0.5 4.75328 4.75329 0.5 10 0.5Z",fill:"#F3F3F3",stroke:"#DCDCDC"}),t.createElement("mask",{id:"mask0_91_854",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"30",y:"60",width:"207",height:"266"},t.createElement("rect",{x:"30.7754",y:"60.5945",width:"205.426",height:"265.304",rx:"3",fill:"#D9D9D9"})),t.createElement("g",{mask:"url(#mask0_91_854)"},t.createElement("path",{d:"M161.429 226.164C161.472 226.322 161.474 226.488 161.438 226.647C157.252 244.639 146.071 257.508 132.955 257.508C119.837 257.508 108.632 244.59 104.447 226.595C104.411 226.439 104.413 226.276 104.453 226.121L107.568 214.051L108.337 211.118C108.453 210.678 108.85 210.371 109.305 210.371L156.578 210.371C157.034 210.371 157.432 210.68 157.546 211.122L160.976 224.435L161.305 225.701L161.429 226.164Z",fill:"#D2D4DA"}),t.createElement("path",{d:"M185.475 157.408C185.556 157.356 185.628 157.291 185.693 157.219C210.004 130.149 193.715 196.897 180.188 189.065C157.256 175.818 183.525 158.645 185.475 157.408Z",fill:"#F7A69C"}),t.createElement("path",{d:"M267.491 324.918C267.577 325.255 267.487 325.608 267.24 325.853C254.85 338.143 225.105 345.481 222.791 346.037C222.686 346.063 222.601 346.067 222.493 346.058C219.509 345.795 174.209 342.097 147.081 357.481C142.849 359.881 122.568 356.455 121.909 356.343C121.888 356.339 121.882 356.339 121.861 356.337L89.946 352.929C89.8715 352.921 89.8068 352.921 89.7323 352.929C87.9869 353.117 64.0883 355.438 45.1808 343.79C29.8522 334.346 9.55527 336.584 -1.36759 325.857C-1.61519 325.614 -1.71005 325.255 -1.62441 324.919L1.46107 312.802C6.33129 293.793 21.3654 279.026 40.5404 274.455L42.6579 273.963L66.162 268.361L72.5851 266.837C75.2907 266.181 77.8788 265.267 80.3256 264.095C82.3725 263.11 84.3253 261.962 86.1605 260.649C88.1368 259.243 89.9955 257.649 91.6659 255.891C96.1597 251.18 99.4771 245.367 101.171 238.827L103.665 229.17L104.324 226.568L104.371 226.357L107.571 214.051L108.319 211.123C108.433 210.681 108.831 210.371 109.288 210.371L156.558 210.371C157.013 210.371 157.411 210.679 157.526 211.12L160.978 224.435L161.308 225.701L161.475 226.325C161.489 226.377 161.496 226.431 161.496 226.486V226.486C161.496 226.54 161.503 226.595 161.517 226.647L162.202 229.193L164.696 238.827C167.025 247.781 172.413 255.446 179.73 260.649C183.729 263.532 188.317 265.665 193.282 266.837L199.211 268.244L225.326 274.455C244.501 279.026 259.535 293.793 264.406 312.802L267.491 324.918Z",fill:"#F7A69C"}),t.createElement("path",{d:"M161.429 226.164C161.472 226.322 161.474 226.488 161.438 226.647C157.252 244.639 146.071 257.508 132.955 257.508C119.837 257.508 108.632 244.59 104.447 226.595C104.411 226.439 104.413 226.276 104.453 226.121L107.568 214.051L108.337 211.118C108.453 210.678 108.85 210.371 109.305 210.371L156.578 210.371C157.034 210.371 157.432 210.68 157.546 211.122L160.976 224.435L161.305 225.701L161.429 226.164Z",fill:"#DC968D"}),t.createElement("path",{d:"M80.3983 157.408C80.3166 157.356 80.2445 157.291 80.1799 157.219C55.8686 130.149 72.1582 196.897 85.685 189.065C108.616 175.818 82.3476 158.645 80.3983 157.408Z",fill:"#F7A69C"}),t.createElement("path",{d:"M189.527 137.873C189.52 137.873 189.515 137.879 189.515 137.885C189.515 139.944 189.397 141.956 189.162 143.968C188.974 145.796 188.15 153.601 186.692 163.54C185.895 169.048 184.865 175.184 183.649 181.346C183.638 181.398 183.635 181.447 183.631 181.5V181.5C183.625 181.607 183.575 181.713 183.554 181.818C180.568 196.836 176.367 211.751 170.881 217.193C164.67 223.381 159.682 229.007 153.988 233.062C148.295 237.14 141.919 239.672 132.978 239.672C124.038 239.672 117.662 237.14 111.968 233.062C106.298 229.007 101.286 223.381 95.0752 217.193C89.5754 211.714 85.367 196.715 82.3561 181.682C82.3499 181.651 82.3467 181.628 82.3467 181.596V181.596C82.3467 181.566 82.3438 181.526 82.338 181.496C81.9648 179.566 81.6147 177.636 81.2645 175.728C81.1233 174.932 80.9821 174.135 80.841 173.338C80.2528 169.962 79.7352 166.657 79.2646 163.563C77.5768 152.19 76.7532 143.609 76.7472 143.546C76.747 143.544 76.7471 143.545 76.7469 143.543C76.5589 141.692 76.4648 139.794 76.4648 137.873C76.4648 137.381 76.4648 136.889 76.4648 136.397C76.5825 131.967 77.1942 127.654 78.3 123.528C78.3471 123.341 78.3941 123.153 78.4412 122.966C84.723 100.089 105.121 83.0011 129.731 81.6416C130.814 81.5713 131.872 81.5479 132.978 81.5479C148.601 81.5479 162.741 87.8531 172.975 98.0494C181.822 106.839 187.75 118.559 189.186 131.615C189.42 133.674 189.538 135.756 189.539 137.862C189.539 137.868 189.533 137.873 189.527 137.873V137.873Z",fill:"#FEAEA5"}),t.createElement("path",{d:"M141.871 188.529C141.871 192.42 137.895 195.561 132.977 195.561C128.06 195.561 124.107 192.42 124.107 188.529V188.529C124.107 188.132 124.593 188.105 124.773 188.459C126.079 191.03 129.266 192.842 132.977 192.842C136.689 192.842 139.893 191.03 141.204 188.458C141.381 188.112 141.871 188.14 141.871 188.529V188.529Z",fill:"#F7A69C"}),t.createElement("path",{d:"M267.512 325.037C267.599 325.374 267.509 325.727 267.264 325.974C232.886 360.672 133.16 359.767 132.956 359.765C132.95 359.765 132.962 359.765 132.956 359.765C132.752 359.767 33.0007 360.672 -1.3537 325.95C-1.59784 325.703 -1.68748 325.351 -1.60167 325.014L1.48353 312.922C6.35375 293.889 21.3879 279.122 40.5629 274.551L66.2315 268.456L72.6075 266.933C75.2325 266.311 77.7789 265.415 80.1745 264.28C80.5729 264.092 81.0485 264.176 81.3541 264.494C94.359 278.009 112.66 286.435 132.956 286.435C153.253 286.435 171.556 278.008 184.562 264.49C184.865 264.174 185.337 264.088 185.734 264.274C188.127 265.395 190.657 266.311 193.304 266.933L198.88 268.269L225.349 274.551C244.524 279.122 259.558 293.889 264.405 312.922L267.512 325.037Z",fill:"#6E7174"}),t.createElement("path",{d:"M197.318 267.895C198.038 268.068 198.334 268.924 197.847 269.481C190.872 277.457 169.982 297.251 132.954 298.717C92.046 300.357 71.408 275.554 67.0543 269.627C66.6418 269.065 66.9505 268.284 67.6281 268.122L72.606 266.933C75.231 266.311 77.7773 265.415 80.173 264.28C80.5713 264.092 81.0469 264.176 81.3526 264.494C94.3575 278.009 112.659 286.435 132.954 286.435C153.252 286.435 171.555 278.008 184.56 264.49C184.864 264.174 185.336 264.088 185.732 264.274C188.126 265.395 190.655 266.311 193.303 266.933L197.318 267.895Z",fill:"#555A5E"}),t.createElement("path",{d:"M75.4663 140.851C75.4663 152.603 78.3795 166.091 80.4253 174.114C80.713 175.242 82.458 175.01 82.5156 173.848C83.0875 162.287 85.7494 140.134 97.4904 130.033C108.545 120.523 117.526 131.201 132.13 131.201C145.353 131.201 157.695 120.704 168.836 130.033C181.053 140.264 183.463 159.992 183.739 171.736C183.767 172.936 185.717 173.218 186.003 172.053C187.986 163.959 190.429 151.77 190.429 140.851C190.429 100.426 174.665 81.3704 132.13 81.3704C93.3928 81.3704 75.4663 100.225 75.4663 140.851Z",fill:"#525252"})),t.createElement("rect",{x:"30.7754",y:"360.29",width:"640.93",height:"40.942",rx:"3",fill:"#C1C1C1"}),t.createElement("rect",{x:"267.427",y:"134.29",width:"402.636",height:"40.942",rx:"3",fill:"#C1C1C1"}),t.createElement("rect",{x:"267.427",y:"209.623",width:"180.775",height:"40.942",rx:"3",fill:"#C1C1C1"}),t.createElement("rect",{x:"481.069",y:"209.623",width:"188.992",height:"40.942",rx:"3",fill:"#C1C1C1"}),t.createElement("rect",{x:"267.427",y:"284.956",width:"180.775",height:"40.942",rx:"3",fill:"#C1C1C1"}),t.createElement("rect",{x:"481.069",y:"284.956",width:"188.992",height:"40.942",rx:"3",fill:"#C1C1C1"}),t.createElement("rect",{x:"266.829",y:"58.3618",width:"402.636",height:"40.942",rx:"3",fill:"#C1C1C1"}),t.createElement("g",{fillOpacity:3===m?b:0,style:{transition:"fill-opacity 0.2s linear"}},t.createElement("rect",{x:"672",y:"55",width:"47",height:"410",transform:"rotate(90 672 55)",fill:y}),t.createElement("rect",{x:"670",y:"206",width:"47",height:"194",transform:"rotate(90 670 206)",fill:y}),t.createElement("rect",{x:"242",y:"61",width:"271",height:"218",transform:"rotate(90 242 61)",fill:y}),t.createElement("rect",{x:"677",y:"357",width:"47",height:"653",transform:"rotate(90 677 357)",fill:y})),t.createElement("g",{fillOpacity:4===m?b:0,style:{transition:"fill-opacity 0.2s linear"}},t.createElement("rect",{x:"455",y:"281",width:"47",height:"194",transform:"rotate(90 455 281)",fill:y}),t.createElement("rect",{x:"672",y:"131",width:"47",height:"411",transform:"rotate(90 672 131)",fill:y})),t.createElement("g",{fillOpacity:m>=5?1:0,style:{transition:"fill-opacity 0.2s linear"}},t.createElement("circle",{cx:"360",cy:"215",r:"41",fill:y}),t.createElement("path",{d:"M339.937 218.076L350.044 229.83L381.809 201.915",stroke:"white",strokeWidth:"10",strokeOpacity:m>=5?1:0,strokeLinecap:"round",strokeLinejoin:"round",style:{transition:"stroke-opacity 0.2s linear"}}))),t.createElement("filter",{id:"filter0_f_91_884",x:"0",y:"0",width:"848",height:"556",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},t.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),t.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),t.createElement("feGaussianBlur",{stdDeviation:"5",result:"effect1_foregroundBlur_91_884"}))))}function Ih(e){var n,r,i,a,s,u,c=e.width,l=void 0===c?428:c,d=e.height,f=void 0===d?747:d,p=e.className,h=t.useState(0),m=h[0],g=h[1];t.useEffect((function(){var e=setInterval((function(){g((function(e){return(e+1)%7}))}),1e3);return function(){clearInterval(e)}}),[]);var v=o.useTheme(),y=null!==(i=null===(r=null===(n=v.idCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.loadingGraphicAccentColor)&&void 0!==i?i:"var(--idm-color-positive-600)",b=null!==(u=null===(s=null===(a=v.idCapture)||void 0===a?void 0:a.loadingOverlay)||void 0===s?void 0:s.loadingGraphicAccentOpacity)&&void 0!==u?u:.2;return t.createElement("svg",{className:p,width:l,height:f,viewBox:"0 0 428 747",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("g",{id:"card",style:{transform:"translate(".concat(m<1?"-500px":"0",", 0)"),transition:"transform 0.3s linear"}},t.createElement("path",{d:"M76.5001 181.274C76.5001 176.027 80.7534 171.774 86.0001 171.774L342 171.774C347.247 171.774 351.5 176.027 351.5 181.274L351.5 586C351.5 591.247 347.247 595.5 342 595.5L86.0001 595.5C80.7534 595.5 76.5001 591.247 76.5001 586L76.5001 181.274Z",fill:"#F3F3F3",stroke:"#DCDCDC"}),t.createElement("mask",{id:"mask0_29_1815",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"113",y:"452",width:"163",height:"126"},t.createElement("rect",{x:"113",y:"577.273",width:"125",height:"162",rx:"3",transform:"rotate(-90 113 577.273)",fill:"#D9D9D9"})),t.createElement("g",{mask:"url(#mask0_29_1815)"},t.createElement("path",{d:"M214.008 497.796C214.165 497.754 214.33 497.751 214.489 497.788C225.426 500.352 233.24 507.14 233.24 515.098C233.24 523.058 225.395 529.861 214.455 532.423C214.3 532.46 214.138 532.458 213.983 532.418L206.704 530.546L205.204 530.154C204.764 530.039 204.457 529.641 204.457 529.186L204.457 501.028C204.457 500.571 204.766 500.173 205.208 500.059L213.044 498.048L213.817 497.847L214.008 497.796Z",fill:"#D2D4DA"}),t.createElement("path",{d:"M172.144 483.183C172.092 483.102 172.027 483.031 171.955 482.966C155.547 468.233 196.225 478.134 191.447 486.357C183.444 500.161 173.096 484.665 172.144 483.183Z",fill:"#F7A69C"}),t.createElement("path",{d:"M274.192 433.287C274.528 433.202 274.882 433.292 275.124 433.541C282.444 441.074 286.849 458.59 287.283 460.373C287.308 460.479 287.314 460.558 287.305 460.667C287.111 462.898 284.971 490.135 294.285 506.502C295.735 509.05 293.703 521.155 293.593 521.803C293.589 521.823 293.587 521.84 293.585 521.861L291.51 541.224C291.502 541.299 291.502 541.364 291.509 541.439C291.65 542.782 292.959 557.13 285.925 568.508C280.203 577.763 281.504 589.995 275.126 596.677C274.887 596.927 274.528 597.02 274.193 596.935L267.003 595.111C255.396 592.147 246.379 582.999 243.588 571.332L243.287 570.043L239.866 555.741L238.936 551.833C238.535 550.186 237.977 548.611 237.262 547.123C236.66 545.877 235.959 544.689 235.158 543.572C234.299 542.37 233.326 541.239 232.252 540.222C229.375 537.488 225.826 535.469 221.832 534.438L215.936 532.921L214.347 532.52L214.218 532.491L206.704 530.544L205.21 530.164C204.767 530.051 204.457 529.652 204.457 529.194L204.457 501.04C204.457 500.584 204.765 500.186 205.207 500.071L213.044 498.046L213.817 497.846L214.198 497.744C214.23 497.736 214.263 497.731 214.297 497.731C214.33 497.731 214.363 497.727 214.395 497.718L215.95 497.302L221.832 495.784C227.3 494.367 231.98 491.088 235.158 486.636C236.918 484.202 238.22 481.411 238.936 478.39L239.795 474.782L243.588 458.891C246.379 447.223 255.396 438.075 267.003 435.112L274.192 433.287Z",fill:"#F7A69C"}),t.createElement("path",{d:"M214.008 497.796C214.165 497.754 214.33 497.751 214.489 497.788C225.426 500.352 233.24 507.14 233.24 515.098C233.24 523.058 225.395 529.861 214.455 532.423C214.3 532.46 214.138 532.458 213.983 532.418L206.704 530.546L205.204 530.154C204.764 530.039 204.457 529.641 204.457 529.186L204.457 501.028C204.457 500.571 204.766 500.173 205.208 500.059L213.044 498.048L213.817 497.847L214.008 497.796Z",fill:"#DC968D"}),t.createElement("path",{d:"M172.144 547.035C172.092 547.117 172.027 547.188 171.955 547.252C155.547 561.986 196.225 552.085 191.447 543.861C183.444 530.057 173.096 545.553 172.144 547.035Z",fill:"#F7A69C"}),t.createElement("path",{d:"M160.188 480.675C160.188 480.679 160.191 480.682 160.195 480.682C161.452 480.682 162.681 480.754 163.91 480.897C165.026 481.011 169.792 481.512 175.861 482.4C179.224 482.885 182.971 483.511 186.733 484.252C186.765 484.258 186.795 484.26 186.827 484.262C186.893 484.266 186.958 484.296 187.022 484.309C196.192 486.126 205.299 488.682 208.623 492.02C212.401 495.8 215.836 498.835 218.312 502.3C220.803 505.764 222.348 509.644 222.348 515.084C222.348 520.524 220.803 524.404 218.312 527.869C215.836 531.319 212.401 534.368 208.623 538.148C205.277 541.494 196.118 544.055 186.939 545.887C186.92 545.891 186.906 545.893 186.886 545.893C186.867 545.893 186.844 545.895 186.825 545.898C185.646 546.125 184.468 546.338 183.303 546.551C182.817 546.637 182.33 546.723 181.843 546.809C179.782 547.167 177.764 547.482 175.875 547.768C168.946 548.793 163.714 549.294 163.652 549.3C163.651 549.3 163.651 549.3 163.649 549.3C162.519 549.415 161.361 549.472 160.188 549.472C159.888 549.472 159.587 549.472 159.287 549.472C156.581 549.4 153.948 549.028 151.429 548.355C151.314 548.327 151.2 548.298 151.085 548.269C137.116 544.447 126.682 532.035 125.852 517.06C125.809 516.401 125.795 515.757 125.795 515.084C125.795 505.578 129.645 496.974 135.871 490.746C141.238 485.363 148.395 481.756 156.367 480.882C157.624 480.739 158.895 480.668 160.181 480.668C160.185 480.668 160.188 480.671 160.188 480.675Z",fill:"#FEAEA5"}),t.createElement("path",{d:"M191.119 509.673C193.495 509.673 195.413 512.092 195.413 515.084C195.413 518.077 193.495 520.482 191.119 520.482C190.877 520.482 190.861 520.186 191.077 520.077C192.647 519.282 193.753 517.343 193.753 515.084C193.753 512.826 192.647 510.876 191.077 510.079C190.866 509.971 190.883 509.673 191.119 509.673Z",fill:"#F7A69C"}),t.createElement("path",{d:"M274.264 433.275C274.6 433.189 274.954 433.278 275.199 433.524C296.217 454.568 295.682 514.893 295.68 515.097C295.68 515.103 295.68 515.092 295.68 515.098C295.682 515.302 296.217 575.643 275.184 596.673C274.939 596.917 274.586 597.007 274.251 596.921L267.076 595.097C255.454 592.134 246.437 582.986 243.646 571.318L239.925 555.699L238.994 551.819C238.638 550.318 238.133 548.86 237.499 547.48C237.314 547.078 237.398 546.602 237.715 546.294C245.845 538.394 250.903 527.342 250.903 515.098C250.903 502.851 245.844 491.798 237.711 483.897C237.396 483.591 237.311 483.119 237.493 482.719C238.122 481.341 238.638 479.89 238.994 478.376L239.81 474.983L243.646 458.877C246.437 447.21 255.454 438.061 267.076 435.112L274.264 433.275Z",fill:"#6E7174"}),t.createElement("path",{d:"M239.436 476.54C239.609 475.821 240.466 475.529 241.015 476.024C246.147 480.64 257.535 493.254 258.403 515.098C259.367 539.068 245.359 551.601 241.088 554.862C240.535 555.285 239.753 554.982 239.59 554.305L238.994 551.82C238.638 550.319 238.133 548.86 237.499 547.48C237.314 547.079 237.398 546.603 237.715 546.295C245.845 538.394 250.903 527.343 250.903 515.098C250.903 502.852 245.844 491.799 237.711 483.898C237.396 483.592 237.311 483.119 237.493 482.72C238.122 481.342 238.638 479.891 238.994 478.377L239.436 476.54Z",fill:"#555A5E"}),t.createElement("path",{d:"M162.007 550.079C167.945 550.079 174.609 548.865 179.507 547.741C180.642 547.481 180.435 545.695 179.275 545.595C171.872 544.959 160.808 542.941 155.401 536.678C149.594 529.951 156.114 524.486 156.114 515.6C156.114 507.554 149.704 500.044 155.401 493.265C160.661 487.005 170.034 484.976 177.145 484.392C178.342 484.293 178.605 482.241 177.431 481.993C172.848 481.025 167.193 480.126 162.007 480.126C137.322 480.126 125.686 489.718 125.686 515.6C125.686 539.171 137.2 550.079 162.007 550.079Z",fill:"#525252"})),t.createElement("rect",{x:"296",y:"577.273",width:"390",height:"25",rx:"3",transform:"rotate(-90 296 577.273)",fill:"#C1C1C1"}),t.createElement("rect",{x:"158",y:"433.273",width:"245",height:"25",rx:"3",transform:"rotate(-90 158 433.273)",fill:"#C1C1C1"}),t.createElement("rect",{x:"204",y:"433.273",width:"110",height:"25",rx:"3",transform:"rotate(-90 204 433.273)",fill:"#C1C1C1"}),t.createElement("rect",{x:"204",y:"303.274",width:"115",height:"25",rx:"3",transform:"rotate(-90 204 303.274)",fill:"#C1C1C1"}),t.createElement("rect",{x:"250",y:"433.273",width:"110",height:"25",rx:"3",transform:"rotate(-90 250 433.273)",fill:"#C1C1C1"}),t.createElement("rect",{x:"250",y:"303.274",width:"115",height:"25",rx:"3",transform:"rotate(-90 250 303.274)",fill:"#C1C1C1"}),t.createElement("rect",{x:"111.637",y:"433.637",width:"245",height:"25",rx:"3",transform:"rotate(-90 111.637 433.637)",fill:"#C1C1C1"}),t.createElement("g",{fillOpacity:2===m?b:0,style:{transition:"fill-opacity 0.2s linear"}},t.createElement("rect",{x:"200",y:"188",width:"33",height:"118",fill:y}),t.createElement("rect",{x:"108",y:"444",width:"171",height:"136",fill:y}),t.createElement("rect",{x:"108",y:"187",width:"33",height:"247",fill:y}),t.createElement("rect",{x:"293",y:"186",width:"31",height:"394",fill:y})),t.createElement("g",{fillOpacity:3===m?b:0,style:{transition:"fill-opacity 0.2s linear"}},t.createElement("rect",{x:"154",y:"185",width:"33",height:"249",fill:y}),t.createElement("rect",{x:"247",y:"322",width:"31",height:"113",rx:"5",fill:y})),t.createElement("g",{fillOpacity:m>=4?1:0,strokeOpacity:m>=4?1:0,style:{transition:"fill-opacity 0.2s linear, stroke-opacity 0.2s linear"}},t.createElement("rect",{x:"78.5",y:"171.5",width:"271",height:"426",rx:"2.5",stroke:y,strokeWidth:"5"}),t.createElement("circle",{cx:"214.5",cy:"383.5",r:"23.5",fill:y}),t.createElement("path",{d:"M203 385.263L208.793 392L227 376",stroke:"white",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"}))),t.createElement("g",{id:"phone",clipPath:"url(#clip0_29_1778)",style:{transform:"translate(".concat(m<1?"40px":"0",", 0)"),transition:"transform 0.3s linear"}},t.createElement("rect",{x:"154",y:"693",width:"120",height:"5",rx:"2.5",fill:"#333343"}),t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M372.869 156.244H373.495V156.241C376.342 156.241 378.647 158.551 378.647 161.396V234.788C378.647 237.637 376.339 239.944 373.495 239.944H372.869V677.09C372.869 698.895 355.203 716.571 333.411 716.571H94.2366C72.444 716.571 54.7781 698.895 54.7781 677.09V278.699H54.1523C51.3051 278.699 49 276.39 49 273.544V228.052C49 225.203 51.3082 222.897 54.1523 222.897H54.7781V212.047H54.1523C51.3051 212.047 49 209.737 49 206.892V161.399C49 158.551 51.3082 156.244 54.1523 156.244H54.7781V90.4813C54.7781 68.6761 72.444 51 94.2366 51H333.411C355.203 51 372.869 68.6761 372.869 90.4813V156.244ZM98.3077 60.7649H329.34C347.039 60.7649 361.387 75.1214 361.387 92.8311V674.734C361.387 692.444 347.039 706.8 329.34 706.8H98.3077C80.6082 706.8 66.26 692.444 66.26 674.734V92.8311C66.26 75.1214 80.6082 60.7649 98.3077 60.7649Z",fill:"#333343"}),t.createElement("rect",{x:"154",y:"71",width:"120",height:"20",rx:"10",fill:"#333343"})),t.createElement("defs",null,t.createElement("clipPath",{id:"clip0_29_1778"},t.createElement("rect",{width:"428",height:"747",fill:"white"}))))}var Sh,Nh,Ah,Lh,Oh,Rh,Fh,Ph,Uh,_h,jh,Bh,zh,Gh,Vh,Wh,qh,Hh,Yh,Zh,Qh,$h,Xh,Kh,Jh,em,tm,nm,rm,om="".concat(mh,"/WebSDK-Instruction-DL-Capture-3-Portrait.png"),im=o.div(Sh||(Sh=v(["\n height: 100dvh;\n display: flex;\n flex-direction: column;\n background: ",";\n color: ",";\n"],["\n height: 100dvh;\n display: flex;\n flex-direction: column;\n background: ",";\n color: ",";\n"])),(function(e){var t,n,r,o;return null!==(o=null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.idCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.backgroundColor)&&void 0!==o?o:"#ecedf3"}),(function(e){var t,n,r,o;return null!==(o=null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.idCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.textColor)&&void 0!==o?o:"black"})),am=o.div(Nh||(Nh=v(["\n text-align: ",";\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n ","\n padding-bottom: 0;\n"],["\n text-align: ",";\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n ","\n padding-bottom: 0;\n"])),(function(e){var t;return null!==(t=e.theme.textAlign)&&void 0!==t?t:"center"}),(function(e){return e.theme.padding?"box-sizing: border-box; padding: ".concat(e.theme.padding,";"):""})),sm=o(hh)(Ah||(Ah=v(["\n padding: 16px 24px;\n margin-top: 16px;\n font-size: 18px;\n font-weight: bold;\n background: white;\n box-shadow:\n 0 1px 3px 0 rgb(0 0 0 / 0.1),\n 0 1px 2px -1px rgb(0 0 0 / 0.1);\n"],["\n padding: 16px 24px;\n margin-top: 16px;\n font-size: 18px;\n font-weight: bold;\n background: white;\n box-shadow:\n 0 1px 3px 0 rgb(0 0 0 / 0.1),\n 0 1px 2px -1px rgb(0 0 0 / 0.1);\n"]))),um=o(B)(Lh||(Lh=v(["\n padding: 0 0 100px;\n\n & > svg {\n height: 100%;\n }\n"],["\n padding: 0 0 100px;\n\n & > svg {\n height: 100%;\n }\n"]))),cm=o.div(Oh||(Oh=v(["\n position: fixed;\n bottom: 120px;\n width: 100dvw;\n display: flex;\n"],["\n position: fixed;\n bottom: 120px;\n width: 100dvw;\n display: flex;\n"]))),lm=o(hh)(Rh||(Rh=v(["\n padding: 12px 18px;\n margin: 0 auto;\n font-size: 14px;\n font-weight: bold;\n background: white;\n box-shadow:\n 0 1px 3px 0 rgb(0 0 0 / 0.1),\n 0 1px 2px -1px rgb(0 0 0 / 0.1);\n"],["\n padding: 12px 18px;\n margin: 0 auto;\n font-size: 14px;\n font-weight: bold;\n background: white;\n box-shadow:\n 0 1px 3px 0 rgb(0 0 0 / 0.1),\n 0 1px 2px -1px rgb(0 0 0 / 0.1);\n"]))),dm=o.input(Fh||(Fh=v(["\n margin-right: 8px;\n"],["\n margin-right: 8px;\n"]))),fm=o(Dh)(Ph||(Ph=v(["\n display: flex;\n flex-direction: row;\n padding: 15px 25px;\n height: 100px;\n color: ",";\n ","\n position: fixed;\n bottom: 0;\n left: 0;\n width: 100dvw;\n box-sizing: border-box;\n"],["\n display: flex;\n flex-direction: row;\n padding: 15px 25px;\n height: 100px;\n color: ",";\n ","\n position: fixed;\n bottom: 0;\n left: 0;\n width: 100dvw;\n box-sizing: border-box;\n"])),(function(e){var t,n,r,o;return null!==(o=null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.selfieCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.progressBarTextColor)&&void 0!==o?o:"white"}),(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.idCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.progressBarFontSize)?"font-size: ".concat(null===(a=null===(i=null===(o=e.theme)||void 0===o?void 0:o.idCapture)||void 0===i?void 0:i.loadingOverlay)||void 0===a?void 0:a.progressBarFontSize,";"):""})),pm=o.div(Uh||(Uh=v(["\n display: flex;\n position: relative;\n z-index: 2;\n"],["\n display: flex;\n position: relative;\n z-index: 2;\n"]))),hm=o.ul(_h||(_h=v(["\n display: block;\n margin: auto;\n list-style: none;\n padding: 0;\n"],["\n display: block;\n margin: auto;\n list-style: none;\n padding: 0;\n"]))),mm=o.li(jh||(jh=v(["\n display: inline-flex;\n justify-content: center;\n align-items: center;\n padding: 2px 1.25rem 2px 0;\n line-height: 1rem;\n\n &::before {\n content: '';\n display: inline-block;\n height: 1rem;\n min-width: 1rem;\n vertical-align: middle;\n background-size: cover;\n background-repeat: no-repeat;\n margin: auto 0.5rem auto 0;\n }\n\n &.done::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBjbGlwLXBhdGg9InVybCgjY2xpcDBfNDlfMzg1KSI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMiAyNEMxOC42Mjc0IDI0IDI0IDE4LjYyNzQgMjQgMTJDMjQgNS4zNzI1OCAxOC42Mjc0IDAgMTIgMEM1LjM3MjU4IDAgMCA1LjM3MjU4IDAgMTJDMCAxOC42Mjc0IDUuMzcyNTggMjQgMTIgMjRaTTE5LjU2NDMgOC4yNzg1MkMxOS45NTQ5IDcuODg3OTkgMTkuOTU0OSA3LjI1NDgzIDE5LjU2NDMgNi44NjQzQzE5LjE3MzggNi40NzM3OCAxOC41NDA2IDYuNDczNzggMTguMTUwMSA2Ljg2NDNMOS40Mjg2NiAxNS41ODU4TDUuODUwMDUgMTIuMDA3MkM1LjQ1OTUzIDExLjYxNjYgNC44MjYzNiAxMS42MTY2IDQuNDM1ODQgMTIuMDA3MkM0LjA0NTMxIDEyLjM5NzcgNC4wNDUzMSAxMy4wMzA5IDQuNDM1ODQgMTMuNDIxNEw4LjcyMTU1IDE3LjcwNzFDOS4xMTIwOCAxOC4wOTc2IDkuNzQ1MjQgMTguMDk3NiAxMC4xMzU4IDE3LjcwNzFMMTkuNTY0MyA4LjI3ODUyWiIgZmlsbD0id2hpdGUiLz48L2c+PGRlZnM+PGNsaXBQYXRoIGlkPSJjbGlwMF80OV8zODUiPjxyZWN0IHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0id2hpdGUiLz48L2NsaXBQYXRoPjwvZGVmcz48L3N2Zz4=');\n }\n\n &.running::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBjbGlwLXBhdGg9InVybCgjY2xpcDBfNDlfMzcwKSI+PG1hc2sgaWQ9InBhdGgtMS1pbnNpZGUtMV80OV8zNzAiIGZpbGw9IndoaXRlIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTMuNTE0NzIgMjAuNDg1NUM4LjIwMTAxIDI1LjE3MTggMTUuNzk5IDI1LjE3MTggMjAuNDg1MyAyMC40ODU1QzI1LjE3MTYgMTUuNzk5MiAyNS4xNzE2IDguMjAxMTkgMjAuNDg1MyAzLjUxNDlDMTUuNzk5IC0xLjE3MTM5IDguMjAxMDEgLTEuMTcxMzkgMy41MTQ3MiAzLjUxNDlDLTEuMTcxNTcgOC4yMDExOSAtMS4xNzE1NyAxNS43OTkyIDMuNTE0NzIgMjAuNDg1NVoiLz48L21hc2s+PHBhdGggZD0iTTYuMzk4MTQgMTEuNDU5QzUuODQ1ODYgMTEuNDU5IDUuMzk4MTQgMTEuOTA2NyA1LjM5ODE0IDEyLjQ1OUM1LjM5ODE0IDEzLjAxMTIgNS44NDU4NiAxMy40NTkgNi4zOTgxNCAxMy40NTlWMTEuNDU5Wk0xNy42MDE5IDEzLjQ1OUMxOC4xNTQxIDEzLjQ1OSAxOC42MDE5IDEzLjAxMTIgMTguNjAxOSAxMi40NTlDMTguNjAxOSAxMS45MDY3IDE4LjE1NDEgMTEuNDU5IDE3LjYwMTkgMTEuNDU5VjEzLjQ1OVpNNi4zOTgxNCAxMy40NTlIMTcuNjAxOVYxMS40NTlINi4zOTgxNFYxMy40NTlaTTMuNTE0NzIgMjAuNDg1NUw0LjkyODkzIDE5LjA3MTNMNC45Mjg5MyAxOS4wNzEzTDMuNTE0NzIgMjAuNDg1NVpNMjAuNDg1MyAzLjUxNDlMMTkuMDcxMSA0LjkyOTEyTDE5LjA3MTEgNC45MjkxMkwyMC40ODUzIDMuNTE0OVpNMy41MTQ3MiAzLjUxNDlMNC45Mjg5MyA0LjkyOTEyTDQuOTI4OTMgNC45MjkxMkwzLjUxNDcyIDMuNTE0OVpNMTkuMDcxMSAxOS4wNzEzQzE1LjE2NTggMjIuOTc2NSA4LjgzNDE3IDIyLjk3NjUgNC45Mjg5MyAxOS4wNzEzTDIuMTAwNTEgMjEuODk5N0M3LjU2Nzg0IDI3LjM2NyAxNi40MzIyIDI3LjM2NyAyMS44OTk1IDIxLjg5OTdMMTkuMDcxMSAxOS4wNzEzWk0xOS4wNzExIDQuOTI5MTJDMjIuOTc2MyA4LjgzNDM2IDIyLjk3NjMgMTUuMTY2IDE5LjA3MTEgMTkuMDcxM0wyMS44OTk1IDIxLjg5OTdDMjcuMzY2OCAxNi40MzIzIDI3LjM2NjggNy41NjgwMyAyMS44OTk1IDIuMTAwNjlMMTkuMDcxMSA0LjkyOTEyWk00LjkyODkzIDQuOTI5MTJDOC44MzQxNyAxLjAyMzg3IDE1LjE2NTggMS4wMjM4NyAxOS4wNzExIDQuOTI5MTJMMjEuODk5NSAyLjEwMDY5QzE2LjQzMjIgLTMuMzY2NjUgNy41Njc4NCAtMy4zNjY2NSAyLjEwMDUxIDIuMTAwNjlMNC45Mjg5MyA0LjkyOTEyWk00LjkyODkzIDE5LjA3MTNDMS4wMjM2OSAxNS4xNjYgMS4wMjM2OSA4LjgzNDM2IDQuOTI4OTMgNC45MjkxMkwyLjEwMDUxIDIuMTAwNjlDLTMuMzY2ODMgNy41NjgwMyAtMy4zNjY4MyAxNi40MzIzIDIuMTAwNTEgMjEuODk5N0w0LjkyODkzIDE5LjA3MTNaIiBmaWxsPSJ3aGl0ZSIgbWFzaz0idXJsKCNwYXRoLTEtaW5zaWRlLTFfNDlfMzcwKSIvPjwvZz48ZGVmcz48Y2xpcFBhdGggaWQ9ImNsaXAwXzQ5XzM3MCI+PHJlY3Qgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSJ3aGl0ZSIvPjwvY2xpcFBhdGg+PC9kZWZzPjwvc3ZnPg==');\n }\n"],["\n display: inline-flex;\n justify-content: center;\n align-items: center;\n padding: 2px 1.25rem 2px 0;\n line-height: 1rem;\n\n &::before {\n content: '';\n display: inline-block;\n height: 1rem;\n min-width: 1rem;\n vertical-align: middle;\n background-size: cover;\n background-repeat: no-repeat;\n margin: auto 0.5rem auto 0;\n }\n\n &.done::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBjbGlwLXBhdGg9InVybCgjY2xpcDBfNDlfMzg1KSI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMiAyNEMxOC42Mjc0IDI0IDI0IDE4LjYyNzQgMjQgMTJDMjQgNS4zNzI1OCAxOC42Mjc0IDAgMTIgMEM1LjM3MjU4IDAgMCA1LjM3MjU4IDAgMTJDMCAxOC42Mjc0IDUuMzcyNTggMjQgMTIgMjRaTTE5LjU2NDMgOC4yNzg1MkMxOS45NTQ5IDcuODg3OTkgMTkuOTU0OSA3LjI1NDgzIDE5LjU2NDMgNi44NjQzQzE5LjE3MzggNi40NzM3OCAxOC41NDA2IDYuNDczNzggMTguMTUwMSA2Ljg2NDNMOS40Mjg2NiAxNS41ODU4TDUuODUwMDUgMTIuMDA3MkM1LjQ1OTUzIDExLjYxNjYgNC44MjYzNiAxMS42MTY2IDQuNDM1ODQgMTIuMDA3MkM0LjA0NTMxIDEyLjM5NzcgNC4wNDUzMSAxMy4wMzA5IDQuNDM1ODQgMTMuNDIxNEw4LjcyMTU1IDE3LjcwNzFDOS4xMTIwOCAxOC4wOTc2IDkuNzQ1MjQgMTguMDk3NiAxMC4xMzU4IDE3LjcwNzFMMTkuNTY0MyA4LjI3ODUyWiIgZmlsbD0id2hpdGUiLz48L2c+PGRlZnM+PGNsaXBQYXRoIGlkPSJjbGlwMF80OV8zODUiPjxyZWN0IHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0id2hpdGUiLz48L2NsaXBQYXRoPjwvZGVmcz48L3N2Zz4=');\n }\n\n &.running::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBjbGlwLXBhdGg9InVybCgjY2xpcDBfNDlfMzcwKSI+PG1hc2sgaWQ9InBhdGgtMS1pbnNpZGUtMV80OV8zNzAiIGZpbGw9IndoaXRlIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTMuNTE0NzIgMjAuNDg1NUM4LjIwMTAxIDI1LjE3MTggMTUuNzk5IDI1LjE3MTggMjAuNDg1MyAyMC40ODU1QzI1LjE3MTYgMTUuNzk5MiAyNS4xNzE2IDguMjAxMTkgMjAuNDg1MyAzLjUxNDlDMTUuNzk5IC0xLjE3MTM5IDguMjAxMDEgLTEuMTcxMzkgMy41MTQ3MiAzLjUxNDlDLTEuMTcxNTcgOC4yMDExOSAtMS4xNzE1NyAxNS43OTkyIDMuNTE0NzIgMjAuNDg1NVoiLz48L21hc2s+PHBhdGggZD0iTTYuMzk4MTQgMTEuNDU5QzUuODQ1ODYgMTEuNDU5IDUuMzk4MTQgMTEuOTA2NyA1LjM5ODE0IDEyLjQ1OUM1LjM5ODE0IDEzLjAxMTIgNS44NDU4NiAxMy40NTkgNi4zOTgxNCAxMy40NTlWMTEuNDU5Wk0xNy42MDE5IDEzLjQ1OUMxOC4xNTQxIDEzLjQ1OSAxOC42MDE5IDEzLjAxMTIgMTguNjAxOSAxMi40NTlDMTguNjAxOSAxMS45MDY3IDE4LjE1NDEgMTEuNDU5IDE3LjYwMTkgMTEuNDU5VjEzLjQ1OVpNNi4zOTgxNCAxMy40NTlIMTcuNjAxOVYxMS40NTlINi4zOTgxNFYxMy40NTlaTTMuNTE0NzIgMjAuNDg1NUw0LjkyODkzIDE5LjA3MTNMNC45Mjg5MyAxOS4wNzEzTDMuNTE0NzIgMjAuNDg1NVpNMjAuNDg1MyAzLjUxNDlMMTkuMDcxMSA0LjkyOTEyTDE5LjA3MTEgNC45MjkxMkwyMC40ODUzIDMuNTE0OVpNMy41MTQ3MiAzLjUxNDlMNC45Mjg5MyA0LjkyOTEyTDQuOTI4OTMgNC45MjkxMkwzLjUxNDcyIDMuNTE0OVpNMTkuMDcxMSAxOS4wNzEzQzE1LjE2NTggMjIuOTc2NSA4LjgzNDE3IDIyLjk3NjUgNC45Mjg5MyAxOS4wNzEzTDIuMTAwNTEgMjEuODk5N0M3LjU2Nzg0IDI3LjM2NyAxNi40MzIyIDI3LjM2NyAyMS44OTk1IDIxLjg5OTdMMTkuMDcxMSAxOS4wNzEzWk0xOS4wNzExIDQuOTI5MTJDMjIuOTc2MyA4LjgzNDM2IDIyLjk3NjMgMTUuMTY2IDE5LjA3MTEgMTkuMDcxM0wyMS44OTk1IDIxLjg5OTdDMjcuMzY2OCAxNi40MzIzIDI3LjM2NjggNy41NjgwMyAyMS44OTk1IDIuMTAwNjlMMTkuMDcxMSA0LjkyOTEyWk00LjkyODkzIDQuOTI5MTJDOC44MzQxNyAxLjAyMzg3IDE1LjE2NTggMS4wMjM4NyAxOS4wNzExIDQuOTI5MTJMMjEuODk5NSAyLjEwMDY5QzE2LjQzMjIgLTMuMzY2NjUgNy41Njc4NCAtMy4zNjY2NSAyLjEwMDUxIDIuMTAwNjlMNC45Mjg5MyA0LjkyOTEyWk00LjkyODkzIDE5LjA3MTNDMS4wMjM2OSAxNS4xNjYgMS4wMjM2OSA4LjgzNDM2IDQuOTI4OTMgNC45MjkxMkwyLjEwMDUxIDIuMTAwNjlDLTMuMzY2ODMgNy41NjgwMyAtMy4zNjY4MyAxNi40MzIzIDIuMTAwNTEgMjEuODk5N0w0LjkyODkzIDE5LjA3MTNaIiBmaWxsPSJ3aGl0ZSIgbWFzaz0idXJsKCNwYXRoLTEtaW5zaWRlLTFfNDlfMzcwKSIvPjwvZz48ZGVmcz48Y2xpcFBhdGggaWQ9ImNsaXAwXzQ5XzM3MCI+PHJlY3Qgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSJ3aGl0ZSIvPjwvY2xpcFBhdGg+PC9kZWZzPjwvc3ZnPg==');\n }\n"]))),gm=o.div(Bh||(Bh=v(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"],["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"]))),vm=o.div(zh||(zh=v(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: ",";\n opacity: ",";\n"],["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: ",";\n opacity: ",";\n"])),(function(e){var t,n,r,o;return null!==(o=null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.idCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.progressBarBackgroundColor)&&void 0!==o?o:"var(--idm-color-positive-600)"}),(function(e){var t,n,r,o;return null!==(o=null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.idCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.progressBarBackgroundOpacity)&&void 0!==o?o:.75})),ym=o.span(Gh||(Gh=v(["\n display: block;\n width: ","%;\n height: 100%;\n"],["\n display: block;\n width: ","%;\n height: 100%;\n"])),(function(e){return e.$progress})),bm=o.span(Vh||(Vh=v(["\n display: block;\n height: 100%;\n background: ",";\n animation: progressBar 3s ease-in-out;\n animation-fill-mode: both;\n\n @keyframes progressBar {\n 0% {\n width: 0;\n }\n 100% {\n width: 100%;\n }\n }\n"],["\n display: block;\n height: 100%;\n background: ",";\n animation: progressBar 3s ease-in-out;\n animation-fill-mode: both;\n\n @keyframes progressBar {\n 0% {\n width: 0;\n }\n 100% {\n width: 100%;\n }\n }\n"])),(function(e){var t,n,r,o;return null!==(o=null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.idCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.progressBarIndicatorColor)&&void 0!==o?o:"var(--idm-color-positive-600)"})),xm=o.img(Wh||(Wh=v([""],[""]))),Cm=o.div(qh||(qh=v(["\n display: flex;\n"],["\n display: flex;\n"]))),wm=o(le)(Hh||(Hh=v(["\n margin: auto;\n white-space: nowrap;\n ","\n ","\n"],["\n margin: auto;\n white-space: nowrap;\n ","\n ","\n"])),(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.idCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.progressBarFontSize)?"font-size: ".concat(null===(a=null===(i=null===(o=e.theme)||void 0===o?void 0:o.idCapture)||void 0===i?void 0:i.loadingOverlay)||void 0===a?void 0:a.progressBarFontSize,";"):""}),(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.idCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.continueBtnBorder)?"border: ".concat(null===(a=null===(i=null===(o=e.theme)||void 0===o?void 0:o.idCapture)||void 0===i?void 0:i.loadingOverlay)||void 0===a?void 0:a.continueBtnBorder,";"):""})),Em=o.div(Yh||(Yh=v(["\n margin-top: 15px;\n margin-bottom: 15px;\n"],["\n margin-top: 15px;\n margin-bottom: 15px;\n"]))),km=o.input(Zh||(Zh=v(["\n margin-right: 8px;\n"],["\n margin-right: 8px;\n"]))),Dm={default:function(e){var n,r,o,i,a=e.onDismissed,s=e.onUserCancel,u=e.instructions,c=e.rotateImage,l=void 0!==c&&c,d=e.assets,f=void 0===d?{}:d,p=e.classNames,h=void 0===p?{}:p,m=e.colors,g=void 0===m?{}:m,v=e.verbiage,y=void 0===v?{}:v,b=t.useContext(bf),x=b.ready,C=b.modelDownloadProgress,w=t.useContext(nt),E=w.cameraReady,k=w.cameraAccessDenied,D=w.iphoneContinuityCameraAvailable,M=w.setIphoneContinuityCameraAllowed,T=t.useState(!1),I=T[0],S=T[1];f.instructionImageUrl||(f.instructionImageUrl=om);var N=rh(y,{headingText:"Use your device camera to capture your ID",useContinuityCameraText:"Use your iPhone as a webcam",downloadingText:"Downloading...",modelsWarmingUpText:"Loading guided capture experience...",modelsReadyText:"Guided capture experience ready",cameraInitializingText:"Camera initializing...",cameraInitializedText:"Camera ready",continueText:"Let's Go!"});t.useEffect((function(){if(x&&E)return function(){return null};var e=setTimeout((function(){S(!1)}),500);return function(){clearTimeout(e)}}),[E,x]);var A=t.useRef(null);if(I)return t.createElement(t.Fragment,null);if(k)return t.createElement(yh,{assets:f.cameraAccessDenied,classNames:h.cameraAccessDenied,colors:g.cameraAccessDenied,verbiage:y.cameraAccessDenied});var L={};if(l){var O=null!==(r=null===(n=A.current)||void 0===n?void 0:n.naturalWidth)&&void 0!==r?r:0,R=null!==(i=null===(o=A.current)||void 0===o?void 0:o.naturalHeight)&&void 0!==i?i:0;L={transform:"rotate(-90deg) scale(".concat(O>R?R/O:1,")")}}return t.createElement(_,{className:h.container},t.createElement(im,{className:h.inner},t.createElement(am,null,t.createElement(sm,{className:h.heading},N.headingText)),s&&t.createElement(kh,{onClick:s,className:h.cancelBtn}),t.createElement(um,{className:h.imageContainer,style:{pointerEvents:"none"}},(null==f?void 0:f.instructionImageUrl)&&f.instructionImageUrl!==om?t.createElement(xm,{ref:A,alt:N.headingText,src:f.instructionImageUrl,className:h.image,style:L}):t.createElement(Mh,{className:h.image})),u,t.createElement(cm,{className:h.continuityCameraCheckboxContainer},D&&t.createElement(lm,{className:h.continuityCameraCheckboxInner},t.createElement(dm,{className:h.continuityCameraCheckbox,id:"use-continuity-camera",type:"checkbox",defaultChecked:!0,onChange:function(e){M(e.target.checked)}}),t.createElement("label",{htmlFor:"use-continuity-camera",className:h.continuityCameraCheckboxLabel},N.useContinuityCameraText))),t.createElement(fm,{className:h.buttonsRow},t.createElement(gm,{className:h.progressContainer},t.createElement(vm,{className:h.progressBackground}),t.createElement(ym,{$progress:C,className:h.progressBar},t.createElement(bm,{className:h.progressIndicator}))),t.createElement(pm,{className:h.loadingListContainer},t.createElement(hm,{className:h.loadingList},t.createElement(mm,{className:"".concat(h.loadingListItem," ").concat(E?"done":"running")},E?N.cameraInitializedText:N.cameraInitializingText),t.createElement(mm,{className:"".concat(h.loadingListItem," ").concat(x?"done":"running")},x?N.modelsReadyText:C>=100?N.modelsWarmingUpText:"".concat(N.downloadingText," (").concat(C,"%)")))),t.createElement(Cm,{className:h.continueBtnContainer},x&&E&&t.createElement(wm,{finished:!0,className:h.continueBtn,variant:"positive",colors:g.continueBtn,onClick:function(){S(!0),null==a||a()}},N.continueText)))))},legacy:function(e){var n,r,o,i,a=e.onDismissed,s=e.onUserCancel,u=e.instructions,c=e.rotateImage,l=void 0!==c&&c,d=e.assets,f=void 0===d?{}:d,p=e.classNames,h=void 0===p?{}:p,m=e.colors,g=void 0===m?{}:m,v=e.verbiage,y=void 0===v?{}:v,b=t.useContext(bf),x=b.ready,C=b.modelDownloadProgress,w=t.useContext(nt),E=w.cameraReady,k=w.cameraAccessDenied,D=w.iphoneContinuityCameraAvailable,M=w.setIphoneContinuityCameraAllowed,T=t.useState(!1),I=T[0],S=T[1];f.instructionImageUrl||(f.instructionImageUrl="".concat(mh,"/WebSDK-Instruction-DL-Capture-3-Portrait.png"));var N=rh(y,{headingText:"Use your device camera to capture your ID",useContinuityCameraText:"Use your iPhone as a webcam",downloadingText:"Downloading...",modelsWarmingUpText:"Models warming up...",cameraInitializingText:"Camera initializing...",continueText:"Continue"});t.useEffect((function(){if(x&&E)return function(){return null};var e=setTimeout((function(){S(!1)}),500);return function(){clearTimeout(e)}}),[E,x]);var A=t.useRef(null);if(I)return t.createElement(t.Fragment,null);if(k)return t.createElement(yh,{assets:f.cameraAccessDenied,classNames:h.cameraAccessDenied,colors:g.cameraAccessDenied,verbiage:y.cameraAccessDenied});var L={};if(l){var O=null!==(r=null===(n=A.current)||void 0===n?void 0:n.naturalWidth)&&void 0!==r?r:0,R=null!==(i=null===(o=A.current)||void 0===o?void 0:o.naturalHeight)&&void 0!==i?i:0;L={transform:"rotate(-90deg) scale(".concat(O>R?R/O:1,")")}}return t.createElement(_,{className:h.container},t.createElement(j,{className:h.inner},t.createElement("h3",{className:h.heading},N.headingText),s&&t.createElement(kh,{onClick:s,className:h.cancelBtn}),t.createElement(B,{className:h.imageContainer,style:{pointerEvents:"none"}},t.createElement("img",{ref:A,alt:N.headingText,src:f.instructionImageUrl,className:h.image,style:L})),u,t.createElement(Em,{className:h.continuityCameraCheckboxContainer},D&&t.createElement(t.Fragment,null,t.createElement(km,{className:h.continuityCameraCheckbox,id:"use-continuity-camera",type:"checkbox",defaultChecked:!0,onChange:function(e){M(e.target.checked)}}),t.createElement("label",{htmlFor:"use-continuity-camera",className:h.continuityCameraCheckboxLabel},N.useContinuityCameraText))),t.createElement(le,{className:h.continueBtn,variant:"positive",disabled:!E||!x,finished:x&&E,colors:g.continueBtn,onClick:function(){S(!0),null==a||a()}},E&&x?N.continueText:x?N.cameraInitializingText:C>=100?N.modelsWarmingUpText:"".concat(N.downloadingText," (").concat(C,"%)"))))}},Mm=function(e){var n,r=e.mode,o=void 0===r?"default":r,i=p(e,["mode"]),a=null!==(n=Dm[o])&&void 0!==n?n:Dm.default;return t.createElement(a,f({},i))},Tm=function(e){var n=e.alt,r=e.className,o=e.image,i=t.useState(o.imageData),a=i[0],s=i[1],u=t.useState(!1),c=u[0],l=u[1],d=o.boundingBox,f=t.useRef(null);return t.createElement("img",{ref:f,alt:n,className:r,src:a,onLoad:function(){d&&!c&&(l(!0),setTimeout((function(){s(Dd(f.current,d).toDataURL("image/jpeg",.95))}),100))},onClick:function(){fetch(o.imageData).then((function(e){return e.blob()})).then((function(e){var t,n=URL.createObjectURL(new Blob([e])),r=document.createElement("a");r.href=n,r.setAttribute("download","".concat(o.documentType,".jpg")),document.body.appendChild(r),r.click(),null===(t=r.parentNode)||void 0===t||t.removeChild(r)}))}})},Im=o.p(Qh||(Qh=v(["\n font-size: 18px;\n margin: 30px 0;\n"],["\n font-size: 18px;\n margin: 30px 0;\n"]))),Sm=function(e){var n=e.capturedDocuments,r=e.onSubmitClick,o=e.onRetryClick,i=e.classNames,a=void 0===i?{}:i,s=e.colors,u=void 0===s?{}:s,c=e.verbiage,l=void 0===c?{}:c,d=e.debugMode,f=void 0!==d&&d,p=t.useContext(_e).submissionStatus,h=n.idCardFront,m=n.idCardBack,g=n.passport,v=rh(l,{headingText:"ID Capture Successful",idCardFrontText:"ID Card Front",idCardBackText:"ID Card Back",passportText:"Passport",instructionText:"Verify the entire ID was captured clearly with no glare.",retryText:"Retry",submittingText:"Submitting...",submitText:"Done"});return t.createElement(_,{className:a.container},t.createElement(j,{className:a.inner},t.createElement(Am,{className:a.imageContainer},t.createElement(Lm,{className:a.imageRow},t.createElement(Nm,{className:a.heading},v.headingText),h&&t.createElement(Om,{className:a.imageCol},t.createElement(Rm,{className:a.imageHeading},v.idCardFrontText),t.createElement(Fm,{className:a.imageWrapper},t.createElement(Pm,{image:h,className:a.image,alt:v.idCardFrontText})),f&&t.createElement("pre",null,"Detection Score: ".concat(h.detectionScore,"\nFocus Score: ").concat(h.focusScore,"\nBounding Box: ").concat(JSON.stringify(h.boundingBox)))),m&&t.createElement(Om,{className:a.imageCol},t.createElement(Rm,{className:a.imageHeading},v.idCardBackText),t.createElement(Fm,{className:a.imageWrapper},t.createElement(Pm,{image:m,className:a.image,alt:v.idCardBackText})),f&&t.createElement("pre",null,"Detection Score: ".concat(m.detectionScore,"\nFocus Score: ").concat(m.focusScore,"\nBounding Box: ").concat(JSON.stringify(m.boundingBox)))),g&&t.createElement(Om,{className:a.imageCol},t.createElement(Rm,{className:a.imageHeading},v.passportText),t.createElement(Fm,{className:a.imageWrapper},t.createElement(Pm,{image:g,className:a.image,alt:v.passportText})),f&&t.createElement("pre",null,"Detection Score: ".concat(g.detectionScore,"\nFocus Score: ").concat(g.focusScore,"\nBounding Box: ").concat(JSON.stringify(g.boundingBox)))))),t.createElement(Im,{className:a.instruction},v.instructionText),t.createElement(Dh,{className:a.buttonsRow},t.createElement(le,{className:a.retryBtn,variant:"warning",onClick:o,colors:u.retryBtn,finished:!0},v.retryText),t.createElement(le,{className:a.submitBtn,variant:"positive",onClick:r,disabled:p===b.SUBMITTING,colors:u.doneBtn,finished:!0},p===b.SUBMITTING?v.submittingText:v.submitText))))},Nm=o.h1($h||($h=v(["\n margin-bottom: 12px;\n"],["\n margin-bottom: 12px;\n"]))),Am=o(B)(Xh||(Xh=v(["\n overflow-y: auto;\n"],["\n overflow-y: auto;\n"]))),Lm=o(z)(Kh||(Kh=v(["\n flex-direction: column;\n"],["\n flex-direction: column;\n"]))),Om=o.div(Jh||(Jh=v(["\n max-height: none !important;\n"],["\n max-height: none !important;\n"]))),Rm=o.h3(em||(em=v(["\n text-align: left;\n margin-top: 24px;\n margin-bottom: 8px;\n font-size: 16px;\n font-weight: normal;\n"],["\n text-align: left;\n margin-top: 24px;\n margin-bottom: 8px;\n font-size: 16px;\n font-weight: normal;\n"]))),Fm=o.div(tm||(tm=v(["\n border: 1px solid\n ",";\n border-radius: 6px;\n padding: 4px;\n background: white;\n display: flex;\n"],["\n border: 1px solid\n ",";\n border-radius: 6px;\n padding: 4px;\n background: white;\n display: flex;\n"])),(function(e){var t,n,r;return null!==(r=null===(n=null===(t=e.theme.idCapture)||void 0===t?void 0:t.success)||void 0===n?void 0:n.imageBorderColor)&&void 0!==r?r:"var(--idm-color-primary-400)"})),Pm=o(Tm)(nm||(nm=v(["\n width: 100%;\n border-radius: 4px;\n"],["\n width: 100%;\n border-radius: 4px;\n"]))),Um=function(e){var n,r=e.className,o=t.useContext(nt),i=o.videoRef,a=o.setVideoLoaded,s=o.onVideoUnmounted,u=o.cameraRef;t.useEffect((function(){var e=i.current;if(e)return function(){s(e)}}),[s,i]),t.useEffect((function(){a(!1)}),[a]),t.useEffect((function(){var e;i.current&&(null===(e=u.current)||void 0===e?void 0:e.stream)&&(i.current.srcObject=u.current.stream)}),[u,i]);var c=t.useCallback((function(){a(!0)}),[a]);return t.createElement(_m,{className:r,autoPlay:!0,playsInline:!0,muted:!0,ref:i,onLoadedData:c,$isRearFacing:null===(n=u.current)||void 0===n?void 0:n.isRearFacing})},_m=o.video(rm||(rm=v(["\n transform: ",";\n min-width: 100%;\n min-height: 100%;\n width: auto;\n height: auto;\n max-width: 100%;\n max-height: 100%;\n object-fit: cover;\n background: black;\n z-index: -2;\n"],["\n transform: ",";\n min-width: 100%;\n min-height: 100%;\n width: auto;\n height: auto;\n max-width: 100%;\n max-height: 100%;\n object-fit: cover;\n background: black;\n z-index: -2;\n"])),(function(e){return e.$isRearFacing?"":"scaleX(-1)"}));function jm(e,n,r){var o=this,i=t.useState(!1),a=i[0],s=i[1];return t.useEffect((function(){n&&e&&("function"==typeof e?h(o,void 0,void 0,(function(){return m(this,(function(t){switch(t.label){case 0:return[4,e()];case 1:return t.sent()?null==r||r():s(!0),[2]}}))})):null==r||r())}),[n,r,e]),!e||a}var Bm,zm=o.div(Bm||(Bm=v(["\n ","\n"],["\n ","\n"])),(function(e){return"snapToGuides"===e.$mode?"display: flex;\n position: absolute;\n left: ".concat(e.$x,"px;\n top: ").concat(e.$y,"px;\n width: ").concat(e.$w,"px;\n height: ").concat(e.$h,"px;"):""}));function Gm(e,t,n){var r,o=1;"undefined"!=typeof window&&(o=window.devicePixelRatio),e.width=t*o,e.height=n*o,e.style.width=t+"px",e.style.height=n+"px",null===(r=e.getContext("2d"))||void 0===r||r.scale(o,o)}function Vm(e){e.width=0,e.height=0,e.style.width="0",e.style.height="0"}var Wm,qm,Hm,Ym,Zm,Qm,$m,Xm,Km,Jm,eg,tg,ng=t.createContext({orientation:"landscape",wrapperWidth:1,wrapperHeight:1,wrapperAspectRatio:0,imageAspectRatio:0,wrapperRef:null,setDimensions:function(){return null},onImageLoaded:function(){return null}}),rg=o(L)(Wm||(Wm=v(["\n z-index: 1000;\n"],["\n z-index: 1000;\n"]))),og=o.div(qm||(qm=v(["\n display: flex;\n flex-flow: column nowrap;\n width: 100dvw;\n height: 100dvh;\n"],["\n display: flex;\n flex-flow: column nowrap;\n width: 100dvw;\n height: 100dvh;\n"]))),ig=o.div(Hm||(Hm=v(["\n position: relative;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-items: center;\n box-sizing: border-box;\n max-width: 100%;\n max-height: 100%;\n min-height: 0;\n flex: 1;\n"],["\n position: relative;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-items: center;\n box-sizing: border-box;\n max-width: 100%;\n max-height: 100%;\n min-height: 0;\n flex: 1;\n"]))),ag=o.div(Ym||(Ym=v(["\n display: flex;\n flex-direction: column;\n justify-content: end;\n width: 100%;\n position: relative;\n z-index: 1000;\n background: ",";\n color: ",";\n text-align: center;\n ","\n ","\n"],["\n display: flex;\n flex-direction: column;\n justify-content: end;\n width: 100%;\n position: relative;\n z-index: 1000;\n background: ",";\n color: ",";\n text-align: center;\n ","\n ","\n"])),(function(e){var t,n,r,o,i;return null!==(i=null!==(t=e.$maskColor)&&void 0!==t?t:null===(o=null===(r=null===(n=e.theme)||void 0===n?void 0:n.idCapture)||void 0===r?void 0:r.guideOverlay)||void 0===o?void 0:o.backgroundColor)&&void 0!==i?i:"rgba(0, 0, 0, 0.5)"}),(function(e){var t,n,r,o;return null!==(o=null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.idCapture)||void 0===n?void 0:n.guideOverlay)||void 0===r?void 0:r.textColor)&&void 0!==o?o:"white"}),(function(e){return e.$minWidth?"min-width: ".concat(e.$minWidth,"px;"):""}),(function(e){return e.$minHeight?"min-height: ".concat(e.$minHeight,"px;"):""})),sg=o(ag)(Zm||(Zm=v(["\n display: block;\n width: auto;\n"],["\n display: block;\n width: auto;\n"]))),ug=o.div(Qm||(Qm=v(["\n ","\n ","\n box-sizing: border-box;\n display: flex;\n flex: 1;\n max-height: 100%;\n height: 100%;\n"],["\n ","\n ","\n box-sizing: border-box;\n display: flex;\n flex: 1;\n max-height: 100%;\n height: 100%;\n"])),(function(e){return e.$minWidth?"min-width: ".concat(e.$minWidth,"px;"):""}),(function(e){return e.$isMirrored?"transform: scaleX(-1);":""})),cg=o.div($m||($m=v(["\n box-sizing: border-box;\n border: ",";\n display: flex;\n flex: 1;\n justify-content: center;\n max-height: 100%;\n min-height: 0;\n position: relative;\n"],["\n box-sizing: border-box;\n border: ",";\n display: flex;\n flex: 1;\n justify-content: center;\n max-height: 100%;\n min-height: 0;\n position: relative;\n"])),(function(e){var t,n;return"".concat(null!==(t=e.$borderWidth)&&void 0!==t?t:4,"px solid ").concat(null!==(n=e.$borderColor)&&void 0!==n?n:"white")})),lg=o.span(Xm||(Xm=v(["\n align-content: center;\n margin-top: 12px;\n margin-bottom: 12px;\n"],["\n align-content: center;\n margin-top: 12px;\n margin-bottom: 12px;\n"]))),dg=o.img(Km||(Km=v(["\n position: relative;\n z-index: 1;\n padding: ","px;\n box-sizing: border-box;\n opacity: ",";\n transition: opacity 0.5s;\n max-height: 100%;\n max-width: 100%;\n"],["\n position: relative;\n z-index: 1;\n padding: ","px;\n box-sizing: border-box;\n opacity: ",";\n transition: opacity 0.5s;\n max-height: 100%;\n max-width: 100%;\n"])),(function(e){return e.$padding}),(function(e){return e.$visible?1:0})),fg=function(e){var n,r,i,a,s,u,c,l,d,f,p,h,m=e.classNames,g=void 0===m?{}:m,v=e.width,y=void 0===v?0:v,b=e.height,x=void 0===b?0:b,C=e.padding,w=e.imagePadding,E=e.imageVisible,k=void 0===E||E,D=e.borderWidth,M=e.borderColor,T=e.maskColor,I=e.isMirrored,S=void 0!==I&&I,N=e.instruction,A=void 0===N?"":N,L=e.portraitGuidesImageUrl,O=e.landscapeGuidesImageUrl,R=e.onClick,F=t.useContext(ng),P=F.orientation,U=F.wrapperRef,_=F.wrapperWidth,j=F.wrapperHeight,B=F.imageAspectRatio,z=F.wrapperAspectRatio,G=F.onImageLoaded,V=F.setDimensions,W=Af()[1];var q=o.useTheme();void 0===D&&(D=null!==(i=null===(r=null===(n=q.idCapture)||void 0===n?void 0:n.guideBox)||void 0===r?void 0:r.borderWidth)&&void 0!==i?i:4),0==y&&(y=_),0==x&&(x=j),t.useEffect((function(){V({width:y,height:x})}),[x,V,y]);var H=null!=C?C:gf()?null!==(u=null===(s=null===(a=q.idCapture)||void 0===a?void 0:a.guideBox)||void 0===s?void 0:s.mobilePadding)&&void 0!==u?u:0:null!==(d=null===(l=null===(c=q.idCapture)||void 0===c?void 0:c.guideBox)||void 0===l?void 0:l.desktopPadding)&&void 0!==d?d:50,Y=2*H+2*D,Z="portrait"===P?L:O,Q=null!==(h=null!=w?w:null===(p=null===(f=q.idCapture)||void 0===f?void 0:f.guideBox)||void 0===p?void 0:p.imagePadding)&&void 0!==h?h:0,$=void 0,X=void 0;return B>=z?$=_-Y:X=j-Y,t.createElement(rg,{ref:U,onClick:R,className:g.container},t.createElement(og,{className:g.inner},t.createElement(ag,{$maskColor:T,$minHeight:H,className:pg(g,"Top")},""!==A&&t.createElement(lg,{className:g.guideText},A)),t.createElement(ig,{className:g.centerRow},t.createElement(sg,{$maskColor:T,$minWidth:H,className:pg(g,"Left")}),t.createElement(ug,{$minWidth:$,$isMirrored:S,className:g.centerRegion},t.createElement(cg,{$borderWidth:D,$borderColor:M,className:g.centerRegionInner},t.createElement(dg,{src:Z,alt:"",onLoad:function(e){G(e);var t=e.target;W({type:"guideImageLoaded",payload:{width:t.naturalWidth,height:t.naturalHeight}})},className:g.image,$width:$,$height:X,$padding:Q,$visible:k}))),t.createElement(sg,{$maskColor:T,$minWidth:H,className:pg(g,"Right")})),t.createElement(ag,{$maskColor:T,$minHeight:H,className:pg(g,"Bottom")},""!==A&&t.createElement(lg,{style:{opacity:0}},A))))},pg=function(e,t){return[e.dimmingRegion,e["dimmingRegion".concat(t)]].filter((function(e){return e})).join(" ")},hg=o(dg)(Jm||(Jm=v(["\n backface-visibility: hidden;\n transform-style: preserve-3d;\n position: absolute;\n height: 100%;\n top: 0;\n left: 50%;\n transition: transform ","s;\n transform: translateX(-50%) ",";\n"],["\n backface-visibility: hidden;\n transform-style: preserve-3d;\n position: absolute;\n height: 100%;\n top: 0;\n left: 50%;\n transition: transform ","s;\n transform: translateX(-50%) ",";\n"])),(function(e){return e.$transitionTime}),(function(e){return e.$transforms})),mg=function(e){var n,r,i,a,s,u,c,l,d,f,p,h,m,g=e.padding,v=e.imagePadding,y=e.borderWidth,b=e.borderColor,x=e.maskColor,C=e.assets,w=void 0===C?{}:C,E=e.classNames,k=void 0===E?{}:E,D=e.verbiage,M=void 0===D?{}:D,T=ze(),I=T.ref,S=T.width,N=void 0===S?1:S,A=T.height,L=void 0===A?1:A,R=t.useContext(nt).cameraRef,F=o.useTheme();w.frontPortraitGuidesImageUrl||(w.frontPortraitGuidesImageUrl="".concat(mh,"/Shieldout-IDCard-Front-SVG-Portrait-2.svg")),w.frontLandscapeGuidesImageUrl||(w.frontLandscapeGuidesImageUrl="".concat(mh,"/Shieldout-IDCard-Front-SVG-Landscape-2.svg")),w.backPortraitGuidesImageUrl||(w.backPortraitGuidesImageUrl="".concat(mh,"/Shieldout-IDCard-Back-SVG-Portrait-2.svg")),w.backLandscapeGuidesImageUrl||(w.backLandscapeGuidesImageUrl="".concat(mh,"/Shieldout-IDCard-Back-SVG-Landscape-2.svg"));var P=nh(M.instructionText,"Please flip your ID card..."),U=(null!=g?g:gf())?null!==(i=null===(r=null===(n=F.idCapture)||void 0===n?void 0:n.guideBox)||void 0===r?void 0:r.mobilePadding)&&void 0!==i?i:0:null!==(u=null===(s=null===(a=F.idCapture)||void 0===a?void 0:a.guideBox)||void 0===s?void 0:s.desktopPadding)&&void 0!==u?u:50;void 0===y&&(y=null!==(d=null===(l=null===(c=F.idCapture)||void 0===c?void 0:c.guideBox)||void 0===l?void 0:l.borderWidth)&&void 0!==d?d:4);var _=!(null===(f=R.current)||void 0===f?void 0:f.isRearFacing),j=t.useContext(ng),B=j.orientation,z=j.wrapperRef,G=j.wrapperWidth,V=j.wrapperHeight,W=j.imageAspectRatio,q=j.wrapperAspectRatio,H=j.onImageLoaded,Y=j.setDimensions;t.useEffect((function(){Y({width:N,height:L})}),[L,Y,N]);var Z=2*U+2*y,Q=null!==(m=null!=v?v:null===(h=null===(p=F.idCapture)||void 0===p?void 0:p.guideBox)||void 0===h?void 0:h.imagePadding)&&void 0!==m?m:0,$=void 0,X=void 0;W>=q?$=G-Z:X=V-Z;var K=t.useState(1),J=K[0],ee=K[1],te=t.useState(0),ne=te[0],re=te[1],oe=["rotateY(".concat(ne,"deg)")];_&&oe.push("scaleX(-1)");var ie=["rotateY(".concat(180-ne,"deg)")];return _&&ie.push("scaleX(-1)"),t.useEffect((function(){var e=function(){ee(1),re(180),setTimeout((function(){ee(0),re(0)}),1500)};setTimeout(e,250);var t=setInterval(e,2500);return function(){clearInterval(t)}}),[]),t.createElement(O,{ref:I,className:k.container},t.createElement(og,{ref:z,className:k.inner},t.createElement(ag,{$minHeight:U,$maskColor:x,className:gg(k,"Top")},""!==P&&t.createElement(lg,{className:k.guideText},P)),t.createElement(ig,{className:k.centerRow},t.createElement(sg,{$minWidth:U,$maskColor:x,className:gg(k,"Left")}),t.createElement(ug,null,t.createElement(cg,{$borderWidth:y,$borderColor:b,className:k.centerRegion},t.createElement(hg,{src:"portrait"===B?w.frontPortraitGuidesImageUrl:w.frontLandscapeGuidesImageUrl,alt:"",className:k.image,$width:$,$height:X,$padding:Q,$transitionTime:J,$transforms:oe.join(" "),$visible:!0,onLoad:H}),t.createElement(hg,{src:"portrait"===B?w.backPortraitGuidesImageUrl:w.backLandscapeGuidesImageUrl,alt:"",className:k.image,$width:$,$height:X,$padding:Q,$transitionTime:J,$transforms:ie.join(" "),$visible:!0}))),t.createElement(sg,{$minWidth:U,$maskColor:x,className:gg(k,"Right")})),t.createElement(ag,{$minHeight:U,$maskColor:x,className:gg(k,"Bottom")},""!==P&&t.createElement(lg,{style:{opacity:0}},P))))},gg=function(e,t){return[e.dimmingRegion,e["dimmingRegion".concat(t)]].filter((function(e){return e})).join(" ")},vg=function(e){var n,r,i,a,s,u,c,l,d,f,p,h,m=e.aspectRatio,g=e.maskColor,v=e.borderRadius,y=void 0===v?33:v,b=e.borderColor,x=e.borderWidth,C=e.padding,w=e.imageUrl,E=e.imageVisible,k=e.frontImageUrl,D=e.backImageUrl,M=e.isMirrored,T=e.instruction,I=e.requestingFlip,S=void 0!==I&&I,N=e.classNames,A=void 0===N?{}:N,L=Af(),O=L[0],R=O.redrawing,F=O.guideImageWidth,P=O.guideImageHeight,U=L[1],_=t.useRef(null),j=ze(),B=j.ref,z=j.width,G=void 0===z?1:z,V=j.height,W=void 0===V?1:V,q=o.useTheme();return void 0===x&&(x=null!==(i=null===(r=null===(n=q.idCapture)||void 0===n?void 0:n.guideBox)||void 0===r?void 0:r.borderWidth)&&void 0!==i?i:4),void 0===C&&(C=gf()?null!==(u=null===(s=null===(a=q.idCapture)||void 0===a?void 0:a.guideBox)||void 0===s?void 0:s.mobilePadding)&&void 0!==u?u:0:null!==(d=null===(l=null===(c=q.idCapture)||void 0===c?void 0:c.guideBox)||void 0===l?void 0:l.desktopPadding)&&void 0!==d?d:0),void 0===m&&0!==F&&(m=F/P),void 0===g&&(g=null!==(h=null===(p=null===(f=q.idCapture)||void 0===f?void 0:f.guideOverlay)||void 0===p?void 0:p.backgroundColor)&&void 0!==h?h:"#708090"),t.useEffect((function(){var e=_.current;if(e){if(R)return Vm(e),void setTimeout((function(){U({type:"redrawInProgress"})}),10);var t=G-2*C-2*x,n=W-2*C-2*x,r=[C+x,C+x,t,n],o=r[0],i=r[1],a=r[2],s=r[3];if(void 0!==m){var u=n*m;u<t?o+=(t-(a=u))/2:i+=(n-(s=t/m))/2}Gm(e,G,W);var c=e.getContext("2d");if(c)c.fillStyle=g,c.clearRect(0,0,G,W),c.fillRect(0,0,G,W),c.beginPath(),c.roundRect(o,i,a,s,y),c.lineWidth=x,c.strokeStyle=null!=b?b:"white",(null==b?void 0:b.startsWith("var("))&&(c.strokeStyle=getComputedStyle(document.documentElement).getPropertyValue(b.slice(4,-1))),c.stroke(),c.fillStyle="rgba(0,0,0,1)",c.globalCompositeOperation="destination-out",c.fill(),c.globalCompositeOperation="source-over",U({type:"redrawCompleted",payload:{guideRectX:o,guideRectY:i,guideRectWidth:a,guideRectHeight:s,guideRectOffsetTop:e.offsetTop}})}}),[m,b,y,x,U,g,C,R,W,G]),t.createElement(t.Fragment,null,t.createElement(yg,{ref:B,$maskColor:g,className:A.canvasWrapper},t.createElement(bg,{ref:_,className:A.canvas})),S?t.createElement(mg,{maskColor:"transparent",borderWidth:0,classNames:A,assets:{frontLandscapeGuidesImageUrl:k,backLandscapeGuidesImageUrl:D}}):t.createElement(fg,{landscapeGuidesImageUrl:w,maskColor:"transparent",borderWidth:0,isMirrored:M,instruction:T,classNames:A,imageVisible:E}))},yg=o.div(eg||(eg=v(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n flex-grow: 1;\n background-clip: padding-box;\n box-shadow: inset 0 0 0 2px ",";\n z-index: -1;\n"],["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n flex-grow: 1;\n background-clip: padding-box;\n box-shadow: inset 0 0 0 2px ",";\n z-index: -1;\n"])),(function(e){return e.$maskColor})),bg=o.canvas(tg||(tg=v(["\n display: block;\n"],["\n display: block;\n"])));function xg(e){var n,r,o=e.guideType,i=void 0===o?"fit":o,a=e.portraitGuidesOnMobile,s=void 0===a||a,u=e.requestingFlip,c=void 0!==u&&u,l=e.isBackToFront,d=void 0!==l&&l,f=e.flipIdPromptAssets,p=void 0===f?{}:f,h=e.classNames,m=void 0===h?{}:h,g=e.assets,v=void 0===g?{}:g,y=e.colors,b=void 0===y?{}:y,x=e.verbiage,C=void 0===x?{}:x,w=Af()[0],E=t.useContext(nt).cameraRef,k=rh(C,{instructionText:"Scan the front of ID",capturingText:"Capturing...",captureFailedText:"Capture failed!"}),D=window.innerWidth<window.innerHeight,M=s&&D?null==p?void 0:p.frontPortraitGuidesImageUrl:null==p?void 0:p.frontLandscapeGuidesImageUrl,T=s&&D?null==p?void 0:p.backPortraitGuidesImageUrl:null==p?void 0:p.backLandscapeGuidesImageUrl;if(d){var I=M;M=T,T=I}return t.createElement(t.Fragment,null,"overlay"===i&&t.createElement(fg,{classNames:m,width:w.pageWidth,height:w.pageHeight,instruction:w.captureFailed?k.captureFailedText:w.capturing?null==k?void 0:k.capturingText:k.instructionText,portraitGuidesImageUrl:v.portraitGuidesImageUrl,landscapeGuidesImageUrl:v.landscapeGuidesImageUrl,isMirrored:!(null===(n=E.current)||void 0===n?void 0:n.isRearFacing),borderColor:w.isGoodFrame?b.guideBoxSatisfiedColor:b.guideBoxUnsatisfiedColor,imageVisible:c||!w.idCardFrontDetectionThresholdMet||!w.documentInBounds||w.documentTooClose}),"fit"===i&&t.createElement(vg,{classNames:m,requestingFlip:c,instruction:w.captureFailed?k.captureFailedText:w.capturing?null==k?void 0:k.capturingText:k.instructionText,imageUrl:s&&D?null==v?void 0:v.portraitGuidesImageUrl:null==v?void 0:v.landscapeGuidesImageUrl,frontImageUrl:M,backImageUrl:T,isMirrored:!(null===(r=E.current)||void 0===r?void 0:r.isRearFacing),borderColor:w.isGoodFrame?b.guideBoxSatisfiedColor:b.guideBoxUnsatisfiedColor,imageVisible:c||!w.detectionThresholdMet||!w.documentInBounds||w.documentTooClose||w.backDetectedFirst||w.flipRequired}))}var Cg,wg,Eg,kg,Dg,Mg,Tg,Ig,Sg,Ng,Ag,Lg,Og,Rg=function(e){var n=e.classNames,r=void 0===n?{}:n,o=e.text,i=e.imageUrl,a=t.useRef(null),s=t.useState(!1),u=s[0],c=s[1],l=t.useState(0),d=l[0],f=l[1];return t.createElement(Ug,{className:r.container,style:{opacity:u?1:0}},o&&t.createElement(_g,{className:r.text},o),t.createElement(jg,{className:r.imageContainer,style:{aspectRatio:d}},t.createElement("img",{ref:a,src:i,alt:"",className:r.image,onLoad:function(){f(a.current.naturalWidth/a.current.naturalHeight),c(!0)},onError:function(){Fe("failed to load image from url",i)}})))},Fg=function(e){var n=e.classNames,r=void 0===n?{}:n,o=e.text,i=e.imageUrl,a=t.useRef(null),s=t.useState(!1),u=s[0],c=s[1],l=t.useState(0),d=l[1];return t.createElement(Ug,{className:r.container,style:{aspectRatio:l[0],opacity:u?1:0}},t.createElement(_g,{className:r.text},t.createElement(Pg,{className:r.spinner,$size:24,$color:"white",$thickness:3}),o),t.createElement(jg,{className:r.imageContainer},t.createElement("img",{ref:a,src:i,alt:"",className:r.image,onLoad:function(){d(a.current.naturalWidth/a.current.naturalHeight),c(!0)},onError:function(){Fe("failed to load image from url",i)}})))},Pg=o(Ee)(Cg||(Cg=v(["\n position: relative;\n top: 4px;\n left: -3px;\n margin: 0 3px 0 -12px;\n"],["\n position: relative;\n top: 4px;\n left: -3px;\n margin: 0 3px 0 -12px;\n"]))),Ug=o.div(wg||(wg=v(["\n position: absolute;\n display: flex;\n flex-direction: column;\n height: 33%;\n bottom: 12px;\n right: 12px;\n"],["\n position: absolute;\n display: flex;\n flex-direction: column;\n height: 33%;\n bottom: 12px;\n right: 12px;\n"]))),_g=o.div(Eg||(Eg=v(["\n display: block;\n position: absolute;\n top: -32px;\n font:\n 14px -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n Helvetica,\n Arial,\n sans-serif,\n 'Apple Color Emoji',\n 'Segoe UI Emoji',\n 'Segoe UI Symbol';\n color: white;\n text-align: center;\n margin: 0 auto;\n width: 100%;\n"],["\n display: block;\n position: absolute;\n top: -32px;\n font:\n 14px -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n Helvetica,\n Arial,\n sans-serif,\n 'Apple Color Emoji',\n 'Segoe UI Emoji',\n 'Segoe UI Symbol';\n color: white;\n text-align: center;\n margin: 0 auto;\n width: 100%;\n"]))),jg=o.div(kg||(kg=v(["\n position: relative;\n height: calc(100% - 8px);\n padding: 4px;\n border-radius: 4px;\n background: white;\n\n & > img {\n border-radius: 4px;\n width: auto;\n max-height: 100%;\n }\n"],["\n position: relative;\n height: calc(100% - 8px);\n padding: 4px;\n border-radius: 4px;\n background: white;\n\n & > img {\n border-radius: 4px;\n width: auto;\n max-height: 100%;\n }\n"]))),Bg={documents:[],currentDocumentIndex:0,initialDrawComplete:!1,redrawing:!1,capturing:!1,rectX:0,rectY:0,rectWidth:0,rectHeight:0,rectOffsetTop:0,uploadCapturedDocument:function(){return Promise.resolve()}},zg=t.createContext(Bg),Gg=t.createContext((function(){})),Vg=function(e,t){var n,r,o,i,a;switch(t.type){case"setDocuments":return f(f({},e),{documents:t.payload,currentDocumentIndex:0});case"setHooks":return f(f({},e),t.payload);case"redrawRequested":return f(f({},e),{redrawing:!0,rectX:0,rectY:0,rectWidth:0,rectHeight:0,rectOffsetTop:0});case"redrawInProgress":return f(f({},e),{redrawing:!1,rectX:0,rectY:0,rectWidth:0,rectHeight:0,rectOffsetTop:0});case"redrawCompleted":return f(f(f({},e),t.payload),{initialDrawComplete:!0});case"captureRequested":return f(f({},e),{capturing:!0});case"captureCompleted":return(s=f(f({},e),{capturing:!1})).documents[u=e.currentDocumentIndex].content=t.payload.content,s.documents[u].contentUrl=t.payload.contentUrl,null===(n=e.onDocumentCaptured)||void 0===n||n.call(e,s.documents[u]),s;case"retryCapture":return(s=f({},e)).documents[u=e.currentDocumentIndex].content=void 0,s.documents[u].contentUrl=void 0,s;case"uploadStarted":return(s=f({},e)).documents[u=e.currentDocumentIndex].uploadState="in_progress",s;case"uploadCompleted":return(s=f({},e)).documents[u=e.currentDocumentIndex].documentId=t.payload.documentId,s.documents[u].uploadState="succeeded",null===(o=(r=s.documents[u]).onUploaded)||void 0===o||o.call(r,s.documents[u]),null===(i=e.onDocumentUploaded)||void 0===i||i.call(e,s.documents[u]),e.documents.length-1>u?s.currentDocumentIndex+=1:null===(a=e.onAllDocumentsUploaded)||void 0===a||a.call(e,s.documents),s;case"uploadFailed":var s,u;return(s=f({},e)).documents[u=e.currentDocumentIndex].uploadState="failed",s;default:return e}},Wg=function(e){var n=e.documents,r=void 0===n?[]:n,o=e.aspectRatio,i=e.cameraFeedMode,a=e.instructions,s=e.onDocumentCaptured,u=e.onDocumentUploaded,c=e.onAllDocumentsUploaded,l=e.children,d=t.useReducer(Vg,Bg),p=d[0],g=d[1],v=t.useContext(nt),y=v.cameraRef,b=v.videoRef,x=t.useContext(_e).uploadDocument,C=t.useCallback((function(e,t){return h(void 0,void 0,void 0,(function(){var n;return m(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),g({type:"uploadStarted"}),[4,x(e,{filetype:t})];case 1:return n=r.sent(),setTimeout((function(){g({type:"uploadCompleted",payload:{documentId:n}})}),0),[3,3];case 2:return r.sent(),g({type:"uploadFailed"}),[3,3];case 3:return[2]}}))}))}),[x]);t.useEffect((function(){var e=(null==r?void 0:r.length)?r.map((function(e){return f(f({title:"Document Capture",aspectRatio:o,cameraFeedMode:"snapToGuides",instructions:a},e),{uploadState:"not_started"})})):[{title:"Document Capture",aspectRatio:o,cameraFeedMode:null!=i?i:"snapToGuides",instructions:a,uploadState:"not_started"}];g({type:"setDocuments",payload:e}),e.forEach((function(e){e.content&&(e.contentUrl||(e.contentUrl=URL.createObjectURL(e.content)),C(e.content,e.content.type))}))}),[o,i,r,a,C]),t.useEffect((function(){g({type:"setHooks",payload:{onDocumentCaptured:s,onDocumentUploaded:u,onAllDocumentsUploaded:c}})}),[s,c,u]);var w=wf((function(){g({type:"redrawRequested"})}),500);t.useLayoutEffect((function(){if("undefined"!=typeof window)return window.addEventListener("resize",w),function(){window.removeEventListener("resize",w)}}),[w]);var E=b.current;t.useEffect((function(){if(p.capturing&&y.current)if("undefined"!=typeof ImageCapture){var e=y.current.stream.getTracks().find((function(e){return"video"===e.kind}));if(!e)throw new Error("Failed to find a video feed for taking a photo");new ImageCapture(e).takePhoto().then(n).catch((function(){}))}else if(E){var t=document.createElement("canvas");We(t,E),t.toBlob(n)}function n(e){if(e){var t=URL.createObjectURL(e);g({type:"captureCompleted",payload:{content:e,contentUrl:t}})}}}),[y,p.capturing,E]);var k=t.useMemo((function(){return f(f({},p),{uploadCapturedDocument:C})}),[p,C]);return t.createElement(zg.Provider,{value:k},t.createElement(Gg.Provider,{value:g},l))},qg=function(){var e=t.useContext(zg),n=t.useContext(Gg);if(!e||!n)throw new Error("useDocumentCaptureState cannot be used without DocumentCaptureStateProvider");return[e,n]},Hg=function(e){var n,r,i,a,s,u,c,l,d,f=e.aspectRatio,p=e.borderRadius,h=void 0===p?25:p,m=e.borderColor,g=e.borderWidth,v=e.maskColor,y=e.padding,b=e.classNames,x=void 0===b?{}:b,C=ze(),w=C.ref,E=C.width,k=void 0===E?1:E,D=C.height,M=void 0===D?1:D,T=qg(),I=T[0].redrawing,S=T[1],N=t.useRef(null),A=o.useTheme();return void 0===g&&(g=null!==(i=null===(r=null===(n=A.documentCapture)||void 0===n?void 0:n.guideBox)||void 0===r?void 0:r.borderWidth)&&void 0!==i?i:4),void 0===y&&(y=gf()?null!==(u=null===(s=null===(a=A.documentCapture)||void 0===a?void 0:a.guideBox)||void 0===s?void 0:s.mobilePadding)&&void 0!==u?u:0:null!==(d=null===(l=null===(c=A.documentCapture)||void 0===c?void 0:c.guideBox)||void 0===l?void 0:l.desktopPadding)&&void 0!==d?d:0),t.useEffect((function(){var e=N.current;if(e){if(I)return Vm(e),void setTimeout((function(){S({type:"redrawInProgress"})}),10);var t=k-2*y-2*g,n=M-2*y-2*g,r=[y+g,y+g,t,n],o=r[0],i=r[1],a=r[2],s=r[3];if(void 0!==f){var u=n*f;u<t?o+=(t-(a=u))/2:i+=(n-(s=t/f))/2}Gm(e,k,M);var c=e.getContext("2d");if(c)c.fillStyle=v,c.clearRect(0,0,k,M),c.fillRect(0,0,k,M),c.beginPath(),c.roundRect(o,i,a,s,h),c.lineWidth=g,c.strokeStyle=null!=m?m:"white",c.stroke(),c.fillStyle="rgba(0,0,0,1)",c.globalCompositeOperation="destination-out",c.fill(),c.globalCompositeOperation="source-over",S({type:"redrawCompleted",payload:{rectX:o,rectY:i,rectWidth:a,rectHeight:s,rectOffsetTop:e.offsetTop}})}}),[f,m,h,g,S,v,y,I,M,k]),t.createElement(Yg,{ref:w,className:x.container,$maskColor:v},t.createElement(Zg,{ref:N}))},Yg=o.div(Dg||(Dg=v(["\n flex-grow: 1;\n background-clip: padding-box;\n box-shadow: inset 0 0 0 2px ",";\n"],["\n flex-grow: 1;\n background-clip: padding-box;\n box-shadow: inset 0 0 0 2px ",";\n"])),(function(e){return e.$maskColor})),Zg=o.canvas(Mg||(Mg=v(["\n display: block;\n"],["\n display: block;\n"]))),Qg=function(e){var n,r,i,a,s,u,c,l=e.onCaptureClicked,d=e.classNames,f=void 0===d?{}:d,p=e.verbiage,g=void 0===p?{}:p,v=qg(),y=v[0],b=y.rectX,x=y.rectY,C=y.rectWidth,w=y.rectHeight,E=y.rectOffsetTop,k=y.capturing,D=y.uploadCapturedDocument,M=v[1],T=null!==(n=y.documents[y.currentDocumentIndex])&&void 0!==n?n:{},I=T.title,S=T.aspectRatio,N=T.cameraFeedMode,A=T.instructions,L=T.contentUrl,R=T.content,F=T.uploadState,P=t.useContext(nt),U=P.cameraRef,_=P.cameraReady,j=P.cameraAccessDenied,B=P.requestCameraAccess,z=t.useState(!1),G=z[1],V="not_started"===F&&!R&&!z[0]&&!(null===(i=null===(r=U.current)||void 0===r?void 0:r.stream)||void 0===i?void 0:i.active);t.useEffect((function(){V&&(G(!0),B())}),[V,B]);var W=null!==(u=null===(s=null===(a=o.useTheme().documentCapture)||void 0===a?void 0:a.guideBox)||void 0===s?void 0:s.maskColor)&&void 0!==u?u:"snapToGuides"===N?"#708090":"rgba(0, 0, 0, 0.5)",q=rh(g,{headingText:I,loadingBtnText:"Camera initializing...",retryCameraAccessBtnText:"Retry",captureBtnText:"Capture",capturingBtnText:"Capturing...",retryCaptureBtnText:"Retry capture",uploadBtnText:"Upload",uploadingBtnText:"Uploading...",retryUploadBtnText:"Retry",successBtnText:"Upload succeeded!"});function H(){return h(this,void 0,void 0,(function(){return m(this,(function(e){switch(e.label){case 0:return[4,D(R,"image/jpeg")];case 1:return e.sent(),[2]}}))}))}return t.createElement(O,{className:"flex ".concat(null!==(c=f.container)&&void 0!==c?c:"")},t.createElement(zm,{className:f.cameraFeedWrapper,$mode:null!=N?N:"snapToGuides",$x:b,$y:x+E,$w:C,$h:w},L?t.createElement(nv,{alt:"",src:L,className:f.previewImage}):t.createElement(Um,{className:f.cameraFeed})),t.createElement($g,{className:f.captureContainer},t.createElement(Xg,{$maskColor:W,className:f.headingRow},t.createElement(Kg,{className:f.heading},q.headingText)),t.createElement(Hg,{aspectRatio:S,classNames:f,maskColor:W}),t.createElement(Jg,{$maskColor:W,className:f.footerRow},A&&t.createElement(ev,{className:f.instructions},A),t.createElement(tv,{className:f.buttonsRow},j?t.createElement(le,{className:f.retryCameraAccessBtn,variant:"negative",finished:!0,onClick:B},q.retryCameraAccessBtnText):L?t.createElement(t.Fragment,null,"not_started"===F?t.createElement(t.Fragment,null,t.createElement(le,{className:f.retryCaptureBtn,finished:!0,variant:"warning",onClick:function(){M({type:"retryCapture"})}},q.retryCaptureBtnText),t.createElement(le,{className:f.uploadBtn,finished:!0,variant:"positive",onClick:H},q.uploadBtnText)):t.createElement(le,{className:f.uploadProgressBtn,finished:"in_progress"!==F,variant:"failed"===F?"negative":"positive",onClick:H,disabled:["in_progress","succeeded"].includes(null!=F?F:"")},"succeeded"===F?q.successBtnText:"failed"===F?q.retryUploadBtnText:q.uploadingBtnText)):t.createElement(le,{className:f.captureBtn,finished:_,variant:"primary",onClick:function(){M({type:"captureRequested"}),null==l||l()},disabled:!_||k},_?k?q.capturingBtnText:q.captureBtnText:q.loadingBtnText)))))},$g=o.div(Tg||(Tg=v(["\n display: flex;\n flex-direction: column;\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: var(--app-height);\n"],["\n display: flex;\n flex-direction: column;\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: var(--app-height);\n"]))),Xg=o.div(Ig||(Ig=v(["\n background: ",";\n text-align: center;\n color: white;\n"],["\n background: ",";\n text-align: center;\n color: white;\n"])),(function(e){return e.$maskColor})),Kg=o.h1(Sg||(Sg=v(["\n font-size: 22px;\n"],["\n font-size: 22px;\n"]))),Jg=o.div(Ng||(Ng=v(["\n background: ",";\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding: 0 20px 20px;\n height: auto;\n color: white;\n"],["\n background: ",";\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding: 0 20px 20px;\n height: auto;\n color: white;\n"])),(function(e){return e.$maskColor})),ev=o.div(Ag||(Ag=v(["\n max-height: ",";\n overflow-y: auto;\n"],["\n max-height: ",";\n overflow-y: auto;\n"])),(function(e){var t,n,r;return null!==(r=null===(n=null===(t=e.theme.documentCapture)||void 0===t?void 0:t.instructions)||void 0===n?void 0:n.maxHeight)&&void 0!==r?r:"8rem"})),tv=o(Dh)(Lg||(Lg=v(["\n padding-top: 20px;\n"],["\n padding-top: 20px;\n"]))),nv=o.img(Og||(Og=v(["\n width: 100%;\n height: 100%;\n object-fit: cover;\n"],["\n width: 100%;\n height: 100%;\n object-fit: cover;\n"]))),rv=function(e){var n=e.documents,r=e.classNames,o=e.verbiage;return t.createElement(Wg,{documents:void 0===n?[]:n,aspectRatio:e.aspectRatio,cameraFeedMode:e.cameraFeedMode,instructions:e.instructions,onDocumentCaptured:e.onDocumentCaptured,onDocumentUploaded:e.onDocumentUploaded,onAllDocumentsUploaded:e.onSuccess},t.createElement(Qg,{classNames:void 0===r?{}:r,verbiage:void 0===o?{}:o}))};function ov(){var e=t.useState(),n=e[0],r=e[1],o=t.useCallback((function(e){var t,n;r(null===(n=null===(t=e.currentTarget)||void 0===t?void 0:t.files)||void 0===n?void 0:n[0])}),[r]);return{rawFile:n,fileInputOnChange:o}}function iv(e){var n=this,r=e.maxEdgePx,o=void 0===r?2048:r,i=function(e){var n=t.useState(),r=n[0],o=n[1];return t.useEffect((function(){if(e){var t=!1,n=new FileReader;return n.onload=function(){return!t&&o(n.result)},n.readAsDataURL(e),function(){t=!0}}}),[e]),{url:r}}(e.rawFile).url,a=t.useState(),s=a[0],u=a[1];return t.useEffect((function(){if(i){var e=!1,t=new Image;return t.onload=function(){return h(n,void 0,void 0,(function(){var n,r,i,a,s,c;return m(this,(function(l){if(e)return[2];if(r=(n=t.width>t.height?{width:o,height:o/t.width*t.height}:{width:o/t.height*t.width,height:o}).width,i=n.height,(a=document.createElement("canvas")).width=r,a.height=i,null==(s=a.getContext("2d")))throw new Error("Can't obtain canvas context");return s.imageSmoothingQuality="high",s.drawImage(t,0,0,t.width,t.height,0,0,r,i),c=a.toDataURL("image/jpeg",.95),e||u(c),[2]}))}))},t.src=i,function(){e=!0}}}),[o,i]),{resizedImageFile:s}}var av,sv,uv,cv,lv,dv,fv,pv,hv=function(e){var n=e.idCaptureRequirement,r=void 0===n?"idCardOrPassport":n,o=e.onCapture,i=e.onFinished,a=e.classNames,s=void 0===a?{}:a,u=e.colors,c=void 0===u?{}:u,l=e.verbiage,d=void 0===l?{}:l,f=e.silentFallback,p=void 0!==f&&f,h=t.useRef(null),m=t.useRef(null),v=t.useState([]),y=v[0],b=v[1],x=t.useState(),C=x[0],w=x[1],E=t.useState(p),k=E[0],D=E[1],M=function(e){return"idCardOrPassport"===e?2:Df(e)}(r),T=Df(r),I=ov(),S=I.fileInputOnChange,N=iv({rawFile:I.rawFile}).resizedImageFile,A=t.useState(!1),L=A[0],O=A[1],R="idCard"===r?"ID card":"passport"===r?"passport":"idCardOrPassport"===r?"ID card or passport":"ID card and passport",F="idCard"===r||"idCardAndPassport"===r?"Please capture the front of your ID card.":"passport"===r?"Please capture the ID page of your passport.":"Please capture the front of your ID card, or the ID page of your passport.",P="idCardOrPassport"===r?"Please capture the back of your ID card, or click Done if submitting a passport.":"Please capture the back of your ID card.",U=rh(d,{headingText:"We're having some trouble.",descriptionText:"On-device capture guidance failed, please capture ".concat(T>1?"photos":" a photo"," of your ").concat(R," manually."),firstInstructionText:F,secondInstructionText:P,thirdInstructionText:"Please capture the ID page of your passport.",captureBtnText:"Capture",captureMoreBtnText:"Capture ".concat(2===y.length?"ID page of passport":"back of ID card"),doneBtnText:"Done"});t.useEffect((function(){N&&N!==h.current&&(h.current=N,b((function(e){return g(g([],e,!0),[N],!1)})),null==o||o(N),w(void 0),D(!1),O(!1))}),[o,N]);var j=0===y.length?U.firstInstructionText:1===y.length?U.secondInstructionText:U.thirdInstructionText;return k&&(D(!1),w(j)),!gf()&&C||k?t.createElement(rv,{documents:[{title:C}],onDocumentCaptured:function(e){var t=e.contentUrl;null==o||o(t),setTimeout((function(){b((function(e){return g(g([],e,!0),[t],!1)})),w(void 0)}),0)}}):t.createElement(t.Fragment,null,t.createElement(_,{className:s.container},t.createElement(mv,{className:s.inner},!p&&t.createElement(t.Fragment,null,t.createElement(gv,{className:s.heading},U.headingText),t.createElement(vv,{className:s.description},U.descriptionText)),(y.length>0||L)&&t.createElement(z,{className:s.imageContainer},y.map((function(e,n){return t.createElement(bv,{key:n,className:s.imageCol},t.createElement("img",{src:e,alt:"",className:s.image}))}))),y.length<T&&t.createElement(yv,{className:s.instruction},j),t.createElement("input",{ref:m,type:"file",accept:"image/*",capture:"environment",onChange:function(e){var t;(null===(t=e.target.files)||void 0===t?void 0:t[0])&&(w(void 0),O(!0),S(e))},hidden:!0}),t.createElement(xv,{className:s.buttonsRow},y.length<M&&t.createElement(le,{variant:y.length>0?"secondary":"positive",className:y.length>0?s.captureMoreBtn:s.captureBtn,colors:y.length>0?c.captureMoreBtn:c.captureBtn,finished:!0,onClick:function(){var e;gf()?null===(e=m.current)||void 0===e||e.click():w(j)}},y.length>0?U.captureMoreBtnText:U.captureBtnText),y.length>=T&&t.createElement(le,{variant:"positive",className:s.doneBtn,colors:c.doneBtn,finished:!0,onClick:function(){null==i||i(y)}},U.doneBtnText)))))},mv=o(j)(av||(av=v(["\n justify-content: center;\n"],["\n justify-content: center;\n"]))),gv=o.h3(sv||(sv=v(["\n margin-bottom: 8px;\n"],["\n margin-bottom: 8px;\n"]))),vv=o.p(uv||(uv=v(["\n margin-bottom: 8px;\n"],["\n margin-bottom: 8px;\n"]))),yv=o.p(cv||(cv=v(["\n font-weight: bold;\n"],["\n font-weight: bold;\n"]))),bv=o.div(lv||(lv=v(["\n display: flex;\n justify-content: center;\n flex-grow: 1;\n flex-basis: 0;\n"],["\n display: flex;\n justify-content: center;\n flex-grow: 1;\n flex-basis: 0;\n"]))),xv=o(Dh)(dv||(dv=v(["\n margin-top: 32px;\n"],["\n margin-top: 32px;\n"]))),Cv=function(e){var n,r,i,a,s,u,c,l,d,f,p,g,v,y,x,C,k=e.onSuccess,D=e.onExitCapture,M=e.onUserCancel,T=e.loadingOverlayMode,I=void 0===T?"default":T,S=e.precapturedDocuments,N=e.captureRequirement,A=void 0===N?"idCardOrPassport":N,L=e.separateIdCardCaptureSequence,R=void 0!==L&&L,F=e.thresholds,P=void 0===F?yf:F,U=e.skipSuccessScreen,_=void 0!==U&&U,j=e.instructions,B=e.releaseCameraAccessOnExit,z=void 0===B||B,G=e.guideType,V=void 0===G?"fit":G,W=e.portraitGuidesOnMobile,q=void 0===W||W,H=e.rotateLoadingOverlayImageWhenPortrait,Y=void 0===H||H,Z=e.silentFallback,Q=void 0!==Z&&Z,$=e.forceFallbackMode,X=void 0!==$&&$,K=e.allowIdCardBackToFrontCapture,J=void 0!==K&&K,ee=e.assets,te=void 0===ee?{}:ee,ne=e.classNames,re=void 0===ne?{}:ne,oe=e.colors,ie=void 0===oe?{}:oe,ae=e.verbiage,se=void 0===ae?{}:ae,ue=e.debugMode,ce=void 0!==ue&&ue,le=Af(),de=le[0],fe=le[1],pe=t.useContext(nt),he=pe.cameraAccessDenied,me=pe.requestCameraAccess,ge=pe.releaseCameraAccess,ve=t.useState(!1),ye=ve[0],be=ve[1],xe=t.useContext(_e),Ce=xe.submissionStatus,we=xe.setIdFrontImage,Ee=xe.setIdBackImage,ke=xe.setPassportImage,De=xe.logIdFrontCaptureAttempt,Me=xe.logIdBackCaptureAttempt,Te=t.useContext(bf),Ie=Te.start,Se=Te.stop,Ne=Te.onPredictionMade,Ae=Te.setRequiredDocumentType,Le=Te.modelError,Oe=Te.resetBestFrame;t.useEffect((function(){fe({type:"configureWizard",payload:{captureRequirement:A,precapturedDocuments:S,allowIdCardBackToFrontCapture:J}})}),[J,A,fe,S]);var Re=Object.keys(de.capturedDocuments).length;t.useEffect((function(){Re&&Oe()}),[Re,Oe]);var Fe=t.useCallback((function(e){var t;e.operationTime=(new Date).getTime()-(null!==(t=de.operationStartedAt)&&void 0!==t?t:new Date).getTime(),"idCardBack"===de.requestedDocumentType?Me(e):De(e)}),[Me,De,de.operationStartedAt,de.requestedDocumentType]);t.useEffect((function(){ye&&"capturing"===de.captureState&&(fe({type:"captureStarted"}),Ie())}),[fe,ye,Ie,de.captureState]),t.useEffect((function(){Ne((function(e){"capturing"===de.captureState?fe({type:"objectsDetected",payload:{prediction:e}}):"requestingFlip"===de.captureState&&"selfie"!==de.requestedDocumentType&&e["".concat(de.requestedDocumentType,"DetectionThresholdMet")]&&(Oe(),fe({type:"flipRequestCompleted"}))}))}),[fe,Ne,Oe,de.captureState,de.requestedDocumentType]),t.useEffect((function(){"complete"===de.captureState&&Se()}),[de.captureState,Se]);var Pe=t.useCallback((function(e,t,n,r,o){Fe(o),fe({type:"documentCaptured",payload:{imageData:e,width:t,height:n,documentType:r,boundingBox:o.boundingBox,detectionScore:o.bestDetectionScore,focusScore:o.bestFocusScore}})}),[fe,Fe]),Ue=t.useCallback((function(){var e=de.capturedDocuments,t=e.idCardFront,n=e.idCardBack,r=e.passport,o=t&&E(t.imageData),i=n&&E(n.imageData),a=r&&E(r.imageData);o&&we(o),i&&Ee(i),a&&ke(a),z&&ge(),setTimeout((function(){null==k||k({idFrontImage:o,idBackImage:i,passportImage:a})}),0)}),[k,ge,z,Ee,we,ke,de.capturedDocuments]),je=jm(_,"complete"===de.captureState,Ue),Be=t.useCallback((function(){fe({type:"resetWizard"})}),[fe]),ze=t.useState(0),Ge=ze[0],Ve=ze[1],We=t.useCallback((function(){ge(),be(!1),Ve((function(e){return e+1})),fe({type:"resetWizard"}),null==D||D(),me()}),[fe,D,ge,me]);t.useEffect((function(){Ce!==b.READY&&z&&ge()}),[ge,z,Ce]),t.useEffect((function(){he&&(be(!1),Ve((function(e){return e+1})))}),[he]),te.idCardFront||(te.idCardFront={}),(c=te.idCardFront).portraitGuidesImageUrl||(c.portraitGuidesImageUrl="".concat(mh,"/Shieldout-IDCard-Front-SVG-Portrait-2.svg")),(l=te.idCardFront).landscapeGuidesImageUrl||(l.landscapeGuidesImageUrl="".concat(mh,"/Shieldout-IDCard-Front-SVG-Landscape-2.svg")),te.idCardBack||(te.idCardBack={}),(d=te.idCardBack).portraitGuidesImageUrl||(d.portraitGuidesImageUrl="".concat(mh,"/Shieldout-IDCard-Back-SVG-Portrait-2.svg")),(f=te.idCardBack).landscapeGuidesImageUrl||(f.landscapeGuidesImageUrl="".concat(mh,"/Shieldout-IDCard-Back-SVG-Landscape-2.svg")),te.passport||(te.passport={}),(p=te.passport).portraitGuidesImageUrl||(p.portraitGuidesImageUrl="".concat(mh,"/Shieldout-Passport-Front-SVG-Portrait-2.svg")),(g=te.passport).landscapeGuidesImageUrl||(g.landscapeGuidesImageUrl="".concat(mh,"/Shieldout-Passport-Front-SVG-Landscape-2.svg")),te.flipIdPrompt||(te.flipIdPrompt={}),(v=te.flipIdPrompt).frontPortraitGuidesImageUrl||(v.frontPortraitGuidesImageUrl=te.idCardFront.portraitGuidesImageUrl),(y=te.flipIdPrompt).frontLandscapeGuidesImageUrl||(y.frontLandscapeGuidesImageUrl=te.idCardFront.landscapeGuidesImageUrl),(x=te.flipIdPrompt).backPortraitGuidesImageUrl||(x.backPortraitGuidesImageUrl=te.idCardBack.portraitGuidesImageUrl),(C=te.flipIdPrompt).backLandscapeGuidesImageUrl||(C.backLandscapeGuidesImageUrl=te.idCardBack.landscapeGuidesImageUrl);var qe={idCardFront:rh(se.idCardFront,{instructionText:"Scan the front of ID",processingIdCardText:"ID card ".concat("idCardFront"in de.capturedDocuments?"front":"back"," captured.")}),idCardBack:rh(se.idCardBack,{instructionText:"Scan the back of ID"}),passport:rh(se.passport,{instructionText:"Scan the ID page of passport"})},He=o.useTheme(),Ye=Af()[0],Ze=Ye.guideRectX,Qe=Ye.guideRectY,$e=Ye.guideRectWidth,Xe=Ye.guideRectHeight,Ke=Ye.imageUrl,Je=te[de.requestedDocumentType],et=qe[de.requestedDocumentType];t.useEffect((function(){if(!R&&"requestingFlip"===de.captureState){var e=setTimeout((function(){Oe(),fe({type:"flipRequestCompleted"})}),6e3);return function(){clearTimeout(e)}}}),[fe,Oe,R,de.captureState]),t.useEffect((function(){return"idCardFront"===de.requestedDocumentType&&Ae("idCardOrPassport"===A?["idCardFront","passport"]:"idCardFront"),"idCardBack"===de.requestedDocumentType&&Ae("idCardBack"),"passport"===de.requestedDocumentType&&Ae("passport"),function(){Ae("none")}}),[A,Ae,de.requestedDocumentType]);var tt=t.useCallback((function(e){return h(void 0,void 0,void 0,(function(){var t;return m(this,(function(n){switch(n.label){case 0:return[4,w(e)];case 1:return t=n.sent(),fe({type:"documentCapturedManually",payload:{imageData:t}}),[2]}}))}))}),[fe]);return X||Le?t.createElement(hv,{idCaptureRequirement:A,onFinished:Ue,onCapture:tt,classNames:re.fallback,colors:ie.fallback,verbiage:se.fallback,silentFallback:Q}):t.createElement(O,{className:"flex ".concat(null!==(n=null==re?void 0:re.container)&&void 0!==n?n:"")},"complete"!==de.captureState&&t.createElement(zm,{$x:Ze,$y:Qe,$w:$e,$h:Xe,$mode:"fit"===V?"snapToGuides":"fullscreen"},t.createElement(Um,{className:null==re?void 0:re.cameraFeed})),ye&&"capturing"===de.captureState&&t.createElement(gh,{requiredDocumentType:de.requestedDocumentType,thresholds:P,onCapture:Pe,assets:Je,classNames:null==re?void 0:re.capture,colors:ie,verbiage:et,debugMode:ce}),t.createElement(xg,{guideType:V,portraitGuidesOnMobile:q,requestingFlip:"requestingFlip"===de.captureState,flipIdPromptAssets:null==te?void 0:te.flipIdPrompt,classNames:re,assets:Je,colors:ie,verbiage:et,isBackToFront:de.allowIdCardBackToFrontCapture&&"idCardBack"in de.capturedDocuments}),!(null===(i=null===(r=He.idCapture)||void 0===r?void 0:r.capturePreview)||void 0===i?void 0:i.disabled)&&"requestingFlip"===de.captureState&&!R&&Ke&&t.createElement(Rg,{classNames:null===(a=re.capture)||void 0===a?void 0:a.imagePreview,text:null===(s=null==qe?void 0:qe.idCardFront)||void 0===s?void 0:s.processingIdCardText,imageUrl:Ke}),"complete"!==de.captureState&&t.createElement("div",{id:"idmission-above-guides-content"}),t.createElement(kh,{onClick:We,className:null===(u=re.capture)||void 0===u?void 0:u.exitCaptureBtn}),!ye&&t.createElement(Mm,{key:Ge,mode:I,instructions:j,assets:te.loadingOverlay,classNames:re.loadingOverlay,colors:ie.loadingOverlay,verbiage:se.loadingOverlay,onUserCancel:M,onDismissed:function(){be(!0)},rotateImage:Y&&q&&window.innerWidth<window.innerHeight}),"requestingFlip"===de.captureState&&R&&t.createElement(Sm,{capturedDocuments:de.capturedDocuments,classNames:re.success,onSubmitClick:function(){fe({type:"flipRequestCompleted"})},onRetryClick:Be,colors:ie.success,verbiage:se.success}),"complete"===de.captureState&&je&&t.createElement(Sm,{capturedDocuments:de.capturedDocuments,classNames:re.success,onSubmitClick:Ue,onRetryClick:Be,colors:ie.success,verbiage:se.success,debugMode:ce}))},wv=o.div(fv||(fv=v(["\n position: absolute;\n z-index: 1000;\n width: 100%;\n height: 100%;\n display: flex;\n"],["\n position: absolute;\n z-index: 1000;\n width: 100%;\n height: 100%;\n display: flex;\n"]))),Ev=o.div(pv||(pv=v(["\n border-width: ","px;\n border-color: ",";\n border-style: solid;\n border-radius: 50%;\n aspect-ratio: 1 / 1.618;\n height: 50%;\n margin: auto;\n"],["\n border-width: ","px;\n border-color: ",";\n border-style: solid;\n border-radius: 50%;\n aspect-ratio: 1 / 1.618;\n height: 50%;\n margin: auto;\n"])),(function(e){return e.$borderWidth}),(function(e){var t,n,r,o;return null!==(o=null!==(t=e.$borderColor)&&void 0!==t?t:null===(r=null===(n=e.theme.selfieCapture)||void 0===n?void 0:n.guides)||void 0===r?void 0:r["".concat(e.$variant,"Color")])&&void 0!==o?o:"white"})),kv=function(e){var n=e.classNames,r=void 0===n?{}:n,o=e.variant,i=e.borderWidth;return t.createElement(wv,{className:r.container},t.createElement(Ev,{className:r.oval,$variant:void 0===o?"unsatisfied":o,$borderWidth:void 0===i?3:i,$borderColor:e.borderColor}))},Dv=t.createContext({start:function(){return null},stop:function(){return null},onPredictionMade:function(){return null},canvasRef:{current:null},ready:!1,error:null,modelDownloadProgress:0});function Mv(e){var n=this,r=e.autoStart,o=void 0===r||r,i=e.children,a=e.throttleMs,s=e.onModelError,c=e.modelLoadTimeoutMs,l=void 0===c?Gd:c,d=t.useContext(nt),p=d.videoRef,g=d.videoLoaded,v=d.cameraReady,y=t.useRef(null),b=t.useRef(),x=function(e){var n=e.onModelError,r=e.modelLoadTimeoutMs,o=void 0===r?Gd:r,i=t.useRef(null),a=t.useState(!1),s=a[0],u=a[1],c=t.useState(0),l=c[0],d=c[1],f=t.useState(null),p=f[0],g=f[1],v=t.useContext(nt).videoRef;return t.useEffect((function(){var e=this;u(!1);var t=setTimeout((function(){g(new Error("Model loading time limit exceeded."))}),o);function n(e){d(ef(e.detail))}return document.addEventListener("idmission.preloadProgress.faceDetection",n),Vd().then((function(n){return h(e,void 0,void 0,(function(){return m(this,(function(e){switch(e.label){case 0:return i.current=n,d(100),clearTimeout(t),[4,Rd(v)];case 1:return e.sent(),n.detectForVideo(v.current,performance.now()),u(!0),[2]}}))}))})).catch((function(e){g(e)})).finally((function(){clearTimeout(t)})),function(){clearTimeout(t),document.removeEventListener("idmission.preloadProgress.faceDetection",n)}}),[o,v]),t.useEffect((function(){p&&(null==n||n(p))}),[p,n]),{detector:i,ready:s,modelDownloadProgress:l,modelError:p}}({onModelError:s,modelLoadTimeoutMs:l}),C=x.detector,w=x.ready,E=x.modelDownloadProgress,k=x.modelError,D=df(t.useCallback((function(){return h(n,void 0,void 0,(function(){var e,t,n,r,o;return m(this,(function(i){if(!g||!v||!w||k||!p.current||!C.current||!y.current)return[2];if(e=p.current.videoWidth,t=p.current.videoHeight,n=y.current.getContext("2d"),y.current.width=e,y.current.height=t,n&&4===p.current.readyState){n.translate(e,0),n.scale(-1,1),n.drawImage(p.current,0,0,e,t);try{r=function(e,t){var n=e.detectForVideo(t,performance.now()),r=n.detections.map((function(e){return{box:Od(e.boundingBox),keypoints:e.keypoints.map((function(e){var n;return f(f({},e),{x:e.x*t.width,y:e.y*t.height,name:null!==(n=e.label)&&void 0!==n?n:""})}))}}));return f(f({},n),{faces:r})}(C.current,y.current).faces,null===(o=b.current)||void 0===o||o.call(b,r)}catch(e){Fe("caught face detection error",e)}}return[2]}))}))}),[v,C,k,w,g,p]),{throttleMs:a,autoStart:o}),M=D.start,T=D.stop,I=t.useCallback((function(e){b.current=e}),[]),S=t.useMemo((function(){return{start:M,stop:T,ready:w,canvasRef:y,onPredictionMade:I,error:k,modelDownloadProgress:E}}),[k,E,I,w,M,T]);return u.createElement(Dv.Provider,{value:S},u.createElement(Ve,{ref:y}),i)}var Tv,Iv,Sv,Nv,Av,Lv,Ov,Rv,Fv,Pv,Uv,_v,jv,Bv=function(e,n,r,o,i){void 0===i&&(i=!0);var a=t.useState(!1),s=a[0],u=a[1],c=t.useState(),l=c[0],d=c[1];return t.useEffect((function(){if(e&&i){d(new Date);var t=setTimeout((function(){u(!0)}),e);return function(){t&&clearTimeout(t)}}}),[e,i]),t.useEffect((function(){if(s&&!r){if(o){var e=setTimeout((function(){null==n||n()}),12e4);return function(){clearTimeout(e)}}null==n||n()}}),[n,o,s,r]),{timedOut:s,timeoutStartedAt:l}},zv=function(e){var n=e.onFinished,r=e.onCapture,o=e.classNames,i=void 0===o?{}:o,a=e.colors,s=void 0===a?{}:a,u=e.verbiage,c=void 0===u?{}:u,l=e.silentFallback,d=void 0!==l&&l,f=e.invalidSelfie,p=void 0!==f&&f,h=e.guidanceMessage,m=void 0===h?void 0:h,g=t.useState(null),v=g[0],y=g[1],b=t.useRef(null),x=t.useRef(null),C=t.useState(!1),w=C[0],E=C[1],k=t.useState(!1),D=k[0],M=k[1],T=ov(),I=T.fileInputOnChange,S=iv({rawFile:T.rawFile}).resizedImageFile;t.useEffect((function(){S&&S!==b.current&&(b.current=S,y(S),E(!0),null==r||r(S),null==n||n(S))}),[S,r,n,w]);var N=rh(c,{headingText:"We're having some trouble.",descriptionText:d?"Use your device camera to capture your face":"On-device capture guidance failed, please capture a selfie manually.",captureBtnText:"Capture",doneBtnText:"Done",doneBtnLoadingText:"Verifying...",livenessFailedText:"Live face not detected, please try again",livenessFailedReasonText:m,retryButtonText:"Retry",retryCaptureButtonText:"Retry capture"});return t.useEffect((function(){var e;return d&&(e=setTimeout((function(){var e;gf()?null===(e=x.current)||void 0===e||e.click():M(!0)}),250)),function(){clearTimeout(e)}}),[d]),D||d&&p&&!v&&!gf()?t.createElement(rv,{documents:[{title:p?N.livenessFailedText:N.descriptionText}],onDocumentCaptured:function(e){var t=e.contentUrl;null==r||r(t),setTimeout((function(){y(t),M(!1)}),0)}}):t.createElement(t.Fragment,null,t.createElement("input",{ref:x,type:"file",accept:"image/*",capture:"user",onChange:function(e){var t;(null===(t=e.target.files)||void 0===t?void 0:t[0])&&(y("LOADING"),I(e))},hidden:!0}),t.createElement(_,{className:i.container},t.createElement(Gv,{className:i.inner},d?p&&t.createElement(t.Fragment,null,t.createElement(Vv,{className:i.heading},N.livenessFailedText),t.createElement(Wv,{className:i.description},N.livenessFailedReasonText||N.descriptionText)):t.createElement(t.Fragment,null,t.createElement(Vv,{className:i.heading},p?N.livenessFailedText:N.headingText),t.createElement(Wv,{className:i.description},N.livenessFailedReasonText||N.descriptionText)),v&&"LOADING"!==v&&t.createElement(qv,{className:i.imageContainer},t.createElement("img",{src:v,alt:"",className:i.image})),t.createElement(Hv,{className:i.buttonsRow},v&&!w&&!gf()&&t.createElement(le,{className:i.retryCaptureBtn,finished:!0,variant:"warning",onClick:function(){var e;gf()?null===(e=x.current)||void 0===e||e.click():M(!0)}},N.retryCaptureButtonText),t.createElement(le,{variant:"positive",key:w?"loading-btn":"ready-btn",className:v?null==i?void 0:i.doneBtn:i.captureBtn,colors:v?null==s?void 0:s.doneBtn:s.captureBtn,finished:!v||!w,onClick:function(){var e;gf()?null===(e=x.current)||void 0===e||e.click():v?(E(!0),null==n||n(v)):M(!0)}},v?w?N.doneBtnLoadingText:N.doneBtnText:p?N.retryButtonText:N.captureBtnText)))))},Gv=o(j)(Tv||(Tv=v(["\n justify-content: center;\n"],["\n justify-content: center;\n"]))),Vv=o.h3(Iv||(Iv=v(["\n margin-bottom: 8px;\n"],["\n margin-bottom: 8px;\n"]))),Wv=o.p(Sv||(Sv=v(["\n margin-bottom: 8px;\n"],["\n margin-bottom: 8px;\n"]))),qv=o(B)(Nv||(Nv=v(["\n margin-top: 32px;\n"],["\n margin-top: 32px;\n"]))),Hv=o(Dh)(Av||(Av=v(["\n margin-top: 32px;\n"],["\n margin-top: 32px;\n"]))),Yv={videoWidth:0,videoHeight:0,frame:null,faces:[],faceNotCentered:!1,faceLookingAway:!1,faceTooClose:!1,faceTooFar:!1,faceReady:!1,faceReadyAt:null},Zv=function(e,t){switch(t.type){case"configure":return f(f({},e),t.payload);case"facesDetected":var n=t.payload.faces,r=n[0],o=!0,i=!1,a=!1,s=!1,u=e.faceReadyAt;if(r){var c=e.videoHeight/2,l=(r.box.xMin+r.box.xMax)/2,d=(r.box.yMin+r.box.yMax)/2,p=.125*e.videoWidth,h=.125*e.videoHeight,m=.2*r.box.width,g=.2*r.box.height,v=r.keypoints[2];v&&(o=Math.abs(e.videoWidth/2-l)>p||Math.abs(c+50-d)>h,i=Math.abs(l-v.x)>m||Math.abs(d-v.y)>g);var y=e.videoWidth<e.videoHeight;a=r.box.width>e.videoWidth/(y?2:4.5),s=r.box.width<e.videoWidth/(y?6:7)}var b=!(o||i||a||s);return b?e.faceReady||(u=new Date):u=null,f(f({},e),{faces:n,faceNotCentered:o,faceLookingAway:i,faceTooClose:a,faceTooFar:s,faceReady:b,faceReadyAt:u})}},Qv=function(e){var n,r=e.onGuidanceSatisfied,o=e.onGuidanceNotSatisfied,i=e.onSelfieCaptured,a=e.onTimeout,s=e.onExit,u=e.timeoutDurationMs,c=void 0===u?15e3:u,l=e.guidanceMessage,d=e.guidanceSatisfied,f=e.classNames,p=void 0===f?{}:f,h=e.colors,m=void 0===h?{}:h,g=e.verbiage,v=void 0===g?{}:g,y=e.debugMode,b=void 0!==y&&y,x=ze(),C=x.ref,w=x.width,E=void 0===w?1:w,k=x.height,D=void 0===k?1:k,M=t.useReducer(Zv,Yv),T=M[0],I=M[1],S=t.useRef(null),N=t.useContext(nt),A=N.cameraRef,L=N.cameraReady,R=N.videoRef,F=t.useContext(Dv),P=F.onPredictionMade,U=F.error;t.useEffect((function(){L&&R.current&&0!==R.current.videoWidth&&I({type:"configure",payload:{videoWidth:R.current.videoWidth,videoHeight:R.current.videoHeight}})}),[L,R]),P(function(e,t){var n={},r=n.leading,o=n.trailing;return wf(e,t,{maxWait:t,leading:void 0===r||r,trailing:void 0===o||o})}((function(e){I({type:"facesDetected",payload:{faces:e}})}),16));var _=t.useState(!1),j=_[0],B=_[1];t.useEffect((function(){var e;return T.faceReady?(null==r||r(),e=setTimeout((function(){B(!0)}),1e3)):null==o||o(),function(){e&&clearTimeout(e)}}),[o,r,T.faceReady]),t.useEffect((function(){if(j&&R.current&&S.current&&T.faces.length>0){We(S.current,R.current);var e=S.current.getContext("2d");if(!e)return;var t=e.getImageData(0,0,R.current.videoWidth,R.current.videoHeight);null==i||i(t,T.faces[0]),qe(S.current)}}),[j,i,T.faces,R]);var z=Bv(c,a),G=z.timedOut,V=z.timeoutStartedAt,W=Uf({enabled:b,pageWidth:E,pageHeight:D,videoWidth:T.videoWidth,videoHeight:T.videoHeight});m.guidesUnsatisfiedColor||(m.guidesUnsatisfiedColor="white"),m.guidesSatisfiedColor||(m.guidesSatisfiedColor="green");var q=rh(v,{guidanceHoldStillText:"Hold still for a few seconds...",guidanceLookStraightText:"Look straight into the camera...",guidanceMoveBackText:"Move back...",guidanceMoveForwardText:"Move forward...",guidanceMoveToCenterText:"Move to the center..."}),H=T.faceReady;return"boolean"==typeof d&&(H=d),l||(l=H?q.guidanceHoldStillText:T.faceLookingAway?q.guidanceLookStraightText:T.faceTooClose?q.guidanceMoveBackText:T.faceTooFar?q.guidanceMoveForwardText:T.faceNotCentered?q.guidanceMoveToCenterText:""),U?t.createElement(zv,{classNames:p.fallback}):t.createElement(O,{ref:C,className:"flex ".concat(null!==(n=p.container)&&void 0!==n?n:"")},t.createElement(Ve,{ref:S}),t.createElement(kv,{classNames:p.guides,variant:H?"satisfied":"unsatisfied"}),""!==l&&t.createElement(ph,{className:p.guidanceMessageContainer},t.createElement(hh,{$variant:H?"positive":"negative",className:p.guidanceMessage},l)),b&&T.faces.length>0&&t.createElement(Rf,null,T.faces.map((function(e,n){return t.createElement(Wf,{key:n,face:e,scaling:W,color:H?"green":"red"})}))),b&&t.createElement(Lf,null,A.current?t.createElement(t.Fragment,null,"✅ Camera: ",A.current.label," (",A.current.width,"x",A.current.height,")"):"❌ Camera not ready",t.createElement("br",null),T.faceNotCentered?"❌":"✅"," Face Centered",t.createElement("br",null),T.faceTooClose||T.faceTooFar?"❌":"✅"," Face"," ",T.faceTooClose?"Too Close":T.faceTooFar?"Too Far":"Distance Correct",t.createElement("br",null),T.faceLookingAway?"❌":"✅"," Face Looking Forward",t.createElement("br",null),G?"❌":"✅"," Time Remaining:"," ",Math.max(0,c-((new Date).getTime()-(null!=V?V:new Date).getTime())),"ms"),t.createElement(kh,{onClick:s,className:p.exitCaptureBtn}))},$v={frame:null,face:null,requestState:"CAPTURING",requestError:null,imageUrl:null,faceLive:!1,eyeCoveringDetected:!1,maskDetected:!1,headCoveringDetected:!1,phoneDetected:!1,timesLivenessCheckFailed:0},Xv=function(e,t){var n,r;switch(t.type){case"livenessReady":return["CAPTURING","FAILED","ERROR"].includes(e.requestState)?f(f({},e),{requestState:"CAPTURED",frame:t.payload.frame,face:t.payload.face}):e;case"livenessChecking":return f(f({},e),{requestState:"IN_PROGRESS"});case"livenessChecked":var o=t.payload.response,i=o.status,a=i.statusMessage,s=i.errorData,u=o.resultData;if("000"!==i.statusCode)return f(f({},e),{requestState:"ERROR",requestError:new Error("".concat(a,": ").concat(s))});var c=["Live Face Detected","Approved"].includes(u.verificationResult),l="true"===u.eyeCovering,d="true"===u.faceMask,p="true"===u.headCovering,h="true"===u.cellPhone,m=c&&!l&&!d&&!p,g=m?"PASSED":"FAILED",v=e.timesLivenessCheckFailed;return m?v=0:v+=1,f(f({},e),{frame:null!==(n=t.payload.frame)&&void 0!==n?n:null,face:null!==(r=t.payload.face)&&void 0!==r?r:null,imageUrl:t.payload.imageUrl,requestState:g,faceLive:c,eyeCoveringDetected:l,maskDetected:d,headCoveringDetected:p,phoneDetected:h,timesLivenessCheckFailed:v});case"livenessCheckFailed":return f(f({},e),{requestState:"ERROR",requestError:t.payload.error});default:return e}},Kv=function(e){var n,r,i,a=e.onCapture,s=e.onSuccess,u=e.onTimeout,c=e.onExit,l=e.timeoutDurationMs,d=void 0===l?15e3:l,f=e.silentFallback,p=void 0!==f&&f,g=e.classNames,v=void 0===g?{}:g,y=e.colors,b=void 0===y?{}:y,x=e.verbiage,C=void 0===x?{}:x,E=e.debugMode,k=t.useContext(_e),D=k.checkLiveness,M=k.submissionError,T=t.useContext(Dv).error,I=t.useReducer(Xv,$v),S=I[0],N=I[1],A=t.useState(null),L=A[0],O=A[1],R=t.useRef(null),F=t.useRef(null),P=t.useRef(null),U=o.useTheme(),_=t.useCallback((function(e,t){null==a||a(),N({type:"livenessReady",payload:{frame:e,face:t}})}),[a]),j=S.frame,B=S.face,z="CAPTURED"===S.requestState,G="PASSED"===S.requestState;t.useEffect((function(){var e=this;j&&B&&z&&!M&&(N({type:"livenessChecking"}),h(e,void 0,void 0,(function(){var e,t,n,r;return m(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),e=kd(R.current,F.current,P.current,j,B,.92,600),O(e),n=D,[4,w(e)];case 1:return[4,n.apply(void 0,[o.sent()])];case 2:return t=o.sent(),N({type:"livenessChecked",payload:{frame:j,face:B,imageUrl:e,response:t}}),[3,4];case 3:return r=o.sent(),N({type:"livenessCheckFailed",payload:{error:r}}),[3,4];case 4:return[2]}}))})))}),[D,B,j,z,M]);var V=t.useCallback((function(e){return h(void 0,void 0,void 0,(function(){var t,n,r,o;return m(this,(function(i){switch(i.label){case 0:N({type:"livenessChecking"}),i.label=1;case 1:return i.trys.push([1,4,,5]),[4,w(e)];case 2:return t=i.sent(),[4,D(t)];case 3:return n=i.sent(),"Live Face Detected"!==(null===(o=null==n?void 0:n.resultData)||void 0===o?void 0:o.verificationResult)&&(null==u||u()),N({type:"livenessChecked",payload:{imageUrl:e,response:n}}),[3,5];case 4:return r=i.sent(),N({type:"livenessCheckFailed",payload:{error:r}}),[3,5];case 5:return[2]}}))}))}),[D,u]);t.useEffect((function(){G&&S.imageUrl&&(null==s||s(S.imageUrl))}),[s,S.imageUrl,G]),t.useEffect((function(){if(!T){S.timesLivenessCheckFailed>=2&&(null==u||u())}}),[T,u,S.timesLivenessCheckFailed]),Bv(d,u,"PASSED"===S.requestState||!!T,"IN_PROGRESS"===S.requestState);var W=rh(C,{guidanceRemoveEyeCoveringsText:"Please remove your eye coverings (sunglasses, eye patch, etc.)...",guidanceRemoveHeadCoveringsText:"Please remove your head coverings (hat, scarf, etc.)...",guidanceRemoveMaskText:"Please remove your mask...",progressPreviewText:"Processing..."}),q=S.eyeCoveringDetected?W.guidanceRemoveEyeCoveringsText:S.headCoveringDetected?W.guidanceRemoveHeadCoveringsText:S.maskDetected?W.guidanceRemoveMaskText:void 0;return T?t.createElement(zv,{key:S.timesLivenessCheckFailed,onFinished:V,silentFallback:p,invalidSelfie:!!S.timesLivenessCheckFailed,guidanceMessage:q}):t.createElement(t.Fragment,null,t.createElement(Ve,{ref:R}),t.createElement(Ve,{ref:F}),t.createElement(Ve,{ref:P}),t.createElement(Qv,{onSelfieCaptured:_,onExit:c,timeoutDurationMs:d,guidanceMessage:q,guidanceSatisfied:!q&&void 0,classNames:v,colors:b,verbiage:W,debugMode:E}),!(null===(r=null===(n=U.selfieCapture)||void 0===n?void 0:n.capturePreview)||void 0===r?void 0:r.disabled)&&L&&t.createElement(Fg,{classNames:v.imagePreview,imageUrl:L,text:null!==(i=W.progressPreviewText)&&void 0!==i?i:""}))},Jv=function(e){var n=e.imageUrl,r=e.onDoneClick,o=e.onRetryClick,i=e.classNames,a=void 0===i?{}:i,s=e.colors,u=void 0===s?{}:s,c=e.verbiage,l=rh(void 0===c?{}:c,{headingText:"Face liveness has been verified!",retryBtnText:"Retry",doneBtnText:"Done"});return t.createElement(_,{className:a.container},t.createElement(j,{className:a.inner},t.createElement(ey,{className:a.heading},l.headingText),t.createElement(B,{className:a.imageContainer},t.createElement("img",{alt:l.headingText,src:n,className:a.image})),t.createElement(Dh,{className:a.buttonsRow},t.createElement(le,{variant:"warning",onClick:o,colors:u.retryBtn,className:a.retryBtn,finished:!0},l.retryBtnText),t.createElement(le,{variant:"positive",onClick:r,colors:u.doneBtn,className:a.doneBtn,finished:!0},l.doneBtnText))))},ey=o.h3(Lv||(Lv=v(["\n margin-bottom: 24px;\n"],["\n margin-bottom: 24px;\n"]))),ty=function(e){var n=e.canRetry,r=void 0===n||n,o=e.onRetryClick,i=e.onExitClick,a=e.assets,s=void 0===a?{}:a,u=e.classNames,c=void 0===u?{}:u,l=e.colors,d=void 0===l?{}:l,f=e.verbiage,p=void 0===f?{}:f;s.imageUrl||(s.imageUrl="".concat(mh,"/manual_capture.png"));var h=rh(p,{headingText:"Live face not detected, please try again",retryBtnText:"Retry",exitBtnText:"Exit"});return t.createElement(_,{className:c.container},t.createElement(j,{className:c.inner},t.createElement("h3",{className:c.heading},h.headingText),t.createElement(ny,{className:c.imageContainer},t.createElement("img",{alt:h.headingText,src:s.imageUrl,className:c.image})),t.createElement(Dh,{className:c.buttonsRow},r&&t.createElement(le,{variant:"warning",className:c.retryBtn,onClick:o,colors:d.retryBtn,finished:!0},h.retryBtnText),t.createElement(le,{variant:"secondary",className:c.exitBtn,onClick:i,colors:d.exitBtn,finished:!0},h.exitBtnText))))},ny=o(B)(Ov||(Ov=v(["\n max-height: calc(100vh - 185px);\n margin: 0 24px;\n"],["\n max-height: calc(100vh - 185px);\n margin: 0 24px;\n"]))),ry=function(e){var n,r=e.assets,o=void 0===r?{}:r,i=e.classNames,a=void 0===i?{}:i,s=e.colors,u=void 0===s?{}:s,c=e.verbiage,l=void 0===c?{}:c,d=t.useContext(nt).requestMicrophoneAccess;o.imageUrl||(o.imageUrl=mh+"/microphone-disable-icon.svg");var f=rh(l,{headingText:"Your microphone permission is disabled",descriptionText:"This application requires access to your microphone to continue. Please accept the permission once prompted by the browser. If the browser does not prompt for microphone permissions, you must go to settings and provide microphone access to the current browser.",retryBtnText:"Retry"});return t.createElement(_,{className:"flex ".concat(null!==(n=a.container)&&void 0!==n?n:"")},t.createElement(oy,{className:a.inner},t.createElement(iy,{className:a.imageContainer},t.createElement("img",{src:o.imageUrl,alt:"",className:a.image})),t.createElement("h3",{className:a.heading},f.headingText),t.createElement(ay,{className:a.description},f.descriptionText),t.createElement(sy,{variant:"warning",onClick:d,colors:u.retryBtn,className:a.retryBtn,finished:!0},f.retryBtnText)))},oy=o(j)(Rv||(Rv=v(["\n max-width: 500px;\n height: auto;\n margin: auto;\n"],["\n max-width: 500px;\n height: auto;\n margin: auto;\n"]))),iy=o(B)(Fv||(Fv=v(["\n flex-grow: 0;\n"],["\n flex-grow: 0;\n"]))),ay=o.p(Pv||(Pv=v(["\n line-height: 1.5;\n margin-bottom: 50px;\n"],["\n line-height: 1.5;\n margin-bottom: 50px;\n"]))),sy=o(le)(Uv||(Uv=v(["\n width: 200px;\n margin: 0 auto;\n"],["\n width: 200px;\n margin: 0 auto;\n"]))),uy=o(hh)(_v||(_v=v(["\n padding: 12px 24px;\n font-weight: normal;\n line-height: 1.5;\n margin-bottom: -30px;\n"],["\n padding: 12px 24px;\n font-weight: normal;\n line-height: 1.5;\n margin-bottom: -30px;\n"]))),cy=o(Dh)(jv||(jv=v(["\n flex-direction: column;\n padding-top: 25px;\n"],["\n flex-direction: column;\n padding-top: 25px;\n"])));function ly(e){var n,r,i,a=e.width,s=void 0===a?840:a,u=e.height,c=void 0===u?740:u,l=e.className,d=t.useState(1),f=d[0],p=d[1];t.useEffect((function(){var e=setInterval((function(){p((function(e){return(e+1)%10}))}),750);return function(){clearInterval(e)}}),[]);var h=null!==(i=null===(r=null===(n=o.useTheme().selfieCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.loadingGraphicAccentColor)&&void 0!==i?i:"var(--idm-color-positive-600)";return t.createElement("svg",{width:s,height:c,className:l,viewBox:"0 0 840 740",fill:"none",preserveAspectRatio:"xMidYMax slice",xmlns:"http://www.w3.org/2000/svg"},t.createElement("g",{clipPath:"url(#clip0_428_1188)"},t.createElement("mask",{id:"mask0_428_1188",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"840",height:"740"},t.createElement("rect",{width:"840",height:"740",fill:"#D9D9D9"})),t.createElement("g",{mask:"url(#mask0_428_1188)"},t.createElement("path",{d:"M503.781 449.497C491.561 503.154 458.442 541.609 419.561 541.609C380.68 541.609 347.492 503.015 335.272 449.358L344.645 412.916L347.492 402.019H491.561L502.253 443.667L503.225 447.415L503.781 449.497Z",fill:"#D2D4DA"}),t.createElement("path",{d:"M574.88 244.97C647.073 163.885 598.921 362.155 558.945 338.928C488.709 298.211 574.88 244.97 574.88 244.97Z",fill:"#F7A69C"}),t.createElement("path",{d:"M816.983 742.838C779.698 781.432 736.86 814.612 689.786 841.127C617.161 882.012 534.399 906.862 446.153 911.027C437.335 911.513 428.448 911.721 419.491 911.721C374.986 911.721 331.731 906.446 290.281 896.519C232.514 882.706 178.358 859.8 129.271 829.397C89.9033 805.033 53.9382 775.948 22 742.838L31.512 705.355C45.8842 649.061 90.2505 605.33 146.837 591.795L153.085 590.337L222.447 573.747L241.401 569.235C249.386 567.292 257.023 564.585 264.244 561.114C270.285 558.199 276.047 554.797 281.463 550.91C287.295 546.745 292.78 542.025 297.71 536.819C310.971 522.867 320.761 505.653 325.76 486.286L333.119 457.688L335.064 449.983L335.202 449.358L344.645 412.916L347.422 402.019H491.491L502.253 443.667L503.225 447.415L503.78 449.497V449.983L505.863 457.757L513.223 486.286C520.097 512.802 535.996 535.5 557.589 550.91C569.393 559.448 582.932 565.765 597.581 569.235L615.078 573.4L692.146 591.795C748.732 605.33 793.099 649.061 807.471 705.355L816.983 742.838Z",fill:"#F7A69C"}),t.createElement("path",{d:"M503.781 449.497C491.561 503.154 458.442 541.609 419.561 541.609C380.68 541.609 347.492 503.015 335.272 449.358L344.645 412.916L347.492 402.019H491.561L502.253 443.667L503.225 447.415L503.781 449.497Z",fill:"#DC968D"}),t.createElement("path",{d:"M264.123 244.97C191.93 163.885 240.082 362.155 280.058 338.928C350.294 298.211 264.123 244.97 264.123 244.97Z",fill:"#F7A69C"}),t.createElement("path",{d:"M586.473 187.324C586.473 193.432 586.126 199.402 585.432 205.371C584.876 210.785 582.446 233.9 578.141 263.331C575.781 279.713 572.726 297.969 569.115 316.294C569.115 316.502 569.115 316.78 568.976 316.988C560.159 361.621 547.731 406.045 531.484 422.219C513.154 440.544 498.435 457.203 481.632 469.211C464.83 481.289 446.014 488.786 419.631 488.786C393.247 488.786 374.431 481.289 357.629 469.211C340.896 457.203 326.107 440.544 307.778 422.219C291.531 405.976 279.103 361.482 270.216 316.918C270.216 316.918 270.216 316.71 270.216 316.641C269.105 310.879 268.063 305.118 267.022 299.426C266.605 297.066 266.189 294.706 265.772 292.346C264.036 282.351 262.509 272.563 261.12 263.401C256.121 229.596 253.691 204.122 253.691 204.122C253.136 198.638 252.858 193.016 252.858 187.324C252.858 185.866 252.858 184.408 252.858 182.951C253.205 169.832 255.01 157.06 258.274 144.843C258.412 144.287 258.551 143.732 258.69 143.177C277.228 75.4294 337.425 24.8271 410.049 20.8011C413.243 20.5928 416.368 20.5234 419.631 20.5234C465.733 20.5234 507.461 39.1956 537.663 69.3904C563.769 95.4205 581.266 130.127 585.501 168.79C586.195 174.899 586.542 181.077 586.542 187.324H586.473Z",fill:"#FEAEA5"}),t.createElement("path",{d:"M445.867 337.327C445.867 348.849 434.133 358.151 419.622 358.151C405.111 358.151 393.447 348.849 393.447 337.327C393.447 335.939 393.586 334.55 394.002 333.301C396.293 342.88 406.916 350.099 419.622 350.099C432.328 350.099 443.02 342.88 445.312 333.301C445.728 334.62 445.867 335.939 445.867 337.327Z",fill:"#F7A69C"}),t.createElement("path",{d:"M817.053 743.187C716.586 847.238 575.642 912 419.561 912C263.481 912 122.467 847.238 22.0698 743.118L31.5818 705.704C45.954 649.34 90.3203 605.61 146.906 592.074L222.655 574.027L241.471 569.515C249.942 567.502 258.135 564.517 265.772 560.699C304.237 601.653 358.879 627.267 419.561 627.267C480.244 627.267 534.886 601.653 573.351 560.699C580.988 564.448 589.111 567.502 597.651 569.515L614.106 573.471L692.216 592.074C748.802 605.61 793.168 649.34 807.471 705.704L817.053 743.187Z",fill:"#6E7174"}),t.createElement("path",{d:"M614.106 573.471C597.165 594.018 534.886 659.058 419.561 663.639C286.671 668.984 226.266 579.441 222.655 574.027L241.471 569.515C249.942 567.502 258.134 564.517 265.772 560.699C304.236 601.653 358.879 627.267 419.561 627.267C480.244 627.267 534.886 601.653 573.35 560.699C580.988 564.448 589.111 567.502 597.651 569.515L614.106 573.471Z",fill:"#555A5E"}),t.createElement("path",{d:"M249.898 196.144C249.898 249.777 270.317 315.623 270.317 315.623C270.317 315.623 266.862 205.572 314.892 164.108C347.514 135.946 374.019 167.565 417.115 167.565C456.137 167.565 492.558 136.481 525.436 164.108C578.852 208.994 568.738 315.623 568.738 315.623C568.738 315.623 589.157 250.557 589.157 196.144C589.157 76.4319 542.638 20 417.115 20C302.8 20 249.898 75.8365 249.898 196.144Z",fill:"#525252"})),f>=8?t.createElement(t.Fragment,null,t.createElement("path",{d:"M565.5 295C565.5 350.583 549.016 400.803 522.488 437.067C495.958 473.332 459.517 495.5 419.5 495.5C379.483 495.5 343.042 473.332 316.512 437.067C289.984 400.803 273.5 350.583 273.5 295C273.5 239.417 289.984 189.197 316.512 152.933C343.042 116.668 379.483 94.5 419.5 94.5C459.517 94.5 495.958 116.668 522.488 152.933C549.016 189.197 565.5 239.417 565.5 295Z",stroke:h,strokeWidth:"5"}),t.createElement("circle",{cx:"518.5",cy:"438.5",r:"25.5",fill:h}),t.createElement("path",{d:"M504 440.5L512 448L531 427",stroke:"white",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"})):t.createElement(t.Fragment,null,f>2&&t.createElement(t.Fragment,null,f>3&&t.createElement(t.Fragment,null,f>4&&t.createElement(t.Fragment,null,f>5&&t.createElement(t.Fragment,null,t.createElement("path",{d:"M298.5 182.5L419 164.5L540 182",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("circle",{cx:"419",cy:"165",r:"7",fill:"white"})),t.createElement("path",{d:"M565.5 295C565.5 350.583 549.016 400.803 522.488 437.067C495.958 473.332 459.517 495.5 419.5 495.5C379.483 495.5 343.042 473.332 316.512 437.067C289.984 400.803 273.5 350.583 273.5 295C273.5 239.417 289.984 189.197 316.512 152.933C343.042 116.668 379.483 94.5 419.5 94.5C459.517 94.5 495.958 116.668 522.488 152.933C549.016 189.197 565.5 239.417 565.5 295Z",stroke:"white",strokeOpacity:f>7?.8:f>5?.3:.1,strokeWidth:"5"}),t.createElement("path",{d:"M299.939 262.805L419 478.5L538.5 261.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M298.5 182.5L418.871 230.054L540 182",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M298.5 182.5L299.939 262.805",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M540.001 182L538.501 261.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("circle",{cx:"299.914",cy:"182",r:"7",fill:"white"}),t.createElement("circle",{cx:"540",cy:"182",r:"7",fill:"white"})),t.createElement("path",{d:"M418.828 230L419 342.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:f>4&&f<7?.3:1}),t.createElement("path",{d:"M300 263.001L419 342.501",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:f>4&&f<7?.3:1}),t.createElement("path",{d:"M538.5 261.5L419 342.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:f>4&&f<7?.3:1}),t.createElement("path",{d:"M301.5 409L419 342.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:f>4&&f<7?.3:1}),t.createElement("path",{d:"M536.5 410L419 342.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:f>4&&f<7?.3:1}),t.createElement("path",{d:"M300 263L419 230",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:f>4&&f<7?.3:1}),t.createElement("path",{d:"M538.5 261.5L419 230",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:f>4&&f<7?.3:1}),t.createElement("circle",{cx:"419",cy:"229.971",r:"7",fill:"white"}),t.createElement("circle",{cx:"419",cy:"342.4",r:"7",fill:"white"})),t.createElement("path",{d:"M538.5 261.5L536.5 410",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:f>3&&f<7?.3:1}),t.createElement("path",{d:"M419 478.5L536.5 410",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:f>3&&f<7?.3:1}),t.createElement("circle",{cx:"537",cy:"263",r:"7",fill:"white"}),t.createElement("circle",{cx:"537",cy:"409",r:"7",fill:"white"})),f>1&&t.createElement(t.Fragment,null,t.createElement("path",{d:"M301.501 409L300.001 263",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:f>2&&f<7?.3:1}),t.createElement("path",{d:"M301.501 409L419.001 478.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:f>2&&f<7?.3:1}),t.createElement("circle",{cx:"419",cy:"477.576",r:"7",fill:"white"}),t.createElement("circle",{cx:"301.914",cy:"263",r:"7",fill:"white"}),t.createElement("circle",{cx:"301.444",cy:"409",r:"7",fill:"white"})))),t.createElement("defs",null,t.createElement("clipPath",{id:"clip0_428_1188"},t.createElement("rect",{width:"840",height:"740",fill:"white"}))))}var dy,fy,py,hy,my,gy,vy,yy,by,xy,Cy,wy,Ey,ky,Dy,My="".concat(mh,"/Selfie-Image-1.png"),Ty=o.div(dy||(dy=v(["\n height: 100dvh;\n display: flex;\n flex-direction: column;\n background: ",";\n color: ",";\n"],["\n height: 100dvh;\n display: flex;\n flex-direction: column;\n background: ",";\n color: ",";\n"])),(function(e){var t,n,r,o;return null!==(o=null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.selfieCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.backgroundColor)&&void 0!==o?o:"#ecedf3"}),(function(e){var t,n,r,o;return null!==(o=null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.selfieCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.textColor)&&void 0!==o?o:"black"})),Iy=o.div(fy||(fy=v(["\n text-align: ",";\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n ","\n padding-bottom: 0;\n"],["\n text-align: ",";\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n ","\n padding-bottom: 0;\n"])),(function(e){var t;return null!==(t=e.theme.textAlign)&&void 0!==t?t:"center"}),(function(e){return e.theme.padding?"box-sizing: border-box; padding: ".concat(e.theme.padding,";"):""})),Sy=o(hh)(py||(py=v(["\n padding: 16px 24px;\n margin-top: 16px;\n font-size: 18px;\n font-weight: bold;\n background: white;\n box-shadow:\n 0 1px 3px 0 rgb(0 0 0 / 0.1),\n 0 1px 2px -1px rgb(0 0 0 / 0.1);\n"],["\n padding: 16px 24px;\n margin-top: 16px;\n font-size: 18px;\n font-weight: bold;\n background: white;\n box-shadow:\n 0 1px 3px 0 rgb(0 0 0 / 0.1),\n 0 1px 2px -1px rgb(0 0 0 / 0.1);\n"]))),Ny=o(Dh)(hy||(hy=v(["\n display: flex;\n flex-direction: row;\n padding: 15px 25px;\n height: 100px;\n color: ",";\n ","\n position: fixed;\n bottom: 0;\n left: 0;\n width: 100dvw;\n box-sizing: border-box;\n"],["\n display: flex;\n flex-direction: row;\n padding: 15px 25px;\n height: 100px;\n color: ",";\n ","\n position: fixed;\n bottom: 0;\n left: 0;\n width: 100dvw;\n box-sizing: border-box;\n"])),(function(e){var t,n,r,o;return null!==(o=null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.selfieCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.progressBarTextColor)&&void 0!==o?o:"white"}),(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.selfieCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.progressBarFontSize)?"font-size: ".concat(null===(a=null===(i=null===(o=e.theme)||void 0===o?void 0:o.selfieCapture)||void 0===i?void 0:i.loadingOverlay)||void 0===a?void 0:a.progressBarFontSize,";"):""})),Ay=o(B)(my||(my=v(["\n padding: 0;\n\n & > svg {\n height: 100%;\n }\n"],["\n padding: 0;\n\n & > svg {\n height: 100%;\n }\n"]))),Ly=o.div(gy||(gy=v(["\n display: flex;\n position: relative;\n z-index: 2;\n"],["\n display: flex;\n position: relative;\n z-index: 2;\n"]))),Oy=o.ul(vy||(vy=v(["\n display: block;\n margin: auto;\n list-style: none;\n padding: 0;\n"],["\n display: block;\n margin: auto;\n list-style: none;\n padding: 0;\n"]))),Ry=o.li(yy||(yy=v(["\n display: inline-flex;\n justify-content: center;\n align-items: center;\n padding: 2px 1.25rem 2px 0;\n line-height: 1rem;\n\n &::before {\n content: '';\n display: inline-block;\n height: 1rem;\n min-width: 1rem;\n vertical-align: middle;\n background-size: cover;\n background-repeat: no-repeat;\n margin: auto 0.5rem auto 0;\n }\n\n &.done::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBjbGlwLXBhdGg9InVybCgjY2xpcDBfNDlfMzg1KSI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMiAyNEMxOC42Mjc0IDI0IDI0IDE4LjYyNzQgMjQgMTJDMjQgNS4zNzI1OCAxOC42Mjc0IDAgMTIgMEM1LjM3MjU4IDAgMCA1LjM3MjU4IDAgMTJDMCAxOC42Mjc0IDUuMzcyNTggMjQgMTIgMjRaTTE5LjU2NDMgOC4yNzg1MkMxOS45NTQ5IDcuODg3OTkgMTkuOTU0OSA3LjI1NDgzIDE5LjU2NDMgNi44NjQzQzE5LjE3MzggNi40NzM3OCAxOC41NDA2IDYuNDczNzggMTguMTUwMSA2Ljg2NDNMOS40Mjg2NiAxNS41ODU4TDUuODUwMDUgMTIuMDA3MkM1LjQ1OTUzIDExLjYxNjYgNC44MjYzNiAxMS42MTY2IDQuNDM1ODQgMTIuMDA3MkM0LjA0NTMxIDEyLjM5NzcgNC4wNDUzMSAxMy4wMzA5IDQuNDM1ODQgMTMuNDIxNEw4LjcyMTU1IDE3LjcwNzFDOS4xMTIwOCAxOC4wOTc2IDkuNzQ1MjQgMTguMDk3NiAxMC4xMzU4IDE3LjcwNzFMMTkuNTY0MyA4LjI3ODUyWiIgZmlsbD0id2hpdGUiLz48L2c+PGRlZnM+PGNsaXBQYXRoIGlkPSJjbGlwMF80OV8zODUiPjxyZWN0IHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0id2hpdGUiLz48L2NsaXBQYXRoPjwvZGVmcz48L3N2Zz4=');\n }\n\n &.running::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBjbGlwLXBhdGg9InVybCgjY2xpcDBfNDlfMzcwKSI+PG1hc2sgaWQ9InBhdGgtMS1pbnNpZGUtMV80OV8zNzAiIGZpbGw9IndoaXRlIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTMuNTE0NzIgMjAuNDg1NUM4LjIwMTAxIDI1LjE3MTggMTUuNzk5IDI1LjE3MTggMjAuNDg1MyAyMC40ODU1QzI1LjE3MTYgMTUuNzk5MiAyNS4xNzE2IDguMjAxMTkgMjAuNDg1MyAzLjUxNDlDMTUuNzk5IC0xLjE3MTM5IDguMjAxMDEgLTEuMTcxMzkgMy41MTQ3MiAzLjUxNDlDLTEuMTcxNTcgOC4yMDExOSAtMS4xNzE1NyAxNS43OTkyIDMuNTE0NzIgMjAuNDg1NVoiLz48L21hc2s+PHBhdGggZD0iTTYuMzk4MTQgMTEuNDU5QzUuODQ1ODYgMTEuNDU5IDUuMzk4MTQgMTEuOTA2NyA1LjM5ODE0IDEyLjQ1OUM1LjM5ODE0IDEzLjAxMTIgNS44NDU4NiAxMy40NTkgNi4zOTgxNCAxMy40NTlWMTEuNDU5Wk0xNy42MDE5IDEzLjQ1OUMxOC4xNTQxIDEzLjQ1OSAxOC42MDE5IDEzLjAxMTIgMTguNjAxOSAxMi40NTlDMTguNjAxOSAxMS45MDY3IDE4LjE1NDEgMTEuNDU5IDE3LjYwMTkgMTEuNDU5VjEzLjQ1OVpNNi4zOTgxNCAxMy40NTlIMTcuNjAxOVYxMS40NTlINi4zOTgxNFYxMy40NTlaTTMuNTE0NzIgMjAuNDg1NUw0LjkyODkzIDE5LjA3MTNMNC45Mjg5MyAxOS4wNzEzTDMuNTE0NzIgMjAuNDg1NVpNMjAuNDg1MyAzLjUxNDlMMTkuMDcxMSA0LjkyOTEyTDE5LjA3MTEgNC45MjkxMkwyMC40ODUzIDMuNTE0OVpNMy41MTQ3MiAzLjUxNDlMNC45Mjg5MyA0LjkyOTEyTDQuOTI4OTMgNC45MjkxMkwzLjUxNDcyIDMuNTE0OVpNMTkuMDcxMSAxOS4wNzEzQzE1LjE2NTggMjIuOTc2NSA4LjgzNDE3IDIyLjk3NjUgNC45Mjg5MyAxOS4wNzEzTDIuMTAwNTEgMjEuODk5N0M3LjU2Nzg0IDI3LjM2NyAxNi40MzIyIDI3LjM2NyAyMS44OTk1IDIxLjg5OTdMMTkuMDcxMSAxOS4wNzEzWk0xOS4wNzExIDQuOTI5MTJDMjIuOTc2MyA4LjgzNDM2IDIyLjk3NjMgMTUuMTY2IDE5LjA3MTEgMTkuMDcxM0wyMS44OTk1IDIxLjg5OTdDMjcuMzY2OCAxNi40MzIzIDI3LjM2NjggNy41NjgwMyAyMS44OTk1IDIuMTAwNjlMMTkuMDcxMSA0LjkyOTEyWk00LjkyODkzIDQuOTI5MTJDOC44MzQxNyAxLjAyMzg3IDE1LjE2NTggMS4wMjM4NyAxOS4wNzExIDQuOTI5MTJMMjEuODk5NSAyLjEwMDY5QzE2LjQzMjIgLTMuMzY2NjUgNy41Njc4NCAtMy4zNjY2NSAyLjEwMDUxIDIuMTAwNjlMNC45Mjg5MyA0LjkyOTEyWk00LjkyODkzIDE5LjA3MTNDMS4wMjM2OSAxNS4xNjYgMS4wMjM2OSA4LjgzNDM2IDQuOTI4OTMgNC45MjkxMkwyLjEwMDUxIDIuMTAwNjlDLTMuMzY2ODMgNy41NjgwMyAtMy4zNjY4MyAxNi40MzIzIDIuMTAwNTEgMjEuODk5N0w0LjkyODkzIDE5LjA3MTNaIiBmaWxsPSJ3aGl0ZSIgbWFzaz0idXJsKCNwYXRoLTEtaW5zaWRlLTFfNDlfMzcwKSIvPjwvZz48ZGVmcz48Y2xpcFBhdGggaWQ9ImNsaXAwXzQ5XzM3MCI+PHJlY3Qgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSJ3aGl0ZSIvPjwvY2xpcFBhdGg+PC9kZWZzPjwvc3ZnPg==');\n }\n"],["\n display: inline-flex;\n justify-content: center;\n align-items: center;\n padding: 2px 1.25rem 2px 0;\n line-height: 1rem;\n\n &::before {\n content: '';\n display: inline-block;\n height: 1rem;\n min-width: 1rem;\n vertical-align: middle;\n background-size: cover;\n background-repeat: no-repeat;\n margin: auto 0.5rem auto 0;\n }\n\n &.done::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBjbGlwLXBhdGg9InVybCgjY2xpcDBfNDlfMzg1KSI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMiAyNEMxOC42Mjc0IDI0IDI0IDE4LjYyNzQgMjQgMTJDMjQgNS4zNzI1OCAxOC42Mjc0IDAgMTIgMEM1LjM3MjU4IDAgMCA1LjM3MjU4IDAgMTJDMCAxOC42Mjc0IDUuMzcyNTggMjQgMTIgMjRaTTE5LjU2NDMgOC4yNzg1MkMxOS45NTQ5IDcuODg3OTkgMTkuOTU0OSA3LjI1NDgzIDE5LjU2NDMgNi44NjQzQzE5LjE3MzggNi40NzM3OCAxOC41NDA2IDYuNDczNzggMTguMTUwMSA2Ljg2NDNMOS40Mjg2NiAxNS41ODU4TDUuODUwMDUgMTIuMDA3MkM1LjQ1OTUzIDExLjYxNjYgNC44MjYzNiAxMS42MTY2IDQuNDM1ODQgMTIuMDA3MkM0LjA0NTMxIDEyLjM5NzcgNC4wNDUzMSAxMy4wMzA5IDQuNDM1ODQgMTMuNDIxNEw4LjcyMTU1IDE3LjcwNzFDOS4xMTIwOCAxOC4wOTc2IDkuNzQ1MjQgMTguMDk3NiAxMC4xMzU4IDE3LjcwNzFMMTkuNTY0MyA4LjI3ODUyWiIgZmlsbD0id2hpdGUiLz48L2c+PGRlZnM+PGNsaXBQYXRoIGlkPSJjbGlwMF80OV8zODUiPjxyZWN0IHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0id2hpdGUiLz48L2NsaXBQYXRoPjwvZGVmcz48L3N2Zz4=');\n }\n\n &.running::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBjbGlwLXBhdGg9InVybCgjY2xpcDBfNDlfMzcwKSI+PG1hc2sgaWQ9InBhdGgtMS1pbnNpZGUtMV80OV8zNzAiIGZpbGw9IndoaXRlIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTMuNTE0NzIgMjAuNDg1NUM4LjIwMTAxIDI1LjE3MTggMTUuNzk5IDI1LjE3MTggMjAuNDg1MyAyMC40ODU1QzI1LjE3MTYgMTUuNzk5MiAyNS4xNzE2IDguMjAxMTkgMjAuNDg1MyAzLjUxNDlDMTUuNzk5IC0xLjE3MTM5IDguMjAxMDEgLTEuMTcxMzkgMy41MTQ3MiAzLjUxNDlDLTEuMTcxNTcgOC4yMDExOSAtMS4xNzE1NyAxNS43OTkyIDMuNTE0NzIgMjAuNDg1NVoiLz48L21hc2s+PHBhdGggZD0iTTYuMzk4MTQgMTEuNDU5QzUuODQ1ODYgMTEuNDU5IDUuMzk4MTQgMTEuOTA2NyA1LjM5ODE0IDEyLjQ1OUM1LjM5ODE0IDEzLjAxMTIgNS44NDU4NiAxMy40NTkgNi4zOTgxNCAxMy40NTlWMTEuNDU5Wk0xNy42MDE5IDEzLjQ1OUMxOC4xNTQxIDEzLjQ1OSAxOC42MDE5IDEzLjAxMTIgMTguNjAxOSAxMi40NTlDMTguNjAxOSAxMS45MDY3IDE4LjE1NDEgMTEuNDU5IDE3LjYwMTkgMTEuNDU5VjEzLjQ1OVpNNi4zOTgxNCAxMy40NTlIMTcuNjAxOVYxMS40NTlINi4zOTgxNFYxMy40NTlaTTMuNTE0NzIgMjAuNDg1NUw0LjkyODkzIDE5LjA3MTNMNC45Mjg5MyAxOS4wNzEzTDMuNTE0NzIgMjAuNDg1NVpNMjAuNDg1MyAzLjUxNDlMMTkuMDcxMSA0LjkyOTEyTDE5LjA3MTEgNC45MjkxMkwyMC40ODUzIDMuNTE0OVpNMy41MTQ3MiAzLjUxNDlMNC45Mjg5MyA0LjkyOTEyTDQuOTI4OTMgNC45MjkxMkwzLjUxNDcyIDMuNTE0OVpNMTkuMDcxMSAxOS4wNzEzQzE1LjE2NTggMjIuOTc2NSA4LjgzNDE3IDIyLjk3NjUgNC45Mjg5MyAxOS4wNzEzTDIuMTAwNTEgMjEuODk5N0M3LjU2Nzg0IDI3LjM2NyAxNi40MzIyIDI3LjM2NyAyMS44OTk1IDIxLjg5OTdMMTkuMDcxMSAxOS4wNzEzWk0xOS4wNzExIDQuOTI5MTJDMjIuOTc2MyA4LjgzNDM2IDIyLjk3NjMgMTUuMTY2IDE5LjA3MTEgMTkuMDcxM0wyMS44OTk1IDIxLjg5OTdDMjcuMzY2OCAxNi40MzIzIDI3LjM2NjggNy41NjgwMyAyMS44OTk1IDIuMTAwNjlMMTkuMDcxMSA0LjkyOTEyWk00LjkyODkzIDQuOTI5MTJDOC44MzQxNyAxLjAyMzg3IDE1LjE2NTggMS4wMjM4NyAxOS4wNzExIDQuOTI5MTJMMjEuODk5NSAyLjEwMDY5QzE2LjQzMjIgLTMuMzY2NjUgNy41Njc4NCAtMy4zNjY2NSAyLjEwMDUxIDIuMTAwNjlMNC45Mjg5MyA0LjkyOTEyWk00LjkyODkzIDE5LjA3MTNDMS4wMjM2OSAxNS4xNjYgMS4wMjM2OSA4LjgzNDM2IDQuOTI4OTMgNC45MjkxMkwyLjEwMDUxIDIuMTAwNjlDLTMuMzY2ODMgNy41NjgwMyAtMy4zNjY4MyAxNi40MzIzIDIuMTAwNTEgMjEuODk5N0w0LjkyODkzIDE5LjA3MTNaIiBmaWxsPSJ3aGl0ZSIgbWFzaz0idXJsKCNwYXRoLTEtaW5zaWRlLTFfNDlfMzcwKSIvPjwvZz48ZGVmcz48Y2xpcFBhdGggaWQ9ImNsaXAwXzQ5XzM3MCI+PHJlY3Qgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSJ3aGl0ZSIvPjwvY2xpcFBhdGg+PC9kZWZzPjwvc3ZnPg==');\n }\n"]))),Fy=o.div(by||(by=v(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"],["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"]))),Py=o.div(xy||(xy=v(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: ",";\n opacity: ",";\n"],["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: ",";\n opacity: ",";\n"])),(function(e){var t,n,r,o;return null!==(o=null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.selfieCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.progressBarBackgroundColor)&&void 0!==o?o:"var(--idm-color-positive-600)"}),(function(e){var t,n,r,o;return null!==(o=null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.selfieCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.progressBarBackgroundOpacity)&&void 0!==o?o:.75})),Uy=o.span(Cy||(Cy=v(["\n display: block;\n width: ","%;\n height: 100%;\n"],["\n display: block;\n width: ","%;\n height: 100%;\n"])),(function(e){return e.$progress})),_y=o.span(wy||(wy=v(["\n display: block;\n height: 100%;\n background: ",";\n animation: progressBar 3s ease-in-out;\n animation-fill-mode: both;\n\n @keyframes progressBar {\n 0% {\n width: 0;\n }\n 100% {\n width: 100%;\n }\n }\n"],["\n display: block;\n height: 100%;\n background: ",";\n animation: progressBar 3s ease-in-out;\n animation-fill-mode: both;\n\n @keyframes progressBar {\n 0% {\n width: 0;\n }\n 100% {\n width: 100%;\n }\n }\n"])),(function(e){var t,n,r,o;return null!==(o=null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.selfieCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.progressBarIndicatorColor)&&void 0!==o?o:"var(--idm-color-positive-600)"})),jy=o.img(Ey||(Ey=v([""],[""]))),By=o.div(ky||(ky=v(["\n display: flex;\n"],["\n display: flex;\n"]))),zy=o(le)(Dy||(Dy=v(["\n margin: auto;\n white-space: nowrap;\n ","\n ","\n"],["\n margin: auto;\n white-space: nowrap;\n ","\n ","\n"])),(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.selfieCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.progressBarFontSize)?"font-size: ".concat(null===(a=null===(i=null===(o=e.theme)||void 0===o?void 0:o.selfieCapture)||void 0===i?void 0:i.loadingOverlay)||void 0===a?void 0:a.progressBarFontSize,";"):""}),(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.selfieCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.continueBtnBorder)?"border: ".concat(null===(a=null===(i=null===(o=e.theme)||void 0===o?void 0:o.selfieCapture)||void 0===i?void 0:i.loadingOverlay)||void 0===a?void 0:a.continueBtnBorder,";"):""})),Gy={default:function(e){var n=e.onDismissed,r=e.onUserCancel,o=e.assets,i=void 0===o?{}:o,a=e.classNames,s=void 0===a?{}:a,u=e.colors,c=void 0===u?{}:u,l=e.verbiage,d=void 0===l?{}:l,f=t.useContext(nt),p=f.cameraReady,h=f.cameraAccessDenied,m=f.microphoneAccessDenied,g=t.useContext(Dv),v=g.ready,y=g.modelDownloadProgress,b=rh(d,{headingText:"Use your device camera to capture your face",removeEyeCoveringsText:"Remove Sunglasses & Hat",avoidExcessiveBacklightingText:"Avoid Excessive Backlighting",continueText:"Let's Go!",cameraInitializingText:"Accessing camera...",cameraInitializedText:"Camera ready",downloadingText:"Downloading...",modelsWarmingUpText:"Loading guided capture experience...",modelsReadyText:"Guided capture experience ready"}),x=t.useState(0),C=x[1],w=[b.headingText,b.removeEyeCoveringsText,b.avoidExcessiveBacklightingText][x[0]];t.useEffect((function(){setInterval((function(){C((function(e){return(e+1)%3}))}),3e3)}),[]);var E=t.useState(!1),k=E[1];return E[0]?t.createElement(t.Fragment,null):h?t.createElement(yh,{assets:i.cameraAccessDenied,classNames:s.cameraAccessDenied,colors:c.cameraAccessDenied,verbiage:d.cameraAccessDenied}):m?t.createElement(ry,{assets:i.microphoneAccessDenied,classNames:s.microphoneAccessDenied,colors:c.microphoneAccessDenied,verbiage:d.microphoneAccessDenied}):t.createElement(_,{className:s.container},t.createElement(Ty,{className:s.inner},r&&t.createElement(kh,{onClick:r,className:s.cancelBtn}),t.createElement(Iy,{className:s.headingContainer},t.createElement(Sy,{className:s.heading},w)),t.createElement(Ay,{className:s.imageContainer},(null==i?void 0:i.instructionImageUrl)&&i.instructionImageUrl!==My?t.createElement(jy,{className:s.image,alt:b.headingText,src:i.instructionImageUrl}):t.createElement(ly,{className:s.image})),t.createElement(Ny,{className:s.buttonsRow},t.createElement(Fy,{className:s.progressContainer},t.createElement(Py,{className:s.progressBackground}),t.createElement(Uy,{$progress:y,className:s.progressBar},t.createElement(_y,{className:s.progressIndicator}))),t.createElement(Ly,{className:s.loadingListContainer},t.createElement(Oy,{className:s.loadingList},t.createElement(Ry,{className:"".concat(s.loadingListItem," ").concat(p?"done":"running")},p?b.cameraInitializedText:b.cameraInitializingText),t.createElement(Ry,{className:"".concat(s.loadingListItem," ").concat(v?"done":"running")},v?b.modelsReadyText:y>=100?b.modelsWarmingUpText:"".concat(b.downloadingText," (").concat(y,"%)")))),t.createElement(By,{className:s.continueBtnContainer},v&&p&&t.createElement(zy,{finished:!0,className:s.continueBtn,variant:"positive",colors:c.continueBtn,onClick:function(){k(!0),null==n||n()}},b.continueText)))))},legacy:function(e){var n=e.onDismissed,r=e.onUserCancel,o=e.assets,i=void 0===o?{}:o,a=e.classNames,s=void 0===a?{}:a,u=e.colors,c=void 0===u?{}:u,l=e.verbiage,d=void 0===l?{}:l,f=t.useContext(nt),p=f.cameraReady,h=f.cameraAccessDenied,m=f.microphoneAccessDenied,g=t.useContext(Dv),v=g.ready,y=g.modelDownloadProgress;i.instructionImageUrl||(i.instructionImageUrl="".concat(mh,"/Selfie-Image-1.png"));var b=rh(d,{headingText:"Use your device camera to capture your face",removeEyeCoveringsText:"Remove Sunglasses & Hat",avoidExcessiveBacklightingText:"Avoid Excessive Backlighting",continueText:"Continue",cameraInitializingText:"Camera initializing...",downloadingText:"Downloading...",modelsWarmingUpText:"Models warming up..."}),x=t.useState(!1),C=x[1];return x[0]?t.createElement(t.Fragment,null):h?t.createElement(yh,{assets:i.cameraAccessDenied,classNames:s.cameraAccessDenied,colors:c.cameraAccessDenied,verbiage:d.cameraAccessDenied}):m?t.createElement(ry,{assets:i.microphoneAccessDenied,classNames:s.microphoneAccessDenied,colors:c.microphoneAccessDenied,verbiage:d.microphoneAccessDenied}):t.createElement(_,{className:s.container},t.createElement(j,{className:s.inner},t.createElement("h3",{className:s.heading},b.headingText),r&&t.createElement(kh,{onClick:r,className:s.cancelBtn}),t.createElement(uy,null,b.removeEyeCoveringsText,t.createElement("br",null),b.avoidExcessiveBacklightingText),t.createElement(B,{className:s.imageContainer},t.createElement("img",{className:s.image,alt:b.headingText,src:i.instructionImageUrl})),t.createElement(cy,{className:s.buttonsRow},t.createElement(le,{variant:"positive",disabled:!p||!v,finished:p&&v,className:s.continueBtn,colors:c.continueBtn,onClick:function(){C(!0),null==n||n()}},p&&v?b.continueText:v?b.cameraInitializingText:y>=100?"".concat(b.modelsWarmingUpText):"".concat(b.downloadingText," (").concat(y,"%)")))))}},Vy=function(e){var n,r=e.mode,o=void 0===r?"default":r,i=p(e,["mode"]),a=null!==(n=Gy[o])&&void 0!==n?n:Gy.default;return t.createElement(a,f({},i))},Wy=function(e){var n,r,o,i=e.onComplete,a=e.onSuccess,s=e.onTimeout,u=e.onExitCapture,c=e.onExitAfterFailure,l=e.onUserCancel,d=e.loadingOverlayMode,f=void 0===d?"default":d,p=e.timeoutDurationMs,g=void 0===p?15e3:p,v=e.maxRetries,y=void 0===v?2:v,b=e.skipSuccessScreen,x=void 0!==b&&b,C=e.renderCameraFeed,E=void 0===C||C,k=e.releaseCameraAccessOnExit,D=void 0===k||k,M=e.silentFallback,T=void 0!==M&&M,I=e.assets,S=void 0===I?{}:I,N=e.classNames,A=void 0===N?{}:N,L=e.colors,R=void 0===L?{}:L,F=e.verbiage,P=void 0===F?{}:F,U=e.debugMode,_=void 0!==U&&U,j=t.useContext(_e),B=j.submissionResponse,z=j.livenessCheckRequest,G=j.setSelfieImage,V=j.logSelfieCaptureAttempt,W=t.useContext(nt),q=W.cameraAccessDenied,H=W.requestCameraAccess,Y=W.releaseCameraAccess,Z=t.useState(""),Q=Z[0],$=Z[1],X=t.useState(0),K=X[0],J=X[1],ee=t.useState("LOADING"),te=ee[0],ne=ee[1],re=t.useRef(),oe=t.useRef(),ie=t.useRef(),ae=t.useContext(Dv),se=ae.start,ue=ae.stop;t.useEffect((function(){ie.current=new Date}),[]),t.useEffect((function(){if("CAPTURING"===te)return re.current=new Date,se(),function(){ue()}}),[te,se,ue]);var ce=t.useCallback((function(){oe.current=new Date}),[]),le=t.useCallback((function(){var e,t,n;V({autoCapture:"Y",captureTime:(null!==(e=oe.current)&&void 0!==e?e:new Date).getTime()-(null!==(t=re.current)&&void 0!==t?t:new Date).getTime(),operationTime:(new Date).getTime()-(null!==(n=ie.current)&&void 0!==n?n:new Date).getTime()}),ie.current=new Date}),[V]),de=t.useCallback((function(e){return h(void 0,void 0,void 0,(function(){var t;return m(this,(function(n){switch(n.label){case 0:return z&&B?(ne("SUCCESS"),$(e),t=G,[4,w(e)]):[2];case 1:return t.apply(void 0,[n.sent()]),null==a||a(B,z),[2]}}))}))}),[a,G,z,B]),fe=t.useCallback((function(){ne("FAILED"),null==s||s(B,z)}),[s,z,B]),pe=t.useState(0),he=pe[0],me=pe[1],ge=t.useCallback((function(){me((function(e){return e+1})),ne("LOADING"),Y(),null==u||u(),H()}),[u,Y,H]),ve=t.useCallback((function(){le(),me((function(e){return e+1})),J((function(e){return e+1})),ne("LOADING"),Y(),H()}),[le,Y,H]),ye=t.useCallback((function(){le(),D&&Y(),setTimeout((function(){null==i||i(B,z)}),0)}),[le,i,Y,D,z,B]),be=jm(x,"SUCCESS"===te,ye);return t.useEffect((function(){q&&(me((function(e){return e+1})),ne("LOADING"))}),[q]),t.createElement(t.Fragment,null,t.createElement(O,{className:"flex ".concat(null!==(r=null===(n=A.capture)||void 0===n?void 0:n.container)&&void 0!==r?r:"")},E&&t.createElement(Um,{className:null===(o=A.capture)||void 0===o?void 0:o.cameraFeed}),"LOADING"!==te&&function(){switch(te){case"CAPTURING":return t.createElement(Kv,{key:"capture".concat(he),onCapture:ce,onSuccess:de,onTimeout:fe,onExit:ge,timeoutDurationMs:g,silentFallback:T,classNames:A.capture,colors:R,verbiage:P,debugMode:_});case"SUCCESS":return be?t.createElement(Jv,{key:"success",imageUrl:Q,classNames:A.success,colors:R.success,verbiage:P.success,onDoneClick:ye,onRetryClick:ve}):null;case"FAILED":return t.createElement(ty,{key:"failure",assets:S.failure,classNames:A.failure,colors:R.failure,verbiage:P.failure,canRetry:y>-1&&K<y,onRetryClick:ve,onExitClick:function(){D&&Y(),setTimeout((function(){null==c||c(B,z)}),0)}});default:return null}}()),t.createElement(Vy,{key:he,mode:f,assets:S.loadingOverlay,classNames:A.loadingOverlay,colors:R.loadingOverlay,verbiage:P.loadingOverlay,onUserCancel:l,onDismissed:function(){ne("CAPTURING")}}))},qy=function(e){var n=e.children,r=t.useState({width:1,height:1})[1],o=t.useState(1),i=o[0],a=o[1],s=ze(),u=s.ref,c=s.width,l=void 0===c?1:c,d=s.height,f=void 0===d?1:d,p=l/f,h=t.useCallback((function(e){var t=e.target;a(t.naturalWidth/t.naturalHeight)}),[]);return t.createElement(ng.Provider,{value:{orientation:"landscape",wrapperWidth:l,wrapperHeight:f,wrapperAspectRatio:p,imageAspectRatio:i,setDimensions:r,wrapperRef:u,onImageLoaded:h}},n)},Hy=function(){var e=t.useContext(_e),n=e.submissionRequest,r=e.submissionResponse,o=t.useState(!1),i=o[0],a=o[1],s=t.useState(!0),u=s[0],c=s[1],l=t.useMemo((function(){var e,t,r,o,i,a,s=JSON.parse(JSON.stringify(n));return u&&((null===(t=null===(e=null==s?void 0:s.customerData)||void 0===e?void 0:e.idData)||void 0===t?void 0:t.idImageFront)&&(s.customerData.idData.idImageFront=Yy(s.customerData.idData.idImageFront,200)),(null===(o=null===(r=null==s?void 0:s.customerData)||void 0===r?void 0:r.idData)||void 0===o?void 0:o.idImageBack)&&(s.customerData.idData.idImageBack=Yy(s.customerData.idData.idImageBack,200)),(null===(a=null===(i=null==s?void 0:s.customerData)||void 0===i?void 0:i.biometricData)||void 0===a?void 0:a.selfie)&&(s.customerData.biometricData.selfie=Yy(s.customerData.biometricData.selfie,200))),JSON.stringify(s,null,2)}),[n,u]);return t.createElement(t.Fragment,null,t.createElement("h3",null,"Submission completed!"),t.createElement("button",{onClick:function(){a(!i)}},i?"Hide":"Show"," request body"),i&&t.createElement(t.Fragment,null,t.createElement("button",{style:{marginLeft:8},onClick:function(){c(!u)}},u?"Display full images":"Truncate images"),t.createElement("h5",null,"Request Body"),t.createElement("pre",null,l)),t.createElement("h5",null,"Response Body"),t.createElement("pre",null,JSON.stringify(r,null,2)))};function Yy(e,t){var n=e.split("").splice(0,t).join("");return n.length<e.length&&(n+="..."),n}var Zy,Qy,$y,Xy,Ky,Jy,eb,tb,nb,rb=function(e){var n=e.document,r=e.onComplete,o=e.classNames,i=void 0===o?{}:o,a=e.verbiage,s=void 0===a?{}:a,u=t.useRef(null),c=t.useState(null),l=c[0],d=c[1],f=rh(s,{headingText:"Additional document capture",captureBtnText:"Capture",nextBtnText:"Next"});return t.createElement(_,{className:i.container},t.createElement(ob,{className:i.inner},t.createElement(ib,{className:i.heading},f.headingText,": ",n.name),n.description&&t.createElement(ab,{className:i.description},n.description),t.createElement("input",{ref:u,type:"file",accept:"image/*,.pdf",onChange:function(e){var t,n=null===(t=e.target.files)||void 0===t?void 0:t[0];n&&d(n)},hidden:!0}),t.createElement(sb,{className:i.buttonsRow},l?t.createElement(le,{variant:"positive",className:i.nextBtn,disabled:!l,finished:!0,onClick:function(){if(l){var e=new FileReader;e.onloadend=function(){if(e.result){var t=e.result.toString();null==r||r({documentName:n.name,processAsPOA:n.processAsPOA?"Y":"N",additionalDocument:{name:l.name,fileContent:E(t),type:k(t),fileUploadType:"Y",isImageControlData:"Y",fieldId:""}})}},e.readAsDataURL(l)}}},f.nextBtnText):t.createElement(le,{variant:"primary",className:i.captureBtn,finished:!0,onClick:function(){var e;null===(e=u.current)||void 0===e||e.click()}},f.captureBtnText))))},ob=o(j)(Zy||(Zy=v(["\n justify-content: center;\n"],["\n justify-content: center;\n"]))),ib=o.h3(Qy||(Qy=v(["\n margin-bottom: 8px;\n"],["\n margin-bottom: 8px;\n"]))),ab=o.p($y||($y=v(["\n margin-bottom: 8px;\n"],["\n margin-bottom: 8px;\n"]))),sb=o(Dh)(Xy||(Xy=v(["\n margin-top: 32px;\n"],["\n margin-top: 32px;\n"]))),ub=function(e){var n=e.documents,r=e.onComplete,o=e.classNames,i=void 0===o?{}:o,a=e.verbiage,s=void 0===a?{}:a,u=t.useState([]),c=u[0],l=u[1],d=c.length,f=n[d],p=d>=n.length;return t.useEffect((function(){(null==f?void 0:f.skip)&&h(void 0,void 0,void 0,(function(){var e;return m(this,(function(t){switch(t.label){case 0:return[4,null===(e=f.skip)||void 0===e?void 0:e.call(f)];case 1:return t.sent()&&l((function(e){return g(g([],e,!0),[null],!1)})),[2]}}))}))}),[f]),t.useEffect((function(){p&&(null==r||r(c.filter((function(e){return!!e}))))}),[p,r,c]),p?t.createElement(t.Fragment,null,"Thanks, your documents have been received."):t.createElement(rb,{key:d,document:f,classNames:i,verbiage:s,onComplete:function(e){l((function(t){return g(g([],t,!0),[e],!1)}))}})},cb={exports:{}},lb={exports:{}};function db(){if(tb)return eb;tb=1;var e=Jy?Ky:(Jy=1,Ky="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");function t(){}function n(){}return n.resetWarningCache=t,eb=function(){function r(t,n,r,o,i,a){if(a!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function o(){return r}r.isRequired=r;var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i}}function fb(e,t,n){this.x=e,this.y=t,this.time=n||(new Date).getTime()}function pb(e,t,n,r){this.startPoint=e,this.control1=t,this.control2=n,this.endPoint=r}function hb(e,t){var n=this,r=t||{};this.velocityFilterWeight=r.velocityFilterWeight||.7,this.minWidth=r.minWidth||.5,this.maxWidth=r.maxWidth||2.5,this.throttle="throttle"in r?r.throttle:16,this.minDistance="minDistance"in r?r.minDistance:5,this._strokeMoveUpdate=this.throttle?function(e,t,n){var r,o,i,a=null,s=0;n||(n={});var u=function(){s=!1===n.leading?0:Date.now(),a=null,i=e.apply(r,o),a||(r=o=null)};return function(){var c=Date.now();s||!1!==n.leading||(s=c);var l=t-(c-s);return r=this,o=arguments,l<=0||l>t?(a&&(clearTimeout(a),a=null),s=c,i=e.apply(r,o),a||(r=o=null)):a||!1===n.trailing||(a=setTimeout(u,l)),i}}(hb.prototype._strokeUpdate,this.throttle):hb.prototype._strokeUpdate,this.dotSize=r.dotSize||function(){return(this.minWidth+this.maxWidth)/2},this.penColor=r.penColor||"black",this.backgroundColor=r.backgroundColor||"rgba(0,0,0,0)",this.onBegin=r.onBegin,this.onEnd=r.onEnd,this._canvas=e,this._ctx=e.getContext("2d"),this.clear(),this._handleMouseDown=function(e){1===e.which&&(n._mouseButtonDown=!0,n._strokeBegin(e))},this._handleMouseMove=function(e){n._mouseButtonDown&&n._strokeMoveUpdate(e)},this._handleMouseUp=function(e){1===e.which&&n._mouseButtonDown&&(n._mouseButtonDown=!1,n._strokeEnd(e))},this._handleTouchStart=function(e){1===e.targetTouches.length&&n._strokeBegin(e.changedTouches[0])},this._handleTouchMove=function(e){e.preventDefault(),n._strokeMoveUpdate(e.targetTouches[0])},this._handleTouchEnd=function(e){e.target===n._canvas&&(e.preventDefault(),n._strokeEnd(e))},this.on()}fb.prototype.velocityFrom=function(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):1},fb.prototype.distanceTo=function(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))},fb.prototype.equals=function(e){return this.x===e.x&&this.y===e.y&&this.time===e.time},pb.prototype.length=function(){for(var e=0,t=void 0,n=void 0,r=0;r<=10;r+=1){var o=r/10,i=this._point(o,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),a=this._point(o,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(r>0){var s=i-t,u=a-n;e+=Math.sqrt(s*s+u*u)}t=i,n=a}return e},pb.prototype._point=function(e,t,n,r,o){return t*(1-e)*(1-e)*(1-e)+3*n*(1-e)*(1-e)*e+3*r*(1-e)*e*e+o*e*e*e},hb.prototype.clear=function(){var e=this._ctx,t=this._canvas;e.fillStyle=this.backgroundColor,e.clearRect(0,0,t.width,t.height),e.fillRect(0,0,t.width,t.height),this._data=[],this._reset(),this._isEmpty=!0},hb.prototype.fromDataURL=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new Image,o=n.ratio||window.devicePixelRatio||1,i=n.width||this._canvas.width/o,a=n.height||this._canvas.height/o;this._reset(),r.src=e,r.onload=function(){t._ctx.drawImage(r,0,0,i,a)},this._isEmpty=!1},hb.prototype.toDataURL=function(e){var t;if("image/svg+xml"===e)return this._toSVG();for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return(t=this._canvas).toDataURL.apply(t,[e].concat(r))},hb.prototype.on=function(){this._handleMouseEvents(),this._handleTouchEvents()},hb.prototype.off=function(){this._canvas.removeEventListener("mousedown",this._handleMouseDown),this._canvas.removeEventListener("mousemove",this._handleMouseMove),document.removeEventListener("mouseup",this._handleMouseUp),this._canvas.removeEventListener("touchstart",this._handleTouchStart),this._canvas.removeEventListener("touchmove",this._handleTouchMove),this._canvas.removeEventListener("touchend",this._handleTouchEnd)},hb.prototype.isEmpty=function(){return this._isEmpty},hb.prototype._strokeBegin=function(e){this._data.push([]),this._reset(),this._strokeUpdate(e),"function"==typeof this.onBegin&&this.onBegin(e)},hb.prototype._strokeUpdate=function(e){var t=this._createPoint(e.clientX,e.clientY),n=this._data[this._data.length-1],r=n&&n[n.length-1],o=r&&t.distanceTo(r)<this.minDistance;if(!r||!o){var i=this._addPoint(t),a=i.curve,s=i.widths;a&&s&&this._drawCurve(a,s.start,s.end),this._data[this._data.length-1].push({x:t.x,y:t.y,time:t.time,color:this.penColor})}},hb.prototype._strokeEnd=function(e){var t=this.points[0];if(!(this.points.length>2)&&t&&this._drawDot(t),t){var n=this._data[this._data.length-1];t.equals(n[n.length-1])||n.push({x:t.x,y:t.y,time:t.time,color:this.penColor})}"function"==typeof this.onEnd&&this.onEnd(e)},hb.prototype._handleMouseEvents=function(){this._mouseButtonDown=!1,this._canvas.addEventListener("mousedown",this._handleMouseDown),this._canvas.addEventListener("mousemove",this._handleMouseMove),document.addEventListener("mouseup",this._handleMouseUp)},hb.prototype._handleTouchEvents=function(){this._canvas.style.msTouchAction="none",this._canvas.style.touchAction="none",this._canvas.addEventListener("touchstart",this._handleTouchStart),this._canvas.addEventListener("touchmove",this._handleTouchMove),this._canvas.addEventListener("touchend",this._handleTouchEnd)},hb.prototype._reset=function(){this.points=[],this._lastVelocity=0,this._lastWidth=(this.minWidth+this.maxWidth)/2,this._ctx.fillStyle=this.penColor},hb.prototype._createPoint=function(e,t,n){var r=this._canvas.getBoundingClientRect();return new fb(e-r.left,t-r.top,n||(new Date).getTime())},hb.prototype._addPoint=function(e){var t=this.points,n=void 0;if(t.push(e),t.length>2){3===t.length&&t.unshift(t[0]);var r=(n=this._calculateCurveControlPoints(t[0],t[1],t[2])).c2;n=this._calculateCurveControlPoints(t[1],t[2],t[3]);var o=new pb(t[1],r,n.c1,t[2]),i=this._calculateCurveWidths(o);return t.shift(),{curve:o,widths:i}}return{}},hb.prototype._calculateCurveControlPoints=function(e,t,n){var r=e.x-t.x,o=e.y-t.y,i=t.x-n.x,a=t.y-n.y,s=(e.x+t.x)/2,u=(e.y+t.y)/2,c=(t.x+n.x)/2,l=(t.y+n.y)/2,d=Math.sqrt(r*r+o*o),f=Math.sqrt(i*i+a*a),p=f/(d+f),h=t.x-(c+(s-c)*p),m=t.y-(l+(u-l)*p);return{c1:new fb(s+h,u+m),c2:new fb(c+h,l+m)}},hb.prototype._calculateCurveWidths=function(e){var t={start:null,end:null},n=this.velocityFilterWeight*e.endPoint.velocityFrom(e.startPoint)+(1-this.velocityFilterWeight)*this._lastVelocity,r=this._strokeWidth(n);return t.start=this._lastWidth,t.end=r,this._lastVelocity=n,this._lastWidth=r,t},hb.prototype._strokeWidth=function(e){return Math.max(this.maxWidth/(e+1),this.minWidth)},hb.prototype._drawPoint=function(e,t,n){var r=this._ctx;r.moveTo(e,t),r.arc(e,t,n,0,2*Math.PI,!1),this._isEmpty=!1},hb.prototype._drawCurve=function(e,t,n){var r=this._ctx,o=n-t,i=Math.floor(e.length());r.beginPath();for(var a=0;a<i;a+=1){var s=a/i,u=s*s,c=u*s,l=1-s,d=l*l,f=d*l,p=f*e.startPoint.x;p+=3*d*s*e.control1.x,p+=3*l*u*e.control2.x;var h=f*e.startPoint.y;h+=3*d*s*e.control1.y,h+=3*l*u*e.control2.y,this._drawPoint(p+=c*e.endPoint.x,h+=c*e.endPoint.y,t+c*o)}r.closePath(),r.fill()},hb.prototype._drawDot=function(e){var t=this._ctx,n="function"==typeof this.dotSize?this.dotSize():this.dotSize;t.beginPath(),this._drawPoint(e.x,e.y,n),t.closePath(),t.fill()},hb.prototype._fromData=function(e,t,n){for(var r=0;r<e.length;r+=1){var o=e[r];if(o.length>1)for(var i=0;i<o.length;i+=1){var a=o[i],s=new fb(a.x,a.y,a.time),u=a.color;if(0===i)this.penColor=u,this._reset(),this._addPoint(s);else if(i!==o.length-1){var c=this._addPoint(s),l=c.curve,d=c.widths;l&&d&&t(l,d,u)}}else this._reset(),n(o[0])}},hb.prototype._toSVG=function(){var e=this,t=this._data,n=this._canvas,r=Math.max(window.devicePixelRatio||1,1),o=n.width/r,i=n.height/r,a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttributeNS(null,"width",n.width),a.setAttributeNS(null,"height",n.height),this._fromData(t,(function(e,t,n){var r=document.createElement("path");if(!(isNaN(e.control1.x)||isNaN(e.control1.y)||isNaN(e.control2.x)||isNaN(e.control2.y))){var o="M "+e.startPoint.x.toFixed(3)+","+e.startPoint.y.toFixed(3)+" C "+e.control1.x.toFixed(3)+","+e.control1.y.toFixed(3)+" "+e.control2.x.toFixed(3)+","+e.control2.y.toFixed(3)+" "+e.endPoint.x.toFixed(3)+","+e.endPoint.y.toFixed(3);r.setAttribute("d",o),r.setAttribute("stroke-width",(2.25*t.end).toFixed(3)),r.setAttribute("stroke",n),r.setAttribute("fill","none"),r.setAttribute("stroke-linecap","round"),a.appendChild(r)}}),(function(t){var n=document.createElement("circle"),r="function"==typeof e.dotSize?e.dotSize():e.dotSize;n.setAttribute("r",r),n.setAttribute("cx",t.x),n.setAttribute("cy",t.y),n.setAttribute("fill",t.color),a.appendChild(n)}));var s='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 '+o+" "+i+'" width="'+o+'" height="'+i+'">',u=a.innerHTML;if(void 0===u){var c=document.createElement("dummy"),l=a.childNodes;c.innerHTML="";for(var d=0;d<l.length;d+=1)c.appendChild(l[d].cloneNode(!0));u=c.innerHTML}return"data:image/svg+xml;base64,"+btoa(s+u+"</svg>")},hb.prototype.fromData=function(e){var t=this;this.clear(),this._fromData(e,(function(e,n){return t._drawCurve(e,n.start,n.end)}),(function(e){return t._drawDot(e)})),this._data=e},hb.prototype.toData=function(){return this._data};var mb,gb=q(Object.freeze({__proto__:null,default:hb})),vb={exports:{}};function yb(){return mb||(mb=1,function(e){e.exports=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t){function n(e){var t=e.getContext("2d"),n=e.width,r=e.height,o=t.getImageData(0,0,n,r).data,s=i(!0,n,r,o),u=i(!1,n,r,o),c=a(!0,n,r,o),l=a(!1,n,r,o)-c+1,d=u-s+1,f=t.getImageData(c,s,l,d);return e.width=l,e.height=d,t.clearRect(0,0,l,d),t.putImageData(f,0,0),e}function r(e,t,n,r){return{red:r[4*(n*t+e)],green:r[4*(n*t+e)+1],blue:r[4*(n*t+e)+2],alpha:r[4*(n*t+e)+3]}}function o(e,t,n,o){return r(e,t,n,o).alpha}function i(e,t,n,r){for(var i=e?1:-1,a=e?0:n-1;e?a<n:a>-1;a+=i)for(var s=0;s<t;s++)if(o(s,a,t,r))return a;return null}function a(e,t,n,r){for(var i=e?1:-1,a=e?0:t-1;e?a<t:a>-1;a+=i)for(var s=0;s<n;s++)if(o(a,s,t,r))return a;return null}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n}])}(vb)),vb.exports}!function(e){e.exports=function(e,t,n,r){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=r(n(1)),d=n(2),f=r(d),p=r(n(3)),h=r(n(4)),m=function(e){function t(){var e,n,r;i(this,t);for(var s=arguments.length,u=Array(s),c=0;c<s;c++)u[c]=arguments[c];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r._sigPad=null,r._excludeOurProps=function(){var e=r.props;return o(e,["canvasProps","clearOnResize"])},r.getCanvas=function(){return r._canvas},r.getTrimmedCanvas=function(){var e=document.createElement("canvas");return e.width=r._canvas.width,e.height=r._canvas.height,e.getContext("2d").drawImage(r._canvas,0,0),(0,h.default)(e)},r.getSignaturePad=function(){return r._sigPad},r._checkClearOnResize=function(){r.props.clearOnResize&&r._resizeCanvas()},r._resizeCanvas=function(){var e=r.props.canvasProps||{},t=e.width,n=e.height;if(!t||!n){var o=r._canvas,i=Math.max(window.devicePixelRatio||1,1);t||(o.width=o.offsetWidth*i),n||(o.height=o.offsetHeight*i),o.getContext("2d").scale(i,i),r.clear()}},r.on=function(){return window.addEventListener("resize",r._checkClearOnResize),r._sigPad.on()},r.off=function(){return window.removeEventListener("resize",r._checkClearOnResize),r._sigPad.off()},r.clear=function(){return r._sigPad.clear()},r.isEmpty=function(){return r._sigPad.isEmpty()},r.fromDataURL=function(e,t){return r._sigPad.fromDataURL(e,t)},r.toDataURL=function(e,t){return r._sigPad.toDataURL(e,t)},r.fromData=function(e){return r._sigPad.fromData(e)},r.toData=function(){return r._sigPad.toData()},a(r,n)}return s(t,e),c(t,[{key:"componentDidMount",value:function(){this._sigPad=new p.default(this._canvas,this._excludeOurProps()),this._resizeCanvas(),this.on()}},{key:"componentWillUnmount",value:function(){this.off()}},{key:"componentDidUpdate",value:function(){Object.assign(this._sigPad,this._excludeOurProps())}},{key:"render",value:function(){var e=this;return f.default.createElement("canvas",u({ref:function(t){e._canvas=t}},this.props.canvasProps))}}]),t}(d.Component);m.propTypes={velocityFilterWeight:l.default.number,minWidth:l.default.number,maxWidth:l.default.number,minDistance:l.default.number,dotSize:l.default.oneOfType([l.default.number,l.default.func]),penColor:l.default.string,throttle:l.default.number,onEnd:l.default.func,onBegin:l.default.func,canvasProps:l.default.object,clearOnResize:l.default.bool},m.defaultProps={clearOnResize:!0},t.default=m},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t){e.exports=r}])}((nb||(nb=1,lb.exports=db()()),lb.exports),t,gb,yb())}(cb);var bb=W(cb.exports);function xb(e){var t,n=null!==(t=e.toDataURL())&&void 0!==t?t:null,r={clickX_simple:[],clickY_simple:[],time_simple:[],pressure:"",fileContent:n?E(n):""};return e.toData().forEach((function(e){var t=[],n=[],o=[];e.forEach((function(e){t.push(e.x),n.push(e.y),o.push(new Date(e.time).toString())})),r.clickX_simple.push(t),r.clickY_simple.push(n),r.time_simple.push(o)})),r}var Cb,wb,Eb,kb,Db,Mb,Tb,Ib,Sb,Nb,Ab,Lb,Ob,Rb,Fb,Pb,Ub,_b,jb,Bb,zb,Gb,Vb,Wb,qb,Hb,Yb,Zb,Qb,$b,Xb,Kb,Jb,ex,tx,nx,rx,ox,ix,ax,sx=o.div(Cb||(Cb=v(["\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n ","\n ","\n ","\n"],["\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n ","\n ","\n ","\n"])),(function(e){var t,n;return(null===(t=e.theme.signatureCapture)||void 0===t?void 0:t.background)?"background: ".concat(null===(n=e.theme.signatureCapture)||void 0===n?void 0:n.background,";"):""}),(function(e){var t,n;return(null===(t=e.theme.signatureCapture)||void 0===t?void 0:t.backgroundSize)?"background-size: ".concat(null===(n=e.theme.signatureCapture)||void 0===n?void 0:n.backgroundSize,";"):""}),(function(e){var t,n;return(null===(t=e.theme.signatureCapture)||void 0===t?void 0:t.backgroundPosition)?"background-position: ".concat(null===(n=e.theme.signatureCapture)||void 0===n?void 0:n.backgroundPosition,";"):""})),ux=o.div(wb||(wb=v(["\n position: absolute;\n top: 25%;\n left: 15%;\n width: 70%;\n height: 50%;\n\n @media (max-width: 800px) {\n top: 15%;\n left: 2%;\n width: 96%;\n height: 70%;\n }\n"],["\n position: absolute;\n top: 25%;\n left: 15%;\n width: 70%;\n height: 50%;\n\n @media (max-width: 800px) {\n top: 15%;\n left: 2%;\n width: 96%;\n height: 70%;\n }\n"]))),cx=o.div(Eb||(Eb=v(["\n position: relative;\n background: ",";\n border: ",";\n border-radius: ",";\n flex-grow: 1;\n z-index: 100;\n height: 100%;\n"],["\n position: relative;\n background: ",";\n border: ",";\n border-radius: ",";\n flex-grow: 1;\n z-index: 100;\n height: 100%;\n"])),(function(e){var t,n,r;return null!==(r=null===(n=null===(t=e.theme.signatureCapture)||void 0===t?void 0:t.canvas)||void 0===n?void 0:n.background)&&void 0!==r?r:"rgba(255, 255, 255, 0.5)"}),(function(e){var t,n,r;return null!==(r=null===(n=null===(t=e.theme.signatureCapture)||void 0===t?void 0:t.canvas)||void 0===n?void 0:n.border)&&void 0!==r?r:"1px solid #dedede"}),(function(e){var t,n,r;return null!==(r=null===(n=null===(t=e.theme.signatureCapture)||void 0===t?void 0:t.canvas)||void 0===n?void 0:n.borderRadius)&&void 0!==r?r:"16px"})),lx=o(Dh)(kb||(kb=v(["\n flex-grow: 0;\n padding-top: 12px;\n display: flex;\n z-index: 1000;\n position: relative;\n"],["\n flex-grow: 0;\n padding-top: 12px;\n display: flex;\n z-index: 1000;\n position: relative;\n"]))),dx=function(e){var n,r=e.onAccept,o=e.classNames,i=void 0===o?{}:o,a=e.verbiage,s=void 0===a?{}:a,u=ze(),c=u.ref,l=u.width,d=u.height,f=t.useRef(null),p=rh(s,{headingText:"Please sign the box below",acceptBtnText:"Accept",clearBtnText:"Clear"});return t.createElement(O,{className:i.container},t.createElement(sx,{className:i.inner},t.createElement(ph,{className:i.guidanceMessageContainer,$top:"5vh"},t.createElement(hh,{className:i.guidanceMessage},p.headingText)),t.createElement(ux,{className:i.canvasContainer},t.createElement(cx,{ref:c,className:i.canvasInner},t.createElement(bb,{ref:f,canvasProps:{width:l,height:d,className:i.canvas}})),t.createElement(lx,{className:i.buttonsRow},t.createElement(le,{variant:"secondary",className:i.clearBtn,onClick:null===(n=f.current)||void 0===n?void 0:n.clear,finished:!0},p.clearBtnText),t.createElement(fx,{variant:"positive",className:i.acceptBtn,onClick:function(){if(f.current){var e=xb(f.current);null==r||r(e,f.current.toDataURL())}},finished:!0},p.acceptBtnText)))))},fx=o(le)(Db||(Db=v(["\n margin-left: auto;\n"],["\n margin-left: auto;\n"]))),px=function(e,n,r){void 0===r&&(r=!1);var o=t.useRef(null),i=t.useRef(null),a=t.useRef([]),s=t.useRef([]),u=t.useState(null),c=u[0],l=u[1],d=t.useState(null),f=d[0],p=d[1],h=t.useState(!1),m=h[0],v=h[1],y=t.useState(!1),b=y[0],x=y[1],C=t.useState(!1),w=C[0],E=C[1],k=t.useState(!1),D=k[0],M=k[1],T=t.useState(!1),I=T[0],S=T[1],N=t.useState(!1),A=N[0],L=N[1],O=t.useCallback((function(){var t,o,i;if(!r)return null==e?void 0:e.stream;var a=null!==(o=null===(t=null==e?void 0:e.stream)||void 0===t?void 0:t.getTracks())&&void 0!==o?o:[],s=null!==(i=null==n?void 0:n.getTracks())&&void 0!==i?i:[];return new MediaStream(g(g([],a,!0),s,!0))}),[n,null==e?void 0:e.stream,r]),R=t.useCallback((function(){var t=new Blob(a.current,{type:"video/mp4"});a.current=[],l(URL.createObjectURL(t)),v(!1),null==e||e.release()}),[e]),F=t.useCallback((function(){var e,t=new Blob(s.current,{type:"audio/mp4"});s.current=[],p(URL.createObjectURL(t)),x(!1),null===(e=null==n?void 0:n.stop)||void 0===e||e.call(n)}),[n]),P=t.useCallback((function(){var e=O();e&&(a.current=[],v(!0),E(!1),S(!1),o.current=new MediaRecorder(e,{videoBitsPerSecond:27e4,audioBitsPerSecond:32e3}),o.current.ondataavailable=function(e){a.current.push(e.data)},o.current.onstop=function(){E(!0)},o.current.start(1e3),setTimeout((function(){var e;"inactive"===(null===(e=o.current)||void 0===e?void 0:e.state)&&Oe("media recorder is inactive!")}),100))}),[O]),U=t.useCallback((function(){r||n&&(s.current=[],x(!0),M(!1),L(!1),i.current=new MediaRecorder(n,{audioBitsPerSecond:32e3}),i.current.ondataavailable=function(e){s.current.push(e.data)},i.current.onstop=function(){M(!0)},i.current.start(1e3))}),[n,r]),_=t.useCallback((function(){var e,t;S(!0),"inactive"!==(null===(e=o.current)||void 0===e?void 0:e.state)&&(null===(t=o.current)||void 0===t||t.stop())}),[]),j=t.useCallback((function(){var e,t;L(!0),"inactive"!==(null===(e=i.current)||void 0===e?void 0:e.state)&&(null===(t=i.current)||void 0===t||t.stop())}),[]);return t.useEffect((function(){w&&I&&R()}),[R,I,w]),t.useEffect((function(){D&&A&&F()}),[A,D,F]),{isRecordingVideo:m,isRecordingAudio:b,startRecordingVideo:P,startRecordingAudio:U,stopRecordingVideo:_,stopRecordingAudio:j,videoRecordingUnintentionallyStopped:w&&!I,audioRecordingUnintentionallyStopped:D&&!A,videoUrl:c,audioUrl:f}},hx=function(e){var n,r,o,i,a=e.onVideoCaptured,s=e.onFaceNotDetected,u=e.onExit,c=e.classNames,l=void 0===c?{}:c,d=e.colors,f=void 0===d?{}:d,p=e.verbiage,v=void 0===p?{}:p,y=e.debugMode,b=void 0!==y&&y,x=t.useContext(nt),C=x.cameraRef,w=x.videoRef,E=ze(),k=E.ref,D=E.width,M=E.height,T=t.useRef(null),I=t.useRef(null),S=t.useRef([]),N=t.useContext(Dv).onPredictionMade,A=px(C.current),L=A.isRecordingVideo,R=A.startRecordingVideo,F=A.stopRecordingVideo,P=A.videoUrl,U=t.useState(null),_=U[0],j=U[1],B=t.useState(null),z=B[0],G=B[1],V=t.useState(null),W=V[0],q=V[1];f.guidanceMessageBackgroundColor||(f.guidanceMessageBackgroundColor="#ccc"),f.guidanceMessageTextColor||(f.guidanceMessageTextColor="black");var H=rh(v,{guidanceMessageText:"Please sign the box below",acceptBtnText:"Accept",clearBtnText:"Clear"}),Y=t.useRef(null),Z=t.useRef(!1);t.useEffect((function(){Z.current||(Z.current=!0,h(void 0,void 0,void 0,(function(){var e;return m(this,(function(t){switch(t.label){case 0:return Y.current?[3,2]:[4,new Promise((function(e){var t=setInterval((function(){Y.current&&(clearInterval(t),e(null))}),10)}))];case 1:t.sent(),t.label=2;case 2:return R(),e=Y.current.captureStream(24),I.current=new MediaRecorder(e,{videoBitsPerSecond:27e4}),I.current.start(),I.current.ondataavailable=function(e){var t;S.current.push(e.data),"recording"===(null===(t=I.current)||void 0===t?void 0:t.state)&&I.current.stop()},I.current.onstop=function(){var e=new Blob(S.current,{type:"video/mp4"});q(e)},[2]}}))})))}),[L,R,P]),t.useEffect((function(){W&&_&&z&&(null==a||a(W,_,z))}),[a,_,z,W]);var Q=t.useRef(0);t.useEffect((function(){var e;if(T.current&&w.current&&Y.current&&C.current&&L){var t=[C.current.width,C.current.height],n=t[0],r=t[1],o="undefined"!=typeof window&&window.innerWidth<window.innerHeight;o&&n>r&&(n=(e=[r,n])[0],r=e[1]),Y.current.width=n,Y.current.height=r;var i=Y.current.getContext("2d");if(i)return Q.current=requestAnimationFrame((function e(){return h(this,void 0,void 0,(function(){var t;return m(this,(function(a){return T.current&&w.current&&Y.current?(t=[n*(o?.02:.15),r*(o?.15:.25),n*(o?.96:.7),r*(o?.7:.5)],i.drawImage(w.current,0,0,n,r),i.beginPath(),i.fillStyle="rgba(255,255,255,0.5)",i.roundRect.apply(i,g(g([],t,!1),[16],!1)),i.fill(),i.drawImage.apply(i,g([T.current.getCanvas()],t,!1)),Q.current=requestAnimationFrame(e),[2]):(cancelAnimationFrame(Q.current),[2])}))}))})),function(){cancelAnimationFrame(Q.current)}}}),[C,L,s,w]);var $=t.useState(0),X=$[0],K=$[1];return t.useEffect((function(){N((function(e){K((function(t){return 0===e.length?t+1:0}))}))}),[N]),t.useEffect((function(){X>=2&&(null==s||s())}),[X,s]),t.createElement(O,{className:"flex ".concat(null!==(n=l.container)&&void 0!==n?n:"")},H.guidanceMessageText&&t.createElement(ph,{$top:"5vh",className:l.guidanceMessageContainer},t.createElement(hh,{className:l.guidanceMessage,$background:f.guidanceMessageBackgroundColor,$textColor:f.guidanceMessageTextColor},H.guidanceMessageText)),t.createElement(ux,{className:l.canvasContainer},t.createElement(cx,{ref:k,className:l.canvasInner},t.createElement(bb,{ref:T,canvasProps:{width:D,height:M,className:l.canvas}})),t.createElement(lx,{className:l.buttonsRow},t.createElement(le,{variant:"secondary",className:l.clearBtn,onClick:null===(r=T.current)||void 0===r?void 0:r.clear,finished:!0},H.clearBtnText),t.createElement(mx,{variant:"positive",className:l.acceptBtn,style:{marginLeft:"auto"},onClick:function(){var e;if(T.current){var t=xb(T.current);j(t),G(T.current.toDataURL()),F(),null===(e=I.current)||void 0===e||e.stop()}},finished:!0},H.acceptBtnText))),b&&t.createElement(Lf,null,"Video: ",null===(o=C.current)||void 0===o?void 0:o.width,"x",null===(i=C.current)||void 0===i?void 0:i.height),t.createElement(kh,{onClick:u,className:l.exitCaptureBtn}),t.createElement(Ve,{ref:Y}))},mx=o(le)(Mb||(Mb=v(["\n margin-left: auto;\n"],["\n margin-left: auto;\n"]))),gx=function(e){var n=e.videoUrl,r=e.onDoneClick,o=e.onRetryClick,i=e.classNames,a=void 0===i?{}:i,s=e.colors,u=void 0===s?{}:s,c=e.verbiage,l=rh(void 0===c?{}:c,{headingText:"Video signature has been successfully captured!",retryBtnText:"Retry",doneBtnText:"Done"});return t.createElement(_,{className:a.container},t.createElement(j,{className:a.inner},t.createElement("h1",{className:a.heading},l.headingText),t.createElement(B,{className:a.videoContainer},t.createElement(vx,{className:a.video,src:n,poster:n+"#t=0.1",controls:!0,preload:"metadata",autoPlay:!0})),t.createElement(Dh,{className:a.buttonsRow},t.createElement(le,{variant:"warning",className:a.retryBtn,onClick:o,colors:u.retryBtn,finished:!0},l.retryBtnText),t.createElement(le,{variant:"positive",className:a.doneBtn,onClick:r,colors:u.doneBtn,finished:!0},l.doneBtnText))))},vx=o.video(Tb||(Tb=v(["\n margin-left: auto;\n margin-right: auto;\n max-width: 100%;\n"],["\n margin-left: auto;\n margin-right: auto;\n max-width: 100%;\n"]))),yx=function(e){var n,r=e.onComplete,o=e.onVideoCaptured,i=e.onRetryClicked,a=e.onExitCapture,s=e.onUserCancel,u=e.loadingOverlayMode,c=void 0===u?"default":u,l=e.skipSuccessScreen,d=void 0!==l&&l,f=e.assets,p=void 0===f?{}:f,g=e.classNames,v=void 0===g?{}:g,y=e.colors,b=void 0===y?{}:y,x=e.verbiage,C=void 0===x?{}:x,E=e.debugMode,k=void 0!==E&&E,D=t.useContext(_e),M=D.selfieImage,T=D.signatureVideoUrl,I=D.setSelfieImage,S=D.setSignatureData,N=D.setSignatureVideoUrl,A=D.logSelfieCaptureAttempt,L=t.useContext(nt),R=L.cameraAccessDenied,F=L.requestCameraAccess,P=L.releaseCameraAccess,U=t.useState("LOADING"),_=U[0],j=U[1],B=t.useRef(),z=t.useRef(),G=t.useRef(),V=t.useContext(Dv),W=V.start,q=V.stop;t.useEffect((function(){B.current=new Date}),[]),t.useEffect((function(){"CHECKING_LIVENESS"===_&&(z.current=new Date)}),[_]);var H=["CHECKING_LIVENESS","CAPTURING_SIGNATURE"].includes(_);t.useEffect((function(){if(H)return W(),function(){q()}}),[H,W,q]);var Y=t.useCallback((function(){var e,t,n;A({autoCapture:"Y",captureTime:(null!==(e=G.current)&&void 0!==e?e:new Date).getTime()-(null!==(t=z.current)&&void 0!==t?t:new Date).getTime(),operationTime:(new Date).getTime()-(null!==(n=B.current)&&void 0!==n?n:new Date).getTime()}),B.current=new Date}),[A]),Z=t.useCallback((function(){j("CHECKING_LIVENESS")}),[]),Q=t.useCallback((function(e){return h(void 0,void 0,void 0,(function(){var t;return m(this,(function(n){switch(n.label){case 0:return j("CAPTURING_SIGNATURE"),Y(),M?[3,2]:(t=I,[4,w(e)]);case 1:t.apply(void 0,[n.sent()]),n.label=2;case 2:return[2]}}))}))}),[Y,M,I]),$=t.useCallback((function(e,t,n){S(t),N(URL.createObjectURL(e)),j("SUCCESS"),null==o||o(e,t,n)}),[o,S,N]),X=t.useCallback((function(){j("CHECKING_LIVENESS")}),[]),K=t.useState(0),J=K[0],ee=K[1],te=t.useCallback((function(){P(),ee((function(e){return e+1})),j("LOADING"),null==a||a(),F()}),[a,P,F]),ne=t.useCallback((function(){null==i||i(),te()}),[te,i]),re=jm(d,"SUCCESS"===_,r);return t.useEffect((function(){R&&(ee((function(e){return e+1})),j("LOADING"))}),[R]),t.createElement(t.Fragment,null,t.createElement(O,{className:"flex ".concat(null!==(n=null==v?void 0:v.container)&&void 0!==n?n:"")},t.createElement(Um,{className:v.cameraFeed}),"LOADING"!==_&&function(){switch(_){case"CHECKING_LIVENESS":return t.createElement(Kv,{onSuccess:Q,onExit:te,classNames:v.faceLiveness,colors:b.faceLiveness,verbiage:C.faceLiveness,debugMode:k});case"CAPTURING_SIGNATURE":return t.createElement(hx,{onVideoCaptured:$,onFaceNotDetected:X,onExit:te,classNames:v,colors:b,verbiage:C,debugMode:k});case"SUCCESS":if(!re)return;return t.createElement(gx,{videoUrl:null!=T?T:"",onDoneClick:r,onRetryClick:ne,classNames:v.success,colors:b.success,verbiage:C.success});default:return null}}()),t.createElement(Vy,{key:J,mode:c,assets:p.loadingOverlay,classNames:v.loadingOverlay,colors:b.loadingOverlay,verbiage:C.loadingOverlay,onDismissed:Z,onUserCancel:s}))},bx=function(e){var n,r=e.className,o=e.imageWidth,i=e.imageHeight,a=e.borderWidth,s=void 0===a?4:a,u=e.assets,c=void 0===u?{}:u,l=t.useContext(nt).cameraRef;c.frontImageUrl||(c.frontImageUrl="".concat(mh,"/Shieldout-IDCard-Front-SVG-Landscape-2.svg")),c.backImageUrl||(c.backImageUrl="".concat(mh,"/Shieldout-IDCard-Back-SVG-Landscape-2.svg"));var d=!(null===(n=l.current)||void 0===n?void 0:n.isRearFacing),f=t.useState(1),p=f[0],h=f[1],m=t.useState(0),g=m[0],v=m[1],y=["rotateY(".concat(g,"deg)")];d&&y.push("scaleX(-1)");var b=["rotateY(".concat(180-g,"deg)")];return d&&b.push("scaleX(-1)"),t.useEffect((function(){var e;function t(){h(1),v(180),e=setTimeout((function(){h(0),v(0)}),1500)}var n=setInterval(t,2500);return e=setTimeout(t,250),function(){clearInterval(n),clearTimeout(e)}}),[]),t.createElement(t.Fragment,null,t.createElement(xx,{src:c.frontImageUrl,alt:"",className:r,$transforms:y.join(" "),$transitionTime:p,$borderWidth:s,$imageWidth:o,$imageHeight:i}),t.createElement(xx,{src:c.backImageUrl,alt:"",className:r,$transforms:b.join(" "),$transitionTime:p,$borderWidth:s,$imageWidth:o,$imageHeight:i,$isBack:!0}))},xx=o.img(Ib||(Ib=v(["\n backface-visibility: hidden;\n transition: transform ","s;\n transform: ",";\n transform-style: preserve-3d;\n position: ",";\n display: block;\n top: ","px;\n width: ","px;\n height: ","px;\n"],["\n backface-visibility: hidden;\n transition: transform ","s;\n transform: ",";\n transform-style: preserve-3d;\n position: ",";\n display: block;\n top: ","px;\n width: ","px;\n height: ","px;\n"])),(function(e){return e.$transitionTime}),(function(e){return e.$transforms}),(function(e){return e.$isBack?"absolute":"relative"}),(function(e){return-e.$borderWidth/2}),(function(e){return e.$imageWidth}),(function(e){return e.$imageHeight+e.$borderWidth})),Cx=function(e){var n,r,i,a,s,u,c,l,d,f,p,h,m,g,v,y,b,x,C,w,E,k=e.requestedAction,D=void 0===k?"SHOW_ID_FRONT":k,M=e.satisfied,T=void 0!==M&&M,I=e.faceGuideBorderWidth,S=e.faceGuideBorderColor,N=e.idCardGuideBorderWidth,A=e.idCardGuideBorderColor,L=e.assets,O=void 0===L?{}:L,R=e.classNames,F=void 0===R?{}:R,P=e.verbiage,U=void 0===P?{}:P,_=t.useContext(nt).cameraRef,j=t.useRef(null),B=t.useState(0),z=B[0],G=B[1],V=t.useState(0),W=V[0],q=V[1];O.frontImageUrl||(O.frontImageUrl="".concat(mh,"/Shieldout-IDCard-Front-SVG-Landscape-2.svg")),O.backImageUrl||(O.backImageUrl="".concat(mh,"/Shieldout-IDCard-Back-SVG-Landscape-2.svg"));var H=rh(U,{idFrontInstructionText:"Display the front of your ID card...",idBackInstructionText:"Display the back of your ID card...",flipIdInstructionText:"Please flip your ID card..."}),Y="SHOW_ID_FRONT"===D?H.idFrontInstructionText:"FLIP_ID"===D?H.flipIdInstructionText:H.idBackInstructionText,Z=o.useTheme();void 0===I&&(I=null!==(i=null===(r=null===(n=Z.idVideoCapture)||void 0===n?void 0:n.faceGuides)||void 0===r?void 0:r.borderWidth)&&void 0!==i?i:4),void 0===S&&(S=null!==(l=T?null===(s=null===(a=Z.idVideoCapture)||void 0===a?void 0:a.faceGuides)||void 0===s?void 0:s.satisfiedColor:null===(c=null===(u=Z.idVideoCapture)||void 0===u?void 0:u.faceGuides)||void 0===c?void 0:c.unsatisfiedColor)&&void 0!==l?l:"white"),void 0===N&&(N=null!==(p=null===(f=null===(d=Z.idVideoCapture)||void 0===d?void 0:d.idCardGuides)||void 0===f?void 0:f.borderWidth)&&void 0!==p?p:4),void 0===A&&(A=null!==(y=T?null===(m=null===(h=Z.idVideoCapture)||void 0===h?void 0:h.idCardGuides)||void 0===m?void 0:m.satisfiedColor:null===(v=null===(g=Z.idVideoCapture)||void 0===g?void 0:g.idCardGuides)||void 0===v?void 0:v.unsatisfiedColor)&&void 0!==y?y:"white");var Q=function(){var e,t,n,r;z||G(null!==(t=null===(e=j.current)||void 0===e?void 0:e.width)&&void 0!==t?t:0),W||q(null!==(r=null===(n=j.current)||void 0===n?void 0:n.height)&&void 0!==r?r:0)};return t.createElement(wx,{className:F.container},t.createElement(Ex,{className:F.faceGuide,$borderWidth:I,$borderColor:S}),t.createElement(kx,{className:F.idCardGuideContainer},t.createElement(Dx,{className:F.idCardGuideInstructionsContainer},t.createElement(Mx,{className:F.idCardGuideInstructions,$textColor:null===(x=null===(b=Z.idVideoCapture)||void 0===b?void 0:b.idCardGuides)||void 0===x?void 0:x.instructionsTextColor,$background:null===(w=null===(C=Z.idVideoCapture)||void 0===C?void 0:C.idCardGuides)||void 0===w?void 0:w.instructionsBackgroundColor},Y)),t.createElement(Tx,{$borderWidth:N,$borderColor:A,className:F.idCardGuideImageContainer},"FLIP_ID"===D?t.createElement(bx,{assets:O,imageWidth:z,imageHeight:W,borderWidth:N,className:F.flipIdPromptImage}):t.createElement(Ix,{ref:j,src:"SHOW_ID_BACK"===D?O.backImageUrl:O.frontImageUrl,alt:"",className:F.idCardGuideImage,$isMirrored:!(null===(E=_.current)||void 0===E?void 0:E.isRearFacing),onLoad:Q,onResize:Q}))))},wx=o.div(Sb||(Sb=v(["\n position: fixed;\n z-index: 1000;\n width: 100dvw;\n height: 100dvh;\n display: flex;\n flex-direction: column;\n font-family: ",";\n"],["\n position: fixed;\n z-index: 1000;\n width: 100dvw;\n height: 100dvh;\n display: flex;\n flex-direction: column;\n font-family: ",";\n"])),(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.fontFamily})),Ex=o.div(Nb||(Nb=v(["\n border-width: ","px;\n border-color: ",";\n border-style: solid;\n border-radius: 50%;\n aspect-ratio: 1 / 1.618;\n height: 50%;\n min-height: 33dvh;\n margin: 4% auto auto;\n"],["\n border-width: ","px;\n border-color: ",";\n border-style: solid;\n border-radius: 50%;\n aspect-ratio: 1 / 1.618;\n height: 50%;\n min-height: 33dvh;\n margin: 4% auto auto;\n"])),(function(e){var t;return null!==(t=e.$borderWidth)&&void 0!==t?t:0}),(function(e){var t;return null!==(t=e.$borderColor)&&void 0!==t?t:"white"})),kx=o.div(Ab||(Ab=v(["\n height: 50%;\n padding: 0 40px;\n display: flex;\n flex-flow: column nowrap;\n margin: 2% auto;\n"],["\n height: 50%;\n padding: 0 40px;\n display: flex;\n flex-flow: column nowrap;\n margin: 2% auto;\n"]))),Dx=o.div(Lb||(Lb=v(["\n width: 100%;\n text-align: center;\n color: white;\n display: flex;\n flex-direction: column;\n justify-content: end;\n"],["\n width: 100%;\n text-align: center;\n color: white;\n display: flex;\n flex-direction: column;\n justify-content: end;\n"]))),Mx=o(hh)(Ob||(Ob=v(["\n align-content: center;\n margin-top: 12px;\n margin-bottom: 12px;\n padding: 8px 12px;\n font-weight: bold;\n"],["\n align-content: center;\n margin-top: 12px;\n margin-bottom: 12px;\n padding: 8px 12px;\n font-weight: bold;\n"]))),Tx=o.div(Rb||(Rb=v(["\n position: relative;\n border: ","px solid\n ",";\n"],["\n position: relative;\n border: ","px solid\n ",";\n"])),(function(e){return e.$borderWidth}),(function(e){return e.$borderColor})),Ix=o.img(Fb||(Fb=v(["\n width: 100%;\n max-height: 100%;\n ","\n"],["\n width: 100%;\n max-height: 100%;\n ","\n"])),(function(e){return e.$isMirrored?"transform: scaleX(-1);":""})),Sx=function(e){var n=e.text,r=e.onComplete,o=e.durationMs,i=void 0===o?15e3:o,a=e.minReadingMs,s=void 0===a?1e4:a,u=e.classNames,c=void 0===u?{}:u,l=e.verbiage,d=void 0===l?{}:l;n=nh(n,"");var f=t.useRef(void 0),p=t.useState(i/1e3),h=p[0],m=p[1],g=rh(d,{headingText:"Please read the following text aloud",doneBtnText:"Done"}),v=t.useCallback((function(e){if(e>0){var t=e-1;m(t),f.current=setTimeout((function(){return v(t)}),1e3)}}),[]);t.useEffect((function(){return m(h),f.current=setTimeout((function(){return v(h)}),1e3),function(){clearTimeout(f.current)}}),[h,v]);var y=t.useState(!1),b=y[0],x=y[1];return t.useEffect((function(){var e=setTimeout((function(){x(!0)}),s);return function(){clearTimeout(e)}}),[s]),t.createElement(Nx,{className:c.container},t.createElement(Ax,{className:c.heading},g.headingText),t.createElement(Lx,{className:c.prompt},n),t.createElement(Ox,{className:c.buttonsRow},t.createElement(Rx,{className:c.timeRemaining},h),t.createElement(Fx,{variant:"positive",className:c.doneBtn,onClick:b?r:void 0,disabled:!b,finished:!0},g.doneBtnText)))},Nx=o.div(Pb||(Pb=v(["\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n display: flex;\n flex-direction: column;\n"],["\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n display: flex;\n flex-direction: column;\n"]))),Ax=o.div(Ub||(Ub=v(["\n padding: 20px;\n font-weight: bold;\n margin: auto auto 32px;\n\n ",";\n ",";\n ",";\n"],["\n padding: 20px;\n font-weight: bold;\n margin: auto auto 32px;\n\n ",";\n ",";\n ",";\n"])),(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme.idVideoCapture)||void 0===t?void 0:t.readTextPrompt)||void 0===n?void 0:n.heading)||void 0===r?void 0:r.backgroundColor)?"background: ".concat(null===(a=null===(i=null===(o=e.theme.idVideoCapture)||void 0===o?void 0:o.readTextPrompt)||void 0===i?void 0:i.heading)||void 0===a?void 0:a.backgroundColor,";"):""}),(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme.idVideoCapture)||void 0===t?void 0:t.readTextPrompt)||void 0===n?void 0:n.heading)||void 0===r?void 0:r.textColor)?"color: ".concat(null===(a=null===(i=null===(o=e.theme.idVideoCapture)||void 0===o?void 0:o.readTextPrompt)||void 0===i?void 0:i.heading)||void 0===a?void 0:a.textColor,";"):""}),(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme.idVideoCapture)||void 0===t?void 0:t.readTextPrompt)||void 0===n?void 0:n.heading)||void 0===r?void 0:r.borderRadius)?"border-radius: ".concat(null===(a=null===(i=null===(o=e.theme.idVideoCapture)||void 0===o?void 0:o.readTextPrompt)||void 0===i?void 0:i.heading)||void 0===a?void 0:a.borderRadius,";"):""})),Lx=o.div(_b||(_b=v(["\n margin: 0 auto;\n text-align: center;\n padding: 50px;\n font-size: 24px;\n max-width: ",";\n\n ",";\n ",";\n ",";\n"],["\n margin: 0 auto;\n text-align: center;\n padding: 50px;\n font-size: 24px;\n max-width: ",";\n\n ",";\n ",";\n ",";\n"])),"undefined"!=typeof window&&window.innerWidth>window.innerHeight?"40%":"90%",(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme.idVideoCapture)||void 0===t?void 0:t.readTextPrompt)||void 0===n?void 0:n.prompt)||void 0===r?void 0:r.backgroundColor)?"background: ".concat(null===(a=null===(i=null===(o=e.theme.idVideoCapture)||void 0===o?void 0:o.readTextPrompt)||void 0===i?void 0:i.prompt)||void 0===a?void 0:a.backgroundColor,";"):""}),(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme.idVideoCapture)||void 0===t?void 0:t.readTextPrompt)||void 0===n?void 0:n.prompt)||void 0===r?void 0:r.textColor)?"color: ".concat(null===(a=null===(i=null===(o=e.theme.idVideoCapture)||void 0===o?void 0:o.readTextPrompt)||void 0===i?void 0:i.prompt)||void 0===a?void 0:a.textColor,";"):""}),(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme.idVideoCapture)||void 0===t?void 0:t.readTextPrompt)||void 0===n?void 0:n.prompt)||void 0===r?void 0:r.borderRadius)?"border-radius: ".concat(null===(a=null===(i=null===(o=e.theme.idVideoCapture)||void 0===o?void 0:o.readTextPrompt)||void 0===i?void 0:i.prompt)||void 0===a?void 0:a.borderRadius,";"):""})),Ox=o(Dh)(jb||(jb=v(["\n margin: 32px auto auto;\n gap: 20px;\n"],["\n margin: 32px auto auto;\n gap: 20px;\n"]))),Rx=o.div(Bb||(Bb=v(["\n padding: 20px;\n\n ",";\n ",";\n ",";\n"],["\n padding: 20px;\n\n ",";\n ",";\n ",";\n"])),(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme.idVideoCapture)||void 0===t?void 0:t.readTextPrompt)||void 0===n?void 0:n.timeRemaining)||void 0===r?void 0:r.backgroundColor)?"background: ".concat(null===(a=null===(i=null===(o=e.theme.idVideoCapture)||void 0===o?void 0:o.readTextPrompt)||void 0===i?void 0:i.timeRemaining)||void 0===a?void 0:a.backgroundColor,";"):""}),(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme.idVideoCapture)||void 0===t?void 0:t.readTextPrompt)||void 0===n?void 0:n.timeRemaining)||void 0===r?void 0:r.textColor)?"color: ".concat(null===(a=null===(i=null===(o=e.theme.idVideoCapture)||void 0===o?void 0:o.readTextPrompt)||void 0===i?void 0:i.timeRemaining)||void 0===a?void 0:a.textColor,";"):""}),(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme.idVideoCapture)||void 0===t?void 0:t.readTextPrompt)||void 0===n?void 0:n.timeRemaining)||void 0===r?void 0:r.borderRadius)?"border-radius: ".concat(null===(a=null===(i=null===(o=e.theme.idVideoCapture)||void 0===o?void 0:o.readTextPrompt)||void 0===i?void 0:i.timeRemaining)||void 0===a?void 0:a.borderRadius,";"):""})),Fx=o(le)(zb||(zb=v(["\n margin: auto 0;\n"],["\n margin: auto 0;\n"]))),Px=.05,Ux={detection:{idCardFront:.6,idCardBack:.6,passport:1},focus:{idCardFront:{desktop:0,mobile:0},idCardBack:{desktop:0,mobile:0},passport:{desktop:0,mobile:0}},goodFrames:{idCardFront:1,idCardBack:1}},_x=function(e){var n,r,i,a,s,u,c,l,d,f,p,g,v,y,b,x,C,w,E,k=e.onComplete,D=e.onIdFrontImageCaptured,M=e.onIdBackImageCaptured,T=e.onFaceNotDetected,I=e.onRecordingFailed,S=e.onExitCapture,N=e.idCaptureModelsEnabled,A=void 0===N||N,L=e.idCardFrontDelay,R=void 0===L?1e3:L,F=e.videoIdCaptureThresholds,P=void 0===F?Ux:F,U=e.skipShowIdCardBack,_=void 0!==U&&U,j=e.captureCountdownSeconds,B=void 0===j?3:j,z=e.readTextPrompt,G=e.readTextTimeoutDurationMs,V=void 0===G?15e3:G,W=e.readTextMinReadingMs,q=void 0===W?1e4:W,H=e.disableFaceDetectionWhileAudioCapture,Y=void 0!==H&&H,Z=e.disableFaceDetectionWhileAudioCaptureMsDelay,Q=void 0===Z?2e3:Z,$=e.mergeAVStreams,X=void 0!==$&&$,K=e.assets,J=void 0===K?{}:K,ee=e.classNames,te=void 0===ee?{}:ee,ne=e.colors,re=void 0===ne?{}:ne,oe=e.verbiage,ie=void 0===oe?{}:oe,ae=e.debugMode,se=void 0!==ae&&ae,ue=ze(),ce=ue.ref,le=ue.width,de=void 0===le?1:le,fe=ue.height,pe=void 0===fe?1:fe,he=t.useContext(nt),me=he.cameraRef,ge=he.videoRef,ve=he.videoLoaded,ye=he.cameraReady,be=he.microphoneReady,xe=he.audioStream,Ce=he.setVideoLoaded,we=t.useState([]),Ee=we[0],ke=we[1],De=t.useState([]),Me=De[0],Te=De[1],Ie=t.useContext(bf),Se=Ie.ready,Ne=Ie.start,Ae=Ie.stop,Le=Ie.onPredictionMade,Oe=Ie.setThresholds,Re=Ie.bestFrameDetails,Fe=Ie.resetBestFrame,Pe=Ie.modelError,Ue=t.useState(null),je=Ue[0],Be=Ue[1],Ge=t.useContext(_e),qe=Ge.setIdCaptureVideoAudioStartsAt,He=Ge.setExpectedAudioText,Ye=t.useContext(Dv),Ze=Ye.onPredictionMade,Qe=Ye.error,$e=px(me.current,xe,X),Xe=$e.isRecordingVideo,Ke=$e.startRecordingVideo,Je=$e.startRecordingAudio,et=$e.stopRecordingVideo,tt=$e.stopRecordingAudio,rt=$e.videoRecordingUnintentionallyStopped,ot=$e.audioRecordingUnintentionallyStopped,it=$e.videoUrl,at=$e.audioUrl,st=t.useRef(void 0),ut=t.useState(-1),ct=ut[0],lt=ut[1];t.useEffect((function(){Xe||it||(Ke(),Be(new Date)),it&&(!(!!z&&!X)||at)&&(Ce(!1),null==k||k(it,at))}),[at,Xe,X,k,z,Ce,Ke,it]),t.useEffect((function(){(rt||ot)&&(null==I||I())}),[ot,I,rt]);var dt=t.useState("SHOW_ID_FRONT"),ft=dt[0],pt=dt[1],ht=A&&ve&&ye&&Se&&!Pe&&"READ_TEXT"!==ft&&(!z||be);t.useEffect((function(){if(ht)return Ne(),function(){Ae()}}),[ht,Ne,Ae]),t.useEffect((function(){Oe(P)}),[ft,Oe,P]);var mt=t.useState(0),gt=mt[0],vt=mt[1],yt=t.useState(0),bt=yt[0],xt=yt[1],Ct=t.useState(0),wt=Ct[0],Et=Ct[1],kt="SHOW_ID_FRONT"===ft?P.goodFrames.idCardFront:P.goodFrames.idCardBack,Dt=wt>=kt;t.useEffect((function(){A&&!Pe&&Le((function(e){ke(e.detectedObjects),vt(e.detectionScore),xt(e.focusScore);var t=("SHOW_ID_FRONT"===ft?e.idCardFrontDetectionThresholdMet:e.idCardBackDetectionThresholdMet)&&e.focusThresholdMet;if("FLIP_ID"===ft&&t)return pt("SHOW_ID_BACK");Et(t?function(e){return e+1}:0)}))}),[A,Le,Pe,ft]);var Mt=t.useState(null),Tt=Mt[0],It=Mt[1];t.useEffect((function(){1===wt&&It((new Date).getTime())}),[wt]);var St="SHOW_ID_FRONT"!==ft||null!==Tt&&(new Date).getTime()>Tt+R,Nt=nh(z,""),At=t.useCallback((function(){var e;Nt?(pt("READ_TEXT"),Je(),qe((new Date).getTime()-(null!==(e=null==je?void 0:je.getTime())&&void 0!==e?e:0)),He(Nt)):et()}),[He,qe,Je,et,Nt,je]),Lt=null!==(r=null===(n=ge.current)||void 0===n?void 0:n.videoWidth)&&void 0!==r?r:0,Ot=null!==(a=null===(i=ge.current)||void 0===i?void 0:i.videoHeight)&&void 0!==a?a:0,Rt=null===(s=null==Me?void 0:Me[0])||void 0===s?void 0:s.box,Ft=!Rt||!Lt||Rt.xMin>Lt*Px&&Rt.yMin>Ot*Px&&Rt.xMax<.95*Lt&&Rt.yMax<.95*Ot,Pt=t.useState(),Ut=Pt[0],_t=Pt[1],jt=t.useRef(null),Bt=t.useRef(!1),zt=t.useCallback((function(){return h(void 0,void 0,void 0,(function(){var e;return m(this,(function(t){switch(t.label){case 0:if(Bt.current)return[2];if(Bt.current=!0,We(jt.current,ge.current),!(e=jt.current.toDataURL("image/jpeg")))return Bt.current=!1,[2];t.label=1;case 1:return t.trys.push([1,,7,8]),"SHOW_ID_FRONT"!=ft?[3,5]:(D&&D(e),_?!0!==_?[3,2]:[2,At()]:[3,4]);case 2:return[4,_()];case 3:if(t.sent())return[2,At()];t.label=4;case 4:return pt("FLIP_ID"),[3,6];case 5:"SHOW_ID_BACK"==ft&&(M&&M(e),At()),t.label=6;case 6:return[3,8];case 7:return ke([]),vt(0),xt(0),Et(0),_t(void 0),Fe(),Bt.current=!1,st.current&&clearTimeout(st.current),[7];case 8:return[2]}}))}))}),[At,M,D,ft,Fe,_,ge]),Gt="FLIP_ID"===ft;t.useEffect((function(){if(Gt){var e=setTimeout((function(){pt("SHOW_ID_BACK")}),6e3);return function(){clearTimeout(e)}}}),[Gt]);var Vt=t.useCallback((function(){et(),tt()}),[tt,et]),Wt=!Gt&&Dt&&Ft&&St;t.useEffect((function(){Wt&&!Ut&&_t(new Date)}),[Ut,Wt]),t.useEffect((function(){return function(){clearTimeout(st.current)}}),[]);var qt=t.useCallback((function(e){if(e>0){var t=e-1;return lt(t),void(st.current=setTimeout((function(){return qt(t)}),1e3))}}),[st]);t.useEffect((function(){if(Ut)return lt(B),st.current=setTimeout((function(){return qt(B)}),1e3),function(){clearTimeout(st.current)}}),[B,Ut,qt]),t.useEffect((function(){0===ct&&(lt(-1),zt().then())}),[zt,ct]);var Ht=Bv(V,Vt,"READ_TEXT"!==ft,!1,"READ_TEXT"===ft).timeoutStartedAt,Yt=t.useState(0),Zt=Yt[0],Qt=Yt[1];t.useEffect((function(){Qe||Ze((function(e){Te(e),Qt((function(t){return 0===e.length?t+1:0}))}))}),[Ze,Qe]),t.useEffect((function(){!(Y&&(null==Ht?void 0:Ht.getTime())&&(new Date).getTime()-(null==Ht?void 0:Ht.getTime())>Q)&&Zt>=2&&(null==T||T())}),[Y,Q,Zt,T,Ht]);var $t=o.useTheme(),Xt=rh(ie,{faceNotCenteredText:"Please move your face to the center...",searchingForIdCardText:"Searching for ID card...",captureBtnText:"Capture"}),Kt=Xt.captureBtnText,Jt=Xt.faceNotCenteredText,en=Xt.searchingForIdCardText,tn=Uf({enabled:se,pageWidth:de,pageHeight:pe,videoWidth:null!==(c=null===(u=ge.current)||void 0===u?void 0:u.videoWidth)&&void 0!==c?c:0,videoHeight:null!==(d=null===(l=ge.current)||void 0===l?void 0:l.videoHeight)&&void 0!==d?d:0}),nn=["SHOW_ID_FRONT","SHOW_ID_BACK"].includes(ft),rn=Ft?A&&nn&&!Dt?en:void 0:Jt;return t.createElement(O,{ref:ce,className:"flex ".concat(null!==(f=te.container)&&void 0!==f?f:"")},t.createElement(Ve,{ref:jt}),"READ_TEXT"===ft?t.createElement(Sx,{text:z,startedAt:Ht||void 0,durationMs:V,minReadingMs:q,classNames:te.readTextPrompt,verbiage:ie.readTextPrompt,onComplete:Vt}):t.createElement(t.Fragment,null,t.createElement(Cx,{assets:J.guides,classNames:te.guides,verbiage:ie.guides,requestedAction:ft,satisfied:Wt,faceGuideBorderColor:Wt?re.guidesSatisfiedColor:re.guidesUnsatisfiedColor,idCardGuideBorderColor:Wt?re.guidesSatisfiedColor:re.guidesUnsatisfiedColor}),se&&nn&&t.createElement(t.Fragment,null,t.createElement(Rf,{$flipX:!(null===(p=me.current)||void 0===p?void 0:p.isRearFacing)},Ee.map((function(e,n){var r;return t.createElement(Vf,{key:n,obj:e,scaling:tn,color:"blue",flipX:!(null===(r=me.current)||void 0===r?void 0:r.isRearFacing)})}))),t.createElement(Gf,null,Me.map((function(e,n){return t.createElement(Wf,{key:n,face:e,scaling:tn})}))))),rn&&A&&!Pe&&t.createElement(ph,{className:te.guidanceMessageContainer},t.createElement(hh,{className:te.guidanceMessage,$background:null!==(y=null===(v=null===(g=$t.guidanceMessages)||void 0===g?void 0:g.negative)||void 0===v?void 0:v.backgroundColor)&&void 0!==y?y:"red",$textColor:null!==(C=null===(x=null===(b=$t.guidanceMessages)||void 0===b?void 0:b.negative)||void 0===x?void 0:x.textColor)&&void 0!==C?C:"white"},rn)),se&&t.createElement(Lf,null,me.current?t.createElement(t.Fragment,null,"✅ Camera: ",me.current.label," (",me.current.width,"x",me.current.height,")"):"❌ Camera not ready",t.createElement("br",null),Xe?"✅ Recording":"❌ Not recording",t.createElement("br",null),Dt?"✅":"❌"," Good Frame Count:"," ",wt,"/",kt,t.createElement("br",null),"Detection Score: ",gt,t.createElement("br",null),"Focus Score: ",bt,t.createElement("br",null),"Best Frame Detection Score: ",null!==(w=null==Re?void 0:Re.detectionScore)&&void 0!==w?w:0,t.createElement("br",null),"Best Frame Focus Score: ",null!==(E=null==Re?void 0:Re.focusScore)&&void 0!==E?E:0),ct>0&&nn&&t.createElement(jx,{className:te.countdownContainer},t.createElement(Bx,{className:te.countdown},ct)),(!A||Pe)&&nn&&t.createElement(zx,{className:te.captureBtnContainer},t.createElement(Gx,{finished:!0,onClick:function(){_t(new Date)},disabled:!!Ut||Bt.current,className:te.captureBtn},Kt)),t.createElement(kh,{onClick:S,className:te.exitCaptureBtn}))},jx=o.div(Gb||(Gb=v(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100dvw;\n height: 100dvh;\n z-index: 99999;\n display: flex;\n"],["\n position: fixed;\n top: 0;\n left: 0;\n width: 100dvw;\n height: 100dvh;\n z-index: 99999;\n display: flex;\n"]))),Bx=o.div(Vb||(Vb=v(["\n color: white;\n font-size: 64px;\n font-weight: bold;\n margin: auto;\n"],["\n color: white;\n font-size: 64px;\n font-weight: bold;\n margin: auto;\n"]))),zx=o.div(Wb||(Wb=v(["\n position: fixed;\n bottom: 0;\n width: 100dvw;\n display: flex;\n z-index: 100000;\n"],["\n position: fixed;\n bottom: 0;\n width: 100dvw;\n display: flex;\n z-index: 100000;\n"]))),Gx=o(le)(qb||(qb=v(["\n margin: 0 auto 25px;\n"],["\n margin: 0 auto 25px;\n"]))),Vx=function(e){var n=e.videoUrl,r=e.audioUrl,o=e.idFrontImageUrl,i=e.idBackImageUrl,a=e.onDoneClick,s=e.onRetryClick,u=e.classNames,c=void 0===u?{}:u,l=e.colors,d=void 0===l?{}:l,f=e.verbiage,p=void 0===f?{}:f,h=t.useState("video"),m=h[0],g=h[1],v=rh(p,{headingText:"Video ID has been successfully captured!",retryBtnText:"Retry",doneBtnText:"Done",idFrontText:"ID Front Image",idBackText:"ID Back Image"});return t.createElement(_,{className:c.container},t.createElement(j,{className:c.inner},t.createElement("h1",{className:c.heading},v.headingText),t.createElement(qx,{className:c.assetSelectorOptions},t.createElement(Hx,{className:c.assetSelectorOption},t.createElement("input",{type:"radio",id:"displayedAssetVideo",value:"video",checked:"video"===m,onChange:function(){return g("video")}}),t.createElement("label",{htmlFor:"displayedAssetVideo"},"Video")),r&&t.createElement(Hx,{className:c.assetSelectorOption},t.createElement("input",{type:"radio",id:"displayedAssetAudio",value:"audio",checked:"audio"===m,onChange:function(){return g("audio")}}),t.createElement("label",{htmlFor:"displayedAssetAudio"},"Audio")),t.createElement(Hx,{className:c.assetSelectorOption},t.createElement("input",{type:"radio",id:"displayedAssetIdFrontImage",value:"idFrontImage",checked:"idFrontImage"===m,onChange:function(){return g("idFrontImage")}}),t.createElement("label",{htmlFor:"displayedAssetIdFrontImage"},v.idFrontText)),i&&t.createElement(Hx,{className:c.assetSelectorOption},t.createElement("input",{type:"radio",id:"displayedAssetIdBackImage",value:"idBackImage",checked:"idBackImage"===m,onChange:function(){return g("idBackImage")}}),t.createElement("label",{htmlFor:"displayedAssetIdBackImage"},v.idBackText))),t.createElement(B,{className:c.videoContainer},"video"===m?t.createElement(Wx,{src:n,className:c.video,poster:n+"#t=0.1",controls:!0,preload:"metadata",autoPlay:!0}):"audio"===m?t.createElement("div",null,t.createElement("h3",null,"Audio"),t.createElement("audio",{controls:!0},t.createElement("source",{src:r}))):t.createElement("img","idFrontImage"===m?{src:o,alt:"ID Front Image"}:{src:i,alt:"ID Back Image"})),t.createElement(Dh,{className:c.buttonsRow},t.createElement(le,{variant:"warning",className:c.retryBtn,onClick:s,colors:d.retryBtn,finished:!0},v.retryBtnText),t.createElement(le,{variant:"positive",className:c.doneBtn,onClick:a,colors:d.doneBtn,finished:!0},v.doneBtnText))))},Wx=o.video(Hb||(Hb=v(["\n margin-left: auto;\n margin-right: auto;\n max-width: 100%;\n"],["\n margin-left: auto;\n margin-right: auto;\n max-width: 100%;\n"]))),qx=o.div(Yb||(Yb=v(["\n margin-bottom: 15px;\n display: flex;\n justify-content: center;\n"],["\n margin-bottom: 15px;\n display: flex;\n justify-content: center;\n"]))),Hx=o.div(Zb||(Zb=v(["\n padding: 0 8px;\n"],["\n padding: 0 8px;\n"]))),Yx=function(e){var n,r,o,i,a,s=e.onComplete,u=e.onExitCapture,c=e.onExitAfterFailure,l=e.onUserCancel,d=e.onIdCaptureModelError,p=e.onCameraAccessDenied,g=e.onMicrophoneAccessDenied,v=e.idCaptureProps,y=void 0===v?{}:v,x=e.faceLivenessProps,C=void 0===x?{}:x,w=e.idCaptureModelsEnabled,E=void 0===w||w,k=e.videoIdCaptureThresholds,D=void 0===k?Ux:k,M=e.readTextPrompt,T=e.readTextTimeoutDurationMs,I=e.readTextMinReadingMs,S=e.skipIdCapture,N=void 0!==S&&S,A=e.skipShowIdCardBack,L=void 0!==A&&A,R=e.skipSuccessScreen,F=void 0!==R&&R,P=e.idCaptureLoadingOverlayMode,U=void 0===P?"default":P,_=e.idCaptureGuideType,j=void 0===_?"fit":_,B=e.idCapturePortraitGuidesOnMobile,z=void 0===B||B,G=e.idCaptureRotateLoadingOverlayImageWhenPortrait,V=void 0===G||G,W=e.idCaptureModelLoadTimeoutMs,q=void 0===W?of:W,H=e.faceLivenessLoadingOverlayMode,Y=void 0===H?"default":H,Z=e.disableFaceDetectionWhileAudioCapture,Q=void 0===Z||Z,$=e.disableFaceDetectionWhileAudioCaptureMsDelay,X=void 0===$?2e3:$,K=e.silentFallback,J=void 0!==K&&K,ee=e.mergeAVStreams,te=void 0!==ee&&ee,ne=e.assets,re=void 0===ne?{}:ne,oe=e.classNames,ie=void 0===oe?{}:oe,ae=e.colors,se=void 0===ae?{}:ae,ue=e.verbiage,ce=void 0===ue?{}:ue,le=e.debugMode,de=void 0!==le&&le,fe=t.useContext(_e),pe=fe.submissionStatus,he=fe.idCaptureVideoUrl,me=fe.idCaptureVideoAudioUrl,ge=fe.idCaptureVideoIdFrontImage,ve=fe.idCaptureVideoIdBackImage,ye=fe.setIdCaptureVideoUrl,be=fe.setIdCaptureVideoIdFrontImage,xe=fe.setIdCaptureVideoIdBackImage,Ce=fe.setIdCaptureVideoAudioUrl,we=t.useState("CAPTURING_ID"),ke=we[0],De=we[1];t.useEffect((function(){N&&"CAPTURING_ID"===ke&&De("CHECKING_LIVENESS")}),[ke,N]);var Me=y.onSuccess,Te=t.useCallback((function(e){null==Me||Me(e),De("CHECKING_LIVENESS")}),[Me]),Ie=t.useCallback((function(){return h(void 0,void 0,void 0,(function(){return m(this,(function(e){return De("CAPTURING_VIDEO"),[2]}))}))}),[]),Se=t.useCallback((function(e,t){return h(void 0,void 0,void 0,(function(){return m(this,(function(n){return ye(e),t&&Ce(t),De("SUCCESS"),F&&(null==s||s()),[2]}))}))}),[s,Ce,ye,F]),Ne=t.useCallback((function(){De("CHECKING_LIVENESS")}),[]),Ae=t.useState(0),Le=Ae[0],Oe=Ae[1],Re=null!=c?c:C.onExitAfterFailure,Fe=t.useCallback((function(e,t){null==Re||Re(e,t),Oe((function(e){return e+1})),De("CAPTURING_ID")}),[Re]),Pe=t.useCallback((function(){Oe((function(e){return e+1})),De("CAPTURING_ID")}),[]),Ue=["LOADING","CAPTURING_ID"].includes(ke);t.useEffect((function(){pe===b.SUBMITTING&&et()}),[pe]);var je=t.useCallback((function(){Oe((function(e){return e+1})),De("CHECKING_LIVENESS")}),[]),Be=t.useCallback((function(){Oe((function(e){return e+1})),null==u||u()}),[u]);return pe===b.SUBMITTING?t.createElement(O,{className:"flex"},t.createElement(Ee,null)):t.createElement(rt,{key:"".concat(Ue?"id":"selfie","-camera-").concat(Le),preferContinuityCamera:Ue,preferFrontFacingCamera:!Ue,requireMicrophoneAccess:!Ue&&!!M,maxVideoWidth:Ue?1920:1280,maxFps:Ue?60:30,onCameraAccessDenied:p,onMicrophoneAccessDenied:g,debugMode:de},t.createElement(Cf,{autoStart:!1,documentDetectionModelUrl:null!==(r=null===(n=y.assets)||void 0===n?void 0:n.documentDetectionModelUrl)&&void 0!==r?r:"",focusModelUrl:null!==(i=null===(o=y.assets)||void 0===o?void 0:o.focusModelUrl)&&void 0!==i?i:"",onModelError:d,modelLoadTimeoutMs:q},t.createElement(Mv,{autoStart:!1,onModelError:null==C?void 0:C.onModelError,modelLoadTimeoutMs:null==C?void 0:C.modelLoadTimeoutMs},t.createElement(O,{className:"flex ".concat(null!==(a=ie.container)&&void 0!==a?a:"")},["CHECKING_LIVENESS","CAPTURING_VIDEO"].includes(ke)&&t.createElement(Um,{className:ie.cameraFeed}),function(){switch(ke){case"CAPTURING_ID":return t.createElement(Nf,null,t.createElement(qy,null,t.createElement(Cv,f({key:"id-capture-".concat(Le),loadingOverlayMode:U,silentFallback:J},y,{assets:re.idCapture,classNames:ie.idCapture,colors:se.idCapture,verbiage:ce.idCapture,onSuccess:Te,onExitCapture:Be,onUserCancel:l,skipSuccessScreen:!0,releaseCameraAccessOnExit:!1,guideType:j,portraitGuidesOnMobile:z,rotateLoadingOverlayImageWhenPortrait:V,debugMode:de}))));case"CHECKING_LIVENESS":return t.createElement(Wy,f({key:"face-liveness-".concat(Le),loadingOverlayMode:Y,silentFallback:J},C,{onComplete:Ie,onExitCapture:Be,onExitAfterFailure:Fe,onUserCancel:l,skipSuccessScreen:!0,renderCameraFeed:!1,releaseCameraAccessOnExit:!1,assets:re.faceLiveness,classNames:ie.faceLiveness,colors:se.faceLiveness,verbiage:ce.faceLiveness,debugMode:de}));case"CAPTURING_VIDEO":return t.createElement(_x,{key:"id-video-capture-".concat(Le),onComplete:Se,onIdFrontImageCaptured:be,onIdBackImageCaptured:xe,onFaceNotDetected:Ne,onRecordingFailed:je,onExitCapture:Be,idCaptureModelsEnabled:E,videoIdCaptureThresholds:D,skipShowIdCardBack:L,disableFaceDetectionWhileAudioCapture:Q,disableFaceDetectionWhileAudioCaptureMsDelay:X,readTextPrompt:M,readTextTimeoutDurationMs:T,readTextMinReadingMs:I,mergeAVStreams:te,assets:re.idVideoCapture,classNames:ie.idVideoCapture,colors:se.idVideoCapture,verbiage:ce.idVideoCapture,debugMode:de});case"SUCCESS":return t.createElement(Vx,{videoUrl:null!=he?he:"",audioUrl:null!=me?me:"",idFrontImageUrl:null!=ge?ge:"",idBackImageUrl:null!=ve?ve:void 0,onDoneClick:s,onRetryClick:Pe,classNames:ie.success,colors:se.success,verbiage:ce.success});default:return t.createElement(t.Fragment,null)}}()))))},Zx=function(e){var n,r,o,i,a,s=e.checks,u=e.idCaptureProps,c=void 0===u?{}:u,l=e.faceLivenessProps,d=void 0===l?{}:l,p=e.additionalDocumentCaptureProps,h=e.signatureCaptureProps,m=void 0===h?{}:h,v=e.videoSignatureCaptureProps,y=void 0===v?{}:v,x=e.videoIdCaptureProps,C=void 0===x?{}:x,w=e.captureSignature,E=void 0!==w&&w,k=e.captureSignatureVideo,D=void 0!==k&&k,M=e.onCameraAccessDenied,T=e.onMicrophoneAccessDenied,I=e.debugMode,S=void 0!==I&&I,N=t.useContext(_e),A=N.submit,L=N.submissionStatus,R=N.setSignatureData,F=N.setAdditionalDocuments,P=t.useState(0),U=P[0],_=P[1],j=t.useMemo((function(){var e,t,n=g([],s,!0);if(E&&D)throw new Error("captureSignature and captureSignatureVideo cannot be used together");return E&&n.push("SignatureCapture"),D&&(n.push("VideoSignatureCapture"),n.includes("FaceLiveness")&&n.splice(n.indexOf("FaceLiveness"),1)),null!==(t=null===(e=null==p?void 0:p.documents)||void 0===e?void 0:e.length)&&void 0!==t&&t&&n.push("AdditionalDocumentCapture"),n}),[null===(n=null==p?void 0:p.documents)||void 0===n?void 0:n.length,E,D,s]),B=j[U],z=U>=j.length;t.useEffect((function(){"SignatureCapture"===B&&"function"==typeof E?E().then((function(e){e||_((function(e){return e+1}))})):"VideoSignatureCapture"===B&&"function"==typeof D&&D().then((function(e){e||_((function(e){return e+1}))}))}),[E,D,B]),t.useEffect((function(){z&&A()}),[z,A]);var G=c.onSuccess,V=t.useCallback((function(e){null==G||G(e),_((function(e){return e+1}))}),[G]),W=C.onComplete,q=t.useCallback((function(){null==W||W(),_((function(e){return e+1}))}),[W]),H=d.onComplete,Y=t.useCallback((function(e,t){null==H||H(e,t),_((function(e){return e+1}))}),[H]),Z=t.useCallback((function(e){R(e),_((function(e){return e+1}))}),[R]),Q=y.onComplete,$=t.useCallback((function(){null==Q||Q(),_((function(e){return e+1}))}),[Q]),X=t.useState(0),K=X[0],J=X[1],ee=y.onRetryClicked,te=t.useCallback((function(){null==ee||ee(),J((function(e){return e+1}))}),[ee]),ne=null==p?void 0:p.onComplete,re=t.useCallback((function(e){F(e),null==ne||ne(e),_((function(e){return e+1}))}),[ne,F]),oe=t.useMemo((function(){var e;return null!==(e=null==p?void 0:p.documents)&&void 0!==e?e:[]}),[null==p?void 0:p.documents]);if(z)switch(L){case b.SUBMITTING:return t.createElement(O,{className:"flex"},t.createElement(Ee,null));case b.SUBMITTED:return t.createElement(Hy,null);case b.FAILED:return t.createElement(t.Fragment,null,"Submission failed!");default:return t.createElement(t.Fragment,null,"Complete!!")}switch(j[U]){case"IdCapture":return t.createElement(rt,{key:"IdCaptureCamera",onCameraAccessDenied:M,onMicrophoneAccessDenied:T,debugMode:S},t.createElement(Cf,{autoStart:!1,documentDetectionModelUrl:null!==(o=null===(r=c.assets)||void 0===r?void 0:r.documentDetectionModelUrl)&&void 0!==o?o:"",focusModelUrl:null!==(a=null===(i=c.assets)||void 0===i?void 0:i.focusModelUrl)&&void 0!==a?a:"",onModelError:c.onModelError,modelLoadTimeoutMs:c.modelLoadTimeoutMs},t.createElement(Nf,null,t.createElement(qy,null,t.createElement(Cv,f({},c,{onSuccess:V}))))));case"VideoIdCapture":return t.createElement(Yx,f({},C,{onComplete:q,onCameraAccessDenied:M,onMicrophoneAccessDenied:T}));case"FaceLiveness":return t.createElement(rt,{key:"FaceLivenessCamera",preferFrontFacingCamera:!0,preferContinuityCamera:!1,onCameraAccessDenied:M,onMicrophoneAccessDenied:T,debugMode:S},t.createElement(Mv,{autoStart:!1,onModelError:d.onModelError,modelLoadTimeoutMs:d.modelLoadTimeoutMs},t.createElement(Wy,f({},d,{onComplete:Y}))));case"SignatureCapture":return t.createElement(dx,f({},m,{onAccept:Z}));case"VideoSignatureCapture":return t.createElement(rt,{key:"SignatureKycCamera-".concat(K),preferContinuityCamera:!1,preferFrontFacingCamera:!0,maxVideoWidth:1280,maxFps:30,onCameraAccessDenied:M,onMicrophoneAccessDenied:T,debugMode:S},t.createElement(Mv,{autoStart:!1,throttleMs:250,onModelError:y.onModelError,modelLoadTimeoutMs:y.modelLoadTimeoutMs},t.createElement(yx,f({},y,{onComplete:$,onRetryClicked:te}))));case"AdditionalDocumentCapture":return t.createElement(ub,f({},p,{documents:oe,onComplete:re}));default:return t.createElement(t.Fragment,null)}},Qx={default:{fontFamily:"Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif",isFullscreen:!0,background:"white",textColor:"black",textAlign:"center",padding:"25px",colors:{primary:{50:"#eef8ff",100:"#d8eeff",200:"#b9e0ff",300:"#89cfff",400:"#52b4ff",500:"#2a91ff",600:"#0d6efd",700:"#0c5ae9",800:"#1149bc",900:"#144194",950:"#11295a"},secondary:{50:"#f6f6f6",100:"#e7e7e7",200:"#d1d1d1",300:"#b0b0b0",400:"#888888",500:"#666666",600:"#5d5d5d",700:"#4f4f4f",800:"#454545",900:"#3d3d3d",950:"#262626"},positive:{50:"#f1fcf9",100:"#cef9eb",200:"#9df2d8",300:"#65e3c2",400:"#4fd4ad",500:"#1cb090",600:"#16a085",700:"#147160",800:"#155a4f",900:"#164b42",950:"#062d28"},negative:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},warning:{50:"#fdf5ef",100:"#fbe7d9",200:"#f6cdb2",300:"#f0ab81",400:"#ea8557",500:"#e35e2c",600:"#d54621",700:"#b1341d",800:"#8d2b1f",900:"#72261c",950:"#3d100d"}},buttons:{style:"bootstrap",primary:{backgroundColor:"var(--idm-color-primary-600)",textColor:"white"},secondary:{backgroundColor:"var(--idm-color-secondary-500)",textColor:"white"},positive:{backgroundColor:"var(--idm-color-positive-600)",textColor:"white"},negative:{backgroundColor:"var(--idm-color-negative-400)",textColor:"white"},warning:{backgroundColor:"var(--idm-color-warning-400)",textColor:"white"},loading:{backgroundColor:"gray",textColor:"white"}},guidanceMessages:{default:{backgroundColor:"var(--idm-color-secondary-200)",textColor:"black"},positive:{backgroundColor:"var(--idm-color-positive-700)",textColor:"white"},negative:{backgroundColor:"var(--idm-color-negative-600)",textColor:"white"}},idCapture:{loadingOverlay:{backgroundColor:"#ecedf3",textColor:"black",loadingGraphicAccentColor:"var(--idm-color-positive-600)",loadingGraphicAccentOpacity:.2,progressBarBackgroundColor:"var(--idm-color-positive-600)",progressBarBackgroundOpacity:.75,progressBarIndicatorColor:"var(--idm-color-positive-600)",progressBarTextColor:"white",continueBtnBorder:"2px solid white"},guideOverlay:{backgroundColor:"#708090",textColor:"white"},guideBox:{unsatisfiedColor:"white",satisfiedColor:"var(--idm-color-positive-500)",borderWidth:4,desktopPadding:50,mobilePadding:0,imagePadding:25}},selfieCapture:{loadingOverlay:{backgroundColor:"#ecedf3",textColor:"black",loadingGraphicAccentColor:"var(--idm-color-positive-600)",progressBarBackgroundColor:"var(--idm-color-positive-600)",progressBarBackgroundOpacity:.75,progressBarIndicatorColor:"var(--idm-color-positive-600)",progressBarTextColor:"white",continueBtnBorder:"2px solid white"},guides:{unsatisfiedColor:"white",satisfiedColor:"var(--idm-color-positive-500)"}},signatureCapture:{background:"radial-gradient(#444cf7 0.5px, transparent 0.5px), radial-gradient(#444cf7 0.5px, #e5e5f7 0.5px)",backgroundSize:"20px 20px",backgroundPosition:"0 0, 10px 10px"},idVideoCapture:{readTextPrompt:{heading:{backgroundColor:"rgba(255, 255, 255, 0.5)",textColor:"black",borderRadius:"8px"},prompt:{backgroundColor:"rgba(255, 255, 255, 0.5)",textColor:"black",borderRadius:"8px"},timeRemaining:{backgroundColor:"rgba(255, 255, 255, 0.5)",textColor:"black",borderRadius:"4px"}}}},none:{}},$x=function(e){var n,r=e.children,i="string"==typeof(n=e.theme)?n in Qx?Qx[n]:Qx.none:n,a=i.colors;return t.useEffect((function(){for(var e in a){var t=a[e];for(var n in t){var r=t[n];document.documentElement.style.setProperty("--idm-color-".concat(e,"-").concat(n),r)}}}),[a]),t.createElement(o.ThemeProvider,{theme:i},r)},Xx=function(e){var n=e.lang,r=e.sessionId,o=e.clientRequestID,i=e.submissionUrl,a=e.authUrl,s=e.documentServiceUrl,u=e.companyId,c=e.needImmediateResponse,l=e.manualReviewRequired,d=e.idBackImageRequired,f=e.verifyIdWithExternalDatabases,p=e.bypassAgeValidation,h=e.bypassNameMatching,m=e.personalData,g=e.cardData,v=e.idData,b=e.webhooksEnabled,x=e.webhooksClientTraceId,C=e.webhooksStripSpecialCharacters,w=e.webhooksSendInputImages,E=e.webhooksSendProcessedImages,k=e.webhooksFireOnReview,D=e.sendBase64DocumentsInSwaggerProxy,M=e.customerDataMatchConfig,T=e.precapturedDocuments,I=e.loadingOverlayMode,S=void 0===I?"default":I,N=e.idCaptureRequirement,A=void 0===N?"idCardOrPassport":N,L=e.separateIdCardCaptureSequence,O=void 0!==L&&L,R=e.idCaptureThresholds,F=void 0===R?yf:R,P=e.skipSuccessScreen,U=void 0!==P&&P,_=e.instructions,j=e.guideType,B=void 0===j?"fit":j,z=e.portraitGuidesOnMobile,G=void 0===z||z,V=e.rotateLoadingOverlayImageWhenPortrait,W=void 0===V||V,q=e.modelLoadTimeoutMs,H=void 0===q?of:q,Y=e.forceFallbackMode,Z=void 0!==Y&&Y,Q=e.allowIdCardBackToFrontCapture,$=void 0!==Q&&Q,X=e.onBeforeSubmit,K=e.onBeforeDocumentUpload,J=e.onDocumentUploadProgress,ee=e.onDocumentUploaded,te=e.onDocumentUploadFailed,ne=e.onSubmit,re=e.onComplete,oe=e.onApproved,ie=e.onDenied,ae=e.onExitCapture,se=e.onUserCancel,ue=e.onModelError,ce=e.onCameraAccessDenied,le=e.theme,de=void 0===le?"default":le,fe=e.assets,pe=void 0===fe?{}:fe,he=e.classNames,me=void 0===he?{}:he,ge=e.colors,ve=void 0===ge?{}:ge,ye=e.verbiage,be=void 0===ye?{}:ye,xe=e.captureSignature,Ce=void 0!==xe&&xe,we=e.captureSignatureVideo,Ee=void 0!==we&&we,ke=e.captureAdditionalDocuments,De=void 0===ke?[]:ke,Me=e.geolocationEnabled,Te=void 0===Me||Me,Ie=e.geolocationRequired,Se=void 0!==Ie&&Ie,Ae=e.debugMode,Oe=void 0!==Ae&&Ae;eh(void 0===n?"auto":n),Le(Oe);var Re=t.useMemo((function(){return{onExitCapture:ae,onUserCancel:se,onModelError:ue,precapturedDocuments:T,captureRequirement:A,separateIdCardCaptureSequence:O,thresholds:F,skipSuccessScreen:U,loadingOverlayMode:S,forceFallbackMode:Z,allowIdCardBackToFrontCapture:$,instructions:_,guideType:B,portraitGuidesOnMobile:G,rotateLoadingOverlayImageWhenPortrait:W,modelLoadTimeoutMs:H,assets:pe,classNames:me,colors:ve,verbiage:be,debugMode:Oe}}),[ae,se,ue,T,A,O,F,U,S,Z,$,_,B,G,W,H,pe,me,ve,be,Oe]),Fe=t.useMemo((function(){return{documents:De,classNames:me.additionalDocumentCapture,verbiage:be.additionalDocumentCapture}}),[De,me.additionalDocumentCapture,be.additionalDocumentCapture]),Pe=t.useMemo((function(){return{classNames:me.signatureCapture,verbiage:be.signatureCapture}}),[me.signatureCapture,be.signatureCapture]),Ue=t.useMemo((function(){return{onExitCapture:ae,onUserCancel:se,skipSuccessScreen:U,classNames:me.videoSignatureCapture,colors:ve.videoSignatureCapture,verbiage:be.videoSignatureCapture,debugMode:Oe}}),[me.videoSignatureCapture,ve.videoSignatureCapture,Oe,ae,se,U,be.videoSignatureCapture]),_e=t.useCallback((function(e,t){null==re||re(e,t),"Approved"===e.resultData.verificationResult?null==oe||oe(e,t):null==ie||ie(e,t)}),[oe,re,ie]);return t.createElement(Ne,{sessionId:r,authUrl:a},t.createElement($x,{theme:de},t.createElement(je,{action:y.VALIDATE,submissionUrl:i,clientRequestID:o,documentServiceUrl:s,companyId:u,needImmediateResponse:c,manualReviewRequired:l,idBackImageRequired:d,verifyIdWithExternalDatabases:f,bypassAgeValidation:p,bypassNameMatching:h,personalData:m,cardData:g,idData:v,webhooksEnabled:b,webhooksClientTraceId:x,webhooksStripSpecialCharacters:C,webhooksSendInputImages:w,webhooksSendProcessedImages:E,webhooksFireOnReview:k,sendBase64DocumentsInSwaggerProxy:D,customerDataMatchConfig:M,onBeforeDocumentUpload:K,onDocumentUploadProgress:J,onDocumentUploaded:ee,onDocumentUploadFailed:te,onBeforeSubmit:X,onSubmit:ne,onResponseReceived:_e,geolocationEnabled:Te,geolocationRequired:Se},t.createElement(Zx,{checks:t.useMemo((function(){return["IdCapture"]}),[]),idCaptureProps:Re,additionalDocumentCaptureProps:Fe,signatureCaptureProps:Pe,videoSignatureCaptureProps:Ue,captureSignature:Ce,captureSignatureVideo:Ee,onCameraAccessDenied:ce,debugMode:Oe}))))},Kx=function(e){var n=e.lang,r=e.sessionId,o=e.authUrl,i=e.submissionUrl,a=e.documentServiceUrl,s=e.companyId,u=e.needImmediateResponse,c=e.webhooksEnabled,l=e.webhooksClientTraceId,d=e.webhooksStripSpecialCharacters,f=e.webhooksSendInputImages,p=e.webhooksSendProcessedImages,h=e.sendBase64DocumentsInSwaggerProxy,m=e.loadingOverlayMode,g=void 0===m?"default":m,v=e.timeoutDurationMs,b=void 0===v?15e3:v,x=e.modelLoadTimeoutMs,C=void 0===x?Gd:x,w=e.skipSuccessScreen,E=void 0!==w&&w,k=e.idCardForFaceMatch,D=e.onBeforeDocumentUpload,M=e.onDocumentUploadProgress,T=e.onDocumentUploaded,I=e.onDocumentUploadFailed,S=e.onBeforeSubmit,N=e.onComplete,A=e.onApproved,L=e.onDenied,O=e.onExitCapture,R=e.onExitAfterFailure,F=e.onUserCancel,P=e.onModelError,U=e.onCameraAccessDenied,_=e.theme,j=void 0===_?"default":_,B=e.assets,z=e.classNames,G=e.colors,V=e.verbiage,W=e.geolocationEnabled,q=void 0===W||W,H=e.geolocationRequired,Y=void 0!==H&&H,Z=e.debugMode,Q=void 0!==Z&&Z;eh(void 0===n?"auto":n),Le(Q);var $=t.useMemo((function(){return{loadingOverlayMode:g,timeoutDurationMs:b,modelLoadTimeoutMs:C,skipSuccessScreen:E,onComplete:N,onSuccess:A,onTimeout:L,onExitCapture:O,onExitAfterFailure:R,onModelError:P,onUserCancel:F,assets:B,classNames:z,colors:G,verbiage:V,debugMode:Q}}),[B,z,G,Q,g,C,A,N,L,R,O,P,F,E,b,V]);return t.createElement(Ne,{sessionId:r,authUrl:o},t.createElement($x,{theme:j},t.createElement(je,{action:y.NONE,submissionUrl:i,documentServiceUrl:a,companyId:s,needImmediateResponse:u,webhooksEnabled:c,webhooksClientTraceId:l,webhooksStripSpecialCharacters:d,webhooksSendInputImages:f,webhooksSendProcessedImages:p,sendBase64DocumentsInSwaggerProxy:h,idCardForFaceMatch:k,onBeforeDocumentUpload:D,onDocumentUploadProgress:M,onDocumentUploaded:T,onDocumentUploadFailed:I,onBeforeLivenessCheck:S,geolocationEnabled:q,geolocationRequired:Y},t.createElement(Zx,{checks:t.useMemo((function(){return["FaceLiveness"]}),[]),faceLivenessProps:$,onCameraAccessDenied:U,debugMode:Q}))))},Jx=function(e){var n=e.lang,r=e.sessionId,o=e.authUrl,i=e.submissionUrl,a=e.documentServiceUrl,s=e.companyId,u=e.needImmediateResponse,c=e.manualReviewRequired,l=e.idBackImageRequired,d=e.verifyIdWithExternalDatabases,f=e.bypassAgeValidation,p=e.bypassNameMatching,h=e.personalData,m=e.cardData,g=e.idData,v=e.webhooksEnabled,b=e.webhooksClientTraceId,x=e.webhooksStripSpecialCharacters,C=e.webhooksSendInputImages,w=e.webhooksSendProcessedImages,E=e.webhooksFireOnReview,k=e.sendBase64DocumentsInSwaggerProxy,D=e.customerDataMatchConfig,M=e.precapturedDocuments,T=e.idCaptureLoadingOverlayMode,I=void 0===T?"default":T,S=e.idCaptureRequirement,N=void 0===S?"idCardOrPassport":S,A=e.idCaptureThresholds,L=void 0===A?yf:A,O=e.faceLivenessLoadingOverlayMode,R=void 0===O?"default":O,F=e.faceLivenessTimeoutDurationMs,P=void 0===F?15e3:F,U=e.skipSuccessScreen,_=void 0!==U&&U,j=e.idCaptureInstructions,B=e.idCaptureGuideType,z=void 0===B?"fit":B,G=e.idCapturePortraitGuidesOnMobile,V=void 0===G||G,W=e.idCaptureRotateLoadingOverlayImageWhenPortrait,q=void 0===W||W,H=e.idCaptureModelLoadTimeoutMs,Y=void 0===H?of:H,Z=e.selfieCaptureModelLoadTimeoutMs,Q=void 0===Z?Gd:Z,$=e.onBeforeDocumentUpload,X=e.onDocumentUploaded,K=e.onDocumentUploadProgress,J=e.onDocumentUploadFailed,ee=e.onBeforeLivenessCheck,te=e.onBeforeSubmit,ne=e.onSubmit,re=e.onComplete,oe=e.onApproved,ie=e.onDenied,ae=e.onExitCapture,se=e.onExitAfterFailure,ue=e.onUserCancel,ce=e.onIdCaptureModelError,le=e.onSelfieCaptureModelError,de=e.onCameraAccessDenied,fe=e.captureSignature,pe=void 0!==fe&&fe,he=e.captureSignatureVideo,me=void 0!==he&&he,ge=e.captureAdditionalDocuments,ve=void 0===ge?[]:ge,ye=e.theme,be=void 0===ye?"default":ye,xe=e.assets,Ce=void 0===xe?{}:xe,we=e.classNames,Ee=void 0===we?{}:we,ke=e.colors,De=void 0===ke?{}:ke,Me=e.verbiage,Te=void 0===Me?{}:Me,Ie=e.geolocationEnabled,Se=void 0===Ie||Ie,Ae=e.geolocationRequired,Oe=void 0!==Ae&&Ae,Re=e.debugMode,Fe=void 0!==Re&&Re;eh(void 0===n?"auto":n),Le(Fe);var Pe=t.useMemo((function(){return{onExitCapture:ae,onUserCancel:ue,onModelError:ce,assets:Ce.idCapture,classNames:Ee.idCapture,colors:De.idCapture,verbiage:Te.idCapture,precapturedDocuments:M,captureRequirement:N,thresholds:L,loadingOverlayMode:I,instructions:j,guideType:z,portraitGuidesOnMobile:V,rotateLoadingOverlayImageWhenPortrait:q,modelLoadTimeoutMs:Y,skipSuccessScreen:_,debugMode:Fe}}),[ae,ue,ce,Ce.idCapture,Ee.idCapture,De.idCapture,Te.idCapture,M,N,L,I,j,z,V,q,Y,_,Fe]),Ue=t.useMemo((function(){return{loadingOverlayMode:R,timeoutDurationMs:P,modelLoadTimeoutMs:Q,onTimeout:ie,onExitCapture:ae,onExitAfterFailure:se,onUserCancel:ue,onModelError:le,skipSuccessScreen:_,assets:Ce.faceLiveness,classNames:Ee.faceLiveness,colors:De.faceLiveness,verbiage:Te.faceLiveness,debugMode:Fe}}),[Ce.faceLiveness,Ee.faceLiveness,De.faceLiveness,Fe,R,P,ie,se,ae,le,ue,Q,_,Te.faceLiveness]),_e=t.useMemo((function(){return{documents:ve,classNames:Ee.additionalDocumentCapture,verbiage:Te.additionalDocumentCapture}}),[ve,Ee.additionalDocumentCapture,Te.additionalDocumentCapture]),Be=t.useMemo((function(){return{classNames:Ee.signatureCapture,verbiage:Te.signatureCapture}}),[Ee.signatureCapture,Te.signatureCapture]),ze=t.useMemo((function(){return{onExitCapture:ae,onUserCancel:ue,skipSuccessScreen:_,classNames:Ee.videoSignatureCapture,colors:De.videoSignatureCapture,verbiage:Te.videoSignatureCapture,debugMode:Fe}}),[Ee.videoSignatureCapture,De.videoSignatureCapture,Fe,ae,ue,_,Te.videoSignatureCapture]),Ge=t.useCallback((function(e,t){null==re||re(e,t),"Approved"===e.resultData.verificationResult?null==oe||oe(e,t):null==ie||ie(e,t)}),[oe,re,ie]),Ve=t.useMemo((function(){return(null==M?void 0:M.selfie)?["IdCapture"]:["IdCapture","FaceLiveness"]}),[null==M?void 0:M.selfie]);return t.createElement(Ne,{sessionId:r,authUrl:o},t.createElement($x,{theme:be},t.createElement(je,{action:y.VALIDATE,submissionUrl:i,documentServiceUrl:a,companyId:s,needImmediateResponse:u,manualReviewRequired:c,idBackImageRequired:l,verifyIdWithExternalDatabases:d,bypassAgeValidation:f,bypassNameMatching:p,personalData:h,cardData:m,idData:g,webhooksEnabled:v,webhooksClientTraceId:b,webhooksStripSpecialCharacters:x,webhooksSendInputImages:C,webhooksSendProcessedImages:w,webhooksFireOnReview:E,sendBase64DocumentsInSwaggerProxy:k,customerDataMatchConfig:D,precapturedDocuments:M,onBeforeDocumentUpload:$,onDocumentUploadProgress:K,onDocumentUploaded:X,onDocumentUploadFailed:J,onBeforeSubmit:te,onBeforeLivenessCheck:ee,onSubmit:ne,onResponseReceived:Ge,geolocationEnabled:Se,geolocationRequired:Oe},t.createElement(Zx,{checks:Ve,idCaptureProps:Pe,faceLivenessProps:Ue,signatureCaptureProps:Be,videoSignatureCaptureProps:ze,additionalDocumentCaptureProps:_e,captureSignature:pe,captureSignatureVideo:me,onCameraAccessDenied:de,debugMode:Fe}))))},eC=function(e){var n=e.enrollmentId,r=e.lang,o=e.sessionId,i=e.authUrl,a=e.submissionUrl,s=e.documentServiceUrl,u=e.companyId,c=e.needImmediateResponse,l=e.manualReviewRequired,d=e.idBackImageRequired,f=e.idImageResolutionCheck,p=e.verifyIdWithExternalDatabases,h=e.bypassAgeValidation,m=e.bypassNameMatching,g=e.personalData,v=e.cardData,b=e.idData,x=e.deduplicationEnabled,C=e.deduplicationSynchronous,w=e.webhooksEnabled,E=e.webhooksClientTraceId,k=e.webhooksStripSpecialCharacters,D=e.webhooksSendInputImages,M=e.webhooksSendProcessedImages,T=e.webhooksFireOnReview,I=e.sendBase64DocumentsInSwaggerProxy,S=e.customerDataMatchConfig,N=e.idCaptureLoadingOverlayMode,A=void 0===N?"default":N,L=e.idCaptureRequirement,O=void 0===L?"idCardOrPassport":L,R=e.idCaptureThresholds,F=void 0===R?yf:R,P=e.faceLivenessTimeoutDurationMs,U=void 0===P?15e3:P,_=e.faceLivenessLoadingOverlayMode,j=void 0===_?"default":_,B=e.skipSuccessScreen,z=void 0!==B&&B,G=e.idCaptureInstructions,V=e.idCaptureGuideType,W=void 0===V?"fit":V,q=e.idCapturePortraitGuidesOnMobile,H=void 0===q||q,Y=e.idCaptureRotateLoadingOverlayImageWhenPortrait,Z=void 0===Y||Y,Q=e.idCaptureModelLoadTimeoutMs,$=void 0===Q?of:Q,X=e.selfieCaptureModelLoadTimeoutMs,K=void 0===X?Gd:X,J=e.onBeforeDocumentUpload,ee=e.onDocumentUploadProgress,te=e.onDocumentUploaded,ne=e.onDocumentUploadFailed,re=e.onBeforeSubmit,oe=e.onSubmit,ie=e.onComplete,ae=e.onEnrolled,se=e.onDenied,ue=e.onExitCapture,ce=e.onExitAfterFailure,le=e.onUserCancel,de=e.onIdCaptureModelError,fe=e.onSelfieCaptureModelError,pe=e.onCameraAccessDenied,he=e.captureSignature,me=void 0!==he&&he,ge=e.captureSignatureVideo,ve=void 0!==ge&&ge,ye=e.captureAdditionalDocuments,be=void 0===ye?[]:ye,xe=e.theme,Ce=void 0===xe?"default":xe,we=e.assets,Ee=void 0===we?{}:we,ke=e.classNames,De=void 0===ke?{}:ke,Me=e.colors,Te=void 0===Me?{}:Me,Ie=e.verbiage,Se=void 0===Ie?{}:Ie,Ae=e.geolocationEnabled,Oe=void 0===Ae||Ae,Re=e.geolocationRequired,Fe=void 0!==Re&&Re,Pe=e.debugMode,Ue=void 0!==Pe&&Pe;eh(void 0===r?"auto":r),Le(Ue);var _e=t.useMemo((function(){return{assets:Ee.idCapture,classNames:De.idCapture,colors:Te.idCapture,verbiage:Se.idCapture,captureRequirement:O,thresholds:F,loadingOverlayMode:A,instructions:G,guideType:W,portraitGuidesOnMobile:H,rotateLoadingOverlayImageWhenPortrait:Z,modelLoadTimeoutMs:$,onExitCapture:ue,onUserCancel:le,onModelError:de,skipSuccessScreen:z,debugMode:Ue}}),[Ee.idCapture,De.idCapture,Te.idCapture,Se.idCapture,O,F,A,G,W,H,Z,$,ue,le,de,z,Ue]),Be=t.useMemo((function(){return{onExitCapture:ue,onExitAfterFailure:ce,onUserCancel:le,onModelError:fe,loadingOverlayMode:j,timeoutDurationMs:U,modelLoadTimeoutMs:K,skipSuccessScreen:z,assets:Ee.faceLiveness,classNames:De.faceLiveness,colors:Te.faceLiveness,verbiage:Se.faceLiveness,debugMode:Ue}}),[Ee.faceLiveness,De.faceLiveness,Te.faceLiveness,Ue,j,U,ce,ue,fe,le,K,z,Se.faceLiveness]),ze=t.useMemo((function(){return{documents:be,classNames:De.additionalDocumentCapture,verbiage:Se.additionalDocumentCapture}}),[be,De.additionalDocumentCapture,Se.additionalDocumentCapture]),Ge=t.useMemo((function(){return{classNames:De.signatureCapture,verbiage:Se.signatureCapture}}),[De.signatureCapture,Se.signatureCapture]),Ve=t.useMemo((function(){return{onExitCapture:ue,onUserCancel:le,skipSuccessScreen:z,classNames:De.videoSignatureCapture,colors:Te.videoSignatureCapture,verbiage:Se.videoSignatureCapture,debugMode:Ue}}),[De.videoSignatureCapture,Te.videoSignatureCapture,Ue,ue,le,z,Se.videoSignatureCapture]),We=t.useCallback((function(e,t){null==ie||ie(e,t),"Customer Onboarded"===e.resultData.verificationResult?null==ae||ae(e,t):null==se||se(e,t)}),[ae,ie,se]);return t.createElement(Ne,{sessionId:o,authUrl:i},t.createElement($x,{theme:Ce},t.createElement(je,{action:y.ENROLL,submissionUrl:a,documentServiceUrl:s,companyId:u,enrollmentId:n,needImmediateResponse:c,manualReviewRequired:l,idBackImageRequired:d,idImageResolutionCheck:f,verifyIdWithExternalDatabases:p,bypassAgeValidation:h,bypassNameMatching:m,personalData:g,cardData:v,idData:b,deduplicationEnabled:x,deduplicationSynchronous:C,webhooksEnabled:w,webhooksClientTraceId:E,webhooksStripSpecialCharacters:k,webhooksSendInputImages:D,webhooksSendProcessedImages:M,webhooksFireOnReview:T,sendBase64DocumentsInSwaggerProxy:I,customerDataMatchConfig:S,onBeforeDocumentUpload:J,onDocumentUploadProgress:ee,onDocumentUploaded:te,onDocumentUploadFailed:ne,onBeforeSubmit:re,onSubmit:oe,onResponseReceived:We,geolocationEnabled:Oe,geolocationRequired:Fe},t.createElement(Zx,{checks:t.useMemo((function(){return["IdCapture","FaceLiveness"]}),[]),idCaptureProps:_e,faceLivenessProps:Be,additionalDocumentCaptureProps:ze,signatureCaptureProps:Ge,videoSignatureCaptureProps:Ve,captureSignature:me,captureSignatureVideo:ve,onCameraAccessDenied:pe,debugMode:Ue}))))},tC={frame:null,face:null,imageUrl:null,requestState:"CAPTURING",requestError:null,unverifiedTimes:0},nC=function(e,t){switch(t.type){case"verificationReady":return["CAPTURING","ERROR"].includes(e.requestState)?f(f({},e),{requestState:"CAPTURED",frame:t.payload.frame,face:t.payload.face}):e;case"verifying":return f(f({},e),{requestState:"VERIFYING",imageUrl:t.payload.imageUrl});case"verificationCompleted":var n=t.payload.response,r=n.status,o=r.statusMessage,i=r.errorData,a=n.resultData;if("000"!==r.statusCode)return f(f({},e),{requestState:"ERROR",requestError:new Error("".concat(o,": ").concat(i))});var s=e.requestState,u=e.unverifiedTimes;return"00"===a.verificationResultCode?s="VERIFIED":u<0?(s="CAPTURING",u+=1):s="REJECTED",f(f({},e),{requestState:s,unverifiedTimes:u});case"verificationFailed":return f(f({},e),{requestState:"ERROR",requestError:t.payload.error});default:return e}},rC=function(e){var n,r,i=e.onCustomerMatched,a=e.onCustomerNotMatched,s=e.onCaptureGuidanceTimeout,u=e.onExit,c=e.captureGuidanceTimeoutDurationMs,l=e.classNames,d=void 0===l?{}:l,f=e.colors,p=void 0===f?{}:f,g=e.verbiage,v=void 0===g?{}:g,y=e.debugMode,b=void 0!==y&&y,x=t.useReducer(nC,tC),C=x[0],E=x[1],k=C.frame,D=C.face,M=t.useContext(_e),T=M.submit,I=M.submissionRequest,S=M.submissionResponse,N=M.submissionError,A=M.selfieImage,L=M.setSelfieImage,O=t.useState(null),R=O[0],F=O[1],P=t.useRef(null),U=t.useRef(null),_=t.useRef(null),j=t.useCallback((function(e,t){E({type:"verificationReady",payload:{frame:e,face:t}})}),[]),B="CAPTURED"===C.requestState;t.useEffect((function(){if(k&&D&&!N){var e=kd(P.current,U.current,_.current,k,D);F(e),w(e).then((function(e){L(e)}))}}),[D,k,L,N]),t.useEffect((function(){B&&A&&!N&&h(void 0,void 0,void 0,(function(){var e,t;return m(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),E({type:"verifying",payload:{imageUrl:A}}),[4,T()];case 1:if(!(e=n.sent()))throw new Error("submission failed!");return E({type:"verificationCompleted",payload:{response:e}}),[3,3];case 2:return t=n.sent(),E({type:"verificationFailed",payload:{error:t}}),[3,3];case 3:return[2]}}))}))}),[B,i,a,A,C.requestState,N,T]),t.useEffect((function(){I&&S&&("VERIFIED"===C.requestState?null==i||i(S,I):"REJECTED"===C.requestState&&(null==a||a(S,I)))}),[i,a,C.requestState,I,S]),Bv(c,s,["VERIFIED","REJECTED"].includes(C.requestState),"VERIFYING"===C.requestState);var z=nh(v.progressPreviewText,"Processing..."),G=o.useTheme();return t.createElement(t.Fragment,null,t.createElement(Ve,{ref:P}),t.createElement(Ve,{ref:U}),t.createElement(Ve,{ref:_}),t.createElement(Qv,{onSelfieCaptured:j,onExit:u,timeoutDurationMs:c,classNames:d,colors:p,verbiage:v,debugMode:b}),!(null===(r=null===(n=G.selfieCapture)||void 0===n?void 0:n.capturePreview)||void 0===r?void 0:r.disabled)&&R&&t.createElement(Fg,{imageUrl:R,text:z,classNames:d.imagePreview}))},oC=function(e){var n=e.imageUrl,r=e.onDoneClick,o=e.onRetryClick,i=e.classNames,a=void 0===i?{}:i,s=e.colors,u=void 0===s?{}:s,c=e.verbiage,l=void 0===c?{}:c;n||(n="".concat(mh,"/Selfie-Image-1.png"));var d=rh(l,{headingText:"Customer has been verified!",retryBtnText:"Retry",doneBtnText:"Done"});return t.createElement(_,{className:a.container},t.createElement(j,{className:a.inner},t.createElement(iC,{className:a.heading},d.headingText),t.createElement(aC,{className:a.imageContainer},t.createElement("img",{alt:d.headingText,src:n,className:a.image})),t.createElement(sC,{className:a.buttonsRow},t.createElement(le,{variant:"warning",className:a.retryBtn,onClick:o,colors:u.retryBtn,finished:!0},d.retryBtnText),t.createElement(le,{variant:"positive",className:a.doneBtn,onClick:r,colors:u.doneBtn,finished:!0},d.doneBtnText))))},iC=o.h3(Qb||(Qb=v(["\n margin-bottom: 24px;\n"],["\n margin-bottom: 24px;\n"]))),aC=o(Dh)($b||($b=v(["\n max-height: calc(100vh - 185px);\n"],["\n max-height: calc(100vh - 185px);\n"]))),sC=o(Dh)(Xb||(Xb=v(["\n margin-top: 24px;\n"],["\n margin-top: 24px;\n"]))),uC=function(e){var n=e.canRetry,r=void 0===n||n,o=e.onRetryClick,i=e.onExitClick,a=e.assets,s=void 0===a?{}:a,u=e.classNames,c=void 0===u?{}:u,l=e.colors,d=void 0===l?{}:l,f=e.verbiage,p=void 0===f?{}:f;s.imageUrl||(s.imageUrl="".concat(mh,"/manual_capture.png"));var h=rh(p,{headingText:"Customer not verified",retryBtnText:"Retry",exitBtnText:"Exit"});return t.createElement(_,{className:c.container},t.createElement(j,{className:c.inner},t.createElement(cC,{className:c.heading},h.headingText),t.createElement(lC,{className:c.imageContainer},t.createElement("img",{alt:h.headingText,src:s.imageUrl,className:c.image})),t.createElement(dC,{className:c.buttonsRow},r&&t.createElement(le,{variant:"warning",className:c.retryBtn,onClick:o,colors:d.retryBtn,finished:!0},h.retryBtnText),t.createElement(le,{variant:"secondary",className:c.exitBtn,onClick:i,colors:d.exitBtn,finished:!0},h.exitBtnText))))},cC=o.h3(Kb||(Kb=v(["\n margin-bottom: 24px;\n"],["\n margin-bottom: 24px;\n"]))),lC=o(Dh)(Jb||(Jb=v(["\n max-height: calc(100vh - 185px);\n"],["\n max-height: calc(100vh - 185px);\n"]))),dC=o(Dh)(ex||(ex=v(["\n margin-top: 24px;\n"],["\n margin-top: 24px;\n"]))),fC=function(e){var n,r=e.onComplete,o=e.onCustomerMatched,i=e.onCustomerNotMatched,a=e.onExitCapture,s=e.onExitAfterFailure,u=e.onUserCancel,c=e.onCaptureGuidanceTimeout,l=e.captureGuidanceTimeoutDurationMs,d=e.skipSuccessScreen,f=void 0!==d&&d,p=e.loadingOverlayMode,g=void 0===p?"default":p,v=e.assets,y=void 0===v?{}:v,b=e.classNames,x=void 0===b?{}:b,C=e.colors,w=void 0===C?{}:C,E=e.verbiage,k=void 0===E?{}:E,D=e.debugMode,M=void 0!==D&&D,T=t.useContext(_e),I=T.submissionRequest,S=T.submissionResponse,N=T.selfieImage,A=t.useState("LOADING"),L=A[0],R=A[1],F=t.useContext(nt),P=F.cameraAccessDenied,U=F.releaseCameraAccess,_=t.useContext(Dv),j=_.start,B=_.stop;t.useEffect((function(){if("CAPTURING"===L)return j(),function(){B()}}),[L,j,B]);var z=t.useCallback((function(e,t){return h(void 0,void 0,void 0,(function(){return m(this,(function(n){return R("MATCHED"),null==o||o(e,t),[2]}))}))}),[o]),G=t.useCallback((function(e,t){return h(void 0,void 0,void 0,(function(){return m(this,(function(n){return R("NOT_MATCHED"),null==i||i(e,t),[2]}))}))}),[i]),V=t.useCallback((function(){R("FAILED"),null==c||c()}),[c]),W=t.useState(0),q=W[0],H=W[1],Y=t.useCallback((function(){H((function(e){return e+1})),R("LOADING"),null==a||a()}),[a]),Z=t.useCallback((function(){U(),I&&S&&(null==r||r(S,I))}),[r,U,I,S]),Q=jm(f,"MATCHED"===L,Z);return t.useEffect((function(){P&&(H((function(e){return e+1})),R("LOADING"))}),[P]),t.createElement(t.Fragment,null,t.createElement(O,{className:"flex ".concat(null!==(n=x.container)&&void 0!==n?n:"")},t.createElement(Um,{className:x.cameraFeed}),"LOADING"!==L&&function(){switch(L){case"CAPTURING":return t.createElement(rC,{key:"capture".concat(q),onCustomerMatched:z,onCustomerNotMatched:G,onCaptureGuidanceTimeout:V,onExit:Y,captureGuidanceTimeoutDurationMs:l,classNames:x,colors:w,verbiage:k,debugMode:M});case"MATCHED":if(!Q)return;return t.createElement(oC,{imageUrl:"data:image/png;base64, ".concat(N),classNames:x.success,colors:w.success,verbiage:k.success,onDoneClick:Z,onRetryClick:function(){R("CAPTURING"),H(0)}});case"NOT_MATCHED":case"FAILED":return t.createElement(uC,{assets:y.failure,classNames:x.failure,colors:w.failure,verbiage:k.failure,canRetry:q<2,onExitClick:function(){U(),null==s||s()},onRetryClick:function(){H((function(e){return e+1}))}});default:return null}}()),t.createElement(Vy,{key:q,mode:g,assets:y.loadingOverlay,classNames:x.loadingOverlay,colors:w.loadingOverlay,verbiage:k.loadingOverlay,onUserCancel:u,onDismissed:function(){R("CAPTURING")}}))},pC=function(e){var n=e.lang,r=e.enrollmentId,o=e.sessionId,i=e.authUrl,a=e.submissionUrl,s=e.documentServiceUrl,u=e.companyId,c=e.needImmediateResponse,l=e.webhooksEnabled,d=e.webhooksClientTraceId,f=e.webhooksStripSpecialCharacters,p=e.webhooksSendInputImages,h=e.webhooksSendProcessedImages,m=e.sendBase64DocumentsInSwaggerProxy,g=e.loadingOverlayMode,v=void 0===g?"default":g,b=e.timeoutDurationMs,x=void 0===b?15e3:b,C=e.modelLoadTimeoutMs,w=void 0===C?Gd:C,E=e.skipSuccessScreen,k=void 0!==E&&E,D=e.theme,M=void 0===D?"default":D,T=e.assets,I=e.classNames,S=e.colors,N=e.verbiage,A=e.onBeforeDocumentUpload,L=e.onDocumentUploadProgress,O=e.onDocumentUploaded,R=e.onDocumentUploadFailed,F=e.onBeforeSubmit,P=e.onSubmit,U=e.onComplete,_=e.onCustomerMatched,j=e.onCustomerNotMatched,B=e.onExitCapture,z=e.onExitAfterFailure,G=e.onUserCancel,V=e.onModelError,W=e.onCameraAccessDenied,q=e.geolocationEnabled,H=void 0===q||q,Y=e.geolocationRequired,Z=void 0!==Y&&Y,Q=e.debugMode,$=void 0!==Q&&Q;return eh(void 0===n?"auto":n),Le($),t.createElement(Ne,{sessionId:o,authUrl:i},t.createElement($x,{theme:M},t.createElement(je,{action:y.VERIFY,submissionUrl:a,documentServiceUrl:s,companyId:u,enrollmentId:r,needImmediateResponse:c,webhooksEnabled:l,webhooksClientTraceId:d,webhooksStripSpecialCharacters:f,webhooksSendInputImages:p,webhooksSendProcessedImages:h,sendBase64DocumentsInSwaggerProxy:m,onBeforeDocumentUpload:A,onDocumentUploadProgress:L,onDocumentUploaded:O,onDocumentUploadFailed:R,onBeforeSubmit:F,onSubmit:P,geolocationEnabled:H,geolocationRequired:Z},t.createElement(rt,{preferFrontFacingCamera:!0,onCameraAccessDenied:W,debugMode:$},t.createElement(Mv,{autoStart:!1,onModelError:V,modelLoadTimeoutMs:w},t.createElement(fC,{onComplete:U,onCustomerMatched:_,onCustomerNotMatched:j,onExitCapture:B,onExitAfterFailure:z,onUserCancel:G,captureGuidanceTimeoutDurationMs:x,loadingOverlayMode:v,skipSuccessScreen:k,assets:T,classNames:I,colors:S,verbiage:N,debugMode:$}))))))},hC={frame:null,face:null,imageUrl:null,requestState:"CAPTURING",requestError:null,notFoundTimes:0},mC=function(e,t){switch(t.type){case"identificationReady":return["CAPTURING","ERROR"].includes(e.requestState)?f(f({},e),{requestState:"CAPTURED",frame:t.payload.frame,face:t.payload.face}):e;case"identifying":return f(f({},e),{requestState:"IDENTIFYING",imageUrl:t.payload.imageUrl});case"identificationCompleted":var n=t.payload.response,r=n.status,o=r.statusMessage,i=r.errorData,a=n.resultData;if("000"!==r.statusCode)return f(f({},e),{requestState:"ERROR",requestError:new Error("".concat(o,": ").concat(i))});var s=e.requestState,u=e.notFoundTimes;return"46"===a.verificationResultCode?s="FOUND":u<0?(s="CAPTURING",u+=1):s="NOT_FOUND",f(f({},e),{requestState:s,notFoundTimes:u});case"identificationFailed":return f(f({},e),{requestState:"ERROR",requestError:t.payload.error});default:return e}},gC=function(e){var n,r,i=e.onCustomerMatched,a=e.onCustomerNotMatched,s=e.onCaptureGuidanceTimeout,u=e.onExit,c=e.captureGuidanceTimeoutDurationMs,l=e.classNames,d=void 0===l?{}:l,f=e.colors,p=void 0===f?{}:f,g=e.verbiage,v=void 0===g?{}:g,y=e.debugMode,b=void 0!==y&&y,x=t.useReducer(mC,hC),C=x[0],E=x[1],k=t.useContext(_e),D=k.submit,M=k.submissionRequest,T=k.submissionResponse,I=k.submissionError,S=k.selfieImage,N=k.setSelfieImage,A=t.useState(null),L=A[0],O=A[1],R=t.useRef(null),F=t.useRef(null),P=t.useRef(null),U=t.useCallback((function(e,t){E({type:"identificationReady",payload:{frame:e,face:t}})}),[]),_=C.frame,j=C.face,B="CAPTURED"===C.requestState;t.useEffect((function(){if(_&&j&&!I){var e=kd(R.current,F.current,P.current,_,j);O(e),w(e).then((function(e){N(e)}))}}),[j,_,N,I]),t.useEffect((function(){B&&S&&!I&&h(void 0,void 0,void 0,(function(){var e,t;return m(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),E({type:"identifying",payload:{imageUrl:S}}),[4,D()];case 1:if(!(e=n.sent()))throw new Error("submission failed!");return E({type:"identificationCompleted",payload:{response:e}}),[3,3];case 2:return t=n.sent(),E({type:"identificationFailed",payload:{error:t}}),[3,3];case 3:return[2]}}))}))}),[B,i,a,S,C.requestState,I,D]),t.useEffect((function(){M&&T&&("FOUND"===C.requestState?null==i||i(T,M):"NOT_FOUND"===C.requestState&&(null==a||a(T,M)))}),[i,a,C.requestState,M,T]),Bv(c,s,["FOUND","NOT_FOUND"].includes(C.requestState),"IDENTIFYING"===C.requestState);var z=nh(v.progressPreviewText,"Processing..."),G=o.useTheme();return t.createElement(t.Fragment,null,t.createElement(Ve,{ref:R}),t.createElement(Ve,{ref:F}),t.createElement(Ve,{ref:P}),t.createElement(Qv,{onSelfieCaptured:U,onExit:u,timeoutDurationMs:c,classNames:d,colors:p,verbiage:v,debugMode:b}),!(null===(r=null===(n=G.selfieCapture)||void 0===n?void 0:n.capturePreview)||void 0===r?void 0:r.disabled)&&L&&t.createElement(Fg,{text:z,imageUrl:L,classNames:d.imagePreview}))},vC=function(e){var n=e.imageUrl,r=e.onDoneClick,o=e.onRetryClick,i=e.classNames,a=void 0===i?{}:i,s=e.colors,u=void 0===s?{}:s,c=e.verbiage,l=void 0===c?{}:c;n||(n="".concat(mh,"/Selfie-Image-1.png"));var d=rh(l,{headingText:"Customer has been identified!",retryBtnText:"Retry",doneBtnText:"Done"});return t.createElement(_,{className:a.container},t.createElement(j,{className:a.inner},t.createElement(yC,{className:a.heading},d.headingText),t.createElement(bC,{className:a.imageContainer},t.createElement("img",{alt:d.headingText,src:n,className:a.image})),t.createElement(xC,{className:a.buttonsRow},t.createElement(le,{variant:"warning",className:a.retryBtn,onClick:o,colors:u.retryBtn,finished:!0},d.retryBtnText),t.createElement(le,{variant:"positive",className:a.doneBtn,onClick:r,colors:u.doneBtn,finished:!0},d.doneBtnText))))},yC=o.h3(tx||(tx=v(["\n margin-bottom: 24px;\n"],["\n margin-bottom: 24px;\n"]))),bC=o(Dh)(nx||(nx=v(["\n max-height: calc(100vh - 185px);\n"],["\n max-height: calc(100vh - 185px);\n"]))),xC=o(Dh)(rx||(rx=v(["\n margin-top: 24px;\n"],["\n margin-top: 24px;\n"]))),CC=function(e){var n=e.canRetry,r=void 0===n||n,o=e.onRetryClick,i=e.onExitClick,a=e.assets,s=void 0===a?{}:a,u=e.classNames,c=void 0===u?{}:u,l=e.colors,d=void 0===l?{}:l,f=e.verbiage,p=void 0===f?{}:f;s.imageUrl||(s.imageUrl="".concat(mh,"/manual_capture.png"));var h=rh(p,{headingText:"Customer not found",retryBtnText:"Retry",exitBtnText:"Exit"});return t.createElement(_,{className:c.container},t.createElement(j,{className:c.inner},t.createElement(wC,{className:c.heading},h.headingText),t.createElement(EC,{className:c.imageContainer},t.createElement("img",{alt:h.headingText,src:s.imageUrl,className:c.image})),t.createElement(kC,{className:c.buttonsRow},r&&t.createElement(le,{variant:"warning",className:c.retryBtn,onClick:o,colors:d.retryBtn,finished:!0},h.retryBtnText),t.createElement(le,{variant:"secondary",className:c.exitBtn,onClick:i,colors:d.exitBtn,finished:!0},h.exitBtnText))))},wC=o.h3(ox||(ox=v(["\n margin-bottom: 24px;\n"],["\n margin-bottom: 24px;\n"]))),EC=o(Dh)(ix||(ix=v(["\n max-height: calc(100vh - 185px);\n"],["\n max-height: calc(100vh - 185px);\n"]))),kC=o(Dh)(ax||(ax=v(["\n margin-top: 24px;\n"],["\n margin-top: 24px;\n"]))),DC=function(e){var n,r=e.onComplete,o=e.onCustomerMatched,i=e.onCustomerNotMatched,a=e.onExitCapture,s=e.onExitAfterFailure,u=e.onUserCancel,c=e.onCaptureGuidanceTimeout,l=e.captureGuidanceTimeoutDurationMs,d=e.skipSuccessScreen,f=void 0!==d&&d,p=e.loadingOverlayMode,g=void 0===p?"default":p,v=e.assets,y=void 0===v?{}:v,b=e.classNames,x=void 0===b?{}:b,C=e.colors,w=void 0===C?{}:C,E=e.verbiage,k=void 0===E?{}:E,D=e.debugMode,M=void 0!==D&&D,T=t.useContext(_e),I=T.submissionResponse,S=T.submissionRequest,N=T.selfieImage,A=t.useState("LOADING"),L=A[0],R=A[1],F=t.useContext(nt),P=F.cameraAccessDenied,U=F.releaseCameraAccess,_=t.useContext(Dv),j=_.start,B=_.stop;t.useEffect((function(){if("CAPTURING"===L)return j(),function(){B()}}),[L,j,B]);var z=t.useCallback((function(e,t){return h(void 0,void 0,void 0,(function(){return m(this,(function(n){return R("FOUND"),null==o||o(e,t),[2]}))}))}),[o]),G=t.useCallback((function(e,t){return h(void 0,void 0,void 0,(function(){return m(this,(function(n){return R("NOT_FOUND"),null==i||i(e,t),[2]}))}))}),[i]),V=t.useCallback((function(){R("FAILED"),null==c||c()}),[c]),W=t.useState(0),q=W[0],H=W[1],Y=t.useCallback((function(){H((function(e){return e+1})),R("LOADING"),null==a||a()}),[a]),Z=t.useCallback((function(){U(),S&&I&&(null==r||r(I,S))}),[r,U,S,I]),Q=jm(f,"FOUND"===L,Z);return t.useEffect((function(){P&&(H((function(e){return e+1})),R("LOADING"))}),[P]),t.createElement(t.Fragment,null,t.createElement(O,{className:"flex ".concat(null!==(n=x.container)&&void 0!==n?n:"")},t.createElement(Um,{className:x.cameraFeed}),"LOADING"!==L&&function(){switch(L){case"CAPTURING":return t.createElement(gC,{key:"capture".concat(q),onCustomerMatched:z,onCustomerNotMatched:G,onCaptureGuidanceTimeout:V,onExit:Y,captureGuidanceTimeoutDurationMs:l,classNames:x,colors:w,verbiage:k,debugMode:M});case"FOUND":if(!Q)return;return t.createElement(vC,{imageUrl:"data:image/png;base64, ".concat(N),classNames:x.success,colors:w.success,verbiage:k.success,onDoneClick:Z,onRetryClick:function(){R("CAPTURING"),H(0)}});case"NOT_FOUND":case"FAILED":return t.createElement(CC,{assets:y.failure,classNames:x.failure,colors:w.failure,verbiage:k.failure,canRetry:q<2,onExitClick:function(){U(),null==s||s()},onRetryClick:function(){H((function(e){return e+1}))}});default:return null}}()),t.createElement(Vy,{key:q,mode:g,assets:y.loadingOverlay,classNames:x.loadingOverlay,colors:w.loadingOverlay,verbiage:k.loadingOverlay,onUserCancel:u,onDismissed:function(){R("CAPTURING")}}))},MC=function(e){var n=e.lang,r=e.sessionId,o=e.authUrl,i=e.submissionUrl,a=e.documentServiceUrl,s=e.companyId,u=e.needImmediateResponse,c=e.webhooksEnabled,l=e.webhooksClientTraceId,d=e.webhooksStripSpecialCharacters,f=e.webhooksSendInputImages,p=e.webhooksSendProcessedImages,h=e.sendBase64DocumentsInSwaggerProxy,m=e.loadingOverlayMode,g=void 0===m?"default":m,v=e.timeoutDurationMs,b=void 0===v?15e3:v,x=e.modelLoadTimeoutMs,C=void 0===x?Gd:x,w=e.skipSuccessScreen,E=void 0!==w&&w,k=e.onBeforeDocumentUpload,D=e.onDocumentUploadProgress,M=e.onDocumentUploaded,T=e.onDocumentUploadFailed,I=e.onBeforeSubmit,S=e.onSubmit,N=e.onComplete,A=e.onCustomerMatched,L=e.onCustomerNotMatched,O=e.onCaptureGuidanceTimeout,R=e.onExitCapture,F=e.onExitAfterFailure,P=e.onUserCancel,U=e.onModelError,_=e.onCameraAccessDenied,j=e.theme,B=void 0===j?"default":j,z=e.assets,G=e.classNames,V=e.colors,W=e.verbiage,q=e.geolocationEnabled,H=e.geolocationRequired,Y=void 0!==H&&H,Z=e.debugMode,Q=void 0!==Z&&Z;return eh(void 0===n?"auto":n),Le(Q),t.createElement(Ne,{sessionId:r,authUrl:o},t.createElement($x,{theme:B},t.createElement(je,{action:y.IDENTIFY,submissionUrl:i,documentServiceUrl:a,companyId:s,needImmediateResponse:u,webhooksEnabled:c,webhooksClientTraceId:l,webhooksStripSpecialCharacters:d,webhooksSendInputImages:f,webhooksSendProcessedImages:p,sendBase64DocumentsInSwaggerProxy:h,onBeforeDocumentUpload:k,onDocumentUploadProgress:D,onDocumentUploaded:M,onDocumentUploadFailed:T,onBeforeSubmit:I,onSubmit:S,geolocationEnabled:q,geolocationRequired:Y},t.createElement(rt,{preferFrontFacingCamera:!0,onCameraAccessDenied:_,debugMode:Q},t.createElement(Mv,{autoStart:!1,modelLoadTimeoutMs:C,onModelError:U},t.createElement(DC,{onComplete:N,onCustomerMatched:A,onCustomerNotMatched:L,onExitCapture:R,onExitAfterFailure:F,onUserCancel:P,onCaptureGuidanceTimeout:O,captureGuidanceTimeoutDurationMs:b,loadingOverlayMode:g,skipSuccessScreen:E,assets:z,classNames:G,colors:V,verbiage:W,debugMode:Q}))))))},TC=function(e){var n=e.lang,r=e.sessionId,o=e.clientRequestID,i=e.authUrl,a=e.submissionUrl,s=e.documentServiceUrl,u=e.sendBase64DocumentsInSwaggerProxy,c=e.onBeforeDocumentUpload,l=e.onDocumentUploadProgress,d=e.onDocumentUploaded,f=e.onDocumentUploadFailed,p=e.onBeforeSubmit,h=e.onSubmit,m=e.onComplete,g=e.onUserCancel,v=e.onModelError,b=e.onCameraAccessDenied,x=e.loadingOverlayMode,C=void 0===x?"default":x,w=e.skipSuccessScreen,E=void 0!==w&&w,k=e.idCardForFaceMatch,D=e.modelLoadTimeoutMs,M=void 0===D?Gd:D,T=e.theme,I=void 0===T?"default":T,S=e.classNames,N=e.colors,A=e.verbiage,L=e.geolocationEnabled,O=e.geolocationRequired,R=e.debugMode,F=void 0!==R&&R;return eh(void 0===n?"auto":n),Le(F),t.createElement(Ne,{sessionId:r,authUrl:i},t.createElement($x,{theme:I},t.createElement(je,{action:y.NONE,submissionUrl:a,clientRequestID:o,documentServiceUrl:s,idCardForFaceMatch:k,sendBase64DocumentsInSwaggerProxy:u,onBeforeDocumentUpload:c,onDocumentUploadProgress:l,onDocumentUploaded:d,onDocumentUploadFailed:f,onBeforeSubmit:p,onSubmit:h,onResponseReceived:m,geolocationEnabled:L,geolocationRequired:O},t.createElement(Zx,{checks:t.useMemo((function(){return["VideoSignatureCapture"]}),[]),onCameraAccessDenied:b,videoSignatureCaptureProps:t.useMemo((function(){return{loadingOverlayMode:C,skipSuccessScreen:E,modelLoadTimeoutMs:M,classNames:S,colors:N,debugMode:F,verbiage:A,onModelError:v,onUserCancel:g}}),[S,N,F,C,M,v,g,E,A])}))))},IC=function(e){var n=e.lang,r=e.sessionId,o=e.clientRequestID,i=e.authUrl,a=e.submissionUrl,s=e.documentServiceUrl,u=e.companyId,c=e.needImmediateResponse,l=e.manualReviewRequired,d=e.idBackImageRequired,f=e.verifyIdWithExternalDatabases,p=e.bypassAgeValidation,h=e.bypassNameMatching,m=e.personalData,g=e.cardData,v=e.idData,b=e.webhooksEnabled,x=e.webhooksClientTraceId,C=e.webhooksStripSpecialCharacters,w=e.webhooksSendInputImages,E=e.webhooksSendProcessedImages,k=e.webhooksFireOnReview,D=e.sendBase64DocumentsInSwaggerProxy,M=e.customerDataMatchConfig,T=e.onBeforeDocumentUpload,I=e.onDocumentUploadProgress,S=e.onDocumentUploaded,N=e.onDocumentUploadFailed,A=e.onSubmit,L=e.onBeforeSubmit,O=e.onComplete,R=e.onExitCapture,F=e.onExitAfterFailure,P=e.onUserCancel,U=e.onCameraAccessDenied,_=e.onMicrophoneAccessDenied,j=e.idCaptureProps,B=e.faceLivenessProps,z=e.idCaptureModelsEnabled,G=void 0===z||z,V=e.videoIdCaptureThresholds,W=void 0===V?Ux:V,q=e.readTextPrompt,H=e.readTextTimeoutDurationMs,Y=void 0===H?15e3:H,Z=e.readTextMinReadingMs,Q=void 0===Z?1e4:Z,$=e.skipSuccessScreen,X=void 0!==$&&$,K=e.skipIdCapture,J=void 0!==K&&K,ee=e.skipShowIdCardBack,te=void 0!==ee&&ee,ne=e.idCaptureLoadingOverlayMode,re=void 0===ne?"default":ne,oe=e.idCaptureGuideType,ie=void 0===oe?"fit":oe,ae=e.idCapturePortraitGuidesOnMobile,se=void 0===ae||ae,ue=e.idCaptureRotateLoadingOverlayImageWhenPortrait,ce=void 0===ue||ue,le=e.idCardForFaceMatch,de=e.faceLivenessLoadingOverlayMode,fe=void 0===de?"default":de,pe=e.disableFaceDetectionWhileAudioCapture,he=void 0!==pe&&pe,me=e.disableFaceDetectionWhileAudioCaptureMsDelay,ge=void 0===me?2e3:me,ve=e.silentFallback,ye=void 0!==ve&&ve,be=e.mergeAVStreams,xe=void 0!==be&&be,Ce=e.theme,we=void 0===Ce?"default":Ce,Ee=e.assets,ke=void 0===Ee?{}:Ee,De=e.classNames,Me=void 0===De?{}:De,Te=e.colors,Ie=void 0===Te?{}:Te,Se=e.verbiage,Ae=void 0===Se?{}:Se,Oe=e.captureSignature,Re=void 0!==Oe&&Oe,Fe=e.captureSignatureVideo,Pe=void 0!==Fe&&Fe,Ue=e.captureAdditionalDocuments,_e=void 0===Ue?[]:Ue,Be=e.geolocationEnabled,ze=void 0===Be||Be,Ge=e.geolocationRequired,Ve=void 0!==Ge&&Ge,We=e.debugMode,qe=void 0!==We&&We;eh(void 0===n?"auto":n),Le(qe);var He=t.useMemo((function(){return{idCaptureProps:j,faceLivenessProps:B,idCaptureModelsEnabled:G,videoIdCaptureThresholds:W,readTextPrompt:q,readTextTimeoutDurationMs:Y,readTextMinReadingMs:Q,onExitCapture:R,onExitAfterFailure:F,onUserCancel:P,skipSuccessScreen:X,skipIdCapture:J,skipShowIdCardBack:te,idCaptureLoadingOverlayMode:re,idCaptureGuideType:ie,idCapturePortraitGuidesOnMobile:se,idCaptureRotateLoadingOverlayImageWhenPortrait:ce,faceLivenessLoadingOverlayMode:fe,disableFaceDetectionWhileAudioCapture:he,disableFaceDetectionWhileAudioCaptureMsDelay:ge,silentFallback:ye,mergeAVStreams:xe,assets:ke,classNames:Me,colors:Ie,verbiage:Ae,debugMode:qe}}),[j,B,G,W,q,Y,Q,R,F,P,X,J,te,re,ie,se,ce,fe,he,ge,ye,xe,ke,Me,Ie,Ae,qe]),Ye=t.useMemo((function(){return{documents:_e,classNames:Me.additionalDocumentCapture,verbiage:Ae.additionalDocumentCapture}}),[_e,Me.additionalDocumentCapture,Ae.additionalDocumentCapture]),Ze=t.useMemo((function(){return{classNames:Me.signatureCapture,verbiage:Ae.signatureCapture}}),[Me.signatureCapture,Ae.signatureCapture]),Qe=t.useMemo((function(){return{onExitCapture:R,onUserCancel:P,skipSuccessScreen:X,classNames:Me.videoSignatureCapture,colors:Ie.videoSignatureCapture,verbiage:Ae.videoSignatureCapture,debugMode:qe}}),[Me.videoSignatureCapture,Ie.videoSignatureCapture,qe,R,P,X,Ae.videoSignatureCapture]);return t.createElement(Ne,{sessionId:r,authUrl:i},t.createElement($x,{theme:we},t.createElement(je,{action:J?y.NONE:y.VALIDATE,submissionUrl:a,clientRequestID:o,documentServiceUrl:s,companyId:u,needImmediateResponse:c,manualReviewRequired:l,idBackImageRequired:d,verifyIdWithExternalDatabases:f,bypassAgeValidation:p,bypassNameMatching:h,personalData:m,cardData:g,idData:v,webhooksEnabled:b,webhooksClientTraceId:x,webhooksStripSpecialCharacters:C,webhooksSendInputImages:w,webhooksSendProcessedImages:E,webhooksFireOnReview:k,sendBase64DocumentsInSwaggerProxy:D,customerDataMatchConfig:M,idCardForFaceMatch:le,onBeforeDocumentUpload:T,onDocumentUploadProgress:I,onDocumentUploaded:S,onDocumentUploadFailed:N,onSubmit:A,onBeforeSubmit:L,onResponseReceived:O,geolocationEnabled:ze,geolocationRequired:Ve},t.createElement(Zx,{checks:t.useMemo((function(){return["VideoIdCapture"]}),[]),videoIdCaptureProps:He,additionalDocumentCaptureProps:Ye,signatureCaptureProps:Ze,videoSignatureCaptureProps:Qe,captureSignature:Re,captureSignatureVideo:Pe,onCameraAccessDenied:U,onMicrophoneAccessDenied:_,debugMode:qe}))))},SC=function(e){var n=e.enrollmentId,r=e.lang,o=e.sessionId,i=e.authUrl,a=e.submissionUrl,s=e.documentServiceUrl,u=e.companyId,c=e.needImmediateResponse,l=e.deduplicationEnabled,d=e.deduplicationSynchronous,f=e.webhooksEnabled,p=e.webhooksClientTraceId,h=e.webhooksStripSpecialCharacters,m=e.webhooksSendInputImages,g=e.webhooksSendProcessedImages,v=e.sendBase64DocumentsInSwaggerProxy,b=e.loadingOverlayMode,x=void 0===b?"default":b,C=e.timeoutDurationMs,w=void 0===C?15e3:C,E=e.modelLoadTimeoutMs,k=void 0===E?Gd:E,D=e.skipSuccessScreen,M=void 0!==D&&D,T=e.onBeforeDocumentUpload,I=e.onDocumentUploadProgress,S=e.onDocumentUploaded,N=e.onDocumentUploadFailed,A=e.onBeforeSubmit,L=e.onSubmit,O=e.onComplete,R=e.onEnrolled,F=e.onDenied,P=e.onExitCapture,U=e.onExitAfterFailure,_=e.onUserCancel,j=e.onModelError,B=e.onCameraAccessDenied,z=e.captureAdditionalDocuments,G=void 0===z?[]:z,V=e.captureSignature,W=void 0!==V&&V,q=e.captureSignatureVideo,H=void 0!==q&&q,Y=e.theme,Z=void 0===Y?"default":Y,Q=e.assets,$=void 0===Q?{}:Q,X=e.classNames,K=void 0===X?{}:X,J=e.colors,ee=void 0===J?{}:J,te=e.verbiage,ne=void 0===te?{}:te,re=e.geolocationEnabled,oe=void 0===re||re,ie=e.geolocationRequired,ae=void 0!==ie&&ie,se=e.debugMode,ue=void 0!==se&&se;eh(void 0===r?"auto":r),Le(ue);var ce=t.useMemo((function(){return{onExitCapture:P,onUserCancel:_,onExitAfterFailure:U,onModelError:j,timeoutDurationMs:w,modelLoadTimeoutMs:k,loadingOverlayMode:x,skipSuccessScreen:M,assets:$.faceLiveness,classNames:K.faceLiveness,colors:ee.faceLiveness,verbiage:ne.faceLiveness,debugMode:ue}}),[$.faceLiveness,K.faceLiveness,ee.faceLiveness,ue,x,k,U,P,j,_,M,w,ne.faceLiveness]),le=t.useMemo((function(){return{documents:G,classNames:K.additionalDocumentCapture,verbiage:ne.additionalDocumentCapture}}),[G,K.additionalDocumentCapture,ne.additionalDocumentCapture]),de=t.useMemo((function(){return{classNames:K.signatureCapture,verbiage:ne.signatureCapture}}),[K.signatureCapture,ne.signatureCapture]),fe=t.useMemo((function(){return{onExitCapture:P,onUserCancel:_,skipSuccessScreen:M,classNames:K.videoSignatureCapture,colors:ee.videoSignatureCapture,verbiage:ne.videoSignatureCapture,debugMode:ue}}),[K.videoSignatureCapture,ee.videoSignatureCapture,ue,P,_,M,ne.videoSignatureCapture]),pe=t.useCallback((function(e,t){null==O||O(e,t),"Customer Onboarded"===e.resultData.verificationResult?null==R||R(e,t):null==F||F(e,t)}),[R,O,F]);return t.createElement(Ne,{sessionId:o,authUrl:i},t.createElement($x,{theme:Z},t.createElement(je,{action:y.ENROLL,submissionUrl:a,documentServiceUrl:s,companyId:u,enrollmentId:n,needImmediateResponse:c,deduplicationEnabled:l,deduplicationSynchronous:d,webhooksEnabled:f,webhooksClientTraceId:p,webhooksStripSpecialCharacters:h,webhooksSendInputImages:m,webhooksSendProcessedImages:g,sendBase64DocumentsInSwaggerProxy:v,onBeforeDocumentUpload:T,onDocumentUploadProgress:I,onDocumentUploaded:S,onDocumentUploadFailed:N,onBeforeSubmit:A,onSubmit:L,onResponseReceived:pe,geolocationEnabled:oe,geolocationRequired:ae},t.createElement(Zx,{checks:t.useMemo((function(){return["FaceLiveness"]}),[]),faceLivenessProps:ce,additionalDocumentCaptureProps:le,signatureCaptureProps:de,videoSignatureCaptureProps:fe,captureSignature:W,captureSignatureVideo:H,onCameraAccessDenied:B,debugMode:ue}))))},NC=function(e){var n=e.lang,r=e.sessionId,o=e.authUrl,i=e.submissionUrl,a=e.documentServiceUrl,s=e.sendBase64DocumentsInSwaggerProxy,u=e.onBeforeDocumentUpload,c=e.onDocumentUploadProgress,l=e.onDocumentUploaded,d=e.onDocumentUploadFailed,f=e.onComplete,p=e.onExitCapture,h=e.onUserCancel,m=e.onCameraAccessDenied,g=e.documents,v=void 0===g?[]:g,b=e.aspectRatio,x=e.cameraFeedMode,C=e.instructions,w=e.theme,E=void 0===w?"default":w,k=e.classNames,D=void 0===k?{}:k,M=e.verbiage,T=void 0===M?{}:M,I=e.geolocationEnabled,S=void 0===I||I,N=e.geolocationRequired,A=void 0!==N&&N,L=e.debugMode,O=void 0!==L&&L;return eh(void 0===n?"auto":n),Le(O),t.createElement(Ne,{sessionId:r,authUrl:o},t.createElement($x,{theme:E},t.createElement(je,{action:y.NONE,submissionUrl:i,documentServiceUrl:a,sendBase64DocumentsInSwaggerProxy:s,onBeforeDocumentUpload:u,onDocumentUploadProgress:c,onDocumentUploaded:l,onDocumentUploadFailed:d,geolocationEnabled:S,geolocationRequired:A},t.createElement(rt,{requestAccessAutomatically:!1,preferContinuityCamera:!0,onCameraAccessDenied:m,debugMode:O},t.createElement(rv,{onSuccess:f,onExitCapture:p,onUserCancel:h,documents:v,aspectRatio:b,cameraFeedMode:x,instructions:C,classNames:D,verbiage:T})))))};function AC(e,n,r){return r||(r=n,n=void 0),function(e,n){if("string"==typeof n){var r=document.querySelector(n);if(!r)throw new Error("targetElement ".concat(n," not found"));n=r}else n||(n=document.createElement("div"),document.body.append(n));var o=c.createRoot(n);if(o.render(t.createElement(_,null,e)),"remove"in n){var i=n.remove;n.remove=function(){try{o.unmount(),i()}catch(e){}}}return n}(t.createElement(e,f({},r)),n)}Kp.use(lp).use(re).init({resources:Jp,detection:{caches:[]},fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1}});var LC=function(e,t){return AC(Xx,e,t)},OC=function(e,t){return AC(Kx,e,t)},RC=function(e,t){return AC(Jx,e,t)},FC=function(e,t){return AC(eC,e,t)},PC=function(e,t){return AC(SC,e,t)},UC=function(e,t){return AC(pC,e,t)},_C=function(e,t){return AC(MC,e,t)},jC=function(e,t){return AC(TC,e,t)},BC=function(e,t){return AC(IC,e,t)},zC=function(e,t){return AC(NC,e,t)};globalThis.IDmissionSDK={renderIdValidation:LC,renderFaceValidation:OC,renderIdAndFaceValidation:RC,renderCustomerIdAndBiometricsEnrollment:FC,renderCustomerBiometricsEnrollment:PC,renderCustomerVerification:UC,renderCustomerIdentification:_C,renderSignatureKYC:jC,renderVideoIdValidation:BC,renderDocumentCapture:zC,preloadModels:Wd,themes:Qx,version:x,ready:!0,authMode:"session",allowedAuthUrls:ke,defaultAuthUrl:e.defaultAuthUrl,defaultSubmissionUrl:e.defaultSubmissionUrl,setServerUrl:Ue};var GC=function(){return GC=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},GC.apply(this,arguments)},VC={lines:12,length:7,width:5,radius:10,scale:1,corners:1,color:"#000",fadeColor:"transparent",animation:"spinner-line-fade-default",rotate:0,direction:1,speed:1,zIndex:2e9,className:"spinner",top:"50%",left:"50%",shadow:"0 0 1px transparent",position:"absolute"},WC=function(){function e(e){void 0===e&&(e={}),this.opts=GC(GC({},VC),e)}return e.prototype.spin=function(e){return this.stop(),this.el=document.createElement("div"),this.el.className=this.opts.className,this.el.setAttribute("role","progressbar"),this.el.style.position=this.opts.position,this.el.style.width="0",this.el.style.zIndex=this.opts.zIndex.toString(),this.el.style.left=this.opts.left,this.el.style.top=this.opts.top,this.el.style.transform="scale(".concat(this.opts.scale,")"),e&&e.insertBefore(this.el,e.firstChild||null),function(e,t){var n=Math.round(t.corners*t.width*500)/1e3+"px",r="none";!0===t.shadow?r="0 2px 4px #000":"string"==typeof t.shadow&&(r=t.shadow);for(var o=function(e){for(var t=/^\s*([a-zA-Z]+\s+)?(-?\d+(\.\d+)?)([a-zA-Z]*)\s+(-?\d+(\.\d+)?)([a-zA-Z]*)(.*)$/,n=[],r=0,o=e.split(",");r<o.length;r++){var i=o[r].match(t);if(null!==i){var a=+i[2],s=+i[5],u=i[4],c=i[7];0!==a||u||(u=c),0!==s||c||(c=u),u===c&&n.push({prefix:i[1]||"",x:a,y:s,xUnits:u,yUnits:c,end:i[8]})}}return n}(r),i=0;i<t.lines;i++){var a=~~(360/t.lines*i+t.rotate),s=document.createElement("div");s.style.position="absolute",s.style.top="".concat(-t.width/2,"px"),s.style.width=t.length+t.width+"px",s.style.height=t.width+"px",s.style.background=qC(t.fadeColor,i),s.style.borderRadius=n,s.style.transformOrigin="left",s.style.transform="rotate(".concat(a,"deg) translateX(").concat(t.radius,"px)");var u=i*t.direction/t.lines/t.speed;u-=1/t.speed;var c=document.createElement("div");c.style.width="100%",c.style.height="100%",c.style.background=qC(t.color,i),c.style.borderRadius=n,c.style.boxShadow=HC(o,a),c.style.animation="".concat(1/t.speed,"s linear ").concat(u,"s infinite ").concat(t.animation),s.appendChild(c),e.appendChild(s)}}(this.el,this.opts),this},e.prototype.stop=function(){return this.el&&(this.el.parentNode&&this.el.parentNode.removeChild(this.el),this.el=void 0),this},e}();function qC(e,t){return"string"==typeof e?e:e[t%e.length]}function HC(e,t){for(var n=[],r=0,o=e;r<o.length;r++){var i=o[r],a=YC(i.x,i.y,t);n.push(i.prefix+a[0]+i.xUnits+" "+a[1]+i.yUnits+i.end)}return n.join(", ")}function YC(e,t,n){var r=n*Math.PI/180,o=Math.sin(r),i=Math.cos(r);return[Math.round(1e3*(e*i+t*o))/1e3,Math.round(1e3*(-e*o+t*i))/1e3]}var ZC=[];function QC(e){if(void 0!==e){if(e.classList.contains("ladda-button")||e.classList.add("ladda-button"),e.hasAttribute("data-style")||e.setAttribute("data-style","expand-right"),!e.querySelector(".ladda-label")){var t=document.createElement("span");t.className="ladda-label",function(e,t){var n=document.createRange();n.selectNodeContents(e),n.surroundContents(t),e.appendChild(t)}(e,t)}var n,r,o=e.querySelector(".ladda-spinner");o||((o=document.createElement("span")).className="ladda-spinner"),e.appendChild(o);var i={start:function(){return r||(r=function(e){var t,n,r=e.offsetHeight;0===r&&(r=parseFloat(window.getComputedStyle(e).height));r>32&&(r*=.8);e.hasAttribute("data-spinner-size")&&(r=parseInt(e.getAttribute("data-spinner-size"),10));e.hasAttribute("data-spinner-color")&&(t=e.getAttribute("data-spinner-color"));e.hasAttribute("data-spinner-lines")&&(n=parseInt(e.getAttribute("data-spinner-lines"),10));var o=.2*r;return new WC({color:t||"#fff",lines:n||12,radius:o,length:.6*o,width:o<7?2:3,animation:"ladda-spinner-line-fade",zIndex:"auto",top:"auto",left:"auto",className:""})}(e)),e.disabled=!0,e.setAttribute("data-loading",""),clearTimeout(n),r.spin(o),this.setProgress(0),this},startAfter:function(e){return clearTimeout(n),n=setTimeout((function(){i.start()}),e),this},stop:function(){return i.isLoading()&&(e.disabled=!1,e.removeAttribute("data-loading")),clearTimeout(n),r&&(n=setTimeout((function(){r.stop()}),1e3)),this},toggle:function(){return this.isLoading()?this.stop():this.start()},setProgress:function(t){t=Math.max(Math.min(t,1),0);var n=e.querySelector(".ladda-progress");0===t&&n&&n.parentNode?n.parentNode.removeChild(n):(n||((n=document.createElement("div")).className="ladda-progress",e.appendChild(n)),n.style.width=(t||0)*e.offsetWidth+"px")},isLoading:function(){return e.hasAttribute("data-loading")},remove:function(){clearTimeout(n),e.disabled=!1,e.removeAttribute("data-loading"),r&&(r.stop(),r=null),ZC.splice(ZC.indexOf(i),1)}};return ZC.push(i),i}console.warn("Ladda button target must be defined.")}function $C(e,t){if("function"==typeof e.addEventListener){var n=QC(e),r=-1;e.addEventListener("click",(function(){var o=!0,i=function(e,t){for(;e.parentNode&&e.tagName!==t;)e=e.parentNode;return t===e.tagName?e:void 0}(e,"FORM");void 0===i||i.hasAttribute("novalidate")||"function"==typeof i.checkValidity&&(o=i.checkValidity()),o&&(n.startAfter(1),"number"==typeof t.timeout&&(clearTimeout(r),r=setTimeout(n.stop,t.timeout)),"function"==typeof t.callback&&t.callback.apply(null,[n]))}),!1)}}var XC=Object.freeze({__proto__:null,bind:function(e,t){var n;if("string"==typeof e)n=document.querySelectorAll(e);else{if("object"!=typeof e)throw new Error("target must be string or object");n=[e]}t=t||{};for(var r=0;r<n.length;r++)$C(n[r],t)},create:QC,stopAll:function(){for(var e=0,t=ZC.length;e<t;e++)ZC[e].stop()}});e.CapturedDocumentImg=Tm,e.CustomerBiometricsEnrollment=SC,e.CustomerIdAndBiometricsEnrollment=eC,e.CustomerIdentification=MC,e.CustomerVerification=pC,e.DocumentCapture=NC,e.FaceValidation=Kx,e.IdAndFaceValidation=Jx,e.IdValidation=Xx,e.SignatureKYC=TC,e.VideoIdValidation=IC,e.allowedAuthUrls=ke,e.preloadModels=Wd,e.renderCustomerBiometricsEnrollment=PC,e.renderCustomerIdAndBiometricsEnrollment=FC,e.renderCustomerIdentification=_C,e.renderCustomerVerification=UC,e.renderDocumentCapture=zC,e.renderFaceValidation=OC,e.renderIdAndFaceValidation=RC,e.renderIdValidation=LC,e.renderSignatureKYC=jC,e.renderVideoIdValidation=BC,e.setServerUrl=Ue,e.themes=Qx}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom/client"),require("platform"),require("styled-components"),require("tus-js-client"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","react-dom/client","platform","styled-components","tus-js-client","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Sdk2={},e.React,e.ReactDOM,e.platform,e.styled,e.tusJsClient,e.ReactDOM)}(this,(function(e,t,n,r,o,i,a){"use strict";function s(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var u=s(t),c=s(n),l=function(e,t){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},l(e,t)};function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var f=function(){return f=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},f.apply(this,arguments)};function p(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function h(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function m(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}function g(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function v(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}"function"==typeof SuppressedError&&SuppressedError;var y,b,x="2.1.21";function C(){return"undefined"!=typeof window&&void 0!==window.platform?window.platform:r}function w(e){return h(this,void 0,void 0,(function(){return m(this,(function(t){return e.indexOf("blob:")>=0?[2,new Promise((function(t,n){fetch(e).then((function(e){if(!e.ok)throw new Error("Failed to fetch Blob content");return e.blob()})).then((function(e){var r=new FileReader;r.onload=function(){var e=r.result?r.result.split(",")[1]:"";t(e)},r.onerror=function(){r.abort(),n(new Error("Error converting blob to base64"))},r.readAsDataURL(e)})).catch((function(e){n(e)}))}))]:[2,e.replace(/^data:image\/(png|jpeg);base64,/,"")]}))}))}function E(e){return e.replace(/^data:.*;base64,/,"")}function k(e){var t,n;return null!==(n=null===(t=e.match(/^(data:.*;base64),/))||void 0===t?void 0:t[1])&&void 0!==n?n:""}function D(e){return new Promise((function(t){var n=new FileReader;n.onloadend=function(){return t(n.result)},n.readAsDataURL(e)}))}!function(e){e.NONE="NONE",e.ENROLL="ENROLL",e.IDENTIFY="IDENTIFY",e.VALIDATE="VALIDATE",e.VERIFY="VERIFY"}(y||(y={})),function(e){e.READY="READY",e.SUBMITTING="SUBMITTING",e.SUBMITTED="SUBMITTED",e.FAILED="FAILED"}(b||(b={}));var M={prod:"https://api.idmission.com",demo:"https://apidemo.idmission.com"};function T(e,t){var n=M[e];if(!n)throw new Error("unrecognized SubmissionEnvironment ".concat(e));return n}function I(e,t){void 0===t&&(t=!1);var n={"Content-Type":"application/json","X-Send-Base64-Documents":t?"1":"0",Origin:"*"};return e&&(n["X-Session-Id"]=e),n}function S(e,t){var n,r,o=t.geolocationResult,i={selfie:t.selfieCaptureAttempts,front:t.idFrontCaptureAttempts,back:t.idBackCaptureAttempts,isRealIDCheckRequired:"false",sdkVersion:"WebSDK_".concat(x),Resolution:"undefined"!=typeof window?"".concat(window.innerWidth," x ").concat(window.innerHeight):"unknown"},a=C();a&&(i.os=null===(n=a.os)||void 0===n?void 0:n.family,i.osVersion=null===(r=a.os)||void 0===r?void 0:r.version,i.browserVersion="".concat(a.name," ").concat(a.version)),o&&(i.GeoLocation=JSON.stringify(o)),e.additionalData.metadata=JSON.stringify(i)}function N(e){return new Promise((function(t){var n=new FileReader;n.onloadend=function(){t(E(n.result))},fetch(e).then((function(e){return e.blob()})).then((function(e){return n.readAsDataURL(e)}))}))}var A,L=o.div(A||(A=v(["\n ","\n\n ","\n\n &.flex {\n display: flex;\n }\n\n &.padded {\n box-sizing: border-box;\n padding: 16px 24px;\n }\n"],["\n ","\n\n ","\n\n &.flex {\n display: flex;\n }\n\n &.padded {\n box-sizing: border-box;\n padding: 16px 24px;\n }\n"])),(function(e){var t;return!1===e.theme.isFullscreen?"":"\n position: fixed;\n top: 0;\n left: 0;\n width: var(--app-width);\n height: calc(\n var(--app-height) - ".concat(null!==(t=e.$heightOffset)&&void 0!==t?t:0,"px\n );\n overflow-x: hidden;\n overflow-y: auto;\n ")}),(function(e){return e.theme.fontFamily?"font-family: ".concat(e.theme.fontFamily,";"):""})),O=t.forwardRef((function(e,n){var r=e.children,o=e.className,i=e.heightOffset,a=void 0===i?0:i,s=e.style,u=e.onClick,c=t.useState(!1),l=c[0],d=c[1];return t.useEffect((function(){if("undefined"!=typeof window){d(!1);var e=function(){var e=document.documentElement;e.style.setProperty("--app-width","".concat(window.innerWidth,"px")),e.style.setProperty("--app-height","".concat(window.innerHeight,"px"))};return window.addEventListener("resize",e),e(),d(!0),function(){window.removeEventListener("resize",e)}}}),[]),t.createElement(L,{ref:n,style:s,onClick:u,className:o,$heightOffset:a},l&&r)}));O.displayName="PageContainer";var R,F,P,U,_=o(O)(R||(R=v(["\n background: ",";\n ","\n z-index: 10000;\n"],["\n background: ",";\n ","\n z-index: 10000;\n"])),(function(e){return e.theme.background?"".concat(e.theme.background):"white"}),(function(e){return e.theme.textColor?"color: ".concat(e.theme.textColor,";"):""})),j=o.div(F||(F=v(["\n text-align: ",";\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n max-height: var(--app-height);\n height: 100%;\n ","\n"],["\n text-align: ",";\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n max-height: var(--app-height);\n height: 100%;\n ","\n"])),(function(e){var t;return null!==(t=e.theme.textAlign)&&void 0!==t?t:"center"}),(function(e){return e.theme.padding?"box-sizing: border-box; padding: ".concat(e.theme.padding,";"):""})),B=o.div(P||(P=v(["\n position: relative;\n display: flex;\n flex-grow: 1;\n padding-bottom: 25px;\n max-width: var(--app-width);\n max-height: var(--app-height);\n overflow: hidden;\n\n & > img,\n & > svg {\n margin: 0 auto;\n width: max-content;\n max-width: 100%;\n max-height: 100%;\n aspect-ratio: initial;\n object-fit: contain;\n display: block;\n }\n"],["\n position: relative;\n display: flex;\n flex-grow: 1;\n padding-bottom: 25px;\n max-width: var(--app-width);\n max-height: var(--app-height);\n overflow: hidden;\n\n & > img,\n & > svg {\n margin: 0 auto;\n width: max-content;\n max-width: 100%;\n max-height: 100%;\n aspect-ratio: initial;\n object-fit: contain;\n display: block;\n }\n"]))),z=o.div(U||(U=v(["\n display: flex;\n margin: auto;\n\n & > div {\n max-height: calc(100vh - 320px);\n\n & > img {\n width: 100%;\n max-height: 100%;\n height: auto;\n object-fit: contain;\n }\n }\n"],["\n display: flex;\n margin: auto;\n\n & > div {\n max-height: calc(100vh - 320px);\n\n & > img {\n width: 100%;\n max-height: 100%;\n height: auto;\n object-fit: contain;\n }\n }\n"])));function G(){return G=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},G.apply(null,arguments)}var V="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function W(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function q(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}function H(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];"string"==typeof n[0]&&(n[0]="react-i18next:: "+n[0]),(e=console).warn.apply(e,n)}}var Y={};function Z(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];"string"==typeof t[0]&&Y[t[0]]||("string"==typeof t[0]&&(Y[t[0]]=new Date),H.apply(void 0,t))}var Q=function(e,t){return function(){if(e.isInitialized)t();else{var n=function(){setTimeout((function(){e.off("initialized",n)}),0),t()};e.on("initialized",n)}}};function $(e,t,n){e.loadNamespaces(t,Q(e,n))}function X(e,t,n,r){"string"==typeof n&&(n=[n]),n.forEach((function(t){e.options.ns.indexOf(t)<0&&e.options.ns.push(t)})),e.loadLanguages(t,Q(e,r))}var K,J=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,ee={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},te=function(e){return ee[e]},ne={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:function(e){return e.replace(J,te)}};var re={type:"3rdParty",init:function(e){!function(){ne=G({},ne,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}(e.options.react),function(e){K=e}(e)}},oe=t.createContext(),ie=function(){function e(){this.usedNamespaces={}}var t=e.prototype;return t.addUsedNamespaces=function(e){var t=this;e.forEach((function(e){t.usedNamespaces[e]||(t.usedNamespaces[e]=!0)}))},t.getUsedNamespaces=function(){return Object.keys(this.usedNamespaces)},e}(),ae=function(e,n){var r=t.useRef();return t.useEffect((function(){r.current=e}),[e,n]),r.current};function se(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.i18n,o=t.useContext(oe)||{},i=o.defaultNS,a=r||o.i18n||K;if(a&&!a.reportNamespaces&&(a.reportNamespaces=new ie),!a){Z("You will need to pass in an i18next instance by using initReactI18next");var s=function(e,t){return"string"==typeof t?t:t&&"object"==typeof t&&"string"==typeof t.defaultValue?t.defaultValue:Array.isArray(e)?e[e.length-1]:e},u=[s,{},!1];return u.t=s,u.i18n={},u.ready=!1,u}a.options.react&&void 0!==a.options.react.wait&&Z("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var c=G({},ne,a.options.react,n),l=c.useSuspense,d=c.keyPrefix,f=e||i||a.options&&a.options.defaultNS;f="string"==typeof f?[f]:f||["translation"],a.reportNamespaces.addUsedNamespaces&&a.reportNamespaces.addUsedNamespaces(f);var p=(a.isInitialized||a.initializedStoreOnce)&&f.every((function(e){return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.languages&&t.languages.length?void 0!==t.options.ignoreJSONStructure?t.hasLoadedNamespace(e,{lng:n.lng,precheck:function(t,r){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}):function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.languages[0],o=!!t.options&&t.options.fallbackLng,i=t.languages[t.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state[e+"|"+n];return-1===r||2===r};return!(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e)||!t.hasResourceBundle(r,e)&&t.services.backendConnector.backend&&(!t.options.resources||t.options.partialBundledLanguages)&&(!a(r,e)||o&&!a(i,e)))}(e,t,n):(Z("i18n.languages were undefined or empty",t.languages),!0)}(e,a,c)}));function h(){return a.getFixedT(n.lng||null,"fallback"===c.nsMode?f:f[0],d)}var m=t.useState(h),g=m[0],v=m[1],y=f.join();n.lng&&(y=""+n.lng+y);var b=ae(y),x=t.useRef(!0);t.useEffect((function(){var e=c.bindI18n,t=c.bindI18nStore;function r(){x.current&&v(h)}return x.current=!0,p||l||(n.lng?X(a,n.lng,f,(function(){x.current&&v(h)})):$(a,f,(function(){x.current&&v(h)}))),p&&b&&b!==y&&x.current&&v(h),e&&a&&a.on(e,r),t&&a&&a.store.on(t,r),function(){x.current=!1,e&&a&&e.split(" ").forEach((function(e){return a.off(e,r)})),t&&a&&t.split(" ").forEach((function(e){return a.store.off(e,r)}))}}),[a,y]);var C=t.useRef(!0);t.useEffect((function(){x.current&&!C.current&&v(h),C.current=!1}),[a,d]);var w=[g,a,p];if(w.t=g,w.i18n=a,w.ready=p,p)return w;if(!p&&!l)return w;throw new Promise((function(e){n.lng?X(a,n.lng,f,(function(){return e()})):$(a,f,(function(){return e()}))}))}var ue,ce,le=function(e){var n=e.children,r=e.className,o=e.colors,i=void 0===o?{}:o,a=e.disabled,s=e.finished,u=e.onClick,c=e.style,l=e.variant,d=void 0===l?"primary":l,f=t.useRef(null),p=t.useRef(null),h=t.useState(!1),m=h[0],g=h[1];return t.useEffect((function(){var e;if(!m&&!s)return Promise.resolve().then((function(){return KC})).then((function(t){if(f.current){p.current=t.create(f.current),p.current.start(),g(!0);var n=0;e=setInterval((function(){var e;n<.9&&(n+=.1),null===(e=p.current)||void 0===e||e.setProgress(n)}),250)}})),function(){var t;null===(t=p.current)||void 0===t||t.remove(),clearInterval(e)}}),[s,m]),t.useEffect((function(){var e;m&&s&&(null===(e=p.current)||void 0===e||e.stop())}),[s,m]),t.createElement(de,{className:"ladda-button ".concat(r," ").concat(a?"disabled":""),"data-style":"expand-right",disabled:a,ref:f,onClick:u,$backgroundColor:i.backgroundColor,$textColor:i.textColor,$disabledBackgroundColor:i.loadingBackgroundColor,$disabledTextColor:i.loadingTextColor,$variant:d,style:c},t.createElement("span",{className:"ladda-label"},n))},de=o.button(ue||(ue=v(["\n ","\n\n /*!\n * Ladda\n * http://lab.hakim.se/ladda\n * MIT licensed\n *\n * Copyright (C) 2018 Hakim El Hattab, http://hakim.se\n */\n @keyframes ladda-spinner-line-fade {\n 0%,\n 100% {\n opacity: 0.22;\n }\n 1% {\n opacity: 1;\n }\n }\n\n position: relative;\n\n .ladda-spinner {\n position: absolute;\n z-index: 2;\n display: inline-block;\n width: 32px;\n top: 50%;\n margin-top: 0;\n opacity: 0;\n pointer-events: none;\n }\n .ladda-label {\n position: relative;\n z-index: 3;\n }\n .ladda-progress {\n position: absolute;\n width: 0;\n height: 100%;\n left: 0;\n top: 0;\n background: rgba(0, 0, 0, 0.2);\n display: none;\n transition: 0.1s linear all !important;\n }\n &[data-loading] .ladda-progress {\n display: block;\n }\n\n transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;\n\n .ladda-spinner,\n .ladda-label {\n transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;\n }\n &[data-style='zoom-in'],\n &[data-style='zoom-in'] .ladda-spinner,\n &[data-style='zoom-in'] .ladda-label,\n &[data-style='zoom-out'],\n &[data-style='zoom-out'] .ladda-spinner,\n &[data-style='zoom-out'] .ladda-label {\n transition: 0.3s ease all !important;\n }\n &[data-style='expand-right'] .ladda-spinner {\n right: -6px;\n }\n &[data-style='expand-right'][data-size='s'] .ladda-spinner,\n &[data-style='expand-right'][data-size='xs'] .ladda-spinner {\n right: -12px;\n }\n &[data-style='expand-right'][data-loading] {\n padding-right: 56px;\n }\n &[data-style='expand-right'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='expand-right'][data-loading][data-size='s'],\n &[data-style='expand-right'][data-loading][data-size='xs'] {\n padding-right: 40px;\n }\n &[data-style='expand-left'] .ladda-spinner {\n left: 26px;\n }\n &[data-style='expand-left'][data-size='s'] .ladda-spinner,\n &[data-style='expand-left'][data-size='xs'] .ladda-spinner {\n left: 4px;\n }\n &[data-style='expand-left'][data-loading] {\n padding-left: 56px;\n }\n &[data-style='expand-left'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='expand-left'][data-loading][data-size='s'],\n &[data-style='expand-left'][data-loading][data-size='xs'] {\n padding-left: 40px;\n }\n &[data-style='expand-up'] {\n overflow: hidden;\n }\n &[data-style='expand-up'] .ladda-spinner {\n top: -32px;\n left: 50%;\n margin-left: 0;\n }\n &[data-style='expand-up'][data-loading] {\n padding-top: 54px;\n }\n &[data-style='expand-up'][data-loading] .ladda-spinner {\n opacity: 1;\n top: 26px;\n margin-top: 0;\n }\n &[data-style='expand-up'][data-loading][data-size='s'],\n &[data-style='expand-up'][data-loading][data-size='xs'] {\n padding-top: 32px;\n }\n &[data-style='expand-up'][data-loading][data-size='s'] .ladda-spinner,\n &[data-style='expand-up'][data-loading][data-size='xs'] .ladda-spinner {\n top: 4px;\n }\n &[data-style='expand-down'] {\n overflow: hidden;\n }\n &[data-style='expand-down'] .ladda-spinner {\n top: 62px;\n left: 50%;\n margin-left: 0;\n }\n &[data-style='expand-down'][data-size='s'] .ladda-spinner,\n &[data-style='expand-down'][data-size='xs'] .ladda-spinner {\n top: 40px;\n }\n &[data-style='expand-down'][data-loading] {\n padding-bottom: 54px;\n }\n &[data-style='expand-down'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='expand-down'][data-loading][data-size='s'],\n &[data-style='expand-down'][data-loading][data-size='xs'] {\n padding-bottom: 32px;\n }\n &[data-style='slide-left'] {\n overflow: hidden;\n }\n &[data-style='slide-left'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-left'] .ladda-spinner {\n left: 100%;\n margin-left: 0;\n }\n &[data-style='slide-left'][data-loading] .ladda-label {\n opacity: 0;\n left: -100%;\n }\n &[data-style='slide-left'][data-loading] .ladda-spinner {\n opacity: 1;\n left: 50%;\n }\n &[data-style='slide-right'] {\n overflow: hidden;\n }\n &[data-style='slide-right'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-right'] .ladda-spinner {\n right: 100%;\n margin-left: 0;\n left: 16px;\n }\n [dir='rtl'] &[data-style='slide-right'] .ladda-spinner {\n right: auto;\n }\n &[data-style='slide-right'][data-loading] .ladda-label {\n opacity: 0;\n left: 100%;\n }\n &[data-style='slide-right'][data-loading] .ladda-spinner {\n opacity: 1;\n left: 50%;\n }\n &[data-style='slide-up'] {\n overflow: hidden;\n }\n &[data-style='slide-up'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-up'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n margin-top: 1em;\n }\n &[data-style='slide-up'][data-loading] .ladda-label {\n opacity: 0;\n top: -1em;\n }\n &[data-style='slide-up'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-top: 0;\n }\n &[data-style='slide-down'] {\n overflow: hidden;\n }\n &[data-style='slide-down'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-down'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n margin-top: -2em;\n }\n &[data-style='slide-down'][data-loading] .ladda-label {\n opacity: 0;\n top: 1em;\n }\n &[data-style='slide-down'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-top: 0;\n }\n &[data-style='zoom-out'] {\n overflow: hidden;\n }\n &[data-style='zoom-out'] .ladda-spinner {\n left: 50%;\n margin-left: 32px;\n transform: scale(2.5);\n }\n &[data-style='zoom-out'] .ladda-label {\n position: relative;\n display: inline-block;\n }\n &[data-style='zoom-out'][data-loading] .ladda-label {\n opacity: 0;\n transform: scale(0.5);\n }\n &[data-style='zoom-out'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-left: 0;\n transform: none;\n }\n &[data-style='zoom-in'] {\n overflow: hidden;\n }\n &[data-style='zoom-in'] .ladda-spinner {\n left: 50%;\n margin-left: -16px;\n transform: scale(0.2);\n }\n &[data-style='zoom-in'] .ladda-label {\n position: relative;\n display: inline-block;\n }\n &[data-style='zoom-in'][data-loading] .ladda-label {\n opacity: 0;\n transform: scale(2.2);\n }\n &[data-style='zoom-in'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-left: 0;\n transform: none;\n }\n &[data-style='contract'] {\n overflow: hidden;\n width: 100px;\n }\n &[data-style='contract'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n }\n &[data-style='contract'][data-loading] {\n border-radius: 50%;\n width: 52px;\n }\n &[data-style='contract'][data-loading] .ladda-label {\n opacity: 0;\n }\n &[data-style='contract'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='contract-overlay'] {\n overflow: hidden;\n width: 100px;\n box-shadow: 0px 0px 0px 2000px rgba(0, 0, 0, 0);\n }\n &[data-style='contract-overlay'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n }\n &[data-style='contract-overlay'][data-loading] {\n border-radius: 50%;\n width: 52px;\n box-shadow: 0px 0px 0px 2000px rgba(0, 0, 0, 0.8);\n }\n &[data-style='contract-overlay'][data-loading] .ladda-label {\n opacity: 0;\n }\n &[data-style='contract-overlay'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n [dir='rtl'] .ladda-spinner > div {\n left: 25% !important;\n }\n"],["\n ","\n\n /*!\n * Ladda\n * http://lab.hakim.se/ladda\n * MIT licensed\n *\n * Copyright (C) 2018 Hakim El Hattab, http://hakim.se\n */\n @keyframes ladda-spinner-line-fade {\n 0%,\n 100% {\n opacity: 0.22;\n }\n 1% {\n opacity: 1;\n }\n }\n\n position: relative;\n\n .ladda-spinner {\n position: absolute;\n z-index: 2;\n display: inline-block;\n width: 32px;\n top: 50%;\n margin-top: 0;\n opacity: 0;\n pointer-events: none;\n }\n .ladda-label {\n position: relative;\n z-index: 3;\n }\n .ladda-progress {\n position: absolute;\n width: 0;\n height: 100%;\n left: 0;\n top: 0;\n background: rgba(0, 0, 0, 0.2);\n display: none;\n transition: 0.1s linear all !important;\n }\n &[data-loading] .ladda-progress {\n display: block;\n }\n\n transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;\n\n .ladda-spinner,\n .ladda-label {\n transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;\n }\n &[data-style='zoom-in'],\n &[data-style='zoom-in'] .ladda-spinner,\n &[data-style='zoom-in'] .ladda-label,\n &[data-style='zoom-out'],\n &[data-style='zoom-out'] .ladda-spinner,\n &[data-style='zoom-out'] .ladda-label {\n transition: 0.3s ease all !important;\n }\n &[data-style='expand-right'] .ladda-spinner {\n right: -6px;\n }\n &[data-style='expand-right'][data-size='s'] .ladda-spinner,\n &[data-style='expand-right'][data-size='xs'] .ladda-spinner {\n right: -12px;\n }\n &[data-style='expand-right'][data-loading] {\n padding-right: 56px;\n }\n &[data-style='expand-right'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='expand-right'][data-loading][data-size='s'],\n &[data-style='expand-right'][data-loading][data-size='xs'] {\n padding-right: 40px;\n }\n &[data-style='expand-left'] .ladda-spinner {\n left: 26px;\n }\n &[data-style='expand-left'][data-size='s'] .ladda-spinner,\n &[data-style='expand-left'][data-size='xs'] .ladda-spinner {\n left: 4px;\n }\n &[data-style='expand-left'][data-loading] {\n padding-left: 56px;\n }\n &[data-style='expand-left'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='expand-left'][data-loading][data-size='s'],\n &[data-style='expand-left'][data-loading][data-size='xs'] {\n padding-left: 40px;\n }\n &[data-style='expand-up'] {\n overflow: hidden;\n }\n &[data-style='expand-up'] .ladda-spinner {\n top: -32px;\n left: 50%;\n margin-left: 0;\n }\n &[data-style='expand-up'][data-loading] {\n padding-top: 54px;\n }\n &[data-style='expand-up'][data-loading] .ladda-spinner {\n opacity: 1;\n top: 26px;\n margin-top: 0;\n }\n &[data-style='expand-up'][data-loading][data-size='s'],\n &[data-style='expand-up'][data-loading][data-size='xs'] {\n padding-top: 32px;\n }\n &[data-style='expand-up'][data-loading][data-size='s'] .ladda-spinner,\n &[data-style='expand-up'][data-loading][data-size='xs'] .ladda-spinner {\n top: 4px;\n }\n &[data-style='expand-down'] {\n overflow: hidden;\n }\n &[data-style='expand-down'] .ladda-spinner {\n top: 62px;\n left: 50%;\n margin-left: 0;\n }\n &[data-style='expand-down'][data-size='s'] .ladda-spinner,\n &[data-style='expand-down'][data-size='xs'] .ladda-spinner {\n top: 40px;\n }\n &[data-style='expand-down'][data-loading] {\n padding-bottom: 54px;\n }\n &[data-style='expand-down'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='expand-down'][data-loading][data-size='s'],\n &[data-style='expand-down'][data-loading][data-size='xs'] {\n padding-bottom: 32px;\n }\n &[data-style='slide-left'] {\n overflow: hidden;\n }\n &[data-style='slide-left'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-left'] .ladda-spinner {\n left: 100%;\n margin-left: 0;\n }\n &[data-style='slide-left'][data-loading] .ladda-label {\n opacity: 0;\n left: -100%;\n }\n &[data-style='slide-left'][data-loading] .ladda-spinner {\n opacity: 1;\n left: 50%;\n }\n &[data-style='slide-right'] {\n overflow: hidden;\n }\n &[data-style='slide-right'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-right'] .ladda-spinner {\n right: 100%;\n margin-left: 0;\n left: 16px;\n }\n [dir='rtl'] &[data-style='slide-right'] .ladda-spinner {\n right: auto;\n }\n &[data-style='slide-right'][data-loading] .ladda-label {\n opacity: 0;\n left: 100%;\n }\n &[data-style='slide-right'][data-loading] .ladda-spinner {\n opacity: 1;\n left: 50%;\n }\n &[data-style='slide-up'] {\n overflow: hidden;\n }\n &[data-style='slide-up'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-up'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n margin-top: 1em;\n }\n &[data-style='slide-up'][data-loading] .ladda-label {\n opacity: 0;\n top: -1em;\n }\n &[data-style='slide-up'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-top: 0;\n }\n &[data-style='slide-down'] {\n overflow: hidden;\n }\n &[data-style='slide-down'] .ladda-label {\n position: relative;\n }\n &[data-style='slide-down'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n margin-top: -2em;\n }\n &[data-style='slide-down'][data-loading] .ladda-label {\n opacity: 0;\n top: 1em;\n }\n &[data-style='slide-down'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-top: 0;\n }\n &[data-style='zoom-out'] {\n overflow: hidden;\n }\n &[data-style='zoom-out'] .ladda-spinner {\n left: 50%;\n margin-left: 32px;\n transform: scale(2.5);\n }\n &[data-style='zoom-out'] .ladda-label {\n position: relative;\n display: inline-block;\n }\n &[data-style='zoom-out'][data-loading] .ladda-label {\n opacity: 0;\n transform: scale(0.5);\n }\n &[data-style='zoom-out'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-left: 0;\n transform: none;\n }\n &[data-style='zoom-in'] {\n overflow: hidden;\n }\n &[data-style='zoom-in'] .ladda-spinner {\n left: 50%;\n margin-left: -16px;\n transform: scale(0.2);\n }\n &[data-style='zoom-in'] .ladda-label {\n position: relative;\n display: inline-block;\n }\n &[data-style='zoom-in'][data-loading] .ladda-label {\n opacity: 0;\n transform: scale(2.2);\n }\n &[data-style='zoom-in'][data-loading] .ladda-spinner {\n opacity: 1;\n margin-left: 0;\n transform: none;\n }\n &[data-style='contract'] {\n overflow: hidden;\n width: 100px;\n }\n &[data-style='contract'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n }\n &[data-style='contract'][data-loading] {\n border-radius: 50%;\n width: 52px;\n }\n &[data-style='contract'][data-loading] .ladda-label {\n opacity: 0;\n }\n &[data-style='contract'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n &[data-style='contract-overlay'] {\n overflow: hidden;\n width: 100px;\n box-shadow: 0px 0px 0px 2000px rgba(0, 0, 0, 0);\n }\n &[data-style='contract-overlay'] .ladda-spinner {\n left: 50%;\n margin-left: 0;\n }\n &[data-style='contract-overlay'][data-loading] {\n border-radius: 50%;\n width: 52px;\n box-shadow: 0px 0px 0px 2000px rgba(0, 0, 0, 0.8);\n }\n &[data-style='contract-overlay'][data-loading] .ladda-label {\n opacity: 0;\n }\n &[data-style='contract-overlay'][data-loading] .ladda-spinner {\n opacity: 1;\n }\n [dir='rtl'] .ladda-spinner > div {\n left: 25% !important;\n }\n"])),(function(e){var t,n,r,o,i,a,s,u,c,l,d,f,p,h,m,g,v,y,b,x;return"bootstrap"===(null===(t=e.theme.buttons)||void 0===t?void 0:t.style)&&"\n border-radius: 0;\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n text-transform: none;\n -webkit-appearance: button;\n \n &:not(:disabled),\n &[type='button']:not(:disabled),\n &[type='reset']:not(:disabled),\n &[type='submit']:not(:disabled) {\n cursor: pointer;\n }\n \n &:focus:not(:focus-visible) {\n outline: 0;\n }\n \n --bs-btn-padding-x: 0.75rem;\n --bs-btn-padding-y: 0.375rem;\n --bs-btn-font-family: ;\n --bs-btn-font-size: 1rem;\n --bs-btn-font-weight: 400;\n --bs-btn-line-height: 1.5;\n --bs-btn-color: var(--bs-body-color);\n --bs-btn-bg: transparent;\n --bs-btn-border-width: var(--bs-border-width);\n --bs-btn-border-color: transparent;\n --bs-btn-border-radius: var(--bs-border-radius);\n --bs-btn-hover-border-color: transparent;\n --bs-btn-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15),\n 0 1px 1px rgba(0, 0, 0, 0.075);\n --bs-btn-disabled-opacity: 0.65;\n --bs-btn-focus-box-shadow: 0 0 0 0.25rem\n rgba(var(--bs-btn-focus-shadow-rgb), 0.5);\n display: inline-block;\n padding: var(--bs-btn-padding-y) var(--bs-btn-padding-x);\n font-family: var(--bs-btn-font-family);\n font-size: var(--bs-btn-font-size);\n font-weight: var(--bs-btn-font-weight);\n line-height: var(--bs-btn-line-height);\n color: var(--bs-btn-color);\n text-align: center;\n text-decoration: none;\n vertical-align: middle;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n border: var(--bs-btn-border-width) solid var(--bs-btn-border-color);\n border-radius: var(--bs-btn-border-radius);\n background-color: var(--bs-btn-bg);\n //transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,\n // border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n \n @media (prefers-reduced-motion: reduce) {\n transition: none;\n }\n \n &:hover {\n filter: brightness(1.15);\n }\n \n &:focus-visible {\n color: var(--bs-btn-hover-color);\n background-color: var(--bs-btn-hover-bg);\n border-color: var(--bs-btn-hover-border-color);\n outline: 0;\n box-shadow: var(--bs-btn-focus-box-shadow);\n }\n \n &:disabled,\n &.disabled,\n fieldset:disabled & {\n color: var(--bs-btn-disabled-color);\n pointer-events: none;\n background-color: var(--bs-btn-disabled-bg);\n border-color: var(--bs-btn-disabled-border-color);\n opacity: var(--bs-btn-disabled-opacity);\n }\n \n --bs-btn-color: ".concat(null!==(a=null!==(n=e.$textColor)&&void 0!==n?n:null===(i=null===(r=e.theme.buttons)||void 0===r?void 0:r[null!==(o=e.$variant)&&void 0!==o?o:"primary"])||void 0===i?void 0:i.textColor)&&void 0!==a?a:"#fff",";\n --bs-btn-bg: ").concat(null!==(d=null!==(s=e.$backgroundColor)&&void 0!==s?s:null===(l=null===(u=e.theme.buttons)||void 0===u?void 0:u[null!==(c=e.$variant)&&void 0!==c?c:"primary"])||void 0===l?void 0:l.backgroundColor)&&void 0!==d?d:"#0d6efd",";\n --bs-btn-border-color: var(--bs-btn-bg);\n --bs-btn-focus-shadow-rgb: 49, 132, 253;\n --bs-btn-active-color: #fff;\n --bs-btn-active-bg: #0a58ca;\n --bs-btn-active-border-color: #0a53be;\n --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);\n --bs-btn-disabled-color: ").concat(null!==(m=null!==(f=e.$disabledTextColor)&&void 0!==f?f:null===(h=null===(p=e.theme.buttons)||void 0===p?void 0:p.loading)||void 0===h?void 0:h.textColor)&&void 0!==m?m:"#fff",";\n --bs-btn-disabled-bg: ").concat(null!==(b=null!==(g=e.$disabledBackgroundColor)&&void 0!==g?g:null===(y=null===(v=e.theme.buttons)||void 0===v?void 0:v.loading)||void 0===y?void 0:y.backgroundColor)&&void 0!==b?b:"gray",";\n --bs-btn-disabled-border-color: ").concat(null!==(x=e.$disabledBackgroundColor)&&void 0!==x?x:"#0d6efd",";\n \n --bs-btn-padding-y: 14px;\n --bs-btn-padding-x: 1rem;\n --bs-btn-font-size: 18px;\n --bs-btn-border-radius: 4px;\n ")})),fe=function(e){var n=e.accessBlockedImageUrl,r=se().t,o=t.useContext(_e).retryLocationAccess;return t.createElement(_,null,t.createElement("div",{style:{display:"flex",height:"100%"}},t.createElement(j,{style:{maxWidth:500,height:"auto",margin:"auto"}},t.createElement(B,{style:{flexGrow:0}},t.createElement("img",{src:n,alt:""})),t.createElement("h3",null,r("Your location access is disabled")),t.createElement("p",{style:{lineHeight:1.5,marginBottom:50}},r("This application requires access to your location to continue. Please accept the permission once prompted by the browser. If the browser does not prompt for location permissions, you must go to settings and provide location access to the current browser.")),t.createElement(le,{variant:"primary",onClick:o,style:{width:200,marginLeft:"auto",marginRight:"auto"},finished:!0},r("Retry")))))},pe=function(e){function t(t){var n=e.call(this,t.statusMessage)||this;return n.status=t,n}return d(t,e),t}(Error),he=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return d(t,e),t}(Error),me=function(e){function t(t,n){var r=e.call(this,t.message)||this;return r.err=t,r.host=n,r}return d(t,e),t}(Error),ge=function(e){var n=e.error;return t.createElement(_,null,t.createElement(j,{style:{justifyContent:"center"}},n instanceof he?t.createElement(ye,{error:n,onRetry:e.onRetry}):t.createElement(ve,{error:n})))},ve=function(e){var n=e.error,r=(0,se().t)("We're sorry, an unexpected error has occurred.");return t.createElement(t.Fragment,null,t.createElement("h3",{style:{marginBottom:8}},r),n.status.statusCode&&t.createElement("p",{style:{marginBottom:0}},t.createElement("code",null,"Status: ",n.status.statusCode)),t.createElement("p",{style:{marginBottom:0}},"Message: ",t.createElement("code",null,n.message)),n.status.errorData&&t.createElement("p",{style:{marginBottom:0}},"Data: ",t.createElement("code",null,n.status.errorData)))},ye=function(e){var n=e.onRetry,r=se().t,o=r("Network unreachable"),i=r("We're having trouble reaching our services, please check your connection and try again."),a=r("Retry");return t.createElement(t.Fragment,null,t.createElement("h3",{style:{marginBottom:8}},o),t.createElement("p",{style:{marginBottom:0}},i),n&&t.createElement("div",{style:{marginTop:32}},t.createElement(le,{variant:"warning",finished:!0,onClick:n},a)))},be=function(){return t.createElement(_,null,t.createElement(j,{style:{justifyContent:"center"}},t.createElement("h3",{style:{marginBottom:8}},"IDmission WebSDK failed to load"),t.createElement("p",{style:{marginBottom:0}},"Required property ",t.createElement("code",null,"sessionId")," is missing."),t.createElement("p",{style:{lineHeight:"1.5rem"}},"Please refer to the"," ",t.createElement("a",{href:"https://www.npmjs.com/package/idmission-web-sdk#getting-started",target:"_blank",rel:"noreferrer"},"Getting Started")," ","section of the documentation for information on how to use your credentials to generate a valid session for your IDmission account. Every usage of the IDmission WebSDK must be authorized with a valid session from IDmission's servers.")))},xe=function(e){var n=e.message;return t.createElement(_,null,t.createElement(j,{style:{justifyContent:"center"}},t.createElement("h3",{style:{marginBottom:8}},"IDmission WebSDK failed to load"),t.createElement("p",{style:{marginBottom:0}},"Required property ",t.createElement("code",null,"sessionId")," is not valid",n&&" (".concat(n,")"),"."),t.createElement("p",{style:{lineHeight:"1.5rem"}},"Please refer to the"," ",t.createElement("a",{href:"https://www.npmjs.com/package/idmission-web-sdk#getting-started",target:"_blank",rel:"noreferrer"},"Getting Started")," ","section of the documentation for information on how to use your credentials to generate a valid session for your IDmission account. Every usage of the IDmission WebSDK must be authorized with a valid session from IDmission's servers.")))},Ce=function(){return t.createElement(_,null,t.createElement(j,{style:{justifyContent:"center"}},t.createElement("h3",{style:{marginBottom:8}},"IDmission WebSDK failed to load"),t.createElement("p",{style:{marginBottom:0}},"Required property ",t.createElement("code",null,"authUrl")," comes from an unrecognized issuer."),t.createElement("p",{style:{marginBottom:0,lineHeight:"1.5rem"}},"Ensure you are generating a fresh session for each request to the IDmission WebSDK."),t.createElement("p",{style:{lineHeight:"1.5rem"}},"Please refer to the"," ",t.createElement("a",{href:"https://www.npmjs.com/package/idmission-web-sdk#getting-started",target:"_blank",rel:"noreferrer"},"Getting Started")," ","section of the documentation for information on how to use your credentials to generate a valid session for your IDmission account. Every usage of the IDmission WebSDK must be authorized with a valid session from IDmission's servers.")))},we=function(e){var n=e.error,r=e.onRetry,o=(0,se().t)("Retry");return t.createElement(_,null,t.createElement(j,{style:{justifyContent:"center"}},t.createElement("h3",{style:{marginBottom:8}},"IDmission WebSDK failed to load"),t.createElement("p",{style:{marginBottom:0}},(null==n?void 0:n.host)?t.createElement(t.Fragment,null,"Failed to reach ",t.createElement("code",null,n.host),"."):t.createElement(t.Fragment,null,"Failed to validate ",t.createElement("code",null,"sessionId"),".")),(null==n?void 0:n.message)&&t.createElement("p",{style:{marginBottom:0,lineHeight:"1.5rem"}},t.createElement("code",null,n.message)),t.createElement("p",{style:{marginBottom:0,lineHeight:"1.5rem"}},"Please ensure that IDmission's servers can be reached. If you believe you have reached this page in error, please contact us at"," ",t.createElement("a",{href:"mailto:support@idmission.com"},"support@idmission.com"),"."),r&&t.createElement("div",{style:{marginTop:32}},t.createElement(le,{variant:"warning",finished:!0,onClick:r},o))))},Ee=o.div(ce||(ce=v(["\n display: inline-block;\n width: ","px;\n height: ","px;\n margin: auto;\n\n &:after {\n content: ' ';\n display: block;\n width: ","px;\n height: ","px;\n margin: 8px;\n border-radius: 50%;\n border: ","px solid\n ",";\n border-color: "," transparent\n "," transparent;\n animation: lds-dual-ring 1.2s linear infinite;\n box-sizing: content-box;\n }\n\n @keyframes lds-dual-ring {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"],["\n display: inline-block;\n width: ","px;\n height: ","px;\n margin: auto;\n\n &:after {\n content: ' ';\n display: block;\n width: ","px;\n height: ","px;\n margin: 8px;\n border-radius: 50%;\n border: ","px solid\n ",";\n border-color: "," transparent\n "," transparent;\n animation: lds-dual-ring 1.2s linear infinite;\n box-sizing: content-box;\n }\n\n @keyframes lds-dual-ring {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"])),(function(e){var t=e.$size;return null!=t?t:80}),(function(e){var t=e.$size;return null!=t?t:80}),(function(e){var t=e.$size;return(null!=t?t:80)-16}),(function(e){var t=e.$size;return(null!=t?t:80)-16}),(function(e){var t=e.$thickness;return null!=t?t:6}),(function(e){var t=e.$color;return null!=t?t:"#888"}),(function(e){var t=e.$color;return null!=t?t:"#888"}),(function(e){var t=e.$color;return null!=t?t:"#888"}));e.defaultAuthUrl="https://portal-api.idmission.com";var ke=["https://portal-api.idmission.com","https://portal-api-uat.idmission.com","https://portal-api-demo.idmission.com","https://portal-api-dev.idmission.com","http://localhost:10000"];var De,Me={authUrl:e.defaultAuthUrl,sessionCheckState:"READY"},Te=t.createContext(Me),Ie=t.createContext((function(){})),Se=function(e,t){switch(t.type){case"setSessionId":return f(f({},e),{sessionId:t.payload});case"setCheckState":return f(f({},e),{sessionCheckState:t.payload});case"setError":return f(f({},e),{sessionCheckState:"ERROR",authError:t.payload});case"retry":return f(f({},e),{sessionCheckState:"READY",authError:void 0,sessionId:void 0});default:return e}};function Ne(n){var r,o=n.authUrl,i=n.children,a=function(n,r){var o=this;void 0===n&&(n=e.defaultAuthUrl);var i=t.useReducer(Se,f(f({},Me),{authUrl:n})),a=i[0],s=i[1],u=a.sessionId,c=a.sessionCheckState;return t.useEffect((function(){if(!ke.includes(n))return s({type:"setCheckState",payload:"AUTH_URL_NOT_ALLOWED"})}),[n]),t.useEffect((function(){if("READY"===c)if(u)s({type:"setCheckState",payload:"RUNNING"}),h(o,void 0,void 0,(function(){var e,t,r,o,i;return m(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,fetch("".concat(n,"/portal.sessions.v1.SessionsService/ValidateSession"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:u})})];case 1:return[4,(e=a.sent()).json()];case 2:return t=a.sent(),r=t.valid,o=t.message,e.ok||s({type:"setError",payload:new me(new Error(o),n)}),s({type:"setCheckState",payload:r?"PASSED":"FAILED"}),[3,4];case 3:return i=a.sent(),s({type:"setError",payload:new me(i,n)}),[3,4];case 4:return[2]}}))}));else{if(!r)return s({type:"setCheckState",payload:"MISSING"});if("string"==typeof r)return s({type:"setSessionId",payload:r});r instanceof Function&&r().then((function(e){s({type:"setSessionId",payload:e})})).catch((function(e){s({type:"setError",payload:new me(e,n)})}))}}),[n,c,u,r]),[a,s]}(void 0===o?e.defaultAuthUrl:o,n.sessionId),s=a[0],u=a[1];return"MISSING"===s.sessionCheckState?t.createElement(be,null):"FAILED"===s.sessionCheckState?t.createElement(xe,{message:null===(r=s.authError)||void 0===r?void 0:r.message}):"AUTH_URL_NOT_ALLOWED"===s.sessionCheckState?t.createElement(Ce,null):"ERROR"===s.sessionCheckState?t.createElement(we,{error:s.authError,onRetry:function(){return u({type:"retry"})}}):"READY"===s.sessionCheckState||"RUNNING"===s.sessionCheckState?t.createElement(O,{className:"flex"},t.createElement(Ee,null)):t.createElement(Te.Provider,{value:s},t.createElement(Ie.Provider,{value:u},i))}!function(e){e[e.Off=0]="Off",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Info=3]="Info",e[e.Debug=4]="Debug"}(De||(De={}));var Ae=De.Warn;function Le(e){var n;t.useEffect((function(){var e=Ae;if(n!==e)return Ae=n,function(){Ae=e}}),[n=e?De.Debug:Ae])}function Oe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];Ae<De.Info||console.log.apply(console,e)}function Re(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];Ae<De.Warn||console.warn.apply(console,e)}function Fe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];Ae<De.Error||console.error.apply(console,e)}e.defaultSubmissionUrl="https://portal-api.idmission.com/swagger";var Pe="https://portal-api.idmission.com/files/";function Ue(t){!function(t){if(!ke.includes(t))throw new Error("invalid auth url");e.defaultAuthUrl=t}(t),function(t){e.defaultSubmissionUrl=t}(t+"/swagger"),function(e){Pe=e}(t+"/files/")}var _e=t.createContext({submit:function(){return h(void 0,void 0,void 0,(function(){return m(this,(function(e){return[2,null]}))}))},submissionStatus:b.READY,submissionRequest:null,submissionResponse:null,submissionError:null,submissionEnvironment:"prod",idFrontImage:null,idBackImage:null,passportImage:null,selfieImage:null,signatureData:null,signatureVideoUrl:null,idCaptureVideoUrl:null,idCaptureVideoIdFrontImage:null,idCaptureVideoIdBackImage:null,idCaptureVideoAudioUrl:null,idCaptureVideoAudioStartsAt:null,additionalDocuments:null,setIdFrontImage:function(){return null},setIdBackImage:function(){return null},setPassportImage:function(){return null},setSelfieImage:function(){return null},setSignatureData:function(){return null},setSignatureVideoUrl:function(){return null},setIdCaptureVideoUrl:function(){return null},setIdCaptureVideoIdFrontImage:function(){return null},setIdCaptureVideoIdBackImage:function(){return null},setIdCaptureVideoAudioUrl:function(){return null},setIdCaptureVideoAudioStartsAt:function(){return null},setExpectedAudioText:function(){return null},setAdditionalDocuments:function(){return null},uploadDocument:Promise.resolve,logIdFrontCaptureAttempt:function(){return null},logIdBackCaptureAttempt:function(){return null},logSelfieCaptureAttempt:function(){return null},livenessCheckRequest:null,checkLiveness:function(){return h(void 0,void 0,void 0,(function(){return m(this,(function(e){throw new Error("checkLiveness is not implemented")}))}))},retryLocationAccess:function(){return null}}),je=function(n){var r=n.action,o=n.children,a=n.submissionUrl,s=void 0===a?e.defaultSubmissionUrl:a,u=n.environment,c=void 0===u?"prod":u,l=n.companyId,d=n.enrollmentId,p=n.personalData,v=n.cardData,x=n.idData,C=n.bypassAgeValidation,k=void 0!==C&&C,M=n.bypassNameMatching,A=void 0===M||M,L=n.needImmediateResponse,O=void 0!==L&&L,R=n.manualReviewRequired,F=void 0!==R&&R,P=n.idBackImageRequired,U=void 0===P||P,_=n.idImageResolutionCheck,j=void 0===_||_,B=n.verifyIdWithExternalDatabases,z=void 0!==B&&B,G=n.deduplicationEnabled,V=void 0!==G&&G,W=n.deduplicationSynchronous,q=void 0!==W&&W,H=n.idCardForFaceMatch,Y=n.geolocationEnabled,Z=void 0===Y||Y,Q=n.geolocationRequired,$=void 0!==Q&&Q,X=n.webhooksEnabled,K=void 0!==X&&X,J=n.webhooksClientTraceId,ee=n.webhooksStripSpecialCharacters,te=void 0===ee||ee,ne=n.webhooksSendInputImages,re=void 0!==ne&&ne,oe=n.webhooksSendProcessedImages,ie=void 0!==oe&&oe,ae=n.webhooksFireOnReview,se=void 0!==ae&&ae,ue=n.customerDataMatchConfig,ce=n.precapturedDocuments,le=n.documentServiceUrl,de=void 0===le?Pe:le,me=n.sendBase64DocumentsInSwaggerProxy,ve=void 0!==me&&me,ye=n.onSubmit,be=n.onBeforeSubmit,xe=n.onBeforeLivenessCheck,Ce=n.onBeforeDocumentUpload,we=n.onDocumentUploadProgress,Ee=n.onDocumentUploaded,ke=n.onDocumentUploadFailed,De=n.onResponseReceived,Me=n.onRequestFailure,Se=n.clientRequestID,Ne=function(){var e=t.useContext(Te),n=t.useContext(Ie);if(!e||!n)throw new Error("useAuthContext cannot be used without AuthStateProvider");return[e,n]}()[0].sessionId,Ae=t.useState(b.READY),Le=Ae[0],Re=Ae[1],Fe=t.useState(null),Ue=Fe[0],je=Fe[1],Be=t.useState(null),ze=Be[0],Ge=Be[1],Ve=t.useState(null),We=Ve[0],qe=Ve[1],He=t.useState(null),Ye=He[0],Ze=He[1],Qe=t.useState(null),$e=Qe[0],Xe=Qe[1],Ke=t.useState(null),Je=Ke[0],et=Ke[1],tt=t.useState(null),nt=tt[0],rt=tt[1],ot=t.useState(null),it=ot[0],at=ot[1],st=t.useState(null),ut=st[0],ct=st[1],lt=t.useState(null),dt=lt[0],ft=lt[1],pt=t.useState(null),ht=pt[0],mt=pt[1],gt=t.useState(null),vt=gt[0],yt=gt[1],bt=t.useState(null),xt=bt[0],Ct=bt[1],wt=t.useState(null),Et=wt[0],kt=wt[1],Dt=t.useState(null),Mt=Dt[0],Tt=Dt[1],It=t.useState(null),St=It[0],Nt=It[1],At=t.useState(null),Lt=At[0],Ot=At[1],Rt=t.useState(null),Ft=Rt[0],Pt=Rt[1],Ut=t.useState(null),_t=Ut[0],jt=Ut[1],Bt=t.useState(0),zt=Bt[0],Gt=Bt[1],Vt=t.useState(!1),Wt=Vt[0],qt=Vt[1],Ht=t.useState([]),Yt=Ht[0],Zt=Ht[1],Qt=t.useState([]),$t=Qt[0],Xt=Qt[1],Kt=t.useState([]),Jt=Kt[0],en=Kt[1],tn=t.useCallback((function(e){Zt((function(t){return g(g([],t,!0),[e],!1)}))}),[]),nn=t.useCallback((function(e){Xt((function(t){return g(g([],t,!0),[e],!1)}))}),[]),rn=t.useCallback((function(e){en((function(t){return g(g([],t,!0),[e],!1)}))}),[]);t.useEffect((function(){(null==ce?void 0:ce.selfie)&&ct(E(ce.selfie.imageData))}),[null==ce?void 0:ce.selfie]);var on=t.useCallback((function(e,t){return new Promise((function(n,r){return h(void 0,void 0,void 0,(function(){var o,a,s;return m(this,(function(u){switch(u.label){case 0:return o="string"==typeof e?function(e){for(var t=e.split(";base64,"),n=t[0].split(":")[1],r=window.atob(t[1]),o=new Uint8Array(r.length),i=0;i<r.length;++i)o[i]=r.charCodeAt(i);return new Blob([o],{type:n})}(e):e,(a=Ce)?[4,null==Ce?void 0:Ce(o,t)]:[3,2];case 1:a=!1===u.sent(),u.label=2;case 2:return a?[2,n(D(o))]:(s=function(e,t){return new(void 0!==window.tus?window.tus.Upload:i.Upload)(e,t)}(o,{endpoint:de,retryDelays:[0,1e3,1e3,1e3,3e3,5e3,1e4,2e4],headers:{"X-Session-Id":Ne},metadata:t||{filetype:o.type},onProgress:function(e,n){null==we||we({bytesUploaded:e,bytesTotal:n,percentage:(e/n*100).toFixed(2)+"%",metadata:t})},onSuccess:function(){var e,r="urn:documentsv1:"+(null===(e=s.url.split("/files/").pop())||void 0===e?void 0:e.split("+").shift());null==Ee||Ee(r,t),n(r)},onError:function(e){Oe("Failed because: "+e),null==ke||ke(e,t),r(e)}}),s.findPreviousUploads().then((function(e){e.length&&s.resumeFromPreviousUpload(e[0]),s.start()})),[2])}}))}))}))}),[Ce,de,Ne,we,Ee,ke]),an=t.useCallback((function(){return h(void 0,void 0,void 0,(function(){function e(e,t){return h(this,arguments,void 0,(function(e,t,n){return void 0===n&&(n="image/jpeg"),m(this,(function(r){switch(r.label){case 0:return de?(e.startsWith("data:")||(e="data:".concat(n,";base64,").concat(e)),[4,on(e,{filename:t,filetype:n})]):[2,e];case 1:return[2,r.sent()]}}))}))}var t,n,r,o,i,a,s,u,c,g;return m(this,(function(y){switch(y.label){case 0:return s={idFrontImage:Je,idBackImage:nt,passportImage:it,selfieImage:ut},(n=ht)?[4,N(ht)]:[3,2];case 1:n=y.sent(),y.label=2;case 2:return s.signatureVideo=n,(r=vt)?[4,N(vt)]:[3,4];case 3:r=y.sent(),y.label=4;case 4:return s.idCaptureVideo=r,(o=Mt)?[4,N(Mt)]:[3,6];case 5:o=y.sent(),y.label=6;case 6:return s.idCaptureVideoAudio=o,s.idCaptureVideoIdFrontImage=xt,s.idCaptureVideoIdBackImage=Et,t=s,dt&&(t.signatureImage=null==dt?void 0:dt.fileContent),de?[4,Promise.all(Object.keys(t).map((function(n){return h(void 0,void 0,void 0,(function(){var r,o;return m(this,(function(i){switch(i.label){case 0:return t[n]?(r=t,o=n,[4,e(t[n],n)]):[3,2];case 1:r[o]=i.sent(),i.label=2;case 2:return[2]}}))}))})))]:[3,8];case 7:y.sent(),y.label=8;case 8:return i={securityData:{userName:"",password:"",merchantId:0},customerData:{idData:f({idType:"NSP",idCountry:"NSP",idState:""},x)},additionalData:{uniqueRequestId:(new Date).getTime().toString(),manualReviewRequired:F?"Y":"N",bypassAgeValidation:k?"Y":"N",bypassNameMatching:A?"Y":"N",postDataAPIRequired:K?"Y":"N",postDataOnReviewRequired:se?"Y":"N",sendInputImagesInPost:re?"Y":"N",sendProcessedImagesInPost:ie?"Y":"N",needImmediateResponse:O?"Y":"N",deDuplicationRequired:V?"Y":"N",deduplicationSynchronous:q?"Y":"N",verifyDataWithHost:z?"Y":"N",idBackImageRequired:U?"Y":"N",stripSpecialCharacters:te?"Y":"N",idImageResolutionCheck:j?"Y":"N",customerDataMatchConfig:ue}},Se&&(i.additionalData.clientRequestID=Se),t.idFrontImage&&(i.customerData.idData.idImageFront=t.idFrontImage),t.idBackImage&&(i.customerData.idData.idImageBack=t.idBackImage),t.passportImage&&(i.customerData.idData.idImageFront=t.passportImage),t.selfieImage&&(i.customerData.biometricData={selfie:t.selfieImage}),l&&(i.employee={companyId:l}),p&&(i.customerData.personalData=p),v&&(i.customerData.cardData=v),d&&((u=i.customerData).personalData||(u.personalData={}),i.customerData.personalData.uniqueNumber=d),J&&(i.additionalData.clientTraceId=J),dt&&(i.customerData.signatureData={signatureImage:JSON.stringify(dt)},t.signatureVideo&&(i.customerData.signatureData.signatureVideo=t.signatureVideo)),Ft&&(i.customerData.additionalDocuments=Ft.map((function(e){return f(f({},e),{additionalDocument:JSON.stringify(f(f({},e.additionalDocument),{uniqueId:i.additionalData.uniqueRequestId}))})}))),t.idCaptureVideo&&((c=i.customerData).biometricData||(c.biometricData={}),i.customerData.biometricData.videoData=t.idCaptureVideo),t.idCaptureVideoAudio&&((g=i.customerData).biometricData||(g.biometricData={}),i.customerData.biometricData.voiceData=t.idCaptureVideoAudio,i.customerData.biometricData.voiceStartTime=null!=St?St:void 0,i.customerData.biometricData.expectedAudioText=null!=Lt?Lt:void 0),t.idCaptureVideoIdFrontImage&&(i.customerData.idData.videoIdImageFront=t.idCaptureVideoIdFrontImage),t.idCaptureVideoIdBackImage&&(i.customerData.idData.videoIdImageBack=t.idCaptureVideoIdBackImage),S(i,{selfieCaptureAttempts:Jt,idFrontCaptureAttempts:Yt,idBackCaptureAttempts:$t,geolocationResult:_t}),be?[4,be(i)]:[3,10];case 9:(a=y.sent())&&(i=a),y.label=10;case 10:return[2,i]}}))}))}),[Ft,k,A,v,Se,l,ue,V,q,de,d,Lt,_t,$t,nt,U,St,Mt,Et,xt,vt,x,Yt,Je,j,F,O,be,it,p,Jt,ut,dt,ht,on,z,J,K,se,re,ie,te]),sn=t.useCallback((function(){return h(void 0,void 0,void 0,(function(){var e,t,n,o,i,a,u,l,d,f;return m(this,(function(p){switch(p.label){case 0:if(r===y.NONE)return e={status:{statusCode:"000"},resultData:{}},Re(b.SUBMITTED),Ge(e),[2,e];Re(b.SUBMITTING),p.label=1;case 1:return p.trys.push([1,7,,8]),[4,an()];case 2:return t=p.sent(),n=s||T(c),o=function(e,t,n){switch(e){case y.ENROLL:return t?"/v4/customer/enroll":"/v4/customer/enroll-biometrics";case y.IDENTIFY:return"/v4/customer/identify";case y.VALIDATE:return n?"/v4/customer/validate-id-match-face":"/v4/customer/validate-id";case y.VERIFY:return"/v4/customer/verify";default:throw new Error("unrecognized SubmissionAction ".concat(e))}}(r,!!(Je||nt||it),!!ut),[4,fetch(n+o,{method:"POST",headers:I(Ne,ve),body:JSON.stringify(t)}).catch((function(e){throw new he(e.message)}))];case 3:return(i=p.sent())&&i.ok?[3,5]:[4,null==i?void 0:i.text()];case 4:if(!(a=p.sent())||"Load failed"===a)throw new he(a);throw new pe({statusCode:null!==(f=null==i?void 0:i.statusText)&&void 0!==f?f:"???",statusMessage:a});case 5:return[4,i.json()];case 6:if("000"!==(u=p.sent()).status.statusCode)throw new pe(u.status);return je(t),Ge(u),Re(b.SUBMITTED),null==De||De(u,t),[2,u];case 7:throw l=p.sent(),d=l,Re(b.FAILED),qe(l instanceof pe||l instanceof he?l:"Load failed"===d.message?new he:new pe({statusCode:"",statusMessage:d.message})),Ze((function(){return["VERIFY","IDENTIFY"].includes(r)?function(){return null}:sn})),null==Me||Me(d),d;case 8:return[2]}}))}))}),[r,an,s,c,Je,nt,it,ut,Ne,ve,De,Me]),un=t.useCallback((function(){return h(void 0,void 0,void 0,(function(){var e;return m(this,(function(t){switch(t.label){case 0:return ye?(e=ye,[4,an()]):[3,2];case 1:return[2,e.apply(void 0,[t.sent()])];case 2:return[4,sn()];case 3:return[2,t.sent()]}}))}))}),[an,sn,ye]),cn=t.useCallback((function(e){return h(void 0,void 0,void 0,(function(){var t,n,r,o,i,a,u,l,d,f,p;return m(this,(function(h){switch(h.label){case 0:return h.trys.push([0,8,,9]),d={securityData:{userName:"",password:"",merchantId:0}},f={},p={},[4,w(e)];case 1:return d.customerData=(f.biometricData=(p.selfie=h.sent(),p),f),d.additionalData={uniqueRequestId:(new Date).getTime().toString(),stripSpecialCharacters:te?"Y":"N",estimateAge:"N",predictGender:"N"},t=d,Se&&(t.additionalData.clientRequestID=Se),H&&(t.customerData.idData={idImageFront:H},t.customerData.additionalData={uniqueRequestId:t.additionalData.uniqueRequestId}),S(t,{selfieCaptureAttempts:Jt,idFrontCaptureAttempts:Yt,idBackCaptureAttempts:$t,geolocationResult:_t}),Xe(t),xe?[4,xe(t)]:[3,3];case 2:(n=h.sent())&&(t=n),h.label=3;case 3:return r=s||T(c),void 0===(m=!!H)&&(m=!1),[4,fetch(r+(m?"/v4/customer/match-id-face":"/v4/customer/live-check"),{method:"POST",headers:I(Ne,ve),body:JSON.stringify(t)}).catch((function(e){throw new he(e.message)}))];case 4:return(o=h.sent()).ok?[3,6]:[4,o.text()];case 5:if(!(i=h.sent())||"Load failed"===i)throw new he(i);throw new pe({statusCode:o.statusText,statusMessage:i});case 6:return[4,o.json()];case 7:if("000"!==(a=h.sent()).status.statusCode)throw new pe(a.status);return Ge(a),[2,a];case 8:throw u=h.sent(),l=u,Re(b.FAILED),qe(u instanceof pe||u instanceof he?u:"Load failed"===l.message?new he:new pe({statusCode:"",statusMessage:l.message})),Ze((function(){return function(){return null}})),null==Me||Me(l),l;case 9:return[2]}var m}))}))}),[te,Se,H,Jt,Yt,$t,_t,xe,s,c,Ne,ve,Me]),ln=t.useCallback((function(){Gt((function(e){return e+1}))}),[]);t.useEffect((function(){Z&&(Oe("making geolocation attempt",zt),navigator.geolocation.getCurrentPosition((function(e){jt(e),qt(!1)}),(function(e){if(1!==e.code)throw new Error(e.message);qt(!0)})))}),[zt,Z,$]);var dn=t.useCallback((function(){Ye&&(qe(null),Re(b.READY),Ye())}),[Ye]);return t.createElement(_e.Provider,{value:{submit:un,submissionStatus:Le,submissionRequest:Ue,submissionResponse:ze,submissionError:We,submissionEnvironment:c,idFrontImage:Je,idBackImage:nt,passportImage:it,selfieImage:ut,signatureData:dt,signatureVideoUrl:ht,idCaptureVideoUrl:vt,idCaptureVideoIdFrontImage:xt,idCaptureVideoIdBackImage:Et,idCaptureVideoAudioUrl:Mt,idCaptureVideoAudioStartsAt:St,additionalDocuments:Ft,setIdFrontImage:et,setIdBackImage:rt,setPassportImage:at,setSelfieImage:ct,setSignatureData:ft,setSignatureVideoUrl:mt,setIdCaptureVideoUrl:yt,setIdCaptureVideoIdFrontImage:Ct,setIdCaptureVideoIdBackImage:kt,setIdCaptureVideoAudioUrl:Tt,setIdCaptureVideoAudioStartsAt:Nt,setExpectedAudioText:Ot,setAdditionalDocuments:Pt,uploadDocument:on,logIdFrontCaptureAttempt:tn,logIdBackCaptureAttempt:nn,logSelfieCaptureAttempt:rn,livenessCheckRequest:$e,checkLiveness:cn,retryLocationAccess:ln}},$&&Wt?t.createElement(fe,null):o,We&&t.createElement(ge,{error:We,onRetry:dn}))};function Be(e,t,n){return e[t]?e[t][0]?e[t][0][n]:e[t][n]:"contentBoxSize"===t?e.contentRect["inlineSize"===n?"width":"height"]:void 0}function ze(e){void 0===e&&(e={});var n=e.onResize,r=t.useRef(void 0);r.current=n;var o=e.round||Math.round,i=t.useRef(),a=t.useState({width:void 0,height:void 0}),s=a[0],u=a[1],c=t.useRef(!1);t.useEffect((function(){return c.current=!1,function(){c.current=!0}}),[]);var l=t.useRef({width:void 0,height:void 0}),d=function(e,n){var r=t.useRef(null),o=t.useRef(null);o.current=n;var i=t.useRef(null);t.useEffect((function(){a()}));var a=t.useCallback((function(){var t=o.current,n=i.current||(t?t instanceof Element?t:t.current:null);r.current&&r.current.element===n&&r.current.subscriber===e||(r.current&&r.current.cleanup&&r.current.cleanup(),r.current={element:n,subscriber:e,cleanup:n?e(n):void 0})}),[e]);return t.useEffect((function(){return function(){r.current&&r.current.cleanup&&(r.current.cleanup(),r.current=null)}}),[]),t.useCallback((function(e){i.current=e,a()}),[a])}(t.useCallback((function(t){return i.current&&i.current.box===e.box&&i.current.round===o||(i.current={box:e.box,round:o,instance:new ResizeObserver((function(t){var n=t[0],i="border-box"===e.box?"borderBoxSize":"device-pixel-content-box"===e.box?"devicePixelContentBoxSize":"contentBoxSize",a=Be(n,i,"inlineSize"),s=Be(n,i,"blockSize"),d=a?o(a):void 0,f=s?o(s):void 0;if(l.current.width!==d||l.current.height!==f){var p={width:d,height:f};l.current.width=d,l.current.height=f,r.current?r.current(p):c.current||u(p)}}))}),i.current.instance.observe(t,{box:e.box}),function(){i.current&&i.current.instance.unobserve(t)}}),[e.box,o]),e.ref);return t.useMemo((function(){return{ref:d,width:s.width,height:s.height}}),[d,s.width,s.height])}var Ge,Ve=o.canvas(Ge||(Ge=v(["\n display: none;\n"],["\n display: none;\n"])));function We(e,t,n,r){if(e){var o=e.getContext("2d");if(o){if(!n||!r){var i=function(e){var t=e.width,n=e.height;return e instanceof HTMLImageElement&&(t=e.naturalWidth,n=e.naturalHeight),e instanceof HTMLVideoElement&&(t=e.videoWidth,n=e.videoHeight),[t,n]}(t);n||(n=i[0]),r||(r=i[1])}e.width=n,e.height=r,o.drawImage(t,0,0,n,r)}}}function qe(e){var t;null===(t=null==e?void 0:e.getContext("2d"))||void 0===t||t.clearRect(0,0,null==e?void 0:e.width,null==e?void 0:e.height)}function He(e){return h(this,arguments,void 0,(function(e,t){var n,r;return void 0===t&&(t=!1),m(this,(function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia({video:{facingMode:{exact:e}},audio:t})];case 1:return n=o.sent(),[4,navigator.mediaDevices.enumerateDevices()];case 2:return r=o.sent().filter((function(e){return"videoinput"===e.kind})),n.getVideoTracks().forEach((function(e){e.enabled=!1,e.stop()})),n=null,[2,r]}}))}))}var Ye,Ze,Qe=["front","avant","anteriore","cameraaanvoorzijde","kamerapåframsidan","forsidekamera","kamerapåforsiden","aparatprzedni","etukamera","kameradepan","ÖnKamera","cameramặttrước","camerăfață","prednákamera","prednjakamera","előlapikamera","přednífotoaparát","μπροστινήκάμερα","переднякамера","передняякамера","преднакамера","алдыңғыкамера","מצלמה קדמית","الكاميرا الأمامية","फ़्रंटकैमरा","前置相机","前置鏡頭","前面カメラ","전면카메라","กล้องด้านหน้า"].map((function(e){return e.toLocaleLowerCase().split(" ").join("")})),$e=["back","rear","posterior","trasera","traseira","arrière","rückkamera","fotocamera(posteriore)","cameraaanachterzijde","kamerapåbaksidan","kamerapåbaksiden","bagsidekamera","aparattylny","takakamera","arkakamera","kamerabelakang","cameramặtsau","camerăspate","stražnjakamera","zadnákamera","hátoldalikamera","zadnífotoaparát","πίσωκάμερα","заднякамера","Задняякамера","заднакамера","артқыкамера","מצלמה אחורית","الكاميرا الخلفية","बैककैमरा","后置相机","後置鏡頭","背面カメラ","후면카메라","กล้องด้านหลัง"].map((function(e){return e.toLocaleLowerCase().split(" ").join("")})),Xe=["backdualwidecamera","backultrawidecamera","ultraampliaposterior","ultra-angulartraseira","ultragrandeangulartraseira","ultragrandangle","ultragranangular","ultra-weitwinkelkamera","ultra-grandangolo","ultrabredecameraaanachterzijde","ultravidvinkelkamerapåbaksidan","ultravidvinkelkameraetpåbagsiden","ultravidvinkelkamerabak","ultragenişkameraarkayüzü","ultralaajakulmainentakakamera","tylnyaparatultraszerokokątny","cameracựcrộngmặtsau","camerăcuobiectivultra‑superangularspate","ultraszéleslátószögűkamera","kameraultralebarbelakang","stražnjaultraširokakamera","zadníultraširokoúhlýfotoaparát","ultraširokouhlá","πίσωυπερευρείακάμερα","заднянадширококутнакамера","Задняясверхширокоугольнаякамера","Задна свръх широкоъгълна камера","артқыультракеңбұрыштыкамера","מצלמה אולטרה רחבה אחורית","كاميرا خلفية عريضة جدًا","बैकअल्ट्रावाइडकैमरा","后置超广角相机","後置超廣角鏡頭相機","背面超広角カメラ","후면울트라와이드카메라","กล้องด้านหลังอัลตร้าไวด์"].map((function(e){return e.toLocaleLowerCase().split(" ").join("")})),Ke=function(e,t){var n=e instanceof MediaDeviceInfo?Je(e):e;return("string"==typeof t?[t]:t).some((function(e){return n.includes(e)}))},Je=function(e){return e.label.toLocaleLowerCase().split(" ").join("")};function et(){Ye&&(Oe("releasing camera access..."),Ye.release(),Ye=void 0)}function tt(e){var n=void 0===e?{}:e,r=n.requestAccessAutomatically,o=void 0===r||r,i=n.preferFrontFacingCamera,a=void 0!==i&&i,s=n.preferContinuityCamera,u=void 0===s||s,c=n.requireMicrophoneAccess,l=void 0!==c&&c,d=n.maxVideoWidth,f=void 0===d?1920:d,p=n.maxFps,v=n.debugMode,y=void 0!==v&&v,b=t.useRef(null),x=t.useRef([]),w=t.useRef(null),E=t.useState(!1),k=E[0],D=E[1],M=t.useState(!1),T=M[0],I=M[1],S=t.useState(null),N=S[0],A=S[1],L=t.useState(null),O=L[0],R=L[1],F=t.useState(!1),P=F[0],U=F[1],_=t.useState(!1),j=_[0],B=_[1],z=t.useState(u),G=z[0],V=z[1],W=t.useState(!1),q=W[0],H=W[1],Y=t.useState(!1),Z=Y[0],Q=Y[1],$=t.useState(!1),X=$[0],K=$[1],J=b.current;t.useEffect((function(){var e=x.current.slice(-1)[0];J&&J!==e&&(Oe("adding video to stack",J),x.current.push(J))}),[J]);var ee=t.useCallback((function(e){Oe("removing video from stack",e),x.current=x.current.filter((function(t){return t!==e})),b.current=x.current.slice(-1)[0],Oe("new videoRef is",b.current)}),[]);t.useEffect((function(){y&&Oe("iphone continuity camera allowed changed",G),et(),w.current=null,U(!1)}),[y,G]);var te=t.useCallback((function(){return h(this,void 0,void 0,(function(){var e,t,n,r,o,i,s;return m(this,(function(u){switch(u.label){case 0:D(!1),Q(!1),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,He()];case 2:return e=u.sent(),t=void 0,y&&Oe("availableCameras",e),n=C(),y&&Oe("platformDetails",n),q||(null==n?void 0:n.os)&&"OS X"!==n.os.family?("Android"===(null===(i=null==n?void 0:n.os)||void 0===i?void 0:i.family)||e.every((function(e){return e.label.startsWith("camera2 ")})))&&(e=e.sort((function(e,t){return e.label.toLowerCase().localeCompare(t.label.toLowerCase())})),y&&Oe("cameras have been sorted",e)):(r=e.find((function(e){return Ke(e,"iphone")})),B(!!r),r&&G&&(t=r)),a&&(t=e.find((function(e){return Ke(e,Qe)}))),t||(t=e.find((function(e){return Ke(e,"backtriplecamera")}))),t||(t=e.find((function(e){return Ke(e,"backdualcamera")}))),t||(t=e.find((function(e){return Ke(e,$e)&&!Ke(e,Xe)}))),t||(t=e.find((function(e){return Ke(e,$e)}))),!a&&"iOS"===(null===(s=null==n?void 0:n.os)||void 0===s?void 0:s.family)&&e.length>0&&(t||(t=e[1])),t||(t=e[0]),y&&Oe("selectedCamera",t),A(t),[3,4];case 3:if("NotAllowedError"!==(o=u.sent()).name)throw Fe("camera access encountered some other error",o),o;return Fe("camera access has been blocked by the user",o),Q(!0),[3,4];case 4:return[2]}}))}))}),[y,G,q,a]);t.useEffect((function(){o&&!Z&&te().catch(Fe)}),[Z,o,te]),t.useEffect((function(){var e;if(N){var t=function(){et(),w.current=null,U(!1)};return(null===(e=navigator.mediaDevices)||void 0===e?void 0:e.getUserMedia)?(h(this,void 0,void 0,(function(){var e,t,n,r;return m(this,(function(o){switch(o.label){case 0:e={audio:!1,video:{deviceId:{exact:N.deviceId},width:{ideal:f},aspectRatio:1.777777778,frameRate:{}}},p&&(e.video.frameRate={max:p}),t=null,o.label=1;case 1:return o.trys.push([1,3,,4]),[4,navigator.mediaDevices.getUserMedia(e)];case 2:return t=o.sent(),[3,4];case 3:return"NotAllowedError"===o.sent().name?(G?(B(!1),H(!0)):Q(!0),[2]):[3,4];case 4:if(t)return[3,8];o.label=5;case 5:return o.trys.push([5,7,,8]),[4,navigator.mediaDevices.getUserMedia({audio:!1,video:!0})];case 6:return t=o.sent(),Oe("opened stream with no width and height constraints"),[3,8];case 7:return o.sent(),Oe("cannot open stream at all"),[3,8];case 8:if(!t)throw new Error("failed to open camera");return n=function(){j&&G?(Oe("someone unplugged the continuity camera"),et(),w.current=null,B(!1),H(!0),A(null)):(Oe("someone unplugged the webcam"),et(),w.current=null,U(!1),Q(!0))},null===(r=b.current)||void 0===r||r.addEventListener("ended",n),t.getVideoTracks().forEach((function(e){e.onended=n})),w.current=function(e,t,n){et(),Oe("obtaining camera access...");var r=e.getVideoTracks()[0].getSettings(),o=r.width,i=r.height,a=t.toLocaleLowerCase().split(" ").join(""),s=Ke(a,g(g(g([],$e,!0),Xe,!0),["iphone"],!1));return o||(o=0),i||(i=0),Ye={label:t,stream:e,width:o,height:i,isRearFacing:s,release:function(){e.getTracks().forEach((function(e){e.enabled=!1,e.stop()})),n&&(n.pause(),n.srcObject=null,n.src="")}},n&&(n.srcObject=e),Ye}(t,N.label,b.current),[2]}}))})),t):t}}),[G,j,p,f,N]),t.useEffect((function(){D(!1),N&&P&&D(N&&P)}),[P,N]);var ne=t.useCallback((function(){return h(this,void 0,void 0,(function(){var e;return m(this,(function(t){switch(t.label){case 0:I(!1),K(!1),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,navigator.mediaDevices.getUserMedia({audio:!0,video:!1})];case 2:return e=t.sent(),Ze=e,R(e),I(!0),e.getAudioTracks().forEach((function(e){e.onended=function(){K(!0)}})),[3,4];case 3:return t.sent(),K(!0),[3,4];case 4:return[2]}}))}))}),[]);t.useEffect((function(){if(l&&!X)return ne().catch(Fe),function(){!function(){var e;Ze&&(Oe("releasing microphone access..."),null===(e=Ze.stop)||void 0===e||e.call(Ze),Ze.getAudioTracks().forEach((function(e){var t;null===(t=e.stop)||void 0===t||t.call(e)})),Ze=void 0)}(),R(null),I(!1)}}),[X,ne,l]);var re=t.useCallback((function(){return h(this,void 0,void 0,(function(){var e;return m(this,(function(t){switch(t.label){case 0:return w.current?"undefined"==typeof ImageCapture?[3,2]:[4,new ImageCapture(w.current.stream.getTracks()[0]).takePhoto()]:[2,null];case 1:return[2,t.sent()];case 2:return b.current?(We(e=document.createElement("canvas"),b.current),[2,new Promise((function(t){return e.toBlob(t)}))]):[2,null]}}))}))}),[]);return t.useMemo((function(){return{videoRef:b,videoDevice:N,videoLoaded:P,setVideoLoaded:U,onVideoUnmounted:ee,cameraRef:w,cameraReady:k,cameraAccessDenied:Z,requestCameraAccess:te,releaseCameraAccess:et,iphoneContinuityCameraAvailable:j,iphoneContinuityCameraAllowed:G,setIphoneContinuityCameraAllowed:V,takePhoto:re,audioStream:O,microphoneReady:T,microphoneAccessDenied:X,requestMicrophoneAccess:ne}}),[O,Z,k,G,j,X,T,ee,te,ne,re,N,P])}var nt=t.createContext({videoRef:{current:null},videoDevice:null,videoLoaded:!1,cameraRef:{current:null},cameraReady:!1,cameraAccessDenied:!1,requestCameraAccess:function(){return null},releaseCameraAccess:function(){return null},iphoneContinuityCameraAvailable:!1,iphoneContinuityCameraAllowed:!0,setIphoneContinuityCameraAllowed:function(){return null},takePhoto:function(){return Promise.resolve(null)},setVideoLoaded:function(){return null},onVideoUnmounted:function(){return null},audioStream:null,microphoneReady:!1,microphoneAccessDenied:!1,requestMicrophoneAccess:function(){return null}}),rt=function(e){var n=e.children,r=e.requestAccessAutomatically,o=e.preferFrontFacingCamera,i=e.preferContinuityCamera,a=e.requireMicrophoneAccess,s=e.maxVideoWidth,u=e.onCameraAccessDenied,c=e.onMicrophoneAccessDenied,l=e.debugMode,d=tt({requestAccessAutomatically:void 0===r||r,preferFrontFacingCamera:void 0!==o&&o,preferContinuityCamera:void 0===i||i,requireMicrophoneAccess:void 0!==a&&a,maxVideoWidth:void 0===s?1920:s,maxFps:e.maxFps,debugMode:void 0!==l&&l});t.useEffect((function(){d.cameraAccessDenied&&(null==u||u())}),[d.cameraAccessDenied,u]),t.useEffect((function(){d.microphoneAccessDenied&&(null==c||c())}),[d.microphoneAccessDenied,c]);var f=d.releaseCameraAccess;return t.useEffect((function(){return function(){f()}}),[f]),t.createElement(nt.Provider,{value:d},n)};function ot(e){return ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ot(e)}function it(e){var t=function(e,t){if("object"!=ot(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=ot(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==ot(t)?t:t+""}function at(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,it(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function st(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,o)}function ut(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){st(i,r,o,a,s,"next",e)}function s(e){st(i,r,o,a,s,"throw",e)}a(void 0)}))}}function ct(e,t){return ct=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ct(e,t)}function lt(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ct(e,t)}function dt(e){return dt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},dt(e)}function ft(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ft=function(){return!!e})()}function pt(e){var t="function"==typeof Map?new Map:void 0;return pt=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(ft())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&ct(o,n.prototype),o}(e,arguments,dt(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),ct(n,e)},pt(e)}var ht={exports:{}},mt={exports:{}};!function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(mt);var gt=mt.exports;!function(e){var t=gt.default;function n(){e.exports=n=function(){return o},e.exports.__esModule=!0,e.exports.default=e.exports;var r,o={},i=Object.prototype,a=i.hasOwnProperty,s=Object.defineProperty||function(e,t,n){e[t]=n.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",d=u.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(r){f=function(e,t,n){return e[t]=n}}function p(e,t,n,r){var o=Object.create((t&&t.prototype instanceof x?t:x).prototype),i=new O(r||[]);return s(o,"_invoke",{value:S(e,n,i)}),o}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}o.wrap=p;var m="suspendedStart",g="suspendedYield",v="executing",y="completed",b={};function x(){}function C(){}function w(){}var E={};f(E,c,(function(){return this}));var k=Object.getPrototypeOf,D=k&&k(k(R([])));D&&D!==i&&a.call(D,c)&&(E=D);var M=w.prototype=x.prototype=Object.create(E);function T(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,n){function r(o,i,s,u){var c=h(e[o],e,i);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==t(d)&&a.call(d,"__await")?n.resolve(d.__await).then((function(e){r("next",e,s,u)}),(function(e){r("throw",e,s,u)})):n.resolve(d).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,u)}))}u(c.arg)}var o;s(this,"_invoke",{value:function(e,t){function i(){return new n((function(n,o){r(e,t,n,o)}))}return o=o?o.then(i,i):i()}})}function S(e,t,n){var o=m;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:r,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=N(s,n);if(u){if(u===b)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var c=h(e,t,n);if("normal"===c.type){if(o=n.done?y:g,c.arg===b)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=y,n.method="throw",n.arg=c.arg)}}}function N(e,t){var n=t.method,o=e.iterator[n];if(o===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=r,N(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var i=h(o,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,b;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,b):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,b)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function R(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function t(){for(;++o<e.length;)if(a.call(e,o))return t.value=e[o],t.done=!1,t;return t.value=r,t.done=!0,t};return i.next=i}}throw new TypeError(t(e)+" is not iterable")}return C.prototype=w,s(M,"constructor",{value:w,configurable:!0}),s(w,"constructor",{value:C,configurable:!0}),C.displayName=f(w,d,"GeneratorFunction"),o.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===C||"GeneratorFunction"===(t.displayName||t.name))},o.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,f(e,d,"GeneratorFunction")),e.prototype=Object.create(M),e},o.awrap=function(e){return{__await:e}},T(I.prototype),f(I.prototype,l,(function(){return this})),o.AsyncIterator=I,o.async=function(e,t,n,r,i){void 0===i&&(i=Promise);var a=new I(p(e,t,n,r),i);return o.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},T(M),f(M,d,"Generator"),f(M,c,(function(){return this})),f(M,"toString",(function(){return"[object Generator]"})),o.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},o.values=R,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(L),!e)for(var t in this)"t"===t.charAt(0)&&a.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=r)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,o){return s.type="throw",s.arg=e,t.next=n,o&&(t.method="next",t.arg=r),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=a.call(i,"catchLoc"),c=a.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),L(n),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;L(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:R(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),b}},o}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(ht);var vt=(0,ht.exports)(),yt=vt;try{regeneratorRuntime=vt}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=vt:Function("r","regeneratorRuntime = r")(vt)}var bt=W(yt);function xt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ct(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ct(e,t):void 0}}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ct(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var wt,Et,kt="undefined"!=typeof self?self:{};function Dt(e){e:{for(var t=["CLOSURE_FLAGS"],n=kt,r=0;r<t.length;r++)if(null==(n=n[t[r]])){t=null;break e}t=n}return null!=(e=t&&t[e])&&e}function Mt(){throw Error("Invalid UTF8")}function Tt(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var It,St="undefined"!=typeof TextDecoder,Nt="undefined"!=typeof TextEncoder;function At(e){if(Nt)e=(It||(It=new TextEncoder)).encode(e);else{for(var t=0,n=new Uint8Array(3*e.length),r=0;r<e.length;r++){var o=e.charCodeAt(r);if(128>o)n[t++]=o;else{if(2048>o)n[t++]=o>>6|192;else{if(55296<=o&&57343>=o){if(56319>=o&&r<e.length){var i=e.charCodeAt(++r);if(56320<=i&&57343>=i){n[t++]=(o=1024*(o-55296)+i-56320+65536)>>18|240,n[t++]=o>>12&63|128,n[t++]=o>>6&63|128,n[t++]=63&o|128;continue}r--}o=65533}n[t++]=o>>12|224,n[t++]=o>>6&63|128}n[t++]=63&o|128}}e=t===n.length?n:n.subarray(0,t)}return e}var Lt,Ot=Dt(610401301),Rt=Dt(188588736),Ft=kt.navigator;function Pt(e){return!!Ot&&!!Lt&&Lt.brands.some((function(t){var n=t.brand;return n&&-1!=n.indexOf(e)}))}function Ut(e){var t;return(t=kt.navigator)&&(t=t.userAgent)||(t=""),-1!=t.indexOf(e)}function _t(){return!!Ot&&!!Lt&&0<Lt.brands.length}function jt(){return _t()?Pt("Chromium"):(Ut("Chrome")||Ut("CriOS"))&&!(!_t()&&Ut("Edge"))||Ut("Silk")}function Bt(e){return Bt[" "](e),e}Lt=Ft&&Ft.userAgentData||null,Bt[" "]=function(){};var zt=!_t()&&(Ut("Trident")||Ut("MSIE"));!Ut("Android")||jt(),jt(),Ut("Safari")&&(jt()||!_t()&&Ut("Coast")||!_t()&&Ut("Opera")||!_t()&&Ut("Edge")||(_t()?Pt("Microsoft Edge"):Ut("Edg/"))||_t()&&Pt("Opera"));var Gt={},Vt=null;function Wt(){if(!Vt){Vt={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));Gt[n]=r;for(var o=0;o<r.length;o++){var i=r[o];void 0===Vt[i]&&(Vt[i]=o)}}}}var qt="undefined"!=typeof Uint8Array,Ht=!zt&&"function"==typeof btoa;function Yt(e){if(!Ht){var t;void 0===t&&(t=0),Wt(),t=Gt[t];for(var n=Array(Math.floor(e.length/3)),r=t[64]||"",o=0,i=0;o<e.length-2;o+=3){var a=e[o],s=e[o+1],u=e[o+2],c=t[a>>2];n[i++]=c+(a=t[(3&a)<<4|s>>4])+(s=t[(15&s)<<2|u>>6])+(u=t[63&u])}switch(c=0,u=r,e.length-o){case 2:u=t[(15&(c=e[o+1]))<<2]||r;case 1:n[i]=t[(e=e[o])>>2]+t[(3&e)<<4|c>>4]+u+r}return n.join("")}for(t="",n=0,r=e.length-10240;n<r;)t+=String.fromCharCode.apply(null,e.subarray(n,n+=10240));return t+=String.fromCharCode.apply(null,n?e.subarray(n):e),btoa(t)}var Zt,Qt=/[-_.]/g,$t={"-":"+",_:"/",".":"="};function Xt(e){return $t[e]||""}function Kt(e){if(!Ht)return function(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var r=new Uint8Array(n),o=0;return function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),o=Vt[n];if(null!=o)return o;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}Wt();for(var r=0;;){var o=n(-1),i=n(0),a=n(64),s=n(64);if(64===s&&-1===o)break;t(o<<2|i>>4),64!=a&&(t(i<<4&240|a>>2),64!=s&&t(a<<6&192|s))}}(e,(function(e){r[o++]=e})),o!==n?r.subarray(0,o):r}(e);Qt.test(e)&&(e=e.replace(Qt,Xt)),e=atob(e);for(var t=new Uint8Array(e.length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}function Jt(e){return qt&&null!=e&&e instanceof Uint8Array}function en(){return Zt||(Zt=new Uint8Array(0))}var tn,nn={};function rn(e){if(e!==nn)throw Error("illegal external caller")}function on(){return tn||(tn=new sn(null,nn))}function an(e){rn(nn);var t=e.g;return null==(t=null==t||Jt(t)?t:"string"==typeof t?Kt(t):null)?t:e.g=t}var sn=function(){function e(e,t){if(rn(t),this.g=e,null!=e&&0===e.length)throw Error("ByteString should be constructed with non-empty values")}return e.prototype.h=function(){var e=an(this);return e?new Uint8Array(e):en()},e}();function un(e,t){return Error("Invalid wire type: "+e+" (at position "+t+")")}function cn(){return Error("Failed to read varint, encoding is invalid.")}function ln(e,t){return Error("Tried to read past the end of the data "+t+" > "+e)}function dn(e){if("string"==typeof e)return{buffer:Kt(e),P:!1};if(Array.isArray(e))return{buffer:new Uint8Array(e),P:!1};if(e.constructor===Uint8Array)return{buffer:e,P:!1};if(e.constructor===ArrayBuffer)return{buffer:new Uint8Array(e),P:!1};if(e.constructor===sn)return{buffer:an(e)||en(),P:!0};if(e instanceof Uint8Array)return{buffer:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),P:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function fn(){return"function"==typeof BigInt}var pn,hn="function"==typeof Uint8Array.prototype.slice,mn=0,gn=0;function vn(e){var t=0>e,n=(e=Math.abs(e))>>>0;if(e=Math.floor((e-n)/4294967296),t){var r=Dn(n,e);e=r[1],n=r[0]}mn=n>>>0,gn=e>>>0}function yn(e){var t=pn||(pn=new DataView(new ArrayBuffer(8)));t.setFloat32(0,+e,!0),gn=0,mn=t.getUint32(0,!0)}function bn(e,t){return 4294967296*t+(e>>>0)}function xn(e,t){var n=2147483648&t;return n&&(t=~t>>>0,0==(e=1+~e>>>0)&&(t=t+1>>>0)),e=bn(e,t),n?-e:e}function Cn(e,t){if(e>>>=0,2097151>=(t>>>=0))var n=""+(4294967296*t+e);else fn()?n=""+(BigInt(t)<<BigInt(32)|BigInt(e)):(e=(16777215&e)+6777216*(n=16777215&(e>>>24|t<<8))+6710656*(t=t>>16&65535),n+=8147497*t,t*=2,1e7<=e&&(n+=Math.floor(e/1e7),e%=1e7),1e7<=n&&(t+=Math.floor(n/1e7),n%=1e7),n=t+wn(n)+wn(e));return n}function wn(e){return e=String(e),"0000000".slice(e.length)+e}function En(){var e=mn,t=gn;if(2147483648&t)if(fn())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{var n=Dn(e,t);e="-"+Cn(n[0],n[1])}else e=Cn(e,t);return e}function kn(e){if(16>e.length)vn(Number(e));else if(fn())e=BigInt(e),mn=Number(e&BigInt(4294967295))>>>0,gn=Number(e>>BigInt(32)&BigInt(4294967295));else{var t=+("-"===e[0]);gn=mn=0;for(var n=e.length,r=t,o=(n-t)%6+t;o<=n;r=o,o+=6){var i=Number(e.slice(r,o));gn*=1e6,4294967296<=(mn=1e6*mn+i)&&(gn+=Math.trunc(mn/4294967296),gn>>>=0,mn>>>=0)}if(t){var a=Dn(mn,gn);mn=a[0],gn=a[1]}}}function Dn(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}function Mn(e,t){var n,r=0,o=0,i=0,a=e.h,s=e.g;do{r|=(127&(n=a[s++]))<<i,i+=7}while(32>i&&128&n);for(32<i&&(o|=(127&n)>>4),i=3;32>i&&128&n;i+=7)o|=(127&(n=a[s++]))<<i;if(Rn(e,s),128>n)return t(r>>>0,o>>>0);throw cn()}function Tn(e){for(var t=0,n=e.g,r=n+10,o=e.h;n<r;){var i=o[n++];if(t|=i,!(128&i))return Rn(e,n),!!(127&t)}throw cn()}function In(e){var t=e.h,n=e.g,r=t[n++],o=127&r;if(128&r&&(o|=(127&(r=t[n++]))<<7,128&r&&(o|=(127&(r=t[n++]))<<14,128&r&&(o|=(127&(r=t[n++]))<<21,128&r&&(o|=(r=t[n++])<<28,128&r&&128&t[n++]&&128&t[n++]&&128&t[n++]&&128&t[n++]&&128&t[n++])))))throw cn();return Rn(e,n),o}function Sn(e){return In(e)>>>0}function Nn(e){var t=e.h,n=e.g,r=t[n],o=t[n+1],i=t[n+2];return t=t[n+3],Rn(e,e.g+4),(r|o<<8|i<<16|t<<24)>>>0}function An(e){var t=Nn(e);e=2*(t>>31)+1;var n=t>>>23&255;return t&=8388607,255==n?t?NaN:1/0*e:0==n?e*Math.pow(2,-149)*t:e*Math.pow(2,n-150)*(t+Math.pow(2,23))}function Ln(e){return In(e)}function On(e,t,n){var r=(void 0===n?{}:n).ca;e.ca=void 0!==r&&r,t&&(t=dn(t),e.h=t.buffer,e.m=t.P,e.j=0,e.l=e.h.length,e.g=e.j)}function Rn(e,t){if(e.g=t,t>e.l)throw ln(e.l,t)}function Fn(e,t){if(0>t)throw Error("Tried to read a negative byte length: "+t);var n=e.g,r=n+t;if(r>e.l)throw ln(t,e.l-n);return e.g=r,n}function Pn(e,t){if(0==t)return on();var n=Fn(e,t);return e.ca&&e.m?n=e.h.subarray(n,n+t):(e=e.h,n=n===(t=n+t)?en():hn?e.slice(n,t):new Uint8Array(e.subarray(n,t))),0==n.length?on():new sn(n,nn)}var Un=[];function _n(e){var t=e.g;if(t.g==t.l)return!1;e.l=e.g.g;var n=Sn(e.g);if(t=n>>>3,!(0<=(n&=7)&&5>=n))throw un(n,e.l);if(1>t)throw Error("Invalid field number: "+t+" (at position "+e.l+")");return e.m=t,e.h=n,!0}function jn(e){switch(e.h){case 0:0!=e.h?jn(e):Tn(e.g);break;case 1:Rn(e=e.g,e.g+8);break;case 2:if(2!=e.h)jn(e);else{var t=Sn(e.g);Rn(e=e.g,e.g+t)}break;case 5:Rn(e=e.g,e.g+4);break;case 3:for(t=e.m;;){if(!_n(e))throw Error("Unmatched start-group tag: stream EOF");if(4==e.h){if(e.m!=t)throw Error("Unmatched end-group tag");break}jn(e)}break;default:throw un(e.h,e.l)}}function Bn(e,t,n){var r=e.g.l,o=Sn(e.g),i=e.g.g+o,a=i-r;if(0>=a&&(e.g.l=i,n(t,e,void 0,void 0,void 0),a=i-e.g.g),a)throw Error("Message parsing ended unexpectedly. Expected to read "+o+" bytes, instead read "+(o-a)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=i,e.g.l=r,t}function zn(e){var t=Sn(e.g),n=Fn(e=e.g,t);if(e=e.h,St){var r,o=e;(r=Et)||(r=Et=new TextDecoder("utf-8",{fatal:!0})),t=n+t,o=0===n&&t===o.length?o:o.subarray(n,t);try{var i=r.decode(o)}catch(e){if(void 0===wt){try{r.decode(new Uint8Array([128]))}catch(e){}try{r.decode(new Uint8Array([97])),wt=!0}catch(e){wt=!1}}throw!wt&&(Et=void 0),e}}else{t=(i=n)+t,n=[];for(var a,s=null;i<t;){var u=e[i++];128>u?n.push(u):224>u?i>=t?Mt():(a=e[i++],194>u||128!=(192&a)?(i--,Mt()):n.push((31&u)<<6|63&a)):240>u?i>=t-1?Mt():128!=(192&(a=e[i++]))||224===u&&160>a||237===u&&160<=a||128!=(192&(r=e[i++]))?(i--,Mt()):n.push((15&u)<<12|(63&a)<<6|63&r):244>=u?i>=t-2?Mt():128!=(192&(a=e[i++]))||a-144+(u<<28)>>30||128!=(192&(r=e[i++]))||128!=(192&(o=e[i++]))?(i--,Mt()):(u=(7&u)<<18|(63&a)<<12|(63&r)<<6|63&o,n.push(55296+((u-=65536)>>10&1023),56320+(1023&u))):Mt(),8192<=n.length&&(s=Tt(s,n),n.length=0)}i=Tt(s,n)}return i}function Gn(e){var t=Sn(e.g);return Pn(e.g,t)}function Vn(e,t,n){var r=Sn(e.g);for(r=e.g.g+r;e.g.g<r;)n.push(t(e.g))}var Wn=[];function qn(e){return e?/^\d+$/.test(e)?(kn(e),new Yn(mn,gn)):null:Hn||(Hn=new Yn(0,0))}var Hn,Yn=function(e,t){this.h=e>>>0,this.g=t>>>0};function Zn(e){return e?/^-?\d+$/.test(e)?(kn(e),new $n(mn,gn)):null:Qn||(Qn=new $n(0,0))}var Qn,$n=function(e,t){this.h=e>>>0,this.g=t>>>0};function Xn(e,t,n){for(;0<n||127<t;)e.g.push(127&t|128),t=(t>>>7|n<<25)>>>0,n>>>=7;e.g.push(t)}function Kn(e,t){for(;127<t;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function Jn(e,t){if(0<=t)Kn(e,t);else{for(var n=0;9>n;n++)e.g.push(127&t|128),t>>=7;e.g.push(1)}}function er(e,t){e.g.push(t>>>0&255),e.g.push(t>>>8&255),e.g.push(t>>>16&255),e.g.push(t>>>24&255)}function tr(e,t){0!==t.length&&(e.l.push(t),e.h+=t.length)}function nr(e,t,n){Kn(e.g,8*t+n)}function rr(e,t){return nr(e,t,2),t=e.g.end(),tr(e,t),t.push(e.h),t}function or(e,t){var n=t.pop();for(n=e.h+e.g.length()-n;127<n;)t.push(127&n|128),n>>>=7,e.h++;t.push(n),e.h++}function ir(e,t,n){nr(e,t,2),Kn(e.g,n.length),tr(e,e.g.end()),tr(e,n)}function ar(e,t,n,r){null!=n&&(t=rr(e,t),r(n,e),or(e,t))}var sr=function(e,t,n,r){this.g=e,this.h=t,this.l=n,this.pa=r};function ur(e){return Array.prototype.slice.call(e)}function cr(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():e}var lr=cr(),dr=cr("0di"),fr=cr("2ex"),pr=lr?function(e,t){e[lr]|=t}:function(e,t){void 0!==e.g?e.g|=t:Object.defineProperties(e,{g:{value:t,configurable:!0,writable:!0,enumerable:!1}})},hr=lr?function(e,t){e[lr]&=~t}:function(e,t){void 0!==e.g&&(e.g&=~t)};function mr(e,t,n){return n?e|t:e&~t}var gr=lr?function(e){return 0|e[lr]}:function(e){return 0|e.g},vr=lr?function(e){return e[lr]}:function(e){return e.g},yr=lr?function(e,t){return e[lr]=t,e}:function(e,t){return void 0!==e.g?e.g=t:Object.defineProperties(e,{g:{value:t,configurable:!0,writable:!0,enumerable:!1}}),e};function br(e){return pr(e,34),e}function xr(e,t){yr(t,-14591&e)}function Cr(e,t){yr(t,-14557&e|34)}function wr(e){return 0==(e=e>>14&1023)?536870912:e}var Er,kr={},Dr={};function Mr(e){return!(!e||"object"!=typeof e||e.Ja!==Dr)}function Tr(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&e.constructor===Object}function Ir(e,t,n){if(null!=e)if("string"==typeof e)e=e?new sn(e,nn):on();else if(e.constructor!==sn)if(Jt(e))e=e.length?new sn(n?e:new Uint8Array(e),nn):on();else{if(!t)throw Error();e=void 0}return e}function Sr(e,t,n){if(!Array.isArray(e)||e.length)return!1;var r=gr(e);return!!(1&r)||!(!t||!(Array.isArray(t)?t.includes(n):t.has(n)))&&(yr(e,1|r),!0)}var Nr=[];function Ar(e){if(2&e)throw Error()}yr(Nr,55),Er=Object.freeze(Nr);var Lr,Or,Rr,Fr=function(){function e(e,t,n){this.l=0,this.g=e,this.h=t,this.m=n}var t=e.prototype;return t.next=function(){if(this.l<this.g.length){var e=this.g[this.l++];return{done:!1,value:this.h?this.h.call(this.m,e):e}}return{done:!0,value:void 0}},t[Symbol.iterator]=function(){return new e(this.g,this.h,this.m)},e}();function Pr(e,t){(t=Lr?t[Lr]:void 0)&&(e[Lr]=ur(t))}function Ur(e,t){e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity=t}function _r(){var e=Error();Ur(e,"incident"),function(e){kt.setTimeout((function(){throw e}),0)}(e)}function jr(e){return Ur(e=Error(e),"warning"),e}function Br(e){return null==e||"number"==typeof e?e:"NaN"===e||"Infinity"===e||"-Infinity"===e?Number(e):void 0}function zr(e){return null==e||"boolean"==typeof e?e:"number"==typeof e?!!e:void 0}Object.freeze(new function(){}),Object.freeze(new function(){});var Gr,Vr,Wr,qr=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Hr(e){var t=typeof e;return"number"===t?Number.isFinite(e):"string"===t&&qr.test(e)}function Yr(e){if(null==e)return e;if("string"==typeof e){if(!e)return;e=+e}return"number"==typeof e&&Number.isFinite(e)?0|e:void 0}function Zr(e){if(null==e)return e;if("string"==typeof e){if(!e)return;e=+e}return"number"==typeof e&&Number.isFinite(e)?e>>>0:void 0}function Qr(e){return"-"!==e[0]&&(20>e.length||20===e.length&&184467>Number(e.substring(0,6)))}function $r(e){return"-"===e[0]?20>e.length||20===e.length&&-922337<Number(e.substring(0,7)):19>e.length||19===e.length&&922337>Number(e.substring(0,6))}function Xr(e){return e=Math.trunc(e),Number.isSafeInteger(e)||(vn(e),e=xn(mn,gn)),e}function Kr(e){var t=Math.trunc(Number(e));return Number.isSafeInteger(t)?String(t):(-1!==(t=e.indexOf("."))&&(e=e.substring(0,t)),$r(e)||(kn(e),e=En()),e)}function Jr(e){return null==e?e:Hr(e)?"number"==typeof e?Xr(e):Kr(e):void 0}function eo(e){if("string"!=typeof e)throw Error();return e}function to(e){if(null!=e&&"string"!=typeof e)throw Error();return e}function no(e){return null==e||"string"==typeof e?e:void 0}function ro(e,t,n,r){if(null!=e&&"object"==typeof e&&e.X===kr)return e;if(!Array.isArray(e))return n?2&r?(e=t[dr])?t=e:(br((e=new t).s),t=t[dr]=e):t=new t:t=void 0,t;var o=n=gr(e);return 0===o&&(o|=32&r),(o|=2&r)!==n&&yr(e,o),new t(e)}function oo(e,t,n){if(t){var r=!!r;if(!Hr(t=e))throw jr("int64");"string"==typeof t?r=Kr(t):r?(r=Math.trunc(t),Number.isSafeInteger(r)?r=String(r):$r(t=String(r))?r=t:(vn(r),r=En())):r=Xr(t)}else r=Jr(e);return"string"==typeof(n=null==(e=r)?n?0:void 0:e)&&(r=+n,Number.isSafeInteger(r))?r:n}function io(e){switch(typeof e){case"boolean":return Vr||(Vr=[0,void 0,!0]);case"number":return 0<e?void 0:0===e?Wr||(Wr=[0,void 0]):[-e,void 0];case"string":return[0,e];case"object":return e}}function ao(e,t){return so(e,t[0],t[1])}function so(e,t,n){if(null==e&&(e=Gr),Gr=void 0,null==e){var r=96;n?(e=[n],r|=512):e=[],t&&(r=-16760833&r|(1023&t)<<14)}else{if(!Array.isArray(e))throw Error("narr");if(2048&(r=gr(e)))throw Error("farr");if(64&r)return e;if(r|=64,n&&(r|=512,n!==e[0]))throw Error("mid");e:{var o=(n=e).length;if(o){var i=o-1;if(Tr(n[i])){if(1024<=(t=i-(+!!(512&(r|=256))-1)))throw Error("pvtlmt");r=-16760833&r|(1023&t)<<14;break e}}if(t){if(1024<(t=Math.max(t,o-(+!!(512&r)-1))))throw Error("spvt");r=-16760833&r|(1023&t)<<14}}}return yr(e,r),e}var uo={},co=function(){try{return Bt(new(function(e){function t(){return e.call(this)||this}return lt(t,e),t}(pt(Map)))),!1}catch(e){return!0}}(),lo=function(){function e(){this.g=new Map}var t=e.prototype;return t.get=function(e){return this.g.get(e)},t.set=function(e,t){return this.g.set(e,t),this.size=this.g.size,this},t.delete=function(e){return e=this.g.delete(e),this.size=this.g.size,e},t.clear=function(){this.g.clear(),this.size=this.g.size},t.has=function(e){return this.g.has(e)},t.entries=function(){return this.g.entries()},t.keys=function(){return this.g.keys()},t.values=function(){return this.g.values()},t.forEach=function(e,t){return this.g.forEach(e,t)},t[Symbol.iterator]=function(){return this.entries()},e}();function fo(e){return e}function po(e){if(2&e.N)throw Error("Cannot mutate an immutable Map")}var ho,mo=function(e){function t(t,n,r,o){var i;void 0===r&&(r=fo),void 0===o&&(o=fo),i=e.call(this)||this;var a=gr(t);yr(t,a|=64),i.N=a,i.U=n,i.S=r,i.Z=i.U?go:o;for(var s=0;s<t.length;s++){var u=t[s],c=r(u[0],!1,!0),l=u[1];n?void 0===l&&(l=null):l=o(u[1],!1,!0,void 0,void 0,a),e.prototype.set.call(i,c,l)}return i}lt(t,e);var n=t.prototype;return n.oa=function(e){if(void 0===e&&(e=vo),0!==this.size)return this.Y(e)},n.Y=function(t){void 0===t&&(t=vo);for(var n,r=[],o=e.prototype.entries.call(this);!(n=o.next()).done;)(n=n.value)[0]=t(n[0]),n[1]=t(n[1]),r.push(n);return r},n.clear=function(){po(this),e.prototype.clear.call(this)},n.delete=function(t){return po(this),e.prototype.delete.call(this,this.S(t,!0,!1))},n.entries=function(){var e=this.na();return new Fr(e,yo,this)},n.keys=function(){return this.Ia()},n.values=function(){var e=this.na();return new Fr(e,mo.prototype.get,this)},n.forEach=function(t,n){var r=this;e.prototype.forEach.call(this,(function(e,o){t.call(n,r.get(o),o,r)}))},n.set=function(t,n){return po(this),null==(t=this.S(t,!0,!1))?this:null==n?(e.prototype.delete.call(this,t),this):e.prototype.set.call(this,t,this.Z(n,!0,!0,this.U,!1,this.N))},n.Oa=function(t){var n=this.S(t[0],!1,!0);t=t[1],t=this.U?void 0===t?null:t:this.Z(t,!1,!0,void 0,!1,this.N),e.prototype.set.call(this,n,t)},n.has=function(t){return e.prototype.has.call(this,this.S(t,!1,!1))},n.get=function(t){t=this.S(t,!1,!1);var n=e.prototype.get.call(this,t);if(void 0!==n){var r=this.U;return r?((r=this.Z(n,!1,!0,r,this.ta,this.N))!==n&&e.prototype.set.call(this,t,r),r):n}},n.na=function(){return Array.from(e.prototype.keys.call(this))},n.Ia=function(){return e.prototype.keys.call(this)},n[Symbol.iterator]=function(){return this.entries()},t}(co?(Object.setPrototypeOf(lo.prototype,Map.prototype),Object.defineProperties(lo.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),lo):function(e){function t(){return e.call(this)||this}return lt(t,e),t}(pt(Map)));function go(e,t,n,r,o,i){return e=ro(e,r,n,i),o&&(e=To(e)),e}function vo(e){return e}function yo(e){return[e,this.get(e)]}function bo(){return ho||(ho=new mo(br([]),void 0,void 0,void 0,uo))}function xo(e,t,n,r,o){if(null!=e){if(Array.isArray(e))e=Sr(e,void 0,0)?void 0:o&&2&gr(e)?e:Co(e,t,n,void 0!==r,o);else if(Tr(e)){var i={};for(var a in e)i[a]=xo(e[a],t,n,r,o);e=i}else e=t(e,r);return e}}function Co(e,t,n,r,o){var i=r||n?gr(e):0;r=r?!!(32&i):void 0;for(var a=ur(e),s=0;s<a.length;s++)a[s]=xo(a[s],t,n,r,o);return n&&(Pr(a,e),n(i,a)),a}function wo(e){return xo(e,Eo,void 0,void 0,!1)}function Eo(e){return e.X===kr?e.toJSON():e instanceof mo?e.oa(wo):function(e){switch(typeof e){case"number":return isFinite(e)?e:String(e);case"boolean":return e?1:0;case"object":if(e)if(Array.isArray(e)){if(Sr(e,void 0,0))return}else{if(Jt(e))return Yt(e);if(e instanceof sn){var t=e.g;return null==t?"":"string"==typeof t?t:e.g=Yt(t)}if(e instanceof mo)return e.oa()}}return e}(e)}function ko(e,t,n){if(void 0===n&&(n=Cr),null!=e){if(qt&&e instanceof Uint8Array)return t?e:new Uint8Array(e);if(Array.isArray(e)){var r=gr(e);return 2&r||(t&&(t=0===r||!!(32&r)&&!(64&r||!(16&r))),e=t?yr(e,-12293&r|34):Co(e,ko,4&r?Cr:n,!0,!0)),e}return e.X===kr?e=2&(r=vr(n=e.s))?e:Do(e,n,r,!0):e instanceof mo&&!(2&e.N)&&(n=br(e.Y(ko)),e=new mo(n,e.U,e.S,e.Z)),e}}function Do(e,t,n,r){return e=e.constructor,Gr=t=Mo(t,n,r),t=new e(t),Gr=void 0,t}function Mo(e,t,n){var r=n||2&t?Cr:xr,o=!!(32&t);return e=function(e,t,n){var r=ur(e),o=r.length,i=256&t?r[o-1]:void 0;for(o+=i?-1:0,t=512&t?1:0;t<o;t++)r[t]=n(r[t]);if(i)for(var a in t=r[t]={},i)t[a]=n(i[a]);return Pr(r,e),r}(e,t,(function(e){return ko(e,o,r)})),pr(e,32|(n?2:0)),e}function To(e){var t=e.s,n=vr(t);return 2&n?Do(e,t,n,!1):e}function Io(e,t,n,r){return!(4&t)||null!=n}function So(e,t){return Ao(e=e.s,vr(e),t)}function No(e,t,n,r){if(!(0>(t=r+(+!!(512&t)-1))||t>=e.length||t>=n))return e[t]}function Ao(e,t,n,r){if(-1===n)return null;var o,i=wr(t);return n>=i?256&t?e[e.length-1][n]:void 0:r&&256&t&&null!=(r=e[e.length-1][n])?(No(e,t,i,n)&&null!=fr&&(4<=(t=(e=null!=(o=Rr)?o:Rr={})[fr]||0)||(e[fr]=t+1,_r())),r):No(e,t,i,n)}function Lo(e,t,n,r){var o=e.s,i=vr(o);return Ar(i),Oo(o,i,t,n,r),e}function Oo(e,t,n,r,o){var i=wr(t);if(n>=i||o){var a=t;if(256&t)o=e[e.length-1];else{if(null==r)return a;o=e[i+(+!!(512&t)-1)]={},a|=256}return o[n]=r,n<i&&(e[n+(+!!(512&t)-1)]=void 0),a!==t&&yr(e,a),a}return e[n+(+!!(512&t)-1)]=r,256&t&&n in(e=e[e.length-1])&&delete e[n],t}function Ro(e,t,n,r,o){var i=2&t,a=Ao(e,t,n,o);Array.isArray(a)||(a=Er);var s=!(2&r);r=!(1&r);var u=!!(32&t),c=gr(a);return 0!==c||!u||i||s?1&c||yr(a,c|=1):yr(a,c|=33),i?(e=!1,2&c||(br(a),e=!!(4&c)),(r||e)&&Object.freeze(a)):(i=!!(2&c)||!!(2048&c),r&&i?(a=ur(a),r=1,u&&!s&&(r|=32),yr(a,r),Oo(e,t,n,a,o)):s&&32&c&&!i&&hr(a,32)),a}function Fo(e,t){var n=vr(e=e.s),r=Ao(e,n,t),o=Br(r);return null!=o&&o!==r&&Oo(e,n,t,o),o}function Po(e){var t=vr(e=e.s),n=Ao(e,t,1),r=Ir(n,!0,!!(34&t));return null!=r&&r!==n&&Oo(e,t,1,r),r}function Uo(e,t,n){var r=e.s,o=vr(r),i=2&o?1:2,a=_o(r,o,t),s=gr(a);if(Io(0,s,void 0)){(4&s||Object.isFrozen(a))&&(a=ur(a),s=ti(s,o),o=Oo(r,o,t,a));for(var u=e=0;e<a.length;e++){var c=n(a[e]);null!=c&&(a[u++]=c)}u<e&&(a.length=u),s=mr(s=jo(s,o),20,!0),s=mr(s,4096,!1),s=mr(s,8192,!1),yr(a,s),2&s&&Object.freeze(a)}return Bo(s)||(n=s,(s=(e=1===i||4===i&&!!(32&s))?mr(s,2,!0):ni(s,o,!1))!==n&&yr(a,s),e&&Object.freeze(a)),2===i&&Bo(s)&&(a=ur(a),s=ni(s=ti(s,o),o,!1),yr(a,s),Oo(r,o,t,a)),a}function _o(e,t,n){return e=Ao(e,t,n),Array.isArray(e)?e:Er}function jo(e,t){return 0===e&&(e=ti(e,t)),mr(e,1,!0)}function Bo(e){return!!(2&e)&&!!(4&e)||!!(2048&e)}function zo(e){e=ur(e);for(var t=0;t<e.length;t++){var n=e[t]=ur(e[t]);Array.isArray(n[1])&&(n[1]=br(n[1]))}return e}function Go(e,t,n){var r=e.s,o=vr(r);if(Ar(o),null==n)Oo(r,o,t);else{var i,a=gr(n),s=a,u=!!(2&a)||Object.isFrozen(n);if((i=!u)&&(i=!1),Io(0,a))for(a=21,u&&(n=ur(n),s=0,a=ni(a=ti(a,o),o,!0)),e=0;e<n.length;e++)n[e]=eo(n[e]);i&&(n=ur(n),s=0,a=ni(a=ti(a,o),o,!0)),a!==s&&yr(n,a),Oo(r,o,t,n)}}function Vo(e,t,n,r){var o=vr(e=e.s);Ar(o),Oo(e,o,t,("0"===r?0===Number(n):n===r)?void 0:n)}function Wo(e,t,n,r){var o=vr(e);Ar(o),e=Ro(e,o,t,2),r=n(r,!!(4&(t=gr(e)))&&!!(4096&t)),e.push(r)}function qo(e){return e}function Ho(e,t){return Yo(e=e.s,vr(e),zs)===t?t:-1}function Yo(e,t,n){for(var r=0,o=0;o<n.length;o++){var i=n[o];null!=Ao(e,t,i)&&(0!==r&&(t=Oo(e,t,r)),r=i)}return r}function Zo(e,t,n,r){var o=vr(e);Ar(o);var i,a=Ao(e,o,n,r);if(null!=a&&a.X===kr)return(t=To(a))!==a&&Oo(e,o,n,t,r),t.s;if(Array.isArray(a)){var s=gr(a);i=ao(i=2&s?Mo(a,s,!1):a,t)}else i=ao(void 0,t);return i!==a&&Oo(e,o,n,i,r),i}function Qo(e,t,n,r){var o=vr(e=e.s),i=Ao(e,o,n,r);return(t=ro(i,t,!1,o))!==i&&null!=t&&Oo(e,o,n,t,r),t}function $o(e,t,n,r){if(void 0===r&&(r=!1),null==(t=Qo(e,t,n,r)))return t;var o=vr(e=e.s);if(!(2&o)){var i=To(t);i!==t&&Oo(e,o,n,t=i,r)}return t}function Xo(e,t,n,r,o,i){var a=2,s=!!(2&t);a=s?1:a,o=!!o,i&&(i=!s),s=_o(e,t,r);var u=gr(s),c=!!(4&u);if(!c){var l=s,d=t,f=!!(2&(u=jo(u,t)));f&&(d=mr(d,2,!0));for(var p=!f,h=!0,m=0,g=0;m<l.length;m++){var v=ro(l[m],n,!1,d);if(v instanceof n){if(!f){var y=!!(2&gr(v.s));p&&(p=!y),h&&(h=y)}l[g++]=v}}g<m&&(l.length=g),u=mr(u,4,!0),u=mr(u,16,h),u=mr(u,8,p),yr(l,u),f&&Object.freeze(l)}if(i&&!(8&u||!s.length&&(1===a||4===a&&32&u))){for(Bo(u)&&(s=ur(s),u=ti(u,t),t=Oo(e,t,r,s)),n=s,i=u,l=0;l<n.length;l++)(u=n[l])!==(d=To(u))&&(n[l]=d);i=mr(i,8,!0),i=mr(i,16,!n.length),yr(n,i),u=i}return Bo(u)||(n=u,(u=(i=1===a||4===a&&!!(32&u))?mr(u,!s.length||16&u&&(!c||32&u)?2:2048,!0):ni(u,t,o))!==n&&yr(s,u),i&&Object.freeze(s)),2===a&&Bo(u)&&(s=ur(s),u=ni(u=ti(u,t),t,o),yr(s,u),Oo(e,t,r,s)),s}function Ko(e,t,n){var r=vr(e=e.s);return Xo(e,r,t,n,!1,!(2&r))}function Jo(e,t,n,r,o){return null==r&&(r=void 0),Lo(e,n,r,o)}function ei(e,t,n,r){null==r&&(r=void 0);var o=vr(e=e.s);Ar(o),(n=Yo(e,o,n))&&n!==t&&null!=r&&(o=Oo(e,o,n)),Oo(e,o,t,r)}function ti(e,t){return e=mr(e,2,!!(2&t)),e=mr(e,32,!0),mr(e,2048,!1)}function ni(e,t,n){return 32&t&&n||(e=mr(e,32,!1)),e}function ri(e,t,n,r){var o=vr(e=e.s);Ar(o),t=Xo(e,o,n,t,!0),n=null!=r?r:new n,t.push(n),2&gr(n.s)?hr(t,8):hr(t,16)}function oi(e,t){return Yr(So(e,t))}function ii(e,t){return null!=e?e:t}function ai(e,t){return ii(Fo(e,t),0)}function si(e,t){return ii(no(So(e,t)),"")}function ui(e,t,n){if(null!=n&&"boolean"!=typeof n)throw e=typeof n,Error("Expected boolean but got "+("object"!=e?e:n?Array.isArray(n)?"array":e:"null")+": "+n);Lo(e,t,n)}function ci(e,t,n){if(null!=n){if("number"!=typeof n)throw jr("int32");if(!Number.isFinite(n))throw jr("int32");n|=0}Lo(e,t,n)}function li(e,t,n){if(null!=n&&"number"!=typeof n)throw Error("Value of float/double field must be a number, found "+typeof n+": "+n);Lo(e,t,n)}function di(e,t,n){t.g?t.m(e,t.g,t.h,n,!0):t.m(e,t.h,n,!0)}mo.prototype.toJSON=void 0,mo.prototype.Ja=Dr;var fi=function(){function e(e,t){this.s=so(e,t)}var t=e.prototype;return t.toJSON=function(){return pi(this,Co(this.s,Eo,void 0,void 0,!1),!0)},t.l=function(){var e=Wu;return e.g?e.l(this,e.g,e.h,!0):e.l(this,e.h,e.defaultValue,!0)},t.clone=function(){var e=this.s;return Do(this,e,vr(e),!1)},t.P=function(){return!!(2&gr(this.s))},e}();function pi(e,t,n){var r,o,i=Rt?void 0:e.constructor.B,a=vr(n?e.s:t);if(!(e=t.length))return t;if(Tr(n=t[e-1])){e:{var s=n,u={},c=!1;for(var l in s){var d=s[l];if(Array.isArray(d)){var f=d;(Sr(d,i,+l)||Mr(d)&&0===d.size)&&(d=null),d!=f&&(c=!0)}null!=d?u[l]=d:c=!0}if(c){for(var p in u){s=u;break e}s=null}}s!=n&&(r=!0),e--}for(l=+!!(512&a)-1;0<e&&(n=t[p=e-1],p-=l,null==n||Sr(n,i,p)||Mr(n)&&0===n.size);e--)o=!0;return r||o?(t=Array.prototype.slice.call(t,0,e),s&&t.push(s),t):t}function hi(e){return Array.isArray(e)?e[0]instanceof sr?e:[ma,e]:[e,void 0]}function mi(e,t){if(Array.isArray(t)){var n=gr(t);if(4&n)return t;for(var r=0,o=0;r<t.length;r++){var i=e(t[r]);null!=i&&(t[o++]=i)}return o<r&&(t.length=o),yr(t,-12289&n|5),2&n&&Object.freeze(t),t}}fi.prototype.X=kr,fi.prototype.toString=function(){return pi(this,this.s,!1).toString()};var gi=Symbol();function vi(e){var t=e[gi];if(!t){var n=Di(e),r=Ui(e),o=r.l;t=o?function(e,t){return o(e,t,r)}:function(e,t){for(;_n(t)&&4!=t.h;){var o=t.m,i=r[o];if(!i){var a=r.ea;a&&(a=a[o])&&(i=r[o]=yi(a))}i&&i(t,e,o)||(o=(i=t).l,jn(i),i.ia?i=void 0:(a=i.g.g-o,i.g.g=o,i=Pn(i.g,a)),o=e,i&&(Lr||(Lr=Symbol()),(a=o[Lr])?a.push(i):o[Lr]=[i]))}n===bi||n===xi||n.j||(e[Or||(Or=Symbol())]=n)},e[gi]=t}return t}function yi(e){var t=(e=hi(e))[0].g;if(e=e[1]){var n=vi(e),r=Ui(e).T;return function(e,o,i){return t(e,o,i,r,n)}}return t}var bi,xi,Ci=function(){},wi=Symbol();function Ei(e,t,n){var r,o=n[1];if(o){var i=o[wi];r=i?i.T:io(o[0]),e[t]=null!=i?i:o}r&&r===Vr?(e.g||(e.g=new Set)).add(t):n[0]&&(e.h||(e.h=new Set)).add(t)}function ki(e,t){return[e.l,!t||0<t[0]?void 0:t]}function Di(e){var t=e[wi];if(t)return t;if(!(t=Ti(e,e[wi]=new Ci,ki,ki,Ei)).ea&&!t.h&&!t.g){var n=!0;for(var r in t)isNaN(r)||(n=!1);n?(io(e[0])===Vr?xi?t=xi:((t=new Ci).T=io(!0),t=xi=t):t=bi||(bi=new Ci),t=e[wi]=t):t.j=!0}return t}function Mi(e,t,n){e[t]=n}function Ti(e,t,n,r,o){void 0===o&&(o=Mi),t.T=io(e[0]);var i=0,a=e[++i];a&&a.constructor===Object&&(t.ea=a,"function"==typeof(a=e[++i])&&(t.l=a,t.m=e[++i],a=e[++i]));for(var s={};Array.isArray(a)&&"number"==typeof a[0]&&0<a[0];){for(var u=0;u<a.length;u++)s[a[u]]=a;a=e[++i]}for(u=1;void 0!==a;){var c=void 0;"number"==typeof a&&(u+=a,a=e[++i]);var l=void 0;if(a instanceof sr?c=a:(c=ga,i--),c.pa){a=e[++i],l=e;var d=i;"function"==typeof a&&(a=a(),l[d]=a),l=a}for(d=u+1,"number"==typeof(a=e[++i])&&0>a&&(d-=a,a=e[++i]);u<d;u++){var f=s[u];o(t,u,l?r(c,l,f):n(c,f))}}return t}var Ii=Symbol();function Si(e){var t=e[Ii];if(!t){var n=Oi(e);t=function(e,t){return Bi(e,t,n)},e[Ii]=t}return t}var Ni=Symbol();function Ai(e){return e.h}function Li(e,t){var n,r,o=e.h;return function(e,i,a){return o(e,i,a,r||(r=Oi(t).T),n||(n=Si(t)))}}function Oi(e){var t=e[Ni];return t||(t=Ti(e,e[Ni]={},Ai,Li),_i(e),t)}var Ri=Symbol();function Fi(e,t){var n=e.g;return t?function(e,r,o){return n(e,r,o,t)}:n}function Pi(e,t,n){var r,o,i=e.g;return function(e,a,s){return i(e,a,s,o||(o=Ui(t).T),r||(r=vi(t)),n)}}function Ui(e){var t=e[Ri];return t||(Di(e),t=Ti(e,e[Ri]={},Fi,Pi),_i(e),t)}function _i(e){Ri in e&&wi in e&&Ni in e&&(e.length=0)}function ji(e,t){var n=e[t];if(n)return n;if((n=e.ea)&&(n=n[t])){var r=(n=hi(n))[0].h;if(n=n[1]){var o=Si(n),i=Oi(n).T;n=(n=e.m)?n(i,o):function(e,t,n){return r(e,t,n,i,o)}}else n=r;return e[t]=n}}function Bi(e,t,n){for(var r=vr(e),o=+!!(512&r)-1,i=e.length,a=512&r?1:0,s=i+(256&r?-1:0);a<s;a++){var u=e[a];if(null!=u){var c=a-o,l=ji(n,c);l&&l(t,u,c)}}if(256&r)for(var d in r=e[i-1])o=+d,Number.isNaN(o)||null!=(i=r[d])&&(s=ji(n,o))&&s(t,i,o);if(e=Lr?e[Lr]:void 0)for(tr(t,t.g.end()),n=0;n<e.length;n++)tr(t,an(e[n])||en())}function zi(e,t){return new sr(e,t,!1,!1)}function Gi(e,t){return new sr(e,t,!0,!1)}function Vi(e,t){return new sr(e,t,!1,!0)}function Wi(e,t,n){Oo(e,vr(e),t,n)}var qi=Vi((function(e,t,n,r,o){return 2===e.h&&(e=Bn(e,ao([void 0,void 0],r),o),Ar(r=vr(t)),(o=Ao(t,r,n))instanceof mo?2&o.N?((o=o.Y()).push(e),Oo(t,r,n,o)):o.Oa(e):Array.isArray(o)?(2&gr(o)&&Oo(t,r,n,o=zo(o)),o.push(e)):Oo(t,r,n,[e]),!0)}),(function(e,t,n,r,o){if(t instanceof mo)t.forEach((function(t,i){ar(e,n,ao([i,t],r),o)}));else if(Array.isArray(t))for(var i=0;i<t.length;i++){var a=t[i];Array.isArray(a)&&ar(e,n,ao(a,r),o)}}));function Hi(e,t,n){e:if(null!=t){if(Hr(t)){if("string"==typeof t){t=Kr(t);break e}if("number"==typeof t){t=Xr(t);break e}}t=void 0}null!=t&&("string"==typeof t&&Zn(t),null!=t&&(nr(e,n,0),"number"==typeof t?(e=e.g,vn(t),Xn(e,mn,gn)):(n=Zn(t),Xn(e.g,n.h,n.g))))}function Yi(e,t,n){null!=(t=Yr(t))&&null!=t&&(nr(e,n,0),Jn(e.g,t))}function Zi(e,t,n){null!=(t=zr(t))&&(nr(e,n,0),e.g.g.push(t?1:0))}function Qi(e,t,n){null!=(t=no(t))&&ir(e,n,At(t))}function $i(e,t,n,r,o){ar(e,n,t instanceof fi?t.s:Array.isArray(t)?ao(t,r):void 0,o)}function Xi(e,t,n){null!=(t=null==t||"string"==typeof t||Jt(t)||t instanceof sn?t:void 0)&&ir(e,n,dn(t).buffer)}function Ki(e,t,n){return(5===e.h||2===e.h)&&(t=Ro(t,vr(t),n,2,!1),2==e.h?Vn(e,An,t):t.push(An(e.g)),!0)}var Ji,ea=zi((function(e,t,n){if(1!==e.h)return!1;var r=e.g;e=Nn(r);var o=Nn(r);r=2*(o>>31)+1;var i=o>>>20&2047;return e=4294967296*(1048575&o)+e,Wi(t,n,2047==i?e?NaN:1/0*r:0==i?r*Math.pow(2,-1074)*e:r*Math.pow(2,i-1075)*(e+4503599627370496)),!0}),(function(e,t,n){null!=(t=Br(t))&&(nr(e,n,1),e=e.g,(n=pn||(pn=new DataView(new ArrayBuffer(8)))).setFloat64(0,+t,!0),mn=n.getUint32(0,!0),gn=n.getUint32(4,!0),er(e,mn),er(e,gn))})),ta=zi((function(e,t,n){return 5===e.h&&(Wi(t,n,An(e.g)),!0)}),(function(e,t,n){null!=(t=Br(t))&&(nr(e,n,5),e=e.g,yn(t),er(e,mn))})),na=Gi(Ki,(function(e,t,n){if(null!=(t=mi(Br,t)))for(var r=0;r<t.length;r++){var o=e,i=t[r];null!=i&&(nr(o,n,5),o=o.g,yn(i),er(o,mn))}})),ra=Gi(Ki,(function(e,t,n){if(null!=(t=mi(Br,t))&&t.length){nr(e,n,2),Kn(e.g,4*t.length);for(var r=0;r<t.length;r++)n=e.g,yn(t[r]),er(n,mn)}})),oa=zi((function(e,t,n){return 0===e.h&&(Wi(t,n,Mn(e.g,xn)),!0)}),Hi),ia=zi((function(e,t,n){return 0===e.h&&(Wi(t,n,0===(e=Mn(e.g,xn))?void 0:e),!0)}),Hi),aa=zi((function(e,t,n){return 0===e.h&&(Wi(t,n,Mn(e.g,bn)),!0)}),(function(e,t,n){e:if(null!=t){if(Hr(t)){if("string"==typeof t){var r=Math.trunc(Number(t));Number.isSafeInteger(r)&&0<=r?t=String(r):(-1!==(r=t.indexOf("."))&&(t=t.substring(0,r)),Qr(t)||(kn(t),t=Cn(mn,gn)));break e}if("number"==typeof t){t=0<=(t=Math.trunc(t))&&Number.isSafeInteger(t)?t:function(e){if(0>e){vn(e);var t=Cn(mn,gn);return e=Number(t),Number.isSafeInteger(e)?e:t}return Qr(String(e))?e:(vn(e),bn(mn,gn))}(t);break e}}t=void 0}null!=t&&("string"==typeof t&&qn(t),null!=t&&(nr(e,n,0),"number"==typeof t?(e=e.g,vn(t),Xn(e,mn,gn)):(n=qn(t),Xn(e.g,n.h,n.g))))})),sa=zi((function(e,t,n){return 0===e.h&&(Wi(t,n,In(e.g)),!0)}),Yi),ua=Gi((function(e,t,n){return(0===e.h||2===e.h)&&(t=Ro(t,vr(t),n,2,!1),2==e.h?Vn(e,In,t):t.push(In(e.g)),!0)}),(function(e,t,n){if(null!=(t=mi(Yr,t))&&t.length){n=rr(e,n);for(var r=0;r<t.length;r++)Jn(e.g,t[r]);or(e,n)}})),ca=zi((function(e,t,n){return 0===e.h&&(Wi(t,n,0===(e=In(e.g))?void 0:e),!0)}),Yi),la=zi((function(e,t,n){return 0===e.h&&(Wi(t,n,Tn(e.g)),!0)}),Zi),da=zi((function(e,t,n){return 0===e.h&&(Wi(t,n,!1===(e=Tn(e.g))?void 0:e),!0)}),Zi),fa=Gi((function(e,t,n){return 2===e.h&&(Wo(t,n,qo,e=zn(e)),!0)}),(function(e,t,n){if(null!=(t=mi(no,t)))for(var r=0;r<t.length;r++){var o=t[r];null!=o&&ir(e,n,At(o))}})),pa=zi((function(e,t,n){return 2===e.h&&(Wi(t,n,""===(e=zn(e))?void 0:e),!0)}),Qi),ha=zi((function(e,t,n){return 2===e.h&&(Wi(t,n,zn(e)),!0)}),Qi),ma=Vi((function(e,t,n,r,o){return 2===e.h&&(Bn(e,Zo(t,r,n,!0),o),!0)}),$i),ga=Vi((function(e,t,n,r,o){return 2===e.h&&(Bn(e,Zo(t,r,n),o),!0)}),$i);Ji=new sr((function(e,t,n,r,o){if(2!==e.h)return!1;r=ao(void 0,r);var i=vr(t);Ar(i);var a=Ro(t,i,n,3);return i=vr(t),4&gr(a)&&(a=ur(a),yr(a,-2079&gr(a)|1),Oo(t,i,n,a)),a.push(r),Bn(e,r,o),!0}),(function(e,t,n,r,o){if(Array.isArray(t))for(var i=0;i<t.length;i++)$i(e,t[i],n,r,o)}),!0,!0);var va=Vi((function(e,t,n,r,o,i){if(2!==e.h)return!1;var a=vr(t);return Ar(a),(i=Yo(t,a,i))&&n!==i&&Oo(t,a,i),Bn(e,t=Zo(t,r,n),o),!0}),$i),ya=zi((function(e,t,n){return 2===e.h&&(Wi(t,n,Gn(e)),!0)}),Xi),ba=Gi((function(e,t,n){return(0===e.h||2===e.h)&&(t=Ro(t,vr(t),n,2,!1),2==e.h?Vn(e,Sn,t):t.push(Sn(e.g)),!0)}),(function(e,t,n){if(null!=(t=mi(Zr,t)))for(var r=0;r<t.length;r++){var o=e,i=t[r];null!=i&&(nr(o,n,0),Kn(o.g,i))}})),xa=zi((function(e,t,n){return 0===e.h&&(Wi(t,n,In(e.g)),!0)}),(function(e,t,n){null!=(t=Yr(t))&&(t=parseInt(t,10),nr(e,n,0),Jn(e.g,t))})),Ca=Gi((function(e,t,n){return(0===e.h||2===e.h)&&(t=Ro(t,vr(t),n,2,!1),2==e.h?Vn(e,Ln,t):t.push(In(e.g)),!0)}),(function(e,t,n){if(null!=(t=mi(Yr,t))&&t.length){n=rr(e,n);for(var r=0;r<t.length;r++)Jn(e.g,t[r]);or(e,n)}})),wa=function(e,t){this.h=e,this.g=t,this.l=$o,this.m=Jo,this.defaultValue=void 0};function Ea(e,t){return new wa(e,t)}function ka(e,t){return function(n,r){if(Wn.length){var o=Wn.pop();o.o(r),On(o.g,n,r),n=o}else n=new(function(){function e(e,t){if(Un.length){var n=Un.pop();On(n,e,t),e=n}else e=new(function(){function e(e,t){this.h=null,this.m=!1,this.g=this.l=this.j=0,On(this,e,t)}return e.prototype.clear=function(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.ca=!1},e}())(e,t);this.g=e,this.l=this.g.g,this.h=this.m=-1,this.o(t)}return e.prototype.o=function(e){var t=(void 0===e?{}:e).ia;this.ia=void 0!==t&&t},e}())(n,r);try{var i=new e,a=i.s;vi(t)(a,n);var s=i}finally{n.g.clear(),n.m=-1,n.h=-1,100>Wn.length&&Wn.push(n)}return s}}function Da(e){return function(){var t=new function(){this.l=[],this.h=0,this.g=new(function(){function e(){this.g=[]}var t=e.prototype;return t.length=function(){return this.g.length},t.end=function(){var e=this.g;return this.g=[],e},e}())};Bi(this.s,t,Oi(e)),tr(t,t.g.end());for(var n=new Uint8Array(t.h),r=t.l,o=r.length,i=0,a=0;a<o;a++){var s=r[a];n.set(s,i),i+=s.length}return t.l=[n],n}}var Ma=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Ta=[0,pa,zi((function(e,t,n){return 2===e.h&&(Wi(t,n,(e=Gn(e))===on()?void 0:e),!0)}),(function(e,t,n){if(null!=t){if(t instanceof fi){var r=t.Qa;return void(r&&(t=r(t),null!=t&&ir(e,n,dn(t).buffer)))}if(Array.isArray(t))return}Xi(e,t,n)}))],Ia=[0,ha],Sa=[0,sa,xa,la,-1,ua,xa,-1],Na=[0,la,-1],Aa=function(e){function t(){return e.call(this)||this}return lt(t,e),t}(fi);Aa.B=[6];var La=[0,la,ha,la,xa,-1,Ca,ha,-1,Na,xa],Oa=[0,ha,-2],Ra=function(e){function t(){return e.call(this)||this}return lt(t,e),t}(fi),Fa=[0],Pa=[0,sa,la,-4],Ua=function(e){function t(t){return e.call(this,t,2)||this}return lt(t,e),t}(fi),_a={},ja=[-2,_a,la];_a[336783863]=[0,ha,la,-1,sa,[0,[1,2,3,4,5,6],va,Fa,va,La,va,Oa,va,Pa,va,Sa,va,[0,ha]],Ia,la,[0,[1,3],[2,4],va,[0,ua],-1,va,[0,fa],-1,Ji,[0,ha,-1]],ha];var Ba=[0,pa,da],za=[0,ia,-1,da,-3,ia,ua,pa,ca,ia,-1,da,ca,da,-2,pa],Ga=[-1,{}],Va=[0,ha,1,Ga],Wa=[0,ha,fa,Ga];function qa(e,t){Vo(e,2,to(t),"")}function Ha(e,t){Wo(e.s,3,eo,t)}function Ya(e,t){Wo(e.s,4,eo,t)}var Za=function(e){function t(t){return e.call(this,t,500)||this}return lt(t,e),t.prototype.o=function(e){return Jo(this,0,7,e)},t}(fi);Za.B=[3,4,5,6,8,13,17,1005];var Qa=[-500,pa,-1,fa,-3,ja,Ji,Ta,ca,-1,Va,Wa,Ji,Ba,pa,za,ca,fa,987,fa],$a=[0,pa,-1,Ga],Xa=[-500,ha,-1,[-1,{}],998,ha],Ka=[-500,ha,fa,-1,[-2,{},la],997,fa,-1],Ja=[-500,ha,fa,Ga,998,fa];function es(e,t){ri(e,1,Za,t)}function ts(e,t){Wo(e.s,10,eo,t)}function ns(e,t){Wo(e.s,15,eo,t)}var rs=function(e){function t(t){return e.call(this,t,500)||this}return lt(t,e),t.prototype.o=function(e){return Jo(this,0,1001,e)},t}(fi);rs.B=[1,6,7,9,10,15,16,17,14,1002];var os=[-500,Ji,Qa,4,Ji,Xa,Ji,Ka,ca,Ji,Ja,fa,ca,Va,Wa,Ji,$a,fa,-2,za,pa,-1,da,979,Ga,Ji,Ta],is=ka(rs,os);rs.prototype.g=Da(os);var as=[0,Ji,[0,sa,-2]],ss=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),us=[0,sa,ta,ha,-1],cs=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t.prototype.g=function(){return Ko(this,ss,1)},t}(fi);cs.B=[1];var ls=[0,Ji,us],ds=ka(cs,ls),fs=[0,sa,ta],ps=[0,sa,-1,as],hs=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),ms=[0,sa,-3],gs=[0,ta,-3],vs=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),ys=[0,ta,-1,ha,ta],bs=function(e){function t(t){return e.call(this,t)||this}lt(t,e);var n=t.prototype;return n.h=function(){return $o(this,hs,2)},n.g=function(){return Ko(this,vs,5)},t}(fi);bs.B=[5];var xs=[0,xa,ms,gs,ps,Ji,ys],Cs=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi);Cs.B=[1,2,3,8,9];var ws=ka(Cs,[0,fa,ua,ra,xs,ha,-1,oa,Ji,fs,fa,oa]),Es=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),ks=[0,ta,-4],Ds=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi);Ds.B=[1];var Ms=ka(Ds,[0,Ji,ks]),Ts=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Is=[0,ta,-4],Ss=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi);Ss.B=[1];var Ns=ka(Ss,[0,Ji,Is]),As=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi);As.B=[3];var Ls=[0,sa,-1,ra,xa],Os=function(e){function t(){return e.call(this)||this}return lt(t,e),t}(fi);Os.prototype.g=Da([0,ta,-4,oa]);var Rs=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Fs=[0,1,sa,ha,ls],Ps=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi);Ps.B=[1];var Us=ka(Ps,[0,Ji,Fs,oa]),_s=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi);_s.B=[1];var js=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t.prototype.qa=function(){var e=Po(this);return null==e?on():e},t}(fi),Bs=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),zs=[1,2],Gs=[0,zs,va,[0,ra],va,[0,ya],sa,ha],Vs=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi);Vs.B=[1];var Ws=ka(Vs,[0,Ji,Gs,oa]),qs=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi);qs.B=[4,5];var Hs=[0,ha,sa,ta,fa,-1],Ys=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Zs=[0,la,-1],Qs=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),$s=[1,2,3,4,5],Xs=function(e){function t(t){return e.call(this,t)||this}lt(t,e);var n=t.prototype;return n.g=function(){return null!=Po(this)},n.h=function(){return null!=no(So(this,2))},t}(fi),Ks=[0,ya,ha,[0,sa,oa,-1],[0,aa,oa]],Js=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t.prototype.g=function(){var e;return null!=(e=zr(So(this,2)))&&e},t}(fi),eu=[0,Ks,la,[0,$s,va,Pa,va,La,va,Sa,va,Fa,va,Oa],xa],tu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),nu=[0,eu,ta,-1,sa],ru=Ea(502141897,tu);_a[502141897]=nu;var ou=[0,Ks];_a[512499200]=ou;var iu=[0,ou];_a[515723506]=iu;var au=ka(function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),[0,[0,xa,-1,na,ba],Ls]),su=[0,eu];_a[508981768]=su;var uu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),cu=[0,eu,ta,su,la],lu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),du=[0,eu,nu,cu,ta,iu];_a[508968149]=cu;var fu=Ea(508968150,lu);_a[508968150]=du;var pu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),hu=Ea(513916220,pu);_a[513916220]=[0,eu,du,sa];var mu=function(e){function t(t){return e.call(this,t)||this}lt(t,e);var n=t.prototype;return n.h=function(){return $o(this,qs,2)},n.g=function(){Lo(this,2)},t}(fi),gu=[0,eu,Hs];_a[478825465]=gu;var vu=[0,eu];_a[478825422]=vu;var yu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),bu=[0,eu,vu,gu,-1],xu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Cu=[0,eu,ta,sa],wu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Eu=[0,eu,ta],ku=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Du=[0,eu,Cu,Eu,ta],Mu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Tu=[0,eu,Du,bu];_a[463370452]=bu,_a[464864288]=Cu,_a[474472470]=Eu;var Iu=Ea(462713202,ku);_a[462713202]=Du;var Su=Ea(479097054,Mu);_a[479097054]=Tu;var Nu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Au=[0,eu],Lu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Ou=[0,eu,ta,-1,sa];_a[514774813]=Ou;var Ru=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Fu=[0,eu,ta,la];_a[518928384]=Fu;var Pu=function(e){function t(){return e.call(this)||this}return lt(t,e),t}(fi);Pu.prototype.g=Da([0,eu,Eu,Au,nu,cu,Ou,Fu]);var Uu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),_u=Ea(456383383,Uu);_a[456383383]=[0,eu,Hs];var ju=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Bu=Ea(476348187,ju);_a[476348187]=[0,eu,Zs];var zu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Gu=[0,xa,-1],Vu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi);Vu.B=[3];var Wu=Ea(458105876,function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t.prototype.g=function(){var e=this.s,t=vr(e),n=2&t;return e=function(e,t,n){var r=Vu,o=2&t,i=!1;if(null==n){if(o)return bo();n=[]}else if(n.constructor===mo){if(!(2&n.N)||o)return n;n=n.Y()}else Array.isArray(n)?i=!!(2&gr(n)):n=[];if(o){if(!n.length)return bo();i||(i=!0,br(n))}else i&&(i=!1,n=zo(n));return i||(64&gr(n)?hr(n,32):32&t&&pr(n,32)),Oo(e,t,2,r=new mo(n,r,oo,void 0),!1),r}(e,t,Ao(e,t,2)),null==e||!n&&Vu&&(e.ta=!0),e},t}(fi));_a[458105876]=[0,Gu,qi,[!0,oa,[0,ha,-1,fa]]];var qu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Hu=Ea(458105758,qu);_a[458105758]=[0,eu,ha,Gu];var Yu=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi);Yu.B=[5,6];var Zu=Ea(443442058,Yu);_a[443442058]=[0,eu,ha,sa,ta,fa,-1];var Qu,$u=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Xu=Ea(516587230,$u);function Ku(e,t){return t=t?t.clone():new qs,void 0!==e.displayNamesLocale?Lo(t,1,to(e.displayNamesLocale)):void 0===e.displayNamesLocale&&Lo(t,1),void 0!==e.maxResults?ci(t,2,e.maxResults):"maxResults"in e&&Lo(t,2),void 0!==e.scoreThreshold?li(t,3,e.scoreThreshold):"scoreThreshold"in e&&Lo(t,3),void 0!==e.categoryAllowlist?Go(t,4,e.categoryAllowlist):"categoryAllowlist"in e&&Lo(t,4),void 0!==e.categoryDenylist?Go(t,5,e.categoryDenylist):"categoryDenylist"in e&&Lo(t,5),t}function Ju(e,t,n){return void 0===t&&(t=-1),void 0===n&&(n=""),{categories:e.map((function(e){var t,n,r,o;return{index:null!=(t=ii(oi(e,1),0))?t:-1,score:null!=(n=ai(e,2))?n:0,categoryName:null!=(r=si(e,3))?r:"",displayName:null!=(o=si(e,4))?o:""}})),headIndex:t,headName:n}}function ec(e){for(var t,n,r,o,i,a,s=Uo(e,3,Br),u=Uo(e,2,Yr),c=Uo(e,1,no),l=Uo(e,9,no),d={categories:[],keypoints:[]},f=0;f<s.length;f++){var p,h,m;d.categories.push({score:s[f],index:null!=(p=u[f])?p:-1,categoryName:null!=(h=c[f])?h:"",displayName:null!=(m=l[f])?m:""})}if((s=null==(t=$o(e,bs,4))?void 0:t.h())&&(d.boundingBox={originX:null!=(n=oi(s,1))?n:0,originY:null!=(r=oi(s,2))?r:0,width:null!=(o=oi(s,3))?o:0,height:null!=(i=oi(s,4))?i:0,angle:0}),null!=(a=$o(e,bs,4))&&a.g().length)for(var g,v=xt($o(e,bs,4).g());!(g=v()).done;){var y,b,x,C,w=g.value;d.keypoints.push({x:null!=(y=Fo(w,1))?y:0,y:null!=(b=Fo(w,2))?b:0,score:null!=(x=Fo(w,4))?x:0,label:null!=(C=no(So(w,3)))?C:""})}return d}function tc(e){for(var t,n=[],r=xt(Ko(e,Ts,1));!(t=r()).done;){var o,i,a,s,u=t.value;n.push({x:null!=(o=ai(u,1))?o:0,y:null!=(i=ai(u,2))?i:0,z:null!=(a=ai(u,3))?a:0,visibility:null!=(s=ai(u,4))?s:0})}return n}function nc(e){for(var t,n=[],r=xt(Ko(e,Es,1));!(t=r()).done;){var o,i,a,s,u=t.value;n.push({x:null!=(o=ai(u,1))?o:0,y:null!=(i=ai(u,2))?i:0,z:null!=(a=ai(u,3))?a:0,visibility:null!=(s=ai(u,4))?s:0})}return n}function rc(e){return Array.from(e,(function(e){return 127<e?e-256:e}))}function oc(e,t){if(e.length!==t.length)throw Error("Cannot compute cosine similarity between embeddings of different sizes ("+e.length+" vs. "+t.length+").");for(var n=0,r=0,o=0,i=0;i<e.length;i++)n+=e[i]*t[i],r+=e[i]*e[i],o+=t[i]*t[i];if(0>=r||0>=o)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return n/Math.sqrt(r*o)}_a[516587230]=[0,eu,Ou,Fu,ta];var ic=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);function ac(){return sc.apply(this,arguments)}function sc(){return(sc=ut(bt.mark((function e(){return bt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==Qu){e.next=10;break}return e.prev=1,e.next=4,WebAssembly.instantiate(ic);case 4:Qu=!0,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),Qu=!1;case 10:return e.abrupt("return",Qu);case 11:case"end":return e.stop()}}),e,null,[[1,7]])})))).apply(this,arguments)}function uc(e,t){return cc.apply(this,arguments)}function cc(){return cc=ut(bt.mark((function e(t,n){var r;return bt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===n&&(n=""),e.next=3,ac();case 3:if(!e.sent){e.next=7;break}e.t0="wasm_internal",e.next=8;break;case 7:e.t0="wasm_nosimd_internal";case 8:return e.abrupt("return",{wasmLoaderPath:n+"/"+t+"_"+(r=e.t0)+".js",wasmBinaryPath:n+"/"+t+"_"+r+".wasm"});case 10:case"end":return e.stop()}}),e)}))),cc.apply(this,arguments)}var lc=function(){};function dc(){var e=navigator;return!("undefined"==typeof OffscreenCanvas||function(e){return void 0===e&&(e=navigator),(e=e.userAgent).includes("Safari")&&!e.includes("Chrome")}(e)&&!((e=e.userAgent.match(/Version\/([\d]+).*Safari/))&&1<=e.length&&17<=Number(e[1])))}function fc(e){return pc.apply(this,arguments)}function pc(){return pc=ut(bt.mark((function e(t){var n;return bt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"==typeof importScripts){e.next=3;break}return n=document.createElement("script"),e.abrupt("return",(n.src=t.toString(),n.crossOrigin="anonymous",new Promise((function(e,t){n.addEventListener("load",(function(){e()}),!1),n.addEventListener("error",(function(e){t(e)}),!1),document.body.appendChild(n)}))));case 3:importScripts(t.toString());case 4:case"end":return e.stop()}}),e)}))),pc.apply(this,arguments)}function hc(e){return void 0!==e.videoWidth?[e.videoWidth,e.videoHeight]:void 0!==e.naturalWidth?[e.naturalWidth,e.naturalHeight]:void 0!==e.displayWidth?[e.displayWidth,e.displayHeight]:[e.width,e.height]}function mc(e,t,n){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),n(t=e.i.stringToNewUTF8(t)),e.i._free(t)}function gc(e,t,n){if(!e.i.canvas)throw Error("No OpenGL canvas configured.");if(n?e.i._bindTextureToStream(n):e.i._bindTextureToCanvas(),!(n=e.i.canvas.getContext("webgl2")||e.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");e.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),e.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);var r=hc(t),o=r[0],i=r[1];return!e.l||o===e.i.canvas.width&&i===e.i.canvas.height||(e.i.canvas.width=o,e.i.canvas.height=i),[o,i]}function vc(e,t,n){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");for(var r=new Uint32Array(t.length),o=0;o<t.length;o++)r[o]=e.i.stringToNewUTF8(t[o]);t=e.i._malloc(4*r.length),e.i.HEAPU32.set(r,t>>2),n(t);for(var i,a=xt(r);!(i=a()).done;){e.i._free(i.value)}e.i._free(t)}function yc(e,t,n){e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=n}function bc(e,t,n){var r=[];e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=function(e,t,o){t?(n(r,o),r=[]):r.push(e)}}function xc(e,t,n,r){return Cc.apply(this,arguments)}function Cc(){return Cc=ut(bt.mark((function e(t,n,r,o){return bt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,function(){var e=ut(bt.mark((function e(t,n,r,o,i){return bt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=n,!e.t0){e.next=4;break}return e.next=4,fc(n);case 4:if(self.ModuleFactory){e.next=6;break}throw Error("ModuleFactory not set.");case 6:if(e.t1=r,!e.t1){e.next=11;break}return e.next=10,fc(r);case 10:e.t1=!self.ModuleFactory;case 11:if(!e.t1){e.next=13;break}throw Error("ModuleFactory not set.");case 13:return self.Module&&i&&((n=self.Module).locateFile=i.locateFile,i.mainScriptUrlOrBlob&&(n.mainScriptUrlOrBlob=i.mainScriptUrlOrBlob)),e.next=16,self.ModuleFactory(self.Module||i);case 16:return i=e.sent,self.ModuleFactory=self.Module=void 0,e.abrupt("return",new t(i,o));case 19:case"end":return e.stop()}}),e)})));return function(t,n,r,o,i){return e.apply(this,arguments)}}()(t,r.wasmLoaderPath,r.assetLoaderPath,n,{locateFile:function(e){return e.endsWith(".wasm")?r.wasmBinaryPath.toString():r.assetBinaryPath&&e.endsWith(".data")?r.assetBinaryPath.toString():e}});case 2:return t=e.sent,e.next=5,t.o(o);case 5:return e.abrupt("return",t);case 6:case"end":return e.stop()}}),e)}))),Cc.apply(this,arguments)}function wc(e,t){var n=$o(e.baseOptions,Xs,1)||new Xs;"string"==typeof t?(Lo(n,2,to(t)),Lo(n,1)):t instanceof Uint8Array&&(Lo(n,1,Ir(t,!1,!1)),Lo(n,2)),Jo(e.baseOptions,0,1,n)}function Ec(e){try{var t=e.K.length;if(1===t)throw Error(e.K[0].message);if(1<t)throw Error("Encountered multiple errors: "+e.K.map((function(e){return e.message})).join(", "))}finally{e.K=[]}}function kc(e,t){e.J=Math.max(e.J,t)}function Dc(e,t){e.C=new Za,qa(e.C,"PassThroughCalculator"),Ha(e.C,"free_memory"),Ya(e.C,"free_memory_unused_out"),ts(t,"free_memory"),es(t,e.C)}function Mc(e,t){Ha(e.C,t),Ya(e.C,t+"_unused_out")}function Tc(e){e.g.addBoolToStream(!0,"free_memory",e.J)}lc.forVisionTasks=function(e){return uc("vision",e)},lc.forTextTasks=function(e){return uc("text",e)},lc.forGenAiExperimentalTasks=function(e){return uc("genai_experimental",e)},lc.forGenAiTasks=function(e){return uc("genai",e)},lc.forAudioTasks=function(e){return uc("audio",e)},lc.isSimdSupported=function(){return ac()};var Ic=function(){function e(e){this.g=e,this.K=[],this.J=0,this.g.setAutoRenderToScreen(!1)}var t=e.prototype;return t.l=function(e,t){var n,r=this;if(void 0===t&&(t=!0),t){var o,i,a,s,u,c,l=e.baseOptions||{};if(null!=(o=e.baseOptions)&&o.modelAssetBuffer&&null!=(i=e.baseOptions)&&i.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(null!=(a=$o(this.baseOptions,Xs,1))&&a.g()||null!=(s=$o(this.baseOptions,Xs,1))&&s.h()||null!=(u=e.baseOptions)&&u.modelAssetBuffer||null!=(c=e.baseOptions)&&c.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(e,t){var n=$o(e.baseOptions,Qs,3);if(!n){var r=n=new Qs,o=new Ra;ei(r,4,$s,o)}"delegate"in t&&("GPU"===t.delegate?(t=n,r=new Aa,ei(t,2,$s,r)):(t=n,r=new Ra,ei(t,4,$s,r))),Jo(e.baseOptions,0,3,n)}(this,l),l.modelAssetPath)return fetch(l.modelAssetPath.toString()).then((function(e){if(e.ok)return e.arrayBuffer();throw Error("Failed to fetch model: "+l.modelAssetPath+" ("+e.status+")")})).then((function(e){try{r.g.i.FS_unlink("/model.dat")}catch(e){}r.g.i.FS_createDataFile("/","model.dat",new Uint8Array(e),!0,!1,!1),wc(r,"/model.dat"),r.m(),r.L()}));if(l.modelAssetBuffer instanceof Uint8Array)wc(this,l.modelAssetBuffer);else if(l.modelAssetBuffer)return(n=ut(bt.mark((function e(t){var n,r,o,i,a,s,u;return bt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=[],r=0;case 2:return e.next=4,t.read();case 4:if(i=(o=e.sent).value,!o.done){e.next=9;break}return e.abrupt("break",12);case 9:n.push(i),r+=i.length;case 10:e.next=2;break;case 12:if(0!==n.length){e.next=14;break}return e.abrupt("return",new Uint8Array(0));case 14:if(1!==n.length){e.next=16;break}return e.abrupt("return",n[0]);case 16:for(t=new Uint8Array(r),r=0,a=0,s=n;a<s.length;a++)t.set(u=s[a],r),r+=u.length;return e.abrupt("return",t);case 19:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})(l.modelAssetBuffer).then((function(e){wc(r,e),r.m(),r.L()}))}return this.m(),this.L(),Promise.resolve()},t.L=function(){},t.fa=function(){var e;if(this.g.fa((function(t){e=is(t)})),!e)throw Error("Failed to retrieve CalculatorGraphConfig");return e},t.setGraph=function(e,t){var n=this;this.g.attachErrorListener((function(e,t){n.K.push(Error(t))})),this.g.Ma(),this.g.setGraph(e,t),this.C=void 0,Ec(this)},t.finishProcessing=function(){this.g.finishProcessing(),Ec(this)},t.close=function(){this.C=void 0,this.g.closeGraph()},e}();function Sc(e,t){if(!e)throw Error("Unable to obtain required WebGL resource: "+t);return e}Ic.prototype.close=Ic.prototype.close,function(e,t){e=e.split(".");var n,r=kt;e[0]in r||void 0===r.execScript||r.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}("TaskRunner",Ic);var Nc=function(){function e(e,t,n,r){this.g=e,this.h=t,this.m=n,this.l=r}var t=e.prototype;return t.bind=function(){this.g.bindVertexArray(this.h)},t.close=function(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)},e}();function Ac(e,t,n){var r=e.g;if(n=Sc(r.createShader(n),"Failed to create WebGL shader"),r.shaderSource(n,t),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw Error("Could not compile WebGL shader: "+r.getShaderInfoLog(n));return r.attachShader(e.h,n),n}function Lc(e,t){var n=e.g,r=Sc(n.createVertexArray(),"Failed to create vertex array");n.bindVertexArray(r);var o=Sc(n.createBuffer(),"Failed to create buffer");n.bindBuffer(n.ARRAY_BUFFER,o),n.enableVertexAttribArray(e.K),n.vertexAttribPointer(e.K,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW);var i=Sc(n.createBuffer(),"Failed to create buffer");return n.bindBuffer(n.ARRAY_BUFFER,i),n.enableVertexAttribArray(e.J),n.vertexAttribPointer(e.J,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array(t?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.bindVertexArray(null),new Nc(n,r,o,i)}function Oc(e,t){if(e.g){if(t!==e.g)throw Error("Cannot change GL context once initialized")}else e.g=t}function Rc(e,t,n,r){return Oc(e,t),e.h||(e.m(),e.D()),n?(e.v||(e.v=Lc(e,!0)),n=e.v):(e.A||(e.A=Lc(e,!1)),n=e.A),t.useProgram(e.h),n.bind(),e.l(),e=r(),n.g.bindVertexArray(null),e}function Fc(e,t,n){return Oc(e,t),e=Sc(t.createTexture(),"Failed to create texture"),t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,null!=n?n:t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,null!=n?n:t.LINEAR),t.bindTexture(t.TEXTURE_2D,null),e}function Pc(e,t,n){Oc(e,t),e.u||(e.u=Sc(t.createFramebuffer(),"Failed to create framebuffe.")),t.bindFramebuffer(t.FRAMEBUFFER,e.u),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,n,0)}function Uc(e){var t;null==(t=e.g)||t.bindFramebuffer(e.g.FRAMEBUFFER,null)}var _c=function(){function e(){}var t=e.prototype;return t.H=function(){return"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D inputTexture;\n void main() {\n gl_FragColor = texture2D(inputTexture, vTex);\n }\n "},t.m=function(){var e=this.g;if(this.h=Sc(e.createProgram(),"Failed to create WebGL program"),this.ba=Ac(this,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",e.VERTEX_SHADER),this.aa=Ac(this,this.H(),e.FRAGMENT_SHADER),e.linkProgram(this.h),!e.getProgramParameter(this.h,e.LINK_STATUS))throw Error("Error during program linking: "+e.getProgramInfoLog(this.h));this.K=e.getAttribLocation(this.h,"aVertex"),this.J=e.getAttribLocation(this.h,"aTex")},t.D=function(){},t.l=function(){},t.close=function(){if(this.h){var e=this.g;e.deleteProgram(this.h),e.deleteShader(this.ba),e.deleteShader(this.aa)}this.u&&this.g.deleteFramebuffer(this.u),this.A&&this.A.close(),this.v&&this.v.close()},e}();function jc(e,t){switch(t){case 0:return e.g.find((function(e){return e instanceof Uint8Array}));case 1:return e.g.find((function(e){return e instanceof Float32Array}));case 2:return e.g.find((function(e){return"undefined"!=typeof WebGLTexture&&e instanceof WebGLTexture}));default:throw Error("Type is not supported: "+t)}}function Bc(e){var t=jc(e,1);if(!t){if(t=jc(e,0))t=new Float32Array(t).map((function(e){return e/255}));else{t=new Float32Array(e.width*e.height);var n=Gc(e),r=Wc(e);if(Pc(r,n,zc(e)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in self.document){r=new Float32Array(e.width*e.height*4),n.readPixels(0,0,e.width,e.height,n.RGBA,n.FLOAT,r);for(var o=0,i=0;o<t.length;++o,i+=4)t[o]=r[i]}else n.readPixels(0,0,e.width,e.height,n.RED,n.FLOAT,t)}e.g.push(t)}return t}function zc(e){var t=jc(e,2);if(!t){var n=Gc(e);t=qc(e);var r=Bc(e),o=Vc(e);n.texImage2D(n.TEXTURE_2D,0,o,e.width,e.height,0,n.RED,n.FLOAT,r),Hc(e)}return t}function Gc(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=Sc(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function Vc(e){if(e=Gc(e),!Yc)if(e.getExtension("EXT_color_buffer_float")&&e.getExtension("OES_texture_float_linear")&&e.getExtension("EXT_float_blend"))Yc=e.R32F;else{if(!e.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");Yc=e.R16F}return Yc}function Wc(e){return e.l||(e.l=new _c),e.l}function qc(e){var t=Gc(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);var n=jc(e,2);return n||(n=Fc(Wc(e),t,e.m?t.LINEAR:t.NEAREST),e.g.push(n),e.j=!0),t.bindTexture(t.TEXTURE_2D,n),n}function Hc(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}var Yc,Zc=function(){function e(e,t,n,r,o,i,a){this.g=e,this.m=t,this.j=n,this.canvas=r,this.l=o,this.width=i,this.height=a,this.j&&0==--Qc&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}var t=e.prototype;return t.Ha=function(){return!!jc(this,0)},t.la=function(){return!!jc(this,1)},t.R=function(){return!!jc(this,2)},t.ka=function(){return(e=jc(this,0))||(e=Bc(this),e=new Uint8Array(e.map((function(e){return 255*e}))),this.g.push(e)),e;var e},t.ja=function(){return Bc(this)},t.O=function(){return zc(this)},t.clone=function(){for(var e,t=this,n=[],r=function(){var r,o=e.value;if(o instanceof Uint8Array)r=new Uint8Array(o);else if(o instanceof Float32Array)r=new Float32Array(o);else{if(!(o instanceof WebGLTexture))throw Error("Type is not supported: "+o);var i=Gc(t),a=Wc(t);i.activeTexture(i.TEXTURE1),r=Fc(a,i,t.m?i.LINEAR:i.NEAREST),i.bindTexture(i.TEXTURE_2D,r);var s=Vc(t);i.texImage2D(i.TEXTURE_2D,0,s,t.width,t.height,0,i.RED,i.FLOAT,null),i.bindTexture(i.TEXTURE_2D,null),Pc(a,i,r),Rc(a,i,!1,(function(){qc(t),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.drawArrays(i.TRIANGLE_FAN,0,4),Hc(t)})),Uc(a),Hc(t)}n.push(r)},o=xt(this.g);!(e=o()).done;)r();return new Zc(n,this.m,this.R(),this.canvas,this.l,this.width,this.height)},t.close=function(){this.j&&Gc(this).deleteTexture(jc(this,2)),Qc=-1},e}();Zc.prototype.close=Zc.prototype.close,Zc.prototype.clone=Zc.prototype.clone,Zc.prototype.getAsWebGLTexture=Zc.prototype.O,Zc.prototype.getAsFloat32Array=Zc.prototype.ja,Zc.prototype.getAsUint8Array=Zc.prototype.ka,Zc.prototype.hasWebGLTexture=Zc.prototype.R,Zc.prototype.hasFloat32Array=Zc.prototype.la,Zc.prototype.hasUint8Array=Zc.prototype.Ha;var Qc=250;function $c(e,t){switch(t){case 0:return e.g.find((function(e){return e instanceof ImageData}));case 1:return e.g.find((function(e){return"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap}));case 2:return e.g.find((function(e){return"undefined"!=typeof WebGLTexture&&e instanceof WebGLTexture}));default:throw Error("Type is not supported: "+t)}}function Xc(e){var t=$c(e,0);if(!t){t=Jc(e);var n=el(e),r=new Uint8Array(e.width*e.height*4);Pc(n,t,Kc(e)),t.readPixels(0,0,e.width,e.height,t.RGBA,t.UNSIGNED_BYTE,r),Uc(n),t=new ImageData(new Uint8ClampedArray(r.buffer),e.width,e.height),e.g.push(t)}return t}function Kc(e){var t=$c(e,2);if(!t){var n=Jc(e);t=tl(e);var r=$c(e,1)||Xc(e);n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,r),nl(e)}return t}function Jc(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when iniitializing the image.");return e.h||(e.h=Sc(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function el(e){return e.l||(e.l=new _c),e.l}function tl(e){var t=Jc(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);var n=$c(e,2);return n||(n=Fc(el(e),t),e.g.push(n),e.m=!0),t.bindTexture(t.TEXTURE_2D,n),n}function nl(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}function rl(e){var t=Jc(e);return Rc(el(e),t,!0,(function(){return function(e,t){var n=e.canvas;if(n.width===e.width&&n.height===e.height)return t();var r=n.width,o=n.height;return n.width=e.width,n.height=e.height,e=t(),n.width=r,n.height=o,e}(e,(function(){if(t.bindFramebuffer(t.FRAMEBUFFER,null),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),!(e.canvas instanceof OffscreenCanvas))throw Error("Conversion to ImageBitmap requires that the MediaPipe Tasks is initialized with an OffscreenCanvas");return e.canvas.transferToImageBitmap()}))}))}var ol=function(){function e(e,t,n,r,o,i,a){this.g=e,this.j=t,this.m=n,this.canvas=r,this.l=o,this.width=i,this.height=a,(this.j||this.m)&&0==--il&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources.")}var t=e.prototype;return t.Ga=function(){return!!$c(this,0)},t.ma=function(){return!!$c(this,1)},t.R=function(){return!!$c(this,2)},t.Ea=function(){return Xc(this)},t.Da=function(){var e=$c(this,1);return e||(Kc(this),tl(this),e=rl(this),nl(this),this.g.push(e),this.j=!0),e},t.O=function(){return Kc(this)},t.clone=function(){for(var e,t=this,n=[],r=function(){var r,o=e.value;if(o instanceof ImageData)r=new ImageData(o.data,t.width,t.height);else if(o instanceof WebGLTexture){var i=Jc(t),a=el(t);i.activeTexture(i.TEXTURE1),r=Fc(a,i),i.bindTexture(i.TEXTURE_2D,r),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,t.width,t.height,0,i.RGBA,i.UNSIGNED_BYTE,null),i.bindTexture(i.TEXTURE_2D,null),Pc(a,i,r),Rc(a,i,!1,(function(){tl(t),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.drawArrays(i.TRIANGLE_FAN,0,4),nl(t)})),Uc(a),nl(t)}else{if(!(o instanceof ImageBitmap))throw Error("Type is not supported: "+o);Kc(t),tl(t),r=rl(t),nl(t)}n.push(r)},o=xt(this.g);!(e=o()).done;)r();return new ol(n,this.ma(),this.R(),this.canvas,this.l,this.width,this.height)},t.close=function(){this.j&&$c(this,1).close(),this.m&&Jc(this).deleteTexture($c(this,2)),il=-1},e}();ol.prototype.close=ol.prototype.close,ol.prototype.clone=ol.prototype.clone,ol.prototype.getAsWebGLTexture=ol.prototype.O,ol.prototype.getAsImageBitmap=ol.prototype.Da,ol.prototype.getAsImageData=ol.prototype.Ea,ol.prototype.hasWebGLTexture=ol.prototype.R,ol.prototype.hasImageBitmap=ol.prototype.ma,ol.prototype.hasImageData=ol.prototype.Ga;var il=250;function al(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.map((function(e){return{start:e[0],end:e[1]}}))}var sl,ul=function(e){return function(e){function t(){return e.apply(this,arguments)||this}return lt(t,e),t.prototype.Ma=function(){this.i._registerModelResourcesGraphService()},t}(e)}((sl=function(){function e(e,t){this.l=!0,this.i=e,this.g=null,this.h=0,this.m="function"==typeof this.i._addIntToInputStream,void 0!==t?this.i.canvas=t:dc()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}var t=e.prototype;return t.initializeGraph=function(){var e=ut(bt.mark((function e(t){var n;return bt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t);case 2:return e.next=4,e.sent.arrayBuffer();case 4:n=e.sent,t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(n),t);case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.setGraphFromString=function(e){this.setGraph((new TextEncoder).encode(e),!1)},t.setGraph=function(e,t){var n=e.length,r=this.i._malloc(n);this.i.HEAPU8.set(e,r),t?this.i._changeBinaryGraph(n,r):this.i._changeTextGraph(n,r),this.i._free(r)},t.configureAudio=function(e,t,n,r,o){var i=this;this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),mc(this,r||"input_audio",(function(r){mc(i,o=o||"audio_header",(function(o){i.i._configureAudio(r,o,e,t,n)}))}))},t.setAutoResizeCanvas=function(e){this.l=e},t.setAutoRenderToScreen=function(e){this.i._setAutoRenderToScreen(e)},t.setGpuBufferVerticalFlip=function(e){this.i.gpuOriginForWebTexturesIsBottomLeft=e},t.fa=function(e){var t=this;yc(this,"__graph_config__",(function(t){e(t)})),mc(this,"__graph_config__",(function(e){t.i._getGraphConfig(e,void 0)})),delete this.i.simpleListeners.__graph_config__},t.attachErrorListener=function(e){this.i.errorListener=e},t.attachEmptyPacketListener=function(e,t){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[e]=t},t.addAudioToStream=function(e,t,n){this.addAudioToStreamWithShape(e,0,0,t,n)},t.addAudioToStreamWithShape=function(e,t,n,r,o){var i=this,a=4*e.length;this.h!==a&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(a),this.h=a),this.i.HEAPF32.set(e,this.g/4),mc(this,r,(function(e){i.i._addAudioToInputStream(i.g,t,n,e,o)}))},t.addGpuBufferToStream=function(e,t,n){var r=this;mc(this,t,(function(t){var o=gc(r,e,t);r.i._addBoundTextureToStream(t,o[0],o[1],n)}))},t.addBoolToStream=function(e,t,n){var r=this;mc(this,t,(function(t){r.i._addBoolToInputStream(e,t,n)}))},t.addDoubleToStream=function(e,t,n){var r=this;mc(this,t,(function(t){r.i._addDoubleToInputStream(e,t,n)}))},t.addFloatToStream=function(e,t,n){var r=this;mc(this,t,(function(t){r.i._addFloatToInputStream(e,t,n)}))},t.addIntToStream=function(e,t,n){var r=this;mc(this,t,(function(t){r.i._addIntToInputStream(e,t,n)}))},t.addUintToStream=function(e,t,n){var r=this;mc(this,t,(function(t){r.i._addUintToInputStream(e,t,n)}))},t.addStringToStream=function(e,t,n){var r=this;mc(this,t,(function(t){mc(r,e,(function(e){r.i._addStringToInputStream(e,t,n)}))}))},t.addStringRecordToStream=function(e,t,n){var r=this;mc(this,t,(function(t){vc(r,Object.keys(e),(function(o){vc(r,Object.values(e),(function(i){r.i._addFlatHashMapToInputStream(o,i,Object.keys(e).length,t,n)}))}))}))},t.addProtoToStream=function(e,t,n,r){var o=this;mc(this,n,(function(n){mc(o,t,(function(t){var i=o.i._malloc(e.length);o.i.HEAPU8.set(e,i),o.i._addProtoToInputStream(i,e.length,t,n,r),o.i._free(i)}))}))},t.addEmptyPacketToStream=function(e,t){var n=this;mc(this,e,(function(e){n.i._addEmptyPacketToInputStream(e,t)}))},t.addBoolVectorToStream=function(e,t,n){var r=this;mc(this,t,(function(t){var o=r.i._allocateBoolVector(e.length);if(!o)throw Error("Unable to allocate new bool vector on heap.");for(var i,a=xt(e);!(i=a()).done;){r.i._addBoolVectorEntry(o,i.value)}r.i._addBoolVectorToInputStream(o,t,n)}))},t.addDoubleVectorToStream=function(e,t,n){var r=this;mc(this,t,(function(t){var o=r.i._allocateDoubleVector(e.length);if(!o)throw Error("Unable to allocate new double vector on heap.");for(var i,a=xt(e);!(i=a()).done;){r.i._addDoubleVectorEntry(o,i.value)}r.i._addDoubleVectorToInputStream(o,t,n)}))},t.addFloatVectorToStream=function(e,t,n){var r=this;mc(this,t,(function(t){var o=r.i._allocateFloatVector(e.length);if(!o)throw Error("Unable to allocate new float vector on heap.");for(var i,a=xt(e);!(i=a()).done;){r.i._addFloatVectorEntry(o,i.value)}r.i._addFloatVectorToInputStream(o,t,n)}))},t.addIntVectorToStream=function(e,t,n){var r=this;mc(this,t,(function(t){var o=r.i._allocateIntVector(e.length);if(!o)throw Error("Unable to allocate new int vector on heap.");for(var i,a=xt(e);!(i=a()).done;){r.i._addIntVectorEntry(o,i.value)}r.i._addIntVectorToInputStream(o,t,n)}))},t.addUintVectorToStream=function(e,t,n){var r=this;mc(this,t,(function(t){var o=r.i._allocateUintVector(e.length);if(!o)throw Error("Unable to allocate new unsigned int vector on heap.");for(var i,a=xt(e);!(i=a()).done;){r.i._addUintVectorEntry(o,i.value)}r.i._addUintVectorToInputStream(o,t,n)}))},t.addStringVectorToStream=function(e,t,n){var r=this;mc(this,t,(function(t){var o=r.i._allocateStringVector(e.length);if(!o)throw Error("Unable to allocate new string vector on heap.");for(var i,a=xt(e);!(i=a()).done;){mc(r,i.value,(function(e){r.i._addStringVectorEntry(o,e)}))}r.i._addStringVectorToInputStream(o,t,n)}))},t.addBoolToInputSidePacket=function(e,t){var n=this;mc(this,t,(function(t){n.i._addBoolToInputSidePacket(e,t)}))},t.addDoubleToInputSidePacket=function(e,t){var n=this;mc(this,t,(function(t){n.i._addDoubleToInputSidePacket(e,t)}))},t.addFloatToInputSidePacket=function(e,t){var n=this;mc(this,t,(function(t){n.i._addFloatToInputSidePacket(e,t)}))},t.addIntToInputSidePacket=function(e,t){var n=this;mc(this,t,(function(t){n.i._addIntToInputSidePacket(e,t)}))},t.addUintToInputSidePacket=function(e,t){var n=this;mc(this,t,(function(t){n.i._addUintToInputSidePacket(e,t)}))},t.addStringToInputSidePacket=function(e,t){var n=this;mc(this,t,(function(t){mc(n,e,(function(e){n.i._addStringToInputSidePacket(e,t)}))}))},t.addProtoToInputSidePacket=function(e,t,n){var r=this;mc(this,n,(function(n){mc(r,t,(function(t){var o=r.i._malloc(e.length);r.i.HEAPU8.set(e,o),r.i._addProtoToInputSidePacket(o,e.length,t,n),r.i._free(o)}))}))},t.addBoolVectorToInputSidePacket=function(e,t){var n=this;mc(this,t,(function(t){var r=n.i._allocateBoolVector(e.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(var o,i=xt(e);!(o=i()).done;){n.i._addBoolVectorEntry(r,o.value)}n.i._addBoolVectorToInputSidePacket(r,t)}))},t.addDoubleVectorToInputSidePacket=function(e,t){var n=this;mc(this,t,(function(t){var r=n.i._allocateDoubleVector(e.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(var o,i=xt(e);!(o=i()).done;){n.i._addDoubleVectorEntry(r,o.value)}n.i._addDoubleVectorToInputSidePacket(r,t)}))},t.addFloatVectorToInputSidePacket=function(e,t){var n=this;mc(this,t,(function(t){var r=n.i._allocateFloatVector(e.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(var o,i=xt(e);!(o=i()).done;){n.i._addFloatVectorEntry(r,o.value)}n.i._addFloatVectorToInputSidePacket(r,t)}))},t.addIntVectorToInputSidePacket=function(e,t){var n=this;mc(this,t,(function(t){var r=n.i._allocateIntVector(e.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(var o,i=xt(e);!(o=i()).done;){n.i._addIntVectorEntry(r,o.value)}n.i._addIntVectorToInputSidePacket(r,t)}))},t.addUintVectorToInputSidePacket=function(e,t){var n=this;mc(this,t,(function(t){var r=n.i._allocateUintVector(e.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(var o,i=xt(e);!(o=i()).done;){n.i._addUintVectorEntry(r,o.value)}n.i._addUintVectorToInputSidePacket(r,t)}))},t.addStringVectorToInputSidePacket=function(e,t){var n=this;mc(this,t,(function(t){var r=n.i._allocateStringVector(e.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(var o,i=xt(e);!(o=i()).done;){mc(n,o.value,(function(e){n.i._addStringVectorEntry(r,e)}))}n.i._addStringVectorToInputSidePacket(r,t)}))},t.attachBoolListener=function(e,t){var n=this;yc(this,e,t),mc(this,e,(function(e){n.i._attachBoolListener(e)}))},t.attachBoolVectorListener=function(e,t){var n=this;bc(this,e,t),mc(this,e,(function(e){n.i._attachBoolVectorListener(e)}))},t.attachIntListener=function(e,t){var n=this;yc(this,e,t),mc(this,e,(function(e){n.i._attachIntListener(e)}))},t.attachIntVectorListener=function(e,t){var n=this;bc(this,e,t),mc(this,e,(function(e){n.i._attachIntVectorListener(e)}))},t.attachUintListener=function(e,t){var n=this;yc(this,e,t),mc(this,e,(function(e){n.i._attachUintListener(e)}))},t.attachUintVectorListener=function(e,t){var n=this;bc(this,e,t),mc(this,e,(function(e){n.i._attachUintVectorListener(e)}))},t.attachDoubleListener=function(e,t){var n=this;yc(this,e,t),mc(this,e,(function(e){n.i._attachDoubleListener(e)}))},t.attachDoubleVectorListener=function(e,t){var n=this;bc(this,e,t),mc(this,e,(function(e){n.i._attachDoubleVectorListener(e)}))},t.attachFloatListener=function(e,t){var n=this;yc(this,e,t),mc(this,e,(function(e){n.i._attachFloatListener(e)}))},t.attachFloatVectorListener=function(e,t){var n=this;bc(this,e,t),mc(this,e,(function(e){n.i._attachFloatVectorListener(e)}))},t.attachStringListener=function(e,t){var n=this;yc(this,e,t),mc(this,e,(function(e){n.i._attachStringListener(e)}))},t.attachStringVectorListener=function(e,t){var n=this;bc(this,e,t),mc(this,e,(function(e){n.i._attachStringVectorListener(e)}))},t.attachProtoListener=function(e,t,n){var r=this;yc(this,e,t),mc(this,e,(function(e){r.i._attachProtoListener(e,n||!1)}))},t.attachProtoVectorListener=function(e,t,n){var r=this;bc(this,e,t),mc(this,e,(function(e){r.i._attachProtoVectorListener(e,n||!1)}))},t.attachAudioListener=function(e,t,n){var r=this;this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),yc(this,e,(function(e,n){e=new Float32Array(e.buffer,e.byteOffset,e.length/4),t(e,n)})),mc(this,e,(function(e){r.i._attachAudioListener(e,n||!1)}))},t.finishProcessing=function(){this.i._waitUntilIdle()},t.closeGraph=function(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0},e}(),function(e){function t(){return e.apply(this,arguments)||this}lt(t,e);var n=t.prototype;return n.sa=function(e,t,n){var r=this;mc(this,t,(function(t){var o=gc(r,e,t);r.ha._addBoundTextureAsImageToStream(t,o[0],o[1],n)}))},n.W=function(e,t){var n=this;yc(this,e,t),mc(this,e,(function(e){n.ha._attachImageListener(e)}))},n.da=function(e,t){var n=this;bc(this,e,t),mc(this,e,(function(e){n.ha._attachImageVectorListener(e)}))},at(t,[{key:"ha",get:function(){return this.i}}])}(sl))),cl=function(e){function t(){return e.apply(this,arguments)||this}return lt(t,e),t}(ul);function ll(e,t,n){return dl.apply(this,arguments)}function dl(){return dl=ut(bt.mark((function e(t,n,r){var o;return bt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",function(){var e=ut(bt.mark((function e(t,n,r,o){return bt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",xc(t,n,r,o));case 1:case"end":return e.stop()}}),e)})));return function(t,n,r,o){return e.apply(this,arguments)}}()(t,null!=(o=r.canvas)?o:dc()?void 0:document.createElement("canvas"),n,r));case 1:case"end":return e.stop()}}),e)}))),dl.apply(this,arguments)}function fl(e,t,n,r){if(e.V){var o,i,a=new Os;if(null!=(o=n)&&o.regionOfInterest){if(!e.ra)throw Error("This task doesn't support region-of-interest.");var s=n.regionOfInterest;if(s.left>=s.right||s.top>=s.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(0>s.left||0>s.top||1<s.right||1<s.bottom)throw Error("Expected RectF values to be in [0,1].");li(a,1,(s.left+s.right)/2),li(a,2,(s.top+s.bottom)/2),li(a,4,s.right-s.left),li(a,3,s.bottom-s.top)}else li(a,1,.5),li(a,2,.5),li(a,4,1),li(a,3,1);if(null!=(i=n)&&i.rotationDegrees){var u,c;if(0!=(null==(u=n)?void 0:u.rotationDegrees)%90)throw Error("Expected rotation to be a multiple of 90°.");if(li(a,5,-Math.PI*n.rotationDegrees/180),0!=(null==(c=n)?void 0:c.rotationDegrees)%180){var l=hc(t),d=l[0],f=l[1];n=ai(a,3)*f/d,s=ai(a,4)*d/f,li(a,4,n),li(a,3,s)}}e.g.addProtoToStream(a.g(),"mediapipe.NormalizedRect",e.V,r)}e.g.sa(t,e.ba,null!=r?r:performance.now()),e.finishProcessing()}function pl(e,t,n){var r;if(null!=(r=e.baseOptions)&&r.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");fl(e,t,n,e.J+1)}function hl(e,t,n,r){var o;if(null==(o=e.baseOptions)||!o.g())throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");fl(e,t,n,r)}function ml(e,t,n,r){var o=t.data,i=t.width,a=i*(t=t.height);if((o instanceof Uint8Array||o instanceof Float32Array)&&o.length!==a)throw Error("Unsupported channel count: "+o.length/a);return e=new Zc([o],n,!1,e.g.i.canvas,e.M,i,t),r?e.clone():e}var gl=function(e){function t(t,n,r,o){var i;return(i=e.call(this,t)||this).g=t,i.ba=n,i.V=r,i.ra=o,i.M=new _c,i}lt(t,e);var n=t.prototype;return n.l=function(t,n){if(void 0===n&&(n=!0),"runningMode"in t&&ui(this.baseOptions,2,!!t.runningMode&&"IMAGE"!==t.runningMode),void 0!==t.canvas&&this.g.i.canvas!==t.canvas)throw Error("You must create a new task to reset the canvas.");return e.prototype.l.call(this,t,n)},n.close=function(){this.M.close(),e.prototype.close.call(this)},t}(Ic);gl.prototype.close=gl.prototype.close;var vl=function(e){function t(t,n){var r;return(r=e.call(this,new cl(t,n),"image_in","norm_rect_in",!1)||this).j={detections:[]},Jo(t=r.h=new tu,0,1,n=new Js),li(r.h,2,.5),li(r.h,3,.3),r}lt(t,e);var n=t.prototype;return n.o=function(e){var t,n;return"minDetectionConfidence"in e&&li(this.h,2,null!=(t=e.minDetectionConfidence)?t:.5),"minSuppressionThreshold"in e&&li(this.h,3,null!=(n=e.minSuppressionThreshold)?n:.3),this.l(e)},n.F=function(e,t){return this.j={detections:[]},pl(this,e,t),this.j},n.G=function(e,t,n){return this.j={detections:[]},hl(this,e,n,t),this.j},n.m=function(){var e=this,t=new rs;ts(t,"image_in"),ts(t,"norm_rect_in"),ns(t,"detections");var n=new Ua;di(n,ru,this.h);var r=new Za;qa(r,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),Ha(r,"IMAGE:image_in"),Ha(r,"NORM_RECT:norm_rect_in"),Ya(r,"DETECTIONS:detections"),r.o(n),es(t,r),this.g.attachProtoVectorListener("detections",(function(t,n){for(var r,o=xt(t);!(r=o()).done;){t=ws(r.value),e.j.detections.push(ec(t))}kc(e,n)})),this.g.attachEmptyPacketListener("detections",(function(t){kc(e,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)},at(t,[{key:"baseOptions",get:function(){return $o(this.h,Js,1)},set:function(e){Jo(this.h,0,1,e)}}])}(gl);vl.prototype.detectForVideo=vl.prototype.G,vl.prototype.detect=vl.prototype.F,vl.prototype.setOptions=vl.prototype.o,vl.createFromModelPath=function(){var e=ut(bt.mark((function e(t,n){return bt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",ll(vl,t,{baseOptions:{modelAssetPath:n}}));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),vl.createFromModelBuffer=function(e,t){return ll(vl,e,{baseOptions:{modelAssetBuffer:t}})},vl.createFromOptions=function(e,t){return ll(vl,e,t)};var yl=al([61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]),bl=al([263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]),xl=al([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),Cl=al([474,475],[475,476],[476,477],[477,474]),wl=al([33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]),El=al([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),kl=al([469,470],[470,471],[471,472],[472,469]),Dl=al([10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]),Ml=[].concat(yl,bl,xl,wl,El,Dl),Tl=al([127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]);function Il(e){e.u={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var Sl=function(e){function t(t,n){var r;return(r=e.call(this,new cl(t,n),"image_in","norm_rect",!1)||this).u={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},r.outputFacialTransformationMatrixes=r.outputFaceBlendshapes=!1,Jo(t=r.h=new lu,0,1,n=new Js),r.H=new uu,Jo(r.h,0,3,r.H),r.j=new tu,Jo(r.h,0,2,r.j),ci(r.j,4,1),li(r.j,2,.5),li(r.H,2,.5),li(r.h,4,.5),r}lt(t,e);var n=t.prototype;return n.o=function(e){var t,n,r,o;return"numFaces"in e&&ci(this.j,4,null!=(t=e.numFaces)?t:1),"minFaceDetectionConfidence"in e&&li(this.j,2,null!=(n=e.minFaceDetectionConfidence)?n:.5),"minTrackingConfidence"in e&&li(this.h,4,null!=(r=e.minTrackingConfidence)?r:.5),"minFacePresenceConfidence"in e&&li(this.H,2,null!=(o=e.minFacePresenceConfidence)?o:.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in e&&(this.outputFacialTransformationMatrixes=!!e.outputFacialTransformationMatrixes),this.l(e)},n.F=function(e,t){return Il(this),pl(this,e,t),this.u},n.G=function(e,t,n){return Il(this),hl(this,e,n,t),this.u},n.m=function(){var e=this,t=new rs;ts(t,"image_in"),ts(t,"norm_rect"),ns(t,"face_landmarks");var n=new Ua;di(n,fu,this.h);var r=new Za;qa(r,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),Ha(r,"IMAGE:image_in"),Ha(r,"NORM_RECT:norm_rect"),Ya(r,"NORM_LANDMARKS:face_landmarks"),r.o(n),es(t,r),this.g.attachProtoVectorListener("face_landmarks",(function(t,n){for(var r,o=xt(t);!(r=o()).done;){t=Ns(r.value),e.u.faceLandmarks.push(tc(t))}kc(e,n)})),this.g.attachEmptyPacketListener("face_landmarks",(function(t){kc(e,t)})),this.outputFaceBlendshapes&&(ns(t,"blendshapes"),Ya(r,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",(function(t,n){if(e.outputFaceBlendshapes)for(var r,o=xt(t);!(r=o()).done;){var i;t=ds(r.value),e.u.faceBlendshapes.push(Ju(null!=(i=t.g())?i:[]))}kc(e,n)})),this.g.attachEmptyPacketListener("blendshapes",(function(t){kc(e,t)}))),this.outputFacialTransformationMatrixes&&(ns(t,"face_geometry"),Ya(r,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",(function(t,n){if(e.outputFacialTransformationMatrixes)for(var r,o=xt(t);!(r=o()).done;){var i,a,s;(t=$o(au(r.value),As,2))&&e.u.facialTransformationMatrixes.push({rows:null!=(i=ii(oi(t,1),0))?i:0,columns:null!=(a=ii(oi(t,2),0))?a:0,data:null!=(s=Uo(t,3,Br).slice())?s:[]})}kc(e,n)})),this.g.attachEmptyPacketListener("face_geometry",(function(t){kc(e,t)}))),t=t.g(),this.setGraph(new Uint8Array(t),!0)},at(t,[{key:"baseOptions",get:function(){return $o(this.h,Js,1)},set:function(e){Jo(this.h,0,1,e)}}])}(gl);Sl.prototype.detectForVideo=Sl.prototype.G,Sl.prototype.detect=Sl.prototype.F,Sl.prototype.setOptions=Sl.prototype.o,Sl.createFromModelPath=function(e,t){return ll(Sl,e,{baseOptions:{modelAssetPath:t}})},Sl.createFromModelBuffer=function(e,t){return ll(Sl,e,{baseOptions:{modelAssetBuffer:t}})},Sl.createFromOptions=function(e,t){return ll(Sl,e,t)},Sl.FACE_LANDMARKS_LIPS=yl,Sl.FACE_LANDMARKS_LEFT_EYE=bl,Sl.FACE_LANDMARKS_LEFT_EYEBROW=xl,Sl.FACE_LANDMARKS_LEFT_IRIS=Cl,Sl.FACE_LANDMARKS_RIGHT_EYE=wl,Sl.FACE_LANDMARKS_RIGHT_EYEBROW=El,Sl.FACE_LANDMARKS_RIGHT_IRIS=kl,Sl.FACE_LANDMARKS_FACE_OVAL=Dl,Sl.FACE_LANDMARKS_CONTOURS=Ml,Sl.FACE_LANDMARKS_TESSELATION=Tl;var Nl=function(e){function t(t,n){var r;return Jo(t=(r=e.call(this,new cl(t,n),"image_in","norm_rect",!0)||this).j=new pu,0,1,n=new Js),r}lt(t,e);var n=t.prototype;return n.o=function(t){return e.prototype.l.call(this,t)},n.Pa=function(e,t,n){var r="function"!=typeof t?t:{};if(this.h="function"==typeof t?t:n,pl(this,e,null!=r?r:{}),!this.h)return this.u},n.m=function(){var e=this,t=new rs;ts(t,"image_in"),ts(t,"norm_rect"),ns(t,"stylized_image");var n=new Ua;di(n,hu,this.j);var r=new Za;qa(r,"mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"),Ha(r,"IMAGE:image_in"),Ha(r,"NORM_RECT:norm_rect"),Ya(r,"STYLIZED_IMAGE:stylized_image"),r.o(n),es(t,r),this.g.W("stylized_image",(function(t,n){var r=!e.h,o=t.data,i=t.width,a=i*(t=t.height);if(o instanceof Uint8Array)if(o.length===3*a){for(var s=new Uint8ClampedArray(4*a),u=0;u<a;++u)s[4*u]=o[3*u],s[4*u+1]=o[3*u+1],s[4*u+2]=o[3*u+2],s[4*u+3]=255;o=new ImageData(s,i,t)}else{if(o.length!==4*a)throw Error("Unsupported channel count: "+o.length/a);o=new ImageData(new Uint8ClampedArray(o.buffer,o.byteOffset,o.length),i,t)}else if(!(o instanceof WebGLTexture))throw Error("Unsupported format: "+o.constructor.name);i=new ol([o],!1,!1,e.g.i.canvas,e.M,i,t),e.u=r=r?i.clone():i,e.h&&e.h(r),kc(e,n)})),this.g.attachEmptyPacketListener("stylized_image",(function(t){e.u=null,e.h&&e.h(null),kc(e,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)},at(t,[{key:"baseOptions",get:function(){return $o(this.j,Js,1)},set:function(e){Jo(this.j,0,1,e)}}])}(gl);Nl.prototype.stylize=Nl.prototype.Pa,Nl.prototype.setOptions=Nl.prototype.o,Nl.createFromModelPath=function(e,t){return ll(Nl,e,{baseOptions:{modelAssetPath:t}})},Nl.createFromModelBuffer=function(e,t){return ll(Nl,e,{baseOptions:{modelAssetBuffer:t}})},Nl.createFromOptions=function(e,t){return ll(Nl,e,t)};var Al=al([0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]);function Ll(e){e.gestures=[],e.landmarks=[],e.worldLandmarks=[],e.handedness=[]}function Ol(e){return 0===e.gestures.length?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:e.gestures,landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handedness:e.handedness,handednesses:e.handedness}}function Rl(e,t){void 0===t&&(t=!0);for(var n,r=[],o=xt(e);!(n=o()).done;){var i=ds(n.value);e=[];for(var a,s=xt(i.g());!(a=s()).done;){var u,c,l,d=a.value;i=t&&null!=oi(d,1)?ii(oi(d,1),0):-1,e.push({score:null!=(u=ai(d,2))?u:0,index:i,categoryName:null!=(c=si(d,3))?c:"",displayName:null!=(l=si(d,4))?l:""})}r.push(e)}return r}var Fl=function(e){function t(t,n){var r;return(r=e.call(this,new cl(t,n),"image_in","norm_rect",!1)||this).gestures=[],r.landmarks=[],r.worldLandmarks=[],r.handedness=[],Jo(t=r.v=new Mu,0,1,n=new Js),r.A=new ku,Jo(r.v,0,2,r.A),r.u=new wu,Jo(r.A,0,3,r.u),r.h=new xu,Jo(r.A,0,2,r.h),r.j=new yu,Jo(r.v,0,3,r.j),li(r.h,2,.5),li(r.A,4,.5),li(r.u,2,.5),r}lt(t,e);var n=t.prototype;return n.o=function(e){var t,n,r,o,i,a,s;if(ci(this.h,3,null!=(t=e.numHands)?t:1),"minHandDetectionConfidence"in e&&li(this.h,2,null!=(n=e.minHandDetectionConfidence)?n:.5),"minTrackingConfidence"in e&&li(this.A,4,null!=(r=e.minTrackingConfidence)?r:.5),"minHandPresenceConfidence"in e&&li(this.u,2,null!=(o=e.minHandPresenceConfidence)?o:.5),e.cannedGesturesClassifierOptions){var u,c=new mu,l=c,d=Ku(e.cannedGesturesClassifierOptions,null==(u=$o(this.j,mu,3))?void 0:u.h());Jo(l,0,2,d),Jo(this.j,0,3,c)}else void 0===e.cannedGesturesClassifierOptions&&(null==(i=$o(this.j,mu,3))||i.g());return e.customGesturesClassifierOptions?(Jo(l=c=new mu,0,2,d=Ku(e.customGesturesClassifierOptions,null==(a=$o(this.j,mu,4))?void 0:a.h())),Jo(this.j,0,4,c)):void 0===e.customGesturesClassifierOptions&&(null==(s=$o(this.j,mu,4))||s.g()),this.l(e)},n.Ka=function(e,t){return Ll(this),pl(this,e,t),Ol(this)},n.La=function(e,t,n){return Ll(this),hl(this,e,n,t),Ol(this)},n.m=function(){var e=this,t=new rs;ts(t,"image_in"),ts(t,"norm_rect"),ns(t,"hand_gestures"),ns(t,"hand_landmarks"),ns(t,"world_hand_landmarks"),ns(t,"handedness");var n=new Ua;di(n,Su,this.v);var r=new Za;qa(r,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),Ha(r,"IMAGE:image_in"),Ha(r,"NORM_RECT:norm_rect"),Ya(r,"HAND_GESTURES:hand_gestures"),Ya(r,"LANDMARKS:hand_landmarks"),Ya(r,"WORLD_LANDMARKS:world_hand_landmarks"),Ya(r,"HANDEDNESS:handedness"),r.o(n),es(t,r),this.g.attachProtoVectorListener("hand_landmarks",(function(t,n){for(var r,o=xt(t);!(r=o()).done;){for(var i,a=[],s=xt(Ko(t=Ns(r.value),Ts,1));!(i=s()).done;){var u,c,l,d,f=i.value;a.push({x:null!=(u=ai(f,1))?u:0,y:null!=(c=ai(f,2))?c:0,z:null!=(l=ai(f,3))?l:0,visibility:null!=(d=ai(f,4))?d:0})}e.landmarks.push(a)}kc(e,n)})),this.g.attachEmptyPacketListener("hand_landmarks",(function(t){kc(e,t)})),this.g.attachProtoVectorListener("world_hand_landmarks",(function(t,n){for(var r,o=xt(t);!(r=o()).done;){for(var i,a=[],s=xt(Ko(t=Ms(r.value),Es,1));!(i=s()).done;){var u,c,l,d,f=i.value;a.push({x:null!=(u=ai(f,1))?u:0,y:null!=(c=ai(f,2))?c:0,z:null!=(l=ai(f,3))?l:0,visibility:null!=(d=ai(f,4))?d:0})}e.worldLandmarks.push(a)}kc(e,n)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(function(t){kc(e,t)})),this.g.attachProtoVectorListener("hand_gestures",(function(t,n){var r;(r=e.gestures).push.apply(r,Rl(t,!1)),kc(e,n)})),this.g.attachEmptyPacketListener("hand_gestures",(function(t){kc(e,t)})),this.g.attachProtoVectorListener("handedness",(function(t,n){var r;(r=e.handedness).push.apply(r,Rl(t)),kc(e,n)})),this.g.attachEmptyPacketListener("handedness",(function(t){kc(e,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)},at(t,[{key:"baseOptions",get:function(){return $o(this.v,Js,1)},set:function(e){Jo(this.v,0,1,e)}}])}(gl);function Pl(e){return{landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handednesses:e.handedness,handedness:e.handedness}}Fl.prototype.recognizeForVideo=Fl.prototype.La,Fl.prototype.recognize=Fl.prototype.Ka,Fl.prototype.setOptions=Fl.prototype.o,Fl.createFromModelPath=function(e,t){return ll(Fl,e,{baseOptions:{modelAssetPath:t}})},Fl.createFromModelBuffer=function(e,t){return ll(Fl,e,{baseOptions:{modelAssetBuffer:t}})},Fl.createFromOptions=function(e,t){return ll(Fl,e,t)},Fl.HAND_CONNECTIONS=Al;var Ul=function(e){function t(t,n){var r;return(r=e.call(this,new cl(t,n),"image_in","norm_rect",!1)||this).landmarks=[],r.worldLandmarks=[],r.handedness=[],Jo(t=r.j=new ku,0,1,n=new Js),r.u=new wu,Jo(r.j,0,3,r.u),r.h=new xu,Jo(r.j,0,2,r.h),ci(r.h,3,1),li(r.h,2,.5),li(r.u,2,.5),li(r.j,4,.5),r}lt(t,e);var n=t.prototype;return n.o=function(e){var t,n,r,o;return"numHands"in e&&ci(this.h,3,null!=(t=e.numHands)?t:1),"minHandDetectionConfidence"in e&&li(this.h,2,null!=(n=e.minHandDetectionConfidence)?n:.5),"minTrackingConfidence"in e&&li(this.j,4,null!=(r=e.minTrackingConfidence)?r:.5),"minHandPresenceConfidence"in e&&li(this.u,2,null!=(o=e.minHandPresenceConfidence)?o:.5),this.l(e)},n.F=function(e,t){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],pl(this,e,t),Pl(this)},n.G=function(e,t,n){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],hl(this,e,n,t),Pl(this)},n.m=function(){var e=this,t=new rs;ts(t,"image_in"),ts(t,"norm_rect"),ns(t,"hand_landmarks"),ns(t,"world_hand_landmarks"),ns(t,"handedness");var n=new Ua;di(n,Iu,this.j);var r=new Za;qa(r,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),Ha(r,"IMAGE:image_in"),Ha(r,"NORM_RECT:norm_rect"),Ya(r,"LANDMARKS:hand_landmarks"),Ya(r,"WORLD_LANDMARKS:world_hand_landmarks"),Ya(r,"HANDEDNESS:handedness"),r.o(n),es(t,r),this.g.attachProtoVectorListener("hand_landmarks",(function(t,n){for(var r,o=xt(t);!(r=o()).done;){t=Ns(r.value),e.landmarks.push(tc(t))}kc(e,n)})),this.g.attachEmptyPacketListener("hand_landmarks",(function(t){kc(e,t)})),this.g.attachProtoVectorListener("world_hand_landmarks",(function(t,n){for(var r,o=xt(t);!(r=o()).done;){t=Ms(r.value),e.worldLandmarks.push(nc(t))}kc(e,n)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(function(t){kc(e,t)})),this.g.attachProtoVectorListener("handedness",(function(t,n){for(var r,o=e.handedness,i=o.push,a=[],s=xt(t);!(r=s()).done;){for(var u,c=[],l=xt((t=ds(r.value)).g());!(u=l()).done;){var d,f,p,h,m=u.value;c.push({score:null!=(d=ai(m,2))?d:0,index:null!=(f=ii(oi(m,1),0))?f:-1,categoryName:null!=(p=si(m,3))?p:"",displayName:null!=(h=si(m,4))?h:""})}a.push(c)}i.call.apply(i,[o].concat(a)),kc(e,n)})),this.g.attachEmptyPacketListener("handedness",(function(t){kc(e,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)},at(t,[{key:"baseOptions",get:function(){return $o(this.j,Js,1)},set:function(e){Jo(this.j,0,1,e)}}])}(gl);Ul.prototype.detectForVideo=Ul.prototype.G,Ul.prototype.detect=Ul.prototype.F,Ul.prototype.setOptions=Ul.prototype.o,Ul.createFromModelPath=function(e,t){return ll(Ul,e,{baseOptions:{modelAssetPath:t}})},Ul.createFromModelBuffer=function(e,t){return ll(Ul,e,{baseOptions:{modelAssetBuffer:t}})},Ul.createFromOptions=function(e,t){return ll(Ul,e,t)},Ul.HAND_CONNECTIONS=Al;var _l=al([0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]);function jl(e){e.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function Bl(e){try{if(!e.I)return e.h;e.I(e.h)}finally{Tc(e)}}function zl(e,t){e=Ns(e),t.push(tc(e))}var Gl=function(e){function t(t,n){var r;return(r=e.call(this,new cl(t,n),"input_frames_image",null,!1)||this).h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},r.outputPoseSegmentationMasks=r.outputFaceBlendshapes=!1,Jo(t=r.A=new Pu,0,1,n=new Js),r.u=new wu,Jo(r.A,0,2,r.u),r.aa=new Nu,Jo(r.A,0,3,r.aa),r.j=new tu,Jo(r.A,0,4,r.j),r.H=new uu,Jo(r.A,0,5,r.H),r.v=new Lu,Jo(r.A,0,6,r.v),r.D=new Ru,Jo(r.A,0,7,r.D),li(r.j,2,.5),li(r.j,3,.3),li(r.H,2,.5),li(r.v,2,.5),li(r.v,3,.3),li(r.D,2,.5),li(r.u,2,.5),r}lt(t,e);var n=t.prototype;return n.o=function(e){var t,n,r,o,i,a,s;return"minFaceDetectionConfidence"in e&&li(this.j,2,null!=(t=e.minFaceDetectionConfidence)?t:.5),"minFaceSuppressionThreshold"in e&&li(this.j,3,null!=(n=e.minFaceSuppressionThreshold)?n:.3),"minFacePresenceConfidence"in e&&li(this.H,2,null!=(r=e.minFacePresenceConfidence)?r:.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"minPoseDetectionConfidence"in e&&li(this.v,2,null!=(o=e.minPoseDetectionConfidence)?o:.5),"minPoseSuppressionThreshold"in e&&li(this.v,3,null!=(i=e.minPoseSuppressionThreshold)?i:.3),"minPosePresenceConfidence"in e&&li(this.D,2,null!=(a=e.minPosePresenceConfidence)?a:.5),"outputPoseSegmentationMasks"in e&&(this.outputPoseSegmentationMasks=!!e.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in e&&li(this.u,2,null!=(s=e.minHandLandmarksConfidence)?s:.5),this.l(e)},n.F=function(e,t,n){var r="function"!=typeof t?t:{};return this.I="function"==typeof t?t:n,jl(this),pl(this,e,r),Bl(this)},n.G=function(e,t,n,r){var o="function"!=typeof n?n:{};return this.I="function"==typeof n?n:r,jl(this),hl(this,e,o,t),Bl(this)},n.m=function(){var e=this,t=new rs;ts(t,"input_frames_image"),ns(t,"pose_landmarks"),ns(t,"pose_world_landmarks"),ns(t,"face_landmarks"),ns(t,"left_hand_landmarks"),ns(t,"left_hand_world_landmarks"),ns(t,"right_hand_landmarks"),ns(t,"right_hand_world_landmarks");var n=new Ua,r=new Ma;Vo(r,1,to("type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),""),function(e,t){if(null!=t)if(Array.isArray(t))Lo(e,2,Co(t,Eo,void 0,void 0,!1));else{if(!("string"==typeof t||t instanceof sn||Jt(t)))throw Error("invalid value in Any.value field: "+t+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");Vo(e,2,Ir(t,!1,!1),on())}}(r,this.A.g());var o=new Za;qa(o,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),ri(o,8,Ma,r),Ha(o,"IMAGE:input_frames_image"),Ya(o,"POSE_LANDMARKS:pose_landmarks"),Ya(o,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),Ya(o,"FACE_LANDMARKS:face_landmarks"),Ya(o,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),Ya(o,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),Ya(o,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),Ya(o,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),o.o(n),es(t,o),Dc(this,t),this.g.attachProtoListener("pose_landmarks",(function(t,n){zl(t,e.h.poseLandmarks),kc(e,n)})),this.g.attachEmptyPacketListener("pose_landmarks",(function(t){kc(e,t)})),this.g.attachProtoListener("pose_world_landmarks",(function(t,n){var r=e.h.poseWorldLandmarks;t=Ms(t),r.push(nc(t)),kc(e,n)})),this.g.attachEmptyPacketListener("pose_world_landmarks",(function(t){kc(e,t)})),this.outputPoseSegmentationMasks&&(Ya(o,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),Mc(this,"pose_segmentation_mask"),this.g.W("pose_segmentation_mask",(function(t,n){e.h.poseSegmentationMasks=[ml(e,t,!0,!e.I)],kc(e,n)})),this.g.attachEmptyPacketListener("pose_segmentation_mask",(function(t){e.h.poseSegmentationMasks=[],kc(e,t)}))),this.g.attachProtoListener("face_landmarks",(function(t,n){zl(t,e.h.faceLandmarks),kc(e,n)})),this.g.attachEmptyPacketListener("face_landmarks",(function(t){kc(e,t)})),this.outputFaceBlendshapes&&(ns(t,"extra_blendshapes"),Ya(o,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",(function(t,n){var r,o=e.h.faceBlendshapes;e.outputFaceBlendshapes&&(t=ds(t),o.push(Ju(null!=(r=t.g())?r:[]))),kc(e,n)})),this.g.attachEmptyPacketListener("extra_blendshapes",(function(t){kc(e,t)}))),this.g.attachProtoListener("left_hand_landmarks",(function(t,n){zl(t,e.h.leftHandLandmarks),kc(e,n)})),this.g.attachEmptyPacketListener("left_hand_landmarks",(function(t){kc(e,t)})),this.g.attachProtoListener("left_hand_world_landmarks",(function(t,n){var r=e.h.leftHandWorldLandmarks;t=Ms(t),r.push(nc(t)),kc(e,n)})),this.g.attachEmptyPacketListener("left_hand_world_landmarks",(function(t){kc(e,t)})),this.g.attachProtoListener("right_hand_landmarks",(function(t,n){zl(t,e.h.rightHandLandmarks),kc(e,n)})),this.g.attachEmptyPacketListener("right_hand_landmarks",(function(t){kc(e,t)})),this.g.attachProtoListener("right_hand_world_landmarks",(function(t,n){var r=e.h.rightHandWorldLandmarks;t=Ms(t),r.push(nc(t)),kc(e,n)})),this.g.attachEmptyPacketListener("right_hand_world_landmarks",(function(t){kc(e,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)},at(t,[{key:"baseOptions",get:function(){return $o(this.A,Js,1)},set:function(e){Jo(this.A,0,1,e)}}])}(gl);Gl.prototype.detectForVideo=Gl.prototype.G,Gl.prototype.detect=Gl.prototype.F,Gl.prototype.setOptions=Gl.prototype.o,Gl.createFromModelPath=function(e,t){return ll(Gl,e,{baseOptions:{modelAssetPath:t}})},Gl.createFromModelBuffer=function(e,t){return ll(Gl,e,{baseOptions:{modelAssetBuffer:t}})},Gl.createFromOptions=function(e,t){return ll(Gl,e,t)},Gl.HAND_CONNECTIONS=Al,Gl.POSE_CONNECTIONS=_l,Gl.FACE_LANDMARKS_LIPS=yl,Gl.FACE_LANDMARKS_LEFT_EYE=bl,Gl.FACE_LANDMARKS_LEFT_EYEBROW=xl,Gl.FACE_LANDMARKS_LEFT_IRIS=Cl,Gl.FACE_LANDMARKS_RIGHT_EYE=wl,Gl.FACE_LANDMARKS_RIGHT_EYEBROW=El,Gl.FACE_LANDMARKS_RIGHT_IRIS=kl,Gl.FACE_LANDMARKS_FACE_OVAL=Dl,Gl.FACE_LANDMARKS_CONTOURS=Ml,Gl.FACE_LANDMARKS_TESSELATION=Tl;var Vl=function(e){function t(t,n){var r;return(r=e.call(this,new cl(t,n),"input_image","norm_rect",!0)||this).j={classifications:[]},Jo(t=r.h=new Uu,0,1,n=new Js),r}lt(t,e);var n=t.prototype;return n.o=function(e){return Jo(this.h,0,2,Ku(e,$o(this.h,qs,2))),this.l(e)},n.ua=function(e,t){return this.j={classifications:[]},pl(this,e,t),this.j},n.va=function(e,t,n){return this.j={classifications:[]},hl(this,e,n,t),this.j},n.m=function(){var e=this,t=new rs;ts(t,"input_image"),ts(t,"norm_rect"),ns(t,"classifications");var n=new Ua;di(n,_u,this.h);var r=new Za;qa(r,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),Ha(r,"IMAGE:input_image"),Ha(r,"NORM_RECT:norm_rect"),Ya(r,"CLASSIFICATIONS:classifications"),r.o(n),es(t,r),this.g.attachProtoListener("classifications",(function(t,n){e.j=function(e){var t={classifications:Ko(e,Rs,1).map((function(e){var t,n;return Ju(null!=(t=null==(n=$o(e,cs,4))?void 0:n.g())?t:[],ii(oi(e,2),0),si(e,3))}))};return null!=Jr(So(e,2))&&(t.timestampMs=ii(Jr(So(e,2)),0)),t}(Us(t)),kc(e,n)})),this.g.attachEmptyPacketListener("classifications",(function(t){kc(e,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)},at(t,[{key:"baseOptions",get:function(){return $o(this.h,Js,1)},set:function(e){Jo(this.h,0,1,e)}}])}(gl);Vl.prototype.classifyForVideo=Vl.prototype.va,Vl.prototype.classify=Vl.prototype.ua,Vl.prototype.setOptions=Vl.prototype.o,Vl.createFromModelPath=function(e,t){return ll(Vl,e,{baseOptions:{modelAssetPath:t}})},Vl.createFromModelBuffer=function(e,t){return ll(Vl,e,{baseOptions:{modelAssetBuffer:t}})},Vl.createFromOptions=function(e,t){return ll(Vl,e,t)};var Wl=function(e){function t(t,n){var r;return(r=e.call(this,new cl(t,n),"image_in","norm_rect",!0)||this).h=new ju,r.embeddings={embeddings:[]},Jo(t=r.h,0,1,n=new Js),r}lt(t,e);var n=t.prototype;return n.o=function(e){var t=this.h,n=$o(this.h,Ys,2);return n=n?n.clone():new Ys,void 0!==e.l2Normalize?ui(n,1,e.l2Normalize):"l2Normalize"in e&&Lo(n,1),void 0!==e.quantize?ui(n,2,e.quantize):"quantize"in e&&Lo(n,2),Jo(t,0,2,n),this.l(e)},n.Ba=function(e,t){return pl(this,e,t),this.embeddings},n.Ca=function(e,t,n){return hl(this,e,n,t),this.embeddings},n.m=function(){var e=this,t=new rs;ts(t,"image_in"),ts(t,"norm_rect"),ns(t,"embeddings_out");var n=new Ua;di(n,Bu,this.h);var r=new Za;qa(r,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),Ha(r,"IMAGE:image_in"),Ha(r,"NORM_RECT:norm_rect"),Ya(r,"EMBEDDINGS:embeddings_out"),r.o(n),es(t,r),this.g.attachProtoListener("embeddings_out",(function(t,n){t=Ws(t),e.embeddings=function(e){return{embeddings:Ko(e,Bs,1).map((function(e){var t,n,r={headIndex:null!=(t=ii(oi(e,3),0))?t:-1,headName:null!=(n=si(e,4))?n:""};if(void 0!==Qo(e,_s,Ho(e,1)))e=Uo(e=$o(e,_s,Ho(e,1)),1,Br),r.floatEmbedding=e.slice();else{var o,i,a=new Uint8Array(0);r.quantizedEmbedding=null!=(o=null==(i=$o(e,js,Ho(e,2)))||null==(i=i.qa())?void 0:i.h())?o:a}return r})),timestampMs:ii(Jr(So(e,2)),0)}}(t),kc(e,n)})),this.g.attachEmptyPacketListener("embeddings_out",(function(t){kc(e,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)},at(t,[{key:"baseOptions",get:function(){return $o(this.h,Js,1)},set:function(e){Jo(this.h,0,1,e)}}])}(gl);Wl.cosineSimilarity=function(e,t){if(e.floatEmbedding&&t.floatEmbedding)e=oc(e.floatEmbedding,t.floatEmbedding);else{if(!e.quantizedEmbedding||!t.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");e=oc(rc(e.quantizedEmbedding),rc(t.quantizedEmbedding))}return e},Wl.prototype.embedForVideo=Wl.prototype.Ca,Wl.prototype.embed=Wl.prototype.Ba,Wl.prototype.setOptions=Wl.prototype.o,Wl.createFromModelPath=function(e,t){return ll(Wl,e,{baseOptions:{modelAssetPath:t}})},Wl.createFromModelBuffer=function(e,t){return ll(Wl,e,{baseOptions:{modelAssetBuffer:t}})},Wl.createFromOptions=function(e,t){return ll(Wl,e,t)};var ql=function(){function e(e,t,n){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=n}return e.prototype.close=function(){var e,t;null!=(e=this.confidenceMasks)&&e.forEach((function(e){e.close()})),null==(t=this.categoryMask)||t.close()},e}();function Hl(e){e.categoryMask=void 0,e.confidenceMasks=void 0,e.qualityScores=void 0}function Yl(e){try{var t=new ql(e.confidenceMasks,e.categoryMask,e.qualityScores);if(!e.j)return t;e.j(t)}finally{Tc(e)}}ql.prototype.close=ql.prototype.close;var Zl=function(e){function t(t,n){var r;return(r=e.call(this,new cl(t,n),"image_in","norm_rect",!1)||this).u=[],r.outputCategoryMask=!1,r.outputConfidenceMasks=!0,r.h=new qu,r.v=new zu,Jo(r.h,0,3,r.v),Jo(t=r.h,0,1,n=new Js),r}lt(t,e);var n=t.prototype;return n.o=function(t){var n,r;return void 0!==t.displayNamesLocale?Lo(this.h,2,to(t.displayNamesLocale)):"displayNamesLocale"in t&&Lo(this.h,2),"outputCategoryMask"in t&&(this.outputCategoryMask=null!=(n=t.outputCategoryMask)&&n),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=null==(r=t.outputConfidenceMasks)||r),e.prototype.l.call(this,t)},n.L=function(){!function(e,t,n){var r=Ko(e.fa(),Za,1).filter((function(e){return si(e,1).includes("mediapipe.tasks.TensorsToSegmentationCalculator")}));if(e.u=[],1<r.length)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");1===r.length&&(null!=(t=null==(n=$o(r[0],Ua,7))||null==(n=n.l())?void 0:n.g())?t:new Map).forEach((function(t,n){e.u[Number(n)]=si(t,1)}))}(this)},n.ga=function(e,t,n){var r="function"!=typeof t?t:{};return this.j="function"==typeof t?t:n,Hl(this),pl(this,e,r),Yl(this)},n.Na=function(e,t,n,r){var o="function"!=typeof n?n:{};return this.j="function"==typeof n?n:r,Hl(this),hl(this,e,o,t),Yl(this)},n.Fa=function(){return this.u},n.m=function(){var e=this,t=new rs;ts(t,"image_in"),ts(t,"norm_rect");var n=new Ua;di(n,Hu,this.h);var r=new Za;qa(r,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),Ha(r,"IMAGE:image_in"),Ha(r,"NORM_RECT:norm_rect"),r.o(n),es(t,r),Dc(this,t),this.outputConfidenceMasks&&(ns(t,"confidence_masks"),Ya(r,"CONFIDENCE_MASKS:confidence_masks"),Mc(this,"confidence_masks"),this.g.da("confidence_masks",(function(t,n){e.confidenceMasks=t.map((function(t){return ml(e,t,!0,!e.j)})),kc(e,n)})),this.g.attachEmptyPacketListener("confidence_masks",(function(t){e.confidenceMasks=[],kc(e,t)}))),this.outputCategoryMask&&(ns(t,"category_mask"),Ya(r,"CATEGORY_MASK:category_mask"),Mc(this,"category_mask"),this.g.W("category_mask",(function(t,n){e.categoryMask=ml(e,t,!1,!e.j),kc(e,n)})),this.g.attachEmptyPacketListener("category_mask",(function(t){e.categoryMask=void 0,kc(e,t)}))),ns(t,"quality_scores"),Ya(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(function(t,n){e.qualityScores=t,kc(e,n)})),this.g.attachEmptyPacketListener("quality_scores",(function(t){e.categoryMask=void 0,kc(e,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)},at(t,[{key:"baseOptions",get:function(){return $o(this.h,Js,1)},set:function(e){Jo(this.h,0,1,e)}}])}(gl);Zl.prototype.getLabels=Zl.prototype.Fa,Zl.prototype.segmentForVideo=Zl.prototype.Na,Zl.prototype.segment=Zl.prototype.ga,Zl.prototype.setOptions=Zl.prototype.o,Zl.createFromModelPath=function(e,t){return ll(Zl,e,{baseOptions:{modelAssetPath:t}})},Zl.createFromModelBuffer=function(e,t){return ll(Zl,e,{baseOptions:{modelAssetBuffer:t}})},Zl.createFromOptions=function(e,t){return ll(Zl,e,t)};var Ql=function(){function e(e,t,n){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=n}return e.prototype.close=function(){var e,t;null!=(e=this.confidenceMasks)&&e.forEach((function(e){e.close()})),null==(t=this.categoryMask)||t.close()},e}();Ql.prototype.close=Ql.prototype.close;var $l=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),Xl=[0,sa,-2],Kl=[0,ea,-3,la],Jl=[0,ea,-3,la,ea,-1],ed=[0,Jl],td=[0,ed,Xl],nd=[0,Jl,Xl],rd=[0,Jl,sa,-1],od=[0,rd,Xl],id=[0,ea,-3,la,Xl,-1],ad=[0,ea,-3,la,xa],sd=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),ud=[0,ea,-1,la],cd=function(e){function t(){return e.call(this)||this}return lt(t,e),t}(fi);cd.B=[1];var ld=function(e){function t(t){return e.call(this,t)||this}return lt(t,e),t}(fi),dd=[1,2,3,4,5,6,7,8,9,10,14,15],fd=[0,dd,va,Jl,va,nd,va,ed,va,td,va,ud,va,ad,va,Kl,va,[0,ha,ea,-2,la,sa,la,-1,2,ea,Xl],va,rd,va,od,ea,Xl,ha,va,id,va,[0,Ji,ud]],pd=[0,ha,sa,-1,la],hd=function(e){function t(){return e.call(this)||this}return lt(t,e),t}(fi);hd.B=[1],hd.prototype.g=Da([0,Ji,fd,ha,pd]);var md=function(e){function t(t,n){var r;return(r=e.call(this,new cl(t,n),"image_in","norm_rect_in",!1)||this).outputCategoryMask=!1,r.outputConfidenceMasks=!0,r.h=new qu,r.v=new zu,Jo(r.h,0,3,r.v),Jo(t=r.h,0,1,n=new Js),r}lt(t,e);var n=t.prototype;return n.o=function(t){var n,r;return"outputCategoryMask"in t&&(this.outputCategoryMask=null!=(n=t.outputCategoryMask)&&n),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=null==(r=t.outputConfidenceMasks)||r),e.prototype.l.call(this,t)},n.ga=function(e,t,n,r){var o="function"!=typeof n?n:{};this.j="function"==typeof n?n:r,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,n=this.J+1,r=new hd;var i=new ld,a=new $l;if(ci(a,1,255),Jo(i,0,12,a),t.keypoint&&t.scribble)throw Error("Cannot provide both keypoint and scribble.");if(t.keypoint){var s=new sd;ui(s,3,!0),li(s,1,t.keypoint.x),li(s,2,t.keypoint.y),ei(i,5,dd,s)}else{if(!t.scribble)throw Error("Must provide either a keypoint or a scribble.");for(var u,c=xt((a=new cd,t.scribble));!(u=c()).done;)s=u.value,ui(t=new sd,3,!0),li(t,1,s.x),li(t,2,s.y),ri(a,1,sd,t);ei(i,15,dd,a)}ri(r,1,ld,i),this.g.addProtoToStream(r.g(),"drishti.RenderData","roi_in",n),pl(this,e,o);e:{try{var l=new Ql(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var d=l;break e}this.j(l)}finally{Tc(this)}d=void 0}return d},n.m=function(){var e=this,t=new rs;ts(t,"image_in"),ts(t,"roi_in"),ts(t,"norm_rect_in");var n=new Ua;di(n,Hu,this.h);var r=new Za;qa(r,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"),Ha(r,"IMAGE:image_in"),Ha(r,"ROI:roi_in"),Ha(r,"NORM_RECT:norm_rect_in"),r.o(n),es(t,r),Dc(this,t),this.outputConfidenceMasks&&(ns(t,"confidence_masks"),Ya(r,"CONFIDENCE_MASKS:confidence_masks"),Mc(this,"confidence_masks"),this.g.da("confidence_masks",(function(t,n){e.confidenceMasks=t.map((function(t){return ml(e,t,!0,!e.j)})),kc(e,n)})),this.g.attachEmptyPacketListener("confidence_masks",(function(t){e.confidenceMasks=[],kc(e,t)}))),this.outputCategoryMask&&(ns(t,"category_mask"),Ya(r,"CATEGORY_MASK:category_mask"),Mc(this,"category_mask"),this.g.W("category_mask",(function(t,n){e.categoryMask=ml(e,t,!1,!e.j),kc(e,n)})),this.g.attachEmptyPacketListener("category_mask",(function(t){e.categoryMask=void 0,kc(e,t)}))),ns(t,"quality_scores"),Ya(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(function(t,n){e.qualityScores=t,kc(e,n)})),this.g.attachEmptyPacketListener("quality_scores",(function(t){e.categoryMask=void 0,kc(e,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)},at(t,[{key:"baseOptions",get:function(){return $o(this.h,Js,1)},set:function(e){Jo(this.h,0,1,e)}}])}(gl);md.prototype.segment=md.prototype.ga,md.prototype.setOptions=md.prototype.o,md.createFromModelPath=function(e,t){return ll(md,e,{baseOptions:{modelAssetPath:t}})},md.createFromModelBuffer=function(e,t){return ll(md,e,{baseOptions:{modelAssetBuffer:t}})},md.createFromOptions=function(e,t){return ll(md,e,t)};var gd=function(e){function t(t,n){var r;return(r=e.call(this,new cl(t,n),"input_frame_gpu","norm_rect",!1)||this).j={detections:[]},Jo(t=r.h=new Yu,0,1,n=new Js),r}lt(t,e);var n=t.prototype;return n.o=function(e){return void 0!==e.displayNamesLocale?Lo(this.h,2,to(e.displayNamesLocale)):"displayNamesLocale"in e&&Lo(this.h,2),void 0!==e.maxResults?ci(this.h,3,e.maxResults):"maxResults"in e&&Lo(this.h,3),void 0!==e.scoreThreshold?li(this.h,4,e.scoreThreshold):"scoreThreshold"in e&&Lo(this.h,4),void 0!==e.categoryAllowlist?Go(this.h,5,e.categoryAllowlist):"categoryAllowlist"in e&&Lo(this.h,5),void 0!==e.categoryDenylist?Go(this.h,6,e.categoryDenylist):"categoryDenylist"in e&&Lo(this.h,6),this.l(e)},n.F=function(e,t){return this.j={detections:[]},pl(this,e,t),this.j},n.G=function(e,t,n){return this.j={detections:[]},hl(this,e,n,t),this.j},n.m=function(){var e=this,t=new rs;ts(t,"input_frame_gpu"),ts(t,"norm_rect"),ns(t,"detections");var n=new Ua;di(n,Zu,this.h);var r=new Za;qa(r,"mediapipe.tasks.vision.ObjectDetectorGraph"),Ha(r,"IMAGE:input_frame_gpu"),Ha(r,"NORM_RECT:norm_rect"),Ya(r,"DETECTIONS:detections"),r.o(n),es(t,r),this.g.attachProtoVectorListener("detections",(function(t,n){for(var r,o=xt(t);!(r=o()).done;){t=ws(r.value),e.j.detections.push(ec(t))}kc(e,n)})),this.g.attachEmptyPacketListener("detections",(function(t){kc(e,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)},at(t,[{key:"baseOptions",get:function(){return $o(this.h,Js,1)},set:function(e){Jo(this.h,0,1,e)}}])}(gl);gd.prototype.detectForVideo=gd.prototype.G,gd.prototype.detect=gd.prototype.F,gd.prototype.setOptions=gd.prototype.o,gd.createFromModelPath=function(){var e=ut(bt.mark((function e(t,n){return bt.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",ll(gd,t,{baseOptions:{modelAssetPath:n}}));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),gd.createFromModelBuffer=function(e,t){return ll(gd,e,{baseOptions:{modelAssetBuffer:t}})},gd.createFromOptions=function(e,t){return ll(gd,e,t)};var vd=function(){function e(e,t,n){this.landmarks=e,this.worldLandmarks=t,this.segmentationMasks=n}return e.prototype.close=function(){var e;null==(e=this.segmentationMasks)||e.forEach((function(e){e.close()}))},e}();function yd(e){e.landmarks=[],e.worldLandmarks=[],e.segmentationMasks=void 0}function bd(e){try{var t=new vd(e.landmarks,e.worldLandmarks,e.segmentationMasks);if(!e.j)return t;e.j(t)}finally{Tc(e)}}vd.prototype.close=vd.prototype.close;var xd=function(e){function t(t,n){var r;return(r=e.call(this,new cl(t,n),"image_in","norm_rect",!1)||this).landmarks=[],r.worldLandmarks=[],r.outputSegmentationMasks=!1,Jo(t=r.h=new $u,0,1,n=new Js),r.D=new Ru,Jo(r.h,0,3,r.D),r.v=new Lu,Jo(r.h,0,2,r.v),ci(r.v,4,1),li(r.v,2,.5),li(r.D,2,.5),li(r.h,4,.5),r}lt(t,e);var n=t.prototype;return n.o=function(e){var t,n,r,o,i;return"numPoses"in e&&ci(this.v,4,null!=(t=e.numPoses)?t:1),"minPoseDetectionConfidence"in e&&li(this.v,2,null!=(n=e.minPoseDetectionConfidence)?n:.5),"minTrackingConfidence"in e&&li(this.h,4,null!=(r=e.minTrackingConfidence)?r:.5),"minPosePresenceConfidence"in e&&li(this.D,2,null!=(o=e.minPosePresenceConfidence)?o:.5),"outputSegmentationMasks"in e&&(this.outputSegmentationMasks=null!=(i=e.outputSegmentationMasks)&&i),this.l(e)},n.F=function(e,t,n){var r="function"!=typeof t?t:{};return this.j="function"==typeof t?t:n,yd(this),pl(this,e,r),bd(this)},n.G=function(e,t,n,r){var o="function"!=typeof n?n:{};return this.j="function"==typeof n?n:r,yd(this),hl(this,e,o,t),bd(this)},n.m=function(){var e=this,t=new rs;ts(t,"image_in"),ts(t,"norm_rect"),ns(t,"normalized_landmarks"),ns(t,"world_landmarks"),ns(t,"segmentation_masks");var n=new Ua;di(n,Xu,this.h);var r=new Za;qa(r,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),Ha(r,"IMAGE:image_in"),Ha(r,"NORM_RECT:norm_rect"),Ya(r,"NORM_LANDMARKS:normalized_landmarks"),Ya(r,"WORLD_LANDMARKS:world_landmarks"),r.o(n),es(t,r),Dc(this,t),this.g.attachProtoVectorListener("normalized_landmarks",(function(t,n){e.landmarks=[];for(var r,o=xt(t);!(r=o()).done;){t=Ns(r.value),e.landmarks.push(tc(t))}kc(e,n)})),this.g.attachEmptyPacketListener("normalized_landmarks",(function(t){e.landmarks=[],kc(e,t)})),this.g.attachProtoVectorListener("world_landmarks",(function(t,n){e.worldLandmarks=[];for(var r,o=xt(t);!(r=o()).done;){t=Ms(r.value),e.worldLandmarks.push(nc(t))}kc(e,n)})),this.g.attachEmptyPacketListener("world_landmarks",(function(t){e.worldLandmarks=[],kc(e,t)})),this.outputSegmentationMasks&&(Ya(r,"SEGMENTATION_MASK:segmentation_masks"),Mc(this,"segmentation_masks"),this.g.da("segmentation_masks",(function(t,n){e.segmentationMasks=t.map((function(t){return ml(e,t,!0,!e.j)})),kc(e,n)})),this.g.attachEmptyPacketListener("segmentation_masks",(function(t){e.segmentationMasks=[],kc(e,t)}))),t=t.g(),this.setGraph(new Uint8Array(t),!0)},at(t,[{key:"baseOptions",get:function(){return $o(this.h,Js,1)},set:function(e){Jo(this.h,0,1,e)}}])}(gl);xd.prototype.detectForVideo=xd.prototype.G,xd.prototype.detect=xd.prototype.F,xd.prototype.setOptions=xd.prototype.o,xd.createFromModelPath=function(e,t){return ll(xd,e,{baseOptions:{modelAssetPath:t}})},xd.createFromModelBuffer=function(e,t){return ll(xd,e,{baseOptions:{modelAssetBuffer:t}})},xd.createFromOptions=function(e,t){return ll(xd,e,t)},xd.POSE_CONNECTIONS=_l;var Cd="https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.7/wasm",wd=!1;function Ed(){return h(this,void 0,void 0,(function(){function e(e){e.detail.url===t&&(Hd.visionRuntime=tf([t]),document.dispatchEvent(new CustomEvent("idmission.preloadProgress.visionRuntime",{detail:Hd.visionRuntime})))}var t;return m(this,(function(n){switch(n.label){case 0:if(wd)return[2,new Promise((function(e){setInterval((function(){wd||e()}),100)}))];wd=!0,t="".concat(Cd,"/vision_wasm_internal.wasm"),document.addEventListener("idmission.preloadProgress",e),n.label=1;case 1:return n.trys.push([1,,3,4]),[4,Yd(t)];case 2:return n.sent(),[3,4];case 3:return document.removeEventListener("idmission.preloadProgress",e),wd=!1,[7];case 4:return[2]}}))}))}function kd(e,t,n,r,o,i,a){if(void 0===i&&(i=.92),!e||!t||!n)return"";var s=e.getContext("2d"),u=t.getContext("2d"),c=n.getContext("2d");if(!s||!u||!c)throw new Error("could not get 2d context");e.width=r.width,e.height=r.height,s.putImageData(r,0,0);var l=o.box,d=l.width,f=.6*r.height-d,p=Math.max(0,l.xMin-f/2);r.height>r.width?(t.width=r.width,t.height=r.height,u.drawImage(e,0,0,t.width,t.height)):(t.width=d+f,t.height=r.height,u.drawImage(e,p,0,t.width,t.height,0,0,t.width,t.height)),n.height=null!=a?a:t.height,n.width=t.width*(n.height/t.height),null==c||c.drawImage(t,0,0,n.width,n.height);var h=n.toDataURL("image/jpeg",i);return Oe("cropToShoulders size",(new TextEncoder).encode(h).length),qe(e),qe(t),qe(n),h}function Dd(e,t,n){n||(n=document.createElement("canvas"));var r=n.getContext("2d");if(!r)throw new Error("could not get 2d context");var o=t.xMin,i=t.yMin,a=t.width,s=t.height;return n.width=a,n.height=s,r.drawImage(e,o,i,a,s,0,0,a,s),n}var Md="https://websdk-cdn-dev.idmission.com/assets/models/selfiesegmenter20240524/selfie_segmenter.tflite",Td=256440.32,Id=(new Date).getTime(),Sd=f({},{probeState:"notProbed",delegate:"GPU",networkTier:"untested",networkSpeed:0,networkTestTime:0});function Nd(){return h(this,void 0,void 0,(function(){return m(this,(function(e){switch(e.label){case 0:return"probed"===Sd.probeState?[2]:"probing"===Sd.probeState?[2,new Promise((function(e){setInterval((function(){"probed"===Sd.probeState&&e()}),100)}))]:(Sd.probeState="probing",[4,Ed()]);case 1:e.sent(),e.label=2;case 2:return e.trys.push([2,4,9,10]),Oe("Model Probing: testing GPU capabilities..."),[4,Ad("GPU")];case 3:return e.sent(),Oe("Model Probing: GPU is capable."),[3,10];case 4:Re("Model Probing: GPU delegate could not be loaded",e.sent()),Sd.delegate="CPU",e.label=5;case 5:return e.trys.push([5,7,,8]),Oe("Model Probing: testing CPU capabilities..."),[4,Ad("CPU")];case 6:return e.sent(),Oe("Model Probing: CPU is capable."),[3,8];case 7:return Re("Model Probing: CPU delegate could not be loaded",e.sent()),Sd.delegate="NONE",[3,8];case 8:return[3,10];case 9:return Sd.probeState="probed",[7];case 10:return[2]}}))}))}function Ad(){return h(this,arguments,void 0,(function(e,t){var n,r,o,i,a,s,u;return void 0===e&&(e="GPU"),void 0===t&&(t=1e4),m(this,(function(c){switch(c.label){case 0:n="".concat(Md,"?_=").concat(Id),r=new Date,c.label=1;case 1:return c.trys.push([1,3,,4]),[4,Promise.race([Yd(n),Ld(t)])];case 2:return c.sent(),[3,4];case 3:return Fe("speed test failed",c.sent()),Sd.networkTier="unusable",[2];case 4:return o=((new Date).getTime()-r.getTime())/1e3,Sd.networkTestTime||(Sd.networkTestTime=o),Sd.networkSpeed||(Sd.networkSpeed=Td/o),Sd.networkTier=o<.5?"fast":o<2?"medium":"slow",Oe("Model Probing: network speed",(Sd.networkSpeed/1024/1024).toFixed(3),"Mbps"),Oe("Model Probing: network test took",o),Oe("Model Probing: network tier",Sd.networkTier),s=(a=Zl).createFromOptions,[4,lc.forVisionTasks(Cd)];case 5:return[4,s.apply(a,[c.sent(),{baseOptions:{modelAssetPath:n,delegate:e}}])];case 6:return i=c.sent(),u=document.createElement("canvas"),i.segment(u),u.remove(),[2]}}))}))}function Ld(e){return new Promise((function(t,n){setTimeout((function(){n(new Error("gave up after reaching maximum time allowed"))}),e)}))}function Od(e){var t,n,r,o,i,a,s,u;return{xMin:null!==(t=null==e?void 0:e.originX)&&void 0!==t?t:0,xMax:(null!==(n=null==e?void 0:e.originX)&&void 0!==n?n:0)+(null!==(r=null==e?void 0:e.width)&&void 0!==r?r:0),yMin:null!==(o=null==e?void 0:e.originY)&&void 0!==o?o:0,yMax:(null!==(i=null==e?void 0:e.originY)&&void 0!==i?i:0)+(null!==(a=null==e?void 0:e.height)&&void 0!==a?a:0),width:null!==(s=null==e?void 0:e.width)&&void 0!==s?s:0,height:null!==(u=null==e?void 0:e.height)&&void 0!==u?u:0}}function Rd(e,t){return void 0===t&&(t=100),new Promise((function(n){var r,o;if((null!==(o=null===(r=e.current)||void 0===r?void 0:r.readyState)&&void 0!==o?o:0)>=2)return n();var i=setInterval((function(){var t,r;(null!==(r=null===(t=e.current)||void 0===t?void 0:t.readyState)&&void 0!==r?r:0)>=2&&(clearInterval(i),n())}),t)}))}var Fd="https://websdk-cdn-dev.idmission.com/assets/models/focusmp20240619/model_fp16.tflite",Pd=45e3,Ud={};function _d(e){var n=e.modelPath,r=void 0===n?Fd:n,o=e.modelLoadTimeoutMs,i=void 0===o?Pd:o,a=e.onModelError,s=t.useRef(null),u=t.useState(!1),c=u[0],l=u[1],d=t.useState(0),f=d[0],p=d[1],g=t.useState(null),v=g[0],y=g[1],b=t.useContext(nt).videoRef;return t.useEffect((function(){var e=this;function t(e){p(ef(e.detail))}l(!1),document.addEventListener("idmission.preloadProgress.focus",t);var n=setTimeout((function(){y(new Error("Model loading time limit exceeded."))}),i);return function(e){return h(this,void 0,void 0,(function(){var t,n,r,o,i;return m(this,(function(a){switch(a.label){case 0:return t="".concat(e),Ud[t]?[2,Ud[t]]:[4,Kd()];case 1:if(a.sent(),"NONE"===Sd.delegate)throw new Error("No available delegate for focus detector.");return n=Ud,r=t,i=(o=Vl).createFromOptions,[4,lc.forVisionTasks(Cd)];case 2:return[4,i.apply(o,[a.sent(),{baseOptions:{modelAssetPath:e,delegate:Sd.delegate},runningMode:"VIDEO"}])];case 3:return n[r]=a.sent(),[2,Ud[t]]}}))}))}(r).then((function(t){return h(e,void 0,void 0,(function(){return m(this,(function(e){switch(e.label){case 0:return s.current=t,p(100),clearTimeout(n),[4,Rd(b)];case 1:return e.sent(),t.classifyForVideo(b.current,performance.now()),l(!0),[2]}}))}))})).catch((function(e){y(e)})).finally((function(){clearTimeout(n)})),function(){clearTimeout(n),document.removeEventListener("idmission.preloadProgress.focus",t)}}),[r,i,b]),t.useEffect((function(){v&&(null==a||a(v))}),[v,a]),{model:s,ready:c,modelDownloadProgress:f,modelError:v}}function jd(e,t,n,r,o){var i,a,s,u,c,l=new Date,d=function(e,t,n,r){if(!r)return e;var o=Dd(e,r,t),i=[r.width,r.height],a=i[0],s=i[1];if(s<=a)return o;var u=n.getContext("2d");return u?(n.width=s,n.height=a,u.clearRect(0,0,n.width,n.height),u.translate(n.width/2,n.height/2),u.rotate(1.5708),u.drawImage(o,-a/2,-s/2),n):o}(t,n,r,o),f=e.classifyForVideo(d,performance.now()),p=null!==(c=null===(u=null===(s=null===(a=null===(i=null==f?void 0:f.classifications)||void 0===i?void 0:i[0])||void 0===a?void 0:a.categories)||void 0===s?void 0:s.find((function(e){return"focused"===e.categoryName})))||void 0===u?void 0:u.score)&&void 0!==c?c:0;return{score:p,predictionTime:(new Date).getTime()-l.getTime()}}(function(){var e;function t(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var n="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e};var r=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof V&&V];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var o=r;e=e.split(".");for(var i=0;i<e.length-1;i++){var a=e[i];if(!(a in o))break e;o=o[a]}(t=t(i=o[e=e[e.length-1]]))!=i&&null!=t&&n(o,e,{configurable:!0,writable:!0,value:t})}}function i(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function a(e){var n="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];return n?n.call(e):{next:t(e)}}function s(e){if(!(e instanceof Array)){e=a(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}o("Symbol",(function(e){function t(e,t){this.g=e,n(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var r="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",o=0;return function e(n){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(r+(n||"")+"_"+o++,n)}})),o("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var o="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),a=0;a<o.length;a++){var s=r[o[a]];"function"==typeof s&&"function"!=typeof s.prototype[e]&&n(s.prototype,e,{configurable:!0,writable:!0,value:function(){return i(t(this))}})}return e}));var u,c="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)u=Object.setPrototypeOf;else{var l;e:{var d={};try{d.__proto__={a:!0},l=d.a;break e}catch(e){}l=!1}u=l?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var f=u;function p(e,t){if(e.prototype=c(t.prototype),e.prototype.constructor=e,f)f(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n];e.na=t.prototype}function h(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.u=this.o=0,this.j=null}function m(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function g(e,t){e.j={da:t,ea:!0},e.g=e.o||e.u}function v(e,t,n){return e.g=n,{value:t}}function y(e){this.g=new h,this.h=e}function b(e,t,n,r){try{var o=t.call(e.g.i,n);if(!(o instanceof Object))throw new TypeError("Iterator result "+o+" is not an object");if(!o.done)return e.g.l=!1,o;var i=o.value}catch(t){return e.g.i=null,g(e.g,t),x(e)}return e.g.i=null,r.call(e.g,i),x(e)}function x(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,g(e.g,t)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.ea)throw t.da;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function C(e){this.next=function(t){return m(e.g),e.g.i?t=b(e,e.g.i.next,t,e.g.s):(e.g.s(t),t=x(e)),t},this.throw=function(t){return m(e.g),e.g.i?t=b(e,e.g.i.throw,t,e.g.s):(g(e.g,t),t=x(e)),t},this.return=function(t){return function(e,t){m(e.g);var n=e.g.i;return n?b(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),x(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function w(e){return function(e){function t(t){return e.next(t)}function n(t){return e.throw(t)}return new Promise((function(r,o){!function e(i){i.done?r(i.value):Promise.resolve(i.value).then(t,n).then(e,o)}(e.next())}))}(new C(new y(e)))}h.prototype.s=function(e){this.h=e},h.prototype.return=function(e){this.j={return:e},this.g=this.u},o("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.s=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function o(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var i=r.setTimeout;n.prototype.i=function(e){i(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.D),reject:e(this.l)}},t.prototype.D=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.H(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.A(e):this.o(e)}},t.prototype.A=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.I(t,e):this.o(e)},t.prototype.l=function(e){this.u(2,e)},t.prototype.o=function(e){this.u(1,e)},t.prototype.u=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.G(),this.B()},t.prototype.G=function(){var e=this;i((function(){if(e.C()){var t=r.console;void 0!==t&&t.error(e.i)}}),1)},t.prototype.C=function(){if(this.s)return!1;var e=r.CustomEvent,t=r.Event,n=r.dispatchEvent;return void 0===n||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=r.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.B=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)s.h(this.g[e]);this.g=null}};var s=new n;return t.prototype.H=function(e){var t=this.j();e.M(t.resolve,t.reject)},t.prototype.I=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function r(e,t){return"function"==typeof e?function(t){try{o(e(t))}catch(e){i(e)}}:t}var o,i,a=new t((function(e,t){o=e,i=t}));return this.M(r(e,o),r(n,i)),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.M=function(e,t){function n(){switch(r.h){case 1:e(r.i);break;case 2:t(r.i);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?s.h(n):this.g.push(n),this.s=!0},t.resolve=o,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var r=a(e),i=r.next();!i.done;i=r.next())o(i.value).M(t,n)}))},t.all=function(e){var n=a(e),r=n.next();return r.done?o([]):new t((function(e,t){function i(t){return function(n){a[t]=n,0==--s&&e(a)}}var a=[],s=0;do{a.push(void 0),s++,o(r.value).M(i(a.length-1),t),r=n.next()}while(!r.done)}))},t}));var E="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e};o("Object.assign",(function(e){return e||E})),o("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),o("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var r=n.length;for(0>(t=t||0)&&(t=Math.max(t+r,0));t<r;t++){var o=n[t];if(o===e||Object.is(o,e))return!0}return!1}})),o("String.prototype.includes",(function(e){return e||function(e,t){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(e,t||0)}})),o("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,r=!1,o={next:function(){if(!r&&n<e.length){var o=n++;return{value:t(o,e[o]),done:!1}}return r=!0,{done:!0,value:void 0}}};return o[Symbol.iterator]=function(){return o},o}(this,(function(e){return e}))}}));var k=this||self;function D(e,t){e=e.split(".");var n,r=k;e[0]in r||void 0===r.execScript||r.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}function M(){throw Error("Invalid UTF8")}function T(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var I,S,N="undefined"!=typeof TextDecoder,A="undefined"!=typeof TextEncoder,L={},O=null;function R(e){var t;void 0===t&&(t=0),P(),t=L[t];for(var n=Array(Math.floor(e.length/3)),r=t[64]||"",o=0,i=0;o<e.length-2;o+=3){var a=e[o],s=e[o+1],u=e[o+2],c=t[a>>2];n[i++]=c+(a=t[(3&a)<<4|s>>4])+(s=t[(15&s)<<2|u>>6])+(u=t[63&u])}switch(c=0,u=r,e.length-o){case 2:u=t[(15&(c=e[o+1]))<<2]||r;case 1:n[i]=t[(e=e[o])>>2]+t[(3&e)<<4|c>>4]+u+r}return n.join("")}function F(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var r=new Uint8Array(n),o=0;return function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),o=O[n];if(null!=o)return o;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}P();for(var r=0;;){var o=n(-1),i=n(0),a=n(64),s=n(64);if(64===s&&-1===o)break;t(o<<2|i>>4),64!=a&&(t(i<<4&240|a>>2),64!=s&&t(a<<6&192|s))}}(e,(function(e){r[o++]=e})),o!==n?r.subarray(0,o):r}function P(){if(!O){O={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));L[n]=r;for(var o=0;o<r.length;o++){var i=r[o];void 0===O[i]&&(O[i]=o)}}}}var U,_="function"==typeof Uint8Array;function j(e){return _&&null!=e&&e instanceof Uint8Array}function B(e){if(this.L=e,null!==e&&0===e.length)throw Error("ByteString should be constructed with non-empty values")}var z="function"==typeof Uint8Array.prototype.slice,G=0;function W(e,t){return Error("Invalid wire type: "+e+" (at position "+t+")")}function q(){return Error("Failed to read varint, encoding is invalid.")}function H(e,t){t=void 0!==(t=void 0===t?{}:t).v&&t.v,this.h=null,this.g=this.i=this.j=0,this.v=t,e&&Y(this,e)}function Y(e,t){e.h=function(e,t){if(e.constructor===Uint8Array)return e;if(e.constructor===ArrayBuffer)return new Uint8Array(e);if(e.constructor===Array)return new Uint8Array(e);if(e.constructor===String)return F(e);if(e.constructor===B)return!t&&(t=e.L)&&t.constructor===Uint8Array?t:(t=null==(t=e.L)||j(t)?t:"string"==typeof t?F(t):null,(e=e.L=t)?new Uint8Array(e):U||(U=new Uint8Array(0)));if(e instanceof Uint8Array)return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, or Array of numbers")}(t,e.v),e.j=0,e.i=e.h.length,e.g=e.j}function Z(e){if(e.g>e.i)throw Error("Tried to read past the end of the data "+e.g+" > "+e.i)}function Q(e){var t=e.h,n=t[e.g],r=127&n;if(128>n)return e.g+=1,Z(e),r;if(r|=(127&(n=t[e.g+1]))<<7,128>n)return e.g+=2,Z(e),r;if(r|=(127&(n=t[e.g+2]))<<14,128>n)return e.g+=3,Z(e),r;if(r|=(127&(n=t[e.g+3]))<<21,128>n)return e.g+=4,Z(e),r;if(n=t[e.g+4],e.g+=5,r|=(15&n)<<28,128>n)return Z(e),r;if(128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++])throw q();return Z(e),r}H.prototype.reset=function(){this.g=this.j};var $=[];function X(){this.g=[]}function K(e,t){for(;127<t;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function J(e){var t={},n=void 0!==t.W&&t.W;this.l={v:void 0!==t.v&&t.v},this.W=n,t=this.l,$.length?(n=$.pop(),t&&(n.v=t.v),e&&Y(n,e),e=n):e=new H(e,t),this.g=e,this.j=this.g.g,this.h=this.i=-1}function ee(e){var t=e.g;if(t.g==t.i)return!1;e.j=e.g.g;var n=Q(e.g)>>>0;if(t=n>>>3,!(0<=(n&=7)&&5>=n))throw W(n,e.j);if(1>t)throw Error("Invalid field number: "+t+" (at position "+e.j+")");return e.i=t,e.h=n,!0}function te(e){switch(e.h){case 0:if(0!=e.h)te(e);else e:{for(var t=(e=e.g).g,n=t+10;t<n;)if(!(128&e.h[t++])){e.g=t,Z(e);break e}throw q()}break;case 1:(e=e.g).g+=8,Z(e);break;case 2:2!=e.h?te(e):(t=Q(e.g)>>>0,(e=e.g).g+=t,Z(e));break;case 5:(e=e.g).g+=4,Z(e);break;case 3:for(t=e.i;;){if(!ee(e))throw Error("Unmatched start-group tag: stream EOF");if(4==e.h){if(e.i!=t)throw Error("Unmatched end-group tag");break}te(e)}break;default:throw W(e.h,e.j)}}X.prototype.length=function(){return this.g.length},X.prototype.end=function(){var e=this.g;return this.g=[],e},J.prototype.reset=function(){this.g.reset(),this.j=this.g.g,this.h=this.i=-1};var ne=[];function re(){this.i=[],this.h=0,this.g=new X}function oe(e,t){0!==t.length&&(e.i.push(t),e.h+=t.length)}var ie="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol(void 0):void 0;function ae(e,t){Object.isFrozen(e)||(ie?e[ie]|=t:void 0!==e.N?e.N|=t:Object.defineProperties(e,{N:{value:t,configurable:!0,writable:!0,enumerable:!1}}))}function se(e){var t;return null==(t=ie?e[ie]:e.N)?0:t}function ue(e){return ae(e,1),e}function ce(e){return!!Array.isArray(e)&&!!(2&se(e))}function le(e){if(!Array.isArray(e))throw Error("cannot mark non-array as immutable");ae(e,2)}function de(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&e.constructor===Object}var fe=Object.freeze(ue([]));function pe(e){if(ce(e.m))throw Error("Cannot mutate an immutable Message")}var he,me="undefined"!=typeof Symbol&&void 0!==Symbol.hasInstance;function ge(e){return{value:e,configurable:!1,writable:!1,enumerable:!1}}function ve(e,t,n){return-1===t?null:t>=e.i?e.g?e.g[t]:void 0:void 0!==n&&n&&e.g&&null!=(n=e.g[t])?n:e.m[t+e.h]}function ye(e,t,n,r){r=void 0!==r&&r,pe(e),t<e.i&&!r?e.m[t+e.h]=n:(e.g||(e.g=e.m[e.i+e.h]={}))[t]=n}function be(e,t,n,r){n=void 0===n||n;var o=ve(e,t,r=void 0!==r&&r);return null==o&&(o=fe),ce(e.m)?n&&(le(o),Object.freeze(o)):(o===fe||ce(o))&&ye(e,t,o=ue(o.slice()),r),o}function xe(e,t,n){return null==(e=null==(e=ve(e,t))?e:+e)?void 0===n?0:n:e}function Ce(e,t,n,r){e.j||(e.j={});var o=ce(e.m),i=e.j[n];if(!i){r=be(e,n,!0,void 0!==r&&r),i=[],o=o||ce(r);for(var a=0;a<r.length;a++)i[a]=new t(r[a]),o&&le(i[a].m);o&&(le(i),Object.freeze(i)),e.j[n]=i}return i}function we(e,t,n,r,o){var i=void 0!==i&&i;return pe(e),i=Ce(e,n,t,i),n=r||new n,e=be(e,t),null!=o?(i.splice(o,0,n),e.splice(o,0,n.m)):(i.push(n),e.push(n.m)),n}function Ee(e,t){return null==(e=ve(e,t))?0:e}function ke(e,t){return null==(e=ve(e,t))?"":e}function De(e){var t=Ie;return Te(e,t=void 0===t?Se:t)}function Me(e,t){if(null!=e){if(Array.isArray(e))e=Te(e,t);else if(de(e)){var n,r={};for(n in e)r[n]=Me(e[n],t);e=r}else e=t(e);return e}}function Te(e,t){for(var n=e.slice(),r=0;r<n.length;r++)n[r]=Me(n[r],t);return Array.isArray(e)&&1&se(e)&&ue(n),n}function Ie(e){return e&&"object"==typeof e&&e.toJSON?e.toJSON():(e=function(e){switch(typeof e){case"number":return isFinite(e)?e:String(e);case"object":if(e&&!Array.isArray(e)){if(j(e))return R(e);if(e instanceof B){var t=e.L;return t=null==t||"string"==typeof t?t:_&&t instanceof Uint8Array?R(t):null,(e.L=t)||""}}}return e}(e),Array.isArray(e)?De(e):e)}function Se(e){return j(e)?new Uint8Array(e):e}function Ne(e,t,n){e||(e=he),he=null;var r=this.constructor.h;if(e||(e=r?[r]:[]),this.h=(r?0:-1)-(this.constructor.g||0),this.j=void 0,this.m=e,e=(r=this.m.length)-1,r&&de(r=this.m[e])?(this.i=e-this.h,this.g=r):void 0!==t&&-1<t?(this.i=Math.max(t,e+1-this.h),this.g=void 0):this.i=Number.MAX_VALUE,n)for(t=0;t<n.length;t++)if((e=n[t])<this.i)(r=this.m[e+=this.h])?Array.isArray(r)&&ue(r):this.m[e]=fe;else{var o=(r=this.g||(this.g=this.m[this.i+this.h]={}))[e];o?Array.isArray(o)&&ue(o):r[e]=fe}}function Ae(){Ne.apply(this,arguments)}if(Ne.prototype.toJSON=function(){return De(this.m)},Ne.prototype.toString=function(){return this.m.toString()},p(Ae,Ne),me){var Le={};Object.defineProperties(Ae,(Le[Symbol.hasInstance]=ge((function(){throw Error("Cannot perform instanceof checks for MutableMessage")})),Le))}function Oe(e,t,n){if(n){var r,o={};for(r in n){var i=n[r],a=i.ha;a||(o.F=i.la||i.fa.P,i.aa?(o.U=Be(i.aa),a=function(e){return function(t,n,r){return e.F(t,n,r,e.U)}}(o)):i.ca?(o.T=ze(i.X.g,i.ca),a=function(e){return function(t,n,r){return e.F(t,n,r,e.T)}}(o)):a=o.F,i.ha=a),a(t,e,i.X),o={F:o.F,U:o.U,T:o.T}}}!function(e,t){if(t=t.ba){oe(e,e.g.end());for(var n=0;n<t.length;n++)oe(e,t[n])}}(t,e)}var Re=Symbol();function Fe(e,t,n){return e[Re]||(e[Re]=function(e,r){return t(e,r,n)})}function Pe(e){var t=e[Re];if(!t){var n=Je(e);t=function(e,t){return et(e,t,n)},e[Re]=t}return t}function Ue(e){var t=function(e){var t=e.aa;return t?Pe(t):(t=e.ka)?Fe(e.X.g,t,e.ca):void 0}(e),n=e.X,r=e.fa.O;return t?function(e,o){return r(e,o,n,t)}:function(e,t){return r(e,t,n)}}function _e(e,t,n,r,o,i){var a=0;for((e=e()).length&&"number"!=typeof e[0]&&(n(t,e[0]),a++);a<e.length;){n=e[a++];for(var s=a+1;s<e.length&&"number"!=typeof e[s];)s++;var u=e[a++];switch(s-=a){case 0:r(t,n,u);break;case 1:r(t,n,u,e[a++]);break;case 2:o(t,n,u,e[a++],e[a++]);break;case 3:s=e[a++];var c=e[a++],l=e[a++];Array.isArray(l)?o(t,n,u,s,c,l):i(t,n,u,s,c,l);break;case 4:i(t,n,u,e[a++],e[a++],e[a++],e[a++]);break;default:throw Error("unexpected number of binary field arguments: "+s)}}return t}var je=Symbol();function Be(e){var t=e[je];if(!t){var n=Ye(e);t=function(e,t){return nt(e,t,n)},e[je]=t}return t}function ze(e,t){var n=e[je];return n||(n=function(e,n){return Oe(e,n,t)},e[je]=n),n}var Ge=Symbol();function Ve(e,t){e.push(t)}function We(e,t,n){e.push(t,n.P)}function qe(e,t,n,r,o){var i=Be(o),a=n.P;e.push(t,(function(e,t,n){return a(e,t,n,r,i)}))}function He(e,t,n,r,o,i){var a=ze(r,i),s=n.P;e.push(t,(function(e,t,n){return s(e,t,n,r,a)}))}function Ye(e){var t=e[Ge];return t||_e(e,e[Ge]=[],Ve,We,qe,He)}var Ze=Symbol();function Qe(e,t){e[0]=t}function $e(e,t,n,r){var o=n.O;e[t]=r?function(e,t,n){return o(e,t,n,r)}:o}function Xe(e,t,n,r,o,i){var a=n.O,s=Pe(o);e[t]=function(e,t,n){return a(e,t,n,r,s,i)}}function Ke(e,t,n,r,o,i,a){var s=n.O,u=Fe(r,o,i);e[t]=function(e,t,n){return s(e,t,n,r,u,a)}}function Je(e){var t=e[Ze];return t||_e(e,e[Ze]={},Qe,$e,Xe,Ke)}function et(e,t,n){for(;ee(t)&&4!=t.h;){var r=t.i,o=n[r];if(!o){var i=n[0];i&&(i=i[r])&&(o=n[r]=Ue(i))}if(!(o&&o(t,e,r)||(o=t,r=e,i=o.j,te(o),o.W))){var a=o.g.h;o=i===(o=o.g.g)?U||(U=new Uint8Array(0)):z?a.slice(i,o):new Uint8Array(a.subarray(i,o)),(i=r.ba)?i.push(o):r.ba=[o]}}return e}function tt(e,t,n){if(ne.length){var r=ne.pop();e&&(Y(r.g,e),r.i=-1,r.h=-1),e=r}else e=new J(e);try{return et(new t,e,Je(n))}finally{(t=e.g).h=null,t.j=0,t.i=0,t.g=0,t.v=!1,e.i=-1,e.h=-1,100>ne.length&&ne.push(e)}}function nt(e,t,n){for(var r=n.length,o=1==r%2,i=o?1:0;i<r;i+=2)(0,n[i+1])(t,e,n[i]);Oe(e,t,o?n[0]:void 0)}function rt(e,t){var n=new re;nt(e,n,Ye(t)),oe(n,n.g.end()),e=new Uint8Array(n.h);for(var r=(t=n.i).length,o=0,i=0;i<r;i++){var a=t[i];e.set(a,o),o+=a.length}return n.i=[e],e}function ot(e,t){return{O:e,P:t}}var it=ot((function(e,t,n){if(5!==e.h)return!1;var r=(e=e.g).h[e.g],o=e.h[e.g+1],i=e.h[e.g+2],a=e.h[e.g+3];return e.g+=4,Z(e),e=2*((o=(r|o<<8|i<<16|a<<24)>>>0)>>31)+1,r=o>>>23&255,o&=8388607,ye(t,n,255==r?o?NaN:Infinity*e:0==r?e*Math.pow(2,-149)*o:e*Math.pow(2,r-150)*(o+Math.pow(2,23))),!0}),(function(e,t,n){if(null!=(t=ve(t,n))){K(e.g,8*n+5),e=e.g;var r=t;0===(r=(n=0>r?1:0)?-r:r)?0<1/r?G=0:G=2147483648:isNaN(r)?G=2147483647:34028234663852886e22<r?G=(n<<31|2139095040)>>>0:11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),G=(n<<31|r)>>>0):(t=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-t),16777216<=(r=Math.round(8388608*r))&&++t,G=(n<<31|t+127<<23|8388607&r)>>>0),e.g.push((n=G)>>>0&255),e.g.push(n>>>8&255),e.g.push(n>>>16&255),e.g.push(n>>>24&255)}})),at=ot((function(e,t,n){if(0!==e.h)return!1;for(var r=e.g,o=128,i=0,a=e=0;4>a&&128<=o;a++)o=r.h[r.g++],Z(r),i|=(127&o)<<7*a;if(128<=o&&(o=r.h[r.g++],Z(r),i|=(127&o)<<28,e|=(127&o)>>4),128<=o)for(a=0;5>a&&128<=o;a++)o=r.h[r.g++],Z(r),e|=(127&o)<<7*a+3;if(!(128>o))throw q();return r=i>>>0,(e=2147483648&(o=e>>>0))&&(o=~o>>>0,0==(r=1+~r>>>0)&&(o=o+1>>>0)),r=4294967296*o+(r>>>0),ye(t,n,e?-r:r),!0}),(function(e,t,n){if(null!=(t=ve(t,n))&&null!=t){K(e.g,8*n),e=e.g;var r=t;for(n=0>r,t=(r=Math.abs(r))>>>0,r=Math.floor((r-t)/4294967296),r>>>=0,n&&(r=~r>>>0,4294967295<(t=1+(~t>>>0))&&(t=0,4294967295<++r&&(r=0))),n=G=t,t=r;0<t||127<n;)e.g.push(127&n|128),n=(n>>>7|t<<25)>>>0,t>>>=7;e.g.push(n)}})),st=ot((function(e,t,n){return 0===e.h&&(ye(t,n,Q(e.g)),!0)}),(function(e,t,n){if(null!=(t=ve(t,n))&&null!=t)if(K(e.g,8*n),e=e.g,0<=(n=t))K(e,n);else{for(t=0;9>t;t++)e.g.push(127&n|128),n>>=7;e.g.push(1)}})),ut=ot((function(e,t,n){if(2!==e.h)return!1;var r,o=Q(e.g)>>>0,i=(e=e.g).g;if(e.g+=o,Z(e),e=e.h,N)(r=I)||(r=I=new TextDecoder("utf-8",{fatal:!0})),r=r.decode(e.subarray(i,i+o));else{o=i+o;for(var a,s,u,c=[],l=null;i<o;)128>(a=e[i++])?c.push(a):224>a?i>=o?M():(s=e[i++],194>a||128!=(192&s)?(i--,M()):c.push((31&a)<<6|63&s)):240>a?i>=o-1?M():128!=(192&(s=e[i++]))||224===a&&160>s||237===a&&160<=s||128!=(192&(r=e[i++]))?(i--,M()):c.push((15&a)<<12|(63&s)<<6|63&r):244>=a?i>=o-2?M():128!=(192&(s=e[i++]))||s-144+(a<<28)>>30||128!=(192&(r=e[i++]))||128!=(192&(u=e[i++]))?(i--,M()):(a=(7&a)<<18|(63&s)<<12|(63&r)<<6|63&u,c.push(55296+((a-=65536)>>10&1023),56320+(1023&a))):M(),8192<=c.length&&(l=T(l,c),c.length=0);r=T(l,c)}return ye(t,n,r),!0}),(function(e,t,n){if(null!=(t=ve(t,n))){var r=!1;if(r=void 0!==r&&r,A){if(r&&/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(t))throw Error("Found an unpaired surrogate");t=(S||(S=new TextEncoder)).encode(t)}else{for(var o=0,i=new Uint8Array(3*t.length),a=0;a<t.length;a++){var s=t.charCodeAt(a);if(128>s)i[o++]=s;else{if(2048>s)i[o++]=s>>6|192;else{if(55296<=s&&57343>=s){if(56319>=s&&a<t.length){var u=t.charCodeAt(++a);if(56320<=u&&57343>=u){i[o++]=(s=1024*(s-55296)+u-56320+65536)>>18|240,i[o++]=s>>12&63|128,i[o++]=s>>6&63|128,i[o++]=63&s|128;continue}a--}if(r)throw Error("Found an unpaired surrogate");s=65533}i[o++]=s>>12|224,i[o++]=s>>6&63|128}i[o++]=63&s|128}}t=i.subarray(0,o)}K(e.g,8*n+2),K(e.g,t.length),oe(e,e.g.end()),oe(e,t)}})),ct=ot((function(e,t,n,r,o){if(2!==e.h)return!1;t=we(t,n,r),n=e.g.i,r=Q(e.g)>>>0;var i=e.g.g+r,a=i-n;if(0>=a&&(e.g.i=i,o(t,e),a=i-e.g.g),a)throw Error("Message parsing ended unexpectedly. Expected to read "+r+" bytes, instead read "+(r-a)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=i,e.g.i=n,!0}),(function(e,t,n,r,o){if(null!=(t=Ce(t,r,n)))for(r=0;r<t.length;r++){var i=e;K(i.g,8*n+2);var a=i.g.end();oe(i,a),a.push(i.h),i=a,o(t[r],e),a=e;var s=i.pop();for(s=a.h+a.g.length()-s;127<s;)i.push(127&s|128),s>>>=7,a.h++;i.push(s),a.h++}}));function lt(){Ae.apply(this,arguments)}if(p(lt,Ae),me){var dt={};Object.defineProperties(lt,(dt[Symbol.hasInstance]=ge(Object[Symbol.hasInstance]),dt))}function ft(e){lt.call(this,e)}function pt(){return[1,st,2,it,3,ut,4,ut]}function ht(e){lt.call(this,e,-1,gt)}function mt(){return[1,ct,ft,pt]}p(ft,lt),p(ht,lt),ht.prototype.addClassification=function(e,t){return we(this,1,ft,e,t),this};var gt=[1];function vt(e){lt.call(this,e)}function yt(){return[1,it,2,it,3,it,4,it,5,it]}function bt(e){lt.call(this,e,-1,Ct)}function xt(){return[1,ct,vt,yt]}p(vt,lt),p(bt,lt);var Ct=[1];function wt(e){lt.call(this,e)}function Et(){return[1,it,2,it,3,it,4,it,5,it,6,at]}p(wt,lt);var kt=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],Dt=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],Mt=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],Tt=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],It=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],St=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],Nt=[].concat(s(kt),s(Dt),s(Mt),s(Tt),s(It),s(St));function At(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function Lt(e){return Ce(e,ft,1).map((function(e){return{index:Ee(e,1),ga:xe(e,2),label:null!=ve(e,3)?ke(e,3):void 0,displayName:null!=ve(e,4)?ke(e,4):void 0}}))}function Ot(e){return{x:xe(e,1),y:xe(e,2),z:xe(e,3),visibility:null!=ve(e,4)?xe(e,4):void 0}}function Rt(e,t){this.h=e,this.g=t,this.l=0}function Ft(e,t,n){return function(e,t){var n=e.g;if(void 0===e.o){var r=At(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),o=At(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),i=n.createProgram();if(n.attachShader(i,r),n.attachShader(i,o),n.linkProgram(i),!n.getProgramParameter(i,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(i));r=e.o=i,n.useProgram(r),o=n.getUniformLocation(r,"sampler0"),e.j={K:n.getAttribLocation(r,"aVertex"),J:n.getAttribLocation(r,"aTex"),ma:o},e.u=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.u),n.enableVertexAttribArray(e.j.K),n.vertexAttribPointer(e.j.K,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.enableVertexAttribArray(e.j.J),n.vertexAttribPointer(e.j.J,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(o,0)}r=e.j,n.useProgram(e.o),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.h.bindTexture2d(t.glName),n.enableVertexAttribArray(r.K),n.bindBuffer(n.ARRAY_BUFFER,e.u),n.vertexAttribPointer(r.K,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.J),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.vertexAttribPointer(r.J,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(r.K),n.disableVertexAttribArray(r.J),n.bindBuffer(n.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(e,t),"function"==typeof e.g.canvas.transferToImageBitmap?Promise.resolve(e.g.canvas.transferToImageBitmap()):n?Promise.resolve(e.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(e.g.canvas):(void 0===e.i&&(e.i=document.createElement("canvas")),new Promise((function(t){e.i.height=e.g.canvas.height,e.i.width=e.g.canvas.width,e.i.getContext("2d",{}).drawImage(e.g.canvas,0,0,e.g.canvas.width,e.g.canvas.height),t(e.i)})))}function Pt(e){this.g=e}var Ut=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function _t(e,t){return t+e}function jt(e,t){window[e]=t}function Bt(e){if(this.g=e,this.listeners={},this.j={},this.H={},this.o={},this.u={},this.I=this.s=this.Z=!0,this.D=Promise.resolve(),this.Y="",this.C={},this.locateFile=e&&e.locateFile||_t,"object"==typeof window)var t=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if("undefined"==typeof location)throw Error("solutions can only be loaded on a web page or in a web worker");t=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.$=t,e.options)for(var n=(t=a(Object.keys(e.options))).next();!n.done;n=t.next()){var r=e.options[n=n.value].default;void 0!==r&&(this.j[n]="function"==typeof r?r():r)}}function zt(e){var t,n,r,o,i,a,u,c,l,d,f;return w((function(p){switch(p.g){case 1:return e.Z?(t=void 0===e.g.files?[]:"function"==typeof e.g.files?e.g.files(e.j):e.g.files,v(p,w((function(e){switch(e.g){case 1:return e.o=2,v(e,WebAssembly.instantiate(Ut),4);case 4:e.g=3,e.o=0;break;case 2:return e.o=0,e.j=null,e.return(!1);case 3:return e.return(!0)}})),2)):p.return();case 2:if(n=p.h,"object"==typeof window)return jt("createMediapipeSolutionsWasm",{locateFile:e.locateFile}),jt("createMediapipeSolutionsPackedAssets",{locateFile:e.locateFile}),a=t.filter((function(e){return void 0!==e.data})),u=t.filter((function(e){return void 0===e.data})),c=Promise.all(a.map((function(t){var n=Gt(e,t.url);if(void 0!==t.path){var r=t.path;n=n.then((function(t){return e.overrideFile(r,t),Promise.resolve(t)}))}return n}))),l=Promise.all(u.map((function(t){return void 0===t.simd||t.simd&&n||!t.simd&&!n?function(e){var t=document.createElement("script");return t.setAttribute("src",e),t.setAttribute("crossorigin","anonymous"),new Promise((function(e){t.addEventListener("load",(function(){e()}),!1),t.addEventListener("error",(function(){e()}),!1),document.body.appendChild(t)}))}(e.locateFile(t.url,e.$)):Promise.resolve()}))).then((function(){var t,n,r;return w((function(o){if(1==o.g)return t=window.createMediapipeSolutionsWasm,n=window.createMediapipeSolutionsPackedAssets,r=e,v(o,t(n),2);r.h=o.h,o.g=0}))})),d=w((function(t){return e.g.graph&&e.g.graph.url?t=v(t,Gt(e,e.g.graph.url),0):(t.g=0,t=void 0),t})),v(p,Promise.all([l,c,d]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return r=t.filter((function(e){return void 0===e.simd||e.simd&&n||!e.simd&&!n})).map((function(t){return e.locateFile(t.url,e.$)})),importScripts.apply(null,s(r)),o=e,v(p,createMediapipeSolutionsWasm(Module),6);case 6:o.h=p.h,e.l=new OffscreenCanvas(1,1),e.h.canvas=e.l,i=e.h.GL.createContext(e.l,{antialias:!1,alpha:!1,ja:"undefined"!=typeof WebGL2RenderingContext?2:1}),e.h.GL.makeContextCurrent(i),p.g=4;break;case 7:if(e.l=document.createElement("canvas"),!(f=e.l.getContext("webgl2",{}))&&!(f=e.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),p.return();e.G=f,e.h.canvas=e.l,e.h.createContext(e.l,!0,!0,{});case 4:e.i=new e.h.SolutionWasm,e.Z=!1,p.g=0}}))}function Gt(e,t){var n,r;return w((function(o){return t in e.H?o.return(e.H[t]):(n=e.locateFile(t,""),r=fetch(n).then((function(e){return e.arrayBuffer()})),e.H[t]=r,o.return(r))}))}function Vt(e,t,n){var r,o,i,s,u,c,l,d,f,p,h,m;return w((function(g){switch(g.g){case 1:if(!n)return g.return(t);for(r={},o=0,i=a(Object.keys(n)),s=i.next();!s.done;s=i.next())"string"!=typeof(u=n[s.value])&&"texture"===u.type&&void 0!==t[u.stream]&&++o;1<o&&(e.I=!1),c=a(Object.keys(n)),s=c.next();case 2:if(s.done){g.g=4;break}if("string"==typeof(d=n[l=s.value]))return h=r,m=l,v(g,function(e,t,n){var r;return w((function(o){return"number"==typeof n||n instanceof Uint8Array||n instanceof e.h.Uint8BlobList?o.return(n):n instanceof e.h.Texture2dDataOut?((r=e.u[t])||(r=new Rt(e.h,e.G),e.u[t]=r),o.return(Ft(r,n,e.I))):o.return(void 0)}))}(e,l,t[d]),14);if(f=t[d.stream],"detection_list"===d.type){if(f){for(var y=f.getRectList(),b=f.getLandmarksList(),x=f.getClassificationsList(),C=[],E=0;E<y.size();++E){var k=tt(y.get(E),wt,Et);k={boundingBox:{xCenter:xe(k,1),yCenter:xe(k,2),height:xe(k,3),width:xe(k,4),rotation:xe(k,5,0),rectId:Ee(k,6)},landmarks:Ce(tt(b.get(E),bt,xt),vt,1).map(Ot),V:Lt(tt(x.get(E),ht,mt))},C.push(k)}y=C}else y=[];r[l]=y,g.g=7;break}if("proto_list"===d.type){if(f){for(y=Array(f.size()),b=0;b<f.size();b++)y[b]=f.get(b);f.delete()}else y=[];r[l]=y,g.g=7;break}if(void 0===f){g.g=3;break}if("float_list"===d.type){r[l]=f,g.g=7;break}if("proto"===d.type){r[l]=f,g.g=7;break}if("texture"!==d.type)throw Error("Unknown output config type: '"+d.type+"'");return(p=e.u[l])||(p=new Rt(e.h,e.G),e.u[l]=p),v(g,Ft(p,f,e.I),13);case 13:r[l]=g.h;case 7:d.transform&&r[l]&&(r[l]=d.transform(r[l])),g.g=3;break;case 14:h[m]=g.h;case 3:s=c.next(),g.g=2;break;case 4:return g.return(r)}}))}function Wt(e,t){for(var n=t.name||"$",r=[].concat(s(t.wants)),o=new e.h.StringList,i=a(t.wants),u=i.next();!u.done;u=i.next())o.push_back(u.value);i=e.h.PacketListener.implement({onResults:function(o){for(var i={},a=0;a<t.wants.length;++a)i[r[a]]=o.get(a);var s=e.listeners[n];s&&(e.D=Vt(e,i,t.outs).then((function(n){n=s(n);for(var o=0;o<t.wants.length;++o){var a=i[r[o]];"object"==typeof a&&a.hasOwnProperty&&a.hasOwnProperty("delete")&&a.delete()}n&&(e.D=n)})))}}),e.i.attachMultiListener(o,i),o.delete()}function qt(e){var t=this,n={url:"face_detection_short.binarypb"},r={type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}};this.g=new Bt({locateFile:(e=e||{}).locateFile,files:[{data:!0,url:"face_detection_short.binarypb"},{data:!0,url:"face_detection_short_range.tflite"},{simd:!0,url:"face_detection_solution_simd_wasm_bin.js"},{simd:!1,url:"face_detection_solution_wasm_bin.js"}],graph:n,listeners:[{wants:["detections","image_transformed"],outs:{image:"image_transformed",detections:{type:"detection_list",stream:"detections"}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"object"==typeof window&&void 0!==window.navigator&&("iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document)},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},model:{type:0,onChange:function(e){var o,i,s,u;return w((function(c){switch(c.g){case 1:o=a("short"===e?["face_detection_short_range.tflite"]:["face_detection_full_range_sparse.tflite"]),i=o.next();case 2:if(i.done){c.g=4;break}return u="third_party/mediapipe/modules/face_detection/"+(s=i.value),v(c,Gt(t.g,s),5);case 5:t.g.overrideFile(u,c.h),i=o.next(),c.g=2;break;case 4:return n.url="short"===e?"face_detection_short.binarypb":"face_detection_full.binarypb",r.graphOptionXref.calculatorName="short"===e?"facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator":"facedetectionfullrangegpu__facedetectionfullrangecommon__TensorsToDetectionsCalculator",c.return(!0)}}))}},minDetectionConfidence:r}})}(e=Bt.prototype).close=function(){return this.i&&this.i.delete(),Promise.resolve()},e.reset=function(){var e=this;return w((function(t){e.i&&(e.i.reset(),e.o={},e.u={}),t.g=0}))},e.setOptions=function(e,t){var n=this;if(t=t||this.g.options){for(var r=[],o=[],i={},s=a(Object.keys(e)),u=s.next();!u.done;i={R:i.R,S:i.S},u=s.next()){var c=u.value;c in this.j&&this.j[c]===e[c]||(this.j[c]=e[c],void 0!==(u=t[c])&&(u.onChange&&(i.R=u.onChange,i.S=e[c],r.push(function(e){return function(){return w((function(t){if(1==t.g)return v(t,e.R(e.S),2);!0===t.h&&(n.s=!0),t.g=0}))}}(i))),u.graphOptionXref&&(c={valueNumber:1===u.type?e[c]:0,valueBoolean:0===u.type&&e[c],valueString:2===u.type?e[c]:""},u=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),u.graphOptionXref),c),o.push(u))))}0===r.length&&0===o.length||(this.s=!0,this.B=(void 0===this.B?[]:this.B).concat(o),this.A=(void 0===this.A?[]:this.A).concat(r))}},e.initialize=function(){var e=this;return w((function(t){return 1==t.g?v(t,zt(e),2):3!=t.g?v(t,function(e){var t,n,r,o,i,s;return w((function(u){if(1==u.g)return e.g.graph&&e.g.graph.url&&e.Y===e.g.graph.url?u.return():(e.s=!0,e.g.graph&&e.g.graph.url?(e.Y=e.g.graph.url,v(u,Gt(e,e.g.graph.url),3)):void(u.g=2));for(2!=u.g&&e.i.loadGraph(u.h),t=a(Object.keys(e.C)),n=t.next();!n.done;n=t.next())e.i.overrideFile(r=n.value,e.C[r]);if(e.C={},e.g.listeners)for(o=a(e.g.listeners),i=o.next();!i.done;i=o.next())Wt(e,i.value);s=e.j,e.j={},e.setOptions(s),u.g=0}))}(e),3):v(t,function(e){var t,n,r,o,i;return w((function(s){switch(s.g){case 1:if(!e.s)return s.return();if(!e.A){s.g=2;break}t=a(e.A),n=t.next();case 3:if(n.done){s.g=5;break}return v(s,(0,n.value)(),4);case 4:n=t.next(),s.g=3;break;case 5:e.A=void 0;case 2:if(e.B){for(r=new e.h.GraphOptionChangeRequestList,o=a(e.B),i=o.next();!i.done;i=o.next())r.push_back(i.value);e.i.changeOptions(r),r.delete(),e.B=void 0}e.s=!1,s.g=0}}))}(e),0)}))},e.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.C[e]=t},e.clearOverriddenFiles=function(){this.C={},this.i&&this.i.clearOverriddenFiles()},e.send=function(e,t){var n,r,o,i,s,u,c,l,d,f=this;return w((function(p){switch(p.g){case 1:return f.g.inputs?(n=1e3*(null==t?performance.now():t),v(p,f.D,2)):p.return();case 2:return v(p,f.initialize(),3);case 3:for(r=new f.h.PacketDataList,o=a(Object.keys(e)),i=o.next();!i.done;i=o.next())if(u=f.g.inputs[s=i.value]){e:{var h=e[s];switch(u.type){case"video":var m=f.o[u.stream];if(m||(m=new Rt(f.h,f.G),f.o[u.stream]=m),0===m.l&&(m.l=m.h.createTexture()),"undefined"!=typeof HTMLVideoElement&&h instanceof HTMLVideoElement)var g=h.videoWidth,y=h.videoHeight;else"undefined"!=typeof HTMLImageElement&&h instanceof HTMLImageElement?(g=h.naturalWidth,y=h.naturalHeight):(g=h.width,y=h.height);y={glName:m.l,width:g,height:y},(g=m.g).canvas.width=y.width,g.canvas.height=y.height,g.activeTexture(g.TEXTURE0),m.h.bindTexture2d(m.l),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,h),m.h.bindTexture2d(0),m=y;break e;case"detections":for((m=f.o[u.stream])||(m=new Pt(f.h),f.o[u.stream]=m),m.data||(m.data=new m.g.DetectionListData),m.data.reset(h.length),y=0;y<h.length;++y){var b=m.data,x=b.setBoundingBox,C=y,w=(g=h[y]).boundingBox,E=new wt;if(ye(E,1,w.xCenter),ye(E,2,w.yCenter),ye(E,3,w.height),ye(E,4,w.width),ye(E,5,w.rotation),ye(E,6,w.rectId),w=rt(E,Et),x.call(b,C,w),g.landmarks)for(b=0;b<g.landmarks.length;++b){var k=!!(E=g.landmarks[b]).visibility;C=(x=m.data).addNormalizedLandmark,w=y,E=Object.assign(Object.assign({},E),{visibility:k?E.visibility:0}),ye(k=new vt,1,E.x),ye(k,2,E.y),ye(k,3,E.z),E.visibility&&ye(k,4,E.visibility),E=rt(k,yt),C.call(x,w,E)}if(g.V)for(b=0;b<g.V.length;++b)C=(x=m.data).addClassification,w=y,E=g.V[b],ye(k=new ft,2,E.ga),E.index&&ye(k,1,E.index),E.label&&ye(k,3,E.label),E.displayName&&ye(k,4,E.displayName),E=rt(k,pt),C.call(x,w,E)}m=m.data;break e;default:m={}}}switch(c=m,l=u.stream,u.type){case"video":r.pushTexture2d(Object.assign(Object.assign({},c),{stream:l,timestamp:n}));break;case"detections":(d=c).stream=l,d.timestamp=n,r.pushDetectionList(d);break;default:throw Error("Unknown input config type: '"+u.type+"'")}}return f.i.send(r),v(p,f.D,4);case 4:r.delete(),p.g=0}}))},e.onResults=function(e,t){this.listeners[t||"$"]=e},D("Solution",Bt),D("OptionType",{BOOL:0,NUMBER:1,ia:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(e=qt.prototype).close=function(){return this.g.close(),Promise.resolve()},e.onResults=function(e){this.g.onResults(e)},e.initialize=function(){var e=this;return w((function(t){return v(t,e.g.initialize(),0)}))},e.reset=function(){this.g.reset()},e.send=function(e){var t=this;return w((function(n){return v(n,t.g.send(e),0)}))},e.setOptions=function(e){this.g.setOptions(e)},D("FaceDetection",qt),D("FACEDETECTION_LIPS",kt),D("FACEDETECTION_LEFT_EYE",Dt),D("FACEDETECTION_LEFT_EYEBROW",Mt),D("FACEDETECTION_RIGHT_EYE",Tt),D("FACEDETECTION_RIGHT_EYEBROW",It),D("FACEDETECTION_FACE_OVAL",St),D("FACEDETECTION_CONTOURS",Nt),D("FACEDETECTION_TESSELATION",[[127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]]),D("VERSION","0.4.1646425229")}).call(V);var Bd,zd="https://websdk-cdn-dev.idmission.com/assets/models/blazeface20240207/blaze_face_short_range.tflite",Gd=45e3;function Vd(){return h(this,void 0,void 0,(function(){var e,t;return m(this,(function(n){switch(n.label){case 0:return Bd?[2,Bd]:[4,Jd()];case 1:if(n.sent(),"NONE"===Sd.delegate)throw new Error("No available delegate for face detector.");return t=(e=vl).createFromOptions,[4,lc.forVisionTasks(Cd)];case 2:return[4,t.apply(e,[n.sent(),{baseOptions:{modelAssetPath:zd,delegate:Sd.delegate},runningMode:"VIDEO"}])];case 3:return[2,Bd=n.sent()]}}))}))}var Wd=function(e){return h(void 0,[e],void 0,(function(e){var t,n=e.documentDetectionModel,r=void 0===n||n,o=e.focusModel,i=void 0===o||o,a=e.faceDetectionModel,s=void 0===a||a;return m(this,(function(e){switch(e.label){case 0:return[4,Nd()];case 1:return e.sent(),t=[],r&&t.push(Xd),i&&t.push(Kd),s&&t.push(Jd),[4,Promise.all(t)];case 2:return e.sent(),[2]}}))}))},qd={},Hd={visionRuntime:{loaded:0,total:0},documentDetection:{loaded:0,total:0},focus:{loaded:0,total:0},faceDetection:{loaded:0,total:0}};function Yd(e){return h(this,void 0,void 0,(function(){var t;return m(this,(function(n){return t=new XMLHttpRequest,[2,new Promise((function(n){t.addEventListener("progress",(function(t){t.lengthComputable&&(qd[e]=t,document.dispatchEvent(new CustomEvent("idmission.preloadProgress",{detail:{url:e,loaded:t.loaded,total:t.total}})))})),t.addEventListener("loadend",(function(){n(4===t.readyState&&200===t.status)})),t.open("GET",e,!0),t.send()}))]}))}))}var Zd=!1,Qd=!1,$d=!1;function Xd(){return h(this,void 0,void 0,(function(){function e(e){t.includes(e.detail.url)&&(Hd.documentDetection=tf(t),document.dispatchEvent(new CustomEvent("idmission.preloadProgress.documentDetection",{detail:Hd.documentDetection})))}var t;return m(this,(function(n){switch(n.label){case 0:return Zd?[2,new Promise((function(e){setInterval((function(){Zd||e()}),100)}))]:(Zd=!0,[4,Nd()]);case 1:if(n.sent(),"NONE"===Sd.delegate)throw new Error("No available delegate for document detector.");t=[nf],document.addEventListener("idmission.preloadProgress",e),n.label=2;case 2:return n.trys.push([2,,4,5]),[4,Promise.all(t.map(Yd))];case 3:return n.sent(),[3,5];case 4:return document.removeEventListener("idmission.preloadProgress",e),Zd=!1,[7];case 5:return[2]}}))}))}function Kd(){return h(this,void 0,void 0,(function(){function e(e){t.includes(e.detail.url)&&(Hd.focus=tf(t),document.dispatchEvent(new CustomEvent("idmission.preloadProgress.focus",{detail:Hd.focus})))}var t;return m(this,(function(n){switch(n.label){case 0:return Qd?[2,new Promise((function(e){setInterval((function(){Qd||e()}),100)}))]:(Qd=!0,[4,Nd()]);case 1:if(n.sent(),"NONE"===Sd.delegate)throw new Error("No available delegate for document detector.");t=[Fd],document.addEventListener("idmission.preloadProgress",e),n.label=2;case 2:return n.trys.push([2,,4,5]),[4,Promise.all(t.map(Yd))];case 3:return n.sent(),[3,5];case 4:return document.removeEventListener("idmission.preloadProgress",e),Qd=!1,[7];case 5:return[2]}}))}))}function Jd(){return h(this,void 0,void 0,(function(){function e(e){t.includes(e.detail.url)&&(Hd.faceDetection=tf(t),document.dispatchEvent(new CustomEvent("idmission.preloadProgress.faceDetection",{detail:Hd.faceDetection})))}var t;return m(this,(function(n){switch(n.label){case 0:return $d?[2,new Promise((function(e){setInterval((function(){$d||e()}),100)}))]:($d=!0,[4,Nd()]);case 1:if(n.sent(),"NONE"===Sd.delegate)throw new Error("No available delegate for document detector.");t=[zd],document.addEventListener("idmission.preloadProgress",e),n.label=2;case 2:return n.trys.push([2,,4,5]),[4,Promise.all(t.map(Yd))];case 3:return n.sent(),[3,5];case 4:return document.removeEventListener("idmission.preloadProgress",e),$d=!1,[7];case 5:return[2]}}))}))}function ef(e){return e.total>0?Math.round(100*e.loaded/e.total):0}function tf(e){return e.reduce((function(e,t){var n=qd[t];return n?(e.loaded+=n.loaded,e.total+=n.total,e):e}),{loaded:0,total:0})}var nf="https://websdk-cdn-dev.idmission.com/assets/models/docdetectmp20240802/model_fp16.tflite",rf=.1,of=45e3,af={idCardFront:"ID card front",idCardBack:"ID card back",passport:"Passport",none:"None"},sf={};function uf(e){var n=e.modelPath,r=void 0===n?nf:n,o=e.modelLoadTimeoutMs,i=void 0===o?of:o,a=e.scoreThreshold,s=void 0===a?rf:a,u=e.onModelError,c=t.useRef(null),l=t.useState(!1),d=l[0],f=l[1],p=t.useState(0),g=p[0],v=p[1],y=t.useState(null),b=y[0],x=y[1],C=t.useContext(nt).videoRef;return t.useEffect((function(){var e=this;function t(e){v(ef(e.detail))}f(!1),document.addEventListener("idmission.preloadProgress.documentDetection",t);var n=setTimeout((function(){x(new Error("Model loading time limit exceeded."))}),i);return function(){return h(this,arguments,void 0,(function(e,t){var n,r,o,i,a;return void 0===e&&(e=nf),void 0===t&&(t=rf),m(this,(function(s){switch(s.label){case 0:return n="".concat(e,":").concat(t),sf[n]?[2,sf[n]]:[4,Xd()];case 1:if(s.sent(),"NONE"===Sd.delegate)throw new Error("No available delegate for document detector.");return r=sf,o=n,a=(i=gd).createFromOptions,[4,lc.forVisionTasks(Cd)];case 2:return[4,a.apply(i,[s.sent(),{baseOptions:{modelAssetPath:e,delegate:Sd.delegate},scoreThreshold:t,runningMode:"VIDEO"}])];case 3:return r[o]=s.sent(),[2,sf[n]]}}))}))}(r,s).then((function(t){return h(e,void 0,void 0,(function(){return m(this,(function(e){switch(e.label){case 0:return c.current=t,v(100),clearTimeout(n),[4,Rd(C)];case 1:return e.sent(),t.detectForVideo(C.current,performance.now()),f(!0),[2]}}))}))})).catch((function(e){x(e)})).finally((function(){clearTimeout(n)})),function(){clearTimeout(n),document.removeEventListener("idmission.preloadProgress.documentDetection",t)}}),[i,r,s,C]),t.useEffect((function(){b&&(null==u||u(b))}),[b,u]),{detector:c,ready:d,modelDownloadProgress:g,modelError:b,setModelError:x}}function cf(e,t){return h(this,void 0,void 0,(function(){var n,r,o,i,a;return m(this,(function(s){n=new Date;try{return r=e.detectForVideo(t,performance.now()),o=(new Date).getTime()-n.getTime(),i=t.width,a=t.height,[2,f(f({},r),{time:o,frameWidth:i,frameHeight:a})]}catch(e){Fe("caught object detection error",e)}return[2,null]}))}))}function lf(e,t){var n,r,o,i,a,s,u,c=e.detections,l=e.frameWidth,d=e.frameHeight,f=e.time,p=function(e){var t={};return e.forEach((function(e,n){e&&(t[e.label]||(t[e.label]=[0,-1]),e.score>t[e.label][0]&&(t[e.label]=[e.score,n]))})),Object.keys(t).map((function(n){return e[t[n][1]]})).filter((function(e){return!!e}))}(c.map((function(e){var t,n=null===(t=e.categories)||void 0===t?void 0:t[0];return{label:null==n?void 0:n.categoryName,score:null==n?void 0:n.score,box:Od(e.boundingBox)}}))),h=c.length>0&&!c.some((function(e){var t=e.boundingBox;return Object.values(null!=t?t:{}).some((function(e){return e>0}))})),m=p.find((function(e){return"Document"===e.label})),g=p.find((function(e){return"Document back"===e.label})),v=p.find((function(e){return"Passport page"===e.label})),y=null!==(n=null==m?void 0:m.score)&&void 0!==n?n:0,b=null!==(r=null==g?void 0:g.score)&&void 0!==r?r:0,x=null!==(o=null==v?void 0:v.score)&&void 0!==o?o:0,C=y>=(null!==(i=t.idCardFront)&&void 0!==i?i:0),w=b>=(null!==(a=t.idCardBack)&&void 0!==a?a:0),E=x>=(null!==(s=t.passport)&&void 0!==s?s:0),k=E?v:w?g:m,D=E?t.passport:w?t.idCardBack:t.idCardFront,M=null!==(u=null==k?void 0:k.score)&&void 0!==u?u:0,T=M>=(null!=D?D:0),I="none";E?I="passport":w?I="idCardBack":T&&(I="idCardFront");var S=!1;if(k){var N=k.box,A=N.xMin,L=N.yMin,O=N.width;S=L>20&&L+N.height+20<d&&(A>20||A<20&&A+O>.8*l)&&A+O+20<l}var R=!1;if(k){var F=[k.box.width/l,k.box.height/d];R=F[0]>.85||F[1]>.85}return{detectedObjects:p,detectionScore:M,detectionTime:f,detectionThresholdMet:T,detectedDocumentType:I,idCardFrontDetectionScore:y,idCardFrontDetectionThresholdMet:C,idCardBackDetectionScore:b,idCardBackDetectionThresholdMet:w,passportDetectionScore:x,passportDetectionThresholdMet:E,bestDocument:k,documentInBounds:S,documentTooClose:R,frameWidth:l,frameHeight:d,allZero:h}}function df(e,n){var r=n.throttleMs,o=void 0===r?0:r,i=n.autoStart,a=void 0!==i&&i,s=t.useState(!1),u=s[0],c=s[1],l=t.useRef(0),d=t.useRef(0);t.useEffect((function(){if(u){var t,n=l.current;return function r(){return h(this,void 0,void 0,(function(){return m(this,(function(i){switch(i.label){case 0:return n!==l.current?[2]:[4,e(d.current)];case 1:return i.sent(),t=setTimeout((function(){d.current=requestAnimationFrame(r)}),null!=o?o:0),[2]}}))}))}().then(),function(){l.current+=1,d.current&&cancelAnimationFrame(d.current),t&&clearTimeout(t)}}}),[e,u,o]);var f=t.useCallback((function(){c(!0)}),[]),p=t.useCallback((function(){l.current+=1,c(!1)}),[]);return t.useEffect((function(){return a&&f(),function(){p()}}),[a,f,p]),{start:f,stop:p}}var ff=t.createContext({startDocumentDetection:function(){return null},stopDocumentDetection:function(){return null},documentDetectionModelReady:!1,documentDetectionModelDownloadProgress:0,documentDetectionModelError:null,onDocumentDetected:function(){return null},detectionTime:0,documentDetectionThresholds:{},setDocumentDetectionThresholds:function(){return null},documentDetectionLastPredictionCanvas:{current:null},clearDocumentDetectionLastPredictionCanvas:function(){return null}});function pf(e){var n=this,r=e.autoStart,o=void 0===r||r,i=e.children,a=e.throttleMs,s=e.documentDetectionModelPath,c=void 0===s?nf:s,l=e.documentDetectionModelScoreThreshold,d=void 0===l?rf:l,f=e.documentDetectionModelLoadTimeoutMs,p=void 0===f?of:f,g=e.onDocumentDetectionModelError,v=t.useContext(nt),y=v.videoRef,b=v.videoLoaded,x=v.cameraReady,C=t.useRef(null),w=t.useRef(),E=t.useState({}),k=E[0],D=E[1],M=t.useState(0),T=M[0],I=M[1],S=t.useState(0),N=S[0],A=S[1],L=t.useState(0),O=L[0],R=L[1],F=t.useRef(0),P=uf({modelPath:c,modelLoadTimeoutMs:p,scoreThreshold:d,onModelError:g}),U=P.detector,_=P.ready,j=P.modelDownloadProgress,B=P.modelError,z=P.setModelError,G=df(t.useCallback((function(e){return h(n,void 0,void 0,(function(){var t,n,r,o,i,a,s;return m(this,(function(u){switch(u.label){case 0:return b&&x&&_&&y.current&&U.current&&C.current?(t=F.current,r=y.current.videoHeight,C.current.width=n=y.current.videoWidth,C.current.height=r,(o=C.current.getContext("2d"))&&4===y.current.readyState?t!==F.current?[2]:(o.drawImage(y.current,0,0,n,r),[4,cf(U.current,C.current)]):[3,3]):[2];case 1:return(i=u.sent())?((a=lf(i,k)).frameId=e,I(i.time),Oe(a),a.allZero&&A((function(e){return e+1})),t!==F.current?[2]:[4,null===(s=w.current)||void 0===s?void 0:s.call(w,a)]):[3,3];case 2:u.sent(),u.label=3;case 3:return[2]}}))}))}),[x,U,k,_,b,y]),{throttleMs:a,autoStart:o}),V=G.start,W=G.stop;t.useEffect((function(){N>=2&&z(new Error("model is returning all zeroes"))}),[z,N]);var q=t.useCallback((function(e){w.current=e}),[]),H=t.useCallback((function(){F.current+=1,R((function(e){return e+1}))}),[]),Y=t.useMemo((function(){return{startDocumentDetection:V,stopDocumentDetection:W,documentDetectionModelReady:_,documentDetectionModelError:B,documentDetectionModelDownloadProgress:j,onDocumentDetected:q,detectionTime:T,documentDetectionThresholds:k,setDocumentDetectionThresholds:D,documentDetectionLastPredictionCanvas:C,clearDocumentDetectionLastPredictionCanvas:H}}),[V,W,_,B,j,q,T,k,H]);return u.createElement(ff.Provider,{value:Y},u.createElement(Ve,{key:O,ref:C}),i)}var hf=t.createContext({focusModelReady:!1,focusModelDownloadProgress:0,focusModelError:null,focusThresholds:{},setFocusThresholds:function(){return null},makeFocusPrediction:function(){return null},focusPredictionTime:0});function mf(e){var n=e.children,r=e.focusModelPath,o=void 0===r?Fd:r,i=e.focusModelLoadTimeoutMs,a=void 0===i?Pd:i,s=e.onFocusModelError,u=e.showCanvases,c=void 0!==u&&u,l=t.useRef(null),d=t.useRef(null),f=t.useState({}),p=f[0],h=f[1],m=t.useState(0),g=m[0],v=m[1],y=_d({modelPath:o,modelLoadTimeoutMs:a,onModelError:s}),b=y.model,x=y.ready,C=y.modelDownloadProgress,w=y.modelError,E=t.useCallback((function(e,t){if(!b.current)return null;var n=jd(b.current,e,l.current,d.current,t);return v(n.predictionTime),n}),[b]),k=t.useMemo((function(){return{focusModelReady:x,focusModelDownloadProgress:C,focusModelError:w,makeFocusPrediction:E,focusPredictionTime:g,focusThresholds:p,setFocusThresholds:h}}),[g,p,E,C,w,x]);return t.createElement(hf.Provider,{value:k},t.createElement(Ve,{ref:d,style:c?{display:"block"}:void 0}),t.createElement(Ve,{ref:l,style:c?{display:"block"}:void 0}),n)}function gf(e){if(e||"undefined"!=typeof navigator&&null!=navigator){if(e||(e=navigator),"ReactNative"===e.product)return!0;var t=e.userAgent||e.vendor||("undefined"!=typeof window?window.opera:"");if(!t){return e.userAgentData&&e.userAgentData.mobile}return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}return!1}var vf=gf(),yf={detection:{idCardFront:.8,idCardBack:.8,passport:.5},focus:{idCardFront:{desktop:0,mobile:.3},idCardBack:{desktop:0,mobile:.3},passport:{desktop:0,mobile:.3}}},bf=t.createContext({ready:!1,start:function(){return null},stop:function(){return null},modelDownloadProgress:0,modelError:null,thresholds:yf,setThresholds:function(){return null},onPredictionMade:function(){return null},detectionTime:0,focusPredictionTime:0,bestFrameDetails:null,getBestFrame:function(){return null},resetBestFrame:function(){return null},requiredDocumentType:"none",setRequiredDocumentType:function(){return null}});function xf(e){var n=e.children,r=e.onModelError,o=t.useContext(ff),i=o.documentDetectionModelReady,a=o.documentDetectionModelDownloadProgress,s=o.startDocumentDetection,u=o.stopDocumentDetection,c=o.documentDetectionLastPredictionCanvas,l=o.clearDocumentDetectionLastPredictionCanvas,d=o.onDocumentDetected,p=o.detectionTime,g=o.documentDetectionThresholds,v=o.setDocumentDetectionThresholds,y=o.documentDetectionModelError,b=t.useContext(hf),x=b.focusModelReady,C=b.focusModelDownloadProgress,w=b.makeFocusPrediction,E=b.focusThresholds,k=b.setFocusThresholds,D=b.focusPredictionTime,M=b.focusModelError,T=t.useRef(),I=t.useState(null),S=I[0],N=I[1],A=t.useRef(null),L=t.useRef(0),O=t.useRef(0),R=t.useState("none"),F=R[0],P=R[1],U=t.useMemo((function(){return f(f({},g),{focus:E})}),[g,E]),_=t.useCallback((function(e){e.detection&&v(e.detection),e.focus&&k(e.focus)}),[v,k]);t.useEffect((function(){var e=this;d((function(t){return h(e,void 0,void 0,(function(){var e,n,r,o,i,a,s,u,l,d,p,h,g;return m(this,(function(m){return c.current?(e=O.current,n=0,r=0,o=!1,("none"===F||t.detectedDocumentType===F||(null===(u=F.includes)||void 0===u?void 0:u.call(F,t.detectedDocumentType)))&&"none"!==t.detectedDocumentType&&t.detectionThresholdMet&&t.documentInBounds&&!t.documentTooClose&&((i=w(c.current,null===(l=t.bestDocument)||void 0===l?void 0:l.box))&&(r=i.score,n=i.predictionTime),a=null===(d=U.focus)||void 0===d?void 0:d[t.detectedDocumentType],s=null!==(p=vf?null==a?void 0:a.mobile:null==a?void 0:a.desktop)&&void 0!==p?p:0,o=r>=s,L.current<=r&&e===O.current&&(L.current=r,We(A.current,c.current),N({boundingBox:null===(h=t.bestDocument)||void 0===h?void 0:h.box,documentType:t.detectedDocumentType,detectionScore:t.detectionScore,focusScore:r}))),null===(g=T.current)||void 0===g||g.call(T,f(f({},t),{focusScore:r,focusPredictionTime:n,focusThresholdMet:o})),[2]):[2]}))}))}))}),[c,w,d,F,U.focus]);var j=null!=y?y:M;t.useEffect((function(){j&&(null==r||r(j))}),[j,r]);var B=t.useCallback((function(e){T.current=e}),[]),z=t.useCallback((function(){return S&&A.current?f(f({},S),{canvas:A.current}):null}),[S]),G=t.useState(0),V=G[0],W=G[1],q=t.useCallback((function(){O.current+=1,W((function(e){return e+1})),l(),N(null),L.current=0}),[l]);t.useEffect((function(){F&&q()}),[F,q]);var H=t.useMemo((function(){return{ready:i&&x,modelDownloadProgress:(a+C)/2,modelError:j,start:s,stop:u,thresholds:U,setThresholds:_,onPredictionMade:B,detectionTime:p,focusPredictionTime:D,getBestFrame:z,resetBestFrame:q,bestFrameDetails:S,requiredDocumentType:F,setRequiredDocumentType:P}}),[S,p,a,i,C,x,D,z,j,B,F,q,_,s,u,U]);return t.createElement(bf.Provider,{value:H},t.createElement(Ve,{key:V,ref:A}),n)}function Cf(e){var n=e.children,r=p(e,["children"]);return t.createElement(pf,f({},r),t.createElement(mf,f({},r),t.createElement(xf,f({},r),n)))}function wf(e,n,r){var o=this,i=t.useRef(null),a=t.useRef(0),s=t.useRef(null),u=t.useRef([]),c=t.useRef(),l=t.useRef(),d=t.useRef(e),f=t.useRef(!0);d.current=e;var p="undefined"!=typeof window,h=!n&&0!==n&&p;if("function"!=typeof e)throw new TypeError("Expected a function");n=+n||0;var m=!!(r=r||{}).leading,g=!("trailing"in r)||!!r.trailing,v="maxWait"in r,y="debounceOnServer"in r&&!!r.debounceOnServer,b=v?Math.max(+r.maxWait||0,n):null;t.useEffect((function(){return f.current=!0,function(){f.current=!1}}),[]);var x=t.useMemo((function(){var e=function(e){var t=u.current,n=c.current;return u.current=c.current=null,a.current=e,l.current=d.current.apply(n,t)},t=function(e,t){h&&cancelAnimationFrame(s.current),s.current=h?requestAnimationFrame(e):setTimeout(e,t)},r=function(e){if(!f.current)return!1;var t=e-i.current;return!i.current||t>=n||t<0||v&&e-a.current>=b},x=function(t){return s.current=null,g&&u.current?e(t):(u.current=c.current=null,l.current)},C=function e(){var o=Date.now();if(r(o))return x(o);if(f.current){var s=n-(o-i.current),u=v?Math.min(s,b-(o-a.current)):s;t(e,u)}},w=function(){if(p||y){var d=Date.now(),h=r(d);if(u.current=[].slice.call(arguments),c.current=o,i.current=d,h){if(!s.current&&f.current)return a.current=i.current,t(C,n),m?e(i.current):l.current;if(v)return t(C,n),e(i.current)}return s.current||t(C,n),l.current}};return w.cancel=function(){s.current&&(h?cancelAnimationFrame(s.current):clearTimeout(s.current)),a.current=0,u.current=i.current=c.current=s.current=null},w.isPending=function(){return!!s.current},w.flush=function(){return s.current?x(Date.now()):l.current},w}),[m,v,n,b,g,h,p,y]);return x}var Ef=["idCardFront","idCardBack","passport","selfie"],kf={idCardFront:["idCardFront"],idCardBack:["idCardBack"],passport:["passport"],idCard:["idCardFront","idCardBack"],idCardAndPassport:["idCardFront","idCardBack","passport"],idCardOrPassport:["idCardFront","idCardBack","passport"]};function Df(e){return"idCardOrPassport"===e?1:kf[e].length}var Mf={initialDrawComplete:!1,redrawing:!1,guideRectX:0,guideRectY:0,guideRectWidth:0,guideRectHeight:0,guideRectOffsetTop:0,guideImageWidth:0,guideImageHeight:0,pageWidth:0,pageHeight:0,videoWidth:0,videoHeight:0,detectedObjects:[],bestDocument:void 0,detectedDocumentType:"none",detectionThresholdMet:!1,documentInBounds:!1,documentTooClose:!1,flipRequired:!1,backDetectedFirst:!1,idCardFrontDetectionScore:0,idCardFrontDetectionThresholdMet:!1,idCardBackDetectionScore:0,idCardBackDetectionThresholdMet:!1,passportDetectionScore:0,passportDetectionThresholdMet:!1,focusScore:0,focusThresholdMet:!1,isGoodFrame:!1,goodFramesCount:0,goodFramesThreshold:3,goodFramesThresholdMet:!1,lastFrameCapturedAt:null,frameCaptureRate:0,capturing:!1,captureFailed:!1,imageUrl:null,captureState:"capturing",capturedDocuments:{},captureRequirement:"idCardOrPassport",requestedDocumentType:"idCardFront",allowIdCardBackToFrontCapture:!1,operationStartedAt:null,captureStartedAt:null},Tf=t.createContext(Mf),If=t.createContext((function(){})),Sf=function(e,t){var n,r;switch(t.type){case"configureWizard":var o=t.payload,i=o.captureRequirement,a=o.precapturedDocuments,s=o.allowIdCardBackToFrontCapture,u=f(f({},e),{captureRequirement:i,allowIdCardBackToFrontCapture:null!=s&&s});if("idCardBack"===i&&(u.requestedDocumentType="idCardBack"),"passport"===i&&(u.requestedDocumentType="passport"),a)for(var c=0,l=Ef;c<l.length;c++){var d=l[c],p=a[d];p&&(u.requestedDocumentType=d,u=Sf(u,{type:"documentCaptured",payload:p}))}return u.operationStartedAt=new Date,u;case"setRequiredDocumentType":return f(f({},e),{requiredDocumentType:t.payload});case"redrawRequested":return f(f({},e),{redrawing:!0,guideRectX:0,guideRectY:0,guideRectWidth:0,guideRectHeight:0,guideRectOffsetTop:0});case"redrawInProgress":return f(f({},e),{redrawing:!1,guideRectX:0,guideRectY:0,guideRectWidth:0,guideRectHeight:0,guideRectOffsetTop:0});case"redrawCompleted":return f(f(f({},e),t.payload),{initialDrawComplete:!0});case"pageRendered":return f(f({},e),t.payload);case"guideImageLoaded":return f(f({},e),{guideImageWidth:t.payload.width,guideImageHeight:t.payload.height});case"objectsDetected":var h=t.payload.prediction,m=h.detectedObjects,g=h.detectionThresholdMet,v=h.detectedDocumentType,y=h.idCardFrontDetectionScore,b=h.idCardFrontDetectionThresholdMet,x=h.idCardBackDetectionScore,C=h.idCardBackDetectionThresholdMet,w=h.passportDetectionScore,E=h.passportDetectionThresholdMet,k=h.bestDocument,D=h.documentInBounds,M=h.documentTooClose,T=h.focusScore,I=h.focusThresholdMet,S=h.frameWidth,N=h.frameHeight,A=new Date,L=0,O=e.goodFramesThreshold;e.lastFrameCapturedAt&&(L=1e3/(A.getTime()-e.lastFrameCapturedAt.getTime()))>0&&(O=Math.ceil(3*L));var R=!e.allowIdCardBackToFrontCapture&&"idCardBack"===e.requestedDocumentType&&"idCardFront"===v,F=e.allowIdCardBackToFrontCapture?"idCardBack"in e.capturedDocuments&&"idCardBack"===v:e.requestedDocumentType.includes("idCardFront")&&"idCardBack"===v,P=g&&D&&!M&&!R&&!F&&I,U=e.goodFramesCount;P&&(U+=1);var _=U>=O,j=e.requestedDocumentType;return e.captureRequirement.includes("idCard")&&e.allowIdCardBackToFrontCapture&&("idCardFront"!==v||"idCardFront"===e.requestedDocumentType||"idCardFront"in e.capturedDocuments?"idCardBack"!==v||"idCardBack"===e.requestedDocumentType||"idCardBack"in e.capturedDocuments||(j="idCardBack"):j="idCardFront"),"idCardOrPassport"===e.captureRequirement&&("passport"===v&&"passport"!==e.requestedDocumentType&&(j="passport"),"passport"===j&&w<.3&&(j="idCardFront"in e.capturedDocuments?"idCardBack":"idCardFront")),f(f({},e),{videoWidth:S,videoHeight:N,detectedObjects:m,bestDocument:k,requestedDocumentType:j,detectedDocumentType:v,detectionThresholdMet:g,documentInBounds:D,documentTooClose:M,flipRequired:R,backDetectedFirst:F,idCardFrontDetectionScore:y,idCardFrontDetectionThresholdMet:b,idCardBackDetectionScore:x,idCardBackDetectionThresholdMet:C,passportDetectionScore:w,passportDetectionThresholdMet:E,focusScore:T,focusThresholdMet:I,isGoodFrame:P,goodFramesCount:U,goodFramesThreshold:O,goodFramesThresholdMet:_,lastFrameCapturedAt:A,frameCaptureRate:L});case"captureStarted":return f(f({},e),{captureStartedAt:new Date,capturing:!1,captureFailed:!1});case"capturing":return f(f({},e),{capturing:!0,captureFailed:!1});case"captured":return f(f({},e),{capturing:!1,captureFailed:!1});case"frameCaptured":return f(f({},e),{imageUrl:t.payload.imageUrl});case"captureFailed":return f(f({},e),{capturing:!1,captureFailed:!0});case"documentCaptured":var B=f(f({},e),{capturing:!1,captureFailed:!1,goodFramesCount:0,capturedDocuments:f(f({},e.capturedDocuments),(n={},n[t.payload.documentType]=t.payload,n))}),z=kf[e.captureRequirement].filter((function(e){return!(e in B.capturedDocuments)}));return"idCardOrPassport"===e.captureRequirement&&(z="passport"===e.requestedDocumentType?[]:z.filter((function(e){return"passport"!==e}))),0===z.length?B.captureState="complete":(B.requestedDocumentType=z[0],("idCardFront"===e.requestedDocumentType&&"idCardBack"===B.requestedDocumentType||"idCardBack"===e.requestedDocumentType&&"idCardFront"===B.requestedDocumentType)&&(B.captureState="requestingFlip",B.idCardFrontDetectionThresholdMet=!1,B.idCardBackDetectionThresholdMet=!1,B.passportDetectionThresholdMet=!1)),B;case"documentCapturedManually":var G=f(f({},e),{capturedDocuments:f(f({},e.capturedDocuments),(r={},r[e.requestedDocumentType]=f(f({},t.payload),{width:0,height:0}),r))});z=kf[e.captureRequirement].filter((function(e){return!(e in G.capturedDocuments)}));return"idCardOrPassport"===e.captureRequirement&&(z="passport"===e.requestedDocumentType?[]:z.filter((function(e){return"passport"!==e}))),0===z.length?G.captureState="complete":(G.requestedDocumentType=z[0],("idCardFront"===e.requestedDocumentType&&"idCardBack"===G.requestedDocumentType||"idCardBack"===e.requestedDocumentType&&"idCardFront"===G.requestedDocumentType)&&(G.captureState="requestingFlip",G.idCardFrontDetectionThresholdMet=!1,G.idCardBackDetectionThresholdMet=!1,G.passportDetectionThresholdMet=!1)),G;case"flipRequestCompleted":return f(f({},e),{captureState:"capturing"});case"resetWizard":return f(f({},Mf),{captureRequirement:e.captureRequirement,allowIdCardBackToFrontCapture:e.allowIdCardBackToFrontCapture});default:return e}},Nf=function(e){var n=e.children,r=t.useReducer(Sf,Mf),o=r[0],i=r[1],a=wf((function(){i({type:"redrawRequested"})}),500);return t.useLayoutEffect((function(){if("undefined"!=typeof window)return window.addEventListener("resize",a),function(){window.removeEventListener("resize",a)}}),[a]),t.createElement(Tf.Provider,{value:o},t.createElement(If.Provider,{value:i},n))},Af=function(){var e=t.useContext(Tf),n=t.useContext(If);if(!e||!n)throw new Error("useIdCaptureState cannot be used without IdCaptureStateProvider");return[e,n]};function Lf(e){var n=t.createElement(Of,null,e.children),r=document.getElementById("idmission-above-guides-content");return r?a.createPortal(n,r):n}var Of=o.span(_f||(_f=v(["\n font-size: 16px;\n font-family: monospace;\n position: absolute;\n left: 20px;\n bottom: 20px;\n margin-right: 20px;\n padding: 8px;\n color: limegreen;\n background: rgba(0, 0, 0, 0.5);\n z-index: 10002;\n"],["\n font-size: 16px;\n font-family: monospace;\n position: absolute;\n left: 20px;\n bottom: 20px;\n margin-right: 20px;\n padding: 8px;\n color: limegreen;\n background: rgba(0, 0, 0, 0.5);\n z-index: 10002;\n"]))),Rf=o.div(jf||(jf=v(["\n position: absolute;\n z-index: 1001;\n width: 100%;\n height: 100%;\n max-width: 100%;\n max-height: 100%;\n overflow: hidden;\n ","\n"],["\n position: absolute;\n z-index: 1001;\n width: 100%;\n height: 100%;\n max-width: 100%;\n max-height: 100%;\n overflow: hidden;\n ","\n"])),(function(e){return e.$flipX?"transform: scaleX(-1);":""})),Ff=o.div(Bf||(Bf=v(["\n font: 10px monospace;\n position: absolute;\n border: 3px solid ",";\n color: ",";\n ","\n"],["\n font: 10px monospace;\n position: absolute;\n border: 3px solid ",";\n color: ",";\n ","\n"])),(function(e){var t=e.$color;return null!=t?t:"green"}),(function(e){var t=e.$color;return null!=t?t:"green"}),(function(e){return e.$flipX?"transform: scaleX(-1);":""})),Pf=o.div(zf||(zf=v(["\n position: absolute;\n width: 4px;\n height: 4px;\n border: 2px solid ",";\n font: 10px monospace;\n color: ",";\n border-radius: 50%;\n ","\n"],["\n position: absolute;\n width: 4px;\n height: 4px;\n border: 2px solid ",";\n font: 10px monospace;\n color: ",";\n border-radius: 50%;\n ","\n"])),(function(e){var t=e.$color;return null!=t?t:"red"}),(function(e){var t=e.$color;return null!=t?t:"red"}),(function(e){return e.$flipX?"transform: scaleX(-1);":""}));function Uf(e){var n=e.enabled,r=void 0===n||n,o=e.pageWidth,i=e.pageHeight,a=e.videoWidth,s=e.videoHeight;return t.useMemo((function(){var e=!1,t=0,n=0,u=0,c=0;return r&&((e=o/i<a/s)?u=((t=a*(i/s))-o)/2:c=((n=s*(o/a))-i)/2),{horizontal:e,pageWidth:o,pageHeight:i,videoWidth:a,videoHeight:s,scaledWidth:t,scaledHeight:n,xOffset:u,yOffset:c}}),[r,i,o,s,a])}var _f,jf,Bf,zf,Gf=function(e){var n=e.scaling,r=e.$flipX,o=e.children,i=Af()[0];return t.createElement(Rf,{id:"debug-overlay-div",$flipX:r,style:{top:i.guideRectY,left:i.guideRectX,width:i.guideRectWidth||(null==n?void 0:n.pageWidth),height:i.guideRectHeight||(null==n?void 0:n.pageHeight)}},o)};function Vf(e){var n,r,o,i,a=e.obj,s=e.color,u=e.scaling,c=u.pageWidth,l=u.pageHeight,d=u.videoWidth,f=u.videoHeight,p=u.scaledWidth,h=u.scaledHeight;return d&&f&&c&&l?(u.horizontal?(n=a.box.yMin/f*l,r=a.box.xMin/d*p-u.xOffset,o=a.box.width/d*p,i=a.box.height/f*l):(n=a.box.yMin/f*h-u.yOffset,r=a.box.xMin/d*c,o=a.box.width/d*c,i=a.box.height/f*h),t.createElement(Ff,{$flipX:e.flipX,$color:void 0===s?"green":s,style:{top:n,left:r,width:o,height:i}})):t.createElement(t.Fragment,null)}function Wf(e){var n,r,o,i,a=e.face,s=e.flipX,u=e.color,c=e.scaling,l=c.pageWidth,d=c.pageHeight,f=c.videoWidth,p=c.videoHeight,h=c.scaledWidth,m=c.scaledHeight;return f&&p&&l&&d?(c.horizontal?(n=a.box.yMin/p*d,r=a.box.xMin/f*h-c.xOffset,o=a.box.width/f*h,i=a.box.height/p*d):(n=a.box.yMin/p*m-c.yOffset,r=a.box.xMin/f*l,o=a.box.width/f*l,i=a.box.height/p*m),t.createElement(t.Fragment,null,t.createElement(Ff,{$flipX:s,$color:void 0===u?"green":u,style:{top:n,left:r,width:o,height:i}}),a.keypoints.map((function(e,n){return t.createElement(qf,{key:n,point:e,scaling:c,flipX:s})})))):t.createElement(t.Fragment,null)}function qf(e){var n,r,o=e.point,i=e.color,a=e.scaling,s=a.videoWidth,u=a.videoHeight;return a.horizontal?(n=o.x/s*a.scaledWidth-a.xOffset,r=o.y/u*a.pageHeight):(n=o.x/s*a.pageWidth,r=o.y/u*a.scaledHeight-a.yOffset),t.createElement(Pf,{$flipX:e.flipX,$color:void 0===i?"red":i,style:{top:r-=2,left:n-=2}})}var Hf=[],Yf=Hf.forEach,Zf=Hf.slice;var Qf=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,$f=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};n&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+60*n*1e3)),r&&(o.domain=r),document.cookie=function(e,t,n){var r=n||{};r.path=r.path||"/";var o=encodeURIComponent(t),i="".concat(e,"=").concat(o);if(r.maxAge>0){var a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");i+="; Max-Age=".concat(Math.floor(a))}if(r.domain){if(!Qf.test(r.domain))throw new TypeError("option domain is invalid");i+="; Domain=".concat(r.domain)}if(r.path){if(!Qf.test(r.path))throw new TypeError("option path is invalid");i+="; Path=".concat(r.path)}if(r.expires){if("function"!=typeof r.expires.toUTCString)throw new TypeError("option expires is invalid");i+="; Expires=".concat(r.expires.toUTCString())}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i}(e,encodeURIComponent(t),o)},Xf=function(e){for(var t="".concat(e,"="),n=document.cookie.split(";"),r=0;r<n.length;r++){for(var o=n[r];" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(t))return o.substring(t.length,o.length)}return null},Kf={name:"cookie",lookup:function(e){var t;if(e.lookupCookie&&"undefined"!=typeof document){var n=Xf(e.lookupCookie);n&&(t=n)}return t},cacheUserLanguage:function(e,t){t.lookupCookie&&"undefined"!=typeof document&&$f(t.lookupCookie,e,t.cookieMinutes,t.cookieDomain,t.cookieOptions)}},Jf={name:"querystring",lookup:function(e){var t;if("undefined"!=typeof window){var n=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));for(var r=n.substring(1).split("&"),o=0;o<r.length;o++){var i=r[o].indexOf("=");if(i>0)r[o].substring(0,i)===e.lookupQuerystring&&(t=r[o].substring(i+1))}}return t}},ep=null,tp=function(){if(null!==ep)return ep;try{ep="undefined"!==window&&null!==window.localStorage;var e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){ep=!1}return ep},np={name:"localStorage",lookup:function(e){var t;if(e.lookupLocalStorage&&tp()){var n=window.localStorage.getItem(e.lookupLocalStorage);n&&(t=n)}return t},cacheUserLanguage:function(e,t){t.lookupLocalStorage&&tp()&&window.localStorage.setItem(t.lookupLocalStorage,e)}},rp=null,op=function(){if(null!==rp)return rp;try{rp="undefined"!==window&&null!==window.sessionStorage;var e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){rp=!1}return rp},ip={name:"sessionStorage",lookup:function(e){var t;if(e.lookupSessionStorage&&op()){var n=window.sessionStorage.getItem(e.lookupSessionStorage);n&&(t=n)}return t},cacheUserLanguage:function(e,t){t.lookupSessionStorage&&op()&&window.sessionStorage.setItem(t.lookupSessionStorage,e)}},ap={name:"navigator",lookup:function(e){var t=[];if("undefined"!=typeof navigator){if(navigator.languages)for(var n=0;n<navigator.languages.length;n++)t.push(navigator.languages[n]);navigator.userLanguage&&t.push(navigator.userLanguage),navigator.language&&t.push(navigator.language)}return t.length>0?t:void 0}},sp={name:"htmlTag",lookup:function(e){var t,n=e.htmlTag||("undefined"!=typeof document?document.documentElement:null);return n&&"function"==typeof n.getAttribute&&(t=n.getAttribute("lang")),t}},up={name:"path",lookup:function(e){var t;if("undefined"!=typeof window){var n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(n instanceof Array)if("number"==typeof e.lookupFromPathIndex){if("string"!=typeof n[e.lookupFromPathIndex])return;t=n[e.lookupFromPathIndex].replace("/","")}else t=n[0].replace("/","")}return t}},cp={name:"subdomain",lookup:function(e){var t="number"==typeof e.lookupFromSubdomainIndex?e.lookupFromSubdomainIndex+1:1,n="undefined"!=typeof window&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[t]}};var lp=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return at(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e||{languageUtils:{}},this.options=function(e){return Yf.call(Zf.call(arguments,1),(function(t){if(t)for(var n in t)void 0===e[n]&&(e[n]=t[n])})),e}(t,this.options||{},{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:function(e){return e}}),"string"==typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=function(e){return e.replace("-","_")}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(Kf),this.addDetector(Jf),this.addDetector(np),this.addDetector(ip),this.addDetector(ap),this.addDetector(sp),this.addDetector(up),this.addDetector(cp)}},{key:"addDetector",value:function(e){return this.detectors[e.name]=e,this}},{key:"detect",value:function(e){var t=this;e||(e=this.options.order);var n=[];return e.forEach((function(e){if(t.detectors[e]){var r=t.detectors[e].lookup(t.options);r&&"string"==typeof r&&(r=[r]),r&&(n=n.concat(r))}})),n=n.map((function(e){return t.options.convertDetectedLanguage(e)})),this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}},{key:"cacheUserLanguage",value:function(e,t){var n=this;t||(t=this.options.caches),t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach((function(t){n.detectors[t]&&n.detectors[t].cacheUserLanguage(e,n.options)})))}}]),e}();function dp(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return fp(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fp(e,t):void 0}}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function fp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}lp.type="languageDetector";var pp={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},hp=function(){function e(e){this.init(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}var t=e.prototype;return t.init=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||pp,this.options=t,this.debug=t.debug},t.log=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)},t.warn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)},t.error=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")},t.deprecate=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)},t.forward=function(e,t,n,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]=""+n+this.prefix+" "+e[0]),this.logger[t](e))},t.create=function(t){return new e(this.logger,G({},{prefix:this.prefix+":"+t+":"},this.options))},t.clone=function(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new e(this.logger,t)},e}(),mp=new hp,gp=function(){function e(){this.observers={}}var t=e.prototype;return t.on=function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]||(n.observers[e]=new Map);var r=n.observers[e].get(t)||0;n.observers[e].set(t,r+1)})),this},t.off=function(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])},t.emit=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.observers[e]&&Array.from(this.observers[e].entries()).forEach((function(e){for(var t=e[0],r=e[1],o=0;o<r;o++)t.apply(void 0,n)}));this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach((function(t){for(var r=t[0],o=t[1],i=0;i<o;i++)r.apply(r,[e].concat(n))}))},e}();function vp(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function yp(e){return null==e?"":""+e}var bp=/###/g;function xp(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(bp,"."):e}function o(){return!e||"string"==typeof e}for(var i="string"!=typeof t?t:t.split("."),a=0;a<i.length-1;){if(o())return{};var s=r(i[a]);!e[s]&&n&&(e[s]=new n),e=Object.prototype.hasOwnProperty.call(e,s)?e[s]:{},++a}return o()?{}:{obj:e,k:r(i[a])}}function Cp(e,t,n){var r=xp(e,t,Object),o=r.obj,i=r.k;if(void 0===o&&1!==t.length){for(var a=t[t.length-1],s=t.slice(0,t.length-1),u=xp(e,s,Object);void 0===u.obj&&s.length;)a=s[s.length-1]+"."+a,(u=xp(e,s=s.slice(0,s.length-1),Object))&&u.obj&&void 0!==u.obj[u.k+"."+a]&&(u.obj=void 0);u.obj[u.k+"."+a]=n}else o[i]=n}function wp(e,t){var n=xp(e,t),r=n.obj;if(r)return r[n.k]}function Ep(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):Ep(e[r],t[r],n):e[r]=t[r]);return e}function kp(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Dp={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function Mp(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return Dp[e]})):e}var Tp=[" ",",","?","!",";"],Ip=new(function(){function e(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}return e.prototype.getRegExp=function(e){var t=this.regExpMap.get(e);if(void 0!==t)return t;var n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n},e}())(20);function Sp(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),o=e,i=0;i<r.length;){if(!o||"object"!=typeof o)return;for(var a=void 0,s="",u=i;u<r.length;++u)if(u!==i&&(s+=n),void 0!==(a=o[s+=r[u]])){if(["string","number","boolean"].indexOf(typeof a)>-1&&u<r.length-1)continue;i+=u-i+1;break}o=a}return o}}function Np(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}var Ap=function(e){function t(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return(n=e.call(this)||this).data=t||{},n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),void 0===n.options.ignoreJSONStructure&&(n.options.ignoreJSONStructure=!0),n}lt(t,e);var n=t.prototype;return n.addNamespaces=function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)},n.removeNamespaces=function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)},n.getResource=function(e,t,n){var r,o,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,s=void 0!==i.ignoreJSONStructure?i.ignoreJSONStructure:this.options.ignoreJSONStructure;if(e.indexOf(".")>-1)r=e.split(".");else if(r=[e,t],n)if(Array.isArray(n))(o=r).push.apply(o,n);else if("string"==typeof n&&a){var u;(u=r).push.apply(u,n.split(a))}else r.push(n);var c=wp(this.data,r);return!c&&!t&&!n&&e.indexOf(".")>-1&&(e=r[0],t=r[1],n=r.slice(2).join(".")),c||!s||"string"!=typeof n?c:Sp(this.data&&this.data[e]&&this.data[e][t],n,a)},n.addResource=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(r=t,t=(a=e.split("."))[1]),this.addNamespaces(t),Cp(this.data,a,r),o.silent||this.emit("added",e,t,n,r)},n.addResources=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var o in n)("string"==typeof n[o]||Array.isArray(n[o]))&&this.addResource(e,t,o,n[o],{silent:!0});r.silent||this.emit("added",e,t,n)},n.addResourceBundle=function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1,skipCopy:!1},a=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var s=wp(this.data,a)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Ep(s,n,o):s=G({},s,n),Cp(this.data,a,s),i.silent||this.emit("added",e,t,n)},n.removeResourceBundle=function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)},n.hasResourceBundle=function(e,t){return void 0!==this.getResource(e,t)},n.getResourceBundle=function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?G({},{},this.getResource(e,t)):this.getResource(e,t)},n.getDataByLanguage=function(e){return this.data[e]},n.hasLanguageSomeTranslations=function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))},n.toJSON=function(){return this.data},t}(gp),Lp={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,o){var i=this;return e.forEach((function(e){i.processors[e]&&(t=i.processors[e].process(t,n,r,o))})),t}},Op={},Rp=function(e){function t(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(e,t,n){e.forEach((function(e){t[e]&&(n[e]=t[e])}))}(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,n=e.call(this)||this),n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=mp.create("translator"),n}lt(t,e);var n=t.prototype;return n.changeLanguage=function(e){e&&(this.language=e)},n.exists=function(e){if(null==e)return!1;var t=this.resolve(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}});return t&&void 0!==t.res},n.extractFromKey=function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS||[],i=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";var r=Tp.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===r.length)return!0;var o=Ip.getRegExp("("+r.map((function(e){return"?"===e?"\\?":e})).join("|")+")"),i=!o.test(e);if(!i){var a=e.indexOf(n);a>0&&!o.test(e.substring(0,a))&&(i=!0)}return i}(e,n,r));if(i&&!a){var s=e.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:e,namespaces:o};var u=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(u[0])>-1)&&(o=u.shift()),e=u.join(r)}return"string"==typeof o&&(o=[o]),{key:e,namespaces:o}},n.translate=function(e,n,r){var o=this;if("object"!=typeof n&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof n&&(n=G({},n)),n||(n={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var i=void 0!==n.returnDetails?n.returnDetails:this.options.returnDetails,a=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,s=this.extractFromKey(e[e.length-1],n),u=s.key,c=s.namespaces,l=c[c.length-1],d=n.lng||this.language,f=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(f){var p=n.nsSeparator||this.options.nsSeparator;return i?{res:""+l+p+u,usedKey:u,exactUsedKey:u,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:""+l+p+u}return i?{res:u,usedKey:u,exactUsedKey:u,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:u}var h=this.resolve(e,n),m=h&&h.res,g=h&&h.usedKey||u,v=h&&h.exactUsedKey||u,y=Object.prototype.toString.apply(m),b=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject;if(x&&m&&("string"!=typeof m&&"boolean"!=typeof m&&"number"!=typeof m)&&["[object Number]","[object Function]","[object RegExp]"].indexOf(y)<0&&("string"!=typeof b||!Array.isArray(m))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var C=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,m,G({},n,{ns:c})):"key '"+u+" ("+this.language+")' returned an object instead of string.";return i?(h.res=C,h.usedParams=this.getUsedParamsDetails(n),h):C}if(a){var w=Array.isArray(m),E=w?[]:{},k=w?v:g;for(var D in m)if(Object.prototype.hasOwnProperty.call(m,D)){var M=""+k+a+D;E[D]=this.translate(M,G({},n,{joinArrays:!1,ns:c})),E[D]===M&&(E[D]=m[D])}m=E}}else if(x&&"string"==typeof b&&Array.isArray(m))(m=m.join(b))&&(m=this.extendTranslation(m,e,n,r));else{var T=!1,I=!1,S=void 0!==n.count&&"string"!=typeof n.count,N=t.hasDefaultValue(n),A=S?this.pluralResolver.getSuffix(d,n.count,n):"",L=n.ordinal&&S?this.pluralResolver.getSuffix(d,n.count,{ordinal:!1}):"",O=S&&!n.ordinal&&0===n.count&&this.pluralResolver.shouldUseIntlApi(),R=O&&n["defaultValue"+this.options.pluralSeparator+"zero"]||n["defaultValue"+A]||n["defaultValue"+L]||n.defaultValue;!this.isValidLookup(m)&&N&&(T=!0,m=R),this.isValidLookup(m)||(I=!0,m=u);var F=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&I?void 0:m,P=N&&R!==m&&this.options.updateMissing;if(I||T||P){if(this.logger.log(P?"updateKey":"missingKey",d,l,u,P?R:m),a){var U=this.resolve(u,G({},n,{keySeparator:!1}));U&&U.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var _=[],j=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&j&&j[0])for(var B=0;B<j.length;B++)_.push(j[B]);else"all"===this.options.saveMissingTo?_=this.languageUtils.toResolveHierarchy(n.lng||this.language):_.push(n.lng||this.language);var z=function(e,t,r){var i=N&&r!==m?r:F;o.options.missingKeyHandler?o.options.missingKeyHandler(e,l,t,i,P,n):o.backendConnector&&o.backendConnector.saveMissing&&o.backendConnector.saveMissing(e,l,t,i,P,n),o.emit("missingKey",e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&S?_.forEach((function(e){var t=o.pluralResolver.getSuffixes(e,n);O&&n["defaultValue"+o.options.pluralSeparator+"zero"]&&t.indexOf(o.options.pluralSeparator+"zero")<0&&t.push(o.options.pluralSeparator+"zero"),t.forEach((function(t){z([e],u+t,n["defaultValue"+t]||R)}))})):z(_,u,R))}m=this.extendTranslation(m,e,n,h,r),I&&m===u&&this.options.appendNamespaceToMissingKey&&(m=l+":"+u),(I||T)&&this.options.parseMissingKeyHandler&&(m="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?l+":"+u:u,T?m:void 0):this.options.parseMissingKeyHandler(m))}return i?(h.res=m,h.usedParams=this.getUsedParamsDetails(n),h):m},n.extendTranslation=function(e,t,n,r,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,G({},this.options.interpolation.defaultVariables,n),n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(G({},n,{interpolation:G({},this.options.interpolation,n.interpolation)}));var a,s="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(s){var u=e.match(this.interpolator.nestingRegexp);a=u&&u.length}var c=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(c=G({},this.options.interpolation.defaultVariables,c)),e=this.interpolator.interpolate(e,c,n.lng||this.language||r.usedLng,n),s){var l=e.match(this.interpolator.nestingRegexp);a<(l&&l.length)&&(n.nest=!1)}!n.lng&&"v1"!==this.options.compatibilityAPI&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return o&&o[0]===r[0]&&!n.context?(i.logger.warn("It seems you are nesting recursively key: "+r[0]+" in key: "+t[0]),null):i.translate.apply(i,r.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var d=n.postProcess||this.options.postProcess,f="string"==typeof d?[d]:d;return null!=e&&f&&f.length&&!1!==n.applyPostProcessor&&(e=Lp.handle(f,e,t,this.options&&this.options.postProcessPassResolved?G({i18nResolved:G({},r,{usedParams:this.getUsedParamsDetails(n)})},n):n,this)),e},n.resolve=function(e){var t,n,r,o,i,a=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!a.isValidLookup(t)){var u=a.extractFromKey(e,s),c=u.key;n=c;var l=u.namespaces;a.options.fallbackNS&&(l=l.concat(a.options.fallbackNS));var d=void 0!==s.count&&"string"!=typeof s.count,f=d&&!s.ordinal&&0===s.count&&a.pluralResolver.shouldUseIntlApi(),p=void 0!==s.context&&("string"==typeof s.context||"number"==typeof s.context)&&""!==s.context,h=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);l.forEach((function(e){a.isValidLookup(t)||(i=e,!Op[h[0]+"-"+e]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(i)&&(Op[h[0]+"-"+e]=!0,a.logger.warn('key "'+n+'" for languages "'+h.join(", ")+'" won\'t get resolved as namespace "'+i+'" was not yet loaded',"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),h.forEach((function(n){if(!a.isValidLookup(t)){o=n;var i,u=[c];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(u,c,n,e,s);else{var l;d&&(l=a.pluralResolver.getSuffix(n,s.count,s));var h=a.options.pluralSeparator+"zero",m=a.options.pluralSeparator+"ordinal"+a.options.pluralSeparator;if(d&&(u.push(c+l),s.ordinal&&0===l.indexOf(m)&&u.push(c+l.replace(m,a.options.pluralSeparator)),f&&u.push(c+h)),p){var g=""+c+a.options.contextSeparator+s.context;u.push(g),d&&(u.push(g+l),s.ordinal&&0===l.indexOf(m)&&u.push(g+l.replace(m,a.options.pluralSeparator)),f&&u.push(g+h))}}for(;i=u.pop();)a.isValidLookup(t)||(r=i,t=a.getResource(n,e,i,s))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}},n.isValidLookup=function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)},n.getResource=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)},n.getUsedParamsDetails=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.replace&&"string"!=typeof e.replace,n=t?e.replace:e;if(t&&void 0!==e.count&&(n.count=e.count),this.options.interpolation.defaultVariables&&(n=G({},this.options.interpolation.defaultVariables,n)),!t){n=G({},n);for(var r,o=dp(["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"]);!(r=o()).done;){delete n[r.value]}}return n},t.hasDefaultValue=function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,12)&&void 0!==e[n])return!0;return!1},t}(gp);function Fp(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Pp=function(){function e(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=mp.create("languageUtils")}var t=e.prototype;return t.getScriptPartFromCode=function(e){if(!(e=Np(e))||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))},t.getLanguagePartFromCode=function(e){if(!(e=Np(e))||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])},t.formatLanguageCode=function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Fp(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Fp(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=Fp(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e},t.isSupportedCode=function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1},t.getBestMatchFromCodes=function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){return e===r?e:e.indexOf("-")<0&&r.indexOf("-")<0?void 0:e.indexOf("-")>0&&r.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===r||0===e.indexOf(r)&&r.length>1?e:void 0}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null},t.getFallbackCodes=function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]},t.toResolveHierarchy=function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),o=[],i=function(e){e&&(n.isSupportedCode(e)?o.push(e):n.logger.warn("rejecting language code not found in supportedLngs: "+e))};return"string"==typeof e&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):"string"==typeof e&&i(this.formatLanguageCode(e)),r.forEach((function(e){o.indexOf(e)<0&&i(n.formatLanguageCode(e))})),o},e}(),Up=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],_p={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},jp=["v1","v2","v3"],Bp=["v4"],zp={zero:0,one:1,two:2,few:3,many:4,other:5};var Gp=function(){function e(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=n,this.logger=mp.create("pluralResolver"),this.options.compatibilityJSON&&!Bp.includes(this.options.compatibilityJSON)||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(t={},Up.forEach((function(e){e.lngs.forEach((function(n){t[n]={numbers:e.nr,plurals:_p[e.fc]}}))})),t)}var t=e.prototype;return t.addRule=function(e,t){this.rules[e]=t},t.getRule=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(Np("dev"===e?"en":e),{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]},t.needsPlural=function(e){var t=this.getRule(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return this.shouldUseIntlApi()?t&&t.resolvedOptions().pluralCategories.length>1:t&&t.numbers.length>1},t.getPluralFormsOfKey=function(e,t){return this.getSuffixes(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).map((function(e){return""+t+e}))},t.getSuffixes=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((function(e,t){return zp[e]-zp[t]})).map((function(e){return t.options.prepend+(n.ordinal?"ordinal"+t.options.prepend:"")+e})):r.numbers.map((function(r){return t.getSuffix(e,r,n)})):[]},t.getSuffix=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?this.options.prepend+(n.ordinal?"ordinal"+this.options.prepend:"")+r.select(t):this.getSuffixRetroCompatible(r,t):(this.logger.warn("no plural rule found for: "+e),"")},t.getSuffixRetroCompatible=function(e,t){var n=this,r=e.plurals(e.noAbs?t:Math.abs(t)),o=e.numbers[r];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var i=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_"+o.toString():i():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?i():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()},t.shouldUseIntlApi=function(){return!jp.includes(this.options.compatibilityJSON)},e}();function Vp(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=function(e,t,n){var r=wp(e,n);return void 0!==r?r:wp(t,n)}(e,t,n);return!i&&o&&"string"==typeof n&&void 0===(i=Sp(e,n,r))&&(i=Sp(t,n,r)),i}var Wp=function(){function e(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=mp.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||function(e){return e},this.init(e)}var t=e.prototype;return t.init=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation,n=t.escape,r=t.escapeValue,o=t.useRawValueToEscape,i=t.prefix,a=t.prefixEscaped,s=t.suffix,u=t.suffixEscaped,c=t.formatSeparator,l=t.unescapeSuffix,d=t.unescapePrefix,f=t.nestingPrefix,p=t.nestingPrefixEscaped,h=t.nestingSuffix,m=t.nestingSuffixEscaped,g=t.nestingOptionsSeparator,v=t.maxReplaces,y=t.alwaysFormat;this.escape=void 0!==n?n:Mp,this.escapeValue=void 0===r||r,this.useRawValueToEscape=void 0!==o&&o,this.prefix=i?kp(i):a||"{{",this.suffix=s?kp(s):u||"}}",this.formatSeparator=c||",",this.unescapePrefix=l?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":l||"",this.nestingPrefix=f?kp(f):p||kp("$t("),this.nestingSuffix=h?kp(h):m||kp(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=v||1e3,this.alwaysFormat=void 0!==y&&y,this.resetRegExp()},t.reset=function(){this.options&&this.init(this.options)},t.resetRegExp=function(){var e=function(e,t){return e&&e.source===t?(e.lastIndex=0,e):new RegExp(t,"g")};this.regexp=e(this.regexp,this.prefix+"(.+?)"+this.suffix),this.regexpUnescape=e(this.regexpUnescape,""+this.prefix+this.unescapePrefix+"(.+?)"+this.unescapeSuffix+this.suffix),this.nestingRegexp=e(this.nestingRegexp,this.nestingPrefix+"(.+?)"+this.nestingSuffix)},t.interpolate=function(e,t,n,r){var o,i,a,s=this,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var l=function(e){if(e.indexOf(s.formatSeparator)<0){var o=Vp(t,u,e,s.options.keySeparator,s.options.ignoreJSONStructure);return s.alwaysFormat?s.format(o,void 0,n,G({},r,t,{interpolationkey:e})):o}var i=e.split(s.formatSeparator),a=i.shift().trim(),c=i.join(s.formatSeparator).trim();return s.format(Vp(t,u,a,s.options.keySeparator,s.options.ignoreJSONStructure),c,n,G({},r,t,{interpolationkey:a}))};this.resetRegExp();var d=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,f=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return c(s.escapeValue?s.escape(e):e)}}].forEach((function(t){for(a=0;o=t.regex.exec(e);){var n=o[1].trim();if(void 0===(i=l(n)))if("function"==typeof d){var u=d(e,o,r);i="string"==typeof u?u:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))i="";else{if(f){i=o[0];continue}s.logger.warn("missed to pass in variable "+n+" for interpolating "+e),i=""}else"string"==typeof i||s.useRawValueToEscape||(i=yp(i));var c=t.safeValue(i);if(e=e.replace(o[0],c),f?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,++a>=s.maxReplaces)break}})),e},t.nest=function(e,t){var n,r,o,i=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function s(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp(n+"[ ]*{")),i="{"+r[1];e=r[0];var a=(i=this.interpolate(i,o)).match(/'/g),s=i.match(/"/g);(a&&a.length%2==0&&!s||s.length%2!=0)&&(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o=G({},t,o))}catch(t){return this.logger.warn("failed parsing options string in nesting for key "+e,t),""+e+n+i}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,e}for(;n=this.nestingRegexp.exec(e);){var u=[];(o=(o=G({},a)).replace&&"string"!=typeof o.replace?o.replace:o).applyPostProcessor=!1,delete o.defaultValue;var c=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var l=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=l.shift(),u=l,c=!0}if((r=t(s.call(this,n[1].trim(),o),o))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=yp(r)),r||(this.logger.warn("missed to resolve "+n[1]+" for nesting "+e),r=""),c&&(r=u.reduce((function(e,t){return i.format(e,t,a.lng,G({},a,{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e},e}();function qp(e){var t={};return function(n,r,o){var i=r+JSON.stringify(o),a=t[i];return a||(a=e(Np(r),o),t[i]=a),a(n)}}var Hp=function(){function e(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=mp.create("formatter"),this.options=e,this.formats={number:qp((function(e,t){var n=new Intl.NumberFormat(e,G({},t));return function(e){return n.format(e)}})),currency:qp((function(e,t){var n=new Intl.NumberFormat(e,G({},t,{style:"currency"}));return function(e){return n.format(e)}})),datetime:qp((function(e,t){var n=new Intl.DateTimeFormat(e,G({},t));return function(e){return n.format(e)}})),relativetime:qp((function(e,t){var n=new Intl.RelativeTimeFormat(e,G({},t));return function(e){return n.format(e,t.range||"day")}})),list:qp((function(e,t){var n=new Intl.ListFormat(e,G({},t));return function(e){return n.format(e)}}))},this.init(e)}var t=e.prototype;return t.init=function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||","},t.add=function(e,t){this.formats[e.toLowerCase().trim()]=t},t.addCached=function(e,t){this.formats[e.toLowerCase().trim()]=qp(t)},t.format=function(e,t,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=t.split(this.formatSeparator).reduce((function(e,t){var i=function(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var o=r[1].substring(0,r[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach((function(e){if(e){var t=e.split(":"),r=t[0],o=t.slice(1).join(":").trim().replace(/^'+|'+$/g,""),i=r.trim();n[i]||(n[i]=o),"false"===o&&(n[i]=!1),"true"===o&&(n[i]=!0),isNaN(o)||(n[i]=parseInt(o,10))}}))}return{formatName:t,formatOptions:n}}(t),a=i.formatName,s=i.formatOptions;if(r.formats[a]){var u=e;try{var c=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{};u=r.formats[a](e,c.locale||c.lng||o.locale||o.lng||n,G({},s,o,c))}catch(e){r.logger.warn(e)}return u}return r.logger.warn("there was no format function for "+a),e}),e);return i},e}();var Yp=function(e){function t(t,n,r){var o,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return(o=e.call(this)||this).backend=t,o.store=n,o.services=r,o.languageUtils=r.languageUtils,o.options=i,o.logger=mp.create("backendConnector"),o.waitingReads=[],o.maxParallelReads=i.maxParallelReads||10,o.readingCalls=0,o.maxRetries=i.maxRetries>=0?i.maxRetries:5,o.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(r,i.backend,i),o}lt(t,e);var n=t.prototype;return n.queueLoad=function(e,t,n,r){var o=this,i={},a={},s={},u={};return e.forEach((function(e){var r=!0;t.forEach((function(t){var s=e+"|"+t;!n.reload&&o.store.hasResourceBundle(e,t)?o.state[s]=2:o.state[s]<0||(1===o.state[s]?void 0===a[s]&&(a[s]=!0):(o.state[s]=1,r=!1,void 0===a[s]&&(a[s]=!0),void 0===i[s]&&(i[s]=!0),void 0===u[t]&&(u[t]=!0)))})),r||(s[e]=!0)})),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(u)}},n.loaded=function(e,t,n){var r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),n&&this.store.addResourceBundle(o,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2;var a={};this.queue.forEach((function(n){!function(e,t,n){var r=xp(e,t,Object),o=r.obj,i=r.k;o[i]=o[i]||[],o[i].push(n)}(n.loaded,[o],i),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((function(e){a[e]||(a[e]={});var t=n.loaded[e];t.length&&t.forEach((function(t){void 0===a[e][t]&&(a[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(e){return!e.done}))},n.read=function(e,t,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads)this.waitingReads.push({lng:e,ns:t,fcName:n,tried:o,wait:i,callback:a});else{this.readingCalls++;var s=function(s,u){if(r.readingCalls--,r.waitingReads.length>0){var c=r.waitingReads.shift();r.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}s&&u&&o<r.maxRetries?setTimeout((function(){r.read.call(r,e,t,n,o+1,2*i,a)}),i):a(s,u)},u=this.backend[n].bind(this.backend);if(2!==u.length)return u(e,t,s);try{var c=u(e,t);c&&"function"==typeof c.then?c.then((function(e){return s(null,e)})).catch(s):s(null,c)}catch(e){s(e)}}},n.prepareLoading=function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var i=this.queueLoad(e,t,r,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach((function(e){n.loadOne(e)}))},n.load=function(e,t,n){this.prepareLoading(e,t,{},n)},n.reload=function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)},n.loadOne=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),o=r[0],i=r[1];this.read(o,i,"read",void 0,void 0,(function(r,a){r&&t.logger.warn(n+"loading namespace "+i+" for language "+o+" failed",r),!r&&a&&t.logger.log(n+"loaded namespace "+i+" for language "+o,a),t.loaded(e,r,a)}))},n.saveMissing=function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn('did not save key "'+n+'" as the namespace "'+t+'" was not yet loaded',"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(null!=n&&""!==n){if(this.backend&&this.backend.create){var s=G({},i,{isUpdate:o}),u=this.backend.create.bind(this.backend);if(u.length<6)try{var c;(c=5===u.length?u(e,t,n,r,s):u(e,t,n,r))&&"function"==typeof c.then?c.then((function(e){return a(null,e)})).catch(a):a(null,c)}catch(e){a(e)}else u(e,t,n,r,a,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}},t}(gp);function Zp(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"==typeof e[1]&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function Qp(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function $p(){}var Xp=function(e){function t(){var t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if((t=e.call(this)||this).options=Qp(r),t.services={},t.logger=mp,t.modules={external:[]},n=t,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((function(e){"function"==typeof n[e]&&(n[e]=n[e].bind(n))})),o&&!t.isInitialized&&!r.isClone){if(!t.options.initImmediate)return t.init(r,o),t||function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t);setTimeout((function(){t.init(r,o)}),0)}return t}lt(t,e);var n=t.prototype;return n.init=function(){var e=this,t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,"function"==typeof n&&(r=n,n={}),!n.defaultNS&&!1!==n.defaultNS&&n.ns&&("string"==typeof n.ns?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));var o=Zp();function i(e){return e?"function"==typeof e?new e:e:null}if(this.options=G({},o,this.options,Qp(n)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=G({},o.interpolation,this.options.interpolation)),void 0!==n.keySeparator&&(this.options.userDefinedKeySeparator=n.keySeparator),void 0!==n.nsSeparator&&(this.options.userDefinedNsSeparator=n.nsSeparator),!this.options.isClone){var a;mp.init(this.modules.logger?i(this.modules.logger):null,this.options),this.modules.formatter?a=this.modules.formatter:"undefined"!=typeof Intl&&(a=Hp);var s=new Pp(this.options);this.store=new Ap(this.options.resources,this.options);var u=this.services;u.logger=mp,u.resourceStore=this.store,u.languageUtils=s,u.pluralResolver=new Gp(s,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!a||this.options.interpolation.format&&this.options.interpolation.format!==o.interpolation.format||(u.formatter=i(a),u.formatter.init(u,this.options),this.options.interpolation.format=u.formatter.format.bind(u.formatter)),u.interpolator=new Wp(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new Yp(i(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",(function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];t.emit.apply(t,[e].concat(r))})),this.modules.languageDetector&&(u.languageDetector=i(this.modules.languageDetector),u.languageDetector.init&&u.languageDetector.init(u,this.options.detection,this.options)),this.modules.i18nFormat&&(u.i18nFormat=i(this.modules.i18nFormat),u.i18nFormat.init&&u.i18nFormat.init(this)),this.translator=new Rp(this.services,this.options),this.translator.on("*",(function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];t.emit.apply(t,[e].concat(r))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.format=this.options.interpolation.format,r||(r=$p),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&"dev"!==c[0]&&(this.options.lng=c[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((function(n){e[n]=function(){var e;return(e=t.store)[n].apply(e,arguments)}}));["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((function(n){e[n]=function(){var e;return(e=t.store)[n].apply(e,arguments),t}}));var l=vp(),d=function(){var t=function(t,n){e.isInitializing=!1,e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),l.resolve(n),r(t,n)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?d():setTimeout(d,0),l},n.loadResources=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$p,r="string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&"cimode"===r.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return n();var o=[],i=function(e){e&&("cimode"!==e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){"cimode"!==e&&o.indexOf(e)<0&&o.push(e)})))};if(r)i(r);else this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((function(e){return i(e)}));this.options.preload&&this.options.preload.forEach((function(e){return i(e)})),this.services.backendConnector.load(o,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),n(e)}))}else n(null)},n.reloadResources=function(e,t,n){var r=vp();return e||(e=this.languages),t||(t=this.options.ns),n||(n=$p),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r},n.use=function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Lp.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this},n.setResolvedLanguage=function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t<this.languages.length;t++){var n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}},n.changeLanguage=function(e,t){var n=this,r=this;this.isLanguageChangingTo=e;var o=vp();this.emit("languageChanging",e);var i=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},a=function(a){e||a||!n.services.languageDetector||(a=[]);var s="string"==typeof a?a:n.services.languageUtils.getBestMatchFromCodes(a);s&&(n.language||i(s),n.translator.language||n.translator.changeLanguage(s),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage&&n.services.languageDetector.cacheUserLanguage(s)),n.loadResources(s,(function(e){!function(e,a){a?(i(a),n.translator.changeLanguage(a),n.isLanguageChangingTo=void 0,n.emit("languageChanged",a),n.logger.log("languageChanged",a)):n.isLanguageChangingTo=void 0,o.resolve((function(){return r.t.apply(r,arguments)})),t&&t(e,(function(){return r.t.apply(r,arguments)}))}(e,s)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e):a(this.services.languageDetector.detect()),o},n.getFixedT=function(e,t,n){var r=this,o=function(e,t){var i;if("object"!=typeof t){for(var a=arguments.length,s=new Array(a>2?a-2:0),u=2;u<a;u++)s[u-2]=arguments[u];i=r.options.overloadTranslationOptionHandler([e,t].concat(s))}else i=G({},t);i.lng=i.lng||o.lng,i.lngs=i.lngs||o.lngs,i.ns=i.ns||o.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||n||o.keyPrefix);var c,l=r.options.keySeparator||".";return c=i.keyPrefix&&Array.isArray(e)?e.map((function(e){return""+i.keyPrefix+l+e})):i.keyPrefix?""+i.keyPrefix+l+e:e,r.t(c,i)};return"string"==typeof e?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o},n.t=function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)},n.exists=function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)},n.setDefaultNamespace=function(e){this.options.defaultNS=e},n.hasLoadedNamespace=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=n.lng||this.resolvedLanguage||this.languages[0],o=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state[e+"|"+n];return-1===r||2===r};if(n.precheck){var s=n.precheck(this,a);if(void 0!==s)return s}return!!this.hasResourceBundle(r,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!a(r,e)||o&&!a(i,e)))},n.loadNamespaces=function(e,t){var n=this,r=vp();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())},n.loadLanguages=function(e,t){var n=this,r=vp();"string"==typeof e&&(e=[e]);var o=this.options.preload||[],i=e.filter((function(e){return o.indexOf(e)<0&&n.services.languageUtils.isSupportedCode(e)}));return i.length?(this.options.preload=o.concat(i),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())},n.dir=function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";var t=this.services&&this.services.languageUtils||new Pp(Zp());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"},t.createInstance=function(){return new t(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)},n.cloneInstance=function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$p,o=n.forkResourceStore;o&&delete n.forkResourceStore;var i=G({},this.options,n,{isClone:!0}),a=new t(i);void 0===n.debug&&void 0===n.prefix||(a.logger=a.logger.clone(n));return["store","services","language"].forEach((function(t){a[t]=e[t]})),a.services=G({},this.services),a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},o&&(a.store=new Ap(this.store.data,i),a.services.resourceStore=a.store),a.translator=new Rp(a.services,i),a.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];a.emit.apply(a,[e].concat(n))})),a.init(i,r),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a},n.toJSON=function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}},t}(gp),Kp=Xp.createInstance();Kp.createInstance=Xp.createInstance;var Jp={en:{translation:{}},es:{translation:{"Use your device camera to capture your ID":"Para capturar la identificación hay que utilizar la cámara del dispositivo.","Use your iPhone as a webcam":"Usar el iPhone como cámara web","Models warming up...":"Cargando modelos...","Camera initializing...":"Inicializando la cámara...","Camera access blocked":"Acceso bloqueado a la cámara","Location access blocked":"Acceso bloqueado a la localización",Continue:"Continuar","Processing...":"Procesando...","Your camera permission is disabled":"El permiso de la cámara está desactivado","This application requires access to your camera to continue. Please accept the permission once prompted by the browser. If the browser does not prompt for camera permissions, you must go to settings and provide camera access to the current browser.":"Esta aplicación requiere el acceso a la cámara para continuar. Hay que aceptar el permiso una vez que se muestre la ventana en el explorador. Si no aparece la ventana para otorgar permisos, entonces hay que dirigirse a Configuración y otorgar el permiso a la cámara en el explorador actual.","Your microphone permission is disabled":"El permiso de la micrófono está desactivado","This application requires access to your microphone to continue. Please accept the permission once prompted by the browser. If the browser does not prompt for microphone permissions, you must go to settings and provide microphone access to the current browser.":"Esta aplicación requiere tener acceso al micrófono para continuar. Hay que aceptar el permiso una vez que se muestre la ventana en el explorador. Si no aparece la ventana para otorgar permisos, entonces hay que dirigirse a Configuración y otorgar el permiso al micrófono en el explorador actual.","Your location permission is disabled":"El permiso de la localización está desactivado","This application requires access to your location to continue. Please accept the permission once prompted by the browser. If the browser does not prompt for location permissions, you must go to settings and provide location access to the current browser.":"Esta aplicación requiere el acceso a la localización para continuar. Hay que aceptar el permiso una vez que se muestre la ventana en el explorador. Si no aparece la ventana para otorgar permisos, entonces hay que dirigirse a Configuración y otorgar el permiso a la localización en el explorador actual.",Retry:"Reintentar","Scan the front of ID":"Escanear el frente de la ID","Scan the back of ID":"Escanear el reverso de la ID","Scan the ID page of passport":"Escanear la página de datos del pasaporte","ID Card Front":"Frente de la ID","ID Card Back":"Reverso de la ID",Passport:"Pasaporte","Document not detected":"No se ha detectado el documento","Document is not centered":"Documento no centrado","Document too close, please back up":"Documento muy cerca, favor de alejarse","Document out of focus – try improving the lighting":"Documento no enfocado - hay que tratar de mejorar la iluminación","ID card front detected - please flip your ID card":"Anverso de ID detectado, por favor voltea tu identificación","ID card back detected - please flip your ID card":"Reverso de ID detectado, por favor voltea tu identificación","Document detected, hold still...":"Se ha detectado el documento, no moverse por favor...","ID card front detected, hold still...":"Anverso de ID detectado, no mover...","ID card back detected, hold still...":"Reverso de ID detectado, no mover...","Passport detected, hold still...":"Pasaporte detectado, no mover...","Capturing...":"Capturando...","Capture failed!":"Falló la captura","Please flip your ID card...":"Por favor voltea la identificación...","ID card front captured.":"Se ha capturado el frente de la identificación.","ID card back captured.":"Se ha capturado el reverso de la identificación.","ID Capture Successful":"Captura Exitosa de ID","Verify the entire ID was captured clearly with no glare.":"Hay que verificar que toda la ID se vea completa y sin reflejos.",Submit:"Enviar","Submitting...":"Enviando...","Use your device camera to capture your face":"Hay que utilizar la cámara del dispositivo para capturar el rostro","Remove Sunglasses & Hat":"Hay que quitarse lentes y/o la gorra","Avoid Excessive Backlighting":"Hay que evitar demasiada luz en el fondo","Hold still for a few seconds...":"Hay que permanecer quieto por unos segundos...","Look straight into the camera...":"Hay que mirar directamente a la cámara...","Move back...":"Hay que hacerse hacia atrás..","Move forward...":"Hay que hacerse hacia adelante...","Move to the center...":"Hay que moverse hacia el centro...","Please remove your eye coverings (sunglasses, eye patch, etc.)...":"Hay que quitarse lo que cubre los ojos (lentes, parche, etc.)...","Please remove your head coverings (hat, scarf, etc.)...":"Hay que quitarse lo que cubre la cabeza (gorra, mascada, etc.)...","Please remove your mask...":"Hay que quitarse el cubrebocas...","Live face not detected, please try again":"Rostro vivo no detectado. Por favor hay que intentar de nuevo.",Exit:"Salir","Face liveness has been verified!":"Se ha verificado la Prueba de Vida en rostro!",Done:"Terminar","Customer has been identified!":"¡Se ha identificado al cliente!","Customer not found":"Cliente no encontrado","Additional document capture":"Captura de otro documento",Next:"Siguiente","Please sign the box below":"Por favor, hay que firmar en el recuadro de abajo",Accept:"Aceptar",Clear:"Borrar","Video signature has been successfully captured!":"La video firma ha sido exitosa.","Network unreachable":"No hay conexión a internet.","We're having trouble reaching our services, please check your connection and try again.":"Estamos teniendo problemas para alcanzar nuestros servicios, por favor verificar la conexión a internet e intentar de nuevo.","We're sorry, an unexpected error has occurred.":"Lo sentimos, se ha producido un error inesperado.","Document Capture":"Captura de documento",Capture:"Capturar","Retry capture":"Reintentar la captura",Upload:"Enviar","Uploading...":"Procesando...","Upload succeeded!":"Proceso completo!","Display the front of your ID card...":"Hay que mostrar el frente de la identificación...","Display the back of your ID card...":"Hay que mostrar el reverso de la identificación...","Please move your face to the center...":"Por favor, hay que mover la cabeza hacia el centro...","Searching for ID card...":"Localizando la identificación...","Please read the following text aloud":"Hay que leer el siguiente texto en voz alta","Video ID has been successfully captured!":"Video ID capturado exitosamente!","ID Front Image":"Frente de ID","ID Back Image":"Reverso de ID","We're having some trouble.":"Se ha presentado un problema.","On-device capture guidance failed, please capture a selfie manually.":"La captura automática para toma de selfie falló. Por favor, hay que tomarse la selfie manualmente.","Verifying...":"Verificando....","Please capture the front of your ID card.":"Hay que capturar el frente de la identificación.","Please capture the back of your ID card.":"Hay que capturar el reverso de la identificación.","Please capture the front of your ID card, or the ID page of your passport.":"Hay que capturar el frente de la identificación o la página de datos del pasaporte.","Please capture the back of your ID card, or click Done if submitting a passport.":"Hay que capturar el reverso de la identificación o hay que presionar el botón de Terminar si se trata de un pasaporte.","Please capture the ID page of your passport.":"Hay que capturar la página de datos del pasaporte.","On-device capture guidance failed, please capture a photo of your ID card manually.":"La captura automática falló. Por favor hay que tomar una foto de la identificación manualmente.","On-device capture guidance failed, please capture a photo of your passport manually.":"La captura automática falló. Por favor hay que tomar una foto de la pasaporte manualmente.","On-device capture guidance failed, please capture photos of your ID card and passport manually.":"La captura automática falló. Por favor hay que tomar una foto de la identificación y del pasaporte manualmente.","On-device capture guidance failed, please capture photos of your ID card or passport manually.":"La captura automática falló. Por favor hay que tomar una foto de la identificación o del pasaporte manualmente.","Capture ID page of passport":"Captura pasaporte (página de la foto)","Capture back of ID card":"Captura del reverso","Downloading...":"Descargando...","Accessing camera...":"Accediendo a la cámara","Camera ready":"Cámara está lista","Loading guided capture experience...":"Cargando la experiencia guiada para la captura....","Guided capture experience ready":"La experiencia guiada está lista","Let's Go!":"Vamos!"}}};var eh=function(e){var n=se().i18n;t.useEffect((function(){"auto"!==e?n.changeLanguage(e):n.changeLanguage()}),[n,e])};function th(e,t,n,r){if("string"==typeof n)return n;if("object"==typeof n){var o=n;if(o[t])return o[t];var i=t.split("-")[0];if(o[i])return o[i]}return e(r)}function nh(e,n){var r=se(),o=r.t,i=r.i18n;return t.useMemo((function(){return th(o,i.language,e,n)}),[n,i.language,o,e])}function rh(e,n){var r=se(),o=r.t,i=r.i18n;return t.useMemo((function(){return f(f({},e),Object.keys(n).reduce((function(t,r){var a;return f(f({},t),((a={})[r]=th(o,i.language,null==e?void 0:e[r],n[r]),a))}),{}))}),[n,i.language,o,e])}var oh,ih,ah,sh,uh,ch,lh,dh,fh=o.div(oh||(oh=v(["\n position: absolute;\n top: calc(",");\n ","\n font-weight: bold;\n width: 100%;\n display: flex;\n"],["\n position: absolute;\n top: calc(",");\n ","\n font-weight: bold;\n width: 100%;\n display: flex;\n"])),(function(e){var t=e.$top;return null!=t?t:"10vh"}),(function(e){var t=e.$bottom;return t?"bottom: ".concat(t,";"):""})),ph=function(e){var n=t.createElement(fh,f({},e)),r=document.getElementById("idmission-above-guides-content");return r?a.createPortal(n,r):n},hh=o.div(ih||(ih=v(["\n margin-left: auto;\n margin-right: auto;\n background: ",";\n color: ",";\n padding: 10px 12px 8px;\n border-radius: 8px;\n z-index: 10001;\n"],["\n margin-left: auto;\n margin-right: auto;\n background: ",";\n color: ",";\n padding: 10px 12px 8px;\n border-radius: 8px;\n z-index: 10001;\n"])),(function(e){var t,n,r,o,i,a;return null!==(a=null!==(t=e.$background)&&void 0!==t?t:null===(i=null===(r=null===(n=e.theme)||void 0===n?void 0:n.guidanceMessages)||void 0===r?void 0:r[null!==(o=e.$variant)&&void 0!==o?o:"default"])||void 0===i?void 0:i.backgroundColor)&&void 0!==a?a:"#ccc"}),(function(e){var t,n,r,o,i,a;return null!==(a=null!==(t=e.$textColor)&&void 0!==t?t:null===(i=null===(r=null===(n=e.theme)||void 0===n?void 0:n.guidanceMessages)||void 0===r?void 0:r[null!==(o=e.$variant)&&void 0!==o?o:"default"])||void 0===i?void 0:i.textColor)&&void 0!==a?a:"black"})),mh="https://websdk-cdn-dev.idmission.com/assets",gh=function(e){var n,r,i,a,s,u,c,l,d=e.requiredDocumentType,f=e.thresholds,p=void 0===f?yf:f,h=e.guidanceMessage,m=e.guidanceSatisfied,g=e.onCapture,v=e.assets,y=void 0===v?{}:v,b=e.classNames,x=void 0===b?{}:b,C=e.colors,w=void 0===C?{}:C,E=e.verbiage,k=void 0===E?{}:E,D=e.debugMode,M=void 0!==D&&D,T=ze(),I=T.ref,S=T.width,N=void 0===S?1:S,A=T.height,L=void 0===A?1:A,R=Af(),F=R[0],P=R[1],U=t.useContext(nt).cameraRef,_=t.useContext(bf),j=_.ready,B=_.setThresholds,z=_.detectionTime,G=_.focusPredictionTime,V=_.getBestFrame;t.useEffect((function(){B(p)}),[p,B]),t.useEffect((function(){d&&P({type:"setRequiredDocumentType",payload:d})}),[P,d]),t.useEffect((function(){P({type:"pageRendered",payload:{pageWidth:N,pageHeight:L}})}),[P,L,N]);var W=F.goodFramesThresholdMet&&!F.capturing&&vh(F.captureStartedAt)>=3e3;t.useEffect((function(){if(W){P({type:"capturing"});var e=V();if(!e)return Oe("uh oh, i did not get a photo"),void P({type:"captureFailed"});var t=e.canvas,n=e.documentType,r=e.boundingBox,o=e.detectionScore,i=e.focusScore,a=t.width,s=t.height,u=t.toDataURL("image/jpeg",.95);P({type:"frameCaptured",payload:{imageUrl:u}});var c="passport"===n?"passport":F.requestedDocumentType;setTimeout((function(){var e,t=(new Date).getTime()-(null!==(e=F.captureStartedAt)&&void 0!==e?e:new Date).getTime();null==g||g(u,a,s,c,{autoCapture:"Y",captureTime:t,boundingBox:r,bestDetectionScore:o,bestFocusScore:i}),P({type:"captured"})}),0)}}),[P,V,g,W,F.captureStartedAt,F.requestedDocumentType]),y.portraitGuidesImageUrl||(y.portraitGuidesImageUrl="".concat(mh,"/Shieldout-IDCard-Front-SVG-Portrait-2.svg")),y.landscapeGuidesImageUrl||(y.landscapeGuidesImageUrl="".concat(mh,"/Shieldout-IDCard-Front-SVG-Landscape-2.svg"));var q=o.useTheme();w.guideBoxUnsatisfiedColor||(w.guideBoxUnsatisfiedColor=null!==(i=null===(r=null===(n=q.idCapture)||void 0===n?void 0:n.guideBox)||void 0===r?void 0:r.unsatisfiedColor)&&void 0!==i?i:"white"),w.guideBoxSatisfiedColor||(w.guideBoxSatisfiedColor=null!==(u=null===(s=null===(a=q.idCapture)||void 0===a?void 0:a.guideBox)||void 0===s?void 0:s.satisfiedColor)&&void 0!==u?u:"green");var H=rh(k,{instructionText:"Scan the front of ID",processingIdCardText:"ID card front captured.",guidanceSatisfiedText:"".concat(af[F.detectedDocumentType]," detected, hold still..."),guidancePleaseFlipText:"ID card front detected - please flip your ID card",guidanceBackDetectedFirstText:"ID card back detected - please flip your ID card",guidanceTooBlurryText:"Document out of focus – try improving the lighting",guidanceNotCenteredText:"Document is not centered",guidanceTooCloseText:"Document too close, please back up",guidanceNotDetectedText:"Document not detected"}),Y=Uf({enabled:M,pageWidth:F.guideRectWidth,pageHeight:F.guideRectHeight,videoWidth:F.videoWidth,videoHeight:F.videoHeight}),Z=F.isGoodFrame;return"boolean"==typeof m&&(Z=m),h||(h=Z?H.guidanceSatisfiedText:F.detectionThresholdMet?F.backDetectedFirst?H.guidanceBackDetectedFirstText:F.flipRequired?H.guidancePleaseFlipText:F.documentInBounds?F.documentTooClose?H.guidanceTooCloseText:F.focusThresholdMet?"":H.guidanceTooBlurryText:H.guidanceNotCenteredText:H.guidanceNotDetectedText),t.createElement(O,{ref:I,className:"flex ".concat(null!==(c=x.container)&&void 0!==c?c:"")},""!==h&&t.createElement(ph,{$top:"",$bottom:"12.5dvh",className:x.guidanceMessageContainer},t.createElement(hh,{$variant:Z?"positive":"default",className:x.guidanceMessage},h)),M&&t.createElement(Gf,{$flipX:!(null===(l=U.current)||void 0===l?void 0:l.isRearFacing),scaling:Y},F.detectedObjects.map((function(e,n){var r;return t.createElement(Vf,{key:n,obj:e,scaling:Y,flipX:!(null===(r=U.current)||void 0===r?void 0:r.isRearFacing)})}))),M&&t.createElement(Lf,null,U.current?t.createElement(t.Fragment,null,"✅ Camera: ",U.current.label," (",U.current.width,"x",U.current.height,")"):"❌ Camera not ready",t.createElement("br",null),F.frameCaptureRate>.75?"✅":"👎"," Frame Rate:"," ",Math.round(1e3*(F.frameCaptureRate+Number.EPSILON))/1e3," ","fps (",z,"ms doc detect, ",G,"ms focus)",t.createElement("br",null),j?t.createElement(t.Fragment,null,F.detectionThresholdMet?"✅":"❌"," Detected Document Type: ",F.detectedDocumentType,t.createElement("br",null),F.idCardFrontDetectionThresholdMet?"✅":"❌"," ID Card Front Score: ",F.idCardFrontDetectionScore.toFixed(3),t.createElement("br",null),F.idCardBackDetectionThresholdMet?"✅":"❌"," ID Card Back Score: ",F.idCardBackDetectionScore.toFixed(3),t.createElement("br",null),F.passportDetectionThresholdMet?"✅":"❌"," Passport Score: ",F.passportDetectionScore.toFixed(3),t.createElement("br",null),F.focusThresholdMet?"✅":"❌"," Focus Score:"," ",F.focusScore.toFixed(3),t.createElement("br",null),F.documentInBounds?"✅":"❌"," Document In Bounds",t.createElement("br",null),F.goodFramesThresholdMet?"✅":"❌"," Good Frame Count:"," ",F.goodFramesCount,"/",F.goodFramesThreshold):t.createElement(t.Fragment,null,"❌ Models not ready")))},vh=function(e){return e?Math.abs((new Date).getTime()-e.getTime()):0},yh=function(e){var n,r=e.assets,o=void 0===r?{}:r,i=e.classNames,a=void 0===i?{}:i,s=e.colors,u=void 0===s?{}:s,c=e.verbiage,l=void 0===c?{}:c,d=t.useContext(nt).requestCameraAccess;o.imageUrl||(o.imageUrl=mh+"/camera-disable-icon.png");var f=rh(l,{headingText:"Your camera permission is disabled",descriptionText:"This application requires access to your camera to continue. Please accept the permission once prompted by the browser. If the browser does not prompt for camera permissions, you must go to settings and provide camera access to the current browser.",retryBtnText:"Retry"});return t.createElement(_,{className:"flex ".concat(null!==(n=a.container)&&void 0!==n?n:"")},t.createElement(bh,{className:a.inner},t.createElement(xh,{className:a.imageContainer},t.createElement("img",{src:o.imageUrl,alt:"",className:a.image})),t.createElement("h3",{className:a.heading},f.headingText),t.createElement(Ch,{className:a.description},f.descriptionText),t.createElement(wh,{variant:"warning",onClick:d,colors:u.retryBtn,className:a.retryBtn,finished:!0},f.retryBtnText)))},bh=o(j)(ah||(ah=v(["\n max-width: 500px;\n height: auto;\n margin: auto;\n"],["\n max-width: 500px;\n height: auto;\n margin: auto;\n"]))),xh=o(B)(sh||(sh=v(["\n flex-grow: 0;\n"],["\n flex-grow: 0;\n"]))),Ch=o.p(uh||(uh=v(["\n line-height: 1.5;\n margin-bottom: 50px;\n"],["\n line-height: 1.5;\n margin-bottom: 50px;\n"]))),wh=o(le)(ch||(ch=v(["\n width: 200px;\n margin: 0 auto;\n"],["\n width: 200px;\n margin: 0 auto;\n"]))),Eh=o.button(lh||(lh=v(["\n position: absolute;\n top: 12px;\n right: 12px;\n font-size: 20px;\n width: 32px;\n height: 32px;\n font-family: monospace;\n z-index: 1002;\n border: none;\n border-radius: 4px;\n background: #ccc;\n cursor: pointer;\n padding: 8px;\n box-sizing: border-box;\n display: flex;\n\n &:hover {\n background: #ddd;\n }\n\n & > svg {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n"],["\n position: absolute;\n top: 12px;\n right: 12px;\n font-size: 20px;\n width: 32px;\n height: 32px;\n font-family: monospace;\n z-index: 1002;\n border: none;\n border-radius: 4px;\n background: #ccc;\n cursor: pointer;\n padding: 8px;\n box-sizing: border-box;\n display: flex;\n\n &:hover {\n background: #ddd;\n }\n\n & > svg {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n"]))),kh=function(e){return t.createElement(Eh,{onClick:e.onClick,className:e.className},t.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"19.3 19.3 25.499999999999996 25.499999999999996",enableBackground:"new 0 0 64 64",width:16,height:16},t.createElement("g",{id:"close-outline-bot_x5F_s1g1_x5F_s2g2_x5F_s3g1_x5F_s4g1"},t.createElement("line",{fill:"none",stroke:"#000000",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",x1:"19.75",y1:"44.25",x2:"44.25",y2:"19.75"})),t.createElement("g",{id:"close-outline-top_x5F_s1g1_x5F_s2g2_x5F_s3g1_x5F_s4g1"},t.createElement("line",{fill:"none",stroke:"#000000",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",x1:"44.25",y1:"44.25",x2:"19.75",y2:"19.75"}))))},Dh=o.div(dh||(dh=v(["\n display: flex;\n gap: 0 15px;\n justify-content: center;\n"],["\n display: flex;\n gap: 0 15px;\n justify-content: center;\n"])));function Mh(e){var n=window.innerHeight>window.innerWidth;return t.createElement(n?Ih:Th,f({},e))}function Th(e){var n,r,i,a,s,u,c=e.width,l=void 0===c?698:c,d=e.height,f=void 0===d?452:d,p=e.className,h=t.useState(0),m=h[0],g=h[1];t.useEffect((function(){var e=setInterval((function(){g((function(e){return(e+1)%7}))}),1e3);return function(){clearInterval(e)}}),[]);var v=o.useTheme(),y=null!==(i=null===(r=null===(n=v.idCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.loadingGraphicAccentColor)&&void 0!==i?i:"var(--idm-color-positive-600)",b=null!==(u=null===(s=null===(a=v.idCapture)||void 0===a?void 0:a.loadingOverlay)||void 0===s?void 0:s.loadingGraphicAccentOpacity)&&void 0!==u?u:.2;return t.createElement("div",{style:{display:"flex",width:"100%",height:"100%"}},t.createElement("svg",{className:p,width:l,height:f,viewBox:"0 0 698 452",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{margin:"auto",transform:"scale(".concat(m>1?1:1===m?1.25:.75,")"),transition:"transform 0.2s linear, border-width 0.2s linear",border:"".concat(m>=5?10:0,"px solid ").concat(y)}},t.createElement("g",{filter:1===m?"url(#filter0_f_91_884)":void 0},t.createElement("path",{d:"M10 0.5L688 0.5C693.247 0.5 697.5 4.75329 697.5 10L697.5 442C697.5 447.246 693.247 451.5 688 451.5L9.99999 451.5C4.75328 451.5 0.5 447.246 0.5 442L0.5 9.99998C0.5 4.75328 4.75329 0.5 10 0.5Z",fill:"#F3F3F3",stroke:"#DCDCDC"}),t.createElement("mask",{id:"mask0_91_854",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"30",y:"60",width:"207",height:"266"},t.createElement("rect",{x:"30.7754",y:"60.5945",width:"205.426",height:"265.304",rx:"3",fill:"#D9D9D9"})),t.createElement("g",{mask:"url(#mask0_91_854)"},t.createElement("path",{d:"M161.429 226.164C161.472 226.322 161.474 226.488 161.438 226.647C157.252 244.639 146.071 257.508 132.955 257.508C119.837 257.508 108.632 244.59 104.447 226.595C104.411 226.439 104.413 226.276 104.453 226.121L107.568 214.051L108.337 211.118C108.453 210.678 108.85 210.371 109.305 210.371L156.578 210.371C157.034 210.371 157.432 210.68 157.546 211.122L160.976 224.435L161.305 225.701L161.429 226.164Z",fill:"#D2D4DA"}),t.createElement("path",{d:"M185.475 157.408C185.556 157.356 185.628 157.291 185.693 157.219C210.004 130.149 193.715 196.897 180.188 189.065C157.256 175.818 183.525 158.645 185.475 157.408Z",fill:"#F7A69C"}),t.createElement("path",{d:"M267.491 324.918C267.577 325.255 267.487 325.608 267.24 325.853C254.85 338.143 225.105 345.481 222.791 346.037C222.686 346.063 222.601 346.067 222.493 346.058C219.509 345.795 174.209 342.097 147.081 357.481C142.849 359.881 122.568 356.455 121.909 356.343C121.888 356.339 121.882 356.339 121.861 356.337L89.946 352.929C89.8715 352.921 89.8068 352.921 89.7323 352.929C87.9869 353.117 64.0883 355.438 45.1808 343.79C29.8522 334.346 9.55527 336.584 -1.36759 325.857C-1.61519 325.614 -1.71005 325.255 -1.62441 324.919L1.46107 312.802C6.33129 293.793 21.3654 279.026 40.5404 274.455L42.6579 273.963L66.162 268.361L72.5851 266.837C75.2907 266.181 77.8788 265.267 80.3256 264.095C82.3725 263.11 84.3253 261.962 86.1605 260.649C88.1368 259.243 89.9955 257.649 91.6659 255.891C96.1597 251.18 99.4771 245.367 101.171 238.827L103.665 229.17L104.324 226.568L104.371 226.357L107.571 214.051L108.319 211.123C108.433 210.681 108.831 210.371 109.288 210.371L156.558 210.371C157.013 210.371 157.411 210.679 157.526 211.12L160.978 224.435L161.308 225.701L161.475 226.325C161.489 226.377 161.496 226.431 161.496 226.486V226.486C161.496 226.54 161.503 226.595 161.517 226.647L162.202 229.193L164.696 238.827C167.025 247.781 172.413 255.446 179.73 260.649C183.729 263.532 188.317 265.665 193.282 266.837L199.211 268.244L225.326 274.455C244.501 279.026 259.535 293.793 264.406 312.802L267.491 324.918Z",fill:"#F7A69C"}),t.createElement("path",{d:"M161.429 226.164C161.472 226.322 161.474 226.488 161.438 226.647C157.252 244.639 146.071 257.508 132.955 257.508C119.837 257.508 108.632 244.59 104.447 226.595C104.411 226.439 104.413 226.276 104.453 226.121L107.568 214.051L108.337 211.118C108.453 210.678 108.85 210.371 109.305 210.371L156.578 210.371C157.034 210.371 157.432 210.68 157.546 211.122L160.976 224.435L161.305 225.701L161.429 226.164Z",fill:"#DC968D"}),t.createElement("path",{d:"M80.3983 157.408C80.3166 157.356 80.2445 157.291 80.1799 157.219C55.8686 130.149 72.1582 196.897 85.685 189.065C108.616 175.818 82.3476 158.645 80.3983 157.408Z",fill:"#F7A69C"}),t.createElement("path",{d:"M189.527 137.873C189.52 137.873 189.515 137.879 189.515 137.885C189.515 139.944 189.397 141.956 189.162 143.968C188.974 145.796 188.15 153.601 186.692 163.54C185.895 169.048 184.865 175.184 183.649 181.346C183.638 181.398 183.635 181.447 183.631 181.5V181.5C183.625 181.607 183.575 181.713 183.554 181.818C180.568 196.836 176.367 211.751 170.881 217.193C164.67 223.381 159.682 229.007 153.988 233.062C148.295 237.14 141.919 239.672 132.978 239.672C124.038 239.672 117.662 237.14 111.968 233.062C106.298 229.007 101.286 223.381 95.0752 217.193C89.5754 211.714 85.367 196.715 82.3561 181.682C82.3499 181.651 82.3467 181.628 82.3467 181.596V181.596C82.3467 181.566 82.3438 181.526 82.338 181.496C81.9648 179.566 81.6147 177.636 81.2645 175.728C81.1233 174.932 80.9821 174.135 80.841 173.338C80.2528 169.962 79.7352 166.657 79.2646 163.563C77.5768 152.19 76.7532 143.609 76.7472 143.546C76.747 143.544 76.7471 143.545 76.7469 143.543C76.5589 141.692 76.4648 139.794 76.4648 137.873C76.4648 137.381 76.4648 136.889 76.4648 136.397C76.5825 131.967 77.1942 127.654 78.3 123.528C78.3471 123.341 78.3941 123.153 78.4412 122.966C84.723 100.089 105.121 83.0011 129.731 81.6416C130.814 81.5713 131.872 81.5479 132.978 81.5479C148.601 81.5479 162.741 87.8531 172.975 98.0494C181.822 106.839 187.75 118.559 189.186 131.615C189.42 133.674 189.538 135.756 189.539 137.862C189.539 137.868 189.533 137.873 189.527 137.873V137.873Z",fill:"#FEAEA5"}),t.createElement("path",{d:"M141.871 188.529C141.871 192.42 137.895 195.561 132.977 195.561C128.06 195.561 124.107 192.42 124.107 188.529V188.529C124.107 188.132 124.593 188.105 124.773 188.459C126.079 191.03 129.266 192.842 132.977 192.842C136.689 192.842 139.893 191.03 141.204 188.458C141.381 188.112 141.871 188.14 141.871 188.529V188.529Z",fill:"#F7A69C"}),t.createElement("path",{d:"M267.512 325.037C267.599 325.374 267.509 325.727 267.264 325.974C232.886 360.672 133.16 359.767 132.956 359.765C132.95 359.765 132.962 359.765 132.956 359.765C132.752 359.767 33.0007 360.672 -1.3537 325.95C-1.59784 325.703 -1.68748 325.351 -1.60167 325.014L1.48353 312.922C6.35375 293.889 21.3879 279.122 40.5629 274.551L66.2315 268.456L72.6075 266.933C75.2325 266.311 77.7789 265.415 80.1745 264.28C80.5729 264.092 81.0485 264.176 81.3541 264.494C94.359 278.009 112.66 286.435 132.956 286.435C153.253 286.435 171.556 278.008 184.562 264.49C184.865 264.174 185.337 264.088 185.734 264.274C188.127 265.395 190.657 266.311 193.304 266.933L198.88 268.269L225.349 274.551C244.524 279.122 259.558 293.889 264.405 312.922L267.512 325.037Z",fill:"#6E7174"}),t.createElement("path",{d:"M197.318 267.895C198.038 268.068 198.334 268.924 197.847 269.481C190.872 277.457 169.982 297.251 132.954 298.717C92.046 300.357 71.408 275.554 67.0543 269.627C66.6418 269.065 66.9505 268.284 67.6281 268.122L72.606 266.933C75.231 266.311 77.7773 265.415 80.173 264.28C80.5713 264.092 81.0469 264.176 81.3526 264.494C94.3575 278.009 112.659 286.435 132.954 286.435C153.252 286.435 171.555 278.008 184.56 264.49C184.864 264.174 185.336 264.088 185.732 264.274C188.126 265.395 190.655 266.311 193.303 266.933L197.318 267.895Z",fill:"#555A5E"}),t.createElement("path",{d:"M75.4663 140.851C75.4663 152.603 78.3795 166.091 80.4253 174.114C80.713 175.242 82.458 175.01 82.5156 173.848C83.0875 162.287 85.7494 140.134 97.4904 130.033C108.545 120.523 117.526 131.201 132.13 131.201C145.353 131.201 157.695 120.704 168.836 130.033C181.053 140.264 183.463 159.992 183.739 171.736C183.767 172.936 185.717 173.218 186.003 172.053C187.986 163.959 190.429 151.77 190.429 140.851C190.429 100.426 174.665 81.3704 132.13 81.3704C93.3928 81.3704 75.4663 100.225 75.4663 140.851Z",fill:"#525252"})),t.createElement("rect",{x:"30.7754",y:"360.29",width:"640.93",height:"40.942",rx:"3",fill:"#C1C1C1"}),t.createElement("rect",{x:"267.427",y:"134.29",width:"402.636",height:"40.942",rx:"3",fill:"#C1C1C1"}),t.createElement("rect",{x:"267.427",y:"209.623",width:"180.775",height:"40.942",rx:"3",fill:"#C1C1C1"}),t.createElement("rect",{x:"481.069",y:"209.623",width:"188.992",height:"40.942",rx:"3",fill:"#C1C1C1"}),t.createElement("rect",{x:"267.427",y:"284.956",width:"180.775",height:"40.942",rx:"3",fill:"#C1C1C1"}),t.createElement("rect",{x:"481.069",y:"284.956",width:"188.992",height:"40.942",rx:"3",fill:"#C1C1C1"}),t.createElement("rect",{x:"266.829",y:"58.3618",width:"402.636",height:"40.942",rx:"3",fill:"#C1C1C1"}),t.createElement("g",{fillOpacity:3===m?b:0,style:{transition:"fill-opacity 0.2s linear"}},t.createElement("rect",{x:"672",y:"55",width:"47",height:"410",transform:"rotate(90 672 55)",fill:y}),t.createElement("rect",{x:"670",y:"206",width:"47",height:"194",transform:"rotate(90 670 206)",fill:y}),t.createElement("rect",{x:"242",y:"61",width:"271",height:"218",transform:"rotate(90 242 61)",fill:y}),t.createElement("rect",{x:"677",y:"357",width:"47",height:"653",transform:"rotate(90 677 357)",fill:y})),t.createElement("g",{fillOpacity:4===m?b:0,style:{transition:"fill-opacity 0.2s linear"}},t.createElement("rect",{x:"455",y:"281",width:"47",height:"194",transform:"rotate(90 455 281)",fill:y}),t.createElement("rect",{x:"672",y:"131",width:"47",height:"411",transform:"rotate(90 672 131)",fill:y})),t.createElement("g",{fillOpacity:m>=5?1:0,style:{transition:"fill-opacity 0.2s linear"}},t.createElement("circle",{cx:"360",cy:"215",r:"41",fill:y}),t.createElement("path",{d:"M339.937 218.076L350.044 229.83L381.809 201.915",stroke:"white",strokeWidth:"10",strokeOpacity:m>=5?1:0,strokeLinecap:"round",strokeLinejoin:"round",style:{transition:"stroke-opacity 0.2s linear"}}))),t.createElement("filter",{id:"filter0_f_91_884",x:"0",y:"0",width:"848",height:"556",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},t.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),t.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),t.createElement("feGaussianBlur",{stdDeviation:"5",result:"effect1_foregroundBlur_91_884"}))))}function Ih(e){var n,r,i,a,s,u,c=e.width,l=void 0===c?428:c,d=e.height,f=void 0===d?747:d,p=e.className,h=t.useState(0),m=h[0],g=h[1];t.useEffect((function(){var e=setInterval((function(){g((function(e){return(e+1)%7}))}),1e3);return function(){clearInterval(e)}}),[]);var v=o.useTheme(),y=null!==(i=null===(r=null===(n=v.idCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.loadingGraphicAccentColor)&&void 0!==i?i:"var(--idm-color-positive-600)",b=null!==(u=null===(s=null===(a=v.idCapture)||void 0===a?void 0:a.loadingOverlay)||void 0===s?void 0:s.loadingGraphicAccentOpacity)&&void 0!==u?u:.2;return t.createElement("svg",{className:p,width:l,height:f,viewBox:"0 0 428 747",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("g",{id:"card",style:{transform:"translate(".concat(m<1?"-500px":"0",", 0)"),transition:"transform 0.3s linear"}},t.createElement("path",{d:"M76.5001 181.274C76.5001 176.027 80.7534 171.774 86.0001 171.774L342 171.774C347.247 171.774 351.5 176.027 351.5 181.274L351.5 586C351.5 591.247 347.247 595.5 342 595.5L86.0001 595.5C80.7534 595.5 76.5001 591.247 76.5001 586L76.5001 181.274Z",fill:"#F3F3F3",stroke:"#DCDCDC"}),t.createElement("mask",{id:"mask0_29_1815",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"113",y:"452",width:"163",height:"126"},t.createElement("rect",{x:"113",y:"577.273",width:"125",height:"162",rx:"3",transform:"rotate(-90 113 577.273)",fill:"#D9D9D9"})),t.createElement("g",{mask:"url(#mask0_29_1815)"},t.createElement("path",{d:"M214.008 497.796C214.165 497.754 214.33 497.751 214.489 497.788C225.426 500.352 233.24 507.14 233.24 515.098C233.24 523.058 225.395 529.861 214.455 532.423C214.3 532.46 214.138 532.458 213.983 532.418L206.704 530.546L205.204 530.154C204.764 530.039 204.457 529.641 204.457 529.186L204.457 501.028C204.457 500.571 204.766 500.173 205.208 500.059L213.044 498.048L213.817 497.847L214.008 497.796Z",fill:"#D2D4DA"}),t.createElement("path",{d:"M172.144 483.183C172.092 483.102 172.027 483.031 171.955 482.966C155.547 468.233 196.225 478.134 191.447 486.357C183.444 500.161 173.096 484.665 172.144 483.183Z",fill:"#F7A69C"}),t.createElement("path",{d:"M274.192 433.287C274.528 433.202 274.882 433.292 275.124 433.541C282.444 441.074 286.849 458.59 287.283 460.373C287.308 460.479 287.314 460.558 287.305 460.667C287.111 462.898 284.971 490.135 294.285 506.502C295.735 509.05 293.703 521.155 293.593 521.803C293.589 521.823 293.587 521.84 293.585 521.861L291.51 541.224C291.502 541.299 291.502 541.364 291.509 541.439C291.65 542.782 292.959 557.13 285.925 568.508C280.203 577.763 281.504 589.995 275.126 596.677C274.887 596.927 274.528 597.02 274.193 596.935L267.003 595.111C255.396 592.147 246.379 582.999 243.588 571.332L243.287 570.043L239.866 555.741L238.936 551.833C238.535 550.186 237.977 548.611 237.262 547.123C236.66 545.877 235.959 544.689 235.158 543.572C234.299 542.37 233.326 541.239 232.252 540.222C229.375 537.488 225.826 535.469 221.832 534.438L215.936 532.921L214.347 532.52L214.218 532.491L206.704 530.544L205.21 530.164C204.767 530.051 204.457 529.652 204.457 529.194L204.457 501.04C204.457 500.584 204.765 500.186 205.207 500.071L213.044 498.046L213.817 497.846L214.198 497.744C214.23 497.736 214.263 497.731 214.297 497.731C214.33 497.731 214.363 497.727 214.395 497.718L215.95 497.302L221.832 495.784C227.3 494.367 231.98 491.088 235.158 486.636C236.918 484.202 238.22 481.411 238.936 478.39L239.795 474.782L243.588 458.891C246.379 447.223 255.396 438.075 267.003 435.112L274.192 433.287Z",fill:"#F7A69C"}),t.createElement("path",{d:"M214.008 497.796C214.165 497.754 214.33 497.751 214.489 497.788C225.426 500.352 233.24 507.14 233.24 515.098C233.24 523.058 225.395 529.861 214.455 532.423C214.3 532.46 214.138 532.458 213.983 532.418L206.704 530.546L205.204 530.154C204.764 530.039 204.457 529.641 204.457 529.186L204.457 501.028C204.457 500.571 204.766 500.173 205.208 500.059L213.044 498.048L213.817 497.847L214.008 497.796Z",fill:"#DC968D"}),t.createElement("path",{d:"M172.144 547.035C172.092 547.117 172.027 547.188 171.955 547.252C155.547 561.986 196.225 552.085 191.447 543.861C183.444 530.057 173.096 545.553 172.144 547.035Z",fill:"#F7A69C"}),t.createElement("path",{d:"M160.188 480.675C160.188 480.679 160.191 480.682 160.195 480.682C161.452 480.682 162.681 480.754 163.91 480.897C165.026 481.011 169.792 481.512 175.861 482.4C179.224 482.885 182.971 483.511 186.733 484.252C186.765 484.258 186.795 484.26 186.827 484.262C186.893 484.266 186.958 484.296 187.022 484.309C196.192 486.126 205.299 488.682 208.623 492.02C212.401 495.8 215.836 498.835 218.312 502.3C220.803 505.764 222.348 509.644 222.348 515.084C222.348 520.524 220.803 524.404 218.312 527.869C215.836 531.319 212.401 534.368 208.623 538.148C205.277 541.494 196.118 544.055 186.939 545.887C186.92 545.891 186.906 545.893 186.886 545.893C186.867 545.893 186.844 545.895 186.825 545.898C185.646 546.125 184.468 546.338 183.303 546.551C182.817 546.637 182.33 546.723 181.843 546.809C179.782 547.167 177.764 547.482 175.875 547.768C168.946 548.793 163.714 549.294 163.652 549.3C163.651 549.3 163.651 549.3 163.649 549.3C162.519 549.415 161.361 549.472 160.188 549.472C159.888 549.472 159.587 549.472 159.287 549.472C156.581 549.4 153.948 549.028 151.429 548.355C151.314 548.327 151.2 548.298 151.085 548.269C137.116 544.447 126.682 532.035 125.852 517.06C125.809 516.401 125.795 515.757 125.795 515.084C125.795 505.578 129.645 496.974 135.871 490.746C141.238 485.363 148.395 481.756 156.367 480.882C157.624 480.739 158.895 480.668 160.181 480.668C160.185 480.668 160.188 480.671 160.188 480.675Z",fill:"#FEAEA5"}),t.createElement("path",{d:"M191.119 509.673C193.495 509.673 195.413 512.092 195.413 515.084C195.413 518.077 193.495 520.482 191.119 520.482C190.877 520.482 190.861 520.186 191.077 520.077C192.647 519.282 193.753 517.343 193.753 515.084C193.753 512.826 192.647 510.876 191.077 510.079C190.866 509.971 190.883 509.673 191.119 509.673Z",fill:"#F7A69C"}),t.createElement("path",{d:"M274.264 433.275C274.6 433.189 274.954 433.278 275.199 433.524C296.217 454.568 295.682 514.893 295.68 515.097C295.68 515.103 295.68 515.092 295.68 515.098C295.682 515.302 296.217 575.643 275.184 596.673C274.939 596.917 274.586 597.007 274.251 596.921L267.076 595.097C255.454 592.134 246.437 582.986 243.646 571.318L239.925 555.699L238.994 551.819C238.638 550.318 238.133 548.86 237.499 547.48C237.314 547.078 237.398 546.602 237.715 546.294C245.845 538.394 250.903 527.342 250.903 515.098C250.903 502.851 245.844 491.798 237.711 483.897C237.396 483.591 237.311 483.119 237.493 482.719C238.122 481.341 238.638 479.89 238.994 478.376L239.81 474.983L243.646 458.877C246.437 447.21 255.454 438.061 267.076 435.112L274.264 433.275Z",fill:"#6E7174"}),t.createElement("path",{d:"M239.436 476.54C239.609 475.821 240.466 475.529 241.015 476.024C246.147 480.64 257.535 493.254 258.403 515.098C259.367 539.068 245.359 551.601 241.088 554.862C240.535 555.285 239.753 554.982 239.59 554.305L238.994 551.82C238.638 550.319 238.133 548.86 237.499 547.48C237.314 547.079 237.398 546.603 237.715 546.295C245.845 538.394 250.903 527.343 250.903 515.098C250.903 502.852 245.844 491.799 237.711 483.898C237.396 483.592 237.311 483.119 237.493 482.72C238.122 481.342 238.638 479.891 238.994 478.377L239.436 476.54Z",fill:"#555A5E"}),t.createElement("path",{d:"M162.007 550.079C167.945 550.079 174.609 548.865 179.507 547.741C180.642 547.481 180.435 545.695 179.275 545.595C171.872 544.959 160.808 542.941 155.401 536.678C149.594 529.951 156.114 524.486 156.114 515.6C156.114 507.554 149.704 500.044 155.401 493.265C160.661 487.005 170.034 484.976 177.145 484.392C178.342 484.293 178.605 482.241 177.431 481.993C172.848 481.025 167.193 480.126 162.007 480.126C137.322 480.126 125.686 489.718 125.686 515.6C125.686 539.171 137.2 550.079 162.007 550.079Z",fill:"#525252"})),t.createElement("rect",{x:"296",y:"577.273",width:"390",height:"25",rx:"3",transform:"rotate(-90 296 577.273)",fill:"#C1C1C1"}),t.createElement("rect",{x:"158",y:"433.273",width:"245",height:"25",rx:"3",transform:"rotate(-90 158 433.273)",fill:"#C1C1C1"}),t.createElement("rect",{x:"204",y:"433.273",width:"110",height:"25",rx:"3",transform:"rotate(-90 204 433.273)",fill:"#C1C1C1"}),t.createElement("rect",{x:"204",y:"303.274",width:"115",height:"25",rx:"3",transform:"rotate(-90 204 303.274)",fill:"#C1C1C1"}),t.createElement("rect",{x:"250",y:"433.273",width:"110",height:"25",rx:"3",transform:"rotate(-90 250 433.273)",fill:"#C1C1C1"}),t.createElement("rect",{x:"250",y:"303.274",width:"115",height:"25",rx:"3",transform:"rotate(-90 250 303.274)",fill:"#C1C1C1"}),t.createElement("rect",{x:"111.637",y:"433.637",width:"245",height:"25",rx:"3",transform:"rotate(-90 111.637 433.637)",fill:"#C1C1C1"}),t.createElement("g",{fillOpacity:2===m?b:0,style:{transition:"fill-opacity 0.2s linear"}},t.createElement("rect",{x:"200",y:"188",width:"33",height:"118",fill:y}),t.createElement("rect",{x:"108",y:"444",width:"171",height:"136",fill:y}),t.createElement("rect",{x:"108",y:"187",width:"33",height:"247",fill:y}),t.createElement("rect",{x:"293",y:"186",width:"31",height:"394",fill:y})),t.createElement("g",{fillOpacity:3===m?b:0,style:{transition:"fill-opacity 0.2s linear"}},t.createElement("rect",{x:"154",y:"185",width:"33",height:"249",fill:y}),t.createElement("rect",{x:"247",y:"322",width:"31",height:"113",rx:"5",fill:y})),t.createElement("g",{fillOpacity:m>=4?1:0,strokeOpacity:m>=4?1:0,style:{transition:"fill-opacity 0.2s linear, stroke-opacity 0.2s linear"}},t.createElement("rect",{x:"78.5",y:"171.5",width:"271",height:"426",rx:"2.5",stroke:y,strokeWidth:"5"}),t.createElement("circle",{cx:"214.5",cy:"383.5",r:"23.5",fill:y}),t.createElement("path",{d:"M203 385.263L208.793 392L227 376",stroke:"white",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"}))),t.createElement("g",{id:"phone",clipPath:"url(#clip0_29_1778)",style:{transform:"translate(".concat(m<1?"40px":"0",", 0)"),transition:"transform 0.3s linear"}},t.createElement("rect",{x:"154",y:"693",width:"120",height:"5",rx:"2.5",fill:"#333343"}),t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M372.869 156.244H373.495V156.241C376.342 156.241 378.647 158.551 378.647 161.396V234.788C378.647 237.637 376.339 239.944 373.495 239.944H372.869V677.09C372.869 698.895 355.203 716.571 333.411 716.571H94.2366C72.444 716.571 54.7781 698.895 54.7781 677.09V278.699H54.1523C51.3051 278.699 49 276.39 49 273.544V228.052C49 225.203 51.3082 222.897 54.1523 222.897H54.7781V212.047H54.1523C51.3051 212.047 49 209.737 49 206.892V161.399C49 158.551 51.3082 156.244 54.1523 156.244H54.7781V90.4813C54.7781 68.6761 72.444 51 94.2366 51H333.411C355.203 51 372.869 68.6761 372.869 90.4813V156.244ZM98.3077 60.7649H329.34C347.039 60.7649 361.387 75.1214 361.387 92.8311V674.734C361.387 692.444 347.039 706.8 329.34 706.8H98.3077C80.6082 706.8 66.26 692.444 66.26 674.734V92.8311C66.26 75.1214 80.6082 60.7649 98.3077 60.7649Z",fill:"#333343"}),t.createElement("rect",{x:"154",y:"71",width:"120",height:"20",rx:"10",fill:"#333343"})),t.createElement("defs",null,t.createElement("clipPath",{id:"clip0_29_1778"},t.createElement("rect",{width:"428",height:"747",fill:"white"}))))}var Sh,Nh,Ah,Lh,Oh,Rh,Fh,Ph,Uh,_h,jh,Bh,zh,Gh,Vh,Wh,qh,Hh,Yh,Zh,Qh,$h,Xh,Kh,Jh,em,tm,nm,rm,om="".concat(mh,"/WebSDK-Instruction-DL-Capture-3-Portrait.png"),im=o.div(Sh||(Sh=v(["\n height: 100dvh;\n display: flex;\n flex-direction: column;\n background: ",";\n color: ",";\n"],["\n height: 100dvh;\n display: flex;\n flex-direction: column;\n background: ",";\n color: ",";\n"])),(function(e){var t,n,r,o;return null!==(o=null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.idCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.backgroundColor)&&void 0!==o?o:"#ecedf3"}),(function(e){var t,n,r,o;return null!==(o=null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.idCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.textColor)&&void 0!==o?o:"black"})),am=o.div(Nh||(Nh=v(["\n text-align: ",";\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n ","\n padding-bottom: 0;\n"],["\n text-align: ",";\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n ","\n padding-bottom: 0;\n"])),(function(e){var t;return null!==(t=e.theme.textAlign)&&void 0!==t?t:"center"}),(function(e){return e.theme.padding?"box-sizing: border-box; padding: ".concat(e.theme.padding,";"):""})),sm=o(hh)(Ah||(Ah=v(["\n padding: 16px 24px;\n margin-top: 16px;\n font-size: 18px;\n font-weight: bold;\n background: white;\n box-shadow:\n 0 1px 3px 0 rgb(0 0 0 / 0.1),\n 0 1px 2px -1px rgb(0 0 0 / 0.1);\n"],["\n padding: 16px 24px;\n margin-top: 16px;\n font-size: 18px;\n font-weight: bold;\n background: white;\n box-shadow:\n 0 1px 3px 0 rgb(0 0 0 / 0.1),\n 0 1px 2px -1px rgb(0 0 0 / 0.1);\n"]))),um=o(B)(Lh||(Lh=v(["\n padding: 0 0 100px;\n\n & > svg {\n height: 100%;\n }\n"],["\n padding: 0 0 100px;\n\n & > svg {\n height: 100%;\n }\n"]))),cm=o.div(Oh||(Oh=v(["\n position: fixed;\n bottom: 120px;\n width: 100dvw;\n display: flex;\n"],["\n position: fixed;\n bottom: 120px;\n width: 100dvw;\n display: flex;\n"]))),lm=o(hh)(Rh||(Rh=v(["\n padding: 12px 18px;\n margin: 0 auto;\n font-size: 14px;\n font-weight: bold;\n background: white;\n box-shadow:\n 0 1px 3px 0 rgb(0 0 0 / 0.1),\n 0 1px 2px -1px rgb(0 0 0 / 0.1);\n"],["\n padding: 12px 18px;\n margin: 0 auto;\n font-size: 14px;\n font-weight: bold;\n background: white;\n box-shadow:\n 0 1px 3px 0 rgb(0 0 0 / 0.1),\n 0 1px 2px -1px rgb(0 0 0 / 0.1);\n"]))),dm=o.input(Fh||(Fh=v(["\n margin-right: 8px;\n"],["\n margin-right: 8px;\n"]))),fm=o(Dh)(Ph||(Ph=v(["\n display: flex;\n flex-direction: row;\n padding: 15px 25px;\n height: 100px;\n color: ",";\n ","\n position: fixed;\n bottom: 0;\n left: 0;\n width: 100dvw;\n box-sizing: border-box;\n"],["\n display: flex;\n flex-direction: row;\n padding: 15px 25px;\n height: 100px;\n color: ",";\n ","\n position: fixed;\n bottom: 0;\n left: 0;\n width: 100dvw;\n box-sizing: border-box;\n"])),(function(e){var t,n,r,o;return null!==(o=null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.selfieCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.progressBarTextColor)&&void 0!==o?o:"white"}),(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.idCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.progressBarFontSize)?"font-size: ".concat(null===(a=null===(i=null===(o=e.theme)||void 0===o?void 0:o.idCapture)||void 0===i?void 0:i.loadingOverlay)||void 0===a?void 0:a.progressBarFontSize,";"):""})),pm=o.div(Uh||(Uh=v(["\n display: flex;\n position: relative;\n z-index: 2;\n"],["\n display: flex;\n position: relative;\n z-index: 2;\n"]))),hm=o.ul(_h||(_h=v(["\n display: block;\n margin: auto;\n list-style: none;\n padding: 0;\n"],["\n display: block;\n margin: auto;\n list-style: none;\n padding: 0;\n"]))),mm=o.li(jh||(jh=v(["\n display: inline-flex;\n justify-content: center;\n align-items: center;\n padding: 2px 1.25rem 2px 0;\n line-height: 1rem;\n\n &::before {\n content: '';\n display: inline-block;\n height: 1rem;\n min-width: 1rem;\n vertical-align: middle;\n background-size: cover;\n background-repeat: no-repeat;\n margin: auto 0.5rem auto 0;\n }\n\n &.done::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBjbGlwLXBhdGg9InVybCgjY2xpcDBfNDlfMzg1KSI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMiAyNEMxOC42Mjc0IDI0IDI0IDE4LjYyNzQgMjQgMTJDMjQgNS4zNzI1OCAxOC42Mjc0IDAgMTIgMEM1LjM3MjU4IDAgMCA1LjM3MjU4IDAgMTJDMCAxOC42Mjc0IDUuMzcyNTggMjQgMTIgMjRaTTE5LjU2NDMgOC4yNzg1MkMxOS45NTQ5IDcuODg3OTkgMTkuOTU0OSA3LjI1NDgzIDE5LjU2NDMgNi44NjQzQzE5LjE3MzggNi40NzM3OCAxOC41NDA2IDYuNDczNzggMTguMTUwMSA2Ljg2NDNMOS40Mjg2NiAxNS41ODU4TDUuODUwMDUgMTIuMDA3MkM1LjQ1OTUzIDExLjYxNjYgNC44MjYzNiAxMS42MTY2IDQuNDM1ODQgMTIuMDA3MkM0LjA0NTMxIDEyLjM5NzcgNC4wNDUzMSAxMy4wMzA5IDQuNDM1ODQgMTMuNDIxNEw4LjcyMTU1IDE3LjcwNzFDOS4xMTIwOCAxOC4wOTc2IDkuNzQ1MjQgMTguMDk3NiAxMC4xMzU4IDE3LjcwNzFMMTkuNTY0MyA4LjI3ODUyWiIgZmlsbD0id2hpdGUiLz48L2c+PGRlZnM+PGNsaXBQYXRoIGlkPSJjbGlwMF80OV8zODUiPjxyZWN0IHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0id2hpdGUiLz48L2NsaXBQYXRoPjwvZGVmcz48L3N2Zz4=');\n }\n\n &.running::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBjbGlwLXBhdGg9InVybCgjY2xpcDBfNDlfMzcwKSI+PG1hc2sgaWQ9InBhdGgtMS1pbnNpZGUtMV80OV8zNzAiIGZpbGw9IndoaXRlIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTMuNTE0NzIgMjAuNDg1NUM4LjIwMTAxIDI1LjE3MTggMTUuNzk5IDI1LjE3MTggMjAuNDg1MyAyMC40ODU1QzI1LjE3MTYgMTUuNzk5MiAyNS4xNzE2IDguMjAxMTkgMjAuNDg1MyAzLjUxNDlDMTUuNzk5IC0xLjE3MTM5IDguMjAxMDEgLTEuMTcxMzkgMy41MTQ3MiAzLjUxNDlDLTEuMTcxNTcgOC4yMDExOSAtMS4xNzE1NyAxNS43OTkyIDMuNTE0NzIgMjAuNDg1NVoiLz48L21hc2s+PHBhdGggZD0iTTYuMzk4MTQgMTEuNDU5QzUuODQ1ODYgMTEuNDU5IDUuMzk4MTQgMTEuOTA2NyA1LjM5ODE0IDEyLjQ1OUM1LjM5ODE0IDEzLjAxMTIgNS44NDU4NiAxMy40NTkgNi4zOTgxNCAxMy40NTlWMTEuNDU5Wk0xNy42MDE5IDEzLjQ1OUMxOC4xNTQxIDEzLjQ1OSAxOC42MDE5IDEzLjAxMTIgMTguNjAxOSAxMi40NTlDMTguNjAxOSAxMS45MDY3IDE4LjE1NDEgMTEuNDU5IDE3LjYwMTkgMTEuNDU5VjEzLjQ1OVpNNi4zOTgxNCAxMy40NTlIMTcuNjAxOVYxMS40NTlINi4zOTgxNFYxMy40NTlaTTMuNTE0NzIgMjAuNDg1NUw0LjkyODkzIDE5LjA3MTNMNC45Mjg5MyAxOS4wNzEzTDMuNTE0NzIgMjAuNDg1NVpNMjAuNDg1MyAzLjUxNDlMMTkuMDcxMSA0LjkyOTEyTDE5LjA3MTEgNC45MjkxMkwyMC40ODUzIDMuNTE0OVpNMy41MTQ3MiAzLjUxNDlMNC45Mjg5MyA0LjkyOTEyTDQuOTI4OTMgNC45MjkxMkwzLjUxNDcyIDMuNTE0OVpNMTkuMDcxMSAxOS4wNzEzQzE1LjE2NTggMjIuOTc2NSA4LjgzNDE3IDIyLjk3NjUgNC45Mjg5MyAxOS4wNzEzTDIuMTAwNTEgMjEuODk5N0M3LjU2Nzg0IDI3LjM2NyAxNi40MzIyIDI3LjM2NyAyMS44OTk1IDIxLjg5OTdMMTkuMDcxMSAxOS4wNzEzWk0xOS4wNzExIDQuOTI5MTJDMjIuOTc2MyA4LjgzNDM2IDIyLjk3NjMgMTUuMTY2IDE5LjA3MTEgMTkuMDcxM0wyMS44OTk1IDIxLjg5OTdDMjcuMzY2OCAxNi40MzIzIDI3LjM2NjggNy41NjgwMyAyMS44OTk1IDIuMTAwNjlMMTkuMDcxMSA0LjkyOTEyWk00LjkyODkzIDQuOTI5MTJDOC44MzQxNyAxLjAyMzg3IDE1LjE2NTggMS4wMjM4NyAxOS4wNzExIDQuOTI5MTJMMjEuODk5NSAyLjEwMDY5QzE2LjQzMjIgLTMuMzY2NjUgNy41Njc4NCAtMy4zNjY2NSAyLjEwMDUxIDIuMTAwNjlMNC45Mjg5MyA0LjkyOTEyWk00LjkyODkzIDE5LjA3MTNDMS4wMjM2OSAxNS4xNjYgMS4wMjM2OSA4LjgzNDM2IDQuOTI4OTMgNC45MjkxMkwyLjEwMDUxIDIuMTAwNjlDLTMuMzY2ODMgNy41NjgwMyAtMy4zNjY4MyAxNi40MzIzIDIuMTAwNTEgMjEuODk5N0w0LjkyODkzIDE5LjA3MTNaIiBmaWxsPSJ3aGl0ZSIgbWFzaz0idXJsKCNwYXRoLTEtaW5zaWRlLTFfNDlfMzcwKSIvPjwvZz48ZGVmcz48Y2xpcFBhdGggaWQ9ImNsaXAwXzQ5XzM3MCI+PHJlY3Qgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSJ3aGl0ZSIvPjwvY2xpcFBhdGg+PC9kZWZzPjwvc3ZnPg==');\n }\n"],["\n display: inline-flex;\n justify-content: center;\n align-items: center;\n padding: 2px 1.25rem 2px 0;\n line-height: 1rem;\n\n &::before {\n content: '';\n display: inline-block;\n height: 1rem;\n min-width: 1rem;\n vertical-align: middle;\n background-size: cover;\n background-repeat: no-repeat;\n margin: auto 0.5rem auto 0;\n }\n\n &.done::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBjbGlwLXBhdGg9InVybCgjY2xpcDBfNDlfMzg1KSI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMiAyNEMxOC42Mjc0IDI0IDI0IDE4LjYyNzQgMjQgMTJDMjQgNS4zNzI1OCAxOC42Mjc0IDAgMTIgMEM1LjM3MjU4IDAgMCA1LjM3MjU4IDAgMTJDMCAxOC42Mjc0IDUuMzcyNTggMjQgMTIgMjRaTTE5LjU2NDMgOC4yNzg1MkMxOS45NTQ5IDcuODg3OTkgMTkuOTU0OSA3LjI1NDgzIDE5LjU2NDMgNi44NjQzQzE5LjE3MzggNi40NzM3OCAxOC41NDA2IDYuNDczNzggMTguMTUwMSA2Ljg2NDNMOS40Mjg2NiAxNS41ODU4TDUuODUwMDUgMTIuMDA3MkM1LjQ1OTUzIDExLjYxNjYgNC44MjYzNiAxMS42MTY2IDQuNDM1ODQgMTIuMDA3MkM0LjA0NTMxIDEyLjM5NzcgNC4wNDUzMSAxMy4wMzA5IDQuNDM1ODQgMTMuNDIxNEw4LjcyMTU1IDE3LjcwNzFDOS4xMTIwOCAxOC4wOTc2IDkuNzQ1MjQgMTguMDk3NiAxMC4xMzU4IDE3LjcwNzFMMTkuNTY0MyA4LjI3ODUyWiIgZmlsbD0id2hpdGUiLz48L2c+PGRlZnM+PGNsaXBQYXRoIGlkPSJjbGlwMF80OV8zODUiPjxyZWN0IHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0id2hpdGUiLz48L2NsaXBQYXRoPjwvZGVmcz48L3N2Zz4=');\n }\n\n &.running::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBjbGlwLXBhdGg9InVybCgjY2xpcDBfNDlfMzcwKSI+PG1hc2sgaWQ9InBhdGgtMS1pbnNpZGUtMV80OV8zNzAiIGZpbGw9IndoaXRlIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTMuNTE0NzIgMjAuNDg1NUM4LjIwMTAxIDI1LjE3MTggMTUuNzk5IDI1LjE3MTggMjAuNDg1MyAyMC40ODU1QzI1LjE3MTYgMTUuNzk5MiAyNS4xNzE2IDguMjAxMTkgMjAuNDg1MyAzLjUxNDlDMTUuNzk5IC0xLjE3MTM5IDguMjAxMDEgLTEuMTcxMzkgMy41MTQ3MiAzLjUxNDlDLTEuMTcxNTcgOC4yMDExOSAtMS4xNzE1NyAxNS43OTkyIDMuNTE0NzIgMjAuNDg1NVoiLz48L21hc2s+PHBhdGggZD0iTTYuMzk4MTQgMTEuNDU5QzUuODQ1ODYgMTEuNDU5IDUuMzk4MTQgMTEuOTA2NyA1LjM5ODE0IDEyLjQ1OUM1LjM5ODE0IDEzLjAxMTIgNS44NDU4NiAxMy40NTkgNi4zOTgxNCAxMy40NTlWMTEuNDU5Wk0xNy42MDE5IDEzLjQ1OUMxOC4xNTQxIDEzLjQ1OSAxOC42MDE5IDEzLjAxMTIgMTguNjAxOSAxMi40NTlDMTguNjAxOSAxMS45MDY3IDE4LjE1NDEgMTEuNDU5IDE3LjYwMTkgMTEuNDU5VjEzLjQ1OVpNNi4zOTgxNCAxMy40NTlIMTcuNjAxOVYxMS40NTlINi4zOTgxNFYxMy40NTlaTTMuNTE0NzIgMjAuNDg1NUw0LjkyODkzIDE5LjA3MTNMNC45Mjg5MyAxOS4wNzEzTDMuNTE0NzIgMjAuNDg1NVpNMjAuNDg1MyAzLjUxNDlMMTkuMDcxMSA0LjkyOTEyTDE5LjA3MTEgNC45MjkxMkwyMC40ODUzIDMuNTE0OVpNMy41MTQ3MiAzLjUxNDlMNC45Mjg5MyA0LjkyOTEyTDQuOTI4OTMgNC45MjkxMkwzLjUxNDcyIDMuNTE0OVpNMTkuMDcxMSAxOS4wNzEzQzE1LjE2NTggMjIuOTc2NSA4LjgzNDE3IDIyLjk3NjUgNC45Mjg5MyAxOS4wNzEzTDIuMTAwNTEgMjEuODk5N0M3LjU2Nzg0IDI3LjM2NyAxNi40MzIyIDI3LjM2NyAyMS44OTk1IDIxLjg5OTdMMTkuMDcxMSAxOS4wNzEzWk0xOS4wNzExIDQuOTI5MTJDMjIuOTc2MyA4LjgzNDM2IDIyLjk3NjMgMTUuMTY2IDE5LjA3MTEgMTkuMDcxM0wyMS44OTk1IDIxLjg5OTdDMjcuMzY2OCAxNi40MzIzIDI3LjM2NjggNy41NjgwMyAyMS44OTk1IDIuMTAwNjlMMTkuMDcxMSA0LjkyOTEyWk00LjkyODkzIDQuOTI5MTJDOC44MzQxNyAxLjAyMzg3IDE1LjE2NTggMS4wMjM4NyAxOS4wNzExIDQuOTI5MTJMMjEuODk5NSAyLjEwMDY5QzE2LjQzMjIgLTMuMzY2NjUgNy41Njc4NCAtMy4zNjY2NSAyLjEwMDUxIDIuMTAwNjlMNC45Mjg5MyA0LjkyOTEyWk00LjkyODkzIDE5LjA3MTNDMS4wMjM2OSAxNS4xNjYgMS4wMjM2OSA4LjgzNDM2IDQuOTI4OTMgNC45MjkxMkwyLjEwMDUxIDIuMTAwNjlDLTMuMzY2ODMgNy41NjgwMyAtMy4zNjY4MyAxNi40MzIzIDIuMTAwNTEgMjEuODk5N0w0LjkyODkzIDE5LjA3MTNaIiBmaWxsPSJ3aGl0ZSIgbWFzaz0idXJsKCNwYXRoLTEtaW5zaWRlLTFfNDlfMzcwKSIvPjwvZz48ZGVmcz48Y2xpcFBhdGggaWQ9ImNsaXAwXzQ5XzM3MCI+PHJlY3Qgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSJ3aGl0ZSIvPjwvY2xpcFBhdGg+PC9kZWZzPjwvc3ZnPg==');\n }\n"]))),gm=o.div(Bh||(Bh=v(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"],["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"]))),vm=o.div(zh||(zh=v(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: ",";\n opacity: ",";\n"],["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: ",";\n opacity: ",";\n"])),(function(e){var t,n,r,o;return null!==(o=null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.idCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.progressBarBackgroundColor)&&void 0!==o?o:"var(--idm-color-positive-600)"}),(function(e){var t,n,r,o;return null!==(o=null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.idCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.progressBarBackgroundOpacity)&&void 0!==o?o:.75})),ym=o.span(Gh||(Gh=v(["\n display: block;\n width: ","%;\n height: 100%;\n"],["\n display: block;\n width: ","%;\n height: 100%;\n"])),(function(e){return e.$progress})),bm=o.span(Vh||(Vh=v(["\n display: block;\n height: 100%;\n background: ",";\n animation: progressBar 3s ease-in-out;\n animation-fill-mode: both;\n\n @keyframes progressBar {\n 0% {\n width: 0;\n }\n 100% {\n width: 100%;\n }\n }\n"],["\n display: block;\n height: 100%;\n background: ",";\n animation: progressBar 3s ease-in-out;\n animation-fill-mode: both;\n\n @keyframes progressBar {\n 0% {\n width: 0;\n }\n 100% {\n width: 100%;\n }\n }\n"])),(function(e){var t,n,r,o;return null!==(o=null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.idCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.progressBarIndicatorColor)&&void 0!==o?o:"var(--idm-color-positive-600)"})),xm=o.img(Wh||(Wh=v([""],[""]))),Cm=o.div(qh||(qh=v(["\n display: flex;\n"],["\n display: flex;\n"]))),wm=o(le)(Hh||(Hh=v(["\n margin: auto;\n white-space: nowrap;\n ","\n ","\n"],["\n margin: auto;\n white-space: nowrap;\n ","\n ","\n"])),(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.idCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.progressBarFontSize)?"font-size: ".concat(null===(a=null===(i=null===(o=e.theme)||void 0===o?void 0:o.idCapture)||void 0===i?void 0:i.loadingOverlay)||void 0===a?void 0:a.progressBarFontSize,";"):""}),(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.idCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.continueBtnBorder)?"border: ".concat(null===(a=null===(i=null===(o=e.theme)||void 0===o?void 0:o.idCapture)||void 0===i?void 0:i.loadingOverlay)||void 0===a?void 0:a.continueBtnBorder,";"):""})),Em=o.div(Yh||(Yh=v(["\n margin-top: 15px;\n margin-bottom: 15px;\n"],["\n margin-top: 15px;\n margin-bottom: 15px;\n"]))),km=o.input(Zh||(Zh=v(["\n margin-right: 8px;\n"],["\n margin-right: 8px;\n"]))),Dm={default:function(e){var n,r,o,i,a=e.onDismissed,s=e.onUserCancel,u=e.instructions,c=e.rotateImage,l=void 0!==c&&c,d=e.assets,f=void 0===d?{}:d,p=e.classNames,h=void 0===p?{}:p,m=e.colors,g=void 0===m?{}:m,v=e.verbiage,y=void 0===v?{}:v,b=t.useContext(bf),x=b.ready,C=b.modelDownloadProgress,w=t.useContext(nt),E=w.cameraReady,k=w.cameraAccessDenied,D=w.iphoneContinuityCameraAvailable,M=w.setIphoneContinuityCameraAllowed,T=t.useState(!1),I=T[0],S=T[1];f.instructionImageUrl||(f.instructionImageUrl=om);var N=rh(y,{headingText:"Use your device camera to capture your ID",useContinuityCameraText:"Use your iPhone as a webcam",downloadingText:"Downloading...",modelsWarmingUpText:"Loading guided capture experience...",modelsReadyText:"Guided capture experience ready",cameraInitializingText:"Camera initializing...",cameraInitializedText:"Camera ready",continueText:"Let's Go!"});t.useEffect((function(){if(x&&E)return function(){return null};var e=setTimeout((function(){S(!1)}),500);return function(){clearTimeout(e)}}),[E,x]);var A=t.useRef(null);if(I)return t.createElement(t.Fragment,null);if(k)return t.createElement(yh,{assets:f.cameraAccessDenied,classNames:h.cameraAccessDenied,colors:g.cameraAccessDenied,verbiage:y.cameraAccessDenied});var L={};if(l){var O=null!==(r=null===(n=A.current)||void 0===n?void 0:n.naturalWidth)&&void 0!==r?r:0,R=null!==(i=null===(o=A.current)||void 0===o?void 0:o.naturalHeight)&&void 0!==i?i:0;L={transform:"rotate(-90deg) scale(".concat(O>R?R/O:1,")")}}return t.createElement(_,{className:h.container},t.createElement(im,{className:h.inner},t.createElement(am,null,t.createElement(sm,{className:h.heading},N.headingText)),s&&t.createElement(kh,{onClick:s,className:h.cancelBtn}),t.createElement(um,{className:h.imageContainer,style:{pointerEvents:"none"}},(null==f?void 0:f.instructionImageUrl)&&f.instructionImageUrl!==om?t.createElement(xm,{ref:A,alt:N.headingText,src:f.instructionImageUrl,className:h.image,style:L}):t.createElement(Mh,{className:h.image})),u,t.createElement(cm,{className:h.continuityCameraCheckboxContainer},D&&t.createElement(lm,{className:h.continuityCameraCheckboxInner},t.createElement(dm,{className:h.continuityCameraCheckbox,id:"use-continuity-camera",type:"checkbox",defaultChecked:!0,onChange:function(e){M(e.target.checked)}}),t.createElement("label",{htmlFor:"use-continuity-camera",className:h.continuityCameraCheckboxLabel},N.useContinuityCameraText))),t.createElement(fm,{className:h.buttonsRow},t.createElement(gm,{className:h.progressContainer},t.createElement(vm,{className:h.progressBackground}),t.createElement(ym,{$progress:C,className:h.progressBar},t.createElement(bm,{className:h.progressIndicator}))),t.createElement(pm,{className:h.loadingListContainer},t.createElement(hm,{className:h.loadingList},t.createElement(mm,{className:"".concat(h.loadingListItem," ").concat(E?"done":"running")},E?N.cameraInitializedText:N.cameraInitializingText),t.createElement(mm,{className:"".concat(h.loadingListItem," ").concat(x?"done":"running")},x?N.modelsReadyText:C>=100?N.modelsWarmingUpText:"".concat(N.downloadingText," (").concat(C,"%)")))),t.createElement(Cm,{className:h.continueBtnContainer},x&&E&&t.createElement(wm,{finished:!0,className:h.continueBtn,variant:"positive",colors:g.continueBtn,onClick:function(){S(!0),null==a||a()}},N.continueText)))))},legacy:function(e){var n,r,o,i,a=e.onDismissed,s=e.onUserCancel,u=e.instructions,c=e.rotateImage,l=void 0!==c&&c,d=e.assets,f=void 0===d?{}:d,p=e.classNames,h=void 0===p?{}:p,m=e.colors,g=void 0===m?{}:m,v=e.verbiage,y=void 0===v?{}:v,b=t.useContext(bf),x=b.ready,C=b.modelDownloadProgress,w=t.useContext(nt),E=w.cameraReady,k=w.cameraAccessDenied,D=w.iphoneContinuityCameraAvailable,M=w.setIphoneContinuityCameraAllowed,T=t.useState(!1),I=T[0],S=T[1];f.instructionImageUrl||(f.instructionImageUrl="".concat(mh,"/WebSDK-Instruction-DL-Capture-3-Portrait.png"));var N=rh(y,{headingText:"Use your device camera to capture your ID",useContinuityCameraText:"Use your iPhone as a webcam",downloadingText:"Downloading...",modelsWarmingUpText:"Models warming up...",cameraInitializingText:"Camera initializing...",continueText:"Continue"});t.useEffect((function(){if(x&&E)return function(){return null};var e=setTimeout((function(){S(!1)}),500);return function(){clearTimeout(e)}}),[E,x]);var A=t.useRef(null);if(I)return t.createElement(t.Fragment,null);if(k)return t.createElement(yh,{assets:f.cameraAccessDenied,classNames:h.cameraAccessDenied,colors:g.cameraAccessDenied,verbiage:y.cameraAccessDenied});var L={};if(l){var O=null!==(r=null===(n=A.current)||void 0===n?void 0:n.naturalWidth)&&void 0!==r?r:0,R=null!==(i=null===(o=A.current)||void 0===o?void 0:o.naturalHeight)&&void 0!==i?i:0;L={transform:"rotate(-90deg) scale(".concat(O>R?R/O:1,")")}}return t.createElement(_,{className:h.container},t.createElement(j,{className:h.inner},t.createElement("h3",{className:h.heading},N.headingText),s&&t.createElement(kh,{onClick:s,className:h.cancelBtn}),t.createElement(B,{className:h.imageContainer,style:{pointerEvents:"none"}},t.createElement("img",{ref:A,alt:N.headingText,src:f.instructionImageUrl,className:h.image,style:L})),u,t.createElement(Em,{className:h.continuityCameraCheckboxContainer},D&&t.createElement(t.Fragment,null,t.createElement(km,{className:h.continuityCameraCheckbox,id:"use-continuity-camera",type:"checkbox",defaultChecked:!0,onChange:function(e){M(e.target.checked)}}),t.createElement("label",{htmlFor:"use-continuity-camera",className:h.continuityCameraCheckboxLabel},N.useContinuityCameraText))),t.createElement(le,{className:h.continueBtn,variant:"positive",disabled:!E||!x,finished:x&&E,colors:g.continueBtn,onClick:function(){S(!0),null==a||a()}},E&&x?N.continueText:x?N.cameraInitializingText:C>=100?N.modelsWarmingUpText:"".concat(N.downloadingText," (").concat(C,"%)"))))}},Mm=function(e){var n,r=e.mode,o=void 0===r?"default":r,i=p(e,["mode"]),a=null!==(n=Dm[o])&&void 0!==n?n:Dm.default;return t.createElement(a,f({},i))},Tm=function(e){var n=e.alt,r=e.className,o=e.image,i=t.useState(o.imageData),a=i[0],s=i[1],u=t.useState(!1),c=u[0],l=u[1],d=o.boundingBox,f=t.useRef(null);return t.createElement("img",{ref:f,alt:n,className:r,src:a,onLoad:function(){d&&!c&&(l(!0),setTimeout((function(){s(Dd(f.current,d).toDataURL("image/jpeg",.95))}),100))},onClick:function(){fetch(o.imageData).then((function(e){return e.blob()})).then((function(e){var t,n=URL.createObjectURL(new Blob([e])),r=document.createElement("a");r.href=n,r.setAttribute("download","".concat(o.documentType,".jpg")),document.body.appendChild(r),r.click(),null===(t=r.parentNode)||void 0===t||t.removeChild(r)}))}})},Im=o.p(Qh||(Qh=v(["\n font-size: 18px;\n margin: 30px 0;\n"],["\n font-size: 18px;\n margin: 30px 0;\n"]))),Sm=function(e){var n=e.capturedDocuments,r=e.onSubmitClick,o=e.onRetryClick,i=e.classNames,a=void 0===i?{}:i,s=e.colors,u=void 0===s?{}:s,c=e.verbiage,l=void 0===c?{}:c,d=e.debugMode,f=void 0!==d&&d,p=t.useContext(_e).submissionStatus,h=n.idCardFront,m=n.idCardBack,g=n.passport,v=rh(l,{headingText:"ID Capture Successful",idCardFrontText:"ID Card Front",idCardBackText:"ID Card Back",passportText:"Passport",instructionText:"Verify the entire ID was captured clearly with no glare.",retryText:"Retry",submittingText:"Submitting...",submitText:"Done"});return t.createElement(_,{className:a.container},t.createElement(j,{className:a.inner},t.createElement(Am,{className:a.imageContainer},t.createElement(Lm,{className:a.imageRow},t.createElement(Nm,{className:a.heading},v.headingText),h&&t.createElement(Om,{className:a.imageCol},t.createElement(Rm,{className:a.imageHeading},v.idCardFrontText),t.createElement(Fm,{className:a.imageWrapper},t.createElement(Pm,{image:h,className:a.image,alt:v.idCardFrontText})),f&&t.createElement("pre",null,"Detection Score: ".concat(h.detectionScore,"\nFocus Score: ").concat(h.focusScore,"\nBounding Box: ").concat(JSON.stringify(h.boundingBox)))),m&&t.createElement(Om,{className:a.imageCol},t.createElement(Rm,{className:a.imageHeading},v.idCardBackText),t.createElement(Fm,{className:a.imageWrapper},t.createElement(Pm,{image:m,className:a.image,alt:v.idCardBackText})),f&&t.createElement("pre",null,"Detection Score: ".concat(m.detectionScore,"\nFocus Score: ").concat(m.focusScore,"\nBounding Box: ").concat(JSON.stringify(m.boundingBox)))),g&&t.createElement(Om,{className:a.imageCol},t.createElement(Rm,{className:a.imageHeading},v.passportText),t.createElement(Fm,{className:a.imageWrapper},t.createElement(Pm,{image:g,className:a.image,alt:v.passportText})),f&&t.createElement("pre",null,"Detection Score: ".concat(g.detectionScore,"\nFocus Score: ").concat(g.focusScore,"\nBounding Box: ").concat(JSON.stringify(g.boundingBox)))))),t.createElement(Im,{className:a.instruction},v.instructionText),t.createElement(Dh,{className:a.buttonsRow},t.createElement(le,{className:a.retryBtn,variant:"warning",onClick:o,colors:u.retryBtn,finished:!0},v.retryText),t.createElement(le,{className:a.submitBtn,variant:"positive",onClick:r,disabled:p===b.SUBMITTING,colors:u.doneBtn,finished:!0},p===b.SUBMITTING?v.submittingText:v.submitText))))},Nm=o.h1($h||($h=v(["\n margin-bottom: 12px;\n"],["\n margin-bottom: 12px;\n"]))),Am=o(B)(Xh||(Xh=v(["\n overflow-y: auto;\n"],["\n overflow-y: auto;\n"]))),Lm=o(z)(Kh||(Kh=v(["\n flex-direction: column;\n"],["\n flex-direction: column;\n"]))),Om=o.div(Jh||(Jh=v(["\n max-height: none !important;\n"],["\n max-height: none !important;\n"]))),Rm=o.h3(em||(em=v(["\n text-align: left;\n margin-top: 24px;\n margin-bottom: 8px;\n font-size: 16px;\n font-weight: normal;\n"],["\n text-align: left;\n margin-top: 24px;\n margin-bottom: 8px;\n font-size: 16px;\n font-weight: normal;\n"]))),Fm=o.div(tm||(tm=v(["\n border: 1px solid\n ",";\n border-radius: 6px;\n padding: 4px;\n background: white;\n display: flex;\n"],["\n border: 1px solid\n ",";\n border-radius: 6px;\n padding: 4px;\n background: white;\n display: flex;\n"])),(function(e){var t,n,r;return null!==(r=null===(n=null===(t=e.theme.idCapture)||void 0===t?void 0:t.success)||void 0===n?void 0:n.imageBorderColor)&&void 0!==r?r:"var(--idm-color-primary-400)"})),Pm=o(Tm)(nm||(nm=v(["\n width: 100%;\n border-radius: 4px;\n"],["\n width: 100%;\n border-radius: 4px;\n"]))),Um=function(e){var n,r=e.className,o=t.useContext(nt),i=o.videoRef,a=o.setVideoLoaded,s=o.onVideoUnmounted,u=o.cameraRef;t.useEffect((function(){var e=i.current;if(e)return function(){s(e)}}),[s,i]),t.useEffect((function(){a(!1)}),[a]),t.useEffect((function(){var e;i.current&&(null===(e=u.current)||void 0===e?void 0:e.stream)&&(i.current.srcObject=u.current.stream)}),[u,i]);var c=t.useCallback((function(){a(!0)}),[a]);return t.createElement(_m,{className:r,autoPlay:!0,playsInline:!0,muted:!0,ref:i,onLoadedData:c,$isRearFacing:null===(n=u.current)||void 0===n?void 0:n.isRearFacing})},_m=o.video(rm||(rm=v(["\n transform: ",";\n min-width: 100%;\n min-height: 100%;\n width: auto;\n height: auto;\n max-width: 100%;\n max-height: 100%;\n object-fit: cover;\n background: black;\n z-index: -2;\n"],["\n transform: ",";\n min-width: 100%;\n min-height: 100%;\n width: auto;\n height: auto;\n max-width: 100%;\n max-height: 100%;\n object-fit: cover;\n background: black;\n z-index: -2;\n"])),(function(e){return e.$isRearFacing?"":"scaleX(-1)"}));function jm(e,n,r){var o=this,i=t.useState(!1),a=i[0],s=i[1];return t.useEffect((function(){n&&e&&("function"==typeof e?h(o,void 0,void 0,(function(){return m(this,(function(t){switch(t.label){case 0:return[4,e()];case 1:return t.sent()?null==r||r():s(!0),[2]}}))})):null==r||r())}),[n,r,e]),!e||a}var Bm,zm=o.div(Bm||(Bm=v(["\n ","\n"],["\n ","\n"])),(function(e){return"snapToGuides"===e.$mode?"display: flex;\n position: absolute;\n left: ".concat(e.$x,"px;\n top: ").concat(e.$y,"px;\n width: ").concat(e.$w,"px;\n height: ").concat(e.$h,"px;"):""}));function Gm(e,t,n){var r,o=1;"undefined"!=typeof window&&(o=window.devicePixelRatio),e.width=t*o,e.height=n*o,e.style.width=t+"px",e.style.height=n+"px",null===(r=e.getContext("2d"))||void 0===r||r.scale(o,o)}function Vm(e){e.width=0,e.height=0,e.style.width="0",e.style.height="0"}var Wm,qm,Hm,Ym,Zm,Qm,$m,Xm,Km,Jm,eg,tg,ng=t.createContext({orientation:"landscape",wrapperWidth:1,wrapperHeight:1,wrapperAspectRatio:0,imageAspectRatio:0,wrapperRef:null,setDimensions:function(){return null},onImageLoaded:function(){return null}}),rg=o(L)(Wm||(Wm=v(["\n z-index: 1000;\n"],["\n z-index: 1000;\n"]))),og=o.div(qm||(qm=v(["\n display: flex;\n flex-flow: column nowrap;\n width: 100dvw;\n height: 100dvh;\n"],["\n display: flex;\n flex-flow: column nowrap;\n width: 100dvw;\n height: 100dvh;\n"]))),ig=o.div(Hm||(Hm=v(["\n position: relative;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-items: center;\n box-sizing: border-box;\n max-width: 100%;\n max-height: 100%;\n min-height: 0;\n flex: 1;\n"],["\n position: relative;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-items: center;\n box-sizing: border-box;\n max-width: 100%;\n max-height: 100%;\n min-height: 0;\n flex: 1;\n"]))),ag=o.div(Ym||(Ym=v(["\n display: flex;\n flex-direction: column;\n justify-content: end;\n width: 100%;\n position: relative;\n z-index: 1000;\n background: ",";\n color: ",";\n text-align: center;\n ","\n ","\n"],["\n display: flex;\n flex-direction: column;\n justify-content: end;\n width: 100%;\n position: relative;\n z-index: 1000;\n background: ",";\n color: ",";\n text-align: center;\n ","\n ","\n"])),(function(e){var t,n,r,o,i;return null!==(i=null!==(t=e.$maskColor)&&void 0!==t?t:null===(o=null===(r=null===(n=e.theme)||void 0===n?void 0:n.idCapture)||void 0===r?void 0:r.guideOverlay)||void 0===o?void 0:o.backgroundColor)&&void 0!==i?i:"rgba(0, 0, 0, 0.5)"}),(function(e){var t,n,r,o;return null!==(o=null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.idCapture)||void 0===n?void 0:n.guideOverlay)||void 0===r?void 0:r.textColor)&&void 0!==o?o:"white"}),(function(e){return e.$minWidth?"min-width: ".concat(e.$minWidth,"px;"):""}),(function(e){return e.$minHeight?"min-height: ".concat(e.$minHeight,"px;"):""})),sg=o(ag)(Zm||(Zm=v(["\n display: block;\n width: auto;\n"],["\n display: block;\n width: auto;\n"]))),ug=o.div(Qm||(Qm=v(["\n ","\n ","\n box-sizing: border-box;\n display: flex;\n flex: 1;\n max-height: 100%;\n height: 100%;\n"],["\n ","\n ","\n box-sizing: border-box;\n display: flex;\n flex: 1;\n max-height: 100%;\n height: 100%;\n"])),(function(e){return e.$minWidth?"min-width: ".concat(e.$minWidth,"px;"):""}),(function(e){return e.$isMirrored?"transform: scaleX(-1);":""})),cg=o.div($m||($m=v(["\n box-sizing: border-box;\n border: ",";\n display: flex;\n flex: 1;\n justify-content: center;\n max-height: 100%;\n min-height: 0;\n position: relative;\n"],["\n box-sizing: border-box;\n border: ",";\n display: flex;\n flex: 1;\n justify-content: center;\n max-height: 100%;\n min-height: 0;\n position: relative;\n"])),(function(e){var t,n;return"".concat(null!==(t=e.$borderWidth)&&void 0!==t?t:4,"px solid ").concat(null!==(n=e.$borderColor)&&void 0!==n?n:"white")})),lg=o.span(Xm||(Xm=v(["\n align-content: center;\n margin-top: 12px;\n margin-bottom: 12px;\n"],["\n align-content: center;\n margin-top: 12px;\n margin-bottom: 12px;\n"]))),dg=o.img(Km||(Km=v(["\n position: relative;\n z-index: 1;\n padding: ","px;\n box-sizing: border-box;\n opacity: ",";\n transition: opacity 0.5s;\n max-height: 100%;\n max-width: 100%;\n"],["\n position: relative;\n z-index: 1;\n padding: ","px;\n box-sizing: border-box;\n opacity: ",";\n transition: opacity 0.5s;\n max-height: 100%;\n max-width: 100%;\n"])),(function(e){return e.$padding}),(function(e){return e.$visible?1:0})),fg=function(e){var n,r,i,a,s,u,c,l,d,f,p,h,m=e.classNames,g=void 0===m?{}:m,v=e.width,y=void 0===v?0:v,b=e.height,x=void 0===b?0:b,C=e.padding,w=e.imagePadding,E=e.imageVisible,k=void 0===E||E,D=e.borderWidth,M=e.borderColor,T=e.maskColor,I=e.isMirrored,S=void 0!==I&&I,N=e.instruction,A=void 0===N?"":N,L=e.portraitGuidesImageUrl,O=e.landscapeGuidesImageUrl,R=e.onClick,F=t.useContext(ng),P=F.orientation,U=F.wrapperRef,_=F.wrapperWidth,j=F.wrapperHeight,B=F.imageAspectRatio,z=F.wrapperAspectRatio,G=F.onImageLoaded,V=F.setDimensions,W=Af()[1];var q=o.useTheme();void 0===D&&(D=null!==(i=null===(r=null===(n=q.idCapture)||void 0===n?void 0:n.guideBox)||void 0===r?void 0:r.borderWidth)&&void 0!==i?i:4),0==y&&(y=_),0==x&&(x=j),t.useEffect((function(){V({width:y,height:x})}),[x,V,y]);var H=null!=C?C:gf()?null!==(u=null===(s=null===(a=q.idCapture)||void 0===a?void 0:a.guideBox)||void 0===s?void 0:s.mobilePadding)&&void 0!==u?u:0:null!==(d=null===(l=null===(c=q.idCapture)||void 0===c?void 0:c.guideBox)||void 0===l?void 0:l.desktopPadding)&&void 0!==d?d:50,Y=2*H+2*D,Z="portrait"===P?L:O,Q=null!==(h=null!=w?w:null===(p=null===(f=q.idCapture)||void 0===f?void 0:f.guideBox)||void 0===p?void 0:p.imagePadding)&&void 0!==h?h:0,$=void 0,X=void 0;return B>=z?$=_-Y:X=j-Y,t.createElement(rg,{ref:U,onClick:R,className:g.container},t.createElement(og,{className:g.inner},t.createElement(ag,{$maskColor:T,$minHeight:H,className:pg(g,"Top")},""!==A&&t.createElement(lg,{className:g.guideText},A)),t.createElement(ig,{className:g.centerRow},t.createElement(sg,{$maskColor:T,$minWidth:H,className:pg(g,"Left")}),t.createElement(ug,{$minWidth:$,$isMirrored:S,className:g.centerRegion},t.createElement(cg,{$borderWidth:D,$borderColor:M,className:g.centerRegionInner},t.createElement(dg,{src:Z,alt:"",onLoad:function(e){G(e);var t=e.target;W({type:"guideImageLoaded",payload:{width:t.naturalWidth,height:t.naturalHeight}})},className:g.image,$width:$,$height:X,$padding:Q,$visible:k}))),t.createElement(sg,{$maskColor:T,$minWidth:H,className:pg(g,"Right")})),t.createElement(ag,{$maskColor:T,$minHeight:H,className:pg(g,"Bottom")},""!==A&&t.createElement(lg,{style:{opacity:0}},A))))},pg=function(e,t){return[e.dimmingRegion,e["dimmingRegion".concat(t)]].filter((function(e){return e})).join(" ")},hg=o(dg)(Jm||(Jm=v(["\n backface-visibility: hidden;\n transform-style: preserve-3d;\n position: absolute;\n height: 100%;\n top: 0;\n left: 50%;\n transition: transform ","s;\n transform: translateX(-50%) ",";\n"],["\n backface-visibility: hidden;\n transform-style: preserve-3d;\n position: absolute;\n height: 100%;\n top: 0;\n left: 50%;\n transition: transform ","s;\n transform: translateX(-50%) ",";\n"])),(function(e){return e.$transitionTime}),(function(e){return e.$transforms})),mg=function(e){var n,r,i,a,s,u,c,l,d,f,p,h,m,g=e.padding,v=e.imagePadding,y=e.borderWidth,b=e.borderColor,x=e.maskColor,C=e.assets,w=void 0===C?{}:C,E=e.classNames,k=void 0===E?{}:E,D=e.verbiage,M=void 0===D?{}:D,T=ze(),I=T.ref,S=T.width,N=void 0===S?1:S,A=T.height,L=void 0===A?1:A,R=t.useContext(nt).cameraRef,F=o.useTheme();w.frontPortraitGuidesImageUrl||(w.frontPortraitGuidesImageUrl="".concat(mh,"/Shieldout-IDCard-Front-SVG-Portrait-2.svg")),w.frontLandscapeGuidesImageUrl||(w.frontLandscapeGuidesImageUrl="".concat(mh,"/Shieldout-IDCard-Front-SVG-Landscape-2.svg")),w.backPortraitGuidesImageUrl||(w.backPortraitGuidesImageUrl="".concat(mh,"/Shieldout-IDCard-Back-SVG-Portrait-2.svg")),w.backLandscapeGuidesImageUrl||(w.backLandscapeGuidesImageUrl="".concat(mh,"/Shieldout-IDCard-Back-SVG-Landscape-2.svg"));var P=nh(M.instructionText,"Please flip your ID card..."),U=(null!=g?g:gf())?null!==(i=null===(r=null===(n=F.idCapture)||void 0===n?void 0:n.guideBox)||void 0===r?void 0:r.mobilePadding)&&void 0!==i?i:0:null!==(u=null===(s=null===(a=F.idCapture)||void 0===a?void 0:a.guideBox)||void 0===s?void 0:s.desktopPadding)&&void 0!==u?u:50;void 0===y&&(y=null!==(d=null===(l=null===(c=F.idCapture)||void 0===c?void 0:c.guideBox)||void 0===l?void 0:l.borderWidth)&&void 0!==d?d:4);var _=!(null===(f=R.current)||void 0===f?void 0:f.isRearFacing),j=t.useContext(ng),B=j.orientation,z=j.wrapperRef,G=j.wrapperWidth,V=j.wrapperHeight,W=j.imageAspectRatio,q=j.wrapperAspectRatio,H=j.onImageLoaded,Y=j.setDimensions;t.useEffect((function(){Y({width:N,height:L})}),[L,Y,N]);var Z=2*U+2*y,Q=null!==(m=null!=v?v:null===(h=null===(p=F.idCapture)||void 0===p?void 0:p.guideBox)||void 0===h?void 0:h.imagePadding)&&void 0!==m?m:0,$=void 0,X=void 0;W>=q?$=G-Z:X=V-Z;var K=t.useState(1),J=K[0],ee=K[1],te=t.useState(0),ne=te[0],re=te[1],oe=["rotateY(".concat(ne,"deg)")];_&&oe.push("scaleX(-1)");var ie=["rotateY(".concat(180-ne,"deg)")];return _&&ie.push("scaleX(-1)"),t.useEffect((function(){var e=function(){ee(1),re(180),setTimeout((function(){ee(0),re(0)}),1500)};setTimeout(e,250);var t=setInterval(e,2500);return function(){clearInterval(t)}}),[]),t.createElement(O,{ref:I,className:k.container},t.createElement(og,{ref:z,className:k.inner},t.createElement(ag,{$minHeight:U,$maskColor:x,className:gg(k,"Top")},""!==P&&t.createElement(lg,{className:k.guideText},P)),t.createElement(ig,{className:k.centerRow},t.createElement(sg,{$minWidth:U,$maskColor:x,className:gg(k,"Left")}),t.createElement(ug,null,t.createElement(cg,{$borderWidth:y,$borderColor:b,className:k.centerRegion},t.createElement(hg,{src:"portrait"===B?w.frontPortraitGuidesImageUrl:w.frontLandscapeGuidesImageUrl,alt:"",className:k.image,$width:$,$height:X,$padding:Q,$transitionTime:J,$transforms:oe.join(" "),$visible:!0,onLoad:H}),t.createElement(hg,{src:"portrait"===B?w.backPortraitGuidesImageUrl:w.backLandscapeGuidesImageUrl,alt:"",className:k.image,$width:$,$height:X,$padding:Q,$transitionTime:J,$transforms:ie.join(" "),$visible:!0}))),t.createElement(sg,{$minWidth:U,$maskColor:x,className:gg(k,"Right")})),t.createElement(ag,{$minHeight:U,$maskColor:x,className:gg(k,"Bottom")},""!==P&&t.createElement(lg,{style:{opacity:0}},P))))},gg=function(e,t){return[e.dimmingRegion,e["dimmingRegion".concat(t)]].filter((function(e){return e})).join(" ")},vg=function(e){var n,r,i,a,s,u,c,l,d,f,p,h,m=e.aspectRatio,g=e.maskColor,v=e.borderRadius,y=void 0===v?33:v,b=e.borderColor,x=e.borderWidth,C=e.padding,w=e.imageUrl,E=e.imageVisible,k=e.frontImageUrl,D=e.backImageUrl,M=e.isMirrored,T=e.instruction,I=e.requestingFlip,S=void 0!==I&&I,N=e.classNames,A=void 0===N?{}:N,L=Af(),O=L[0],R=O.redrawing,F=O.guideImageWidth,P=O.guideImageHeight,U=L[1],_=t.useRef(null),j=ze(),B=j.ref,z=j.width,G=void 0===z?1:z,V=j.height,W=void 0===V?1:V,q=o.useTheme();return void 0===x&&(x=null!==(i=null===(r=null===(n=q.idCapture)||void 0===n?void 0:n.guideBox)||void 0===r?void 0:r.borderWidth)&&void 0!==i?i:4),void 0===C&&(C=gf()?null!==(u=null===(s=null===(a=q.idCapture)||void 0===a?void 0:a.guideBox)||void 0===s?void 0:s.mobilePadding)&&void 0!==u?u:0:null!==(d=null===(l=null===(c=q.idCapture)||void 0===c?void 0:c.guideBox)||void 0===l?void 0:l.desktopPadding)&&void 0!==d?d:0),void 0===m&&0!==F&&(m=F/P),void 0===g&&(g=null!==(h=null===(p=null===(f=q.idCapture)||void 0===f?void 0:f.guideOverlay)||void 0===p?void 0:p.backgroundColor)&&void 0!==h?h:"#708090"),t.useEffect((function(){var e=_.current;if(e){if(R)return Vm(e),void setTimeout((function(){U({type:"redrawInProgress"})}),10);var t=G-2*C-2*x,n=W-2*C-2*x,r=[C+x,C+x,t,n],o=r[0],i=r[1],a=r[2],s=r[3];if(void 0!==m){var u=n*m;u<t?o+=(t-(a=u))/2:i+=(n-(s=t/m))/2}Gm(e,G,W);var c=e.getContext("2d");if(c)c.fillStyle=g,c.clearRect(0,0,G,W),c.fillRect(0,0,G,W),c.beginPath(),c.roundRect(o,i,a,s,y),c.lineWidth=x,c.strokeStyle=null!=b?b:"white",(null==b?void 0:b.startsWith("var("))&&(c.strokeStyle=getComputedStyle(document.documentElement).getPropertyValue(b.slice(4,-1))),c.stroke(),c.fillStyle="rgba(0,0,0,1)",c.globalCompositeOperation="destination-out",c.fill(),c.globalCompositeOperation="source-over",U({type:"redrawCompleted",payload:{guideRectX:o,guideRectY:i,guideRectWidth:a,guideRectHeight:s,guideRectOffsetTop:e.offsetTop}})}}),[m,b,y,x,U,g,C,R,W,G]),t.createElement(t.Fragment,null,t.createElement(yg,{ref:B,$maskColor:g,className:A.canvasWrapper},t.createElement(bg,{ref:_,className:A.canvas})),S?t.createElement(mg,{maskColor:"transparent",borderWidth:0,classNames:A,assets:{frontLandscapeGuidesImageUrl:k,backLandscapeGuidesImageUrl:D}}):t.createElement(fg,{landscapeGuidesImageUrl:w,maskColor:"transparent",borderWidth:0,isMirrored:M,instruction:T,classNames:A,imageVisible:E}))},yg=o.div(eg||(eg=v(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n flex-grow: 1;\n background-clip: padding-box;\n box-shadow: inset 0 0 0 2px ",";\n z-index: -1;\n"],["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n flex-grow: 1;\n background-clip: padding-box;\n box-shadow: inset 0 0 0 2px ",";\n z-index: -1;\n"])),(function(e){return e.$maskColor})),bg=o.canvas(tg||(tg=v(["\n display: block;\n"],["\n display: block;\n"])));function xg(e){var n,r,o=e.guideType,i=void 0===o?"fit":o,a=e.portraitGuidesOnMobile,s=void 0===a||a,u=e.requestingFlip,c=void 0!==u&&u,l=e.isBackToFront,d=void 0!==l&&l,f=e.flipIdPromptAssets,p=void 0===f?{}:f,h=e.classNames,m=void 0===h?{}:h,g=e.assets,v=void 0===g?{}:g,y=e.colors,b=void 0===y?{}:y,x=e.verbiage,C=void 0===x?{}:x,w=Af()[0],E=t.useContext(nt).cameraRef,k=rh(C,{instructionText:"Scan the front of ID",capturingText:"Capturing...",captureFailedText:"Capture failed!"}),D=window.innerWidth<window.innerHeight,M=s&&D?null==p?void 0:p.frontPortraitGuidesImageUrl:null==p?void 0:p.frontLandscapeGuidesImageUrl,T=s&&D?null==p?void 0:p.backPortraitGuidesImageUrl:null==p?void 0:p.backLandscapeGuidesImageUrl;if(d){var I=M;M=T,T=I}return t.createElement(t.Fragment,null,"overlay"===i&&t.createElement(fg,{classNames:m,width:w.pageWidth,height:w.pageHeight,instruction:w.captureFailed?k.captureFailedText:w.capturing?null==k?void 0:k.capturingText:k.instructionText,portraitGuidesImageUrl:v.portraitGuidesImageUrl,landscapeGuidesImageUrl:v.landscapeGuidesImageUrl,isMirrored:!(null===(n=E.current)||void 0===n?void 0:n.isRearFacing),borderColor:w.isGoodFrame?b.guideBoxSatisfiedColor:b.guideBoxUnsatisfiedColor,imageVisible:c||!w.idCardFrontDetectionThresholdMet||!w.documentInBounds||w.documentTooClose}),"fit"===i&&t.createElement(vg,{classNames:m,requestingFlip:c,instruction:w.captureFailed?k.captureFailedText:w.capturing?null==k?void 0:k.capturingText:k.instructionText,imageUrl:s&&D?null==v?void 0:v.portraitGuidesImageUrl:null==v?void 0:v.landscapeGuidesImageUrl,frontImageUrl:M,backImageUrl:T,isMirrored:!(null===(r=E.current)||void 0===r?void 0:r.isRearFacing),borderColor:w.isGoodFrame?b.guideBoxSatisfiedColor:b.guideBoxUnsatisfiedColor,imageVisible:c||!w.detectionThresholdMet||!w.documentInBounds||w.documentTooClose||w.backDetectedFirst||w.flipRequired}))}var Cg,wg,Eg,kg,Dg,Mg,Tg,Ig,Sg,Ng,Ag,Lg,Og,Rg=function(e){var n=e.classNames,r=void 0===n?{}:n,o=e.text,i=e.imageUrl,a=t.useRef(null),s=t.useState(!1),u=s[0],c=s[1],l=t.useState(0),d=l[0],f=l[1];return t.createElement(Ug,{className:r.container,style:{opacity:u?1:0}},o&&t.createElement(_g,{className:r.text},o),t.createElement(jg,{className:r.imageContainer,style:{aspectRatio:d}},t.createElement("img",{ref:a,src:i,alt:"",className:r.image,onLoad:function(){f(a.current.naturalWidth/a.current.naturalHeight),c(!0)},onError:function(){Fe("failed to load image from url",i)}})))},Fg=function(e){var n=e.classNames,r=void 0===n?{}:n,o=e.text,i=e.imageUrl,a=t.useRef(null),s=t.useState(!1),u=s[0],c=s[1],l=t.useState(0),d=l[1];return t.createElement(Ug,{className:r.container,style:{aspectRatio:l[0],opacity:u?1:0}},t.createElement(_g,{className:r.text},t.createElement(Pg,{className:r.spinner,$size:24,$color:"white",$thickness:3}),o),t.createElement(jg,{className:r.imageContainer},t.createElement("img",{ref:a,src:i,alt:"",className:r.image,onLoad:function(){d(a.current.naturalWidth/a.current.naturalHeight),c(!0)},onError:function(){Fe("failed to load image from url",i)}})))},Pg=o(Ee)(Cg||(Cg=v(["\n position: relative;\n top: 4px;\n left: -3px;\n margin: 0 3px 0 -12px;\n"],["\n position: relative;\n top: 4px;\n left: -3px;\n margin: 0 3px 0 -12px;\n"]))),Ug=o.div(wg||(wg=v(["\n position: absolute;\n display: flex;\n flex-direction: column;\n height: 33%;\n bottom: 12px;\n right: 12px;\n"],["\n position: absolute;\n display: flex;\n flex-direction: column;\n height: 33%;\n bottom: 12px;\n right: 12px;\n"]))),_g=o.div(Eg||(Eg=v(["\n display: block;\n position: absolute;\n top: -32px;\n font:\n 14px -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n Helvetica,\n Arial,\n sans-serif,\n 'Apple Color Emoji',\n 'Segoe UI Emoji',\n 'Segoe UI Symbol';\n color: white;\n text-align: center;\n margin: 0 auto;\n width: 100%;\n"],["\n display: block;\n position: absolute;\n top: -32px;\n font:\n 14px -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n Helvetica,\n Arial,\n sans-serif,\n 'Apple Color Emoji',\n 'Segoe UI Emoji',\n 'Segoe UI Symbol';\n color: white;\n text-align: center;\n margin: 0 auto;\n width: 100%;\n"]))),jg=o.div(kg||(kg=v(["\n position: relative;\n height: calc(100% - 8px);\n padding: 4px;\n border-radius: 4px;\n background: white;\n\n & > img {\n border-radius: 4px;\n width: auto;\n max-height: 100%;\n }\n"],["\n position: relative;\n height: calc(100% - 8px);\n padding: 4px;\n border-radius: 4px;\n background: white;\n\n & > img {\n border-radius: 4px;\n width: auto;\n max-height: 100%;\n }\n"]))),Bg={documents:[],currentDocumentIndex:0,initialDrawComplete:!1,redrawing:!1,capturing:!1,rectX:0,rectY:0,rectWidth:0,rectHeight:0,rectOffsetTop:0,uploadCapturedDocument:function(){return Promise.resolve()}},zg=t.createContext(Bg),Gg=t.createContext((function(){})),Vg=function(e,t){var n,r,o,i,a;switch(t.type){case"setDocuments":return f(f({},e),{documents:t.payload,currentDocumentIndex:0});case"setHooks":return f(f({},e),t.payload);case"redrawRequested":return f(f({},e),{redrawing:!0,rectX:0,rectY:0,rectWidth:0,rectHeight:0,rectOffsetTop:0});case"redrawInProgress":return f(f({},e),{redrawing:!1,rectX:0,rectY:0,rectWidth:0,rectHeight:0,rectOffsetTop:0});case"redrawCompleted":return f(f(f({},e),t.payload),{initialDrawComplete:!0});case"captureRequested":return f(f({},e),{capturing:!0});case"captureCompleted":return(s=f(f({},e),{capturing:!1})).documents[u=e.currentDocumentIndex].content=t.payload.content,s.documents[u].contentUrl=t.payload.contentUrl,null===(n=e.onDocumentCaptured)||void 0===n||n.call(e,s.documents[u]),s;case"retryCapture":return(s=f({},e)).documents[u=e.currentDocumentIndex].content=void 0,s.documents[u].contentUrl=void 0,s;case"uploadStarted":return(s=f({},e)).documents[u=e.currentDocumentIndex].uploadState="in_progress",s;case"uploadCompleted":return(s=f({},e)).documents[u=e.currentDocumentIndex].documentId=t.payload.documentId,s.documents[u].uploadState="succeeded",null===(o=(r=s.documents[u]).onUploaded)||void 0===o||o.call(r,s.documents[u]),null===(i=e.onDocumentUploaded)||void 0===i||i.call(e,s.documents[u]),e.documents.length-1>u?s.currentDocumentIndex+=1:null===(a=e.onAllDocumentsUploaded)||void 0===a||a.call(e,s.documents),s;case"uploadFailed":var s,u;return(s=f({},e)).documents[u=e.currentDocumentIndex].uploadState="failed",s;default:return e}},Wg=function(e){var n=e.documents,r=void 0===n?[]:n,o=e.aspectRatio,i=e.cameraFeedMode,a=e.instructions,s=e.onDocumentCaptured,u=e.onDocumentUploaded,c=e.onAllDocumentsUploaded,l=e.children,d=t.useReducer(Vg,Bg),p=d[0],g=d[1],v=t.useContext(nt),y=v.cameraRef,b=v.videoRef,x=t.useContext(_e).uploadDocument,C=t.useCallback((function(e,t){return h(void 0,void 0,void 0,(function(){var n;return m(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),g({type:"uploadStarted"}),[4,x(e,{filetype:t})];case 1:return n=r.sent(),setTimeout((function(){g({type:"uploadCompleted",payload:{documentId:n}})}),0),[3,3];case 2:return r.sent(),g({type:"uploadFailed"}),[3,3];case 3:return[2]}}))}))}),[x]);t.useEffect((function(){var e=(null==r?void 0:r.length)?r.map((function(e){return f(f({title:"Document Capture",aspectRatio:o,cameraFeedMode:"snapToGuides",instructions:a},e),{uploadState:"not_started"})})):[{title:"Document Capture",aspectRatio:o,cameraFeedMode:null!=i?i:"snapToGuides",instructions:a,uploadState:"not_started"}];g({type:"setDocuments",payload:e}),e.forEach((function(e){e.content&&(e.contentUrl||(e.contentUrl=URL.createObjectURL(e.content)),C(e.content,e.content.type))}))}),[o,i,r,a,C]),t.useEffect((function(){g({type:"setHooks",payload:{onDocumentCaptured:s,onDocumentUploaded:u,onAllDocumentsUploaded:c}})}),[s,c,u]);var w=wf((function(){g({type:"redrawRequested"})}),500);t.useLayoutEffect((function(){if("undefined"!=typeof window)return window.addEventListener("resize",w),function(){window.removeEventListener("resize",w)}}),[w]);var E=b.current;t.useEffect((function(){if(p.capturing&&y.current)if("undefined"!=typeof ImageCapture){var e=y.current.stream.getTracks().find((function(e){return"video"===e.kind}));if(!e)throw new Error("Failed to find a video feed for taking a photo");new ImageCapture(e).takePhoto().then(n).catch((function(){}))}else if(E){var t=document.createElement("canvas");We(t,E),t.toBlob(n)}function n(e){if(e){var t=URL.createObjectURL(e);g({type:"captureCompleted",payload:{content:e,contentUrl:t}})}}}),[y,p.capturing,E]);var k=t.useMemo((function(){return f(f({},p),{uploadCapturedDocument:C})}),[p,C]);return t.createElement(zg.Provider,{value:k},t.createElement(Gg.Provider,{value:g},l))},qg=function(){var e=t.useContext(zg),n=t.useContext(Gg);if(!e||!n)throw new Error("useDocumentCaptureState cannot be used without DocumentCaptureStateProvider");return[e,n]},Hg=function(e){var n,r,i,a,s,u,c,l,d,f=e.aspectRatio,p=e.borderRadius,h=void 0===p?25:p,m=e.borderColor,g=e.borderWidth,v=e.maskColor,y=e.padding,b=e.classNames,x=void 0===b?{}:b,C=ze(),w=C.ref,E=C.width,k=void 0===E?1:E,D=C.height,M=void 0===D?1:D,T=qg(),I=T[0].redrawing,S=T[1],N=t.useRef(null),A=o.useTheme();return void 0===g&&(g=null!==(i=null===(r=null===(n=A.documentCapture)||void 0===n?void 0:n.guideBox)||void 0===r?void 0:r.borderWidth)&&void 0!==i?i:4),void 0===y&&(y=gf()?null!==(u=null===(s=null===(a=A.documentCapture)||void 0===a?void 0:a.guideBox)||void 0===s?void 0:s.mobilePadding)&&void 0!==u?u:0:null!==(d=null===(l=null===(c=A.documentCapture)||void 0===c?void 0:c.guideBox)||void 0===l?void 0:l.desktopPadding)&&void 0!==d?d:0),t.useEffect((function(){var e=N.current;if(e){if(I)return Vm(e),void setTimeout((function(){S({type:"redrawInProgress"})}),10);var t=k-2*y-2*g,n=M-2*y-2*g,r=[y+g,y+g,t,n],o=r[0],i=r[1],a=r[2],s=r[3];if(void 0!==f){var u=n*f;u<t?o+=(t-(a=u))/2:i+=(n-(s=t/f))/2}Gm(e,k,M);var c=e.getContext("2d");if(c)c.fillStyle=v,c.clearRect(0,0,k,M),c.fillRect(0,0,k,M),c.beginPath(),c.roundRect(o,i,a,s,h),c.lineWidth=g,c.strokeStyle=null!=m?m:"white",c.stroke(),c.fillStyle="rgba(0,0,0,1)",c.globalCompositeOperation="destination-out",c.fill(),c.globalCompositeOperation="source-over",S({type:"redrawCompleted",payload:{rectX:o,rectY:i,rectWidth:a,rectHeight:s,rectOffsetTop:e.offsetTop}})}}),[f,m,h,g,S,v,y,I,M,k]),t.createElement(Yg,{ref:w,className:x.container,$maskColor:v},t.createElement(Zg,{ref:N}))},Yg=o.div(Dg||(Dg=v(["\n flex-grow: 1;\n background-clip: padding-box;\n box-shadow: inset 0 0 0 2px ",";\n"],["\n flex-grow: 1;\n background-clip: padding-box;\n box-shadow: inset 0 0 0 2px ",";\n"])),(function(e){return e.$maskColor})),Zg=o.canvas(Mg||(Mg=v(["\n display: block;\n"],["\n display: block;\n"]))),Qg=function(e){var n,r,i,a,s,u,c,l=e.onCaptureClicked,d=e.classNames,f=void 0===d?{}:d,p=e.verbiage,g=void 0===p?{}:p,v=qg(),y=v[0],b=y.rectX,x=y.rectY,C=y.rectWidth,w=y.rectHeight,E=y.rectOffsetTop,k=y.capturing,D=y.uploadCapturedDocument,M=v[1],T=null!==(n=y.documents[y.currentDocumentIndex])&&void 0!==n?n:{},I=T.title,S=T.aspectRatio,N=T.cameraFeedMode,A=T.instructions,L=T.contentUrl,R=T.content,F=T.uploadState,P=t.useContext(nt),U=P.cameraRef,_=P.cameraReady,j=P.cameraAccessDenied,B=P.requestCameraAccess,z=t.useState(!1),G=z[1],V="not_started"===F&&!R&&!z[0]&&!(null===(i=null===(r=U.current)||void 0===r?void 0:r.stream)||void 0===i?void 0:i.active);t.useEffect((function(){V&&(G(!0),B())}),[V,B]);var W=null!==(u=null===(s=null===(a=o.useTheme().documentCapture)||void 0===a?void 0:a.guideBox)||void 0===s?void 0:s.maskColor)&&void 0!==u?u:"snapToGuides"===N?"#708090":"rgba(0, 0, 0, 0.5)",q=rh(g,{headingText:I,loadingBtnText:"Camera initializing...",retryCameraAccessBtnText:"Retry",captureBtnText:"Capture",capturingBtnText:"Capturing...",retryCaptureBtnText:"Retry capture",uploadBtnText:"Upload",uploadingBtnText:"Uploading...",retryUploadBtnText:"Retry",successBtnText:"Upload succeeded!"});function H(){return h(this,void 0,void 0,(function(){return m(this,(function(e){switch(e.label){case 0:return[4,D(R,"image/jpeg")];case 1:return e.sent(),[2]}}))}))}return t.createElement(O,{className:"flex ".concat(null!==(c=f.container)&&void 0!==c?c:"")},t.createElement(zm,{className:f.cameraFeedWrapper,$mode:null!=N?N:"snapToGuides",$x:b,$y:x+E,$w:C,$h:w},L?t.createElement(nv,{alt:"",src:L,className:f.previewImage}):t.createElement(Um,{className:f.cameraFeed})),t.createElement($g,{className:f.captureContainer},t.createElement(Xg,{$maskColor:W,className:f.headingRow},t.createElement(Kg,{className:f.heading},q.headingText)),t.createElement(Hg,{aspectRatio:S,classNames:f,maskColor:W}),t.createElement(Jg,{$maskColor:W,className:f.footerRow},A&&t.createElement(ev,{className:f.instructions},A),t.createElement(tv,{className:f.buttonsRow},j?t.createElement(le,{className:f.retryCameraAccessBtn,variant:"negative",finished:!0,onClick:B},q.retryCameraAccessBtnText):L?t.createElement(t.Fragment,null,"not_started"===F?t.createElement(t.Fragment,null,t.createElement(le,{className:f.retryCaptureBtn,finished:!0,variant:"warning",onClick:function(){M({type:"retryCapture"})}},q.retryCaptureBtnText),t.createElement(le,{className:f.uploadBtn,finished:!0,variant:"positive",onClick:H},q.uploadBtnText)):t.createElement(le,{className:f.uploadProgressBtn,finished:"in_progress"!==F,variant:"failed"===F?"negative":"positive",onClick:H,disabled:["in_progress","succeeded"].includes(null!=F?F:"")},"succeeded"===F?q.successBtnText:"failed"===F?q.retryUploadBtnText:q.uploadingBtnText)):t.createElement(le,{className:f.captureBtn,finished:_,variant:"primary",onClick:function(){M({type:"captureRequested"}),null==l||l()},disabled:!_||k},_?k?q.capturingBtnText:q.captureBtnText:q.loadingBtnText)))))},$g=o.div(Tg||(Tg=v(["\n display: flex;\n flex-direction: column;\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: var(--app-height);\n"],["\n display: flex;\n flex-direction: column;\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: var(--app-height);\n"]))),Xg=o.div(Ig||(Ig=v(["\n background: ",";\n text-align: center;\n color: white;\n"],["\n background: ",";\n text-align: center;\n color: white;\n"])),(function(e){return e.$maskColor})),Kg=o.h1(Sg||(Sg=v(["\n font-size: 22px;\n"],["\n font-size: 22px;\n"]))),Jg=o.div(Ng||(Ng=v(["\n background: ",";\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding: 0 20px 20px;\n height: auto;\n color: white;\n"],["\n background: ",";\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding: 0 20px 20px;\n height: auto;\n color: white;\n"])),(function(e){return e.$maskColor})),ev=o.div(Ag||(Ag=v(["\n max-height: ",";\n overflow-y: auto;\n"],["\n max-height: ",";\n overflow-y: auto;\n"])),(function(e){var t,n,r;return null!==(r=null===(n=null===(t=e.theme.documentCapture)||void 0===t?void 0:t.instructions)||void 0===n?void 0:n.maxHeight)&&void 0!==r?r:"8rem"})),tv=o(Dh)(Lg||(Lg=v(["\n padding-top: 20px;\n"],["\n padding-top: 20px;\n"]))),nv=o.img(Og||(Og=v(["\n width: 100%;\n height: 100%;\n object-fit: cover;\n"],["\n width: 100%;\n height: 100%;\n object-fit: cover;\n"]))),rv=function(e){var n=e.documents,r=e.classNames,o=e.verbiage;return t.createElement(Wg,{documents:void 0===n?[]:n,aspectRatio:e.aspectRatio,cameraFeedMode:e.cameraFeedMode,instructions:e.instructions,onDocumentCaptured:e.onDocumentCaptured,onDocumentUploaded:e.onDocumentUploaded,onAllDocumentsUploaded:e.onSuccess},t.createElement(Qg,{classNames:void 0===r?{}:r,verbiage:void 0===o?{}:o}))};function ov(){var e=t.useState(),n=e[0],r=e[1],o=t.useCallback((function(e){var t,n;r(null===(n=null===(t=e.currentTarget)||void 0===t?void 0:t.files)||void 0===n?void 0:n[0])}),[r]);return{rawFile:n,fileInputOnChange:o}}function iv(e){var n=this,r=e.maxEdgePx,o=void 0===r?2048:r,i=function(e){var n=t.useState(),r=n[0],o=n[1];return t.useEffect((function(){if(e){var t=!1,n=new FileReader;return n.onload=function(){return!t&&o(n.result)},n.readAsDataURL(e),function(){t=!0}}}),[e]),{url:r}}(e.rawFile).url,a=t.useState(),s=a[0],u=a[1];return t.useEffect((function(){if(i){var e=!1,t=new Image;return t.onload=function(){return h(n,void 0,void 0,(function(){var n,r,i,a,s,c;return m(this,(function(l){if(e)return[2];if(r=(n=t.width>t.height?{width:o,height:o/t.width*t.height}:{width:o/t.height*t.width,height:o}).width,i=n.height,(a=document.createElement("canvas")).width=r,a.height=i,null==(s=a.getContext("2d")))throw new Error("Can't obtain canvas context");return s.imageSmoothingQuality="high",s.drawImage(t,0,0,t.width,t.height,0,0,r,i),c=a.toDataURL("image/jpeg",.95),e||u(c),[2]}))}))},t.src=i,function(){e=!0}}}),[o,i]),{resizedImageFile:s}}var av,sv,uv,cv,lv,dv,fv,pv,hv=function(e){var n=e.idCaptureRequirement,r=void 0===n?"idCardOrPassport":n,o=e.onCapture,i=e.onFinished,a=e.classNames,s=void 0===a?{}:a,u=e.colors,c=void 0===u?{}:u,l=e.verbiage,d=void 0===l?{}:l,f=e.silentFallback,p=void 0!==f&&f,h=t.useRef(null),m=t.useRef(null),v=t.useState([]),y=v[0],b=v[1],x=t.useState(),C=x[0],w=x[1],E=t.useState(p),k=E[0],D=E[1],M=function(e){return"idCardOrPassport"===e?2:Df(e)}(r),T=Df(r),I=ov(),S=I.fileInputOnChange,N=iv({rawFile:I.rawFile}).resizedImageFile,A=t.useState(!1),L=A[0],O=A[1],R="idCard"===r?"ID card":"passport"===r?"passport":"idCardOrPassport"===r?"ID card or passport":"ID card and passport",F="idCard"===r||"idCardAndPassport"===r?"Please capture the front of your ID card.":"passport"===r?"Please capture the ID page of your passport.":"Please capture the front of your ID card, or the ID page of your passport.",P="idCardOrPassport"===r?"Please capture the back of your ID card, or click Done if submitting a passport.":"Please capture the back of your ID card.",U=rh(d,{headingText:"We're having some trouble.",descriptionText:"On-device capture guidance failed, please capture ".concat(T>1?"photos":" a photo"," of your ").concat(R," manually."),firstInstructionText:F,secondInstructionText:P,thirdInstructionText:"Please capture the ID page of your passport.",captureBtnText:"Capture",captureMoreBtnText:"Capture ".concat(2===y.length?"ID page of passport":"back of ID card"),doneBtnText:"Done"});t.useEffect((function(){N&&N!==h.current&&(h.current=N,b((function(e){return g(g([],e,!0),[N],!1)})),null==o||o(N),w(void 0),D(!1),O(!1))}),[o,N]);var j=0===y.length?U.firstInstructionText:1===y.length?U.secondInstructionText:U.thirdInstructionText;return k&&(D(!1),w(j)),!gf()&&C||k?t.createElement(rv,{documents:[{title:C}],onDocumentCaptured:function(e){var t=e.contentUrl;null==o||o(t),setTimeout((function(){b((function(e){return g(g([],e,!0),[t],!1)})),w(void 0)}),0)}}):t.createElement(t.Fragment,null,t.createElement(_,{className:s.container},t.createElement(mv,{className:s.inner},!p&&t.createElement(t.Fragment,null,t.createElement(gv,{className:s.heading},U.headingText),t.createElement(vv,{className:s.description},U.descriptionText)),(y.length>0||L)&&t.createElement(z,{className:s.imageContainer},y.map((function(e,n){return t.createElement(bv,{key:n,className:s.imageCol},t.createElement("img",{src:e,alt:"",className:s.image}))}))),y.length<T&&t.createElement(yv,{className:s.instruction},j),t.createElement("input",{ref:m,type:"file",accept:"image/*",capture:"environment",onChange:function(e){var t;(null===(t=e.target.files)||void 0===t?void 0:t[0])&&(w(void 0),O(!0),S(e))},hidden:!0}),t.createElement(xv,{className:s.buttonsRow},y.length<M&&t.createElement(le,{variant:y.length>0?"secondary":"positive",className:y.length>0?s.captureMoreBtn:s.captureBtn,colors:y.length>0?c.captureMoreBtn:c.captureBtn,finished:!0,onClick:function(){var e;gf()?null===(e=m.current)||void 0===e||e.click():w(j)}},y.length>0?U.captureMoreBtnText:U.captureBtnText),y.length>=T&&t.createElement(le,{variant:"positive",className:s.doneBtn,colors:c.doneBtn,finished:!0,onClick:function(){null==i||i(y)}},U.doneBtnText)))))},mv=o(j)(av||(av=v(["\n justify-content: center;\n"],["\n justify-content: center;\n"]))),gv=o.h3(sv||(sv=v(["\n margin-bottom: 8px;\n"],["\n margin-bottom: 8px;\n"]))),vv=o.p(uv||(uv=v(["\n margin-bottom: 8px;\n"],["\n margin-bottom: 8px;\n"]))),yv=o.p(cv||(cv=v(["\n font-weight: bold;\n"],["\n font-weight: bold;\n"]))),bv=o.div(lv||(lv=v(["\n display: flex;\n justify-content: center;\n flex-grow: 1;\n flex-basis: 0;\n"],["\n display: flex;\n justify-content: center;\n flex-grow: 1;\n flex-basis: 0;\n"]))),xv=o(Dh)(dv||(dv=v(["\n margin-top: 32px;\n"],["\n margin-top: 32px;\n"]))),Cv=function(e){var n,r,i,a,s,u,c,l,d,f,p,g,v,y,x,C,k=e.onSuccess,D=e.onExitCapture,M=e.onUserCancel,T=e.loadingOverlayMode,I=void 0===T?"default":T,S=e.precapturedDocuments,N=e.captureRequirement,A=void 0===N?"idCardOrPassport":N,L=e.separateIdCardCaptureSequence,R=void 0!==L&&L,F=e.thresholds,P=void 0===F?yf:F,U=e.skipSuccessScreen,_=void 0!==U&&U,j=e.instructions,B=e.releaseCameraAccessOnExit,z=void 0===B||B,G=e.guideType,V=void 0===G?"fit":G,W=e.portraitGuidesOnMobile,q=void 0===W||W,H=e.rotateLoadingOverlayImageWhenPortrait,Y=void 0===H||H,Z=e.silentFallback,Q=void 0!==Z&&Z,$=e.forceFallbackMode,X=void 0!==$&&$,K=e.allowIdCardBackToFrontCapture,J=void 0!==K&&K,ee=e.assets,te=void 0===ee?{}:ee,ne=e.classNames,re=void 0===ne?{}:ne,oe=e.colors,ie=void 0===oe?{}:oe,ae=e.verbiage,se=void 0===ae?{}:ae,ue=e.debugMode,ce=void 0!==ue&&ue,le=Af(),de=le[0],fe=le[1],pe=t.useContext(nt),he=pe.cameraAccessDenied,me=pe.requestCameraAccess,ge=pe.releaseCameraAccess,ve=t.useState(!1),ye=ve[0],be=ve[1],xe=t.useContext(_e),Ce=xe.submissionStatus,we=xe.setIdFrontImage,Ee=xe.setIdBackImage,ke=xe.setPassportImage,De=xe.logIdFrontCaptureAttempt,Me=xe.logIdBackCaptureAttempt,Te=t.useContext(bf),Ie=Te.start,Se=Te.stop,Ne=Te.onPredictionMade,Ae=Te.setRequiredDocumentType,Le=Te.modelError,Oe=Te.resetBestFrame;t.useEffect((function(){fe({type:"configureWizard",payload:{captureRequirement:A,precapturedDocuments:S,allowIdCardBackToFrontCapture:J}})}),[J,A,fe,S]);var Re=Object.keys(de.capturedDocuments).length;t.useEffect((function(){Re&&Oe()}),[Re,Oe]);var Fe=t.useCallback((function(e){var t;e.operationTime=(new Date).getTime()-(null!==(t=de.operationStartedAt)&&void 0!==t?t:new Date).getTime(),"idCardBack"===de.requestedDocumentType?Me(e):De(e)}),[Me,De,de.operationStartedAt,de.requestedDocumentType]);t.useEffect((function(){ye&&"capturing"===de.captureState&&(fe({type:"captureStarted"}),Ie())}),[fe,ye,Ie,de.captureState]),t.useEffect((function(){Ne((function(e){"capturing"===de.captureState?fe({type:"objectsDetected",payload:{prediction:e}}):"requestingFlip"===de.captureState&&"selfie"!==de.requestedDocumentType&&e["".concat(de.requestedDocumentType,"DetectionThresholdMet")]&&(Oe(),fe({type:"flipRequestCompleted"}))}))}),[fe,Ne,Oe,de.captureState,de.requestedDocumentType]),t.useEffect((function(){"complete"===de.captureState&&Se()}),[de.captureState,Se]);var Pe=t.useCallback((function(e,t,n,r,o){Fe(o),fe({type:"documentCaptured",payload:{imageData:e,width:t,height:n,documentType:r,boundingBox:o.boundingBox,detectionScore:o.bestDetectionScore,focusScore:o.bestFocusScore}})}),[fe,Fe]),Ue=t.useCallback((function(){var e=de.capturedDocuments,t=e.idCardFront,n=e.idCardBack,r=e.passport,o=t&&E(t.imageData),i=n&&E(n.imageData),a=r&&E(r.imageData);o&&we(o),i&&Ee(i),a&&ke(a),z&&ge(),setTimeout((function(){null==k||k({idFrontImage:o,idBackImage:i,passportImage:a})}),0)}),[k,ge,z,Ee,we,ke,de.capturedDocuments]),je=jm(_,"complete"===de.captureState,Ue),Be=t.useCallback((function(){fe({type:"resetWizard"})}),[fe]),ze=t.useState(0),Ge=ze[0],Ve=ze[1],We=t.useCallback((function(){ge(),be(!1),Ve((function(e){return e+1})),fe({type:"resetWizard"}),null==D||D(),me()}),[fe,D,ge,me]);t.useEffect((function(){Ce!==b.READY&&z&&ge()}),[ge,z,Ce]),t.useEffect((function(){he&&(be(!1),Ve((function(e){return e+1})))}),[he]),te.idCardFront||(te.idCardFront={}),(c=te.idCardFront).portraitGuidesImageUrl||(c.portraitGuidesImageUrl="".concat(mh,"/Shieldout-IDCard-Front-SVG-Portrait-2.svg")),(l=te.idCardFront).landscapeGuidesImageUrl||(l.landscapeGuidesImageUrl="".concat(mh,"/Shieldout-IDCard-Front-SVG-Landscape-2.svg")),te.idCardBack||(te.idCardBack={}),(d=te.idCardBack).portraitGuidesImageUrl||(d.portraitGuidesImageUrl="".concat(mh,"/Shieldout-IDCard-Back-SVG-Portrait-2.svg")),(f=te.idCardBack).landscapeGuidesImageUrl||(f.landscapeGuidesImageUrl="".concat(mh,"/Shieldout-IDCard-Back-SVG-Landscape-2.svg")),te.passport||(te.passport={}),(p=te.passport).portraitGuidesImageUrl||(p.portraitGuidesImageUrl="".concat(mh,"/Shieldout-Passport-Front-SVG-Portrait-2.svg")),(g=te.passport).landscapeGuidesImageUrl||(g.landscapeGuidesImageUrl="".concat(mh,"/Shieldout-Passport-Front-SVG-Landscape-2.svg")),te.flipIdPrompt||(te.flipIdPrompt={}),(v=te.flipIdPrompt).frontPortraitGuidesImageUrl||(v.frontPortraitGuidesImageUrl=te.idCardFront.portraitGuidesImageUrl),(y=te.flipIdPrompt).frontLandscapeGuidesImageUrl||(y.frontLandscapeGuidesImageUrl=te.idCardFront.landscapeGuidesImageUrl),(x=te.flipIdPrompt).backPortraitGuidesImageUrl||(x.backPortraitGuidesImageUrl=te.idCardBack.portraitGuidesImageUrl),(C=te.flipIdPrompt).backLandscapeGuidesImageUrl||(C.backLandscapeGuidesImageUrl=te.idCardBack.landscapeGuidesImageUrl);var qe={idCardFront:rh(se.idCardFront,{instructionText:"Scan the front of ID",processingIdCardText:"ID card ".concat("idCardFront"in de.capturedDocuments?"front":"back"," captured.")}),idCardBack:rh(se.idCardBack,{instructionText:"Scan the back of ID"}),passport:rh(se.passport,{instructionText:"Scan the ID page of passport"})},He=o.useTheme(),Ye=Af()[0],Ze=Ye.guideRectX,Qe=Ye.guideRectY,$e=Ye.guideRectWidth,Xe=Ye.guideRectHeight,Ke=Ye.imageUrl,Je=te[de.requestedDocumentType],et=qe[de.requestedDocumentType];t.useEffect((function(){if(!R&&"requestingFlip"===de.captureState){var e=setTimeout((function(){Oe(),fe({type:"flipRequestCompleted"})}),6e3);return function(){clearTimeout(e)}}}),[fe,Oe,R,de.captureState]),t.useEffect((function(){return"idCardFront"===de.requestedDocumentType&&Ae("idCardOrPassport"===A?["idCardFront","passport"]:"idCardFront"),"idCardBack"===de.requestedDocumentType&&Ae("idCardBack"),"passport"===de.requestedDocumentType&&Ae("passport"),function(){Ae("none")}}),[A,Ae,de.requestedDocumentType]);var tt=t.useCallback((function(e){return h(void 0,void 0,void 0,(function(){var t;return m(this,(function(n){switch(n.label){case 0:return[4,w(e)];case 1:return t=n.sent(),fe({type:"documentCapturedManually",payload:{imageData:t}}),[2]}}))}))}),[fe]);return X||Le?t.createElement(hv,{idCaptureRequirement:A,onFinished:Ue,onCapture:tt,classNames:re.fallback,colors:ie.fallback,verbiage:se.fallback,silentFallback:Q}):t.createElement(O,{className:"flex ".concat(null!==(n=null==re?void 0:re.container)&&void 0!==n?n:"")},"complete"!==de.captureState&&t.createElement(zm,{$x:Ze,$y:Qe,$w:$e,$h:Xe,$mode:"fit"===V?"snapToGuides":"fullscreen"},t.createElement(Um,{className:null==re?void 0:re.cameraFeed})),ye&&"capturing"===de.captureState&&t.createElement(gh,{requiredDocumentType:de.requestedDocumentType,thresholds:P,onCapture:Pe,assets:Je,classNames:null==re?void 0:re.capture,colors:ie,verbiage:et,debugMode:ce}),t.createElement(xg,{guideType:V,portraitGuidesOnMobile:q,requestingFlip:"requestingFlip"===de.captureState,flipIdPromptAssets:null==te?void 0:te.flipIdPrompt,classNames:re,assets:Je,colors:ie,verbiage:et,isBackToFront:de.allowIdCardBackToFrontCapture&&"idCardBack"in de.capturedDocuments}),!(null===(i=null===(r=He.idCapture)||void 0===r?void 0:r.capturePreview)||void 0===i?void 0:i.disabled)&&"requestingFlip"===de.captureState&&!R&&Ke&&t.createElement(Rg,{classNames:null===(a=re.capture)||void 0===a?void 0:a.imagePreview,text:null===(s=null==qe?void 0:qe.idCardFront)||void 0===s?void 0:s.processingIdCardText,imageUrl:Ke}),"complete"!==de.captureState&&t.createElement("div",{id:"idmission-above-guides-content"}),t.createElement(kh,{onClick:We,className:null===(u=re.capture)||void 0===u?void 0:u.exitCaptureBtn}),!ye&&t.createElement(Mm,{key:Ge,mode:I,instructions:j,assets:te.loadingOverlay,classNames:re.loadingOverlay,colors:ie.loadingOverlay,verbiage:se.loadingOverlay,onUserCancel:M,onDismissed:function(){be(!0)},rotateImage:Y&&q&&window.innerWidth<window.innerHeight}),"requestingFlip"===de.captureState&&R&&t.createElement(Sm,{capturedDocuments:de.capturedDocuments,classNames:re.success,onSubmitClick:function(){fe({type:"flipRequestCompleted"})},onRetryClick:Be,colors:ie.success,verbiage:se.success}),"complete"===de.captureState&&je&&t.createElement(Sm,{capturedDocuments:de.capturedDocuments,classNames:re.success,onSubmitClick:Ue,onRetryClick:Be,colors:ie.success,verbiage:se.success,debugMode:ce}))},wv=o.div(fv||(fv=v(["\n position: absolute;\n z-index: 1000;\n width: 100%;\n height: 100%;\n display: flex;\n"],["\n position: absolute;\n z-index: 1000;\n width: 100%;\n height: 100%;\n display: flex;\n"]))),Ev=o.div(pv||(pv=v(["\n border-width: ","px;\n border-color: ",";\n border-style: solid;\n border-radius: 50%;\n aspect-ratio: 1 / 1.618;\n height: 50%;\n margin: auto;\n"],["\n border-width: ","px;\n border-color: ",";\n border-style: solid;\n border-radius: 50%;\n aspect-ratio: 1 / 1.618;\n height: 50%;\n margin: auto;\n"])),(function(e){return e.$borderWidth}),(function(e){var t,n,r,o;return null!==(o=null!==(t=e.$borderColor)&&void 0!==t?t:null===(r=null===(n=e.theme.selfieCapture)||void 0===n?void 0:n.guides)||void 0===r?void 0:r["".concat(e.$variant,"Color")])&&void 0!==o?o:"white"})),kv=function(e){var n=e.classNames,r=void 0===n?{}:n,o=e.variant,i=e.borderWidth;return t.createElement(wv,{className:r.container},t.createElement(Ev,{className:r.oval,$variant:void 0===o?"unsatisfied":o,$borderWidth:void 0===i?3:i,$borderColor:e.borderColor}))},Dv=t.createContext({start:function(){return null},stop:function(){return null},onPredictionMade:function(){return null},canvasRef:{current:null},ready:!1,error:null,modelDownloadProgress:0});function Mv(e){var n=this,r=e.autoStart,o=void 0===r||r,i=e.children,a=e.throttleMs,s=e.onModelError,c=e.modelLoadTimeoutMs,l=void 0===c?Gd:c,d=t.useContext(nt),p=d.videoRef,g=d.videoLoaded,v=d.cameraReady,y=t.useRef(null),b=t.useRef(),x=function(e){var n=e.onModelError,r=e.modelLoadTimeoutMs,o=void 0===r?Gd:r,i=t.useRef(null),a=t.useState(!1),s=a[0],u=a[1],c=t.useState(0),l=c[0],d=c[1],f=t.useState(null),p=f[0],g=f[1],v=t.useContext(nt).videoRef;return t.useEffect((function(){var e=this;u(!1);var t=setTimeout((function(){g(new Error("Model loading time limit exceeded."))}),o);function n(e){d(ef(e.detail))}return document.addEventListener("idmission.preloadProgress.faceDetection",n),Vd().then((function(n){return h(e,void 0,void 0,(function(){return m(this,(function(e){switch(e.label){case 0:return i.current=n,d(100),clearTimeout(t),[4,Rd(v)];case 1:return e.sent(),n.detectForVideo(v.current,performance.now()),u(!0),[2]}}))}))})).catch((function(e){g(e)})).finally((function(){clearTimeout(t)})),function(){clearTimeout(t),document.removeEventListener("idmission.preloadProgress.faceDetection",n)}}),[o,v]),t.useEffect((function(){p&&(null==n||n(p))}),[p,n]),{detector:i,ready:s,modelDownloadProgress:l,modelError:p}}({onModelError:s,modelLoadTimeoutMs:l}),C=x.detector,w=x.ready,E=x.modelDownloadProgress,k=x.modelError,D=df(t.useCallback((function(){return h(n,void 0,void 0,(function(){var e,t,n,r,o;return m(this,(function(i){if(!g||!v||!w||k||!p.current||!C.current||!y.current)return[2];if(e=p.current.videoWidth,t=p.current.videoHeight,n=y.current.getContext("2d"),y.current.width=e,y.current.height=t,n&&4===p.current.readyState){n.translate(e,0),n.scale(-1,1),n.drawImage(p.current,0,0,e,t);try{r=function(e,t){var n=e.detectForVideo(t,performance.now()),r=n.detections.map((function(e){return{box:Od(e.boundingBox),keypoints:e.keypoints.map((function(e){var n;return f(f({},e),{x:e.x*t.width,y:e.y*t.height,name:null!==(n=e.label)&&void 0!==n?n:""})}))}}));return f(f({},n),{faces:r})}(C.current,y.current).faces,null===(o=b.current)||void 0===o||o.call(b,r)}catch(e){Fe("caught face detection error",e)}}return[2]}))}))}),[v,C,k,w,g,p]),{throttleMs:a,autoStart:o}),M=D.start,T=D.stop,I=t.useCallback((function(e){b.current=e}),[]),S=t.useMemo((function(){return{start:M,stop:T,ready:w,canvasRef:y,onPredictionMade:I,error:k,modelDownloadProgress:E}}),[k,E,I,w,M,T]);return u.createElement(Dv.Provider,{value:S},u.createElement(Ve,{ref:y}),i)}var Tv,Iv,Sv,Nv,Av,Lv,Ov,Rv,Fv,Pv,Uv,_v,jv,Bv=function(e,n,r,o,i){void 0===i&&(i=!0);var a=t.useState(!1),s=a[0],u=a[1],c=t.useState(),l=c[0],d=c[1];return t.useEffect((function(){if(e&&i){d(new Date);var t=setTimeout((function(){u(!0)}),e);return function(){t&&clearTimeout(t)}}}),[e,i]),t.useEffect((function(){if(s&&!r){if(o){var e=setTimeout((function(){null==n||n()}),12e4);return function(){clearTimeout(e)}}null==n||n()}}),[n,o,s,r]),{timedOut:s,timeoutStartedAt:l}},zv=function(e){var n=e.onFinished,r=e.onCapture,o=e.classNames,i=void 0===o?{}:o,a=e.colors,s=void 0===a?{}:a,u=e.verbiage,c=void 0===u?{}:u,l=e.silentFallback,d=void 0!==l&&l,f=e.invalidSelfie,p=void 0!==f&&f,h=e.guidanceMessage,m=void 0===h?void 0:h,g=t.useState(null),v=g[0],y=g[1],b=t.useRef(null),x=t.useRef(null),C=t.useState(!1),w=C[0],E=C[1],k=t.useState(!1),D=k[0],M=k[1],T=ov(),I=T.fileInputOnChange,S=iv({rawFile:T.rawFile}).resizedImageFile;t.useEffect((function(){S&&S!==b.current&&(b.current=S,y(S),E(!0),null==r||r(S),null==n||n(S))}),[S,r,n,w]);var N=rh(c,{headingText:"We're having some trouble.",descriptionText:d?"Use your device camera to capture your face":"On-device capture guidance failed, please capture a selfie manually.",captureBtnText:"Capture",doneBtnText:"Done",doneBtnLoadingText:"Verifying...",livenessFailedText:"Live face not detected, please try again",livenessFailedReasonText:m,retryButtonText:"Retry",retryCaptureButtonText:"Retry capture"});return t.useEffect((function(){var e;return d&&(e=setTimeout((function(){var e;gf()?null===(e=x.current)||void 0===e||e.click():M(!0)}),250)),function(){clearTimeout(e)}}),[d]),D||d&&p&&!v&&!gf()?t.createElement(rv,{documents:[{title:p?N.livenessFailedText:N.descriptionText}],onDocumentCaptured:function(e){var t=e.contentUrl;null==r||r(t),setTimeout((function(){y(t),M(!1)}),0)}}):t.createElement(t.Fragment,null,t.createElement("input",{ref:x,type:"file",accept:"image/*",capture:"user",onChange:function(e){var t;(null===(t=e.target.files)||void 0===t?void 0:t[0])&&(y("LOADING"),I(e))},hidden:!0}),t.createElement(_,{className:i.container},t.createElement(Gv,{className:i.inner},d?p&&t.createElement(t.Fragment,null,t.createElement(Vv,{className:i.heading},N.livenessFailedText),t.createElement(Wv,{className:i.description},N.livenessFailedReasonText||N.descriptionText)):t.createElement(t.Fragment,null,t.createElement(Vv,{className:i.heading},p?N.livenessFailedText:N.headingText),t.createElement(Wv,{className:i.description},N.livenessFailedReasonText||N.descriptionText)),v&&"LOADING"!==v&&t.createElement(qv,{className:i.imageContainer},t.createElement("img",{src:v,alt:"",className:i.image})),t.createElement(Hv,{className:i.buttonsRow},v&&!w&&!gf()&&t.createElement(le,{className:i.retryCaptureBtn,finished:!0,variant:"warning",onClick:function(){var e;gf()?null===(e=x.current)||void 0===e||e.click():M(!0)}},N.retryCaptureButtonText),t.createElement(le,{variant:"positive",key:w?"loading-btn":"ready-btn",className:v?null==i?void 0:i.doneBtn:i.captureBtn,colors:v?null==s?void 0:s.doneBtn:s.captureBtn,finished:!v||!w,onClick:function(){var e;gf()?null===(e=x.current)||void 0===e||e.click():v?(E(!0),null==n||n(v)):M(!0)}},v?w?N.doneBtnLoadingText:N.doneBtnText:p?N.retryButtonText:N.captureBtnText)))))},Gv=o(j)(Tv||(Tv=v(["\n justify-content: center;\n"],["\n justify-content: center;\n"]))),Vv=o.h3(Iv||(Iv=v(["\n margin-bottom: 8px;\n"],["\n margin-bottom: 8px;\n"]))),Wv=o.p(Sv||(Sv=v(["\n margin-bottom: 8px;\n"],["\n margin-bottom: 8px;\n"]))),qv=o(B)(Nv||(Nv=v(["\n margin-top: 32px;\n"],["\n margin-top: 32px;\n"]))),Hv=o(Dh)(Av||(Av=v(["\n margin-top: 32px;\n"],["\n margin-top: 32px;\n"]))),Yv={videoWidth:0,videoHeight:0,frame:null,faces:[],faceNotCentered:!1,faceLookingAway:!1,faceTooClose:!1,faceTooFar:!1,faceReady:!1,faceReadyAt:null},Zv=function(e,t){switch(t.type){case"configure":return f(f({},e),t.payload);case"facesDetected":var n=t.payload.faces,r=n[0],o=!0,i=!1,a=!1,s=!1,u=e.faceReadyAt;if(r){var c=e.videoHeight/2,l=(r.box.xMin+r.box.xMax)/2,d=(r.box.yMin+r.box.yMax)/2,p=.125*e.videoWidth,h=.125*e.videoHeight,m=.2*r.box.width,g=.2*r.box.height,v=r.keypoints[2];v&&(o=Math.abs(e.videoWidth/2-l)>p||Math.abs(c+50-d)>h,i=Math.abs(l-v.x)>m||Math.abs(d-v.y)>g);var y=e.videoWidth<e.videoHeight;a=r.box.width>e.videoWidth/(y?2:4.5),s=r.box.width<e.videoWidth/(y?6:7)}var b=!(o||i||a||s);return b?e.faceReady||(u=new Date):u=null,f(f({},e),{faces:n,faceNotCentered:o,faceLookingAway:i,faceTooClose:a,faceTooFar:s,faceReady:b,faceReadyAt:u})}},Qv=function(e){var n,r=e.onGuidanceSatisfied,o=e.onGuidanceNotSatisfied,i=e.onSelfieCaptured,a=e.onTimeout,s=e.onExit,u=e.timeoutDurationMs,c=void 0===u?15e3:u,l=e.guidanceMessage,d=e.guidanceSatisfied,f=e.classNames,p=void 0===f?{}:f,h=e.colors,m=void 0===h?{}:h,g=e.verbiage,v=void 0===g?{}:g,y=e.debugMode,b=void 0!==y&&y,x=ze(),C=x.ref,w=x.width,E=void 0===w?1:w,k=x.height,D=void 0===k?1:k,M=t.useReducer(Zv,Yv),T=M[0],I=M[1],S=t.useRef(null),N=t.useContext(nt),A=N.cameraRef,L=N.cameraReady,R=N.videoRef,F=t.useContext(Dv),P=F.onPredictionMade,U=F.error;t.useEffect((function(){L&&R.current&&0!==R.current.videoWidth&&I({type:"configure",payload:{videoWidth:R.current.videoWidth,videoHeight:R.current.videoHeight}})}),[L,R]),P(function(e,t){var n={},r=n.leading,o=n.trailing;return wf(e,t,{maxWait:t,leading:void 0===r||r,trailing:void 0===o||o})}((function(e){I({type:"facesDetected",payload:{faces:e}})}),16));var _=t.useState(!1),j=_[0],B=_[1];t.useEffect((function(){var e;return T.faceReady?(null==r||r(),e=setTimeout((function(){B(!0)}),1e3)):null==o||o(),function(){e&&clearTimeout(e)}}),[o,r,T.faceReady]),t.useEffect((function(){if(j&&R.current&&S.current&&T.faces.length>0){We(S.current,R.current);var e=S.current.getContext("2d");if(!e)return;var t=e.getImageData(0,0,R.current.videoWidth,R.current.videoHeight);null==i||i(t,T.faces[0]),qe(S.current)}}),[j,i,T.faces,R]);var z=Bv(c,a),G=z.timedOut,V=z.timeoutStartedAt,W=Uf({enabled:b,pageWidth:E,pageHeight:D,videoWidth:T.videoWidth,videoHeight:T.videoHeight});m.guidesUnsatisfiedColor||(m.guidesUnsatisfiedColor="white"),m.guidesSatisfiedColor||(m.guidesSatisfiedColor="green");var q=rh(v,{guidanceHoldStillText:"Hold still for a few seconds...",guidanceLookStraightText:"Look straight into the camera...",guidanceMoveBackText:"Move back...",guidanceMoveForwardText:"Move forward...",guidanceMoveToCenterText:"Move to the center..."}),H=T.faceReady;return"boolean"==typeof d&&(H=d),l||(l=H?q.guidanceHoldStillText:T.faceLookingAway?q.guidanceLookStraightText:T.faceTooClose?q.guidanceMoveBackText:T.faceTooFar?q.guidanceMoveForwardText:T.faceNotCentered?q.guidanceMoveToCenterText:""),U?t.createElement(zv,{classNames:p.fallback}):t.createElement(O,{ref:C,className:"flex ".concat(null!==(n=p.container)&&void 0!==n?n:"")},t.createElement(Ve,{ref:S}),t.createElement(kv,{classNames:p.guides,variant:H?"satisfied":"unsatisfied"}),""!==l&&t.createElement(ph,{className:p.guidanceMessageContainer},t.createElement(hh,{$variant:H?"positive":"negative",className:p.guidanceMessage},l)),b&&T.faces.length>0&&t.createElement(Rf,null,T.faces.map((function(e,n){return t.createElement(Wf,{key:n,face:e,scaling:W,color:H?"green":"red"})}))),b&&t.createElement(Lf,null,A.current?t.createElement(t.Fragment,null,"✅ Camera: ",A.current.label," (",A.current.width,"x",A.current.height,")"):"❌ Camera not ready",t.createElement("br",null),T.faceNotCentered?"❌":"✅"," Face Centered",t.createElement("br",null),T.faceTooClose||T.faceTooFar?"❌":"✅"," Face"," ",T.faceTooClose?"Too Close":T.faceTooFar?"Too Far":"Distance Correct",t.createElement("br",null),T.faceLookingAway?"❌":"✅"," Face Looking Forward",t.createElement("br",null),G?"❌":"✅"," Time Remaining:"," ",Math.max(0,c-((new Date).getTime()-(null!=V?V:new Date).getTime())),"ms"),t.createElement(kh,{onClick:s,className:p.exitCaptureBtn}))},$v={frame:null,face:null,requestState:"CAPTURING",requestError:null,imageUrl:null,faceLive:!1,eyeCoveringDetected:!1,maskDetected:!1,headCoveringDetected:!1,phoneDetected:!1,timesLivenessCheckFailed:0},Xv=function(e,t){var n,r;switch(t.type){case"livenessReady":return["CAPTURING","FAILED","ERROR"].includes(e.requestState)?f(f({},e),{requestState:"CAPTURED",frame:t.payload.frame,face:t.payload.face}):e;case"livenessChecking":return f(f({},e),{requestState:"IN_PROGRESS"});case"livenessChecked":var o=t.payload.response,i=o.status,a=i.statusMessage,s=i.errorData,u=o.resultData;if("000"!==i.statusCode)return f(f({},e),{requestState:"ERROR",requestError:new Error("".concat(a,": ").concat(s))});var c=["Live Face Detected","Approved"].includes(u.verificationResult),l="true"===u.eyeCovering,d="true"===u.faceMask,p="true"===u.headCovering,h="true"===u.cellPhone,m=c&&!l&&!d&&!p,g=m?"PASSED":"FAILED",v=e.timesLivenessCheckFailed;return m?v=0:v+=1,f(f({},e),{frame:null!==(n=t.payload.frame)&&void 0!==n?n:null,face:null!==(r=t.payload.face)&&void 0!==r?r:null,imageUrl:t.payload.imageUrl,requestState:g,faceLive:c,eyeCoveringDetected:l,maskDetected:d,headCoveringDetected:p,phoneDetected:h,timesLivenessCheckFailed:v});case"livenessCheckFailed":return f(f({},e),{requestState:"ERROR",requestError:t.payload.error});default:return e}},Kv=function(e){var n,r,i,a=e.onCapture,s=e.onSuccess,u=e.onTimeout,c=e.onExit,l=e.timeoutDurationMs,d=void 0===l?15e3:l,f=e.silentFallback,p=void 0!==f&&f,g=e.classNames,v=void 0===g?{}:g,y=e.colors,b=void 0===y?{}:y,x=e.verbiage,C=void 0===x?{}:x,E=e.debugMode,k=t.useContext(_e),D=k.checkLiveness,M=k.submissionError,T=t.useContext(Dv).error,I=t.useReducer(Xv,$v),S=I[0],N=I[1],A=t.useState(null),L=A[0],O=A[1],R=t.useRef(null),F=t.useRef(null),P=t.useRef(null),U=o.useTheme(),_=t.useCallback((function(e,t){null==a||a(),N({type:"livenessReady",payload:{frame:e,face:t}})}),[a]),j=S.frame,B=S.face,z="CAPTURED"===S.requestState,G="PASSED"===S.requestState;t.useEffect((function(){var e=this;j&&B&&z&&!M&&(N({type:"livenessChecking"}),h(e,void 0,void 0,(function(){var e,t,n,r;return m(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),e=kd(R.current,F.current,P.current,j,B,.92,600),O(e),n=D,[4,w(e)];case 1:return[4,n.apply(void 0,[o.sent()])];case 2:return t=o.sent(),N({type:"livenessChecked",payload:{frame:j,face:B,imageUrl:e,response:t}}),[3,4];case 3:return r=o.sent(),N({type:"livenessCheckFailed",payload:{error:r}}),[3,4];case 4:return[2]}}))})))}),[D,B,j,z,M]);var V=t.useCallback((function(e){return h(void 0,void 0,void 0,(function(){var t,n,r,o;return m(this,(function(i){switch(i.label){case 0:N({type:"livenessChecking"}),i.label=1;case 1:return i.trys.push([1,4,,5]),[4,w(e)];case 2:return t=i.sent(),[4,D(t)];case 3:return n=i.sent(),"Live Face Detected"!==(null===(o=null==n?void 0:n.resultData)||void 0===o?void 0:o.verificationResult)&&(null==u||u()),N({type:"livenessChecked",payload:{imageUrl:e,response:n}}),[3,5];case 4:return r=i.sent(),N({type:"livenessCheckFailed",payload:{error:r}}),[3,5];case 5:return[2]}}))}))}),[D,u]);t.useEffect((function(){G&&S.imageUrl&&(null==s||s(S.imageUrl))}),[s,S.imageUrl,G]),t.useEffect((function(){if(!T){S.timesLivenessCheckFailed>=2&&(null==u||u())}}),[T,u,S.timesLivenessCheckFailed]),Bv(d,u,"PASSED"===S.requestState||!!T,"IN_PROGRESS"===S.requestState);var W=rh(C,{guidanceRemoveEyeCoveringsText:"Please remove your eye coverings (sunglasses, eye patch, etc.)...",guidanceRemoveHeadCoveringsText:"Please remove your head coverings (hat, scarf, etc.)...",guidanceRemoveMaskText:"Please remove your mask...",progressPreviewText:"Processing..."}),q=S.eyeCoveringDetected?W.guidanceRemoveEyeCoveringsText:S.headCoveringDetected?W.guidanceRemoveHeadCoveringsText:S.maskDetected?W.guidanceRemoveMaskText:void 0;return T?t.createElement(zv,{key:S.timesLivenessCheckFailed,onFinished:V,silentFallback:p,invalidSelfie:!!S.timesLivenessCheckFailed,guidanceMessage:q}):t.createElement(t.Fragment,null,t.createElement(Ve,{ref:R}),t.createElement(Ve,{ref:F}),t.createElement(Ve,{ref:P}),t.createElement(Qv,{onSelfieCaptured:_,onExit:c,timeoutDurationMs:d,guidanceMessage:q,guidanceSatisfied:!q&&void 0,classNames:v,colors:b,verbiage:W,debugMode:E}),!(null===(r=null===(n=U.selfieCapture)||void 0===n?void 0:n.capturePreview)||void 0===r?void 0:r.disabled)&&L&&t.createElement(Fg,{classNames:v.imagePreview,imageUrl:L,text:null!==(i=W.progressPreviewText)&&void 0!==i?i:""}))},Jv=function(e){var n=e.imageUrl,r=e.onDoneClick,o=e.onRetryClick,i=e.classNames,a=void 0===i?{}:i,s=e.colors,u=void 0===s?{}:s,c=e.verbiage,l=rh(void 0===c?{}:c,{headingText:"Face liveness has been verified!",retryBtnText:"Retry",doneBtnText:"Done"});return t.createElement(_,{className:a.container},t.createElement(j,{className:a.inner},t.createElement(ey,{className:a.heading},l.headingText),t.createElement(B,{className:a.imageContainer},t.createElement("img",{alt:l.headingText,src:n,className:a.image})),t.createElement(Dh,{className:a.buttonsRow},t.createElement(le,{variant:"warning",onClick:o,colors:u.retryBtn,className:a.retryBtn,finished:!0},l.retryBtnText),t.createElement(le,{variant:"positive",onClick:r,colors:u.doneBtn,className:a.doneBtn,finished:!0},l.doneBtnText))))},ey=o.h3(Lv||(Lv=v(["\n margin-bottom: 24px;\n"],["\n margin-bottom: 24px;\n"]))),ty=function(e){var n=e.canRetry,r=void 0===n||n,o=e.onRetryClick,i=e.onExitClick,a=e.assets,s=void 0===a?{}:a,u=e.classNames,c=void 0===u?{}:u,l=e.colors,d=void 0===l?{}:l,f=e.verbiage,p=void 0===f?{}:f;s.imageUrl||(s.imageUrl="".concat(mh,"/manual_capture.png"));var h=rh(p,{headingText:"Live face not detected, please try again",retryBtnText:"Retry",exitBtnText:"Exit"});return t.createElement(_,{className:c.container},t.createElement(j,{className:c.inner},t.createElement("h3",{className:c.heading},h.headingText),t.createElement(ny,{className:c.imageContainer},t.createElement("img",{alt:h.headingText,src:s.imageUrl,className:c.image})),t.createElement(Dh,{className:c.buttonsRow},r&&t.createElement(le,{variant:"warning",className:c.retryBtn,onClick:o,colors:d.retryBtn,finished:!0},h.retryBtnText),t.createElement(le,{variant:"secondary",className:c.exitBtn,onClick:i,colors:d.exitBtn,finished:!0},h.exitBtnText))))},ny=o(B)(Ov||(Ov=v(["\n max-height: calc(100vh - 185px);\n margin: 0 24px;\n"],["\n max-height: calc(100vh - 185px);\n margin: 0 24px;\n"]))),ry=function(e){var n,r=e.assets,o=void 0===r?{}:r,i=e.classNames,a=void 0===i?{}:i,s=e.colors,u=void 0===s?{}:s,c=e.verbiage,l=void 0===c?{}:c,d=t.useContext(nt).requestMicrophoneAccess;o.imageUrl||(o.imageUrl=mh+"/microphone-disable-icon.svg");var f=rh(l,{headingText:"Your microphone permission is disabled",descriptionText:"This application requires access to your microphone to continue. Please accept the permission once prompted by the browser. If the browser does not prompt for microphone permissions, you must go to settings and provide microphone access to the current browser.",retryBtnText:"Retry"});return t.createElement(_,{className:"flex ".concat(null!==(n=a.container)&&void 0!==n?n:"")},t.createElement(oy,{className:a.inner},t.createElement(iy,{className:a.imageContainer},t.createElement("img",{src:o.imageUrl,alt:"",className:a.image})),t.createElement("h3",{className:a.heading},f.headingText),t.createElement(ay,{className:a.description},f.descriptionText),t.createElement(sy,{variant:"warning",onClick:d,colors:u.retryBtn,className:a.retryBtn,finished:!0},f.retryBtnText)))},oy=o(j)(Rv||(Rv=v(["\n max-width: 500px;\n height: auto;\n margin: auto;\n"],["\n max-width: 500px;\n height: auto;\n margin: auto;\n"]))),iy=o(B)(Fv||(Fv=v(["\n flex-grow: 0;\n"],["\n flex-grow: 0;\n"]))),ay=o.p(Pv||(Pv=v(["\n line-height: 1.5;\n margin-bottom: 50px;\n"],["\n line-height: 1.5;\n margin-bottom: 50px;\n"]))),sy=o(le)(Uv||(Uv=v(["\n width: 200px;\n margin: 0 auto;\n"],["\n width: 200px;\n margin: 0 auto;\n"]))),uy=o(hh)(_v||(_v=v(["\n padding: 12px 24px;\n font-weight: normal;\n line-height: 1.5;\n margin-bottom: -30px;\n"],["\n padding: 12px 24px;\n font-weight: normal;\n line-height: 1.5;\n margin-bottom: -30px;\n"]))),cy=o(Dh)(jv||(jv=v(["\n flex-direction: column;\n padding-top: 25px;\n"],["\n flex-direction: column;\n padding-top: 25px;\n"])));function ly(e){var n,r,i,a=e.width,s=void 0===a?840:a,u=e.height,c=void 0===u?740:u,l=e.className,d=t.useState(1),f=d[0],p=d[1];t.useEffect((function(){var e=setInterval((function(){p((function(e){return(e+1)%10}))}),750);return function(){clearInterval(e)}}),[]);var h=null!==(i=null===(r=null===(n=o.useTheme().selfieCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.loadingGraphicAccentColor)&&void 0!==i?i:"var(--idm-color-positive-600)";return t.createElement("svg",{width:s,height:c,className:l,viewBox:"0 0 840 740",fill:"none",preserveAspectRatio:"xMidYMax slice",xmlns:"http://www.w3.org/2000/svg"},t.createElement("g",{clipPath:"url(#clip0_428_1188)"},t.createElement("mask",{id:"mask0_428_1188",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"840",height:"740"},t.createElement("rect",{width:"840",height:"740",fill:"#D9D9D9"})),t.createElement("g",{mask:"url(#mask0_428_1188)"},t.createElement("path",{d:"M503.781 449.497C491.561 503.154 458.442 541.609 419.561 541.609C380.68 541.609 347.492 503.015 335.272 449.358L344.645 412.916L347.492 402.019H491.561L502.253 443.667L503.225 447.415L503.781 449.497Z",fill:"#D2D4DA"}),t.createElement("path",{d:"M574.88 244.97C647.073 163.885 598.921 362.155 558.945 338.928C488.709 298.211 574.88 244.97 574.88 244.97Z",fill:"#F7A69C"}),t.createElement("path",{d:"M816.983 742.838C779.698 781.432 736.86 814.612 689.786 841.127C617.161 882.012 534.399 906.862 446.153 911.027C437.335 911.513 428.448 911.721 419.491 911.721C374.986 911.721 331.731 906.446 290.281 896.519C232.514 882.706 178.358 859.8 129.271 829.397C89.9033 805.033 53.9382 775.948 22 742.838L31.512 705.355C45.8842 649.061 90.2505 605.33 146.837 591.795L153.085 590.337L222.447 573.747L241.401 569.235C249.386 567.292 257.023 564.585 264.244 561.114C270.285 558.199 276.047 554.797 281.463 550.91C287.295 546.745 292.78 542.025 297.71 536.819C310.971 522.867 320.761 505.653 325.76 486.286L333.119 457.688L335.064 449.983L335.202 449.358L344.645 412.916L347.422 402.019H491.491L502.253 443.667L503.225 447.415L503.78 449.497V449.983L505.863 457.757L513.223 486.286C520.097 512.802 535.996 535.5 557.589 550.91C569.393 559.448 582.932 565.765 597.581 569.235L615.078 573.4L692.146 591.795C748.732 605.33 793.099 649.061 807.471 705.355L816.983 742.838Z",fill:"#F7A69C"}),t.createElement("path",{d:"M503.781 449.497C491.561 503.154 458.442 541.609 419.561 541.609C380.68 541.609 347.492 503.015 335.272 449.358L344.645 412.916L347.492 402.019H491.561L502.253 443.667L503.225 447.415L503.781 449.497Z",fill:"#DC968D"}),t.createElement("path",{d:"M264.123 244.97C191.93 163.885 240.082 362.155 280.058 338.928C350.294 298.211 264.123 244.97 264.123 244.97Z",fill:"#F7A69C"}),t.createElement("path",{d:"M586.473 187.324C586.473 193.432 586.126 199.402 585.432 205.371C584.876 210.785 582.446 233.9 578.141 263.331C575.781 279.713 572.726 297.969 569.115 316.294C569.115 316.502 569.115 316.78 568.976 316.988C560.159 361.621 547.731 406.045 531.484 422.219C513.154 440.544 498.435 457.203 481.632 469.211C464.83 481.289 446.014 488.786 419.631 488.786C393.247 488.786 374.431 481.289 357.629 469.211C340.896 457.203 326.107 440.544 307.778 422.219C291.531 405.976 279.103 361.482 270.216 316.918C270.216 316.918 270.216 316.71 270.216 316.641C269.105 310.879 268.063 305.118 267.022 299.426C266.605 297.066 266.189 294.706 265.772 292.346C264.036 282.351 262.509 272.563 261.12 263.401C256.121 229.596 253.691 204.122 253.691 204.122C253.136 198.638 252.858 193.016 252.858 187.324C252.858 185.866 252.858 184.408 252.858 182.951C253.205 169.832 255.01 157.06 258.274 144.843C258.412 144.287 258.551 143.732 258.69 143.177C277.228 75.4294 337.425 24.8271 410.049 20.8011C413.243 20.5928 416.368 20.5234 419.631 20.5234C465.733 20.5234 507.461 39.1956 537.663 69.3904C563.769 95.4205 581.266 130.127 585.501 168.79C586.195 174.899 586.542 181.077 586.542 187.324H586.473Z",fill:"#FEAEA5"}),t.createElement("path",{d:"M445.867 337.327C445.867 348.849 434.133 358.151 419.622 358.151C405.111 358.151 393.447 348.849 393.447 337.327C393.447 335.939 393.586 334.55 394.002 333.301C396.293 342.88 406.916 350.099 419.622 350.099C432.328 350.099 443.02 342.88 445.312 333.301C445.728 334.62 445.867 335.939 445.867 337.327Z",fill:"#F7A69C"}),t.createElement("path",{d:"M817.053 743.187C716.586 847.238 575.642 912 419.561 912C263.481 912 122.467 847.238 22.0698 743.118L31.5818 705.704C45.954 649.34 90.3203 605.61 146.906 592.074L222.655 574.027L241.471 569.515C249.942 567.502 258.135 564.517 265.772 560.699C304.237 601.653 358.879 627.267 419.561 627.267C480.244 627.267 534.886 601.653 573.351 560.699C580.988 564.448 589.111 567.502 597.651 569.515L614.106 573.471L692.216 592.074C748.802 605.61 793.168 649.34 807.471 705.704L817.053 743.187Z",fill:"#6E7174"}),t.createElement("path",{d:"M614.106 573.471C597.165 594.018 534.886 659.058 419.561 663.639C286.671 668.984 226.266 579.441 222.655 574.027L241.471 569.515C249.942 567.502 258.134 564.517 265.772 560.699C304.236 601.653 358.879 627.267 419.561 627.267C480.244 627.267 534.886 601.653 573.35 560.699C580.988 564.448 589.111 567.502 597.651 569.515L614.106 573.471Z",fill:"#555A5E"}),t.createElement("path",{d:"M249.898 196.144C249.898 249.777 270.317 315.623 270.317 315.623C270.317 315.623 266.862 205.572 314.892 164.108C347.514 135.946 374.019 167.565 417.115 167.565C456.137 167.565 492.558 136.481 525.436 164.108C578.852 208.994 568.738 315.623 568.738 315.623C568.738 315.623 589.157 250.557 589.157 196.144C589.157 76.4319 542.638 20 417.115 20C302.8 20 249.898 75.8365 249.898 196.144Z",fill:"#525252"})),f>=8?t.createElement(t.Fragment,null,t.createElement("path",{d:"M565.5 295C565.5 350.583 549.016 400.803 522.488 437.067C495.958 473.332 459.517 495.5 419.5 495.5C379.483 495.5 343.042 473.332 316.512 437.067C289.984 400.803 273.5 350.583 273.5 295C273.5 239.417 289.984 189.197 316.512 152.933C343.042 116.668 379.483 94.5 419.5 94.5C459.517 94.5 495.958 116.668 522.488 152.933C549.016 189.197 565.5 239.417 565.5 295Z",stroke:h,strokeWidth:"5"}),t.createElement("circle",{cx:"518.5",cy:"438.5",r:"25.5",fill:h}),t.createElement("path",{d:"M504 440.5L512 448L531 427",stroke:"white",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"})):t.createElement(t.Fragment,null,f>2&&t.createElement(t.Fragment,null,f>3&&t.createElement(t.Fragment,null,f>4&&t.createElement(t.Fragment,null,f>5&&t.createElement(t.Fragment,null,t.createElement("path",{d:"M298.5 182.5L419 164.5L540 182",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("circle",{cx:"419",cy:"165",r:"7",fill:"white"})),t.createElement("path",{d:"M565.5 295C565.5 350.583 549.016 400.803 522.488 437.067C495.958 473.332 459.517 495.5 419.5 495.5C379.483 495.5 343.042 473.332 316.512 437.067C289.984 400.803 273.5 350.583 273.5 295C273.5 239.417 289.984 189.197 316.512 152.933C343.042 116.668 379.483 94.5 419.5 94.5C459.517 94.5 495.958 116.668 522.488 152.933C549.016 189.197 565.5 239.417 565.5 295Z",stroke:"white",strokeOpacity:f>7?.8:f>5?.3:.1,strokeWidth:"5"}),t.createElement("path",{d:"M299.939 262.805L419 478.5L538.5 261.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M298.5 182.5L418.871 230.054L540 182",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M298.5 182.5L299.939 262.805",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M540.001 182L538.501 261.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("circle",{cx:"299.914",cy:"182",r:"7",fill:"white"}),t.createElement("circle",{cx:"540",cy:"182",r:"7",fill:"white"})),t.createElement("path",{d:"M418.828 230L419 342.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:f>4&&f<7?.3:1}),t.createElement("path",{d:"M300 263.001L419 342.501",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:f>4&&f<7?.3:1}),t.createElement("path",{d:"M538.5 261.5L419 342.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:f>4&&f<7?.3:1}),t.createElement("path",{d:"M301.5 409L419 342.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:f>4&&f<7?.3:1}),t.createElement("path",{d:"M536.5 410L419 342.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:f>4&&f<7?.3:1}),t.createElement("path",{d:"M300 263L419 230",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:f>4&&f<7?.3:1}),t.createElement("path",{d:"M538.5 261.5L419 230",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:f>4&&f<7?.3:1}),t.createElement("circle",{cx:"419",cy:"229.971",r:"7",fill:"white"}),t.createElement("circle",{cx:"419",cy:"342.4",r:"7",fill:"white"})),t.createElement("path",{d:"M538.5 261.5L536.5 410",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:f>3&&f<7?.3:1}),t.createElement("path",{d:"M419 478.5L536.5 410",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:f>3&&f<7?.3:1}),t.createElement("circle",{cx:"537",cy:"263",r:"7",fill:"white"}),t.createElement("circle",{cx:"537",cy:"409",r:"7",fill:"white"})),f>1&&t.createElement(t.Fragment,null,t.createElement("path",{d:"M301.501 409L300.001 263",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:f>2&&f<7?.3:1}),t.createElement("path",{d:"M301.501 409L419.001 478.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:f>2&&f<7?.3:1}),t.createElement("circle",{cx:"419",cy:"477.576",r:"7",fill:"white"}),t.createElement("circle",{cx:"301.914",cy:"263",r:"7",fill:"white"}),t.createElement("circle",{cx:"301.444",cy:"409",r:"7",fill:"white"})))),t.createElement("defs",null,t.createElement("clipPath",{id:"clip0_428_1188"},t.createElement("rect",{width:"840",height:"740",fill:"white"}))))}var dy,fy,py,hy,my,gy,vy,yy,by,xy,Cy,wy,Ey,ky,Dy,My="".concat(mh,"/Selfie-Image-1.png"),Ty=o.div(dy||(dy=v(["\n height: 100dvh;\n display: flex;\n flex-direction: column;\n background: ",";\n color: ",";\n"],["\n height: 100dvh;\n display: flex;\n flex-direction: column;\n background: ",";\n color: ",";\n"])),(function(e){var t,n,r,o;return null!==(o=null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.selfieCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.backgroundColor)&&void 0!==o?o:"#ecedf3"}),(function(e){var t,n,r,o;return null!==(o=null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.selfieCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.textColor)&&void 0!==o?o:"black"})),Iy=o.div(fy||(fy=v(["\n text-align: ",";\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n ","\n padding-bottom: 0;\n"],["\n text-align: ",";\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n ","\n padding-bottom: 0;\n"])),(function(e){var t;return null!==(t=e.theme.textAlign)&&void 0!==t?t:"center"}),(function(e){return e.theme.padding?"box-sizing: border-box; padding: ".concat(e.theme.padding,";"):""})),Sy=o(hh)(py||(py=v(["\n padding: 16px 24px;\n margin-top: 16px;\n font-size: 18px;\n font-weight: bold;\n background: white;\n box-shadow:\n 0 1px 3px 0 rgb(0 0 0 / 0.1),\n 0 1px 2px -1px rgb(0 0 0 / 0.1);\n"],["\n padding: 16px 24px;\n margin-top: 16px;\n font-size: 18px;\n font-weight: bold;\n background: white;\n box-shadow:\n 0 1px 3px 0 rgb(0 0 0 / 0.1),\n 0 1px 2px -1px rgb(0 0 0 / 0.1);\n"]))),Ny=o(Dh)(hy||(hy=v(["\n display: flex;\n flex-direction: row;\n padding: 15px 25px;\n height: 100px;\n color: ",";\n ","\n position: fixed;\n bottom: 0;\n left: 0;\n width: 100dvw;\n box-sizing: border-box;\n"],["\n display: flex;\n flex-direction: row;\n padding: 15px 25px;\n height: 100px;\n color: ",";\n ","\n position: fixed;\n bottom: 0;\n left: 0;\n width: 100dvw;\n box-sizing: border-box;\n"])),(function(e){var t,n,r,o;return null!==(o=null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.selfieCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.progressBarTextColor)&&void 0!==o?o:"white"}),(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.selfieCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.progressBarFontSize)?"font-size: ".concat(null===(a=null===(i=null===(o=e.theme)||void 0===o?void 0:o.selfieCapture)||void 0===i?void 0:i.loadingOverlay)||void 0===a?void 0:a.progressBarFontSize,";"):""})),Ay=o(B)(my||(my=v(["\n padding: 0;\n\n & > svg {\n height: 100%;\n }\n"],["\n padding: 0;\n\n & > svg {\n height: 100%;\n }\n"]))),Ly=o.div(gy||(gy=v(["\n display: flex;\n position: relative;\n z-index: 2;\n"],["\n display: flex;\n position: relative;\n z-index: 2;\n"]))),Oy=o.ul(vy||(vy=v(["\n display: block;\n margin: auto;\n list-style: none;\n padding: 0;\n"],["\n display: block;\n margin: auto;\n list-style: none;\n padding: 0;\n"]))),Ry=o.li(yy||(yy=v(["\n display: inline-flex;\n justify-content: center;\n align-items: center;\n padding: 2px 1.25rem 2px 0;\n line-height: 1rem;\n\n &::before {\n content: '';\n display: inline-block;\n height: 1rem;\n min-width: 1rem;\n vertical-align: middle;\n background-size: cover;\n background-repeat: no-repeat;\n margin: auto 0.5rem auto 0;\n }\n\n &.done::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBjbGlwLXBhdGg9InVybCgjY2xpcDBfNDlfMzg1KSI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMiAyNEMxOC42Mjc0IDI0IDI0IDE4LjYyNzQgMjQgMTJDMjQgNS4zNzI1OCAxOC42Mjc0IDAgMTIgMEM1LjM3MjU4IDAgMCA1LjM3MjU4IDAgMTJDMCAxOC42Mjc0IDUuMzcyNTggMjQgMTIgMjRaTTE5LjU2NDMgOC4yNzg1MkMxOS45NTQ5IDcuODg3OTkgMTkuOTU0OSA3LjI1NDgzIDE5LjU2NDMgNi44NjQzQzE5LjE3MzggNi40NzM3OCAxOC41NDA2IDYuNDczNzggMTguMTUwMSA2Ljg2NDNMOS40Mjg2NiAxNS41ODU4TDUuODUwMDUgMTIuMDA3MkM1LjQ1OTUzIDExLjYxNjYgNC44MjYzNiAxMS42MTY2IDQuNDM1ODQgMTIuMDA3MkM0LjA0NTMxIDEyLjM5NzcgNC4wNDUzMSAxMy4wMzA5IDQuNDM1ODQgMTMuNDIxNEw4LjcyMTU1IDE3LjcwNzFDOS4xMTIwOCAxOC4wOTc2IDkuNzQ1MjQgMTguMDk3NiAxMC4xMzU4IDE3LjcwNzFMMTkuNTY0MyA4LjI3ODUyWiIgZmlsbD0id2hpdGUiLz48L2c+PGRlZnM+PGNsaXBQYXRoIGlkPSJjbGlwMF80OV8zODUiPjxyZWN0IHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0id2hpdGUiLz48L2NsaXBQYXRoPjwvZGVmcz48L3N2Zz4=');\n }\n\n &.running::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBjbGlwLXBhdGg9InVybCgjY2xpcDBfNDlfMzcwKSI+PG1hc2sgaWQ9InBhdGgtMS1pbnNpZGUtMV80OV8zNzAiIGZpbGw9IndoaXRlIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTMuNTE0NzIgMjAuNDg1NUM4LjIwMTAxIDI1LjE3MTggMTUuNzk5IDI1LjE3MTggMjAuNDg1MyAyMC40ODU1QzI1LjE3MTYgMTUuNzk5MiAyNS4xNzE2IDguMjAxMTkgMjAuNDg1MyAzLjUxNDlDMTUuNzk5IC0xLjE3MTM5IDguMjAxMDEgLTEuMTcxMzkgMy41MTQ3MiAzLjUxNDlDLTEuMTcxNTcgOC4yMDExOSAtMS4xNzE1NyAxNS43OTkyIDMuNTE0NzIgMjAuNDg1NVoiLz48L21hc2s+PHBhdGggZD0iTTYuMzk4MTQgMTEuNDU5QzUuODQ1ODYgMTEuNDU5IDUuMzk4MTQgMTEuOTA2NyA1LjM5ODE0IDEyLjQ1OUM1LjM5ODE0IDEzLjAxMTIgNS44NDU4NiAxMy40NTkgNi4zOTgxNCAxMy40NTlWMTEuNDU5Wk0xNy42MDE5IDEzLjQ1OUMxOC4xNTQxIDEzLjQ1OSAxOC42MDE5IDEzLjAxMTIgMTguNjAxOSAxMi40NTlDMTguNjAxOSAxMS45MDY3IDE4LjE1NDEgMTEuNDU5IDE3LjYwMTkgMTEuNDU5VjEzLjQ1OVpNNi4zOTgxNCAxMy40NTlIMTcuNjAxOVYxMS40NTlINi4zOTgxNFYxMy40NTlaTTMuNTE0NzIgMjAuNDg1NUw0LjkyODkzIDE5LjA3MTNMNC45Mjg5MyAxOS4wNzEzTDMuNTE0NzIgMjAuNDg1NVpNMjAuNDg1MyAzLjUxNDlMMTkuMDcxMSA0LjkyOTEyTDE5LjA3MTEgNC45MjkxMkwyMC40ODUzIDMuNTE0OVpNMy41MTQ3MiAzLjUxNDlMNC45Mjg5MyA0LjkyOTEyTDQuOTI4OTMgNC45MjkxMkwzLjUxNDcyIDMuNTE0OVpNMTkuMDcxMSAxOS4wNzEzQzE1LjE2NTggMjIuOTc2NSA4LjgzNDE3IDIyLjk3NjUgNC45Mjg5MyAxOS4wNzEzTDIuMTAwNTEgMjEuODk5N0M3LjU2Nzg0IDI3LjM2NyAxNi40MzIyIDI3LjM2NyAyMS44OTk1IDIxLjg5OTdMMTkuMDcxMSAxOS4wNzEzWk0xOS4wNzExIDQuOTI5MTJDMjIuOTc2MyA4LjgzNDM2IDIyLjk3NjMgMTUuMTY2IDE5LjA3MTEgMTkuMDcxM0wyMS44OTk1IDIxLjg5OTdDMjcuMzY2OCAxNi40MzIzIDI3LjM2NjggNy41NjgwMyAyMS44OTk1IDIuMTAwNjlMMTkuMDcxMSA0LjkyOTEyWk00LjkyODkzIDQuOTI5MTJDOC44MzQxNyAxLjAyMzg3IDE1LjE2NTggMS4wMjM4NyAxOS4wNzExIDQuOTI5MTJMMjEuODk5NSAyLjEwMDY5QzE2LjQzMjIgLTMuMzY2NjUgNy41Njc4NCAtMy4zNjY2NSAyLjEwMDUxIDIuMTAwNjlMNC45Mjg5MyA0LjkyOTEyWk00LjkyODkzIDE5LjA3MTNDMS4wMjM2OSAxNS4xNjYgMS4wMjM2OSA4LjgzNDM2IDQuOTI4OTMgNC45MjkxMkwyLjEwMDUxIDIuMTAwNjlDLTMuMzY2ODMgNy41NjgwMyAtMy4zNjY4MyAxNi40MzIzIDIuMTAwNTEgMjEuODk5N0w0LjkyODkzIDE5LjA3MTNaIiBmaWxsPSJ3aGl0ZSIgbWFzaz0idXJsKCNwYXRoLTEtaW5zaWRlLTFfNDlfMzcwKSIvPjwvZz48ZGVmcz48Y2xpcFBhdGggaWQ9ImNsaXAwXzQ5XzM3MCI+PHJlY3Qgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSJ3aGl0ZSIvPjwvY2xpcFBhdGg+PC9kZWZzPjwvc3ZnPg==');\n }\n"],["\n display: inline-flex;\n justify-content: center;\n align-items: center;\n padding: 2px 1.25rem 2px 0;\n line-height: 1rem;\n\n &::before {\n content: '';\n display: inline-block;\n height: 1rem;\n min-width: 1rem;\n vertical-align: middle;\n background-size: cover;\n background-repeat: no-repeat;\n margin: auto 0.5rem auto 0;\n }\n\n &.done::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBjbGlwLXBhdGg9InVybCgjY2xpcDBfNDlfMzg1KSI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMiAyNEMxOC42Mjc0IDI0IDI0IDE4LjYyNzQgMjQgMTJDMjQgNS4zNzI1OCAxOC42Mjc0IDAgMTIgMEM1LjM3MjU4IDAgMCA1LjM3MjU4IDAgMTJDMCAxOC42Mjc0IDUuMzcyNTggMjQgMTIgMjRaTTE5LjU2NDMgOC4yNzg1MkMxOS45NTQ5IDcuODg3OTkgMTkuOTU0OSA3LjI1NDgzIDE5LjU2NDMgNi44NjQzQzE5LjE3MzggNi40NzM3OCAxOC41NDA2IDYuNDczNzggMTguMTUwMSA2Ljg2NDNMOS40Mjg2NiAxNS41ODU4TDUuODUwMDUgMTIuMDA3MkM1LjQ1OTUzIDExLjYxNjYgNC44MjYzNiAxMS42MTY2IDQuNDM1ODQgMTIuMDA3MkM0LjA0NTMxIDEyLjM5NzcgNC4wNDUzMSAxMy4wMzA5IDQuNDM1ODQgMTMuNDIxNEw4LjcyMTU1IDE3LjcwNzFDOS4xMTIwOCAxOC4wOTc2IDkuNzQ1MjQgMTguMDk3NiAxMC4xMzU4IDE3LjcwNzFMMTkuNTY0MyA4LjI3ODUyWiIgZmlsbD0id2hpdGUiLz48L2c+PGRlZnM+PGNsaXBQYXRoIGlkPSJjbGlwMF80OV8zODUiPjxyZWN0IHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0id2hpdGUiLz48L2NsaXBQYXRoPjwvZGVmcz48L3N2Zz4=');\n }\n\n &.running::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBjbGlwLXBhdGg9InVybCgjY2xpcDBfNDlfMzcwKSI+PG1hc2sgaWQ9InBhdGgtMS1pbnNpZGUtMV80OV8zNzAiIGZpbGw9IndoaXRlIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTMuNTE0NzIgMjAuNDg1NUM4LjIwMTAxIDI1LjE3MTggMTUuNzk5IDI1LjE3MTggMjAuNDg1MyAyMC40ODU1QzI1LjE3MTYgMTUuNzk5MiAyNS4xNzE2IDguMjAxMTkgMjAuNDg1MyAzLjUxNDlDMTUuNzk5IC0xLjE3MTM5IDguMjAxMDEgLTEuMTcxMzkgMy41MTQ3MiAzLjUxNDlDLTEuMTcxNTcgOC4yMDExOSAtMS4xNzE1NyAxNS43OTkyIDMuNTE0NzIgMjAuNDg1NVoiLz48L21hc2s+PHBhdGggZD0iTTYuMzk4MTQgMTEuNDU5QzUuODQ1ODYgMTEuNDU5IDUuMzk4MTQgMTEuOTA2NyA1LjM5ODE0IDEyLjQ1OUM1LjM5ODE0IDEzLjAxMTIgNS44NDU4NiAxMy40NTkgNi4zOTgxNCAxMy40NTlWMTEuNDU5Wk0xNy42MDE5IDEzLjQ1OUMxOC4xNTQxIDEzLjQ1OSAxOC42MDE5IDEzLjAxMTIgMTguNjAxOSAxMi40NTlDMTguNjAxOSAxMS45MDY3IDE4LjE1NDEgMTEuNDU5IDE3LjYwMTkgMTEuNDU5VjEzLjQ1OVpNNi4zOTgxNCAxMy40NTlIMTcuNjAxOVYxMS40NTlINi4zOTgxNFYxMy40NTlaTTMuNTE0NzIgMjAuNDg1NUw0LjkyODkzIDE5LjA3MTNMNC45Mjg5MyAxOS4wNzEzTDMuNTE0NzIgMjAuNDg1NVpNMjAuNDg1MyAzLjUxNDlMMTkuMDcxMSA0LjkyOTEyTDE5LjA3MTEgNC45MjkxMkwyMC40ODUzIDMuNTE0OVpNMy41MTQ3MiAzLjUxNDlMNC45Mjg5MyA0LjkyOTEyTDQuOTI4OTMgNC45MjkxMkwzLjUxNDcyIDMuNTE0OVpNMTkuMDcxMSAxOS4wNzEzQzE1LjE2NTggMjIuOTc2NSA4LjgzNDE3IDIyLjk3NjUgNC45Mjg5MyAxOS4wNzEzTDIuMTAwNTEgMjEuODk5N0M3LjU2Nzg0IDI3LjM2NyAxNi40MzIyIDI3LjM2NyAyMS44OTk1IDIxLjg5OTdMMTkuMDcxMSAxOS4wNzEzWk0xOS4wNzExIDQuOTI5MTJDMjIuOTc2MyA4LjgzNDM2IDIyLjk3NjMgMTUuMTY2IDE5LjA3MTEgMTkuMDcxM0wyMS44OTk1IDIxLjg5OTdDMjcuMzY2OCAxNi40MzIzIDI3LjM2NjggNy41NjgwMyAyMS44OTk1IDIuMTAwNjlMMTkuMDcxMSA0LjkyOTEyWk00LjkyODkzIDQuOTI5MTJDOC44MzQxNyAxLjAyMzg3IDE1LjE2NTggMS4wMjM4NyAxOS4wNzExIDQuOTI5MTJMMjEuODk5NSAyLjEwMDY5QzE2LjQzMjIgLTMuMzY2NjUgNy41Njc4NCAtMy4zNjY2NSAyLjEwMDUxIDIuMTAwNjlMNC45Mjg5MyA0LjkyOTEyWk00LjkyODkzIDE5LjA3MTNDMS4wMjM2OSAxNS4xNjYgMS4wMjM2OSA4LjgzNDM2IDQuOTI4OTMgNC45MjkxMkwyLjEwMDUxIDIuMTAwNjlDLTMuMzY2ODMgNy41NjgwMyAtMy4zNjY4MyAxNi40MzIzIDIuMTAwNTEgMjEuODk5N0w0LjkyODkzIDE5LjA3MTNaIiBmaWxsPSJ3aGl0ZSIgbWFzaz0idXJsKCNwYXRoLTEtaW5zaWRlLTFfNDlfMzcwKSIvPjwvZz48ZGVmcz48Y2xpcFBhdGggaWQ9ImNsaXAwXzQ5XzM3MCI+PHJlY3Qgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSJ3aGl0ZSIvPjwvY2xpcFBhdGg+PC9kZWZzPjwvc3ZnPg==');\n }\n"]))),Fy=o.div(by||(by=v(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"],["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"]))),Py=o.div(xy||(xy=v(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: ",";\n opacity: ",";\n"],["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: ",";\n opacity: ",";\n"])),(function(e){var t,n,r,o;return null!==(o=null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.selfieCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.progressBarBackgroundColor)&&void 0!==o?o:"var(--idm-color-positive-600)"}),(function(e){var t,n,r,o;return null!==(o=null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.selfieCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.progressBarBackgroundOpacity)&&void 0!==o?o:.75})),Uy=o.span(Cy||(Cy=v(["\n display: block;\n width: ","%;\n height: 100%;\n"],["\n display: block;\n width: ","%;\n height: 100%;\n"])),(function(e){return e.$progress})),_y=o.span(wy||(wy=v(["\n display: block;\n height: 100%;\n background: ",";\n animation: progressBar 3s ease-in-out;\n animation-fill-mode: both;\n\n @keyframes progressBar {\n 0% {\n width: 0;\n }\n 100% {\n width: 100%;\n }\n }\n"],["\n display: block;\n height: 100%;\n background: ",";\n animation: progressBar 3s ease-in-out;\n animation-fill-mode: both;\n\n @keyframes progressBar {\n 0% {\n width: 0;\n }\n 100% {\n width: 100%;\n }\n }\n"])),(function(e){var t,n,r,o;return null!==(o=null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.selfieCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.progressBarIndicatorColor)&&void 0!==o?o:"var(--idm-color-positive-600)"})),jy=o.img(Ey||(Ey=v([""],[""]))),By=o.div(ky||(ky=v(["\n display: flex;\n"],["\n display: flex;\n"]))),zy=o(le)(Dy||(Dy=v(["\n margin: auto;\n white-space: nowrap;\n ","\n ","\n"],["\n margin: auto;\n white-space: nowrap;\n ","\n ","\n"])),(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.selfieCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.progressBarFontSize)?"font-size: ".concat(null===(a=null===(i=null===(o=e.theme)||void 0===o?void 0:o.selfieCapture)||void 0===i?void 0:i.loadingOverlay)||void 0===a?void 0:a.progressBarFontSize,";"):""}),(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme)||void 0===t?void 0:t.selfieCapture)||void 0===n?void 0:n.loadingOverlay)||void 0===r?void 0:r.continueBtnBorder)?"border: ".concat(null===(a=null===(i=null===(o=e.theme)||void 0===o?void 0:o.selfieCapture)||void 0===i?void 0:i.loadingOverlay)||void 0===a?void 0:a.continueBtnBorder,";"):""})),Gy={default:function(e){var n=e.onDismissed,r=e.onUserCancel,o=e.assets,i=void 0===o?{}:o,a=e.classNames,s=void 0===a?{}:a,u=e.colors,c=void 0===u?{}:u,l=e.verbiage,d=void 0===l?{}:l,f=t.useContext(nt),p=f.cameraReady,h=f.cameraAccessDenied,m=f.microphoneAccessDenied,g=t.useContext(Dv),v=g.ready,y=g.modelDownloadProgress,b=rh(d,{headingText:"Use your device camera to capture your face",removeEyeCoveringsText:"Remove Sunglasses & Hat",avoidExcessiveBacklightingText:"Avoid Excessive Backlighting",continueText:"Let's Go!",cameraInitializingText:"Accessing camera...",cameraInitializedText:"Camera ready",downloadingText:"Downloading...",modelsWarmingUpText:"Loading guided capture experience...",modelsReadyText:"Guided capture experience ready"}),x=t.useState(0),C=x[1],w=[b.headingText,b.removeEyeCoveringsText,b.avoidExcessiveBacklightingText][x[0]];t.useEffect((function(){setInterval((function(){C((function(e){return(e+1)%3}))}),3e3)}),[]);var E=t.useState(!1),k=E[1];return E[0]?t.createElement(t.Fragment,null):h?t.createElement(yh,{assets:i.cameraAccessDenied,classNames:s.cameraAccessDenied,colors:c.cameraAccessDenied,verbiage:d.cameraAccessDenied}):m?t.createElement(ry,{assets:i.microphoneAccessDenied,classNames:s.microphoneAccessDenied,colors:c.microphoneAccessDenied,verbiage:d.microphoneAccessDenied}):t.createElement(_,{className:s.container},t.createElement(Ty,{className:s.inner},r&&t.createElement(kh,{onClick:r,className:s.cancelBtn}),t.createElement(Iy,{className:s.headingContainer},t.createElement(Sy,{className:s.heading},w)),t.createElement(Ay,{className:s.imageContainer},(null==i?void 0:i.instructionImageUrl)&&i.instructionImageUrl!==My?t.createElement(jy,{className:s.image,alt:b.headingText,src:i.instructionImageUrl}):t.createElement(ly,{className:s.image})),t.createElement(Ny,{className:s.buttonsRow},t.createElement(Fy,{className:s.progressContainer},t.createElement(Py,{className:s.progressBackground}),t.createElement(Uy,{$progress:y,className:s.progressBar},t.createElement(_y,{className:s.progressIndicator}))),t.createElement(Ly,{className:s.loadingListContainer},t.createElement(Oy,{className:s.loadingList},t.createElement(Ry,{className:"".concat(s.loadingListItem," ").concat(p?"done":"running")},p?b.cameraInitializedText:b.cameraInitializingText),t.createElement(Ry,{className:"".concat(s.loadingListItem," ").concat(v?"done":"running")},v?b.modelsReadyText:y>=100?b.modelsWarmingUpText:"".concat(b.downloadingText," (").concat(y,"%)")))),t.createElement(By,{className:s.continueBtnContainer},v&&p&&t.createElement(zy,{finished:!0,className:s.continueBtn,variant:"positive",colors:c.continueBtn,onClick:function(){k(!0),null==n||n()}},b.continueText)))))},legacy:function(e){var n=e.onDismissed,r=e.onUserCancel,o=e.assets,i=void 0===o?{}:o,a=e.classNames,s=void 0===a?{}:a,u=e.colors,c=void 0===u?{}:u,l=e.verbiage,d=void 0===l?{}:l,f=t.useContext(nt),p=f.cameraReady,h=f.cameraAccessDenied,m=f.microphoneAccessDenied,g=t.useContext(Dv),v=g.ready,y=g.modelDownloadProgress;i.instructionImageUrl||(i.instructionImageUrl="".concat(mh,"/Selfie-Image-1.png"));var b=rh(d,{headingText:"Use your device camera to capture your face",removeEyeCoveringsText:"Remove Sunglasses & Hat",avoidExcessiveBacklightingText:"Avoid Excessive Backlighting",continueText:"Continue",cameraInitializingText:"Camera initializing...",downloadingText:"Downloading...",modelsWarmingUpText:"Models warming up..."}),x=t.useState(!1),C=x[1];return x[0]?t.createElement(t.Fragment,null):h?t.createElement(yh,{assets:i.cameraAccessDenied,classNames:s.cameraAccessDenied,colors:c.cameraAccessDenied,verbiage:d.cameraAccessDenied}):m?t.createElement(ry,{assets:i.microphoneAccessDenied,classNames:s.microphoneAccessDenied,colors:c.microphoneAccessDenied,verbiage:d.microphoneAccessDenied}):t.createElement(_,{className:s.container},t.createElement(j,{className:s.inner},t.createElement("h3",{className:s.heading},b.headingText),r&&t.createElement(kh,{onClick:r,className:s.cancelBtn}),t.createElement(uy,null,b.removeEyeCoveringsText,t.createElement("br",null),b.avoidExcessiveBacklightingText),t.createElement(B,{className:s.imageContainer},t.createElement("img",{className:s.image,alt:b.headingText,src:i.instructionImageUrl})),t.createElement(cy,{className:s.buttonsRow},t.createElement(le,{variant:"positive",disabled:!p||!v,finished:p&&v,className:s.continueBtn,colors:c.continueBtn,onClick:function(){C(!0),null==n||n()}},p&&v?b.continueText:v?b.cameraInitializingText:y>=100?"".concat(b.modelsWarmingUpText):"".concat(b.downloadingText," (").concat(y,"%)")))))}},Vy=function(e){var n,r=e.mode,o=void 0===r?"default":r,i=p(e,["mode"]),a=null!==(n=Gy[o])&&void 0!==n?n:Gy.default;return t.createElement(a,f({},i))},Wy=function(e){var n,r,o,i=e.onComplete,a=e.onSuccess,s=e.onTimeout,u=e.onExitCapture,c=e.onExitAfterFailure,l=e.onUserCancel,d=e.loadingOverlayMode,f=void 0===d?"default":d,p=e.timeoutDurationMs,g=void 0===p?15e3:p,v=e.maxRetries,y=void 0===v?2:v,b=e.skipSuccessScreen,x=void 0!==b&&b,C=e.renderCameraFeed,E=void 0===C||C,k=e.releaseCameraAccessOnExit,D=void 0===k||k,M=e.silentFallback,T=void 0!==M&&M,I=e.assets,S=void 0===I?{}:I,N=e.classNames,A=void 0===N?{}:N,L=e.colors,R=void 0===L?{}:L,F=e.verbiage,P=void 0===F?{}:F,U=e.debugMode,_=void 0!==U&&U,j=t.useContext(_e),B=j.submissionResponse,z=j.livenessCheckRequest,G=j.setSelfieImage,V=j.logSelfieCaptureAttempt,W=t.useContext(nt),q=W.cameraAccessDenied,H=W.requestCameraAccess,Y=W.releaseCameraAccess,Z=t.useState(""),Q=Z[0],$=Z[1],X=t.useState(0),K=X[0],J=X[1],ee=t.useState("LOADING"),te=ee[0],ne=ee[1],re=t.useRef(),oe=t.useRef(),ie=t.useRef(),ae=t.useContext(Dv),se=ae.start,ue=ae.stop;t.useEffect((function(){ie.current=new Date}),[]),t.useEffect((function(){if("CAPTURING"===te)return re.current=new Date,se(),function(){ue()}}),[te,se,ue]);var ce=t.useCallback((function(){oe.current=new Date}),[]),le=t.useCallback((function(){var e,t,n;V({autoCapture:"Y",captureTime:(null!==(e=oe.current)&&void 0!==e?e:new Date).getTime()-(null!==(t=re.current)&&void 0!==t?t:new Date).getTime(),operationTime:(new Date).getTime()-(null!==(n=ie.current)&&void 0!==n?n:new Date).getTime()}),ie.current=new Date}),[V]),de=t.useCallback((function(e){return h(void 0,void 0,void 0,(function(){var t;return m(this,(function(n){switch(n.label){case 0:return z&&B?(ne("SUCCESS"),$(e),t=G,[4,w(e)]):[2];case 1:return t.apply(void 0,[n.sent()]),null==a||a(B,z),[2]}}))}))}),[a,G,z,B]),fe=t.useCallback((function(){ne("FAILED"),null==s||s(B,z)}),[s,z,B]),pe=t.useState(0),he=pe[0],me=pe[1],ge=t.useCallback((function(){me((function(e){return e+1})),ne("LOADING"),Y(),null==u||u(),H()}),[u,Y,H]),ve=t.useCallback((function(){le(),me((function(e){return e+1})),J((function(e){return e+1})),ne("LOADING"),Y(),H()}),[le,Y,H]),ye=t.useCallback((function(){le(),D&&Y(),setTimeout((function(){null==i||i(B,z)}),0)}),[le,i,Y,D,z,B]),be=jm(x,"SUCCESS"===te,ye);return t.useEffect((function(){q&&(me((function(e){return e+1})),ne("LOADING"))}),[q]),t.createElement(t.Fragment,null,t.createElement(O,{className:"flex ".concat(null!==(r=null===(n=A.capture)||void 0===n?void 0:n.container)&&void 0!==r?r:"")},E&&t.createElement(Um,{className:null===(o=A.capture)||void 0===o?void 0:o.cameraFeed}),"LOADING"!==te&&function(){switch(te){case"CAPTURING":return t.createElement(Kv,{key:"capture".concat(he),onCapture:ce,onSuccess:de,onTimeout:fe,onExit:ge,timeoutDurationMs:g,silentFallback:T,classNames:A.capture,colors:R,verbiage:P,debugMode:_});case"SUCCESS":return be?t.createElement(Jv,{key:"success",imageUrl:Q,classNames:A.success,colors:R.success,verbiage:P.success,onDoneClick:ye,onRetryClick:ve}):null;case"FAILED":return t.createElement(ty,{key:"failure",assets:S.failure,classNames:A.failure,colors:R.failure,verbiage:P.failure,canRetry:y>-1&&K<y,onRetryClick:ve,onExitClick:function(){D&&Y(),setTimeout((function(){null==c||c(B,z)}),0)}});default:return null}}()),t.createElement(Vy,{key:he,mode:f,assets:S.loadingOverlay,classNames:A.loadingOverlay,colors:R.loadingOverlay,verbiage:P.loadingOverlay,onUserCancel:l,onDismissed:function(){ne("CAPTURING")}}))},qy=function(e){var n=e.children,r=t.useState({width:1,height:1})[1],o=t.useState(1),i=o[0],a=o[1],s=ze(),u=s.ref,c=s.width,l=void 0===c?1:c,d=s.height,f=void 0===d?1:d,p=l/f,h=t.useCallback((function(e){var t=e.target;a(t.naturalWidth/t.naturalHeight)}),[]);return t.createElement(ng.Provider,{value:{orientation:"landscape",wrapperWidth:l,wrapperHeight:f,wrapperAspectRatio:p,imageAspectRatio:i,setDimensions:r,wrapperRef:u,onImageLoaded:h}},n)},Hy=function(){var e=t.useContext(_e),n=e.submissionRequest,r=e.submissionResponse,o=t.useState(!1),i=o[0],a=o[1],s=t.useState(!0),u=s[0],c=s[1],l=t.useMemo((function(){var e,t,r,o,i,a,s=JSON.parse(JSON.stringify(n));return u&&((null===(t=null===(e=null==s?void 0:s.customerData)||void 0===e?void 0:e.idData)||void 0===t?void 0:t.idImageFront)&&(s.customerData.idData.idImageFront=Yy(s.customerData.idData.idImageFront,200)),(null===(o=null===(r=null==s?void 0:s.customerData)||void 0===r?void 0:r.idData)||void 0===o?void 0:o.idImageBack)&&(s.customerData.idData.idImageBack=Yy(s.customerData.idData.idImageBack,200)),(null===(a=null===(i=null==s?void 0:s.customerData)||void 0===i?void 0:i.biometricData)||void 0===a?void 0:a.selfie)&&(s.customerData.biometricData.selfie=Yy(s.customerData.biometricData.selfie,200))),JSON.stringify(s,null,2)}),[n,u]);return t.createElement(t.Fragment,null,t.createElement("h3",null,"Submission completed!"),t.createElement("button",{onClick:function(){a(!i)}},i?"Hide":"Show"," request body"),i&&t.createElement(t.Fragment,null,t.createElement("button",{style:{marginLeft:8},onClick:function(){c(!u)}},u?"Display full images":"Truncate images"),t.createElement("h5",null,"Request Body"),t.createElement("pre",null,l)),t.createElement("h5",null,"Response Body"),t.createElement("pre",null,JSON.stringify(r,null,2)))};function Yy(e,t){var n=e.split("").splice(0,t).join("");return n.length<e.length&&(n+="..."),n}var Zy,Qy,$y,Xy,Ky,Jy,eb,tb,nb,rb=function(e){var n=e.document,r=e.onComplete,o=e.classNames,i=void 0===o?{}:o,a=e.verbiage,s=void 0===a?{}:a,u=t.useRef(null),c=t.useState(null),l=c[0],d=c[1],f=rh(s,{headingText:"Additional document capture",captureBtnText:"Capture",nextBtnText:"Next"});return t.createElement(_,{className:i.container},t.createElement(ob,{className:i.inner},t.createElement(ib,{className:i.heading},f.headingText,": ",n.name),n.description&&t.createElement(ab,{className:i.description},n.description),t.createElement("input",{ref:u,type:"file",accept:"image/*,.pdf",onChange:function(e){var t,n=null===(t=e.target.files)||void 0===t?void 0:t[0];n&&d(n)},hidden:!0}),t.createElement(sb,{className:i.buttonsRow},l?t.createElement(le,{variant:"positive",className:i.nextBtn,disabled:!l,finished:!0,onClick:function(){if(l){var e=new FileReader;e.onloadend=function(){if(e.result){var t=e.result.toString();null==r||r({documentName:n.name,processAsPOA:n.processAsPOA?"Y":"N",additionalDocument:{name:l.name,fileContent:E(t),type:k(t),fileUploadType:"Y",isImageControlData:"Y",fieldId:""}})}},e.readAsDataURL(l)}}},f.nextBtnText):t.createElement(le,{variant:"primary",className:i.captureBtn,finished:!0,onClick:function(){var e;null===(e=u.current)||void 0===e||e.click()}},f.captureBtnText))))},ob=o(j)(Zy||(Zy=v(["\n justify-content: center;\n"],["\n justify-content: center;\n"]))),ib=o.h3(Qy||(Qy=v(["\n margin-bottom: 8px;\n"],["\n margin-bottom: 8px;\n"]))),ab=o.p($y||($y=v(["\n margin-bottom: 8px;\n"],["\n margin-bottom: 8px;\n"]))),sb=o(Dh)(Xy||(Xy=v(["\n margin-top: 32px;\n"],["\n margin-top: 32px;\n"]))),ub=function(e){var n=e.documents,r=e.onComplete,o=e.classNames,i=void 0===o?{}:o,a=e.verbiage,s=void 0===a?{}:a,u=t.useState([]),c=u[0],l=u[1],d=c.length,f=n[d],p=d>=n.length;return t.useEffect((function(){(null==f?void 0:f.skip)&&h(void 0,void 0,void 0,(function(){var e;return m(this,(function(t){switch(t.label){case 0:return[4,null===(e=f.skip)||void 0===e?void 0:e.call(f)];case 1:return t.sent()&&l((function(e){return g(g([],e,!0),[null],!1)})),[2]}}))}))}),[f]),t.useEffect((function(){p&&(null==r||r(c.filter((function(e){return!!e}))))}),[p,r,c]),p?t.createElement(t.Fragment,null,"Thanks, your documents have been received."):t.createElement(rb,{key:d,document:f,classNames:i,verbiage:s,onComplete:function(e){l((function(t){return g(g([],t,!0),[e],!1)}))}})},cb={exports:{}},lb={exports:{}};function db(){if(tb)return eb;tb=1;var e=Jy?Ky:(Jy=1,Ky="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");function t(){}function n(){}return n.resetWarningCache=t,eb=function(){function r(t,n,r,o,i,a){if(a!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function o(){return r}r.isRequired=r;var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i}}function fb(e,t,n){this.x=e,this.y=t,this.time=n||(new Date).getTime()}function pb(e,t,n,r){this.startPoint=e,this.control1=t,this.control2=n,this.endPoint=r}function hb(e,t){var n=this,r=t||{};this.velocityFilterWeight=r.velocityFilterWeight||.7,this.minWidth=r.minWidth||.5,this.maxWidth=r.maxWidth||2.5,this.throttle="throttle"in r?r.throttle:16,this.minDistance="minDistance"in r?r.minDistance:5,this._strokeMoveUpdate=this.throttle?function(e,t,n){var r,o,i,a=null,s=0;n||(n={});var u=function(){s=!1===n.leading?0:Date.now(),a=null,i=e.apply(r,o),a||(r=o=null)};return function(){var c=Date.now();s||!1!==n.leading||(s=c);var l=t-(c-s);return r=this,o=arguments,l<=0||l>t?(a&&(clearTimeout(a),a=null),s=c,i=e.apply(r,o),a||(r=o=null)):a||!1===n.trailing||(a=setTimeout(u,l)),i}}(hb.prototype._strokeUpdate,this.throttle):hb.prototype._strokeUpdate,this.dotSize=r.dotSize||function(){return(this.minWidth+this.maxWidth)/2},this.penColor=r.penColor||"black",this.backgroundColor=r.backgroundColor||"rgba(0,0,0,0)",this.onBegin=r.onBegin,this.onEnd=r.onEnd,this._canvas=e,this._ctx=e.getContext("2d"),this.clear(),this._handleMouseDown=function(e){1===e.which&&(n._mouseButtonDown=!0,n._strokeBegin(e))},this._handleMouseMove=function(e){n._mouseButtonDown&&n._strokeMoveUpdate(e)},this._handleMouseUp=function(e){1===e.which&&n._mouseButtonDown&&(n._mouseButtonDown=!1,n._strokeEnd(e))},this._handleTouchStart=function(e){1===e.targetTouches.length&&n._strokeBegin(e.changedTouches[0])},this._handleTouchMove=function(e){e.preventDefault(),n._strokeMoveUpdate(e.targetTouches[0])},this._handleTouchEnd=function(e){e.target===n._canvas&&(e.preventDefault(),n._strokeEnd(e))},this.on()}fb.prototype.velocityFrom=function(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):1},fb.prototype.distanceTo=function(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))},fb.prototype.equals=function(e){return this.x===e.x&&this.y===e.y&&this.time===e.time},pb.prototype.length=function(){for(var e=0,t=void 0,n=void 0,r=0;r<=10;r+=1){var o=r/10,i=this._point(o,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),a=this._point(o,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(r>0){var s=i-t,u=a-n;e+=Math.sqrt(s*s+u*u)}t=i,n=a}return e},pb.prototype._point=function(e,t,n,r,o){return t*(1-e)*(1-e)*(1-e)+3*n*(1-e)*(1-e)*e+3*r*(1-e)*e*e+o*e*e*e},hb.prototype.clear=function(){var e=this._ctx,t=this._canvas;e.fillStyle=this.backgroundColor,e.clearRect(0,0,t.width,t.height),e.fillRect(0,0,t.width,t.height),this._data=[],this._reset(),this._isEmpty=!0},hb.prototype.fromDataURL=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new Image,o=n.ratio||window.devicePixelRatio||1,i=n.width||this._canvas.width/o,a=n.height||this._canvas.height/o;this._reset(),r.src=e,r.onload=function(){t._ctx.drawImage(r,0,0,i,a)},this._isEmpty=!1},hb.prototype.toDataURL=function(e){var t;if("image/svg+xml"===e)return this._toSVG();for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return(t=this._canvas).toDataURL.apply(t,[e].concat(r))},hb.prototype.on=function(){this._handleMouseEvents(),this._handleTouchEvents()},hb.prototype.off=function(){this._canvas.removeEventListener("mousedown",this._handleMouseDown),this._canvas.removeEventListener("mousemove",this._handleMouseMove),document.removeEventListener("mouseup",this._handleMouseUp),this._canvas.removeEventListener("touchstart",this._handleTouchStart),this._canvas.removeEventListener("touchmove",this._handleTouchMove),this._canvas.removeEventListener("touchend",this._handleTouchEnd)},hb.prototype.isEmpty=function(){return this._isEmpty},hb.prototype._strokeBegin=function(e){this._data.push([]),this._reset(),this._strokeUpdate(e),"function"==typeof this.onBegin&&this.onBegin(e)},hb.prototype._strokeUpdate=function(e){var t=this._createPoint(e.clientX,e.clientY),n=this._data[this._data.length-1],r=n&&n[n.length-1],o=r&&t.distanceTo(r)<this.minDistance;if(!r||!o){var i=this._addPoint(t),a=i.curve,s=i.widths;a&&s&&this._drawCurve(a,s.start,s.end),this._data[this._data.length-1].push({x:t.x,y:t.y,time:t.time,color:this.penColor})}},hb.prototype._strokeEnd=function(e){var t=this.points[0];if(!(this.points.length>2)&&t&&this._drawDot(t),t){var n=this._data[this._data.length-1];t.equals(n[n.length-1])||n.push({x:t.x,y:t.y,time:t.time,color:this.penColor})}"function"==typeof this.onEnd&&this.onEnd(e)},hb.prototype._handleMouseEvents=function(){this._mouseButtonDown=!1,this._canvas.addEventListener("mousedown",this._handleMouseDown),this._canvas.addEventListener("mousemove",this._handleMouseMove),document.addEventListener("mouseup",this._handleMouseUp)},hb.prototype._handleTouchEvents=function(){this._canvas.style.msTouchAction="none",this._canvas.style.touchAction="none",this._canvas.addEventListener("touchstart",this._handleTouchStart),this._canvas.addEventListener("touchmove",this._handleTouchMove),this._canvas.addEventListener("touchend",this._handleTouchEnd)},hb.prototype._reset=function(){this.points=[],this._lastVelocity=0,this._lastWidth=(this.minWidth+this.maxWidth)/2,this._ctx.fillStyle=this.penColor},hb.prototype._createPoint=function(e,t,n){var r=this._canvas.getBoundingClientRect();return new fb(e-r.left,t-r.top,n||(new Date).getTime())},hb.prototype._addPoint=function(e){var t=this.points,n=void 0;if(t.push(e),t.length>2){3===t.length&&t.unshift(t[0]);var r=(n=this._calculateCurveControlPoints(t[0],t[1],t[2])).c2;n=this._calculateCurveControlPoints(t[1],t[2],t[3]);var o=new pb(t[1],r,n.c1,t[2]),i=this._calculateCurveWidths(o);return t.shift(),{curve:o,widths:i}}return{}},hb.prototype._calculateCurveControlPoints=function(e,t,n){var r=e.x-t.x,o=e.y-t.y,i=t.x-n.x,a=t.y-n.y,s=(e.x+t.x)/2,u=(e.y+t.y)/2,c=(t.x+n.x)/2,l=(t.y+n.y)/2,d=Math.sqrt(r*r+o*o),f=Math.sqrt(i*i+a*a),p=f/(d+f),h=t.x-(c+(s-c)*p),m=t.y-(l+(u-l)*p);return{c1:new fb(s+h,u+m),c2:new fb(c+h,l+m)}},hb.prototype._calculateCurveWidths=function(e){var t={start:null,end:null},n=this.velocityFilterWeight*e.endPoint.velocityFrom(e.startPoint)+(1-this.velocityFilterWeight)*this._lastVelocity,r=this._strokeWidth(n);return t.start=this._lastWidth,t.end=r,this._lastVelocity=n,this._lastWidth=r,t},hb.prototype._strokeWidth=function(e){return Math.max(this.maxWidth/(e+1),this.minWidth)},hb.prototype._drawPoint=function(e,t,n){var r=this._ctx;r.moveTo(e,t),r.arc(e,t,n,0,2*Math.PI,!1),this._isEmpty=!1},hb.prototype._drawCurve=function(e,t,n){var r=this._ctx,o=n-t,i=Math.floor(e.length());r.beginPath();for(var a=0;a<i;a+=1){var s=a/i,u=s*s,c=u*s,l=1-s,d=l*l,f=d*l,p=f*e.startPoint.x;p+=3*d*s*e.control1.x,p+=3*l*u*e.control2.x;var h=f*e.startPoint.y;h+=3*d*s*e.control1.y,h+=3*l*u*e.control2.y,this._drawPoint(p+=c*e.endPoint.x,h+=c*e.endPoint.y,t+c*o)}r.closePath(),r.fill()},hb.prototype._drawDot=function(e){var t=this._ctx,n="function"==typeof this.dotSize?this.dotSize():this.dotSize;t.beginPath(),this._drawPoint(e.x,e.y,n),t.closePath(),t.fill()},hb.prototype._fromData=function(e,t,n){for(var r=0;r<e.length;r+=1){var o=e[r];if(o.length>1)for(var i=0;i<o.length;i+=1){var a=o[i],s=new fb(a.x,a.y,a.time),u=a.color;if(0===i)this.penColor=u,this._reset(),this._addPoint(s);else if(i!==o.length-1){var c=this._addPoint(s),l=c.curve,d=c.widths;l&&d&&t(l,d,u)}}else this._reset(),n(o[0])}},hb.prototype._toSVG=function(){var e=this,t=this._data,n=this._canvas,r=Math.max(window.devicePixelRatio||1,1),o=n.width/r,i=n.height/r,a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttributeNS(null,"width",n.width),a.setAttributeNS(null,"height",n.height),this._fromData(t,(function(e,t,n){var r=document.createElement("path");if(!(isNaN(e.control1.x)||isNaN(e.control1.y)||isNaN(e.control2.x)||isNaN(e.control2.y))){var o="M "+e.startPoint.x.toFixed(3)+","+e.startPoint.y.toFixed(3)+" C "+e.control1.x.toFixed(3)+","+e.control1.y.toFixed(3)+" "+e.control2.x.toFixed(3)+","+e.control2.y.toFixed(3)+" "+e.endPoint.x.toFixed(3)+","+e.endPoint.y.toFixed(3);r.setAttribute("d",o),r.setAttribute("stroke-width",(2.25*t.end).toFixed(3)),r.setAttribute("stroke",n),r.setAttribute("fill","none"),r.setAttribute("stroke-linecap","round"),a.appendChild(r)}}),(function(t){var n=document.createElement("circle"),r="function"==typeof e.dotSize?e.dotSize():e.dotSize;n.setAttribute("r",r),n.setAttribute("cx",t.x),n.setAttribute("cy",t.y),n.setAttribute("fill",t.color),a.appendChild(n)}));var s='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 '+o+" "+i+'" width="'+o+'" height="'+i+'">',u=a.innerHTML;if(void 0===u){var c=document.createElement("dummy"),l=a.childNodes;c.innerHTML="";for(var d=0;d<l.length;d+=1)c.appendChild(l[d].cloneNode(!0));u=c.innerHTML}return"data:image/svg+xml;base64,"+btoa(s+u+"</svg>")},hb.prototype.fromData=function(e){var t=this;this.clear(),this._fromData(e,(function(e,n){return t._drawCurve(e,n.start,n.end)}),(function(e){return t._drawDot(e)})),this._data=e},hb.prototype.toData=function(){return this._data};var mb,gb=q(Object.freeze({__proto__:null,default:hb})),vb={exports:{}};function yb(){return mb||(mb=1,function(e){e.exports=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t){function n(e){var t=e.getContext("2d"),n=e.width,r=e.height,o=t.getImageData(0,0,n,r).data,s=i(!0,n,r,o),u=i(!1,n,r,o),c=a(!0,n,r,o),l=a(!1,n,r,o)-c+1,d=u-s+1,f=t.getImageData(c,s,l,d);return e.width=l,e.height=d,t.clearRect(0,0,l,d),t.putImageData(f,0,0),e}function r(e,t,n,r){return{red:r[4*(n*t+e)],green:r[4*(n*t+e)+1],blue:r[4*(n*t+e)+2],alpha:r[4*(n*t+e)+3]}}function o(e,t,n,o){return r(e,t,n,o).alpha}function i(e,t,n,r){for(var i=e?1:-1,a=e?0:n-1;e?a<n:a>-1;a+=i)for(var s=0;s<t;s++)if(o(s,a,t,r))return a;return null}function a(e,t,n,r){for(var i=e?1:-1,a=e?0:t-1;e?a<t:a>-1;a+=i)for(var s=0;s<n;s++)if(o(a,s,t,r))return a;return null}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n}])}(vb)),vb.exports}!function(e){e.exports=function(e,t,n,r){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=r(n(1)),d=n(2),f=r(d),p=r(n(3)),h=r(n(4)),m=function(e){function t(){var e,n,r;i(this,t);for(var s=arguments.length,u=Array(s),c=0;c<s;c++)u[c]=arguments[c];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r._sigPad=null,r._excludeOurProps=function(){var e=r.props;return o(e,["canvasProps","clearOnResize"])},r.getCanvas=function(){return r._canvas},r.getTrimmedCanvas=function(){var e=document.createElement("canvas");return e.width=r._canvas.width,e.height=r._canvas.height,e.getContext("2d").drawImage(r._canvas,0,0),(0,h.default)(e)},r.getSignaturePad=function(){return r._sigPad},r._checkClearOnResize=function(){r.props.clearOnResize&&r._resizeCanvas()},r._resizeCanvas=function(){var e=r.props.canvasProps||{},t=e.width,n=e.height;if(!t||!n){var o=r._canvas,i=Math.max(window.devicePixelRatio||1,1);t||(o.width=o.offsetWidth*i),n||(o.height=o.offsetHeight*i),o.getContext("2d").scale(i,i),r.clear()}},r.on=function(){return window.addEventListener("resize",r._checkClearOnResize),r._sigPad.on()},r.off=function(){return window.removeEventListener("resize",r._checkClearOnResize),r._sigPad.off()},r.clear=function(){return r._sigPad.clear()},r.isEmpty=function(){return r._sigPad.isEmpty()},r.fromDataURL=function(e,t){return r._sigPad.fromDataURL(e,t)},r.toDataURL=function(e,t){return r._sigPad.toDataURL(e,t)},r.fromData=function(e){return r._sigPad.fromData(e)},r.toData=function(){return r._sigPad.toData()},a(r,n)}return s(t,e),c(t,[{key:"componentDidMount",value:function(){this._sigPad=new p.default(this._canvas,this._excludeOurProps()),this._resizeCanvas(),this.on()}},{key:"componentWillUnmount",value:function(){this.off()}},{key:"componentDidUpdate",value:function(){Object.assign(this._sigPad,this._excludeOurProps())}},{key:"render",value:function(){var e=this;return f.default.createElement("canvas",u({ref:function(t){e._canvas=t}},this.props.canvasProps))}}]),t}(d.Component);m.propTypes={velocityFilterWeight:l.default.number,minWidth:l.default.number,maxWidth:l.default.number,minDistance:l.default.number,dotSize:l.default.oneOfType([l.default.number,l.default.func]),penColor:l.default.string,throttle:l.default.number,onEnd:l.default.func,onBegin:l.default.func,canvasProps:l.default.object,clearOnResize:l.default.bool},m.defaultProps={clearOnResize:!0},t.default=m},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t){e.exports=r}])}((nb||(nb=1,lb.exports=db()()),lb.exports),t,gb,yb())}(cb);var bb=W(cb.exports);function xb(e){var t,n=null!==(t=e.toDataURL())&&void 0!==t?t:null,r={clickX_simple:[],clickY_simple:[],time_simple:[],pressure:"",fileContent:n?E(n):""};return e.toData().forEach((function(e){var t=[],n=[],o=[];e.forEach((function(e){t.push(e.x),n.push(e.y),o.push(new Date(e.time).toString())})),r.clickX_simple.push(t),r.clickY_simple.push(n),r.time_simple.push(o)})),r}var Cb,wb,Eb,kb,Db,Mb,Tb,Ib,Sb,Nb,Ab,Lb,Ob,Rb,Fb,Pb,Ub,_b,jb,Bb,zb,Gb,Vb,Wb,qb,Hb,Yb,Zb,Qb,$b,Xb,Kb,Jb,ex,tx,nx,rx,ox,ix,ax,sx=o.div(Cb||(Cb=v(["\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n ","\n ","\n ","\n"],["\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n ","\n ","\n ","\n"])),(function(e){var t,n;return(null===(t=e.theme.signatureCapture)||void 0===t?void 0:t.background)?"background: ".concat(null===(n=e.theme.signatureCapture)||void 0===n?void 0:n.background,";"):""}),(function(e){var t,n;return(null===(t=e.theme.signatureCapture)||void 0===t?void 0:t.backgroundSize)?"background-size: ".concat(null===(n=e.theme.signatureCapture)||void 0===n?void 0:n.backgroundSize,";"):""}),(function(e){var t,n;return(null===(t=e.theme.signatureCapture)||void 0===t?void 0:t.backgroundPosition)?"background-position: ".concat(null===(n=e.theme.signatureCapture)||void 0===n?void 0:n.backgroundPosition,";"):""})),ux=o.div(wb||(wb=v(["\n position: absolute;\n top: 25%;\n left: 15%;\n width: 70%;\n height: 50%;\n\n @media (max-width: 800px) {\n top: 15%;\n left: 2%;\n width: 96%;\n height: 70%;\n }\n"],["\n position: absolute;\n top: 25%;\n left: 15%;\n width: 70%;\n height: 50%;\n\n @media (max-width: 800px) {\n top: 15%;\n left: 2%;\n width: 96%;\n height: 70%;\n }\n"]))),cx=o.div(Eb||(Eb=v(["\n position: relative;\n background: ",";\n border: ",";\n border-radius: ",";\n flex-grow: 1;\n z-index: 100;\n height: 100%;\n"],["\n position: relative;\n background: ",";\n border: ",";\n border-radius: ",";\n flex-grow: 1;\n z-index: 100;\n height: 100%;\n"])),(function(e){var t,n,r;return null!==(r=null===(n=null===(t=e.theme.signatureCapture)||void 0===t?void 0:t.canvas)||void 0===n?void 0:n.background)&&void 0!==r?r:"rgba(255, 255, 255, 0.5)"}),(function(e){var t,n,r;return null!==(r=null===(n=null===(t=e.theme.signatureCapture)||void 0===t?void 0:t.canvas)||void 0===n?void 0:n.border)&&void 0!==r?r:"1px solid #dedede"}),(function(e){var t,n,r;return null!==(r=null===(n=null===(t=e.theme.signatureCapture)||void 0===t?void 0:t.canvas)||void 0===n?void 0:n.borderRadius)&&void 0!==r?r:"16px"})),lx=o(Dh)(kb||(kb=v(["\n flex-grow: 0;\n padding-top: 12px;\n display: flex;\n z-index: 1000;\n position: relative;\n"],["\n flex-grow: 0;\n padding-top: 12px;\n display: flex;\n z-index: 1000;\n position: relative;\n"]))),dx=function(e){var n,r=e.onAccept,o=e.classNames,i=void 0===o?{}:o,a=e.verbiage,s=void 0===a?{}:a,u=ze(),c=u.ref,l=u.width,d=u.height,f=t.useRef(null),p=rh(s,{headingText:"Please sign the box below",acceptBtnText:"Accept",clearBtnText:"Clear"});return t.createElement(O,{className:i.container},t.createElement(sx,{className:i.inner},t.createElement(ph,{className:i.guidanceMessageContainer,$top:"5vh"},t.createElement(hh,{className:i.guidanceMessage},p.headingText)),t.createElement(ux,{className:i.canvasContainer},t.createElement(cx,{ref:c,className:i.canvasInner},t.createElement(bb,{ref:f,canvasProps:{width:l,height:d,className:i.canvas}})),t.createElement(lx,{className:i.buttonsRow},t.createElement(le,{variant:"secondary",className:i.clearBtn,onClick:null===(n=f.current)||void 0===n?void 0:n.clear,finished:!0},p.clearBtnText),t.createElement(fx,{variant:"positive",className:i.acceptBtn,onClick:function(){if(f.current){var e=xb(f.current);null==r||r(e,f.current.toDataURL())}},finished:!0},p.acceptBtnText)))))},fx=o(le)(Db||(Db=v(["\n margin-left: auto;\n"],["\n margin-left: auto;\n"]))),px=function(e,n,r){void 0===r&&(r=!1);var o=t.useRef(null),i=t.useRef(null),a=t.useRef([]),s=t.useRef([]),u=t.useState(null),c=u[0],l=u[1],d=t.useState(null),f=d[0],p=d[1],h=t.useState(!1),m=h[0],v=h[1],y=t.useState(!1),b=y[0],x=y[1],C=t.useState(!1),w=C[0],E=C[1],k=t.useState(!1),D=k[0],M=k[1],T=t.useState(!1),I=T[0],S=T[1],N=t.useState(!1),A=N[0],L=N[1],O=t.useCallback((function(){var t,o,i;if(!r)return null==e?void 0:e.stream;var a=null!==(o=null===(t=null==e?void 0:e.stream)||void 0===t?void 0:t.getTracks())&&void 0!==o?o:[],s=null!==(i=null==n?void 0:n.getTracks())&&void 0!==i?i:[];return new MediaStream(g(g([],a,!0),s,!0))}),[n,null==e?void 0:e.stream,r]),R=t.useCallback((function(){var t=new Blob(a.current,{type:"video/mp4"});a.current=[],l(URL.createObjectURL(t)),v(!1),null==e||e.release()}),[e]),F=t.useCallback((function(){var e,t=new Blob(s.current,{type:"audio/mp4"});s.current=[],p(URL.createObjectURL(t)),x(!1),null===(e=null==n?void 0:n.stop)||void 0===e||e.call(n)}),[n]),P=t.useCallback((function(){var e=O();e&&(a.current=[],v(!0),E(!1),S(!1),o.current=new MediaRecorder(e,{videoBitsPerSecond:27e4,audioBitsPerSecond:32e3}),o.current.ondataavailable=function(e){a.current.push(e.data)},o.current.onstop=function(){E(!0)},o.current.start(1e3),setTimeout((function(){var e;"inactive"===(null===(e=o.current)||void 0===e?void 0:e.state)&&Oe("media recorder is inactive!")}),100))}),[O]),U=t.useCallback((function(){r||n&&(s.current=[],x(!0),M(!1),L(!1),i.current=new MediaRecorder(n,{audioBitsPerSecond:32e3}),i.current.ondataavailable=function(e){s.current.push(e.data)},i.current.onstop=function(){M(!0)},i.current.start(1e3))}),[n,r]),_=t.useCallback((function(){var e,t;S(!0),"inactive"!==(null===(e=o.current)||void 0===e?void 0:e.state)&&(null===(t=o.current)||void 0===t||t.stop())}),[]),j=t.useCallback((function(){var e,t;L(!0),"inactive"!==(null===(e=i.current)||void 0===e?void 0:e.state)&&(null===(t=i.current)||void 0===t||t.stop())}),[]);return t.useEffect((function(){w&&I&&R()}),[R,I,w]),t.useEffect((function(){D&&A&&F()}),[A,D,F]),{isRecordingVideo:m,isRecordingAudio:b,startRecordingVideo:P,startRecordingAudio:U,stopRecordingVideo:_,stopRecordingAudio:j,videoRecordingUnintentionallyStopped:w&&!I,audioRecordingUnintentionallyStopped:D&&!A,videoUrl:c,audioUrl:f}},hx=function(e){var n,r,o,i,a=e.onVideoCaptured,s=e.onFaceNotDetected,u=e.onExit,c=e.classNames,l=void 0===c?{}:c,d=e.colors,f=void 0===d?{}:d,p=e.verbiage,v=void 0===p?{}:p,y=e.debugMode,b=void 0!==y&&y,x=t.useContext(nt),C=x.cameraRef,w=x.videoRef,E=ze(),k=E.ref,D=E.width,M=E.height,T=t.useRef(null),I=t.useRef(null),S=t.useRef([]),N=t.useContext(Dv).onPredictionMade,A=px(C.current),L=A.isRecordingVideo,R=A.startRecordingVideo,F=A.stopRecordingVideo,P=A.videoUrl,U=t.useState(null),_=U[0],j=U[1],B=t.useState(null),z=B[0],G=B[1],V=t.useState(null),W=V[0],q=V[1];f.guidanceMessageBackgroundColor||(f.guidanceMessageBackgroundColor="#ccc"),f.guidanceMessageTextColor||(f.guidanceMessageTextColor="black");var H=rh(v,{guidanceMessageText:"Please sign the box below",acceptBtnText:"Accept",clearBtnText:"Clear"}),Y=t.useRef(null),Z=t.useRef(!1);t.useEffect((function(){Z.current||(Z.current=!0,h(void 0,void 0,void 0,(function(){var e;return m(this,(function(t){switch(t.label){case 0:return Y.current?[3,2]:[4,new Promise((function(e){var t=setInterval((function(){Y.current&&(clearInterval(t),e(null))}),10)}))];case 1:t.sent(),t.label=2;case 2:return R(),e=Y.current.captureStream(24),I.current=new MediaRecorder(e,{videoBitsPerSecond:27e4}),I.current.start(),I.current.ondataavailable=function(e){var t;S.current.push(e.data),"recording"===(null===(t=I.current)||void 0===t?void 0:t.state)&&I.current.stop()},I.current.onstop=function(){var e=new Blob(S.current,{type:"video/mp4"});q(e)},[2]}}))})))}),[L,R,P]),t.useEffect((function(){W&&_&&z&&(null==a||a(W,_,z))}),[a,_,z,W]);var Q=t.useRef(0);t.useEffect((function(){var e;if(T.current&&w.current&&Y.current&&C.current&&L){var t=[C.current.width,C.current.height],n=t[0],r=t[1],o="undefined"!=typeof window&&window.innerWidth<window.innerHeight;o&&n>r&&(n=(e=[r,n])[0],r=e[1]),Y.current.width=n,Y.current.height=r;var i=Y.current.getContext("2d");if(i)return Q.current=requestAnimationFrame((function e(){return h(this,void 0,void 0,(function(){var t;return m(this,(function(a){return T.current&&w.current&&Y.current?(t=[n*(o?.02:.15),r*(o?.15:.25),n*(o?.96:.7),r*(o?.7:.5)],i.drawImage(w.current,0,0,n,r),i.beginPath(),i.fillStyle="rgba(255,255,255,0.5)",i.roundRect.apply(i,g(g([],t,!1),[16],!1)),i.fill(),i.drawImage.apply(i,g([T.current.getCanvas()],t,!1)),Q.current=requestAnimationFrame(e),[2]):(cancelAnimationFrame(Q.current),[2])}))}))})),function(){cancelAnimationFrame(Q.current)}}}),[C,L,s,w]);var $=t.useState(0),X=$[0],K=$[1];return t.useEffect((function(){N((function(e){K((function(t){return 0===e.length?t+1:0}))}))}),[N]),t.useEffect((function(){X>=2&&(null==s||s())}),[X,s]),t.createElement(O,{className:"flex ".concat(null!==(n=l.container)&&void 0!==n?n:"")},H.guidanceMessageText&&t.createElement(ph,{$top:"5vh",className:l.guidanceMessageContainer},t.createElement(hh,{className:l.guidanceMessage,$background:f.guidanceMessageBackgroundColor,$textColor:f.guidanceMessageTextColor},H.guidanceMessageText)),t.createElement(ux,{className:l.canvasContainer},t.createElement(cx,{ref:k,className:l.canvasInner},t.createElement(bb,{ref:T,canvasProps:{width:D,height:M,className:l.canvas}})),t.createElement(lx,{className:l.buttonsRow},t.createElement(le,{variant:"secondary",className:l.clearBtn,onClick:null===(r=T.current)||void 0===r?void 0:r.clear,finished:!0},H.clearBtnText),t.createElement(mx,{variant:"positive",className:l.acceptBtn,style:{marginLeft:"auto"},onClick:function(){if(T.current){var e=xb(T.current);j(e);var t=T.current.getCanvas(),n=600*t.height/t.width,r=T.current.getSignaturePad()._toSVG(),o=atob(r.replace("data:image/svg+xml;base64,","")).replace(/width="[0-9.]+"/,'width="600"').replace(/height="[0-9.]+"/,'height="'.concat(n,'"')).replace(/viewBox="0 0 [0-9.]+ [0-9.]+"/,'viewBox="0 0 '.concat(t.width," ").concat(t.height,'"')),i="data:image/svg+xml;base64,"+btoa(o);gx(i).then((function(e){var t;e&&G(e),F(),null===(t=I.current)||void 0===t||t.stop()}))}},finished:!0},H.acceptBtnText))),b&&t.createElement(Lf,null,"Video: ",null===(o=C.current)||void 0===o?void 0:o.width,"x",null===(i=C.current)||void 0===i?void 0:i.height),t.createElement(kh,{onClick:u,className:l.exitCaptureBtn}),t.createElement(Ve,{ref:Y}))},mx=o(le)(Mb||(Mb=v(["\n margin-left: auto;\n"],["\n margin-left: auto;\n"]))),gx=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return h(void 0,g([e],t,!0),void 0,(function(e,t){var n,r,o;return void 0===t&&(t="jpeg"),m(this,(function(i){switch(i.label){case 0:return[4,(a=e,h(void 0,void 0,void 0,(function(){var e;return m(this,(function(t){return(e=document.createElement("img")).src=a,[2,new Promise((function(t,n){e.onload=function(){return t(e)},e.onerror=n}))]}))})))];case 1:return n=i.sent(),(r=document.createElement("canvas")).width=n.naturalWidth,r.height=n.naturalHeight,(o=r.getContext("2d"))?(o.fillStyle="white",o.fillRect(0,0,r.width,r.height),o.drawImage(n,0,0,n.naturalWidth,n.naturalHeight),[2,r.toDataURL("image/".concat(t),1)]):[2]}var a}))}))},vx=function(e){var n=e.videoUrl,r=e.onDoneClick,o=e.onRetryClick,i=e.classNames,a=void 0===i?{}:i,s=e.colors,u=void 0===s?{}:s,c=e.verbiage,l=rh(void 0===c?{}:c,{headingText:"Video signature has been successfully captured!",retryBtnText:"Retry",doneBtnText:"Done"});return t.createElement(_,{className:a.container},t.createElement(j,{className:a.inner},t.createElement("h1",{className:a.heading},l.headingText),t.createElement(B,{className:a.videoContainer},t.createElement(yx,{className:a.video,src:n,poster:n+"#t=0.1",controls:!0,preload:"metadata",autoPlay:!0})),t.createElement(Dh,{className:a.buttonsRow},t.createElement(le,{variant:"warning",className:a.retryBtn,onClick:o,colors:u.retryBtn,finished:!0},l.retryBtnText),t.createElement(le,{variant:"positive",className:a.doneBtn,onClick:r,colors:u.doneBtn,finished:!0},l.doneBtnText))))},yx=o.video(Tb||(Tb=v(["\n margin-left: auto;\n margin-right: auto;\n max-width: 100%;\n"],["\n margin-left: auto;\n margin-right: auto;\n max-width: 100%;\n"]))),bx=function(e){var n,r=e.onComplete,o=e.onVideoCaptured,i=e.onRetryClicked,a=e.onExitCapture,s=e.onUserCancel,u=e.loadingOverlayMode,c=void 0===u?"default":u,l=e.skipSuccessScreen,d=void 0!==l&&l,f=e.assets,p=void 0===f?{}:f,g=e.classNames,v=void 0===g?{}:g,y=e.colors,b=void 0===y?{}:y,x=e.verbiage,C=void 0===x?{}:x,E=e.debugMode,k=void 0!==E&&E,D=t.useContext(_e),M=D.selfieImage,T=D.signatureVideoUrl,I=D.setSelfieImage,S=D.setSignatureData,N=D.setSignatureVideoUrl,A=D.logSelfieCaptureAttempt,L=t.useContext(nt),R=L.cameraAccessDenied,F=L.requestCameraAccess,P=L.releaseCameraAccess,U=t.useState("LOADING"),_=U[0],j=U[1],B=t.useRef(),z=t.useRef(),G=t.useRef(),V=t.useContext(Dv),W=V.start,q=V.stop;t.useEffect((function(){B.current=new Date}),[]),t.useEffect((function(){"CHECKING_LIVENESS"===_&&(z.current=new Date)}),[_]);var H=["CHECKING_LIVENESS","CAPTURING_SIGNATURE"].includes(_);t.useEffect((function(){if(H)return W(),function(){q()}}),[H,W,q]);var Y=t.useCallback((function(){var e,t,n;A({autoCapture:"Y",captureTime:(null!==(e=G.current)&&void 0!==e?e:new Date).getTime()-(null!==(t=z.current)&&void 0!==t?t:new Date).getTime(),operationTime:(new Date).getTime()-(null!==(n=B.current)&&void 0!==n?n:new Date).getTime()}),B.current=new Date}),[A]),Z=t.useCallback((function(){j("CHECKING_LIVENESS")}),[]),Q=t.useCallback((function(e){return h(void 0,void 0,void 0,(function(){var t;return m(this,(function(n){switch(n.label){case 0:return j("CAPTURING_SIGNATURE"),Y(),M?[3,2]:(t=I,[4,w(e)]);case 1:t.apply(void 0,[n.sent()]),n.label=2;case 2:return[2]}}))}))}),[Y,M,I]),$=t.useState(null),X=$[0],K=$[1],J=t.useCallback((function(e,t,n){S(t),N(URL.createObjectURL(e)),j("SUCCESS"),K(n),null==o||o(e,t,n)}),[o,S,N]),ee=t.useCallback((function(){j("CHECKING_LIVENESS")}),[]),te=t.useState(0),ne=te[0],re=te[1],oe=t.useCallback((function(){P(),re((function(e){return e+1})),j("LOADING"),null==a||a(),F()}),[a,P,F]),ie=t.useCallback((function(){null==i||i(),oe()}),[oe,i]),ae=jm(d,"SUCCESS"===_,r);return t.useEffect((function(){R&&(re((function(e){return e+1})),j("LOADING"))}),[R]),t.createElement(t.Fragment,null,t.createElement(O,{className:"flex ".concat(null!==(n=null==v?void 0:v.container)&&void 0!==n?n:"")},t.createElement(Um,{className:v.cameraFeed}),"LOADING"!==_&&function(){switch(_){case"CHECKING_LIVENESS":return t.createElement(Kv,{onSuccess:Q,onExit:oe,classNames:v.faceLiveness,colors:b.faceLiveness,verbiage:C.faceLiveness,debugMode:k});case"CAPTURING_SIGNATURE":return t.createElement(hx,{onVideoCaptured:J,onFaceNotDetected:ee,onExit:oe,classNames:v,colors:b,verbiage:C,debugMode:k});case"SUCCESS":if(!ae)return;return t.createElement(t.Fragment,null,t.createElement(vx,{videoUrl:null!=T?T:"",onDoneClick:r,onRetryClick:ie,classNames:v.success,colors:b.success,verbiage:C.success}),X&&t.createElement("img",{src:X,alt:""}));default:return null}}()),t.createElement(Vy,{key:ne,mode:c,assets:p.loadingOverlay,classNames:v.loadingOverlay,colors:b.loadingOverlay,verbiage:C.loadingOverlay,onDismissed:Z,onUserCancel:s}))},xx=function(e){var n,r=e.className,o=e.imageWidth,i=e.imageHeight,a=e.borderWidth,s=void 0===a?4:a,u=e.assets,c=void 0===u?{}:u,l=t.useContext(nt).cameraRef;c.frontImageUrl||(c.frontImageUrl="".concat(mh,"/Shieldout-IDCard-Front-SVG-Landscape-2.svg")),c.backImageUrl||(c.backImageUrl="".concat(mh,"/Shieldout-IDCard-Back-SVG-Landscape-2.svg"));var d=!(null===(n=l.current)||void 0===n?void 0:n.isRearFacing),f=t.useState(1),p=f[0],h=f[1],m=t.useState(0),g=m[0],v=m[1],y=["rotateY(".concat(g,"deg)")];d&&y.push("scaleX(-1)");var b=["rotateY(".concat(180-g,"deg)")];return d&&b.push("scaleX(-1)"),t.useEffect((function(){var e;function t(){h(1),v(180),e=setTimeout((function(){h(0),v(0)}),1500)}var n=setInterval(t,2500);return e=setTimeout(t,250),function(){clearInterval(n),clearTimeout(e)}}),[]),t.createElement(t.Fragment,null,t.createElement(Cx,{src:c.frontImageUrl,alt:"",className:r,$transforms:y.join(" "),$transitionTime:p,$borderWidth:s,$imageWidth:o,$imageHeight:i}),t.createElement(Cx,{src:c.backImageUrl,alt:"",className:r,$transforms:b.join(" "),$transitionTime:p,$borderWidth:s,$imageWidth:o,$imageHeight:i,$isBack:!0}))},Cx=o.img(Ib||(Ib=v(["\n backface-visibility: hidden;\n transition: transform ","s;\n transform: ",";\n transform-style: preserve-3d;\n position: ",";\n display: block;\n top: ","px;\n width: ","px;\n height: ","px;\n"],["\n backface-visibility: hidden;\n transition: transform ","s;\n transform: ",";\n transform-style: preserve-3d;\n position: ",";\n display: block;\n top: ","px;\n width: ","px;\n height: ","px;\n"])),(function(e){return e.$transitionTime}),(function(e){return e.$transforms}),(function(e){return e.$isBack?"absolute":"relative"}),(function(e){return-e.$borderWidth/2}),(function(e){return e.$imageWidth}),(function(e){return e.$imageHeight+e.$borderWidth})),wx=function(e){var n,r,i,a,s,u,c,l,d,f,p,h,m,g,v,y,b,x,C,w,E,k=e.requestedAction,D=void 0===k?"SHOW_ID_FRONT":k,M=e.satisfied,T=void 0!==M&&M,I=e.faceGuideBorderWidth,S=e.faceGuideBorderColor,N=e.idCardGuideBorderWidth,A=e.idCardGuideBorderColor,L=e.assets,O=void 0===L?{}:L,R=e.classNames,F=void 0===R?{}:R,P=e.verbiage,U=void 0===P?{}:P,_=t.useContext(nt).cameraRef,j=t.useRef(null),B=t.useState(0),z=B[0],G=B[1],V=t.useState(0),W=V[0],q=V[1];O.frontImageUrl||(O.frontImageUrl="".concat(mh,"/Shieldout-IDCard-Front-SVG-Landscape-2.svg")),O.backImageUrl||(O.backImageUrl="".concat(mh,"/Shieldout-IDCard-Back-SVG-Landscape-2.svg"));var H=rh(U,{idFrontInstructionText:"Display the front of your ID card...",idBackInstructionText:"Display the back of your ID card...",flipIdInstructionText:"Please flip your ID card..."}),Y="SHOW_ID_FRONT"===D?H.idFrontInstructionText:"FLIP_ID"===D?H.flipIdInstructionText:H.idBackInstructionText,Z=o.useTheme();void 0===I&&(I=null!==(i=null===(r=null===(n=Z.idVideoCapture)||void 0===n?void 0:n.faceGuides)||void 0===r?void 0:r.borderWidth)&&void 0!==i?i:4),void 0===S&&(S=null!==(l=T?null===(s=null===(a=Z.idVideoCapture)||void 0===a?void 0:a.faceGuides)||void 0===s?void 0:s.satisfiedColor:null===(c=null===(u=Z.idVideoCapture)||void 0===u?void 0:u.faceGuides)||void 0===c?void 0:c.unsatisfiedColor)&&void 0!==l?l:"white"),void 0===N&&(N=null!==(p=null===(f=null===(d=Z.idVideoCapture)||void 0===d?void 0:d.idCardGuides)||void 0===f?void 0:f.borderWidth)&&void 0!==p?p:4),void 0===A&&(A=null!==(y=T?null===(m=null===(h=Z.idVideoCapture)||void 0===h?void 0:h.idCardGuides)||void 0===m?void 0:m.satisfiedColor:null===(v=null===(g=Z.idVideoCapture)||void 0===g?void 0:g.idCardGuides)||void 0===v?void 0:v.unsatisfiedColor)&&void 0!==y?y:"white");var Q=function(){var e,t,n,r;z||G(null!==(t=null===(e=j.current)||void 0===e?void 0:e.width)&&void 0!==t?t:0),W||q(null!==(r=null===(n=j.current)||void 0===n?void 0:n.height)&&void 0!==r?r:0)};return t.createElement(Ex,{className:F.container},t.createElement(kx,{className:F.faceGuide,$borderWidth:I,$borderColor:S}),t.createElement(Dx,{className:F.idCardGuideContainer},t.createElement(Mx,{className:F.idCardGuideInstructionsContainer},t.createElement(Tx,{className:F.idCardGuideInstructions,$textColor:null===(x=null===(b=Z.idVideoCapture)||void 0===b?void 0:b.idCardGuides)||void 0===x?void 0:x.instructionsTextColor,$background:null===(w=null===(C=Z.idVideoCapture)||void 0===C?void 0:C.idCardGuides)||void 0===w?void 0:w.instructionsBackgroundColor},Y)),t.createElement(Ix,{$borderWidth:N,$borderColor:A,className:F.idCardGuideImageContainer},"FLIP_ID"===D?t.createElement(xx,{assets:O,imageWidth:z,imageHeight:W,borderWidth:N,className:F.flipIdPromptImage}):t.createElement(Sx,{ref:j,src:"SHOW_ID_BACK"===D?O.backImageUrl:O.frontImageUrl,alt:"",className:F.idCardGuideImage,$isMirrored:!(null===(E=_.current)||void 0===E?void 0:E.isRearFacing),onLoad:Q,onResize:Q}))))},Ex=o.div(Sb||(Sb=v(["\n position: fixed;\n z-index: 1000;\n width: 100dvw;\n height: 100dvh;\n display: flex;\n flex-direction: column;\n font-family: ",";\n"],["\n position: fixed;\n z-index: 1000;\n width: 100dvw;\n height: 100dvh;\n display: flex;\n flex-direction: column;\n font-family: ",";\n"])),(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.fontFamily})),kx=o.div(Nb||(Nb=v(["\n border-width: ","px;\n border-color: ",";\n border-style: solid;\n border-radius: 50%;\n aspect-ratio: 1 / 1.618;\n height: 50%;\n min-height: 33dvh;\n margin: 4% auto auto;\n"],["\n border-width: ","px;\n border-color: ",";\n border-style: solid;\n border-radius: 50%;\n aspect-ratio: 1 / 1.618;\n height: 50%;\n min-height: 33dvh;\n margin: 4% auto auto;\n"])),(function(e){var t;return null!==(t=e.$borderWidth)&&void 0!==t?t:0}),(function(e){var t;return null!==(t=e.$borderColor)&&void 0!==t?t:"white"})),Dx=o.div(Ab||(Ab=v(["\n height: 50%;\n padding: 0 40px;\n display: flex;\n flex-flow: column nowrap;\n margin: 2% auto;\n"],["\n height: 50%;\n padding: 0 40px;\n display: flex;\n flex-flow: column nowrap;\n margin: 2% auto;\n"]))),Mx=o.div(Lb||(Lb=v(["\n width: 100%;\n text-align: center;\n color: white;\n display: flex;\n flex-direction: column;\n justify-content: end;\n"],["\n width: 100%;\n text-align: center;\n color: white;\n display: flex;\n flex-direction: column;\n justify-content: end;\n"]))),Tx=o(hh)(Ob||(Ob=v(["\n align-content: center;\n margin-top: 12px;\n margin-bottom: 12px;\n padding: 8px 12px;\n font-weight: bold;\n"],["\n align-content: center;\n margin-top: 12px;\n margin-bottom: 12px;\n padding: 8px 12px;\n font-weight: bold;\n"]))),Ix=o.div(Rb||(Rb=v(["\n position: relative;\n border: ","px solid\n ",";\n"],["\n position: relative;\n border: ","px solid\n ",";\n"])),(function(e){return e.$borderWidth}),(function(e){return e.$borderColor})),Sx=o.img(Fb||(Fb=v(["\n width: 100%;\n max-height: 100%;\n ","\n"],["\n width: 100%;\n max-height: 100%;\n ","\n"])),(function(e){return e.$isMirrored?"transform: scaleX(-1);":""})),Nx=function(e){var n=e.text,r=e.onComplete,o=e.durationMs,i=void 0===o?15e3:o,a=e.minReadingMs,s=void 0===a?1e4:a,u=e.classNames,c=void 0===u?{}:u,l=e.verbiage,d=void 0===l?{}:l;n=nh(n,"");var f=t.useRef(void 0),p=t.useState(i/1e3),h=p[0],m=p[1],g=rh(d,{headingText:"Please read the following text aloud",doneBtnText:"Done"}),v=t.useCallback((function(e){if(e>0){var t=e-1;m(t),f.current=setTimeout((function(){return v(t)}),1e3)}}),[]);t.useEffect((function(){return m(h),f.current=setTimeout((function(){return v(h)}),1e3),function(){clearTimeout(f.current)}}),[h,v]);var y=t.useState(!1),b=y[0],x=y[1];return t.useEffect((function(){var e=setTimeout((function(){x(!0)}),s);return function(){clearTimeout(e)}}),[s]),t.createElement(Ax,{className:c.container},t.createElement(Lx,{className:c.heading},g.headingText),t.createElement(Ox,{className:c.prompt},n),t.createElement(Rx,{className:c.buttonsRow},t.createElement(Fx,{className:c.timeRemaining},h),t.createElement(Px,{variant:"positive",className:c.doneBtn,onClick:b?r:void 0,disabled:!b,finished:!0},g.doneBtnText)))},Ax=o.div(Pb||(Pb=v(["\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n display: flex;\n flex-direction: column;\n"],["\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n display: flex;\n flex-direction: column;\n"]))),Lx=o.div(Ub||(Ub=v(["\n padding: 20px;\n font-weight: bold;\n margin: auto auto 32px;\n\n ",";\n ",";\n ",";\n"],["\n padding: 20px;\n font-weight: bold;\n margin: auto auto 32px;\n\n ",";\n ",";\n ",";\n"])),(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme.idVideoCapture)||void 0===t?void 0:t.readTextPrompt)||void 0===n?void 0:n.heading)||void 0===r?void 0:r.backgroundColor)?"background: ".concat(null===(a=null===(i=null===(o=e.theme.idVideoCapture)||void 0===o?void 0:o.readTextPrompt)||void 0===i?void 0:i.heading)||void 0===a?void 0:a.backgroundColor,";"):""}),(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme.idVideoCapture)||void 0===t?void 0:t.readTextPrompt)||void 0===n?void 0:n.heading)||void 0===r?void 0:r.textColor)?"color: ".concat(null===(a=null===(i=null===(o=e.theme.idVideoCapture)||void 0===o?void 0:o.readTextPrompt)||void 0===i?void 0:i.heading)||void 0===a?void 0:a.textColor,";"):""}),(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme.idVideoCapture)||void 0===t?void 0:t.readTextPrompt)||void 0===n?void 0:n.heading)||void 0===r?void 0:r.borderRadius)?"border-radius: ".concat(null===(a=null===(i=null===(o=e.theme.idVideoCapture)||void 0===o?void 0:o.readTextPrompt)||void 0===i?void 0:i.heading)||void 0===a?void 0:a.borderRadius,";"):""})),Ox=o.div(_b||(_b=v(["\n margin: 0 auto;\n text-align: center;\n padding: 50px;\n font-size: 24px;\n max-width: ",";\n\n ",";\n ",";\n ",";\n"],["\n margin: 0 auto;\n text-align: center;\n padding: 50px;\n font-size: 24px;\n max-width: ",";\n\n ",";\n ",";\n ",";\n"])),"undefined"!=typeof window&&window.innerWidth>window.innerHeight?"40%":"90%",(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme.idVideoCapture)||void 0===t?void 0:t.readTextPrompt)||void 0===n?void 0:n.prompt)||void 0===r?void 0:r.backgroundColor)?"background: ".concat(null===(a=null===(i=null===(o=e.theme.idVideoCapture)||void 0===o?void 0:o.readTextPrompt)||void 0===i?void 0:i.prompt)||void 0===a?void 0:a.backgroundColor,";"):""}),(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme.idVideoCapture)||void 0===t?void 0:t.readTextPrompt)||void 0===n?void 0:n.prompt)||void 0===r?void 0:r.textColor)?"color: ".concat(null===(a=null===(i=null===(o=e.theme.idVideoCapture)||void 0===o?void 0:o.readTextPrompt)||void 0===i?void 0:i.prompt)||void 0===a?void 0:a.textColor,";"):""}),(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme.idVideoCapture)||void 0===t?void 0:t.readTextPrompt)||void 0===n?void 0:n.prompt)||void 0===r?void 0:r.borderRadius)?"border-radius: ".concat(null===(a=null===(i=null===(o=e.theme.idVideoCapture)||void 0===o?void 0:o.readTextPrompt)||void 0===i?void 0:i.prompt)||void 0===a?void 0:a.borderRadius,";"):""})),Rx=o(Dh)(jb||(jb=v(["\n margin: 32px auto auto;\n gap: 20px;\n"],["\n margin: 32px auto auto;\n gap: 20px;\n"]))),Fx=o.div(Bb||(Bb=v(["\n padding: 20px;\n\n ",";\n ",";\n ",";\n"],["\n padding: 20px;\n\n ",";\n ",";\n ",";\n"])),(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme.idVideoCapture)||void 0===t?void 0:t.readTextPrompt)||void 0===n?void 0:n.timeRemaining)||void 0===r?void 0:r.backgroundColor)?"background: ".concat(null===(a=null===(i=null===(o=e.theme.idVideoCapture)||void 0===o?void 0:o.readTextPrompt)||void 0===i?void 0:i.timeRemaining)||void 0===a?void 0:a.backgroundColor,";"):""}),(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme.idVideoCapture)||void 0===t?void 0:t.readTextPrompt)||void 0===n?void 0:n.timeRemaining)||void 0===r?void 0:r.textColor)?"color: ".concat(null===(a=null===(i=null===(o=e.theme.idVideoCapture)||void 0===o?void 0:o.readTextPrompt)||void 0===i?void 0:i.timeRemaining)||void 0===a?void 0:a.textColor,";"):""}),(function(e){var t,n,r,o,i,a;return(null===(r=null===(n=null===(t=e.theme.idVideoCapture)||void 0===t?void 0:t.readTextPrompt)||void 0===n?void 0:n.timeRemaining)||void 0===r?void 0:r.borderRadius)?"border-radius: ".concat(null===(a=null===(i=null===(o=e.theme.idVideoCapture)||void 0===o?void 0:o.readTextPrompt)||void 0===i?void 0:i.timeRemaining)||void 0===a?void 0:a.borderRadius,";"):""})),Px=o(le)(zb||(zb=v(["\n margin: auto 0;\n"],["\n margin: auto 0;\n"]))),Ux=.05,_x={detection:{idCardFront:.6,idCardBack:.6,passport:1},focus:{idCardFront:{desktop:0,mobile:0},idCardBack:{desktop:0,mobile:0},passport:{desktop:0,mobile:0}},goodFrames:{idCardFront:1,idCardBack:1}},jx=function(e){var n,r,i,a,s,u,c,l,d,f,p,g,v,y,b,x,C,w,E,k=e.onComplete,D=e.onIdFrontImageCaptured,M=e.onIdBackImageCaptured,T=e.onFaceNotDetected,I=e.onRecordingFailed,S=e.onExitCapture,N=e.idCaptureModelsEnabled,A=void 0===N||N,L=e.idCardFrontDelay,R=void 0===L?1e3:L,F=e.videoIdCaptureThresholds,P=void 0===F?_x:F,U=e.skipShowIdCardBack,_=void 0!==U&&U,j=e.captureCountdownSeconds,B=void 0===j?3:j,z=e.readTextPrompt,G=e.readTextTimeoutDurationMs,V=void 0===G?15e3:G,W=e.readTextMinReadingMs,q=void 0===W?1e4:W,H=e.disableFaceDetectionWhileAudioCapture,Y=void 0!==H&&H,Z=e.disableFaceDetectionWhileAudioCaptureMsDelay,Q=void 0===Z?2e3:Z,$=e.mergeAVStreams,X=void 0!==$&&$,K=e.assets,J=void 0===K?{}:K,ee=e.classNames,te=void 0===ee?{}:ee,ne=e.colors,re=void 0===ne?{}:ne,oe=e.verbiage,ie=void 0===oe?{}:oe,ae=e.debugMode,se=void 0!==ae&&ae,ue=ze(),ce=ue.ref,le=ue.width,de=void 0===le?1:le,fe=ue.height,pe=void 0===fe?1:fe,he=t.useContext(nt),me=he.cameraRef,ge=he.videoRef,ve=he.videoLoaded,ye=he.cameraReady,be=he.microphoneReady,xe=he.audioStream,Ce=he.setVideoLoaded,we=t.useState([]),Ee=we[0],ke=we[1],De=t.useState([]),Me=De[0],Te=De[1],Ie=t.useContext(bf),Se=Ie.ready,Ne=Ie.start,Ae=Ie.stop,Le=Ie.onPredictionMade,Oe=Ie.setThresholds,Re=Ie.bestFrameDetails,Fe=Ie.resetBestFrame,Pe=Ie.modelError,Ue=t.useState(null),je=Ue[0],Be=Ue[1],Ge=t.useContext(_e),qe=Ge.setIdCaptureVideoAudioStartsAt,He=Ge.setExpectedAudioText,Ye=t.useContext(Dv),Ze=Ye.onPredictionMade,Qe=Ye.error,$e=px(me.current,xe,X),Xe=$e.isRecordingVideo,Ke=$e.startRecordingVideo,Je=$e.startRecordingAudio,et=$e.stopRecordingVideo,tt=$e.stopRecordingAudio,rt=$e.videoRecordingUnintentionallyStopped,ot=$e.audioRecordingUnintentionallyStopped,it=$e.videoUrl,at=$e.audioUrl,st=t.useRef(void 0),ut=t.useState(-1),ct=ut[0],lt=ut[1];t.useEffect((function(){Xe||it||(Ke(),Be(new Date)),it&&(!(!!z&&!X)||at)&&(Ce(!1),null==k||k(it,at))}),[at,Xe,X,k,z,Ce,Ke,it]),t.useEffect((function(){(rt||ot)&&(null==I||I())}),[ot,I,rt]);var dt=t.useState("SHOW_ID_FRONT"),ft=dt[0],pt=dt[1],ht=A&&ve&&ye&&Se&&!Pe&&"READ_TEXT"!==ft&&(!z||be);t.useEffect((function(){if(ht)return Ne(),function(){Ae()}}),[ht,Ne,Ae]),t.useEffect((function(){Oe(P)}),[ft,Oe,P]);var mt=t.useState(0),gt=mt[0],vt=mt[1],yt=t.useState(0),bt=yt[0],xt=yt[1],Ct=t.useState(0),wt=Ct[0],Et=Ct[1],kt="SHOW_ID_FRONT"===ft?P.goodFrames.idCardFront:P.goodFrames.idCardBack,Dt=wt>=kt;t.useEffect((function(){A&&!Pe&&Le((function(e){ke(e.detectedObjects),vt(e.detectionScore),xt(e.focusScore);var t=("SHOW_ID_FRONT"===ft?e.idCardFrontDetectionThresholdMet:e.idCardBackDetectionThresholdMet)&&e.focusThresholdMet;if("FLIP_ID"===ft&&t)return pt("SHOW_ID_BACK");Et(t?function(e){return e+1}:0)}))}),[A,Le,Pe,ft]);var Mt=t.useState(null),Tt=Mt[0],It=Mt[1];t.useEffect((function(){1===wt&&It((new Date).getTime())}),[wt]);var St="SHOW_ID_FRONT"!==ft||null!==Tt&&(new Date).getTime()>Tt+R,Nt=nh(z,""),At=t.useCallback((function(){var e;Nt?(pt("READ_TEXT"),Je(),qe((new Date).getTime()-(null!==(e=null==je?void 0:je.getTime())&&void 0!==e?e:0)),He(Nt)):et()}),[He,qe,Je,et,Nt,je]),Lt=null!==(r=null===(n=ge.current)||void 0===n?void 0:n.videoWidth)&&void 0!==r?r:0,Ot=null!==(a=null===(i=ge.current)||void 0===i?void 0:i.videoHeight)&&void 0!==a?a:0,Rt=null===(s=null==Me?void 0:Me[0])||void 0===s?void 0:s.box,Ft=!Rt||!Lt||Rt.xMin>Lt*Ux&&Rt.yMin>Ot*Ux&&Rt.xMax<.95*Lt&&Rt.yMax<.95*Ot,Pt=t.useState(),Ut=Pt[0],_t=Pt[1],jt=t.useRef(null),Bt=t.useRef(!1),zt=t.useCallback((function(){return h(void 0,void 0,void 0,(function(){var e;return m(this,(function(t){switch(t.label){case 0:if(Bt.current)return[2];if(Bt.current=!0,We(jt.current,ge.current),!(e=jt.current.toDataURL("image/jpeg")))return Bt.current=!1,[2];t.label=1;case 1:return t.trys.push([1,,7,8]),"SHOW_ID_FRONT"!=ft?[3,5]:(D&&D(e),_?!0!==_?[3,2]:[2,At()]:[3,4]);case 2:return[4,_()];case 3:if(t.sent())return[2,At()];t.label=4;case 4:return pt("FLIP_ID"),[3,6];case 5:"SHOW_ID_BACK"==ft&&(M&&M(e),At()),t.label=6;case 6:return[3,8];case 7:return ke([]),vt(0),xt(0),Et(0),_t(void 0),Fe(),Bt.current=!1,st.current&&clearTimeout(st.current),[7];case 8:return[2]}}))}))}),[At,M,D,ft,Fe,_,ge]),Gt="FLIP_ID"===ft;t.useEffect((function(){if(Gt){var e=setTimeout((function(){pt("SHOW_ID_BACK")}),6e3);return function(){clearTimeout(e)}}}),[Gt]);var Vt=t.useCallback((function(){et(),tt()}),[tt,et]),Wt=!Gt&&Dt&&Ft&&St;t.useEffect((function(){Wt&&!Ut&&_t(new Date)}),[Ut,Wt]),t.useEffect((function(){return function(){clearTimeout(st.current)}}),[]);var qt=t.useCallback((function(e){if(e>0){var t=e-1;return lt(t),void(st.current=setTimeout((function(){return qt(t)}),1e3))}}),[st]);t.useEffect((function(){if(Ut)return lt(B),st.current=setTimeout((function(){return qt(B)}),1e3),function(){clearTimeout(st.current)}}),[B,Ut,qt]),t.useEffect((function(){0===ct&&(lt(-1),zt().then())}),[zt,ct]);var Ht=Bv(V,Vt,"READ_TEXT"!==ft,!1,"READ_TEXT"===ft).timeoutStartedAt,Yt=t.useState(0),Zt=Yt[0],Qt=Yt[1];t.useEffect((function(){Qe||Ze((function(e){Te(e),Qt((function(t){return 0===e.length?t+1:0}))}))}),[Ze,Qe]),t.useEffect((function(){!(Y&&(null==Ht?void 0:Ht.getTime())&&(new Date).getTime()-(null==Ht?void 0:Ht.getTime())>Q)&&Zt>=2&&(null==T||T())}),[Y,Q,Zt,T,Ht]);var $t=o.useTheme(),Xt=rh(ie,{faceNotCenteredText:"Please move your face to the center...",searchingForIdCardText:"Searching for ID card...",captureBtnText:"Capture"}),Kt=Xt.captureBtnText,Jt=Xt.faceNotCenteredText,en=Xt.searchingForIdCardText,tn=Uf({enabled:se,pageWidth:de,pageHeight:pe,videoWidth:null!==(c=null===(u=ge.current)||void 0===u?void 0:u.videoWidth)&&void 0!==c?c:0,videoHeight:null!==(d=null===(l=ge.current)||void 0===l?void 0:l.videoHeight)&&void 0!==d?d:0}),nn=["SHOW_ID_FRONT","SHOW_ID_BACK"].includes(ft),rn=Ft?A&&nn&&!Dt?en:void 0:Jt;return t.createElement(O,{ref:ce,className:"flex ".concat(null!==(f=te.container)&&void 0!==f?f:"")},t.createElement(Ve,{ref:jt}),"READ_TEXT"===ft?t.createElement(Nx,{text:z,startedAt:Ht||void 0,durationMs:V,minReadingMs:q,classNames:te.readTextPrompt,verbiage:ie.readTextPrompt,onComplete:Vt}):t.createElement(t.Fragment,null,t.createElement(wx,{assets:J.guides,classNames:te.guides,verbiage:ie.guides,requestedAction:ft,satisfied:Wt,faceGuideBorderColor:Wt?re.guidesSatisfiedColor:re.guidesUnsatisfiedColor,idCardGuideBorderColor:Wt?re.guidesSatisfiedColor:re.guidesUnsatisfiedColor}),se&&nn&&t.createElement(t.Fragment,null,t.createElement(Rf,{$flipX:!(null===(p=me.current)||void 0===p?void 0:p.isRearFacing)},Ee.map((function(e,n){var r;return t.createElement(Vf,{key:n,obj:e,scaling:tn,color:"blue",flipX:!(null===(r=me.current)||void 0===r?void 0:r.isRearFacing)})}))),t.createElement(Gf,null,Me.map((function(e,n){return t.createElement(Wf,{key:n,face:e,scaling:tn})}))))),rn&&A&&!Pe&&t.createElement(ph,{className:te.guidanceMessageContainer},t.createElement(hh,{className:te.guidanceMessage,$background:null!==(y=null===(v=null===(g=$t.guidanceMessages)||void 0===g?void 0:g.negative)||void 0===v?void 0:v.backgroundColor)&&void 0!==y?y:"red",$textColor:null!==(C=null===(x=null===(b=$t.guidanceMessages)||void 0===b?void 0:b.negative)||void 0===x?void 0:x.textColor)&&void 0!==C?C:"white"},rn)),se&&t.createElement(Lf,null,me.current?t.createElement(t.Fragment,null,"✅ Camera: ",me.current.label," (",me.current.width,"x",me.current.height,")"):"❌ Camera not ready",t.createElement("br",null),Xe?"✅ Recording":"❌ Not recording",t.createElement("br",null),Dt?"✅":"❌"," Good Frame Count:"," ",wt,"/",kt,t.createElement("br",null),"Detection Score: ",gt,t.createElement("br",null),"Focus Score: ",bt,t.createElement("br",null),"Best Frame Detection Score: ",null!==(w=null==Re?void 0:Re.detectionScore)&&void 0!==w?w:0,t.createElement("br",null),"Best Frame Focus Score: ",null!==(E=null==Re?void 0:Re.focusScore)&&void 0!==E?E:0),ct>0&&nn&&t.createElement(Bx,{className:te.countdownContainer},t.createElement(zx,{className:te.countdown},ct)),(!A||Pe)&&nn&&t.createElement(Gx,{className:te.captureBtnContainer},t.createElement(Vx,{finished:!0,onClick:function(){_t(new Date)},disabled:!!Ut||Bt.current,className:te.captureBtn},Kt)),t.createElement(kh,{onClick:S,className:te.exitCaptureBtn}))},Bx=o.div(Gb||(Gb=v(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100dvw;\n height: 100dvh;\n z-index: 99999;\n display: flex;\n"],["\n position: fixed;\n top: 0;\n left: 0;\n width: 100dvw;\n height: 100dvh;\n z-index: 99999;\n display: flex;\n"]))),zx=o.div(Vb||(Vb=v(["\n color: white;\n font-size: 64px;\n font-weight: bold;\n margin: auto;\n"],["\n color: white;\n font-size: 64px;\n font-weight: bold;\n margin: auto;\n"]))),Gx=o.div(Wb||(Wb=v(["\n position: fixed;\n bottom: 0;\n width: 100dvw;\n display: flex;\n z-index: 100000;\n"],["\n position: fixed;\n bottom: 0;\n width: 100dvw;\n display: flex;\n z-index: 100000;\n"]))),Vx=o(le)(qb||(qb=v(["\n margin: 0 auto 25px;\n"],["\n margin: 0 auto 25px;\n"]))),Wx=function(e){var n=e.videoUrl,r=e.audioUrl,o=e.idFrontImageUrl,i=e.idBackImageUrl,a=e.onDoneClick,s=e.onRetryClick,u=e.classNames,c=void 0===u?{}:u,l=e.colors,d=void 0===l?{}:l,f=e.verbiage,p=void 0===f?{}:f,h=t.useState("video"),m=h[0],g=h[1],v=rh(p,{headingText:"Video ID has been successfully captured!",retryBtnText:"Retry",doneBtnText:"Done",idFrontText:"ID Front Image",idBackText:"ID Back Image"});return t.createElement(_,{className:c.container},t.createElement(j,{className:c.inner},t.createElement("h1",{className:c.heading},v.headingText),t.createElement(Hx,{className:c.assetSelectorOptions},t.createElement(Yx,{className:c.assetSelectorOption},t.createElement("input",{type:"radio",id:"displayedAssetVideo",value:"video",checked:"video"===m,onChange:function(){return g("video")}}),t.createElement("label",{htmlFor:"displayedAssetVideo"},"Video")),r&&t.createElement(Yx,{className:c.assetSelectorOption},t.createElement("input",{type:"radio",id:"displayedAssetAudio",value:"audio",checked:"audio"===m,onChange:function(){return g("audio")}}),t.createElement("label",{htmlFor:"displayedAssetAudio"},"Audio")),t.createElement(Yx,{className:c.assetSelectorOption},t.createElement("input",{type:"radio",id:"displayedAssetIdFrontImage",value:"idFrontImage",checked:"idFrontImage"===m,onChange:function(){return g("idFrontImage")}}),t.createElement("label",{htmlFor:"displayedAssetIdFrontImage"},v.idFrontText)),i&&t.createElement(Yx,{className:c.assetSelectorOption},t.createElement("input",{type:"radio",id:"displayedAssetIdBackImage",value:"idBackImage",checked:"idBackImage"===m,onChange:function(){return g("idBackImage")}}),t.createElement("label",{htmlFor:"displayedAssetIdBackImage"},v.idBackText))),t.createElement(B,{className:c.videoContainer},"video"===m?t.createElement(qx,{src:n,className:c.video,poster:n+"#t=0.1",controls:!0,preload:"metadata",autoPlay:!0}):"audio"===m?t.createElement("div",null,t.createElement("h3",null,"Audio"),t.createElement("audio",{controls:!0},t.createElement("source",{src:r}))):t.createElement("img","idFrontImage"===m?{src:o,alt:"ID Front Image"}:{src:i,alt:"ID Back Image"})),t.createElement(Dh,{className:c.buttonsRow},t.createElement(le,{variant:"warning",className:c.retryBtn,onClick:s,colors:d.retryBtn,finished:!0},v.retryBtnText),t.createElement(le,{variant:"positive",className:c.doneBtn,onClick:a,colors:d.doneBtn,finished:!0},v.doneBtnText))))},qx=o.video(Hb||(Hb=v(["\n margin-left: auto;\n margin-right: auto;\n max-width: 100%;\n"],["\n margin-left: auto;\n margin-right: auto;\n max-width: 100%;\n"]))),Hx=o.div(Yb||(Yb=v(["\n margin-bottom: 15px;\n display: flex;\n justify-content: center;\n"],["\n margin-bottom: 15px;\n display: flex;\n justify-content: center;\n"]))),Yx=o.div(Zb||(Zb=v(["\n padding: 0 8px;\n"],["\n padding: 0 8px;\n"]))),Zx=function(e){var n,r,o,i,a,s=e.onComplete,u=e.onExitCapture,c=e.onExitAfterFailure,l=e.onUserCancel,d=e.onIdCaptureModelError,p=e.onCameraAccessDenied,g=e.onMicrophoneAccessDenied,v=e.idCaptureProps,y=void 0===v?{}:v,x=e.faceLivenessProps,C=void 0===x?{}:x,w=e.idCaptureModelsEnabled,E=void 0===w||w,k=e.videoIdCaptureThresholds,D=void 0===k?_x:k,M=e.readTextPrompt,T=e.readTextTimeoutDurationMs,I=e.readTextMinReadingMs,S=e.skipIdCapture,N=void 0!==S&&S,A=e.skipShowIdCardBack,L=void 0!==A&&A,R=e.skipSuccessScreen,F=void 0!==R&&R,P=e.idCaptureLoadingOverlayMode,U=void 0===P?"default":P,_=e.idCaptureGuideType,j=void 0===_?"fit":_,B=e.idCapturePortraitGuidesOnMobile,z=void 0===B||B,G=e.idCaptureRotateLoadingOverlayImageWhenPortrait,V=void 0===G||G,W=e.idCaptureModelLoadTimeoutMs,q=void 0===W?of:W,H=e.faceLivenessLoadingOverlayMode,Y=void 0===H?"default":H,Z=e.disableFaceDetectionWhileAudioCapture,Q=void 0===Z||Z,$=e.disableFaceDetectionWhileAudioCaptureMsDelay,X=void 0===$?2e3:$,K=e.silentFallback,J=void 0!==K&&K,ee=e.mergeAVStreams,te=void 0!==ee&&ee,ne=e.assets,re=void 0===ne?{}:ne,oe=e.classNames,ie=void 0===oe?{}:oe,ae=e.colors,se=void 0===ae?{}:ae,ue=e.verbiage,ce=void 0===ue?{}:ue,le=e.debugMode,de=void 0!==le&&le,fe=t.useContext(_e),pe=fe.submissionStatus,he=fe.idCaptureVideoUrl,me=fe.idCaptureVideoAudioUrl,ge=fe.idCaptureVideoIdFrontImage,ve=fe.idCaptureVideoIdBackImage,ye=fe.setIdCaptureVideoUrl,be=fe.setIdCaptureVideoIdFrontImage,xe=fe.setIdCaptureVideoIdBackImage,Ce=fe.setIdCaptureVideoAudioUrl,we=t.useState("CAPTURING_ID"),ke=we[0],De=we[1];t.useEffect((function(){N&&"CAPTURING_ID"===ke&&De("CHECKING_LIVENESS")}),[ke,N]);var Me=y.onSuccess,Te=t.useCallback((function(e){null==Me||Me(e),De("CHECKING_LIVENESS")}),[Me]),Ie=t.useCallback((function(){return h(void 0,void 0,void 0,(function(){return m(this,(function(e){return De("CAPTURING_VIDEO"),[2]}))}))}),[]),Se=t.useCallback((function(e,t){return h(void 0,void 0,void 0,(function(){return m(this,(function(n){return ye(e),t&&Ce(t),De("SUCCESS"),F&&(null==s||s()),[2]}))}))}),[s,Ce,ye,F]),Ne=t.useCallback((function(){De("CHECKING_LIVENESS")}),[]),Ae=t.useState(0),Le=Ae[0],Oe=Ae[1],Re=null!=c?c:C.onExitAfterFailure,Fe=t.useCallback((function(e,t){null==Re||Re(e,t),Oe((function(e){return e+1})),De("CAPTURING_ID")}),[Re]),Pe=t.useCallback((function(){Oe((function(e){return e+1})),De("CAPTURING_ID")}),[]),Ue=["LOADING","CAPTURING_ID"].includes(ke);t.useEffect((function(){pe===b.SUBMITTING&&et()}),[pe]);var je=t.useCallback((function(){Oe((function(e){return e+1})),De("CHECKING_LIVENESS")}),[]),Be=t.useCallback((function(){Oe((function(e){return e+1})),null==u||u()}),[u]);return pe===b.SUBMITTING?t.createElement(O,{className:"flex"},t.createElement(Ee,null)):t.createElement(rt,{key:"".concat(Ue?"id":"selfie","-camera-").concat(Le),preferContinuityCamera:Ue,preferFrontFacingCamera:!Ue,requireMicrophoneAccess:!Ue&&!!M,maxVideoWidth:Ue?1920:1280,maxFps:Ue?60:30,onCameraAccessDenied:p,onMicrophoneAccessDenied:g,debugMode:de},t.createElement(Cf,{autoStart:!1,documentDetectionModelUrl:null!==(r=null===(n=y.assets)||void 0===n?void 0:n.documentDetectionModelUrl)&&void 0!==r?r:"",focusModelUrl:null!==(i=null===(o=y.assets)||void 0===o?void 0:o.focusModelUrl)&&void 0!==i?i:"",onModelError:d,modelLoadTimeoutMs:q},t.createElement(Mv,{autoStart:!1,onModelError:null==C?void 0:C.onModelError,modelLoadTimeoutMs:null==C?void 0:C.modelLoadTimeoutMs},t.createElement(O,{className:"flex ".concat(null!==(a=ie.container)&&void 0!==a?a:"")},["CHECKING_LIVENESS","CAPTURING_VIDEO"].includes(ke)&&t.createElement(Um,{className:ie.cameraFeed}),function(){switch(ke){case"CAPTURING_ID":return t.createElement(Nf,null,t.createElement(qy,null,t.createElement(Cv,f({key:"id-capture-".concat(Le),loadingOverlayMode:U,silentFallback:J},y,{assets:re.idCapture,classNames:ie.idCapture,colors:se.idCapture,verbiage:ce.idCapture,onSuccess:Te,onExitCapture:Be,onUserCancel:l,skipSuccessScreen:!0,releaseCameraAccessOnExit:!1,guideType:j,portraitGuidesOnMobile:z,rotateLoadingOverlayImageWhenPortrait:V,debugMode:de}))));case"CHECKING_LIVENESS":return t.createElement(Wy,f({key:"face-liveness-".concat(Le),loadingOverlayMode:Y,silentFallback:J},C,{onComplete:Ie,onExitCapture:Be,onExitAfterFailure:Fe,onUserCancel:l,skipSuccessScreen:!0,renderCameraFeed:!1,releaseCameraAccessOnExit:!1,assets:re.faceLiveness,classNames:ie.faceLiveness,colors:se.faceLiveness,verbiage:ce.faceLiveness,debugMode:de}));case"CAPTURING_VIDEO":return t.createElement(jx,{key:"id-video-capture-".concat(Le),onComplete:Se,onIdFrontImageCaptured:be,onIdBackImageCaptured:xe,onFaceNotDetected:Ne,onRecordingFailed:je,onExitCapture:Be,idCaptureModelsEnabled:E,videoIdCaptureThresholds:D,skipShowIdCardBack:L,disableFaceDetectionWhileAudioCapture:Q,disableFaceDetectionWhileAudioCaptureMsDelay:X,readTextPrompt:M,readTextTimeoutDurationMs:T,readTextMinReadingMs:I,mergeAVStreams:te,assets:re.idVideoCapture,classNames:ie.idVideoCapture,colors:se.idVideoCapture,verbiage:ce.idVideoCapture,debugMode:de});case"SUCCESS":return t.createElement(Wx,{videoUrl:null!=he?he:"",audioUrl:null!=me?me:"",idFrontImageUrl:null!=ge?ge:"",idBackImageUrl:null!=ve?ve:void 0,onDoneClick:s,onRetryClick:Pe,classNames:ie.success,colors:se.success,verbiage:ce.success});default:return t.createElement(t.Fragment,null)}}()))))},Qx=function(e){var n,r,o,i,a,s=e.checks,u=e.idCaptureProps,c=void 0===u?{}:u,l=e.faceLivenessProps,d=void 0===l?{}:l,p=e.additionalDocumentCaptureProps,h=e.signatureCaptureProps,m=void 0===h?{}:h,v=e.videoSignatureCaptureProps,y=void 0===v?{}:v,x=e.videoIdCaptureProps,C=void 0===x?{}:x,w=e.captureSignature,E=void 0!==w&&w,k=e.captureSignatureVideo,D=void 0!==k&&k,M=e.onCameraAccessDenied,T=e.onMicrophoneAccessDenied,I=e.debugMode,S=void 0!==I&&I,N=t.useContext(_e),A=N.submit,L=N.submissionStatus,R=N.setSignatureData,F=N.setAdditionalDocuments,P=t.useState(0),U=P[0],_=P[1],j=t.useMemo((function(){var e,t,n=g([],s,!0);if(E&&D)throw new Error("captureSignature and captureSignatureVideo cannot be used together");return E&&n.push("SignatureCapture"),D&&(n.push("VideoSignatureCapture"),n.includes("FaceLiveness")&&n.splice(n.indexOf("FaceLiveness"),1)),null!==(t=null===(e=null==p?void 0:p.documents)||void 0===e?void 0:e.length)&&void 0!==t&&t&&n.push("AdditionalDocumentCapture"),n}),[null===(n=null==p?void 0:p.documents)||void 0===n?void 0:n.length,E,D,s]),B=j[U],z=U>=j.length;t.useEffect((function(){"SignatureCapture"===B&&"function"==typeof E?E().then((function(e){e||_((function(e){return e+1}))})):"VideoSignatureCapture"===B&&"function"==typeof D&&D().then((function(e){e||_((function(e){return e+1}))}))}),[E,D,B]),t.useEffect((function(){z&&A()}),[z,A]);var G=c.onSuccess,V=t.useCallback((function(e){null==G||G(e),_((function(e){return e+1}))}),[G]),W=C.onComplete,q=t.useCallback((function(){null==W||W(),_((function(e){return e+1}))}),[W]),H=d.onComplete,Y=t.useCallback((function(e,t){null==H||H(e,t),_((function(e){return e+1}))}),[H]),Z=t.useCallback((function(e){R(e),_((function(e){return e+1}))}),[R]),Q=y.onComplete,$=t.useCallback((function(){null==Q||Q(),_((function(e){return e+1}))}),[Q]),X=t.useState(0),K=X[0],J=X[1],ee=y.onRetryClicked,te=t.useCallback((function(){null==ee||ee(),J((function(e){return e+1}))}),[ee]),ne=null==p?void 0:p.onComplete,re=t.useCallback((function(e){F(e),null==ne||ne(e),_((function(e){return e+1}))}),[ne,F]),oe=t.useMemo((function(){var e;return null!==(e=null==p?void 0:p.documents)&&void 0!==e?e:[]}),[null==p?void 0:p.documents]);if(z)switch(L){case b.SUBMITTING:return t.createElement(O,{className:"flex"},t.createElement(Ee,null));case b.SUBMITTED:return t.createElement(Hy,null);case b.FAILED:return t.createElement(t.Fragment,null,"Submission failed!");default:return t.createElement(t.Fragment,null,"Complete!!")}switch(j[U]){case"IdCapture":return t.createElement(rt,{key:"IdCaptureCamera",onCameraAccessDenied:M,onMicrophoneAccessDenied:T,debugMode:S},t.createElement(Cf,{autoStart:!1,documentDetectionModelUrl:null!==(o=null===(r=c.assets)||void 0===r?void 0:r.documentDetectionModelUrl)&&void 0!==o?o:"",focusModelUrl:null!==(a=null===(i=c.assets)||void 0===i?void 0:i.focusModelUrl)&&void 0!==a?a:"",onModelError:c.onModelError,modelLoadTimeoutMs:c.modelLoadTimeoutMs},t.createElement(Nf,null,t.createElement(qy,null,t.createElement(Cv,f({},c,{onSuccess:V}))))));case"VideoIdCapture":return t.createElement(Zx,f({},C,{onComplete:q,onCameraAccessDenied:M,onMicrophoneAccessDenied:T}));case"FaceLiveness":return t.createElement(rt,{key:"FaceLivenessCamera",preferFrontFacingCamera:!0,preferContinuityCamera:!1,onCameraAccessDenied:M,onMicrophoneAccessDenied:T,debugMode:S},t.createElement(Mv,{autoStart:!1,onModelError:d.onModelError,modelLoadTimeoutMs:d.modelLoadTimeoutMs},t.createElement(Wy,f({},d,{onComplete:Y}))));case"SignatureCapture":return t.createElement(dx,f({},m,{onAccept:Z}));case"VideoSignatureCapture":return t.createElement(rt,{key:"SignatureKycCamera-".concat(K),preferContinuityCamera:!1,preferFrontFacingCamera:!0,maxVideoWidth:1280,maxFps:30,onCameraAccessDenied:M,onMicrophoneAccessDenied:T,debugMode:S},t.createElement(Mv,{autoStart:!1,throttleMs:250,onModelError:y.onModelError,modelLoadTimeoutMs:y.modelLoadTimeoutMs},t.createElement(bx,f({},y,{onComplete:$,onRetryClicked:te}))));case"AdditionalDocumentCapture":return t.createElement(ub,f({},p,{documents:oe,onComplete:re}));default:return t.createElement(t.Fragment,null)}},$x={default:{fontFamily:"Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif",isFullscreen:!0,background:"white",textColor:"black",textAlign:"center",padding:"25px",colors:{primary:{50:"#eef8ff",100:"#d8eeff",200:"#b9e0ff",300:"#89cfff",400:"#52b4ff",500:"#2a91ff",600:"#0d6efd",700:"#0c5ae9",800:"#1149bc",900:"#144194",950:"#11295a"},secondary:{50:"#f6f6f6",100:"#e7e7e7",200:"#d1d1d1",300:"#b0b0b0",400:"#888888",500:"#666666",600:"#5d5d5d",700:"#4f4f4f",800:"#454545",900:"#3d3d3d",950:"#262626"},positive:{50:"#f1fcf9",100:"#cef9eb",200:"#9df2d8",300:"#65e3c2",400:"#4fd4ad",500:"#1cb090",600:"#16a085",700:"#147160",800:"#155a4f",900:"#164b42",950:"#062d28"},negative:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},warning:{50:"#fdf5ef",100:"#fbe7d9",200:"#f6cdb2",300:"#f0ab81",400:"#ea8557",500:"#e35e2c",600:"#d54621",700:"#b1341d",800:"#8d2b1f",900:"#72261c",950:"#3d100d"}},buttons:{style:"bootstrap",primary:{backgroundColor:"var(--idm-color-primary-600)",textColor:"white"},secondary:{backgroundColor:"var(--idm-color-secondary-500)",textColor:"white"},positive:{backgroundColor:"var(--idm-color-positive-600)",textColor:"white"},negative:{backgroundColor:"var(--idm-color-negative-400)",textColor:"white"},warning:{backgroundColor:"var(--idm-color-warning-400)",textColor:"white"},loading:{backgroundColor:"gray",textColor:"white"}},guidanceMessages:{default:{backgroundColor:"var(--idm-color-secondary-200)",textColor:"black"},positive:{backgroundColor:"var(--idm-color-positive-700)",textColor:"white"},negative:{backgroundColor:"var(--idm-color-negative-600)",textColor:"white"}},idCapture:{loadingOverlay:{backgroundColor:"#ecedf3",textColor:"black",loadingGraphicAccentColor:"var(--idm-color-positive-600)",loadingGraphicAccentOpacity:.2,progressBarBackgroundColor:"var(--idm-color-positive-600)",progressBarBackgroundOpacity:.75,progressBarIndicatorColor:"var(--idm-color-positive-600)",progressBarTextColor:"white",continueBtnBorder:"2px solid white"},guideOverlay:{backgroundColor:"#708090",textColor:"white"},guideBox:{unsatisfiedColor:"white",satisfiedColor:"var(--idm-color-positive-500)",borderWidth:4,desktopPadding:50,mobilePadding:0,imagePadding:25}},selfieCapture:{loadingOverlay:{backgroundColor:"#ecedf3",textColor:"black",loadingGraphicAccentColor:"var(--idm-color-positive-600)",progressBarBackgroundColor:"var(--idm-color-positive-600)",progressBarBackgroundOpacity:.75,progressBarIndicatorColor:"var(--idm-color-positive-600)",progressBarTextColor:"white",continueBtnBorder:"2px solid white"},guides:{unsatisfiedColor:"white",satisfiedColor:"var(--idm-color-positive-500)"}},signatureCapture:{background:"radial-gradient(#444cf7 0.5px, transparent 0.5px), radial-gradient(#444cf7 0.5px, #e5e5f7 0.5px)",backgroundSize:"20px 20px",backgroundPosition:"0 0, 10px 10px"},idVideoCapture:{readTextPrompt:{heading:{backgroundColor:"rgba(255, 255, 255, 0.5)",textColor:"black",borderRadius:"8px"},prompt:{backgroundColor:"rgba(255, 255, 255, 0.5)",textColor:"black",borderRadius:"8px"},timeRemaining:{backgroundColor:"rgba(255, 255, 255, 0.5)",textColor:"black",borderRadius:"4px"}}}},none:{}},Xx=function(e){var n,r=e.children,i="string"==typeof(n=e.theme)?n in $x?$x[n]:$x.none:n,a=i.colors;return t.useEffect((function(){for(var e in a){var t=a[e];for(var n in t){var r=t[n];document.documentElement.style.setProperty("--idm-color-".concat(e,"-").concat(n),r)}}}),[a]),t.createElement(o.ThemeProvider,{theme:i},r)},Kx=function(e){var n=e.lang,r=e.sessionId,o=e.clientRequestID,i=e.submissionUrl,a=e.authUrl,s=e.documentServiceUrl,u=e.companyId,c=e.needImmediateResponse,l=e.manualReviewRequired,d=e.idBackImageRequired,f=e.verifyIdWithExternalDatabases,p=e.bypassAgeValidation,h=e.bypassNameMatching,m=e.personalData,g=e.cardData,v=e.idData,b=e.webhooksEnabled,x=e.webhooksClientTraceId,C=e.webhooksStripSpecialCharacters,w=e.webhooksSendInputImages,E=e.webhooksSendProcessedImages,k=e.webhooksFireOnReview,D=e.sendBase64DocumentsInSwaggerProxy,M=e.customerDataMatchConfig,T=e.precapturedDocuments,I=e.loadingOverlayMode,S=void 0===I?"default":I,N=e.idCaptureRequirement,A=void 0===N?"idCardOrPassport":N,L=e.separateIdCardCaptureSequence,O=void 0!==L&&L,R=e.idCaptureThresholds,F=void 0===R?yf:R,P=e.skipSuccessScreen,U=void 0!==P&&P,_=e.instructions,j=e.guideType,B=void 0===j?"fit":j,z=e.portraitGuidesOnMobile,G=void 0===z||z,V=e.rotateLoadingOverlayImageWhenPortrait,W=void 0===V||V,q=e.modelLoadTimeoutMs,H=void 0===q?of:q,Y=e.forceFallbackMode,Z=void 0!==Y&&Y,Q=e.allowIdCardBackToFrontCapture,$=void 0!==Q&&Q,X=e.onBeforeSubmit,K=e.onBeforeDocumentUpload,J=e.onDocumentUploadProgress,ee=e.onDocumentUploaded,te=e.onDocumentUploadFailed,ne=e.onSubmit,re=e.onComplete,oe=e.onApproved,ie=e.onDenied,ae=e.onExitCapture,se=e.onUserCancel,ue=e.onModelError,ce=e.onCameraAccessDenied,le=e.theme,de=void 0===le?"default":le,fe=e.assets,pe=void 0===fe?{}:fe,he=e.classNames,me=void 0===he?{}:he,ge=e.colors,ve=void 0===ge?{}:ge,ye=e.verbiage,be=void 0===ye?{}:ye,xe=e.captureSignature,Ce=void 0!==xe&&xe,we=e.captureSignatureVideo,Ee=void 0!==we&&we,ke=e.captureAdditionalDocuments,De=void 0===ke?[]:ke,Me=e.geolocationEnabled,Te=void 0===Me||Me,Ie=e.geolocationRequired,Se=void 0!==Ie&&Ie,Ae=e.debugMode,Oe=void 0!==Ae&&Ae;eh(void 0===n?"auto":n),Le(Oe);var Re=t.useMemo((function(){return{onExitCapture:ae,onUserCancel:se,onModelError:ue,precapturedDocuments:T,captureRequirement:A,separateIdCardCaptureSequence:O,thresholds:F,skipSuccessScreen:U,loadingOverlayMode:S,forceFallbackMode:Z,allowIdCardBackToFrontCapture:$,instructions:_,guideType:B,portraitGuidesOnMobile:G,rotateLoadingOverlayImageWhenPortrait:W,modelLoadTimeoutMs:H,assets:pe,classNames:me,colors:ve,verbiage:be,debugMode:Oe}}),[ae,se,ue,T,A,O,F,U,S,Z,$,_,B,G,W,H,pe,me,ve,be,Oe]),Fe=t.useMemo((function(){return{documents:De,classNames:me.additionalDocumentCapture,verbiage:be.additionalDocumentCapture}}),[De,me.additionalDocumentCapture,be.additionalDocumentCapture]),Pe=t.useMemo((function(){return{classNames:me.signatureCapture,verbiage:be.signatureCapture}}),[me.signatureCapture,be.signatureCapture]),Ue=t.useMemo((function(){return{onExitCapture:ae,onUserCancel:se,skipSuccessScreen:U,classNames:me.videoSignatureCapture,colors:ve.videoSignatureCapture,verbiage:be.videoSignatureCapture,debugMode:Oe}}),[me.videoSignatureCapture,ve.videoSignatureCapture,Oe,ae,se,U,be.videoSignatureCapture]),_e=t.useCallback((function(e,t){null==re||re(e,t),"Approved"===e.resultData.verificationResult?null==oe||oe(e,t):null==ie||ie(e,t)}),[oe,re,ie]);return t.createElement(Ne,{sessionId:r,authUrl:a},t.createElement(Xx,{theme:de},t.createElement(je,{action:y.VALIDATE,submissionUrl:i,clientRequestID:o,documentServiceUrl:s,companyId:u,needImmediateResponse:c,manualReviewRequired:l,idBackImageRequired:d,verifyIdWithExternalDatabases:f,bypassAgeValidation:p,bypassNameMatching:h,personalData:m,cardData:g,idData:v,webhooksEnabled:b,webhooksClientTraceId:x,webhooksStripSpecialCharacters:C,webhooksSendInputImages:w,webhooksSendProcessedImages:E,webhooksFireOnReview:k,sendBase64DocumentsInSwaggerProxy:D,customerDataMatchConfig:M,onBeforeDocumentUpload:K,onDocumentUploadProgress:J,onDocumentUploaded:ee,onDocumentUploadFailed:te,onBeforeSubmit:X,onSubmit:ne,onResponseReceived:_e,geolocationEnabled:Te,geolocationRequired:Se},t.createElement(Qx,{checks:t.useMemo((function(){return["IdCapture"]}),[]),idCaptureProps:Re,additionalDocumentCaptureProps:Fe,signatureCaptureProps:Pe,videoSignatureCaptureProps:Ue,captureSignature:Ce,captureSignatureVideo:Ee,onCameraAccessDenied:ce,debugMode:Oe}))))},Jx=function(e){var n=e.lang,r=e.sessionId,o=e.authUrl,i=e.submissionUrl,a=e.documentServiceUrl,s=e.companyId,u=e.needImmediateResponse,c=e.webhooksEnabled,l=e.webhooksClientTraceId,d=e.webhooksStripSpecialCharacters,f=e.webhooksSendInputImages,p=e.webhooksSendProcessedImages,h=e.sendBase64DocumentsInSwaggerProxy,m=e.loadingOverlayMode,g=void 0===m?"default":m,v=e.timeoutDurationMs,b=void 0===v?15e3:v,x=e.modelLoadTimeoutMs,C=void 0===x?Gd:x,w=e.skipSuccessScreen,E=void 0!==w&&w,k=e.idCardForFaceMatch,D=e.onBeforeDocumentUpload,M=e.onDocumentUploadProgress,T=e.onDocumentUploaded,I=e.onDocumentUploadFailed,S=e.onBeforeSubmit,N=e.onComplete,A=e.onApproved,L=e.onDenied,O=e.onExitCapture,R=e.onExitAfterFailure,F=e.onUserCancel,P=e.onModelError,U=e.onCameraAccessDenied,_=e.theme,j=void 0===_?"default":_,B=e.assets,z=e.classNames,G=e.colors,V=e.verbiage,W=e.geolocationEnabled,q=void 0===W||W,H=e.geolocationRequired,Y=void 0!==H&&H,Z=e.debugMode,Q=void 0!==Z&&Z;eh(void 0===n?"auto":n),Le(Q);var $=t.useMemo((function(){return{loadingOverlayMode:g,timeoutDurationMs:b,modelLoadTimeoutMs:C,skipSuccessScreen:E,onComplete:N,onSuccess:A,onTimeout:L,onExitCapture:O,onExitAfterFailure:R,onModelError:P,onUserCancel:F,assets:B,classNames:z,colors:G,verbiage:V,debugMode:Q}}),[B,z,G,Q,g,C,A,N,L,R,O,P,F,E,b,V]);return t.createElement(Ne,{sessionId:r,authUrl:o},t.createElement(Xx,{theme:j},t.createElement(je,{action:y.NONE,submissionUrl:i,documentServiceUrl:a,companyId:s,needImmediateResponse:u,webhooksEnabled:c,webhooksClientTraceId:l,webhooksStripSpecialCharacters:d,webhooksSendInputImages:f,webhooksSendProcessedImages:p,sendBase64DocumentsInSwaggerProxy:h,idCardForFaceMatch:k,onBeforeDocumentUpload:D,onDocumentUploadProgress:M,onDocumentUploaded:T,onDocumentUploadFailed:I,onBeforeLivenessCheck:S,geolocationEnabled:q,geolocationRequired:Y},t.createElement(Qx,{checks:t.useMemo((function(){return["FaceLiveness"]}),[]),faceLivenessProps:$,onCameraAccessDenied:U,debugMode:Q}))))},eC=function(e){var n=e.lang,r=e.sessionId,o=e.authUrl,i=e.submissionUrl,a=e.documentServiceUrl,s=e.companyId,u=e.needImmediateResponse,c=e.manualReviewRequired,l=e.idBackImageRequired,d=e.verifyIdWithExternalDatabases,f=e.bypassAgeValidation,p=e.bypassNameMatching,h=e.personalData,m=e.cardData,g=e.idData,v=e.webhooksEnabled,b=e.webhooksClientTraceId,x=e.webhooksStripSpecialCharacters,C=e.webhooksSendInputImages,w=e.webhooksSendProcessedImages,E=e.webhooksFireOnReview,k=e.sendBase64DocumentsInSwaggerProxy,D=e.customerDataMatchConfig,M=e.precapturedDocuments,T=e.idCaptureLoadingOverlayMode,I=void 0===T?"default":T,S=e.idCaptureRequirement,N=void 0===S?"idCardOrPassport":S,A=e.idCaptureThresholds,L=void 0===A?yf:A,O=e.faceLivenessLoadingOverlayMode,R=void 0===O?"default":O,F=e.faceLivenessTimeoutDurationMs,P=void 0===F?15e3:F,U=e.skipSuccessScreen,_=void 0!==U&&U,j=e.idCaptureInstructions,B=e.idCaptureGuideType,z=void 0===B?"fit":B,G=e.idCapturePortraitGuidesOnMobile,V=void 0===G||G,W=e.idCaptureRotateLoadingOverlayImageWhenPortrait,q=void 0===W||W,H=e.idCaptureModelLoadTimeoutMs,Y=void 0===H?of:H,Z=e.selfieCaptureModelLoadTimeoutMs,Q=void 0===Z?Gd:Z,$=e.onBeforeDocumentUpload,X=e.onDocumentUploaded,K=e.onDocumentUploadProgress,J=e.onDocumentUploadFailed,ee=e.onBeforeLivenessCheck,te=e.onBeforeSubmit,ne=e.onSubmit,re=e.onComplete,oe=e.onApproved,ie=e.onDenied,ae=e.onExitCapture,se=e.onExitAfterFailure,ue=e.onUserCancel,ce=e.onIdCaptureModelError,le=e.onSelfieCaptureModelError,de=e.onCameraAccessDenied,fe=e.captureSignature,pe=void 0!==fe&&fe,he=e.captureSignatureVideo,me=void 0!==he&&he,ge=e.captureAdditionalDocuments,ve=void 0===ge?[]:ge,ye=e.theme,be=void 0===ye?"default":ye,xe=e.assets,Ce=void 0===xe?{}:xe,we=e.classNames,Ee=void 0===we?{}:we,ke=e.colors,De=void 0===ke?{}:ke,Me=e.verbiage,Te=void 0===Me?{}:Me,Ie=e.geolocationEnabled,Se=void 0===Ie||Ie,Ae=e.geolocationRequired,Oe=void 0!==Ae&&Ae,Re=e.debugMode,Fe=void 0!==Re&&Re;eh(void 0===n?"auto":n),Le(Fe);var Pe=t.useMemo((function(){return{onExitCapture:ae,onUserCancel:ue,onModelError:ce,assets:Ce.idCapture,classNames:Ee.idCapture,colors:De.idCapture,verbiage:Te.idCapture,precapturedDocuments:M,captureRequirement:N,thresholds:L,loadingOverlayMode:I,instructions:j,guideType:z,portraitGuidesOnMobile:V,rotateLoadingOverlayImageWhenPortrait:q,modelLoadTimeoutMs:Y,skipSuccessScreen:_,debugMode:Fe}}),[ae,ue,ce,Ce.idCapture,Ee.idCapture,De.idCapture,Te.idCapture,M,N,L,I,j,z,V,q,Y,_,Fe]),Ue=t.useMemo((function(){return{loadingOverlayMode:R,timeoutDurationMs:P,modelLoadTimeoutMs:Q,onTimeout:ie,onExitCapture:ae,onExitAfterFailure:se,onUserCancel:ue,onModelError:le,skipSuccessScreen:_,assets:Ce.faceLiveness,classNames:Ee.faceLiveness,colors:De.faceLiveness,verbiage:Te.faceLiveness,debugMode:Fe}}),[Ce.faceLiveness,Ee.faceLiveness,De.faceLiveness,Fe,R,P,ie,se,ae,le,ue,Q,_,Te.faceLiveness]),_e=t.useMemo((function(){return{documents:ve,classNames:Ee.additionalDocumentCapture,verbiage:Te.additionalDocumentCapture}}),[ve,Ee.additionalDocumentCapture,Te.additionalDocumentCapture]),Be=t.useMemo((function(){return{classNames:Ee.signatureCapture,verbiage:Te.signatureCapture}}),[Ee.signatureCapture,Te.signatureCapture]),ze=t.useMemo((function(){return{onExitCapture:ae,onUserCancel:ue,skipSuccessScreen:_,classNames:Ee.videoSignatureCapture,colors:De.videoSignatureCapture,verbiage:Te.videoSignatureCapture,debugMode:Fe}}),[Ee.videoSignatureCapture,De.videoSignatureCapture,Fe,ae,ue,_,Te.videoSignatureCapture]),Ge=t.useCallback((function(e,t){null==re||re(e,t),"Approved"===e.resultData.verificationResult?null==oe||oe(e,t):null==ie||ie(e,t)}),[oe,re,ie]),Ve=t.useMemo((function(){return(null==M?void 0:M.selfie)?["IdCapture"]:["IdCapture","FaceLiveness"]}),[null==M?void 0:M.selfie]);return t.createElement(Ne,{sessionId:r,authUrl:o},t.createElement(Xx,{theme:be},t.createElement(je,{action:y.VALIDATE,submissionUrl:i,documentServiceUrl:a,companyId:s,needImmediateResponse:u,manualReviewRequired:c,idBackImageRequired:l,verifyIdWithExternalDatabases:d,bypassAgeValidation:f,bypassNameMatching:p,personalData:h,cardData:m,idData:g,webhooksEnabled:v,webhooksClientTraceId:b,webhooksStripSpecialCharacters:x,webhooksSendInputImages:C,webhooksSendProcessedImages:w,webhooksFireOnReview:E,sendBase64DocumentsInSwaggerProxy:k,customerDataMatchConfig:D,precapturedDocuments:M,onBeforeDocumentUpload:$,onDocumentUploadProgress:K,onDocumentUploaded:X,onDocumentUploadFailed:J,onBeforeSubmit:te,onBeforeLivenessCheck:ee,onSubmit:ne,onResponseReceived:Ge,geolocationEnabled:Se,geolocationRequired:Oe},t.createElement(Qx,{checks:Ve,idCaptureProps:Pe,faceLivenessProps:Ue,signatureCaptureProps:Be,videoSignatureCaptureProps:ze,additionalDocumentCaptureProps:_e,captureSignature:pe,captureSignatureVideo:me,onCameraAccessDenied:de,debugMode:Fe}))))},tC=function(e){var n=e.enrollmentId,r=e.lang,o=e.sessionId,i=e.authUrl,a=e.submissionUrl,s=e.documentServiceUrl,u=e.companyId,c=e.needImmediateResponse,l=e.manualReviewRequired,d=e.idBackImageRequired,f=e.idImageResolutionCheck,p=e.verifyIdWithExternalDatabases,h=e.bypassAgeValidation,m=e.bypassNameMatching,g=e.personalData,v=e.cardData,b=e.idData,x=e.deduplicationEnabled,C=e.deduplicationSynchronous,w=e.webhooksEnabled,E=e.webhooksClientTraceId,k=e.webhooksStripSpecialCharacters,D=e.webhooksSendInputImages,M=e.webhooksSendProcessedImages,T=e.webhooksFireOnReview,I=e.sendBase64DocumentsInSwaggerProxy,S=e.customerDataMatchConfig,N=e.idCaptureLoadingOverlayMode,A=void 0===N?"default":N,L=e.idCaptureRequirement,O=void 0===L?"idCardOrPassport":L,R=e.idCaptureThresholds,F=void 0===R?yf:R,P=e.faceLivenessTimeoutDurationMs,U=void 0===P?15e3:P,_=e.faceLivenessLoadingOverlayMode,j=void 0===_?"default":_,B=e.skipSuccessScreen,z=void 0!==B&&B,G=e.idCaptureInstructions,V=e.idCaptureGuideType,W=void 0===V?"fit":V,q=e.idCapturePortraitGuidesOnMobile,H=void 0===q||q,Y=e.idCaptureRotateLoadingOverlayImageWhenPortrait,Z=void 0===Y||Y,Q=e.idCaptureModelLoadTimeoutMs,$=void 0===Q?of:Q,X=e.selfieCaptureModelLoadTimeoutMs,K=void 0===X?Gd:X,J=e.onBeforeDocumentUpload,ee=e.onDocumentUploadProgress,te=e.onDocumentUploaded,ne=e.onDocumentUploadFailed,re=e.onBeforeSubmit,oe=e.onSubmit,ie=e.onComplete,ae=e.onEnrolled,se=e.onDenied,ue=e.onExitCapture,ce=e.onExitAfterFailure,le=e.onUserCancel,de=e.onIdCaptureModelError,fe=e.onSelfieCaptureModelError,pe=e.onCameraAccessDenied,he=e.captureSignature,me=void 0!==he&&he,ge=e.captureSignatureVideo,ve=void 0!==ge&&ge,ye=e.captureAdditionalDocuments,be=void 0===ye?[]:ye,xe=e.theme,Ce=void 0===xe?"default":xe,we=e.assets,Ee=void 0===we?{}:we,ke=e.classNames,De=void 0===ke?{}:ke,Me=e.colors,Te=void 0===Me?{}:Me,Ie=e.verbiage,Se=void 0===Ie?{}:Ie,Ae=e.geolocationEnabled,Oe=void 0===Ae||Ae,Re=e.geolocationRequired,Fe=void 0!==Re&&Re,Pe=e.debugMode,Ue=void 0!==Pe&&Pe;eh(void 0===r?"auto":r),Le(Ue);var _e=t.useMemo((function(){return{assets:Ee.idCapture,classNames:De.idCapture,colors:Te.idCapture,verbiage:Se.idCapture,captureRequirement:O,thresholds:F,loadingOverlayMode:A,instructions:G,guideType:W,portraitGuidesOnMobile:H,rotateLoadingOverlayImageWhenPortrait:Z,modelLoadTimeoutMs:$,onExitCapture:ue,onUserCancel:le,onModelError:de,skipSuccessScreen:z,debugMode:Ue}}),[Ee.idCapture,De.idCapture,Te.idCapture,Se.idCapture,O,F,A,G,W,H,Z,$,ue,le,de,z,Ue]),Be=t.useMemo((function(){return{onExitCapture:ue,onExitAfterFailure:ce,onUserCancel:le,onModelError:fe,loadingOverlayMode:j,timeoutDurationMs:U,modelLoadTimeoutMs:K,skipSuccessScreen:z,assets:Ee.faceLiveness,classNames:De.faceLiveness,colors:Te.faceLiveness,verbiage:Se.faceLiveness,debugMode:Ue}}),[Ee.faceLiveness,De.faceLiveness,Te.faceLiveness,Ue,j,U,ce,ue,fe,le,K,z,Se.faceLiveness]),ze=t.useMemo((function(){return{documents:be,classNames:De.additionalDocumentCapture,verbiage:Se.additionalDocumentCapture}}),[be,De.additionalDocumentCapture,Se.additionalDocumentCapture]),Ge=t.useMemo((function(){return{classNames:De.signatureCapture,verbiage:Se.signatureCapture}}),[De.signatureCapture,Se.signatureCapture]),Ve=t.useMemo((function(){return{onExitCapture:ue,onUserCancel:le,skipSuccessScreen:z,classNames:De.videoSignatureCapture,colors:Te.videoSignatureCapture,verbiage:Se.videoSignatureCapture,debugMode:Ue}}),[De.videoSignatureCapture,Te.videoSignatureCapture,Ue,ue,le,z,Se.videoSignatureCapture]),We=t.useCallback((function(e,t){null==ie||ie(e,t),"Customer Onboarded"===e.resultData.verificationResult?null==ae||ae(e,t):null==se||se(e,t)}),[ae,ie,se]);return t.createElement(Ne,{sessionId:o,authUrl:i},t.createElement(Xx,{theme:Ce},t.createElement(je,{action:y.ENROLL,submissionUrl:a,documentServiceUrl:s,companyId:u,enrollmentId:n,needImmediateResponse:c,manualReviewRequired:l,idBackImageRequired:d,idImageResolutionCheck:f,verifyIdWithExternalDatabases:p,bypassAgeValidation:h,bypassNameMatching:m,personalData:g,cardData:v,idData:b,deduplicationEnabled:x,deduplicationSynchronous:C,webhooksEnabled:w,webhooksClientTraceId:E,webhooksStripSpecialCharacters:k,webhooksSendInputImages:D,webhooksSendProcessedImages:M,webhooksFireOnReview:T,sendBase64DocumentsInSwaggerProxy:I,customerDataMatchConfig:S,onBeforeDocumentUpload:J,onDocumentUploadProgress:ee,onDocumentUploaded:te,onDocumentUploadFailed:ne,onBeforeSubmit:re,onSubmit:oe,onResponseReceived:We,geolocationEnabled:Oe,geolocationRequired:Fe},t.createElement(Qx,{checks:t.useMemo((function(){return["IdCapture","FaceLiveness"]}),[]),idCaptureProps:_e,faceLivenessProps:Be,additionalDocumentCaptureProps:ze,signatureCaptureProps:Ge,videoSignatureCaptureProps:Ve,captureSignature:me,captureSignatureVideo:ve,onCameraAccessDenied:pe,debugMode:Ue}))))},nC={frame:null,face:null,imageUrl:null,requestState:"CAPTURING",requestError:null,unverifiedTimes:0},rC=function(e,t){switch(t.type){case"verificationReady":return["CAPTURING","ERROR"].includes(e.requestState)?f(f({},e),{requestState:"CAPTURED",frame:t.payload.frame,face:t.payload.face}):e;case"verifying":return f(f({},e),{requestState:"VERIFYING",imageUrl:t.payload.imageUrl});case"verificationCompleted":var n=t.payload.response,r=n.status,o=r.statusMessage,i=r.errorData,a=n.resultData;if("000"!==r.statusCode)return f(f({},e),{requestState:"ERROR",requestError:new Error("".concat(o,": ").concat(i))});var s=e.requestState,u=e.unverifiedTimes;return"00"===a.verificationResultCode?s="VERIFIED":u<0?(s="CAPTURING",u+=1):s="REJECTED",f(f({},e),{requestState:s,unverifiedTimes:u});case"verificationFailed":return f(f({},e),{requestState:"ERROR",requestError:t.payload.error});default:return e}},oC=function(e){var n,r,i=e.onCustomerMatched,a=e.onCustomerNotMatched,s=e.onCaptureGuidanceTimeout,u=e.onExit,c=e.captureGuidanceTimeoutDurationMs,l=e.classNames,d=void 0===l?{}:l,f=e.colors,p=void 0===f?{}:f,g=e.verbiage,v=void 0===g?{}:g,y=e.debugMode,b=void 0!==y&&y,x=t.useReducer(rC,nC),C=x[0],E=x[1],k=C.frame,D=C.face,M=t.useContext(_e),T=M.submit,I=M.submissionRequest,S=M.submissionResponse,N=M.submissionError,A=M.selfieImage,L=M.setSelfieImage,O=t.useState(null),R=O[0],F=O[1],P=t.useRef(null),U=t.useRef(null),_=t.useRef(null),j=t.useCallback((function(e,t){E({type:"verificationReady",payload:{frame:e,face:t}})}),[]),B="CAPTURED"===C.requestState;t.useEffect((function(){if(k&&D&&!N){var e=kd(P.current,U.current,_.current,k,D);F(e),w(e).then((function(e){L(e)}))}}),[D,k,L,N]),t.useEffect((function(){B&&A&&!N&&h(void 0,void 0,void 0,(function(){var e,t;return m(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),E({type:"verifying",payload:{imageUrl:A}}),[4,T()];case 1:if(!(e=n.sent()))throw new Error("submission failed!");return E({type:"verificationCompleted",payload:{response:e}}),[3,3];case 2:return t=n.sent(),E({type:"verificationFailed",payload:{error:t}}),[3,3];case 3:return[2]}}))}))}),[B,i,a,A,C.requestState,N,T]),t.useEffect((function(){I&&S&&("VERIFIED"===C.requestState?null==i||i(S,I):"REJECTED"===C.requestState&&(null==a||a(S,I)))}),[i,a,C.requestState,I,S]),Bv(c,s,["VERIFIED","REJECTED"].includes(C.requestState),"VERIFYING"===C.requestState);var z=nh(v.progressPreviewText,"Processing..."),G=o.useTheme();return t.createElement(t.Fragment,null,t.createElement(Ve,{ref:P}),t.createElement(Ve,{ref:U}),t.createElement(Ve,{ref:_}),t.createElement(Qv,{onSelfieCaptured:j,onExit:u,timeoutDurationMs:c,classNames:d,colors:p,verbiage:v,debugMode:b}),!(null===(r=null===(n=G.selfieCapture)||void 0===n?void 0:n.capturePreview)||void 0===r?void 0:r.disabled)&&R&&t.createElement(Fg,{imageUrl:R,text:z,classNames:d.imagePreview}))},iC=function(e){var n=e.imageUrl,r=e.onDoneClick,o=e.onRetryClick,i=e.classNames,a=void 0===i?{}:i,s=e.colors,u=void 0===s?{}:s,c=e.verbiage,l=void 0===c?{}:c;n||(n="".concat(mh,"/Selfie-Image-1.png"));var d=rh(l,{headingText:"Customer has been verified!",retryBtnText:"Retry",doneBtnText:"Done"});return t.createElement(_,{className:a.container},t.createElement(j,{className:a.inner},t.createElement(aC,{className:a.heading},d.headingText),t.createElement(sC,{className:a.imageContainer},t.createElement("img",{alt:d.headingText,src:n,className:a.image})),t.createElement(uC,{className:a.buttonsRow},t.createElement(le,{variant:"warning",className:a.retryBtn,onClick:o,colors:u.retryBtn,finished:!0},d.retryBtnText),t.createElement(le,{variant:"positive",className:a.doneBtn,onClick:r,colors:u.doneBtn,finished:!0},d.doneBtnText))))},aC=o.h3(Qb||(Qb=v(["\n margin-bottom: 24px;\n"],["\n margin-bottom: 24px;\n"]))),sC=o(Dh)($b||($b=v(["\n max-height: calc(100vh - 185px);\n"],["\n max-height: calc(100vh - 185px);\n"]))),uC=o(Dh)(Xb||(Xb=v(["\n margin-top: 24px;\n"],["\n margin-top: 24px;\n"]))),cC=function(e){var n=e.canRetry,r=void 0===n||n,o=e.onRetryClick,i=e.onExitClick,a=e.assets,s=void 0===a?{}:a,u=e.classNames,c=void 0===u?{}:u,l=e.colors,d=void 0===l?{}:l,f=e.verbiage,p=void 0===f?{}:f;s.imageUrl||(s.imageUrl="".concat(mh,"/manual_capture.png"));var h=rh(p,{headingText:"Customer not verified",retryBtnText:"Retry",exitBtnText:"Exit"});return t.createElement(_,{className:c.container},t.createElement(j,{className:c.inner},t.createElement(lC,{className:c.heading},h.headingText),t.createElement(dC,{className:c.imageContainer},t.createElement("img",{alt:h.headingText,src:s.imageUrl,className:c.image})),t.createElement(fC,{className:c.buttonsRow},r&&t.createElement(le,{variant:"warning",className:c.retryBtn,onClick:o,colors:d.retryBtn,finished:!0},h.retryBtnText),t.createElement(le,{variant:"secondary",className:c.exitBtn,onClick:i,colors:d.exitBtn,finished:!0},h.exitBtnText))))},lC=o.h3(Kb||(Kb=v(["\n margin-bottom: 24px;\n"],["\n margin-bottom: 24px;\n"]))),dC=o(Dh)(Jb||(Jb=v(["\n max-height: calc(100vh - 185px);\n"],["\n max-height: calc(100vh - 185px);\n"]))),fC=o(Dh)(ex||(ex=v(["\n margin-top: 24px;\n"],["\n margin-top: 24px;\n"]))),pC=function(e){var n,r=e.onComplete,o=e.onCustomerMatched,i=e.onCustomerNotMatched,a=e.onExitCapture,s=e.onExitAfterFailure,u=e.onUserCancel,c=e.onCaptureGuidanceTimeout,l=e.captureGuidanceTimeoutDurationMs,d=e.skipSuccessScreen,f=void 0!==d&&d,p=e.loadingOverlayMode,g=void 0===p?"default":p,v=e.assets,y=void 0===v?{}:v,b=e.classNames,x=void 0===b?{}:b,C=e.colors,w=void 0===C?{}:C,E=e.verbiage,k=void 0===E?{}:E,D=e.debugMode,M=void 0!==D&&D,T=t.useContext(_e),I=T.submissionRequest,S=T.submissionResponse,N=T.selfieImage,A=t.useState("LOADING"),L=A[0],R=A[1],F=t.useContext(nt),P=F.cameraAccessDenied,U=F.releaseCameraAccess,_=t.useContext(Dv),j=_.start,B=_.stop;t.useEffect((function(){if("CAPTURING"===L)return j(),function(){B()}}),[L,j,B]);var z=t.useCallback((function(e,t){return h(void 0,void 0,void 0,(function(){return m(this,(function(n){return R("MATCHED"),null==o||o(e,t),[2]}))}))}),[o]),G=t.useCallback((function(e,t){return h(void 0,void 0,void 0,(function(){return m(this,(function(n){return R("NOT_MATCHED"),null==i||i(e,t),[2]}))}))}),[i]),V=t.useCallback((function(){R("FAILED"),null==c||c()}),[c]),W=t.useState(0),q=W[0],H=W[1],Y=t.useCallback((function(){H((function(e){return e+1})),R("LOADING"),null==a||a()}),[a]),Z=t.useCallback((function(){U(),I&&S&&(null==r||r(S,I))}),[r,U,I,S]),Q=jm(f,"MATCHED"===L,Z);return t.useEffect((function(){P&&(H((function(e){return e+1})),R("LOADING"))}),[P]),t.createElement(t.Fragment,null,t.createElement(O,{className:"flex ".concat(null!==(n=x.container)&&void 0!==n?n:"")},t.createElement(Um,{className:x.cameraFeed}),"LOADING"!==L&&function(){switch(L){case"CAPTURING":return t.createElement(oC,{key:"capture".concat(q),onCustomerMatched:z,onCustomerNotMatched:G,onCaptureGuidanceTimeout:V,onExit:Y,captureGuidanceTimeoutDurationMs:l,classNames:x,colors:w,verbiage:k,debugMode:M});case"MATCHED":if(!Q)return;return t.createElement(iC,{imageUrl:"data:image/png;base64, ".concat(N),classNames:x.success,colors:w.success,verbiage:k.success,onDoneClick:Z,onRetryClick:function(){R("CAPTURING"),H(0)}});case"NOT_MATCHED":case"FAILED":return t.createElement(cC,{assets:y.failure,classNames:x.failure,colors:w.failure,verbiage:k.failure,canRetry:q<2,onExitClick:function(){U(),null==s||s()},onRetryClick:function(){H((function(e){return e+1}))}});default:return null}}()),t.createElement(Vy,{key:q,mode:g,assets:y.loadingOverlay,classNames:x.loadingOverlay,colors:w.loadingOverlay,verbiage:k.loadingOverlay,onUserCancel:u,onDismissed:function(){R("CAPTURING")}}))},hC=function(e){var n=e.lang,r=e.enrollmentId,o=e.sessionId,i=e.authUrl,a=e.submissionUrl,s=e.documentServiceUrl,u=e.companyId,c=e.needImmediateResponse,l=e.webhooksEnabled,d=e.webhooksClientTraceId,f=e.webhooksStripSpecialCharacters,p=e.webhooksSendInputImages,h=e.webhooksSendProcessedImages,m=e.sendBase64DocumentsInSwaggerProxy,g=e.loadingOverlayMode,v=void 0===g?"default":g,b=e.timeoutDurationMs,x=void 0===b?15e3:b,C=e.modelLoadTimeoutMs,w=void 0===C?Gd:C,E=e.skipSuccessScreen,k=void 0!==E&&E,D=e.theme,M=void 0===D?"default":D,T=e.assets,I=e.classNames,S=e.colors,N=e.verbiage,A=e.onBeforeDocumentUpload,L=e.onDocumentUploadProgress,O=e.onDocumentUploaded,R=e.onDocumentUploadFailed,F=e.onBeforeSubmit,P=e.onSubmit,U=e.onComplete,_=e.onCustomerMatched,j=e.onCustomerNotMatched,B=e.onExitCapture,z=e.onExitAfterFailure,G=e.onUserCancel,V=e.onModelError,W=e.onCameraAccessDenied,q=e.geolocationEnabled,H=void 0===q||q,Y=e.geolocationRequired,Z=void 0!==Y&&Y,Q=e.debugMode,$=void 0!==Q&&Q;return eh(void 0===n?"auto":n),Le($),t.createElement(Ne,{sessionId:o,authUrl:i},t.createElement(Xx,{theme:M},t.createElement(je,{action:y.VERIFY,submissionUrl:a,documentServiceUrl:s,companyId:u,enrollmentId:r,needImmediateResponse:c,webhooksEnabled:l,webhooksClientTraceId:d,webhooksStripSpecialCharacters:f,webhooksSendInputImages:p,webhooksSendProcessedImages:h,sendBase64DocumentsInSwaggerProxy:m,onBeforeDocumentUpload:A,onDocumentUploadProgress:L,onDocumentUploaded:O,onDocumentUploadFailed:R,onBeforeSubmit:F,onSubmit:P,geolocationEnabled:H,geolocationRequired:Z},t.createElement(rt,{preferFrontFacingCamera:!0,onCameraAccessDenied:W,debugMode:$},t.createElement(Mv,{autoStart:!1,onModelError:V,modelLoadTimeoutMs:w},t.createElement(pC,{onComplete:U,onCustomerMatched:_,onCustomerNotMatched:j,onExitCapture:B,onExitAfterFailure:z,onUserCancel:G,captureGuidanceTimeoutDurationMs:x,loadingOverlayMode:v,skipSuccessScreen:k,assets:T,classNames:I,colors:S,verbiage:N,debugMode:$}))))))},mC={frame:null,face:null,imageUrl:null,requestState:"CAPTURING",requestError:null,notFoundTimes:0},gC=function(e,t){switch(t.type){case"identificationReady":return["CAPTURING","ERROR"].includes(e.requestState)?f(f({},e),{requestState:"CAPTURED",frame:t.payload.frame,face:t.payload.face}):e;case"identifying":return f(f({},e),{requestState:"IDENTIFYING",imageUrl:t.payload.imageUrl});case"identificationCompleted":var n=t.payload.response,r=n.status,o=r.statusMessage,i=r.errorData,a=n.resultData;if("000"!==r.statusCode)return f(f({},e),{requestState:"ERROR",requestError:new Error("".concat(o,": ").concat(i))});var s=e.requestState,u=e.notFoundTimes;return"46"===a.verificationResultCode?s="FOUND":u<0?(s="CAPTURING",u+=1):s="NOT_FOUND",f(f({},e),{requestState:s,notFoundTimes:u});case"identificationFailed":return f(f({},e),{requestState:"ERROR",requestError:t.payload.error});default:return e}},vC=function(e){var n,r,i=e.onCustomerMatched,a=e.onCustomerNotMatched,s=e.onCaptureGuidanceTimeout,u=e.onExit,c=e.captureGuidanceTimeoutDurationMs,l=e.classNames,d=void 0===l?{}:l,f=e.colors,p=void 0===f?{}:f,g=e.verbiage,v=void 0===g?{}:g,y=e.debugMode,b=void 0!==y&&y,x=t.useReducer(gC,mC),C=x[0],E=x[1],k=t.useContext(_e),D=k.submit,M=k.submissionRequest,T=k.submissionResponse,I=k.submissionError,S=k.selfieImage,N=k.setSelfieImage,A=t.useState(null),L=A[0],O=A[1],R=t.useRef(null),F=t.useRef(null),P=t.useRef(null),U=t.useCallback((function(e,t){E({type:"identificationReady",payload:{frame:e,face:t}})}),[]),_=C.frame,j=C.face,B="CAPTURED"===C.requestState;t.useEffect((function(){if(_&&j&&!I){var e=kd(R.current,F.current,P.current,_,j);O(e),w(e).then((function(e){N(e)}))}}),[j,_,N,I]),t.useEffect((function(){B&&S&&!I&&h(void 0,void 0,void 0,(function(){var e,t;return m(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),E({type:"identifying",payload:{imageUrl:S}}),[4,D()];case 1:if(!(e=n.sent()))throw new Error("submission failed!");return E({type:"identificationCompleted",payload:{response:e}}),[3,3];case 2:return t=n.sent(),E({type:"identificationFailed",payload:{error:t}}),[3,3];case 3:return[2]}}))}))}),[B,i,a,S,C.requestState,I,D]),t.useEffect((function(){M&&T&&("FOUND"===C.requestState?null==i||i(T,M):"NOT_FOUND"===C.requestState&&(null==a||a(T,M)))}),[i,a,C.requestState,M,T]),Bv(c,s,["FOUND","NOT_FOUND"].includes(C.requestState),"IDENTIFYING"===C.requestState);var z=nh(v.progressPreviewText,"Processing..."),G=o.useTheme();return t.createElement(t.Fragment,null,t.createElement(Ve,{ref:R}),t.createElement(Ve,{ref:F}),t.createElement(Ve,{ref:P}),t.createElement(Qv,{onSelfieCaptured:U,onExit:u,timeoutDurationMs:c,classNames:d,colors:p,verbiage:v,debugMode:b}),!(null===(r=null===(n=G.selfieCapture)||void 0===n?void 0:n.capturePreview)||void 0===r?void 0:r.disabled)&&L&&t.createElement(Fg,{text:z,imageUrl:L,classNames:d.imagePreview}))},yC=function(e){var n=e.imageUrl,r=e.onDoneClick,o=e.onRetryClick,i=e.classNames,a=void 0===i?{}:i,s=e.colors,u=void 0===s?{}:s,c=e.verbiage,l=void 0===c?{}:c;n||(n="".concat(mh,"/Selfie-Image-1.png"));var d=rh(l,{headingText:"Customer has been identified!",retryBtnText:"Retry",doneBtnText:"Done"});return t.createElement(_,{className:a.container},t.createElement(j,{className:a.inner},t.createElement(bC,{className:a.heading},d.headingText),t.createElement(xC,{className:a.imageContainer},t.createElement("img",{alt:d.headingText,src:n,className:a.image})),t.createElement(CC,{className:a.buttonsRow},t.createElement(le,{variant:"warning",className:a.retryBtn,onClick:o,colors:u.retryBtn,finished:!0},d.retryBtnText),t.createElement(le,{variant:"positive",className:a.doneBtn,onClick:r,colors:u.doneBtn,finished:!0},d.doneBtnText))))},bC=o.h3(tx||(tx=v(["\n margin-bottom: 24px;\n"],["\n margin-bottom: 24px;\n"]))),xC=o(Dh)(nx||(nx=v(["\n max-height: calc(100vh - 185px);\n"],["\n max-height: calc(100vh - 185px);\n"]))),CC=o(Dh)(rx||(rx=v(["\n margin-top: 24px;\n"],["\n margin-top: 24px;\n"]))),wC=function(e){var n=e.canRetry,r=void 0===n||n,o=e.onRetryClick,i=e.onExitClick,a=e.assets,s=void 0===a?{}:a,u=e.classNames,c=void 0===u?{}:u,l=e.colors,d=void 0===l?{}:l,f=e.verbiage,p=void 0===f?{}:f;s.imageUrl||(s.imageUrl="".concat(mh,"/manual_capture.png"));var h=rh(p,{headingText:"Customer not found",retryBtnText:"Retry",exitBtnText:"Exit"});return t.createElement(_,{className:c.container},t.createElement(j,{className:c.inner},t.createElement(EC,{className:c.heading},h.headingText),t.createElement(kC,{className:c.imageContainer},t.createElement("img",{alt:h.headingText,src:s.imageUrl,className:c.image})),t.createElement(DC,{className:c.buttonsRow},r&&t.createElement(le,{variant:"warning",className:c.retryBtn,onClick:o,colors:d.retryBtn,finished:!0},h.retryBtnText),t.createElement(le,{variant:"secondary",className:c.exitBtn,onClick:i,colors:d.exitBtn,finished:!0},h.exitBtnText))))},EC=o.h3(ox||(ox=v(["\n margin-bottom: 24px;\n"],["\n margin-bottom: 24px;\n"]))),kC=o(Dh)(ix||(ix=v(["\n max-height: calc(100vh - 185px);\n"],["\n max-height: calc(100vh - 185px);\n"]))),DC=o(Dh)(ax||(ax=v(["\n margin-top: 24px;\n"],["\n margin-top: 24px;\n"]))),MC=function(e){var n,r=e.onComplete,o=e.onCustomerMatched,i=e.onCustomerNotMatched,a=e.onExitCapture,s=e.onExitAfterFailure,u=e.onUserCancel,c=e.onCaptureGuidanceTimeout,l=e.captureGuidanceTimeoutDurationMs,d=e.skipSuccessScreen,f=void 0!==d&&d,p=e.loadingOverlayMode,g=void 0===p?"default":p,v=e.assets,y=void 0===v?{}:v,b=e.classNames,x=void 0===b?{}:b,C=e.colors,w=void 0===C?{}:C,E=e.verbiage,k=void 0===E?{}:E,D=e.debugMode,M=void 0!==D&&D,T=t.useContext(_e),I=T.submissionResponse,S=T.submissionRequest,N=T.selfieImage,A=t.useState("LOADING"),L=A[0],R=A[1],F=t.useContext(nt),P=F.cameraAccessDenied,U=F.releaseCameraAccess,_=t.useContext(Dv),j=_.start,B=_.stop;t.useEffect((function(){if("CAPTURING"===L)return j(),function(){B()}}),[L,j,B]);var z=t.useCallback((function(e,t){return h(void 0,void 0,void 0,(function(){return m(this,(function(n){return R("FOUND"),null==o||o(e,t),[2]}))}))}),[o]),G=t.useCallback((function(e,t){return h(void 0,void 0,void 0,(function(){return m(this,(function(n){return R("NOT_FOUND"),null==i||i(e,t),[2]}))}))}),[i]),V=t.useCallback((function(){R("FAILED"),null==c||c()}),[c]),W=t.useState(0),q=W[0],H=W[1],Y=t.useCallback((function(){H((function(e){return e+1})),R("LOADING"),null==a||a()}),[a]),Z=t.useCallback((function(){U(),S&&I&&(null==r||r(I,S))}),[r,U,S,I]),Q=jm(f,"FOUND"===L,Z);return t.useEffect((function(){P&&(H((function(e){return e+1})),R("LOADING"))}),[P]),t.createElement(t.Fragment,null,t.createElement(O,{className:"flex ".concat(null!==(n=x.container)&&void 0!==n?n:"")},t.createElement(Um,{className:x.cameraFeed}),"LOADING"!==L&&function(){switch(L){case"CAPTURING":return t.createElement(vC,{key:"capture".concat(q),onCustomerMatched:z,onCustomerNotMatched:G,onCaptureGuidanceTimeout:V,onExit:Y,captureGuidanceTimeoutDurationMs:l,classNames:x,colors:w,verbiage:k,debugMode:M});case"FOUND":if(!Q)return;return t.createElement(yC,{imageUrl:"data:image/png;base64, ".concat(N),classNames:x.success,colors:w.success,verbiage:k.success,onDoneClick:Z,onRetryClick:function(){R("CAPTURING"),H(0)}});case"NOT_FOUND":case"FAILED":return t.createElement(wC,{assets:y.failure,classNames:x.failure,colors:w.failure,verbiage:k.failure,canRetry:q<2,onExitClick:function(){U(),null==s||s()},onRetryClick:function(){H((function(e){return e+1}))}});default:return null}}()),t.createElement(Vy,{key:q,mode:g,assets:y.loadingOverlay,classNames:x.loadingOverlay,colors:w.loadingOverlay,verbiage:k.loadingOverlay,onUserCancel:u,onDismissed:function(){R("CAPTURING")}}))},TC=function(e){var n=e.lang,r=e.sessionId,o=e.authUrl,i=e.submissionUrl,a=e.documentServiceUrl,s=e.companyId,u=e.needImmediateResponse,c=e.webhooksEnabled,l=e.webhooksClientTraceId,d=e.webhooksStripSpecialCharacters,f=e.webhooksSendInputImages,p=e.webhooksSendProcessedImages,h=e.sendBase64DocumentsInSwaggerProxy,m=e.loadingOverlayMode,g=void 0===m?"default":m,v=e.timeoutDurationMs,b=void 0===v?15e3:v,x=e.modelLoadTimeoutMs,C=void 0===x?Gd:x,w=e.skipSuccessScreen,E=void 0!==w&&w,k=e.onBeforeDocumentUpload,D=e.onDocumentUploadProgress,M=e.onDocumentUploaded,T=e.onDocumentUploadFailed,I=e.onBeforeSubmit,S=e.onSubmit,N=e.onComplete,A=e.onCustomerMatched,L=e.onCustomerNotMatched,O=e.onCaptureGuidanceTimeout,R=e.onExitCapture,F=e.onExitAfterFailure,P=e.onUserCancel,U=e.onModelError,_=e.onCameraAccessDenied,j=e.theme,B=void 0===j?"default":j,z=e.assets,G=e.classNames,V=e.colors,W=e.verbiage,q=e.geolocationEnabled,H=e.geolocationRequired,Y=void 0!==H&&H,Z=e.debugMode,Q=void 0!==Z&&Z;return eh(void 0===n?"auto":n),Le(Q),t.createElement(Ne,{sessionId:r,authUrl:o},t.createElement(Xx,{theme:B},t.createElement(je,{action:y.IDENTIFY,submissionUrl:i,documentServiceUrl:a,companyId:s,needImmediateResponse:u,webhooksEnabled:c,webhooksClientTraceId:l,webhooksStripSpecialCharacters:d,webhooksSendInputImages:f,webhooksSendProcessedImages:p,sendBase64DocumentsInSwaggerProxy:h,onBeforeDocumentUpload:k,onDocumentUploadProgress:D,onDocumentUploaded:M,onDocumentUploadFailed:T,onBeforeSubmit:I,onSubmit:S,geolocationEnabled:q,geolocationRequired:Y},t.createElement(rt,{preferFrontFacingCamera:!0,onCameraAccessDenied:_,debugMode:Q},t.createElement(Mv,{autoStart:!1,modelLoadTimeoutMs:C,onModelError:U},t.createElement(MC,{onComplete:N,onCustomerMatched:A,onCustomerNotMatched:L,onExitCapture:R,onExitAfterFailure:F,onUserCancel:P,onCaptureGuidanceTimeout:O,captureGuidanceTimeoutDurationMs:b,loadingOverlayMode:g,skipSuccessScreen:E,assets:z,classNames:G,colors:V,verbiage:W,debugMode:Q}))))))},IC=function(e){var n=e.lang,r=e.sessionId,o=e.clientRequestID,i=e.authUrl,a=e.submissionUrl,s=e.documentServiceUrl,u=e.sendBase64DocumentsInSwaggerProxy,c=e.onBeforeDocumentUpload,l=e.onDocumentUploadProgress,d=e.onDocumentUploaded,f=e.onDocumentUploadFailed,p=e.onBeforeSubmit,h=e.onSubmit,m=e.onComplete,g=e.onUserCancel,v=e.onModelError,b=e.onCameraAccessDenied,x=e.loadingOverlayMode,C=void 0===x?"default":x,w=e.skipSuccessScreen,E=void 0!==w&&w,k=e.idCardForFaceMatch,D=e.modelLoadTimeoutMs,M=void 0===D?Gd:D,T=e.theme,I=void 0===T?"default":T,S=e.classNames,N=e.colors,A=e.verbiage,L=e.geolocationEnabled,O=e.geolocationRequired,R=e.debugMode,F=void 0!==R&&R;return eh(void 0===n?"auto":n),Le(F),t.createElement(Ne,{sessionId:r,authUrl:i},t.createElement(Xx,{theme:I},t.createElement(je,{action:y.NONE,submissionUrl:a,clientRequestID:o,documentServiceUrl:s,idCardForFaceMatch:k,sendBase64DocumentsInSwaggerProxy:u,onBeforeDocumentUpload:c,onDocumentUploadProgress:l,onDocumentUploaded:d,onDocumentUploadFailed:f,onBeforeSubmit:p,onSubmit:h,onResponseReceived:m,geolocationEnabled:L,geolocationRequired:O},t.createElement(Qx,{checks:t.useMemo((function(){return["VideoSignatureCapture"]}),[]),onCameraAccessDenied:b,videoSignatureCaptureProps:t.useMemo((function(){return{loadingOverlayMode:C,skipSuccessScreen:E,modelLoadTimeoutMs:M,classNames:S,colors:N,debugMode:F,verbiage:A,onModelError:v,onUserCancel:g}}),[S,N,F,C,M,v,g,E,A])}))))},SC=function(e){var n=e.lang,r=e.sessionId,o=e.clientRequestID,i=e.authUrl,a=e.submissionUrl,s=e.documentServiceUrl,u=e.companyId,c=e.needImmediateResponse,l=e.manualReviewRequired,d=e.idBackImageRequired,f=e.verifyIdWithExternalDatabases,p=e.bypassAgeValidation,h=e.bypassNameMatching,m=e.personalData,g=e.cardData,v=e.idData,b=e.webhooksEnabled,x=e.webhooksClientTraceId,C=e.webhooksStripSpecialCharacters,w=e.webhooksSendInputImages,E=e.webhooksSendProcessedImages,k=e.webhooksFireOnReview,D=e.sendBase64DocumentsInSwaggerProxy,M=e.customerDataMatchConfig,T=e.onBeforeDocumentUpload,I=e.onDocumentUploadProgress,S=e.onDocumentUploaded,N=e.onDocumentUploadFailed,A=e.onSubmit,L=e.onBeforeSubmit,O=e.onComplete,R=e.onExitCapture,F=e.onExitAfterFailure,P=e.onUserCancel,U=e.onCameraAccessDenied,_=e.onMicrophoneAccessDenied,j=e.idCaptureProps,B=e.faceLivenessProps,z=e.idCaptureModelsEnabled,G=void 0===z||z,V=e.videoIdCaptureThresholds,W=void 0===V?_x:V,q=e.readTextPrompt,H=e.readTextTimeoutDurationMs,Y=void 0===H?15e3:H,Z=e.readTextMinReadingMs,Q=void 0===Z?1e4:Z,$=e.skipSuccessScreen,X=void 0!==$&&$,K=e.skipIdCapture,J=void 0!==K&&K,ee=e.skipShowIdCardBack,te=void 0!==ee&&ee,ne=e.idCaptureLoadingOverlayMode,re=void 0===ne?"default":ne,oe=e.idCaptureGuideType,ie=void 0===oe?"fit":oe,ae=e.idCapturePortraitGuidesOnMobile,se=void 0===ae||ae,ue=e.idCaptureRotateLoadingOverlayImageWhenPortrait,ce=void 0===ue||ue,le=e.idCardForFaceMatch,de=e.faceLivenessLoadingOverlayMode,fe=void 0===de?"default":de,pe=e.disableFaceDetectionWhileAudioCapture,he=void 0!==pe&&pe,me=e.disableFaceDetectionWhileAudioCaptureMsDelay,ge=void 0===me?2e3:me,ve=e.silentFallback,ye=void 0!==ve&&ve,be=e.mergeAVStreams,xe=void 0!==be&&be,Ce=e.theme,we=void 0===Ce?"default":Ce,Ee=e.assets,ke=void 0===Ee?{}:Ee,De=e.classNames,Me=void 0===De?{}:De,Te=e.colors,Ie=void 0===Te?{}:Te,Se=e.verbiage,Ae=void 0===Se?{}:Se,Oe=e.captureSignature,Re=void 0!==Oe&&Oe,Fe=e.captureSignatureVideo,Pe=void 0!==Fe&&Fe,Ue=e.captureAdditionalDocuments,_e=void 0===Ue?[]:Ue,Be=e.geolocationEnabled,ze=void 0===Be||Be,Ge=e.geolocationRequired,Ve=void 0!==Ge&&Ge,We=e.debugMode,qe=void 0!==We&&We;eh(void 0===n?"auto":n),Le(qe);var He=t.useMemo((function(){return{idCaptureProps:j,faceLivenessProps:B,idCaptureModelsEnabled:G,videoIdCaptureThresholds:W,readTextPrompt:q,readTextTimeoutDurationMs:Y,readTextMinReadingMs:Q,onExitCapture:R,onExitAfterFailure:F,onUserCancel:P,skipSuccessScreen:X,skipIdCapture:J,skipShowIdCardBack:te,idCaptureLoadingOverlayMode:re,idCaptureGuideType:ie,idCapturePortraitGuidesOnMobile:se,idCaptureRotateLoadingOverlayImageWhenPortrait:ce,faceLivenessLoadingOverlayMode:fe,disableFaceDetectionWhileAudioCapture:he,disableFaceDetectionWhileAudioCaptureMsDelay:ge,silentFallback:ye,mergeAVStreams:xe,assets:ke,classNames:Me,colors:Ie,verbiage:Ae,debugMode:qe}}),[j,B,G,W,q,Y,Q,R,F,P,X,J,te,re,ie,se,ce,fe,he,ge,ye,xe,ke,Me,Ie,Ae,qe]),Ye=t.useMemo((function(){return{documents:_e,classNames:Me.additionalDocumentCapture,verbiage:Ae.additionalDocumentCapture}}),[_e,Me.additionalDocumentCapture,Ae.additionalDocumentCapture]),Ze=t.useMemo((function(){return{classNames:Me.signatureCapture,verbiage:Ae.signatureCapture}}),[Me.signatureCapture,Ae.signatureCapture]),Qe=t.useMemo((function(){return{onExitCapture:R,onUserCancel:P,skipSuccessScreen:X,classNames:Me.videoSignatureCapture,colors:Ie.videoSignatureCapture,verbiage:Ae.videoSignatureCapture,debugMode:qe}}),[Me.videoSignatureCapture,Ie.videoSignatureCapture,qe,R,P,X,Ae.videoSignatureCapture]);return t.createElement(Ne,{sessionId:r,authUrl:i},t.createElement(Xx,{theme:we},t.createElement(je,{action:J?y.NONE:y.VALIDATE,submissionUrl:a,clientRequestID:o,documentServiceUrl:s,companyId:u,needImmediateResponse:c,manualReviewRequired:l,idBackImageRequired:d,verifyIdWithExternalDatabases:f,bypassAgeValidation:p,bypassNameMatching:h,personalData:m,cardData:g,idData:v,webhooksEnabled:b,webhooksClientTraceId:x,webhooksStripSpecialCharacters:C,webhooksSendInputImages:w,webhooksSendProcessedImages:E,webhooksFireOnReview:k,sendBase64DocumentsInSwaggerProxy:D,customerDataMatchConfig:M,idCardForFaceMatch:le,onBeforeDocumentUpload:T,onDocumentUploadProgress:I,onDocumentUploaded:S,onDocumentUploadFailed:N,onSubmit:A,onBeforeSubmit:L,onResponseReceived:O,geolocationEnabled:ze,geolocationRequired:Ve},t.createElement(Qx,{checks:t.useMemo((function(){return["VideoIdCapture"]}),[]),videoIdCaptureProps:He,additionalDocumentCaptureProps:Ye,signatureCaptureProps:Ze,videoSignatureCaptureProps:Qe,captureSignature:Re,captureSignatureVideo:Pe,onCameraAccessDenied:U,onMicrophoneAccessDenied:_,debugMode:qe}))))},NC=function(e){var n=e.enrollmentId,r=e.lang,o=e.sessionId,i=e.authUrl,a=e.submissionUrl,s=e.documentServiceUrl,u=e.companyId,c=e.needImmediateResponse,l=e.deduplicationEnabled,d=e.deduplicationSynchronous,f=e.webhooksEnabled,p=e.webhooksClientTraceId,h=e.webhooksStripSpecialCharacters,m=e.webhooksSendInputImages,g=e.webhooksSendProcessedImages,v=e.sendBase64DocumentsInSwaggerProxy,b=e.loadingOverlayMode,x=void 0===b?"default":b,C=e.timeoutDurationMs,w=void 0===C?15e3:C,E=e.modelLoadTimeoutMs,k=void 0===E?Gd:E,D=e.skipSuccessScreen,M=void 0!==D&&D,T=e.onBeforeDocumentUpload,I=e.onDocumentUploadProgress,S=e.onDocumentUploaded,N=e.onDocumentUploadFailed,A=e.onBeforeSubmit,L=e.onSubmit,O=e.onComplete,R=e.onEnrolled,F=e.onDenied,P=e.onExitCapture,U=e.onExitAfterFailure,_=e.onUserCancel,j=e.onModelError,B=e.onCameraAccessDenied,z=e.captureAdditionalDocuments,G=void 0===z?[]:z,V=e.captureSignature,W=void 0!==V&&V,q=e.captureSignatureVideo,H=void 0!==q&&q,Y=e.theme,Z=void 0===Y?"default":Y,Q=e.assets,$=void 0===Q?{}:Q,X=e.classNames,K=void 0===X?{}:X,J=e.colors,ee=void 0===J?{}:J,te=e.verbiage,ne=void 0===te?{}:te,re=e.geolocationEnabled,oe=void 0===re||re,ie=e.geolocationRequired,ae=void 0!==ie&&ie,se=e.debugMode,ue=void 0!==se&&se;eh(void 0===r?"auto":r),Le(ue);var ce=t.useMemo((function(){return{onExitCapture:P,onUserCancel:_,onExitAfterFailure:U,onModelError:j,timeoutDurationMs:w,modelLoadTimeoutMs:k,loadingOverlayMode:x,skipSuccessScreen:M,assets:$.faceLiveness,classNames:K.faceLiveness,colors:ee.faceLiveness,verbiage:ne.faceLiveness,debugMode:ue}}),[$.faceLiveness,K.faceLiveness,ee.faceLiveness,ue,x,k,U,P,j,_,M,w,ne.faceLiveness]),le=t.useMemo((function(){return{documents:G,classNames:K.additionalDocumentCapture,verbiage:ne.additionalDocumentCapture}}),[G,K.additionalDocumentCapture,ne.additionalDocumentCapture]),de=t.useMemo((function(){return{classNames:K.signatureCapture,verbiage:ne.signatureCapture}}),[K.signatureCapture,ne.signatureCapture]),fe=t.useMemo((function(){return{onExitCapture:P,onUserCancel:_,skipSuccessScreen:M,classNames:K.videoSignatureCapture,colors:ee.videoSignatureCapture,verbiage:ne.videoSignatureCapture,debugMode:ue}}),[K.videoSignatureCapture,ee.videoSignatureCapture,ue,P,_,M,ne.videoSignatureCapture]),pe=t.useCallback((function(e,t){null==O||O(e,t),"Customer Onboarded"===e.resultData.verificationResult?null==R||R(e,t):null==F||F(e,t)}),[R,O,F]);return t.createElement(Ne,{sessionId:o,authUrl:i},t.createElement(Xx,{theme:Z},t.createElement(je,{action:y.ENROLL,submissionUrl:a,documentServiceUrl:s,companyId:u,enrollmentId:n,needImmediateResponse:c,deduplicationEnabled:l,deduplicationSynchronous:d,webhooksEnabled:f,webhooksClientTraceId:p,webhooksStripSpecialCharacters:h,webhooksSendInputImages:m,webhooksSendProcessedImages:g,sendBase64DocumentsInSwaggerProxy:v,onBeforeDocumentUpload:T,onDocumentUploadProgress:I,onDocumentUploaded:S,onDocumentUploadFailed:N,onBeforeSubmit:A,onSubmit:L,onResponseReceived:pe,geolocationEnabled:oe,geolocationRequired:ae},t.createElement(Qx,{checks:t.useMemo((function(){return["FaceLiveness"]}),[]),faceLivenessProps:ce,additionalDocumentCaptureProps:le,signatureCaptureProps:de,videoSignatureCaptureProps:fe,captureSignature:W,captureSignatureVideo:H,onCameraAccessDenied:B,debugMode:ue}))))},AC=function(e){var n=e.lang,r=e.sessionId,o=e.authUrl,i=e.submissionUrl,a=e.documentServiceUrl,s=e.sendBase64DocumentsInSwaggerProxy,u=e.onBeforeDocumentUpload,c=e.onDocumentUploadProgress,l=e.onDocumentUploaded,d=e.onDocumentUploadFailed,f=e.onComplete,p=e.onExitCapture,h=e.onUserCancel,m=e.onCameraAccessDenied,g=e.documents,v=void 0===g?[]:g,b=e.aspectRatio,x=e.cameraFeedMode,C=e.instructions,w=e.theme,E=void 0===w?"default":w,k=e.classNames,D=void 0===k?{}:k,M=e.verbiage,T=void 0===M?{}:M,I=e.geolocationEnabled,S=void 0===I||I,N=e.geolocationRequired,A=void 0!==N&&N,L=e.debugMode,O=void 0!==L&&L;return eh(void 0===n?"auto":n),Le(O),t.createElement(Ne,{sessionId:r,authUrl:o},t.createElement(Xx,{theme:E},t.createElement(je,{action:y.NONE,submissionUrl:i,documentServiceUrl:a,sendBase64DocumentsInSwaggerProxy:s,onBeforeDocumentUpload:u,onDocumentUploadProgress:c,onDocumentUploaded:l,onDocumentUploadFailed:d,geolocationEnabled:S,geolocationRequired:A},t.createElement(rt,{requestAccessAutomatically:!1,preferContinuityCamera:!0,onCameraAccessDenied:m,debugMode:O},t.createElement(rv,{onSuccess:f,onExitCapture:p,onUserCancel:h,documents:v,aspectRatio:b,cameraFeedMode:x,instructions:C,classNames:D,verbiage:T})))))};function LC(e,n,r){return r||(r=n,n=void 0),function(e,n){if("string"==typeof n){var r=document.querySelector(n);if(!r)throw new Error("targetElement ".concat(n," not found"));n=r}else n||(n=document.createElement("div"),document.body.append(n));var o=c.createRoot(n);if(o.render(t.createElement(_,null,e)),"remove"in n){var i=n.remove;n.remove=function(){try{o.unmount(),i()}catch(e){}}}return n}(t.createElement(e,f({},r)),n)}Kp.use(lp).use(re).init({resources:Jp,detection:{caches:[]},fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1}});var OC=function(e,t){return LC(Kx,e,t)},RC=function(e,t){return LC(Jx,e,t)},FC=function(e,t){return LC(eC,e,t)},PC=function(e,t){return LC(tC,e,t)},UC=function(e,t){return LC(NC,e,t)},_C=function(e,t){return LC(hC,e,t)},jC=function(e,t){return LC(TC,e,t)},BC=function(e,t){return LC(IC,e,t)},zC=function(e,t){return LC(SC,e,t)},GC=function(e,t){return LC(AC,e,t)};globalThis.IDmissionSDK={renderIdValidation:OC,renderFaceValidation:RC,renderIdAndFaceValidation:FC,renderCustomerIdAndBiometricsEnrollment:PC,renderCustomerBiometricsEnrollment:UC,renderCustomerVerification:_C,renderCustomerIdentification:jC,renderSignatureKYC:BC,renderVideoIdValidation:zC,renderDocumentCapture:GC,preloadModels:Wd,themes:$x,version:x,ready:!0,authMode:"session",allowedAuthUrls:ke,defaultAuthUrl:e.defaultAuthUrl,defaultSubmissionUrl:e.defaultSubmissionUrl,setServerUrl:Ue};var VC=function(){return VC=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},VC.apply(this,arguments)},WC={lines:12,length:7,width:5,radius:10,scale:1,corners:1,color:"#000",fadeColor:"transparent",animation:"spinner-line-fade-default",rotate:0,direction:1,speed:1,zIndex:2e9,className:"spinner",top:"50%",left:"50%",shadow:"0 0 1px transparent",position:"absolute"},qC=function(){function e(e){void 0===e&&(e={}),this.opts=VC(VC({},WC),e)}return e.prototype.spin=function(e){return this.stop(),this.el=document.createElement("div"),this.el.className=this.opts.className,this.el.setAttribute("role","progressbar"),this.el.style.position=this.opts.position,this.el.style.width="0",this.el.style.zIndex=this.opts.zIndex.toString(),this.el.style.left=this.opts.left,this.el.style.top=this.opts.top,this.el.style.transform="scale(".concat(this.opts.scale,")"),e&&e.insertBefore(this.el,e.firstChild||null),function(e,t){var n=Math.round(t.corners*t.width*500)/1e3+"px",r="none";!0===t.shadow?r="0 2px 4px #000":"string"==typeof t.shadow&&(r=t.shadow);for(var o=function(e){for(var t=/^\s*([a-zA-Z]+\s+)?(-?\d+(\.\d+)?)([a-zA-Z]*)\s+(-?\d+(\.\d+)?)([a-zA-Z]*)(.*)$/,n=[],r=0,o=e.split(",");r<o.length;r++){var i=o[r].match(t);if(null!==i){var a=+i[2],s=+i[5],u=i[4],c=i[7];0!==a||u||(u=c),0!==s||c||(c=u),u===c&&n.push({prefix:i[1]||"",x:a,y:s,xUnits:u,yUnits:c,end:i[8]})}}return n}(r),i=0;i<t.lines;i++){var a=~~(360/t.lines*i+t.rotate),s=document.createElement("div");s.style.position="absolute",s.style.top="".concat(-t.width/2,"px"),s.style.width=t.length+t.width+"px",s.style.height=t.width+"px",s.style.background=HC(t.fadeColor,i),s.style.borderRadius=n,s.style.transformOrigin="left",s.style.transform="rotate(".concat(a,"deg) translateX(").concat(t.radius,"px)");var u=i*t.direction/t.lines/t.speed;u-=1/t.speed;var c=document.createElement("div");c.style.width="100%",c.style.height="100%",c.style.background=HC(t.color,i),c.style.borderRadius=n,c.style.boxShadow=YC(o,a),c.style.animation="".concat(1/t.speed,"s linear ").concat(u,"s infinite ").concat(t.animation),s.appendChild(c),e.appendChild(s)}}(this.el,this.opts),this},e.prototype.stop=function(){return this.el&&(this.el.parentNode&&this.el.parentNode.removeChild(this.el),this.el=void 0),this},e}();function HC(e,t){return"string"==typeof e?e:e[t%e.length]}function YC(e,t){for(var n=[],r=0,o=e;r<o.length;r++){var i=o[r],a=ZC(i.x,i.y,t);n.push(i.prefix+a[0]+i.xUnits+" "+a[1]+i.yUnits+i.end)}return n.join(", ")}function ZC(e,t,n){var r=n*Math.PI/180,o=Math.sin(r),i=Math.cos(r);return[Math.round(1e3*(e*i+t*o))/1e3,Math.round(1e3*(-e*o+t*i))/1e3]}var QC=[];function $C(e){if(void 0!==e){if(e.classList.contains("ladda-button")||e.classList.add("ladda-button"),e.hasAttribute("data-style")||e.setAttribute("data-style","expand-right"),!e.querySelector(".ladda-label")){var t=document.createElement("span");t.className="ladda-label",function(e,t){var n=document.createRange();n.selectNodeContents(e),n.surroundContents(t),e.appendChild(t)}(e,t)}var n,r,o=e.querySelector(".ladda-spinner");o||((o=document.createElement("span")).className="ladda-spinner"),e.appendChild(o);var i={start:function(){return r||(r=function(e){var t,n,r=e.offsetHeight;0===r&&(r=parseFloat(window.getComputedStyle(e).height));r>32&&(r*=.8);e.hasAttribute("data-spinner-size")&&(r=parseInt(e.getAttribute("data-spinner-size"),10));e.hasAttribute("data-spinner-color")&&(t=e.getAttribute("data-spinner-color"));e.hasAttribute("data-spinner-lines")&&(n=parseInt(e.getAttribute("data-spinner-lines"),10));var o=.2*r;return new qC({color:t||"#fff",lines:n||12,radius:o,length:.6*o,width:o<7?2:3,animation:"ladda-spinner-line-fade",zIndex:"auto",top:"auto",left:"auto",className:""})}(e)),e.disabled=!0,e.setAttribute("data-loading",""),clearTimeout(n),r.spin(o),this.setProgress(0),this},startAfter:function(e){return clearTimeout(n),n=setTimeout((function(){i.start()}),e),this},stop:function(){return i.isLoading()&&(e.disabled=!1,e.removeAttribute("data-loading")),clearTimeout(n),r&&(n=setTimeout((function(){r.stop()}),1e3)),this},toggle:function(){return this.isLoading()?this.stop():this.start()},setProgress:function(t){t=Math.max(Math.min(t,1),0);var n=e.querySelector(".ladda-progress");0===t&&n&&n.parentNode?n.parentNode.removeChild(n):(n||((n=document.createElement("div")).className="ladda-progress",e.appendChild(n)),n.style.width=(t||0)*e.offsetWidth+"px")},isLoading:function(){return e.hasAttribute("data-loading")},remove:function(){clearTimeout(n),e.disabled=!1,e.removeAttribute("data-loading"),r&&(r.stop(),r=null),QC.splice(QC.indexOf(i),1)}};return QC.push(i),i}console.warn("Ladda button target must be defined.")}function XC(e,t){if("function"==typeof e.addEventListener){var n=$C(e),r=-1;e.addEventListener("click",(function(){var o=!0,i=function(e,t){for(;e.parentNode&&e.tagName!==t;)e=e.parentNode;return t===e.tagName?e:void 0}(e,"FORM");void 0===i||i.hasAttribute("novalidate")||"function"==typeof i.checkValidity&&(o=i.checkValidity()),o&&(n.startAfter(1),"number"==typeof t.timeout&&(clearTimeout(r),r=setTimeout(n.stop,t.timeout)),"function"==typeof t.callback&&t.callback.apply(null,[n]))}),!1)}}var KC=Object.freeze({__proto__:null,bind:function(e,t){var n;if("string"==typeof e)n=document.querySelectorAll(e);else{if("object"!=typeof e)throw new Error("target must be string or object");n=[e]}t=t||{};for(var r=0;r<n.length;r++)XC(n[r],t)},create:$C,stopAll:function(){for(var e=0,t=QC.length;e<t;e++)QC[e].stop()}});e.CapturedDocumentImg=Tm,e.CustomerBiometricsEnrollment=NC,e.CustomerIdAndBiometricsEnrollment=tC,e.CustomerIdentification=TC,e.CustomerVerification=hC,e.DocumentCapture=AC,e.FaceValidation=Jx,e.IdAndFaceValidation=eC,e.IdValidation=Kx,e.SignatureKYC=IC,e.VideoIdValidation=SC,e.allowedAuthUrls=ke,e.preloadModels=Wd,e.renderCustomerBiometricsEnrollment=UC,e.renderCustomerIdAndBiometricsEnrollment=PC,e.renderCustomerIdentification=jC,e.renderCustomerVerification=_C,e.renderDocumentCapture=GC,e.renderFaceValidation=RC,e.renderIdAndFaceValidation=FC,e.renderIdValidation=OC,e.renderSignatureKYC=BC,e.renderVideoIdValidation=zC,e.setServerUrl=Ue,e.themes=$x}));
2
2
  //# sourceMappingURL=sdk2.umd.production.js.map