@tsocial/tvweb-sdk.dop 5.14.0-alpha.6 → 5.14.0-alpha.7
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.
|
@@ -68,4 +68,4 @@ var ms={};void 0!==ms.asn1&&ms.asn1||(ms.asn1={}),ms.asn1.ASN1Util=new function(
|
|
|
68
68
|
*
|
|
69
69
|
* This source code is licensed under the MIT license found in the
|
|
70
70
|
* LICENSE file in the root directory of this source tree.
|
|
71
|
-
*/function Ic(e){if("object"==typeof e&&null!==e){var r=e.$$typeof;switch(r){case lc:switch(e=e.type){case vc:case yc:case fc:case hc:case pc:case Cc:return e;default:switch(e=e&&e.$$typeof){case gc:case bc:case Bc:case kc:case mc:return e;default:return r}}case dc:return r}}}function Tc(e){return Ic(e)===yc}var xc={AsyncMode:vc,ConcurrentMode:yc,ContextConsumer:gc,ContextProvider:mc,Element:lc,ForwardRef:bc,Fragment:fc,Lazy:Bc,Memo:kc,Portal:dc,Profiler:hc,StrictMode:pc,Suspense:Cc,isAsyncMode:function(e){return Tc(e)||Ic(e)===vc},isConcurrentMode:Tc,isContextConsumer:function(e){return Ic(e)===gc},isContextProvider:function(e){return Ic(e)===mc},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===lc},isForwardRef:function(e){return Ic(e)===bc},isFragment:function(e){return Ic(e)===fc},isLazy:function(e){return Ic(e)===Bc},isMemo:function(e){return Ic(e)===kc},isPortal:function(e){return Ic(e)===dc},isProfiler:function(e){return Ic(e)===hc},isStrictMode:function(e){return Ic(e)===pc},isSuspense:function(e){return Ic(e)===Cc},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===fc||e===yc||e===hc||e===pc||e===Cc||e===wc||"object"==typeof e&&null!==e&&(e.$$typeof===Bc||e.$$typeof===kc||e.$$typeof===mc||e.$$typeof===gc||e.$$typeof===bc||e.$$typeof===Sc||e.$$typeof===_c||e.$$typeof===Ac||e.$$typeof===Ec)},typeOf:Ic},Pc=(Hs((function(e,r){})),Hs((function(e){e.exports=xc}))),Rc={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Dc={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Nc={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Lc={};function Oc(e){return Pc.isMemo(e)?Nc:Lc[e.$$typeof]||Rc}Lc[Pc.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Lc[Pc.Memo]=Nc;var Mc=Object.defineProperty,Fc=Object.getOwnPropertyNames,Uc=Object.getOwnPropertySymbols,Vc=Object.getOwnPropertyDescriptor,jc=Object.getPrototypeOf,zc=Object.prototype;var Kc=function e(r,t,n){if("string"!=typeof t){if(zc){var a=jc(t);a&&a!==zc&&e(r,a,n)}var o=Fc(t);Uc&&(o=o.concat(Uc(t)));for(var i=Oc(r),s=Oc(t),c=0;c<o.length;++c){var u=o[c];if(!(Dc[u]||n&&n[u]||s&&s[u]||i&&i[u])){var l=Vc(t,u);try{Mc(r,u,l)}catch(e){}}}}return r};function Hc(){return"function"==typeof navigator.enumerateDevices?navigator.enumerateDevices():"object"===B(navigator.mediaDevices)&&"function"==typeof navigator.mediaDevices.enumerateDevices?navigator.mediaDevices.enumerateDevices():new Promise((function(e,r){try{if(null==window.MediaStreamTrack||null==window.MediaStreamTrack.getSources)throw new Error;window.MediaStreamTrack.getSources((function(r){e(r.filter((function(e){return"video"===e.kind.toLowerCase()||"videoinput"===e.kind.toLowerCase()})).map((function(e){return{deviceId:null!=e.deviceId?e.deviceId:"",groupId:e.groupId,kind:"videoinput",label:e.label,toJSON:function(){return this}}})))}))}catch(e){return r(e)}}))}var qc,Gc,Wc,Qc,Xc,Yc=["camtwist","manycam","obs virtual","logi capture","iglasses","splitcam","virtual"],Zc=function(e){if(!e)return{isVirtual:!1};var r=e.getTracks();if(!r||!r.length)return{isVirtual:!1};var t=r[0].label,n=t&&Yc.some((function(e){return t.toLowerCase().includes(e)}));return{deviceLabel:t,isVirtual:n}},$c=function(e,r){return!e||(1===navigator.maxTouchPoints||navigator.plugins.length>0&&!r)},Jc=function(){var e,r;return{updateTime:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"start";"start"===n?e=t:"end"===n&&(r=t)},getStart:function(){return e},getEnd:function(){return r}}},eu=K.Errors,ru=1e3,tu=m.div(qc||(qc=L(["\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background: #000;\n display: flex;\n justify-content: center;\n z-index: ",";\n ","\n"])),1e3,(function(e){return e.checkCameraMode&&"opacity: 0;"})),nu=m.video(Gc||(Gc=L(["\n width: 100%;\n ","\n"])),(function(e){return e.flipHorizontal&&"\n transform: scale(".concat(-1*e.scale,", ").concat(1*e.scale,");\n ")})),au=m.div(Wc||(Wc=L(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),ou=m(au)(Qc||(Qc=L(["\n z-index: ",";\n position: fixed;\n top: 20px;\n right: 20px;\n width: 20px;\n"])),2e3),iu=m.div(Xc||(Xc=L(["\n z-index: ",";\n position: absolute;\n top: 40px;\n color: red;\n"])),1020),su=r.createRef(),cu=function(){if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)return navigator.mediaDevices;var e=navigator.mozGetUserMedia||navigator.webkitGetUserMedia;return e?{getUserMedia:function(r){return new Promise((function(t,n){e.call(navigator,r,t,n)}))}}:null}();function uu(e){var t=e.checkCameraMode,n=e.frontCamera,s=e.onClose,u=e.children,l=e.onVideoPlayed,d=e.flipHorizontal,f=e.videoSettings,p=e.refVideo,h=e.onError,m=e.closeButton,g=e.videoClassName,v=e.scale,y=e.defaultCameraId,b=e.onWarning,C=a(),w=$t.useSDKSettings().lang,k=Pn.useSDKTracking().sendEvent,B=Nn.useAsset("ic_close.png"),E=O(c(""),2),_=E[0],A=E[1],I=a(!1),T=a(!1),P=a(!1),R=a(),D=a([]),N=a(""),L=o((function(e){h&&h(e)}),[h]),M=o((function(){try{var e;clearInterval(C.current),(null==p||null===(e=p.current)||void 0===e?void 0:e.srcObject)instanceof MediaStream&&(p.current.srcObject.getTracks().forEach((function(e){return e.stop()})),p.current.srcObject=null)}catch(e){}clearTimeout(R)}),[p]);function F(){return U.apply(this,arguments)}function U(){return(U=S(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Hc();case 3:r=e.sent,D.current=r.filter((function(e){return e.deviceId&&"videoinput"===e.kind})),Rs.addExifData("device_info.camera_list",JSON.stringify(D.current.map((function(e){return e.label})))),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),console.error(e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})))).apply(this,arguments)}C.current||(C.current=setInterval((function(){document.getElementById("tv-camera-".concat(C.current))||M()}),1e3)),i((function(){return function(){P.current=!0}}),[]);var V=o((function(){R.current||(R.current=setTimeout((function(){I.current||(A(eu.camera_timeout.msg[w]),L(eu.camera_timeout))}),2e4))}),[w,L]),j=o(function(){var e=S(regeneratorRuntime.mark((function e(r){var t,a,o,i,s,c,u,l,d,p,h=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=h.length>1&&void 0!==h[1]&&h[1],a={},!1!==window.tv_last_req_camera_complete){e.next=5;break}return b&&b("too_many_request_to_camera"),e.abrupt("return",new Promise((function(e){return e(null)})));case 5:return window.tv_last_req_camera_complete=!1,a=qs.isMobile?qs.isIOS?{width:{ideal:1460},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{height:{ideal:720},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{width:{ideal:9999}},o=Jc(),i=o.updateTime,s=o.getStart,c=o.getEnd,e.prev=8,u=f||a,i(performance.now(),"start"),$c(qs.isMobile,qs.isIOS)&&n&&(u={}),t&&(u={}),Rs.addExifData("device_info.camera_label_dimension.req",JSON.stringify(u)),l={audio:!1,video:x(x({},r?{deviceId:r}:{facingMode:n?"user":"environment"}),u)},e.next=17,cu.getUserMedia(l);case 17:return d=e.sent,e.next=20,F();case 20:return e.next=22,new Promise((function(e){return setTimeout(e,300)}));case 22:if(V(),d){e.next=27;break}return A(eu.not_supported.msg[w]),L(eu.not_supported),e.abrupt("return",null);case 27:i(performance.now(),"end"),window.tv_last_req_camera_complete=!0,c()-s()<1600?k({tag:"cam_permission",event:"user_activity.cam",log:{already_enable:!0}}):k({tag:"cam_permission",event:"user_activity.allow",log:{}});try{p=d.getVideoTracks()[0].getSettings(),Rs.addExifData("device_info.camera_label_dimension.got","".concat(p.width,"x").concat(p.height))}catch(e){}return e.abrupt("return",d);case 34:e.prev=34,e.t0=e.catch(8),i(performance.now(),"end"),"NotAllowedError"===e.t0.name?(A(eu.no_permission.msg[w]),L(eu.no_permission),T.current=!0,k({tag:"cam_permission",event:"user_activity.cam",log:c()-s()<1600?{already_block:!0}:{click_block_on_popup:!0}})):T.current&&("NotReadableError"===e.t0.name?(L(eu.not_readable),A(eu.not_readable.msg[w])):(A(e.t0.message),L({code:e.t0.name||e.t0.code,message:e.t0.message})));case 38:return window.tv_last_req_camera_complete=!0,e.abrupt("return",null);case 40:case"end":return e.stop()}}),e,null,[[8,34]])})));return function(r){return e.apply(this,arguments)}}(),[n,f,w,L,b,V,k]),z=o(S(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c,u,d,f=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=f.length>0&&void 0!==f[0]?f[0]:y,a=f.length>1&&void 0!==f[1]&&f[1],!(null!=(o=p.current)&&null!==(r=o.srcObject)&&void 0!==r&&r.id&&null!=o&&null!==(t=o.srcObject)&&void 0!==t&&t.active&&I.current)){e.next=5;break}return e.abrupt("return");case 5:return o.oncanplaythrough=function(){var e,r,t;o.play(),Rs.addExifData("device_info.camera_label",null===(e=i)||void 0===e||null===(r=e.getVideoTracks())||void 0===r||null===(t=r[0])||void 0===t?void 0:t.label),I.current=!0,A("");var n=window.innerWidth,a=window.innerHeight,s=ca.analyzeVideoAndWindowSizes(o),c=s.lostX,u=void 0===c?0:c,d=s.lostY,f=void 0===d?0:d,p=Math.min(n,Math.floor(n-2*u)),h=Math.min(a,Math.floor(a-2*f));l&&l({clientWidth:n,clientHeight:a,videoAreaWidth:p,videoAreaHeight:h,lostX:u,lostY:f})},e.next=8,j(n,a);case 8:i=e.sent,s=Zc(i),c=s.deviceLabel,(u=s.isVirtual)&&(N.current+="".concat(c,", "),(d=D.current.filter((function(e){return!N.current.includes(e.label)})))[0]&&d[0].deviceId&&z(d[0].deviceId)),i||T.current||(Rs.addExifData("device_info.camera_label_retry","yes"),T.current=!0,z(n,!0)),i&&P.current&&(p.current.srcObject=i,M()),!i||P.current||u||(o.srcObject=i);case 14:case"end":return e.stop()}}),e)}))),[p,j,l,y,M]);i((function(){function e(){return(e=S(regeneratorRuntime.mark((function e(){var r,t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z();case 2:return e.next=4,Hc();case 4:r=e.sent,(t=r.filter((function(e){return"videoinput"===e.kind&&e.label.includes("back")&&e.label.includes("0")}))).length>0&&(n=t[0].deviceId,M(),z(n));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var r=p.current;return I.current?function(){}:(!cu||qs.browserName&&["facebook"].includes(qs.browserName.toLowerCase())||qs.getUA.includes("Zalo iOS")?(A(eu.not_supported.msg[w]),L(eu.not_supported)):r&&(qs.isAndroid&&!1===n?function(){e.apply(this,arguments)}():z()),function(){P.current&&M()})}),[p,w,n,z,M,L]);var K=o((function(){M(),s&&s(),k({tag:"result",event:"user_activity.cancel",log:{}})}),[s,M,k]);return r.createElement(tu,{id:"tv-camera-".concat(C.current),checkCameraMode:t},function(){if(!_)return null;var e=eu.no_permission.msg[w];return _===e&&qs.isIOS?r.createElement(iu,null,_," ",r.createElement("button",{onClick:function(){window.location.reload()}},{vi:"Cấp lại quyền truy cập camera",en:"Request camera permission"}[w])):r.createElement(iu,null,_)}(),r.createElement(nu,{ref:p,playsInline:!0,muted:!0,flipHorizontal:d,className:g,scale:v}),u,m?r.cloneElement(m,{onClick:K,"data-testid":"close-camera"}):r.createElement(ou,{onClick:K,"data-testid":"close-camera"},r.createElement("img",{src:B,alt:""})))}uu.propTypes={checkCameraMode:h.bool,frontCamera:h.bool,onClose:h.func,onError:h.func,onVideoPlayed:h.func,children:h.node,flipHorizontal:h.bool,videoSettings:h.object,refVideo:h.object,closeButton:h.node,videoClassName:h.string,scale:h.number,defaultCameraId:h.string,onWarning:h.func},uu.defaultProps={checkCameraMode:!1,frontCamera:!0,onClose:null,onError:null,onVideoPlayed:null,children:null,flipHorizontal:!1,videoSettings:null,refVideo:null,closeButton:null,videoClassName:"",scale:1,defaultCameraId:void 0,onWarning:null};var lu,du,fu,pu=function(e,t,n){class a extends s{constructor(){super(...arguments),this.updateDebounced=cc(this.forceUpdate,t,n)}shouldComponentUpdate(){return this.updateDebounced(),!1}componentWillUnmount(){this.updateDebounced.cancel()}render(){return r.createElement(e,Object.assign({},this.props))}}return a.displayName=`debounceRender(${e.displayName||e.name||"Component"})`,Kc(a,e)}(uu,250),hu=r.forwardRef((function(e,t){return r.createElement(pu,I({},e,{refVideo:t||su}))})),mu=m.table(lu||(lu=L(["\n width: 100%;\n height: 100%;\n td {\n text-align: center;\n vertical-align: middle;\n padding: 0;\n border: 0;\n }\n border-spacing: 0;\n table-layout: auto;\n border-collapse: collapse;\n"]))),gu=m.div(du||(du=L(["\n position: relative;\n"]))),vu=Array.from(Array(3).keys()),yu=Array.from(Array(3).keys());function bu(e){var t=e.children,n=e.x,a=e.y,o=e.width,i=e.height,s=e.className,c=e.surroundStyle;return r.createElement(mu,{className:s},r.createElement("tbody",null,vu.map((function(e,s){return r.createElement("tr",{key:e,style:{height:0===s?a:"auto"},"data-testid":"row"},yu.map((function(e,a){var u=1===s&&1===a,l="auto";return u?l=o:0===a&&(l=n),r.createElement("td",{"data-testid":u?"centeredCell":"cell",key:e,style:x({width:l,height:u?i:"auto"},u?{}:c)},u?r.createElement(gu,{style:{width:l,height:i}},t):null)})))}))))}bu.propTypes={children:h.node,x:h.string,y:h.string,width:h.string,height:h.string,className:h.string,surroundStyle:h.object},bu.defaultProps={children:null,x:"auto",y:"auto",width:"auto",height:"auto",className:"",surroundStyle:{}};var Cu=m(bu)(fu||(fu=L(["\n background: transparent;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n"])));function wu(e){var t=e.className;return r.createElement("svg",{className:t,width:"38px",height:"32px",viewBox:"0 0 24 21","data-testid":"camera-icon"},r.createElement("title",null,"FA45C15C-1E21-4D7B-9585-07FB9F999CB8"),r.createElement("desc",null,"Created with sketchtool."),r.createElement("g",{id:"Web-demo",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"step1",transform:"translate(-950.000000, -380.000000)",fill:"currentColor",fillRule:"nonzero"},r.createElement("g",{id:"Group",transform:"translate(950.000000, 380.000000)"},r.createElement("g",{id:"Group-2"},r.createElement("g",{id:"camera"},r.createElement("path",{d:"M21,3 L17,3 L15,0 L9,0 L7,3 L3,3 C1.34314575,3 0,4.34314575 0,6 L0,18 C0,19.6568542 1.34314575,21 3,21 L21,21 C22.6568542,21 24,19.6568542 24,18 L24,6 C24,4.34314575 22.6568542,3 21,3 Z M12,17 C9.23857625,17 7,14.7614237 7,12 C7,9.23857625 9.23857625,7 12,7 C14.7614237,7 17,9.23857625 17,12 C17,14.7614237 14.7614237,17 12,17 L12,17 Z",id:"Shape"})))))))}wu.propTypes={className:h.string},wu.defaultProps={className:""};var ku=function(e){var r=typeof e;return null!=e&&("object"==r||"function"==r)},Bu="object"==typeof zs&&zs&&zs.Object===Object&&zs,Eu="object"==typeof self&&self&&self.Object===Object&&self,Su=Bu||Eu||Function("return this")(),_u=function(){return Su.Date.now()},Au=/\s/;var Iu=function(e){for(var r=e.length;r--&&Au.test(e.charAt(r)););return r},Tu=/^\s+/;var xu=function(e){return e?e.slice(0,Iu(e)+1).replace(Tu,""):e},Pu=Su.Symbol,Ru=Object.prototype,Du=Ru.hasOwnProperty,Nu=Ru.toString,Lu=Pu?Pu.toStringTag:void 0;var Ou=function(e){var r=Du.call(e,Lu),t=e[Lu];try{e[Lu]=void 0;var n=!0}catch(e){}var a=Nu.call(e);return n&&(r?e[Lu]=t:delete e[Lu]),a},Mu=Object.prototype.toString;var Fu=function(e){return Mu.call(e)},Uu=Pu?Pu.toStringTag:void 0;var Vu=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Uu&&Uu in Object(e)?Ou(e):Fu(e)};var ju=function(e){return null!=e&&"object"==typeof e};var zu=function(e){return"symbol"==typeof e||ju(e)&&"[object Symbol]"==Vu(e)},Ku=/^[-+]0x[0-9a-f]+$/i,Hu=/^0b[01]+$/i,qu=/^0o[0-7]+$/i,Gu=parseInt;var Wu=function(e){if("number"==typeof e)return e;if(zu(e))return NaN;if(ku(e)){var r="function"==typeof e.valueOf?e.valueOf():e;e=ku(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=xu(e);var t=Hu.test(e);return t||qu.test(e)?Gu(e.slice(2),t?2:8):Ku.test(e)?NaN:+e},Qu=Math.max,Xu=Math.min;var Yu=function(e,r,t){var n,a,o,i,s,c,u=0,l=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(r){var t=n,o=a;return n=a=void 0,u=r,i=e.apply(o,t)}function h(e){return u=e,s=setTimeout(g,r),l?p(e):i}function m(e){var t=e-c;return void 0===c||t>=r||t<0||d&&e-u>=o}function g(){var e=_u();if(m(e))return v(e);s=setTimeout(g,function(e){var t=r-(e-c);return d?Xu(t,o-(e-u)):t}(e))}function v(e){return s=void 0,f&&n?p(e):(n=a=void 0,i)}function y(){var e=_u(),t=m(e);if(n=arguments,a=this,c=e,t){if(void 0===s)return h(c);if(d)return clearTimeout(s),s=setTimeout(g,r),p(c)}return void 0===s&&(s=setTimeout(g,r)),i}return r=Wu(r)||0,ku(t)&&(l=!!t.leading,o=(d="maxWait"in t)?Qu(Wu(t.maxWait)||0,r):o,f="trailing"in t?!!t.trailing:f),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,n=c=a=s=void 0},y.flush=function(){return void 0===s?i:v(_u())},y};var Zu=function(e,r,t){var n=!0,a=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return ku(t)&&(n="leading"in t?!!t.leading:n,a="trailing"in t?!!t.trailing:a),Yu(e,r,{leading:n,maxWait:r,trailing:a})};var $u,Ju=function(e){if(!ku(e))return!1;var r=Vu(e);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r},el=Su["__core-js_shared__"],rl=($u=/[^.]+$/.exec(el&&el.keys&&el.keys.IE_PROTO||""))?"Symbol(src)_1."+$u:"";var tl=function(e){return!!rl&&rl in e},nl=Function.prototype.toString;var al=function(e){if(null!=e){try{return nl.call(e)}catch(e){}try{return e+""}catch(e){}}return""},ol=/^\[object .+?Constructor\]$/,il=Function.prototype,sl=Object.prototype,cl=il.toString,ul=sl.hasOwnProperty,ll=RegExp("^"+cl.call(ul).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var dl=function(e){return!(!ku(e)||tl(e))&&(Ju(e)?ll:ol).test(al(e))};var fl=function(e,r){return null==e?void 0:e[r]};var pl=function(e,r){var t=fl(e,r);return dl(t)?t:void 0},hl=function(){try{var e=pl(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var ml=function(e,r,t){"__proto__"==r&&hl?hl(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t};var gl=function(e,r){return e===r||e!=e&&r!=r},vl=Object.prototype.hasOwnProperty;var yl=function(e,r,t){var n=e[r];vl.call(e,r)&&gl(n,t)&&(void 0!==t||r in e)||ml(e,r,t)};var bl=function(e,r,t,n){var a=!t;t||(t={});for(var o=-1,i=r.length;++o<i;){var s=r[o],c=n?n(t[s],e[s],s,t,e):void 0;void 0===c&&(c=e[s]),a?ml(t,s,c):yl(t,s,c)}return t};var Cl=function(e){return e};var wl=function(e,r,t){switch(t.length){case 0:return e.call(r);case 1:return e.call(r,t[0]);case 2:return e.call(r,t[0],t[1]);case 3:return e.call(r,t[0],t[1],t[2])}return e.apply(r,t)},kl=Math.max;var Bl=function(e,r,t){return r=kl(void 0===r?e.length-1:r,0),function(){for(var n=arguments,a=-1,o=kl(n.length-r,0),i=Array(o);++a<o;)i[a]=n[r+a];a=-1;for(var s=Array(r+1);++a<r;)s[a]=n[a];return s[r]=t(i),wl(e,this,s)}};var El=function(e){return function(){return e}},Sl=hl?function(e,r){return hl(e,"toString",{configurable:!0,enumerable:!1,value:El(r),writable:!0})}:Cl,_l=Date.now;var Al=function(e){var r=0,t=0;return function(){var n=_l(),a=16-(n-t);if(t=n,a>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}(Sl);var Il=function(e,r){return Al(Bl(e,r,Cl),e+"")};var Tl=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var xl=function(e){return null!=e&&Tl(e.length)&&!Ju(e)},Pl=/^(?:0|[1-9]\d*)$/;var Rl=function(e,r){var t=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==t||"symbol"!=t&&Pl.test(e))&&e>-1&&e%1==0&&e<r};var Dl=function(e,r,t){if(!ku(t))return!1;var n=typeof r;return!!("number"==n?xl(t)&&Rl(r,t.length):"string"==n&&r in t)&&gl(t[r],e)};var Nl=function(e){return Il((function(r,t){var n=-1,a=t.length,o=a>1?t[a-1]:void 0,i=a>2?t[2]:void 0;for(o=e.length>3&&"function"==typeof o?(a--,o):void 0,i&&Dl(t[0],t[1],i)&&(o=a<3?void 0:o,a=1),r=Object(r);++n<a;){var s=t[n];s&&e(r,s,n,o)}return r}))};var Ll=function(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n};var Ol=function(e){return ju(e)&&"[object Arguments]"==Vu(e)},Ml=Object.prototype,Fl=Ml.hasOwnProperty,Ul=Ml.propertyIsEnumerable,Vl=Ol(function(){return arguments}())?Ol:function(e){return ju(e)&&Fl.call(e,"callee")&&!Ul.call(e,"callee")},jl=Array.isArray;var zl=function(){return!1},Kl=Hs((function(e,r){var t=r&&!r.nodeType&&r,n=t&&e&&!e.nodeType&&e,a=n&&n.exports===t?Su.Buffer:void 0,o=(a?a.isBuffer:void 0)||zl;e.exports=o})),Hl={};Hl["[object Float32Array]"]=Hl["[object Float64Array]"]=Hl["[object Int8Array]"]=Hl["[object Int16Array]"]=Hl["[object Int32Array]"]=Hl["[object Uint8Array]"]=Hl["[object Uint8ClampedArray]"]=Hl["[object Uint16Array]"]=Hl["[object Uint32Array]"]=!0,Hl["[object Arguments]"]=Hl["[object Array]"]=Hl["[object ArrayBuffer]"]=Hl["[object Boolean]"]=Hl["[object DataView]"]=Hl["[object Date]"]=Hl["[object Error]"]=Hl["[object Function]"]=Hl["[object Map]"]=Hl["[object Number]"]=Hl["[object Object]"]=Hl["[object RegExp]"]=Hl["[object Set]"]=Hl["[object String]"]=Hl["[object WeakMap]"]=!1;var ql=function(e){return ju(e)&&Tl(e.length)&&!!Hl[Vu(e)]};var Gl=function(e){return function(r){return e(r)}},Wl=Hs((function(e,r){var t=r&&!r.nodeType&&r,n=t&&e&&!e.nodeType&&e,a=n&&n.exports===t&&Bu.process,o=function(){try{var e=n&&n.require&&n.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=o})),Ql=Wl&&Wl.isTypedArray,Xl=Ql?Gl(Ql):ql,Yl=Object.prototype.hasOwnProperty;var Zl=function(e,r){var t=jl(e),n=!t&&Vl(e),a=!t&&!n&&Kl(e),o=!t&&!n&&!a&&Xl(e),i=t||n||a||o,s=i?Ll(e.length,String):[],c=s.length;for(var u in e)!r&&!Yl.call(e,u)||i&&("length"==u||a&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Rl(u,c))||s.push(u);return s},$l=Object.prototype;var Jl=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||$l)};var ed=function(e){var r=[];if(null!=e)for(var t in Object(e))r.push(t);return r},rd=Object.prototype.hasOwnProperty;var td=function(e){if(!ku(e))return ed(e);var r=Jl(e),t=[];for(var n in e)("constructor"!=n||!r&&rd.call(e,n))&&t.push(n);return t};var nd=function(e){return xl(e)?Zl(e,!0):td(e)},ad=Nl((function(e,r,t,n){bl(r,nd(r),e,n)}));var od=function(e,r){return function(t){return e(r(t))}},id=od(Object.getPrototypeOf,Object),sd=Function.prototype,cd=Object.prototype,ud=sd.toString,ld=cd.hasOwnProperty,dd=ud.call(Object);var fd=function(e){if(!ju(e)||"[object Object]"!=Vu(e))return!1;var r=id(e);if(null===r)return!0;var t=ld.call(r,"constructor")&&r.constructor;return"function"==typeof t&&t instanceof t&&ud.call(t)==dd};var pd=function(e){if(!ju(e))return!1;var r=Vu(e);return"[object Error]"==r||"[object DOMException]"==r||"string"==typeof e.message&&"string"==typeof e.name&&!fd(e)},hd=Il((function(e,r){try{return wl(e,void 0,r)}catch(e){return pd(e)?e:new Error(e)}}));var md=function(e,r){for(var t=-1,n=null==e?0:e.length,a=Array(n);++t<n;)a[t]=r(e[t],t,e);return a};var gd=function(e,r){return md(r,(function(r){return e[r]}))},vd=Object.prototype,yd=vd.hasOwnProperty;var bd=function(e,r,t,n){return void 0===e||gl(e,vd[t])&&!yd.call(n,t)?r:e},Cd={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};var wd=function(e){return"\\"+Cd[e]},kd=od(Object.keys,Object),Bd=Object.prototype.hasOwnProperty;var Ed=function(e){if(!Jl(e))return kd(e);var r=[];for(var t in Object(e))Bd.call(e,t)&&"constructor"!=t&&r.push(t);return r};var Sd=function(e){return xl(e)?Zl(e):Ed(e)},_d=/<%=([\s\S]+?)%>/g;var Ad=function(e){return function(r){return null==e?void 0:e[r]}}({"&":"&","<":"<",">":">",'"':""","'":"'"}),Id=Pu?Pu.prototype:void 0,Td=Id?Id.toString:void 0;var xd=function e(r){if("string"==typeof r)return r;if(jl(r))return md(r,e)+"";if(zu(r))return Td?Td.call(r):"";var t=r+"";return"0"==t&&1/r==-Infinity?"-0":t};var Pd=function(e){return null==e?"":xd(e)},Rd=/[&<>"']/g,Dd=RegExp(Rd.source);var Nd={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:_d,variable:"",imports:{_:{escape:function(e){return(e=Pd(e))&&Dd.test(e)?e.replace(Rd,Ad):e}}}},Ld=/\b__p \+= '';/g,Od=/\b(__p \+=) '' \+/g,Md=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Fd=/[()=,{}\[\]\/\s]/,Ud=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Vd=/($^)/,jd=/['\n\r\u2028\u2029\\]/g,zd=Object.prototype.hasOwnProperty;var Kd=function(e,r,t){var n=Nd.imports._.templateSettings||Nd;t&&Dl(e,r,t)&&(r=void 0),e=Pd(e),r=ad({},r,n,bd);var a,o,i=ad({},r.imports,n.imports,bd),s=Sd(i),c=gd(i,s),u=0,l=r.interpolate||Vd,d="__p += '",f=RegExp((r.escape||Vd).source+"|"+l.source+"|"+(l===_d?Ud:Vd).source+"|"+(r.evaluate||Vd).source+"|$","g"),p=zd.call(r,"sourceURL")?"//# sourceURL="+(r.sourceURL+"").replace(/\s/g," ")+"\n":"";e.replace(f,(function(r,t,n,i,s,c){return n||(n=i),d+=e.slice(u,c).replace(jd,wd),t&&(a=!0,d+="' +\n__e("+t+") +\n'"),s&&(o=!0,d+="';\n"+s+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=c+r.length,r})),d+="';\n";var h=zd.call(r,"variable")&&r.variable;if(h){if(Fd.test(h))throw new Error("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(o?d.replace(Ld,""):d).replace(Od,"$1").replace(Md,"$1;"),d="function("+(h||"obj")+") {\n"+(h?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(a?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=hd((function(){return Function(s,p+"return "+d).apply(void 0,c)}));if(m.source=d,pd(m))throw m;return m},Hd=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qd=/^\w*$/;var Gd=function(e,r){if(jl(e))return!1;var t=typeof e;return!("number"!=t&&"symbol"!=t&&"boolean"!=t&&null!=e&&!zu(e))||(qd.test(e)||!Hd.test(e)||null!=r&&e in Object(r))},Wd=pl(Object,"create");var Qd=function(){this.__data__=Wd?Wd(null):{},this.size=0};var Xd=function(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r},Yd=Object.prototype.hasOwnProperty;var Zd=function(e){var r=this.__data__;if(Wd){var t=r[e];return"__lodash_hash_undefined__"===t?void 0:t}return Yd.call(r,e)?r[e]:void 0},$d=Object.prototype.hasOwnProperty;var Jd=function(e){var r=this.__data__;return Wd?void 0!==r[e]:$d.call(r,e)};var ef=function(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=Wd&&void 0===r?"__lodash_hash_undefined__":r,this};function rf(e){var r=-1,t=null==e?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}rf.prototype.clear=Qd,rf.prototype.delete=Xd,rf.prototype.get=Zd,rf.prototype.has=Jd,rf.prototype.set=ef;var tf=rf;var nf=function(){this.__data__=[],this.size=0};var af=function(e,r){for(var t=e.length;t--;)if(gl(e[t][0],r))return t;return-1},of=Array.prototype.splice;var sf=function(e){var r=this.__data__,t=af(r,e);return!(t<0)&&(t==r.length-1?r.pop():of.call(r,t,1),--this.size,!0)};var cf=function(e){var r=this.__data__,t=af(r,e);return t<0?void 0:r[t][1]};var uf=function(e){return af(this.__data__,e)>-1};var lf=function(e,r){var t=this.__data__,n=af(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this};function df(e){var r=-1,t=null==e?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}df.prototype.clear=nf,df.prototype.delete=sf,df.prototype.get=cf,df.prototype.has=uf,df.prototype.set=lf;var ff=df,pf=pl(Su,"Map");var hf=function(){this.size=0,this.__data__={hash:new tf,map:new(pf||ff),string:new tf}};var mf=function(e){var r=typeof e;return"string"==r||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==e:null===e};var gf=function(e,r){var t=e.__data__;return mf(r)?t["string"==typeof r?"string":"hash"]:t.map};var vf=function(e){var r=gf(this,e).delete(e);return this.size-=r?1:0,r};var yf=function(e){return gf(this,e).get(e)};var bf=function(e){return gf(this,e).has(e)};var Cf=function(e,r){var t=gf(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this};function wf(e){var r=-1,t=null==e?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}wf.prototype.clear=hf,wf.prototype.delete=vf,wf.prototype.get=yf,wf.prototype.has=bf,wf.prototype.set=Cf;var kf=wf;function Bf(e,r){if("function"!=typeof e||null!=r&&"function"!=typeof r)throw new TypeError("Expected a function");var t=function(){var n=arguments,a=r?r.apply(this,n):n[0],o=t.cache;if(o.has(a))return o.get(a);var i=e.apply(this,n);return t.cache=o.set(a,i)||o,i};return t.cache=new(Bf.Cache||kf),t}Bf.Cache=kf;var Ef=Bf;var Sf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_f=/\\(\\)?/g,Af=function(e){var r=Ef(e,(function(e){return 500===t.size&&t.clear(),e})),t=r.cache;return r}((function(e){var r=[];return 46===e.charCodeAt(0)&&r.push(""),e.replace(Sf,(function(e,t,n,a){r.push(n?a.replace(_f,"$1"):t||e)})),r}));var If=function(e,r){return jl(e)?e:Gd(e,r)?[e]:Af(Pd(e))};var Tf=function(e){if("string"==typeof e||zu(e))return e;var r=e+"";return"0"==r&&1/e==-Infinity?"-0":r};var xf=function(e,r){for(var t=0,n=(r=If(r,e)).length;null!=e&&t<n;)e=e[Tf(r[t++])];return t&&t==n?e:void 0};var Pf=function(e,r,t){var n=null==e?void 0:xf(e,r);return void 0===n?t:n},Rf=K.Errors;function Df(e){var r=e.livenessSettings,t=e.apiClient,n=e.apiCheck,a=e.onError,o=O(c({face_tracking_setting:{enable:!1,web_terminate_threshold:.0030152991993743408,web_warning_threshold:.0017317430600108828,limit_for:"all_flow",max_warning_time:5},flow_interval_time_ms:3e3,take_one_picture_time_ms:3e3,limit_time_liveness_check:{enable:!1,limit_time_second:45},terminate_if_no_face:{enable:!1,max_invalid_frame:5,max_time_ms:1e3},close_eye_detector:{enable:!0,web_threshold:.342,web_timeout:5},exif_data_settings:{enable:!0}}),2),s=o[0],u=o[1];return i((function(){r&&Object.keys(r).length>0?u((function(e){return x(x({},e),r)})):n&&t.clientSettings().then((function(e){if(e&&e.data){var r,t=Pf(e,"data.settings.sdk_settings.active_liveness_settings"),n=Pf(e,"data.settings.sdk_settings.liveness_settings"),o=Pf(t,"save_encoded_frames",{});o.enable&&(r={enable:!0,framesIntervalTime:o.frames_interval_ms,framesBatchLength:o.frames_batch_len});var i=Pf(e,"data.settings.sdk_settings.liveness_settings.exif_data_settings",{enable:!0});u(x(x(x({},t),n),{},{captureFrameSettings:r,exif_data_settings:i}))}e&&e.errors&&a(Rf.server_error)})).catch((function(e){a(e)}))}),[r,t,a,n]),s}var Nf=function(e){var r=e.curStep,t=e.faceDirection,n=Pf(r,"stepTimeConstraints.delayTime");return!!n&&(null===r.firstFrameSpottedAt?(r.name===t&&(r.firstFrameSpottedAt=(new Date).getTime()),!0):(new Date).getTime()-r.firstFrameSpottedAt<n)};var Lf=function(e){return e?Infinity===(e=Wu(e))||-Infinity===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0};var Of=function(e){var r=Lf(e),t=r%1;return r==r?t?r-t:r:0};var Mf=function(e,r){var t;if("function"!=typeof r)throw new TypeError("Expected a function");return e=Of(e),function(){return--e>0&&(t=r.apply(this,arguments)),e<=1&&(r=void 0),t}};var Ff=function(e){return Mf(2,e)},Uf=function(){var e=S(regeneratorRuntime.mark((function e(r){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.closeEyesModelUrl,n=void 0===t?Ds:t,e.next=3,di.preloadResource({modelUrl:n});case 3:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}();function Vf(){return(Vf=S(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c,u,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=l.length>0&&void 0!==l[0]?l[0]:{},t=r.blazefaceModelUrl,n=r.tfScriptUrls,a=r.closeEyesModelUrl,o=new Ns(a),e.next=4,di.loadTensorFlow(n);case 4:return e.next=6,di.initTensorFlow({preferredBackends:["wasm","cpu"]});case 6:return i=[di.loadBlazefaceModel({modelUrl:t}),o.load()],e.next=9,Promise.all(i);case 9:return s=e.sent,c=O(s,1),u=c[0].blazefaceModel,e.abrupt("return",{blazefaceModel:u,closeEyesModel:o});case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var jf,zf,Kf,Hf,qf,Gf,Wf,Qf,Xf=Ff((function(){return Vf.apply(this,arguments)})),Yf=[],Zf=function(){Yf=[]},$f=function(e,r,t){t&&Zf(),Yf.push({id:null});var n=Yf.length-1;r.httpClient.post("/v1/files",{frames:e,metadata:JSON.stringify({type:"selfie"})}).then((function(e){e&&e.data&&e.data.file_id?Yf[n].id=e.data.file_id:Yf[n].id=-1}))},Jf=function(e,r,t){t&&Zf(),Yf.push({id:null});var n=Yf.length-1;r.uploadFiles({frames:e,metadata:JSON.stringify({type:"selfie"})}).then((function(e){e&&e.data&&e.data.file_id?Yf[n].id=e.data.file_id:Yf[n].id=-1}))},ep=function(){return new Promise((function(e){var r=setInterval((function(){Yf.every((function(e){return e.id}))&&(e(),clearInterval(r))}),200)}))},rp=function(e){return e.enable?Yf.some((function(e){return-1===e.id}))?null:Yf:[]},tp=function(){var e=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.steps,n=r.apiClient,a=r.FaceDirection,o=r.outputEncryptionSettings,i=[],t.forEach((function(e){var r=e.name,t=e.image,s=e.frontalFaceImage;if(r!==a.FRONTAL){var c={label:"portrait",metadata:JSON.stringify({gesture_score:t.leftRightScore,gesture:r})};o&&o.key?i.push(n.httpClient.post("/v1/images",x({base64:t.encrypted.hex},c),{"X-TV-Key":o.key})):i.push(n.uploadImage(x({file:t.blob},c)))}else i.push(Promise.resolve({data:{image_id:null}}));if(s.blob){var u={label:"portrait",metadata:JSON.stringify({gesture_score:s.leftRightScore,gesture:a.FRONTAL})};o&&o.key?i.push(n.httpClient.post("/v1/images",x({base64:s.encrypted.hex},u),{"X-TV-Key":o.key})):i.push(n.uploadImage(x({file:s.blob},u)))}else i.push(Promise.resolve({data:{image_id:null}}))})),e.next=5,Promise.all(i);case 5:s=e.sent,t.forEach((function(e,r){e.image.imageId=s[2*r].data.image_id,e.frontalFaceImage.imageId=s[2*r+1].data.image_id}));case 7:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),np=function(){var e=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,u,l,d,f,p,h,m,g,v,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.apiClient,n=r.faceVerificationFlowData,a=r.onLivenessDetectionDone,o=r.captureFrameSettings,i=r.FaceDirection,s=r.onError,c=r.outputEncryptionSettings,e.prev=1,u=n.current.steps,e.next=5,tp({steps:u,apiClient:t,FaceDirection:i,outputEncryptionSettings:c});case 5:if(0!==(l=u.filter((function(e){return e.frontalFaceImage.imageId}))).length){e.next=10;break}a({error:"wrong_face_movement"}),e.next=27;break;case 10:return e.next=12,ep();case 12:if(d=rp(o)){e.next=17;break}a({error:"network_error"}),e.next=27;break;case 17:return f=t.verifyFaceLiveness({images:l.map((function(e){return{id:e.frontalFaceImage.imageId}})),gesture_images:u.filter((function(e){return e.image.imageId&&e.name!==i.FRONTAL})).map((function(e){return{gesture:e.name,images:[{id:e.image.imageId}]}})),videos:d}),p=t.requestVerifyPortrait({image:{id:l[l.length-1].frontalFaceImage.imageId}}),e.next=21,Promise.all([f,p]);case 21:h=e.sent,m=O(h,2),g=m[0],v=m[1],y=!0===g.data.is_live,a({apiCheckPassed:y,verifyFaceLivenessResult:g.data,verifyFacePortraitResult:v.data,frontalFaces:l.map((function(e){return{id:e.frontalFaceImage.imageId,blob:e.frontalFaceImage.blob}})),steps:u.filter((function(e){return e.image.imageId&&e.name!==i.FRONTAL})).map((function(e){var r=e.name,t=e.image;return{name:r,blob:t.blob,id:t.imageId}}))});case 27:e.next=32;break;case 29:e.prev=29,e.t0=e.catch(1),s({error:e.t0});case 32:case"end":return e.stop()}}),e,null,[[1,29]])})));return function(r){return e.apply(this,arguments)}}(),ap=Ea.faceTracker(),op=new gi,ip=K.Mode,sp=K.FaceDirection,cp=K.Errors,up=K.Messages,lp=K.TrackLivenessEvents,dp={captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},customStepTimeConstraints:(jf={},A(jf,K.FaceDirection.UP,{delayTime:0}),A(jf,K.FaceDirection.LEFT,{delayTime:0}),A(jf,K.FaceDirection.RIGHT,{delayTime:0}),A(jf,K.FaceDirection.FRONTAL,{delayTime:2e3}),jf),setRemainingTime:function(){},onFramesCaptured:function(){},onProcessing:function(){}},fp=function(e){var r=e.apiCredentials,t=e.sdkAdapter,n=Fo.useApiClient({apiCredentials:r}).apiClient;return{apiClient:t instanceof js?t:n,apiClientFromUtils:n}};function pp(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.apiCheck,t=e.mode,s=e.bgCameraMask,l=e.bgCameraMaskRed,d=e.surroundStyle,f=e.cropAreaDimension,p=e.customInstructions,h=e.customIcon,m=e.customDirectionIcon,g=e.customStepTimeConstraints,v=void 0===g?dp.customStepTimeConstraints:g,y=e.onLivenessDetectionDone,b=e.onError,C=e.frontalMinSize,w=e.waitingTimeToGetBetterFrames,k=void 0===w?500:w,E=e.captureFrameSettings,_=void 0===E?dp.captureFrameSettings:E,I=e.livenessSettings,T=e.setRemainingTime,P=void 0===T?dp.setRemainingTime:T,R=e.onProcessing,D=void 0===R?dp.onProcessing:R,N=e.customErrors,L=e.customMessages,F=e.apiCredentials,U=void 0===F?{}:F,V=e.onFramesCaptured,j=void 0===V?dp.onFramesCaptured:V,z=e.initFirstGestureTimeout,H=void 0===z?2e3:z,q=e.outputEncryptionSettings,G=e.cameraScale,W=void 0===G?1:G,Q=e.passiveModeAuto,X=void 0!==Q&&Q,Y=e.sendCustomEvent,Z=e.sdkAdapter,$=void 0===Z?null:Z,J=c(!1),ee=O(J,2),re=ee[0],te=ee[1],ne=c(!1),ae=O(ne,2),oe=ae[0],ie=ae[1],se=c(!1),ce=O(se,2),ue=ce[0],le=ce[1],de=c(!1),fe=O(de,2),pe=fe[0],he=fe[1],me=a(null),ge=$t.useSDKSettings(),ve=ge.lang,ye=ge.assetRoot,be=ge.customUrls,Ce=t===ip.ACTIVE,we=u((function(e){return e+1}),0),ke=O(we,2),Be=(ke[0],ke[1]),Ee=a(null),Se=a(!1),_e=c(!1),Ae=O(_e,2),Ie=Ae[0],Te=Ae[1],xe=a({}),Pe=fp({apiCredentials:U,sdkAdapter:$}),Re=Pe.apiClient,De=Pe.apiClientFromUtils,Ne=Pn.useSDKTracking(),Le=Ne.sendEvent,Oe=Os(),Me=Oe.startMotion,Fe=Oe.stopMotion,Ue=Oe.motionData,Ve=Oe.orientationData,je=a(null);null===je.current&&(je.current=Ea.initFaceVerificationData({assetRoot:ye,customInstructions:p,customIcon:h,customDirectionIcon:m,customStepTimeConstraints:v}));var ze=c(),Ke=O(ze,2),He=Ke[0],qe=Ke[1],Ge=o((function(e){qe(e)}),[]),We=n((function(){return Zu(Ge,500)}),[Ge]),Qe=a([]),Xe=a(),Ye=Df({livenessSettings:I,apiClient:De,apiCheck:r,onError:b}),Ze=Ye.face_tracking_setting,$e=Ye.flow_interval_time_ms,Je=Ye.limit_time_liveness_check,er=Ye.terminate_if_no_face,rr=Ye.close_eye_detector,tr=void 0===rr?{}:rr,nr=Ye.captureFrameSettings,ar=void 0===nr?_:nr,or=Ye.exif_data_settings,ir=Ye.take_one_picture_time_ms,sr=a(""),cr=o((function(e){if(null!=e&&e.event){if(e.event===(null==lp?void 0:lp.show_alert)){var r,t=null===(r=e.log)||void 0===r?void 0:r.alert;if(t===sr.current)return;sr.current=t}Le(e),Y&&Y(e)}}),[Y,Le]),ur=n((function(){return Zu((function(e){cr(e)}),2e3)}),[cr]),lr=a(0),dr=a();i((function(){cr({tag:"selfie",event:null==lp?void 0:lp.start_camera,log:{}})}),[cr]),i((function(){return op.start(),Rs.initExifData(),function(){op.stop()}}),[]),i((function(){var e=!1;function r(){return(r=S(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(Ie){r.next=13;break}return Xe.current=performance.now(),r.next=4,Xf(be);case 4:return xe.current=r.sent,r.next=7,di.initTensorFlow({preferredBackends:["wasm","webgl","cpu"]});case 7:if(!e){r.next=9;break}return r.abrupt("return");case 9:Te(!0),cr({tag:"selfie",event:null==lp?void 0:lp.show_warmup,log:{}}),cr({tag:"selfie",event:null==lp?void 0:lp.finish_load_model,log:{status:"success",time_in_ms:performance.now()-Xe.current}}),Xe.current=null;case 13:case"end":return r.stop()}}),r)})))).apply(this,arguments)}return function(){r.apply(this,arguments)}(),function(){e=!0}}),[Ie,be,cr]);var fr=o((function(){P(""),je.current.curStepIndex=je.current.steps.length,le(!1),op.stop(),setTimeout((function(){je.current=Ea.initFaceVerificationData({assetRoot:ye,customInstructions:p,customIcon:h,customDirectionIcon:m}),op.start(),lr.current=0,dr.current=null,Qe.current=[],he(!1),Zf(),Be()}),$e)}),[ye,p,h,m,$e,P]),pr=n((function(){return x(x({},cp),N)}),[N]),hr=n((function(){return x(x({},up),L)}),[L]),mr=400;i((function(){if(oe&&Je.enable&&pe){var e=Je.limit_time_second+1,r=Je.remain_time_show||10,t=Je.format||"s";op.start("limit",(function(n){var a=e-n;if(je.current.curStepIndex<je.current.steps.length){if(a<=r&&a>=1){var o=Kd(hr.REMAIN_TIME[ve]),i=a;switch(t){case"mm:ss":i=a.toString().padStart(5,"00:00");break;case"ss":i=a.toString().padStart(2,"0")}P(o({x:i}))}if(0===a){var s,c={};Object.keys(null===(s=pr.liveness_terminated_time_out)||void 0===s?void 0:s.msg).forEach((function(e){var r,t=Kd(null===(r=pr.liveness_terminated_time_out)||void 0===r?void 0:r.msg[e]);c[e]=t({x:Je.limit_time_second})})),qe(x(x({},pr.liveness_terminated_time_out),{},{msg:c,duration:$e})),cr({tag:"selfie",event:null==lp?void 0:lp.show_alert,log:{alert:"liveness_terminated_time_out,"}}),fr()}}}))}}),[fr,P,oe,ve,$e,Je.enable,Je.limit_time_second,pe,pr.liveness_terminated_time_out,hr.REMAIN_TIME,Je.format,Je.remain_time_show,cr]);var gr=o((function(e){var r,t,n=e.clientWidth,a=e.clientHeight,o=e.videoAreaWidth,i=e.videoAreaHeight,c=e.lostX,u=e.lostY;qs.isMobile?t=r=o:r=t=i-200;var l=Math.floor((o-r)/2)+c,p=5+u,h=s;Ee.current={x:l,y:p,width:r,height:t,image:h,surroundStyle:d},"object"===B(f)?Ee.current=x(x({},Ee.current),f):"function"==typeof f&&(Ee.current=x(x({},Ee.current),f({clientWidth:n,clientHeight:a,videoAreaWidth:o,videoAreaHeight:i,lostX:c,lostY:u,isMobile:qs.isMobile,width:r,height:t}))),Be(),ie(!0)}),[s,d,f]),vr=c(3),yr=O(vr,2),br=yr[0],Cr=yr[1],wr=c(!1),kr=O(wr,2),Br=kr[0],Er=kr[1],Sr=a(!1),_r=o((function(e){Er(e),Sr.current=e}),[]),Ar=a(null),Ir=a([]),Tr=o((function(){Cr(3),clearInterval(Ar.current),_r(!0);var e=function(){var e=S(regeneratorRuntime.mark((function e(t){var n,a,o,i,s,c,u,l,d,f,p,h,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t-1!=0){e.next=25;break}return clearInterval(Ar.current),n=Ir.current,D(),te(!0),Fe(),Rs.preWriteExif({mode:Rs.MODE.SELFIE,motionData:Ue,orientationData:Ve,startTime:Date.now()-1e3*op.duration("from_1st_frame"),endTime:Date.now()}),a=n.map((function(e){return So.resizeBlobImg(e.blob,mr,mr)})),e.next=10,Promise.all(a);case 10:return o=e.sent,i=o.map((function(e,r){return Rs.writeExif({mode:Rs.MODE.SELFIE,imageData:x(x({},n[r]),{},{blob:e,gesture:"frontal"}),enableExifData:or.enable})})),e.next=14,Promise.all(i);case 14:if(s=e.sent,c={},!q||!q.key){e.next=23;break}return u=q.key,l=s.map((function(e){return mi.encrypt({blob:e,key:u})})),e.next=21,Promise.all(l);case 21:d=e.sent,c={frontalFacesEncrypted:d};case 23:r?(p=M(Qe.current),h=function(e){return{label:"portrait",metadata:JSON.stringify({gesture_score:e,gesture:sp.FRONTAL})}},m=n.map((function(e,r){return Re.uploadImage(x({file:s[r]},h(e.leftRightScore)))})),q&&q.key&&(m=n.map((function(e,r){return De.httpClient.post("/v1/images",x({base64:c.frontalFacesEncrypted[r].hex},h(e.leftRightScore)),{"X-TV-Key":q.key})}))),Promise.all(m).then((function(e){return Re.verifyFaceLiveness({images:e.map((function(e){return{id:e.data.image_id}})),videos:[{frames:p}]})})).then((function(e){y({apiCheckPassed:e.data.is_live,verifyFaceLivenessResult:e.data})})).catch((function(e){b({error:e})}))):$ instanceof js?(te(!0),f=x(x({mode:ip.PASSIVE,imageAddedExif:s,frontalFaceImages:n},c),{},{capturedFrames:Qe.current,steps:je.current.steps}),y(f),te(!1)):y(x(x({frontalFaces:s},c),{},{capturedFrames:Qe.current})),te(!1);case 25:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}();Ar.current=setInterval((function(){Cr((function(r){return e(r),r-1}))}),ir/3)}),[ir,_r,r,y,Re,De,b,D,q,Fe,Ue,Ve,or.enable,$]),xr=a({});i((function(){xr.current.isFirstValidFrameFoundRef=pe}),[pe]),i((function(){var e,t=me.current,n=function(){var e=S(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=je.current.steps,t=[],r.map((function(e){return t.push({name:e.name,blob:e.image.blob,captureTime:e.image.captureTime,gesture:e.name}),e.frontalFaceImage.blob&&t.push({name:e.name,blob:e.frontalFaceImage.blob,captureTime:e.frontalFaceImage.captureTime,gesture:sp.FRONTAL}),0})),n=t.map((function(e){return So.resizeBlobImg(e.blob,mr,mr)})),e.next=6,Promise.all(n);case 6:return a=e.sent,o="0",_.framesBatchLength>0&&(i="".concat(Math.floor(Qe.current.length/_.framesBatchLength),"x").concat(_.framesBatchLength),s=Qe.current.length%_.framesBatchLength>0?"+".concat(Qe.current.length%_.framesBatchLength):"",o="".concat(Qe.current.length,":").concat(i).concat(s)),c=a.map((function(e,r){return Rs.writeExif({mode:Rs.MODE.SELFIE,imageData:x(x({},t[r]),{},{blob:e,frames:o}),enableExifData:or.enable})})),e.next=12,Promise.all(c);case 12:return u=e.sent,l=t.map((function(e,r){return{name:e.name,blob:u[r]}})),e.next=16,Promise.all(r.map(function(){var e=S(regeneratorRuntime.mark((function e(t,n){var a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=l.filter((function(e){return e.name===t.name})),r[n].image.blob=a[0].blob,t.frontalFaceImage.blob&&(r[n].frontalFaceImage.blob=a[1].blob),!q||!q.key){e.next=12;break}return o=q.key,e.next=7,mi.encrypt({blob:a[0].blob,key:o});case 7:if(r[n].image.encrypted=e.sent,!t.frontalFaceImage.blob){e.next=12;break}return e.next=11,mi.encrypt({blob:a[1].blob,key:o});case 11:r[n].frontalFaceImage.encrypted=e.sent;case 12:return e.abrupt("return",0);case 13:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}()));case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),a=function(){var e=S(regeneratorRuntime.mark((function e(){var t,a,o,i,s,c,u,l,d,f,p,h,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=je.current.steps,o=a[je.current.curStepIndex],A(t={},K.FaceDirection.UP,null==lp?void 0:lp.capture_up_face),A(t,K.FaceDirection.LEFT,null==lp?void 0:lp.capture_left_face),A(t,K.FaceDirection.RIGHT,null==lp?void 0:lp.capture_right_face),A(t,K.FaceDirection.FRONTAL,null==lp?void 0:lp.capture_frontal_face),cr({tag:"selfie",event:t[o.name],log:{time_capture_in_seconds:((performance.now()-Xe.current)/1e3).toFixed(1)}}),je.current.curStepIndex++,Xe.current=performance.now(),Ze.enable&&"each_gesture"===Ze.limit_for&&(lr.current=0),je.current.curStepIndex!==a.length){e.next=45;break}if(Je.enable&&P(""),!y){e.next=45;break}return ar.enable&&ar.framesBatchLength>0&&Qe.current.length%ar.framesBatchLength>0&&(j(Qe.current.slice(Qe.current.length%ar.framesBatchLength*-1).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),r?$f(Qe.current.slice(Qe.current.length%ar.framesBatchLength*-1),De):$ instanceof js&&Jf(Qe.current.slice(Qe.current.length%ar.framesBatchLength*-1),Re)),cr({tag:"selfie",event:null==lp?void 0:lp.finish_capture,log:{time_capture_in_seconds:op.duration("from_1st_frame")}}),D(),te(!0),Fe(),Rs.preWriteExif({mode:Rs.MODE.SELFIE,motionData:Ue,orientationData:Ve,startTime:Date.now()-1e3*op.duration("from_1st_frame"),endTime:Date.now()}),e.next=18,n();case 18:if(r){e.next=38;break}if(l=a.filter((function(e){return e.name!==sp.FRONTAL})).map((function(e){return{name:e.name,image:{blob:e.image.blob,encrypted:e.image.encrypted}}})),d=a.filter((function(e){return e.name!==sp.FRONTAL})).map((function(e){return e.frontalFaceImage.blob})).filter((function(e){return null!==e})),f=a.filter((function(e){return e.name!==sp.FRONTAL})).map((function(e){return e.frontalFaceImage.encrypted})).filter((function(e){return e&&e.hex})),p=null===(i=a.find((function(e){return e.name===sp.FRONTAL})))||void 0===i||null===(s=i.image)||void 0===s?void 0:s.blob,h=null===(c=a.find((function(e){return e.name===sp.FRONTAL})))||void 0===c||null===(u=c.image)||void 0===u?void 0:u.encrypted,!p||!C){e.next=30;break}return e.next=27,So.scaleImage(p,{minSize:C});case 27:e.t0=e.sent,e.next=31;break;case 30:e.t0=null;case 31:m=e.t0,p&&d.push(p),h&&f.push(h),cr({tag:"result",event:null==lp?void 0:lp.liveness_detection_done,log:{result_object:{steps:l,frontalFaces:d,frontalScaledImage:m}}}),y($ instanceof js?{mode:ip.ACTIVE,faceVerificationFlowData:je,captureFrameSettings:ar,FaceDirection:sp,capturedFrames:Qe.current}:{steps:l,frontalFaces:d,frontalFacesEncrypted:f,frontalScaledImage:m,capturedFrames:Qe.current}),e.next=44;break;case 38:if(!($ instanceof js)){e.next=42;break}y({mode:ip.ACTIVE,faceVerificationFlowData:je,captureFrameSettings:ar,FaceDirection:sp,capturedFrames:Qe.current}),e.next=44;break;case 42:return e.next=44,np({apiClient:Re,faceVerificationFlowData:je,onLivenessDetectionDone:y,captureFrameSettings:ar,FaceDirection:sp,onError:b,outputEncryptionSettings:q});case 44:te(!1);case 45:Be();case 46:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),o=Yu((function(){var e=je.current,r=e.curStepIndex,t=e.steps,n=t[r],o=null!==(null==n?void 0:n.image.blob),i=null!==(null==n?void 0:n.frontalFaceImage.blob),s=t.filter((function(e){return e.frontalFaceImage.blob})).length,c=!1;return o&&(i||![1].includes(r)||s>=1)?(Se.current=!1,a(),c=!0):Se.current=!(!o||i),le(!1),c}),k);function i(e){return c.apply(this,arguments)}function c(){return(c=S(regeneratorRuntime.mark((function e(r){var t,n,i,s,c,u,l,d,f,p,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.faceDirection,n=r.canvas,i=r.blurScore,s=r.leftRightScore,c=r.isEyeClose,u=je.current,l=u.curStepIndex,d=u.steps,!(l<d.length)){e.next=29;break}if(f=d[l],!Nf({faceDirection:t,curStep:f})){e.next=6;break}return e.abrupt("return");case 6:if(!c){e.next=8;break}return e.abrupt("return");case 8:if(t!==sp.FRONTAL||null!==f.frontalFaceImage.blurScore&&!ia.hasBetterBlurScore(i,f.frontalFaceImage.blurScore)){e.next=17;break}return f.frontalFaceImage.blurScore=i,e.next=12,ca.takePicture({canvas:n});case 12:p=e.sent,f.frontalFaceImage.blob=p,f.frontalFaceImage.leftRightScore=s,f.frontalFaceImage.captureTime=Date.now(),Se.current&&(Se.current=!1,a());case 17:if(f.name!==t||null!==f.image.blurScore&&!ia.hasBetterBlurScore(i,f.image.blurScore)){e.next=29;break}return le(!0),f.image.blurScore=i,e.next=22,ca.takePicture({canvas:n});case 22:h=e.sent,f.image.blob=h,f.image.leftRightScore=s,f.image.captureTime=Date.now(),f.image.objUrl&&URL.revokeObjectURL(f.image.objUrl),f.image.objUrl=URL.createObjectURL(h),o();case 29:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function u(e,r,t){return d.apply(this,arguments)}function d(){return(d=S(regeneratorRuntime.mark((function e(r,t,n){var a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(!0===Sr.current&&r===sp.FRONTAL&&Ir.current.length<3)){e.next=5;break}return e.next=3,ca.takePicture({canvas:t});case 3:a=e.sent,Ir.current.push({blob:a,leftRightScore:n,captureTime:Date.now()});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function f(e,t,n,a){if(Qe.current.length&&Date.now()-Qe.current[Qe.current.length-1].time<ar.framesIntervalTime)return null;if(ar.enable&&!a){var o=e.topLeft,i=e.bottomRight,s=[].concat(M(o),M(i)),c=ap(e,0===Qe.current.length),u=c.score,l=c.time,d=t.toDataURL("image/jpeg",.8);return Qe.current.push({label:"portrait",base64:d.split(",")[1],landmarks:n,original_landmarks:n,score:u,time:l,index:Qe.current.length,bbox:s,original_bbox:s}),ar.framesBatchLength>0&&Qe.current.length%ar.framesBatchLength==0&&j&&(j(Qe.current.slice(-ar.framesBatchLength).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),r?$f(Qe.current.slice(-ar.framesBatchLength),De,Qe.current.length===ar.framesBatchLength):$ instanceof js&&Jf(Qe.current.slice(-ar.framesBatchLength),Re,Qe.current.length===ar.framesBatchLength)),u}return null}function p(e){var r=e.trackingScore,t=e.isFirstValidFrameFoundRef;if(!Ze.enable||null===r||!t)return!0;var n=Ze.web_warning_threshold,a=Ze.web_terminate_threshold,o=Ze.max_warning_time;return r<n||(r<a&&lr.current<o?(lr.current++,lr.current===o?(qe(x(x({},pr.liveness_terminated_face_tracking),{},{duration:$e})),cr({tag:"selfie",event:null==lp?void 0:lp.show_alert,log:{alert:"liveness_terminated_face_tracking"}})):qe(x(x({},pr.liveness_too_fast),{},{duration:1500})),!0):(qe(x(x({},pr.liveness_terminated),{},{duration:$e})),cr({tag:"selfie",event:null==lp?void 0:lp.show_alert,log:{alert:"liveness_terminated"}}),fr(),!1))}function h(e){var r=e.noFace,t=e.isFirstValidFrameFoundRef;if(er.enable&&t){var n=er.max_time_ms;dr.current&&r||(dr.current={time:Date.now(),frame:0}),r&&dr.current.frame++;var a=dr.current.time;r&&Date.now()-a>=n&&(qe(x(x({},pr.liveness_terminated_no_face),{},{duration:$e})),cr({tag:"selfie",event:null==lp?void 0:lp.show_alert,log:{alert:"liveness_terminated_no_face"}}),fr())}}function m(e,r){return g.apply(this,arguments)}function g(){return(g=S(regeneratorRuntime.mark((function r(n,a){var o,c,d,g,y,b,C,w,k,B,E,S,_,A,I,T,x,P,R,D,N,L,M,F,U,V,j,z,H,q,G,Q,Y,Z,$,J,ee;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(0!==(null==a?void 0:a.width)&&0!==(null==a?void 0:a.height)){r.next=2;break}return r.abrupt("return");case 2:return g=xr.current.isFirstValidFrameFoundRef,y=n.cropX,b=n.cropY,C=n.cropWidth,w=n.cropHeight,a.getContext("2d").drawImage(t,y,b,C,w,-(mr*W-mr)/2/W,-(mr*W-mr)/2/W,mr,mr),k=xe.current,B=k.blazefaceModel,E=k.closeEyesModel,r.next=9,Promise.all([ia.calculateBlurScore(a),_a.getModelPredictions({model:B,sCanvas:a})]);case 9:return S=r.sent,_=O(S,2),A=_[0],I=_[1],r.next=15,Ea.validatePredictions({predictions:I,width:_a.SIZE,height:_a.SIZE});case 15:if(x=r.sent,P=x.error,R=x.fullFace,D=x.faceRatio,N=x.faceNotFrontalMinThreshold,T=P,Ee.current.image=s,M=null,F=null,U=null,V=null,j=je.current,z=j.curStepIndex,H=j.steps,!R){r.next=44;break}return q=H[z],G=q&&q.name===sp.FRONTAL,U=R.landmarks,r.next=33,Ea.calculateFaceDirection({landmarks:U,getPerfectFrontal:G});case 33:if((Q=r.sent)&&(M=Q.gesture,F=Q.leftRightScore),Y=(null==tr?void 0:tr.web_timeout)+v[K.FaceDirection.FRONTAL].delayTime/1e3,!(G&&null!=tr&&tr.enable&&(-1===op.duration("limit_close_eye")||op.duration("limit_close_eye")<Y))){r.next=44;break}return-1===op.duration("limit_close_eye")&&op.start("limit_close_eye"),r.next=40,E.predict(a,U,null==tr?void 0:tr.web_threshold);case 40:Z=r.sent,$=Z.isEyeClose,(V=$)&&!T&&(T=cp.close_eye);case 44:if(J="no_face"===(null===(o=T)||void 0===o?void 0:o.code)||"partial_face"===(null===(c=T)||void 0===c?void 0:c.code),ee=z<H.length,h({noFace:J&&ee,isFirstValidFrameFoundRef:g}),null!==(d=T)&&void 0!==d&&d.code&&ur({tag:"selfie",event:null==lp?void 0:lp.show_alert,log:{alert:T.code}}),T&&!("face_too_small"===T.code&&M!==sp.FRONTAL&&D>=N)){r.next=70;break}if(Ce||f(I[0],a,U),!Ce){r.next=58;break}if(g||(he(!0),Xe.current=performance.now(),op.start("from_1st_frame")),!p({trackingScore:f(I[0],a,U,z>=H.length),isFirstValidFrameFoundRef:g})){r.next=56;break}return r.next=56,i({faceDirection:M,canvas:a,blurScore:A,leftRightScore:F,isEyeClose:V});case 56:r.next=68;break;case 58:if(M===sp.FRONTAL){r.next=63;break}L=pr.not_frontal_face,Ee.current.image=l,r.next=68;break;case 63:if(T){r.next=68;break}return g||(he(!0),op.start("from_1st_frame")),X&&!Sr.current&&0===Ir.current.length&&setTimeout((function(){Tr()}),500),r.next=68,u(M,a,F);case 68:r.next=71;break;case 70:z<H.length&&(L=pr[T.code],Ee.current.image=l);case 71:We(L),-1!==e&&(e=requestAnimationFrame((function(){return m(n,a)})));case 73:case"end":return r.stop()}}),r)})))).apply(this,arguments)}function w(){return(w=S(regeneratorRuntime.mark((function e(){var r,n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=ca.analyzeVideoAndWindowSizes(t,Ee.current),(n=document.createElement("canvas")).width=mr,n.height=mr,(a=n.getContext("2d")).translate(mr,0),a.scale(-1*W,1*W),m(r,n);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return oe&&Ie&&setTimeout((function(){!function(){w.apply(this,arguments)}()}),H),function(){cancelAnimationFrame(e),e=-1}}),[H,oe,ve,Ce,Re,De,r,s,l,y,b,C,k,ar,D,Ze,Je.enable,P,We,v,$e,fr,er,pr,Ie,cr,j,q,W,Tr,X,tr.enable,tr.web_threshold,tr.web_timeout,Ue,Ve,Fe,or.enable,ur,_.framesBatchLength,$]),i((function(){He&&(clearInterval(Ar.current),_r(!1),Ir.current=[]),Me()}),[He,_r,Me]);var Pr=je.current,Rr=Pr.curStepIndex,Dr=Pr.steps,Nr=n((function(){return Dr.find((function(e){return e.name===K.FaceDirection.FRONTAL}))}),[Dr]),Lr=Se.current?Nr:Dr[Rr],Or=Lr&&pe?Lr.instructions[ve]:null,Mr=Lr&&pe?Lr.directionIcon:"",Fr=Lr?Lr.directionIconAnimation:"";return{countdownToTakePicture:br,cropArea:Ee,curStepIndex:Rr,directionIcon:Mr,directionIconAnimation:Fr,faceDetectionError:He,handleTriggerPassiveMode:Tr,handleVideoPlayed:gr,instructions:Or,isActiveMode:Ce,refVideo:me,showCountdown:Br,steps:Dr,videoPlayed:oe,activeCapturing:ue,isFirstValidFrameFound:pe,warmupDone:Ie,motionData:Ue,orientationData:Ve,showLoading:re}}var hp=(A(zf={},K.FaceDirection.LEFT,90),A(zf,K.FaceDirection.RIGHT,270),A(zf,K.FaceDirection.UP,180),A(zf,K.FaceDirection.DOWN,0),zf),mp=v(["0%{opacity:0.15;}50%{opacity:0.3;}100%{opacity:1;}"]),gp=m.div(Kf||(Kf=L(["\n width: 200px;\n height: 200px;\n position: relative;\n transform: scale(0.48);\n\n .top,\n .right,\n .bottom,\n .left {\n position: absolute;\n }\n\n .top {\n top: 0;\n left: 50%;\n transform: rotate(","deg) translateX(-50%);\n }\n\n .right {\n right: 0;\n top: 50%;\n transform: rotate(","deg) translateX(-50%);\n }\n\n .bottom {\n bottom: 0;\n left: 50%;\n transform: rotate(","deg) translateX(50%);\n }\n\n .left {\n left: 0;\n top: 50%;\n transform: rotate(","deg) translateX(50%);\n }\n"])),hp[K.FaceDirection.DOWN],hp[K.FaceDirection.LEFT],hp[K.FaceDirection.UP],hp[K.FaceDirection.RIGHT]),vp=m.div(Hf||(Hf=L(["\n width: 70px;\n transform: rotate(","deg);\n"])),(function(e){var r,t=e.direction;return null!==(r=hp[t])&&void 0!==r?r:0})),yp=m.span(qf||(qf=L(["\n display: flex;\n margin: 4px 0;\n width: 100%;\n height: 15px;\n animation: "," 1s infinite;\n animation-direction: alternate;\n\n &::before,\n &::after {\n content: '';\n height: 100%;\n width: 50%;\n background: rgba(255, 255, 255, 0.8);\n }\n\n &::before {\n transform: skewY(32deg);\n }\n\n &::after {\n width: 50%;\n transform: skewY(-32deg);\n }\n"])),mp),bp=m(yp)(Gf||(Gf=L(["\n animation-delay: 0s;\n"]))),Cp=m(yp)(Wf||(Wf=L(["\n animation-delay: 0.5s;\n"]))),wp=m(yp)(Qf||(Qf=L(["\n animation-delay: 1s;\n"])));function kp(e){var t=e.type;return t!==K.FaceDirection.FRONTAL?r.createElement(vp,{direction:t},r.createElement(bp,null),r.createElement(Cp,null),r.createElement(wp,null)):r.createElement(gp,null,r.createElement(vp,{className:"top"},r.createElement(bp,null),r.createElement(Cp,null),r.createElement(wp,null)),r.createElement(vp,{className:"right"},r.createElement(bp,null),r.createElement(Cp,null),r.createElement(wp,null)),r.createElement(vp,{className:"bottom"},r.createElement(bp,null),r.createElement(Cp,null),r.createElement(wp,null)),r.createElement(vp,{className:"left"},r.createElement(bp,null),r.createElement(Cp,null),r.createElement(wp,null)))}kp.propTypes={type:h.oneOf([K.FaceDirection.LEFT,K.FaceDirection.RIGHT,K.FaceDirection.UP,K.FaceDirection.FRONTAL])},kp.defaultProps={type:K.FaceDirection.LEFT};var Bp,Ep=K.ErrorDuration;function Sp(e){var t=e.children,n=e.errorMsg,a=e.className;return r.isValidElement(t)?n?r.createElement("div",{className:a},r.cloneElement(t,{errorMsg:n})):null:n?r.createElement("div",{className:a},n):null}function _p(e){var r=e.children,t=e.className,n=e.error,o=a(0),i=a(""),s=$t.useSDKSettings().lang,c=a(Ep.SHORT),u=n||{},l=u.msg,d=u.duration,f=void 0===d?Ep.SHORT:d,p=null==l?void 0:l[s];return Date.now()-o.current>=c.current?(o.current=Date.now(),c.current=f,i.current=p,Sp({children:r,errorMsg:p,className:t})):Sp({children:r,errorMsg:i.current,className:t})}_p.propTypes={children:h.node,className:h.string},_p.defaultProps={className:""};var Ap=m.circle(Bp||(Bp=L(["\n transition: stroke-dashoffset 0.4s;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n"])));function Ip(e){var t=e.className,n=e.style,a=e.radius,o=e.strokeWidth,i=e.progress,s=e.hasError,c=e.activeColor,u=e.innerPadding,l=e.outsideRingColor,d=e.outsideRingOpacity,f=e.insideRingColor,p=e.insideRingWidth,h=e.insideRingStrokeDash,m=e.errorRingWidth,g=e.errorRingColor,v=e.dashedRingColor,y=e.dashedRingOpacity,b=e.dashedRingWidth,C=e.dashedRingLineThick,w=e.dashedRingLineSpacing,k=e.dashedInsideRingColor,B=e.dashedInsideRingWidth,E=e.showOutsideRing,S=e.showInsideRing,_=e.showDashedRing,A=2*a,I=2*a,T=a-2*o,x=2*Math.PI*T,P=x-i/100*x,R=T-b/2-o/2-u,D=2*Math.PI*R,N=D-i/100*D,L=R-B/2-b/2,O=2*Math.PI*L,M=O-i/100*O,F=L-p/2-B/2,U=L-m/2-B/2;return r.createElement("svg",{className:t,style:n,width:A,height:I,viewBox:"0 0 ".concat(A," ").concat(I),fill:"none",xmlns:"http://www.w3.org/2000/svg"},E?r.createElement(r.Fragment,null,r.createElement("circle",{"data-testid":"outsideRing",opacity:d,cx:a,cy:a,r:T,stroke:l}),r.createElement(Ap,{"data-testid":"outsideAnimateRing",cx:a,cy:a,r:T,stroke:c,strokeWidth:o,strokeLinecap:"round",strokeDasharray:"".concat(x," ").concat(x),style:{strokeDashoffset:P}})):null,_?r.createElement(r.Fragment,null,r.createElement("circle",{"data-testid":"dashedRing",opacity:y,cx:a,cy:a,r:R,stroke:v,strokeWidth:b,strokeDasharray:"".concat(C," ").concat(w)}),r.createElement("mask",{id:"mask0","mask-type":"alpha",maskUnits:"userSpaceOnUse"},r.createElement("circle",{cx:a,cy:a,r:R,stroke:c,strokeWidth:b,strokeDasharray:"".concat(C," ").concat(w)})),r.createElement("g",{mask:"url(#mask0)"},r.createElement(Ap,{"data-testid":"dashedAnimateRing",cx:a,cy:a,r:R,stroke:c,strokeWidth:b,strokeDasharray:"".concat(D," ").concat(D),style:{strokeDashoffset:N}})),r.createElement("circle",{"data-testid":"dashedInsideRing",opacity:y,cx:a,cy:a,r:L,stroke:k,strokeWidth:B}),r.createElement(Ap,{"data-testid":"dashedInsideAnimateRing",cx:a,cy:a,r:L,stroke:c,strokeWidth:B,strokeLinecap:"round",strokeDasharray:"".concat(O," ").concat(O),style:{strokeDashoffset:M}})):null,S?r.createElement("circle",{"data-testid":"insideRing",strokeDasharray:h,cx:a,cy:a,r:F,stroke:f,strokeWidth:p}):null,s?r.createElement("circle",{"data-testid":"errorRing",strokeDasharray:h,cx:a,cy:a,r:U,stroke:g,strokeWidth:m}):null)}function Tp(e){var t=e.className;return r.createElement("svg",{className:t,width:"320",height:"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M320 0H0V320H320V0ZM160 296C235.111 296 296 235.111 296 160C296 84.8893 235.111 24 160 24C84.8893 24 24 84.8893 24 160C24 235.111 84.8893 296 160 296Z",fill:"currentColor"}))}function xp(){return(xp=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}Ip.propTypes={className:h.string,style:h.shape({}),radius:h.number,strokeWidth:h.number,progress:h.number,hasError:h.bool,activeColor:h.string,innerPadding:h.number,outsideRingColor:h.string,outsideRingOpacity:h.number,insideRingColor:h.string,insideRingWidth:h.number,insideRingStrokeDash:h.string,errorRingColor:h.string,errorRingWidth:h.number,dashedRingColor:h.string,dashedRingOpacity:h.number,dashedRingWidth:h.number,dashedRingLineThick:h.number,dashedRingLineSpacing:h.number,dashedInsideRingColor:h.string,dashedInsideRingWidth:h.number,showOutsideRing:h.bool,showDashedRing:h.bool,showInsideRing:h.bool},Ip.defaultProps={className:"",style:null,radius:160,strokeWidth:3,progress:0,hasError:!1,activeColor:"#0092ff",innerPadding:5,outsideRingColor:"#f2f6f9",outsideRingOpacity:.1,insideRingColor:"#f2f6f9",insideRingWidth:3,insideRingStrokeDash:"0",errorRingColor:"#df0000",errorRingWidth:3,dashedRingColor:"#ffffff",dashedRingOpacity:.3,dashedRingWidth:10,dashedRingLineThick:1,dashedRingLineSpacing:6,dashedInsideRingColor:"#ffffff",dashedInsideRingWidth:0,showOutsideRing:!0,showDashedRing:!0,showInsideRing:!0},Tp.propTypes={className:h.string},Tp.defaultProps={className:""};var Pp,Rp,Dp="undefined"!=typeof window?f:i,Np={popupContent:{tooltip:{position:"absolute",zIndex:999},modal:{position:"relative",margin:"auto"}},popupArrow:{height:"8px",width:"16px",position:"absolute",background:"transparent",color:"#FFF",zIndex:-1},overlay:{tooltip:{position:"fixed",top:"0",bottom:"0",left:"0",right:"0",zIndex:999},modal:{position:"fixed",top:"0",bottom:"0",left:"0",right:"0",display:"flex",zIndex:999}}},Lp=["top left","top center","top right","right top","right center","right bottom","bottom left","bottom center","bottom right","left top","left center","left bottom"],Op=function(e,r,t,n,a){var o=a.offsetX,i=a.offsetY,s=n?8:0,c=t.split(" "),u=e.top+e.height/2,l=e.left+e.width/2,d=r.height,f=r.width,p=u-d/2,h=l-f/2,m="",g="0%",v="0%";switch(c[0]){case"top":p-=d/2+e.height/2+s,m="rotate(180deg) translateX(50%)",g="100%",v="50%";break;case"bottom":p+=d/2+e.height/2+s,m="rotate(0deg) translateY(-100%) translateX(-50%)",v="50%";break;case"left":h-=f/2+e.width/2+s,m=" rotate(90deg) translateY(50%) translateX(-25%)",v="100%",g="50%";break;case"right":h+=f/2+e.width/2+s,m="rotate(-90deg) translateY(-150%) translateX(25%)",g="50%"}switch(c[1]){case"top":p=e.top,g=e.height/2+"px";break;case"bottom":p=e.top-d+e.height,g=d-e.height/2+"px";break;case"left":h=e.left,v=e.width/2+"px";break;case"right":h=e.left-f+e.width,v=f-e.width/2+"px"}return{top:p="top"===c[0]?p-i:p+i,left:h="left"===c[0]?h-o:h+o,transform:m,arrowLeft:v,arrowTop:g}},Mp=function(e,r,t,n,a,o){var i=a.offsetX,s=a.offsetY,c={arrowLeft:"0%",arrowTop:"0%",left:0,top:0,transform:"rotate(135deg)"},u=0,l=function(e){var r={top:0,left:0,width:window.innerWidth,height:window.innerHeight};if("string"==typeof e){var t=document.querySelector(e);null!==t&&(r=t.getBoundingClientRect())}return r}(o),d=Array.isArray(t)?t:[t];for((o||Array.isArray(t))&&(d=[].concat(d,Lp));u<d.length;){var f={top:(c=Op(e,r,d[u],n,{offsetX:i,offsetY:s})).top,left:c.left,width:r.width,height:r.height};if(!(f.top<=l.top||f.left<=l.left||f.top+f.height>=l.top+l.height||f.left+f.width>=l.left+l.width))break;u++}return c},Fp=0,Up=l((function(e,t){var n=e.trigger,o=void 0===n?null:n,s=e.onOpen,u=void 0===s?function(){}:s,l=e.onClose,f=void 0===l?function(){}:l,p=e.defaultOpen,h=void 0!==p&&p,m=e.open,g=void 0===m?void 0:m,v=e.disabled,y=void 0!==v&&v,b=e.nested,C=void 0!==b&&b,k=e.closeOnDocumentClick,B=void 0===k||k,E=e.repositionOnResize,S=void 0===E||E,_=e.closeOnEscape,A=void 0===_||_,I=e.on,T=void 0===I?["click"]:I,x=e.contentStyle,P=void 0===x?{}:x,R=e.arrowStyle,D=void 0===R?{}:R,N=e.overlayStyle,L=void 0===N?{}:N,O=e.className,M=void 0===O?"":O,F=e.position,U=void 0===F?"bottom center":F,V=e.modal,j=void 0!==V&&V,z=e.lockScroll,K=void 0!==z&&z,H=e.arrow,q=void 0===H||H,G=e.offsetX,W=void 0===G?0:G,Q=e.offsetY,X=void 0===Q?0:Q,Y=e.mouseEnterDelay,Z=void 0===Y?100:Y,$=e.mouseLeaveDelay,J=void 0===$?100:$,ee=e.keepTooltipInside,re=void 0!==ee&&ee,te=e.children,ne=c(g||h),ae=ne[0],oe=ne[1],ie=a(null),se=a(null),ce=a(null),ue=a(null),le=a("popup-"+ ++Fp),de=!!j||!o,fe=a(0);Dp((function(){return ae?(ue.current=document.activeElement,Ee(),we(),be()):Ce(),function(){clearTimeout(fe.current)}}),[ae]),i((function(){"boolean"==typeof g&&(g?pe():he())}),[g,y]);var pe=function(e){ae||y||(oe(!0),setTimeout((function(){return u(e)}),0))},he=function(e){var r;ae&&!y&&(oe(!1),de&&(null===(r=ue.current)||void 0===r||r.focus()),setTimeout((function(){return f(e)}),0))},me=function(e){null==e||e.stopPropagation(),ae?he(e):pe(e)},ge=function(e){clearTimeout(fe.current),fe.current=setTimeout((function(){return pe(e)}),Z)},ve=function(e){null==e||e.preventDefault(),me()},ye=function(e){clearTimeout(fe.current),fe.current=setTimeout((function(){return he(e)}),J)},be=function(){de&&K&&(document.getElementsByTagName("body")[0].style.overflow="hidden")},Ce=function(){de&&K&&(document.getElementsByTagName("body")[0].style.overflow="auto")},we=function(){var e,r=null==se||null===(e=se.current)||void 0===e?void 0:e.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'),t=Array.prototype.slice.call(r)[0];null==t||t.focus()};d(t,(function(){return{open:function(){pe()},close:function(){he()},toggle:function(){me()}}}));var ke,Be,Ee=function(){if(!de&&ae&&(null==ie?void 0:ie.current)&&(null==ie?void 0:ie.current)&&(null==se?void 0:se.current)){var e,r,t=ie.current.getBoundingClientRect(),n=se.current.getBoundingClientRect(),a=Mp(t,n,U,q,{offsetX:W,offsetY:X},re);if(se.current.style.top=a.top+window.scrollY+"px",se.current.style.left=a.left+window.scrollX+"px",q&&ce.current)ce.current.style.transform=a.transform,ce.current.style.setProperty("-ms-transform",a.transform),ce.current.style.setProperty("-webkit-transform",a.transform),ce.current.style.top=(null===(e=D.top)||void 0===e?void 0:e.toString())||a.arrowTop,ce.current.style.left=(null===(r=D.left)||void 0===r?void 0:r.toString())||a.arrowLeft}};void 0===(Be=A)&&(Be=!0),i((function(){if(Be){var e=function(e){"Escape"===e.key&&ke(e)};return document.addEventListener("keyup",e),function(){Be&&document.removeEventListener("keyup",e)}}}),[ke=he,Be]),function(e,r){void 0===r&&(r=!0),i((function(){if(r){var t=function(r){if(9===r.keyCode){var t,n=null==e||null===(t=e.current)||void 0===t?void 0:t.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'),a=Array.prototype.slice.call(n);if(1===a.length)return void r.preventDefault();var o=a[0],i=a[a.length-1];r.shiftKey&&document.activeElement===o?(r.preventDefault(),i.focus()):document.activeElement===i&&(r.preventDefault(),o.focus())}};return document.addEventListener("keydown",t),function(){r&&document.removeEventListener("keydown",t)}}}),[e,r])}(se,ae&&de),function(e,r){void 0===r&&(r=!0),i((function(){if(r){var t=function(){e()};return window.addEventListener("resize",t),function(){r&&window.removeEventListener("resize",t)}}}),[e,r])}(Ee,S),function(e,r,t){void 0===t&&(t=!0),i((function(){if(t){var n=function(t){var n=Array.isArray(e)?e:[e],a=!1;n.forEach((function(e){e.current&&!e.current.contains(t.target)||(a=!0)})),t.stopPropagation(),a||r(t)};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),function(){t&&(document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n))}}}),[e,r,t])}(o?[se,ie]:[se],he,B&&!C);var Se,_e=function(){return r.createElement("div",Object.assign({},(e=de?Np.popupContent.modal:Np.popupContent.tooltip,t={className:"popup-content "+(""!==M?M.split(" ").map((function(e){return e+"-content"})).join(" "):""),style:xp({},e,P,{pointerEvents:"auto"}),ref:se,onClick:function(e){e.stopPropagation()}},!j&&T.indexOf("hover")>=0&&(t.onMouseEnter=ge,t.onMouseLeave=ye),t),{key:"C",role:de?"dialog":"tooltip",id:le.current}),q&&!de&&r.createElement("div",{ref:ce,style:Np.popupArrow},r.createElement("svg",{"data-testid":"arrow",className:"popup-arrow "+(""!==M?M.split(" ").map((function(e){return e+"-arrow"})).join(" "):""),viewBox:"0 0 32 16",style:xp({position:"absolute"},D)},r.createElement("path",{d:"M16 0l16 16H0z",fill:"currentcolor"}))),te&&"function"==typeof te?te(he,ae):te);var e,t},Ae=!(T.indexOf("hover")>=0),Ie=de?Np.overlay.modal:Np.overlay.tooltip,Te=[Ae&&r.createElement("div",{key:"O","data-testid":"overlay","data-popup":de?"modal":"tooltip",className:"popup-overlay "+(""!==M?M.split(" ").map((function(e){return e+"-overlay"})).join(" "):""),style:xp({},Ie,L,{pointerEvents:B&&C||de?"auto":"none"}),onClick:B&&C?he:void 0,tabIndex:-1},de&&_e()),!de&&_e()];return r.createElement(r.Fragment,null,function(){for(var e={key:"T",ref:ie,"aria-describedby":le.current},t=Array.isArray(T)?T:[T],n=0,a=t.length;n<a;n++)switch(t[n]){case"click":e.onClick=me;break;case"right-click":e.onContextMenu=ve;break;case"hover":e.onMouseEnter=ge,e.onMouseLeave=ye;break;case"focus":e.onFocus=ge,e.onBlur=ye}if("function"==typeof o){var i=o(ae);return!!o&&r.cloneElement(i,e)}return!!o&&r.cloneElement(o,e)}(),ae&&w.createPortal(Te,(null===(Se=document.getElementById("popup-root"))&&((Se=document.createElement("div")).setAttribute("id","popup-root"),document.body.appendChild(Se)),Se)))})),Vp=y(Pp||(Pp=L(["\n .popup-content {\n margin: auto;\n background: #fff;\n width: 100%;\n padding: 5px;\n border: 1px solid #d7d7d7;\n max-width: 568px;\n border-radius: 10px;\n }\n\n [role=tooltip].popup-content {\n width: 200px;\n box-shadow: 0 0 3px rgba(0, 0, 0, .16);\n border-radius: 5px\n }\n\n .popup-overlay {\n background: rgba(0, 0, 0, .5);\n padding: 10px;\n }\n\n [data-popup=tooltip].popup-overlay {\n background: transparent\n }\n\n .popup-arrow {\n -webkit-filter: drop-shadow(0 -3px 3px rgba(0, 0, 0, .16));\n filter: drop-shadow(0 -3px 3px rgba(0, 0, 0, .16));\n color: #fff;\n stroke-width: 2px;\n stroke: #d7d7d7;\n stroke-dasharray: 30px;\n stroke-dashoffset: -54px;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0\n }\n"]))),jp=["open","children","overlayStyle"],zp=function(e){var t=e.open,n=e.children,a=e.overlayStyle,o=N(e,jp);return r.createElement(r.Fragment,null,t&&r.createElement(r.Fragment,null,r.createElement(Up,I({overlayStyle:x(x({},a),{},{zIndex:2e3}),closeOnDocumentClick:!1,closeOnEscape:!1,modal:!0,open:t},o),n),r.createElement(Vp,null)))};zp.propTypes={open:h.bool,children:h.node,overlayStyle:h.shape({})},zp.defaultProps={open:!1,children:null,overlayStyle:{}};var Kp={WARMUP_INTRO:{en:"Warming up... Please wait a moment",vi:"Đang khởi động, vui lòng chờ trong giây lát..."}},Hp=m.div(Rp||(Rp=L(["\n font-size: 18px;\n text-align: center;\n padding: 10px;\n"]))),qp=function(e){var t=e.contentStyle,n=$t.useSDKSettings(),a=n.lang,o=n.warmupMessage,i=o?o[a]:Kp.WARMUP_INTRO[a];return r.createElement(zp,{open:!0,contentStyle:t},r.createElement(Hp,{className:"warmup-message"},i))};qp.propTypes={contentStyle:h.shape({})},qp.defaultProps={contentStyle:{}};var Gp=v(["from{transform:perspective(400px);}to{transform:perspective(400px) rotateY(90deg);}"]),Wp=v(["from{transform:perspective(400px) rotateY(-90deg);}to{transform:perspective(400px);}"]),Qp=b([".flipY-exit{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}.flipY-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-out;}"],Gp,500,Wp,500),Xp=Object.freeze({__proto__:null,animationDuration:500,default:Qp}),Yp=v(["from,to{transform:translate3d(-","px,0,0);}50%{transform:translate3d(","px,0,0);}"],20,20),Zp=v(["from,to{transform:translate3d(0,-","px,0);}50%{transform:translate3d(0,","px,0);}"],20,20),$p=b([".slide-horizontal{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}.slide-vertical{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}"],Yp,Zp),Jp=Object.freeze({__proto__:null,default:$p}),eh=v(["from,to{opacity:1;}50%{opacity:0;}"]),rh=b([".blink{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}"],eh),th=Object.freeze({__proto__:null,default:rh});function nh(){return(nh=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function ah(e,r){if(null==e)return{};var t,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||(a[t]=e[t]);return a}function oh(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,e.__proto__=r}function ih(e,r){return e.replace(new RegExp("(^|\\s)"+r+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var sh=!1,ch=r.createContext(null),uh="entering",lh="entered",dh=function(e){function t(r,t){var n;n=e.call(this,r,t)||this;var a,o=t&&!t.isMounting?r.enter:r.appear;return n.appearStatus=null,r.in?o?(a="exited",n.appearStatus=uh):a=lh:a=r.unmountOnExit||r.mountOnEnter?"unmounted":"exited",n.state={status:a},n.nextCallback=null,n}oh(t,e),t.getDerivedStateFromProps=function(e,r){return e.in&&"unmounted"===r.status?{status:"exited"}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var r=null;if(e!==this.props){var t=this.state.status;this.props.in?t!==uh&&t!==lh&&(r=uh):t!==uh&&t!==lh||(r="exiting")}this.updateStatus(!1,r)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,r,t,n=this.props.timeout;return e=r=t=n,null!=n&&"number"!=typeof n&&(e=n.exit,r=n.enter,t=void 0!==n.appear?n.appear:r),{exit:e,enter:r,appear:t}},n.updateStatus=function(e,r){void 0===e&&(e=!1),null!==r?(this.cancelNextCallback(),r===uh?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&"exited"===this.state.status&&this.setState({status:"unmounted"})},n.performEnter=function(e){var r=this,t=this.props.enter,n=this.context?this.context.isMounting:e,a=this.props.nodeRef?[n]:[w.findDOMNode(this),n],o=a[0],i=a[1],s=this.getTimeouts(),c=n?s.appear:s.enter;!e&&!t||sh?this.safeSetState({status:lh},(function(){r.props.onEntered(o)})):(this.props.onEnter(o,i),this.safeSetState({status:uh},(function(){r.props.onEntering(o,i),r.onTransitionEnd(c,(function(){r.safeSetState({status:lh},(function(){r.props.onEntered(o,i)}))}))})))},n.performExit=function(){var e=this,r=this.props.exit,t=this.getTimeouts(),n=this.props.nodeRef?void 0:w.findDOMNode(this);r&&!sh?(this.props.onExit(n),this.safeSetState({status:"exiting"},(function(){e.props.onExiting(n),e.onTransitionEnd(t.exit,(function(){e.safeSetState({status:"exited"},(function(){e.props.onExited(n)}))}))}))):this.safeSetState({status:"exited"},(function(){e.props.onExited(n)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,r){r=this.setNextCallback(r),this.setState(e,r)},n.setNextCallback=function(e){var r=this,t=!0;return this.nextCallback=function(n){t&&(t=!1,r.nextCallback=null,e(n))},this.nextCallback.cancel=function(){t=!1},this.nextCallback},n.onTransitionEnd=function(e,r){this.setNextCallback(r);var t=this.props.nodeRef?this.props.nodeRef.current:w.findDOMNode(this),n=null==e&&!this.props.addEndListener;if(t&&!n){if(this.props.addEndListener){var a=this.props.nodeRef?[this.nextCallback]:[t,this.nextCallback],o=a[0],i=a[1];this.props.addEndListener(o,i)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if("unmounted"===e)return null;var t=this.props,n=t.children,a=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,ah(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return r.createElement(ch.Provider,{value:null},"function"==typeof n?n(e,a):r.cloneElement(r.Children.only(n),a))},t}(r.Component);function fh(){}dh.contextType=ch,dh.propTypes={},dh.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:fh,onEntering:fh,onEntered:fh,onExit:fh,onExiting:fh,onExited:fh},dh.UNMOUNTED="unmounted",dh.EXITED="exited",dh.ENTERING=uh,dh.ENTERED=lh,dh.EXITING="exiting";var ph,hh,mh=function(e,r){return e&&r&&r.split(" ").forEach((function(r){return n=r,void((t=e).classList?t.classList.add(n):function(e,r){return e.classList?!!r&&e.classList.contains(r):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+r+" ")}(t,n)||("string"==typeof t.className?t.className=t.className+" "+n:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+n)));var t,n}))},gh=function(e,r){return e&&r&&r.split(" ").forEach((function(r){return n=r,void((t=e).classList?t.classList.remove(n):"string"==typeof t.className?t.className=ih(t.className,n):t.setAttribute("class",ih(t.className&&t.className.baseVal||"",n)));var t,n}))},vh=function(e){function t(){for(var r,t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return(r=e.call.apply(e,[this].concat(n))||this).appliedClasses={appear:{},enter:{},exit:{}},r.onEnter=function(e,t){var n=r.resolveArguments(e,t),a=n[0],o=n[1];r.removeClasses(a,"exit"),r.addClass(a,o?"appear":"enter","base"),r.props.onEnter&&r.props.onEnter(e,t)},r.onEntering=function(e,t){var n=r.resolveArguments(e,t),a=n[0],o=n[1]?"appear":"enter";r.addClass(a,o,"active"),r.props.onEntering&&r.props.onEntering(e,t)},r.onEntered=function(e,t){var n=r.resolveArguments(e,t),a=n[0],o=n[1]?"appear":"enter";r.removeClasses(a,o),r.addClass(a,o,"done"),r.props.onEntered&&r.props.onEntered(e,t)},r.onExit=function(e){var t=r.resolveArguments(e)[0];r.removeClasses(t,"appear"),r.removeClasses(t,"enter"),r.addClass(t,"exit","base"),r.props.onExit&&r.props.onExit(e)},r.onExiting=function(e){var t=r.resolveArguments(e)[0];r.addClass(t,"exit","active"),r.props.onExiting&&r.props.onExiting(e)},r.onExited=function(e){var t=r.resolveArguments(e)[0];r.removeClasses(t,"exit"),r.addClass(t,"exit","done"),r.props.onExited&&r.props.onExited(e)},r.resolveArguments=function(e,t){return r.props.nodeRef?[r.props.nodeRef.current,e]:[e,t]},r.getClassNames=function(e){var t=r.props.classNames,n="string"==typeof t,a=n?""+(n&&t?t+"-":"")+e:t[e];return{baseClassName:a,activeClassName:n?a+"-active":t[e+"Active"],doneClassName:n?a+"-done":t[e+"Done"]}},r}oh(t,e);var n=t.prototype;return n.addClass=function(e,r,t){var n=this.getClassNames(r)[t+"ClassName"],a=this.getClassNames("enter").doneClassName;"appear"===r&&"done"===t&&a&&(n+=" "+a),"active"===t&&e&&e.scrollTop,n&&(this.appliedClasses[r][t]=n,mh(e,n))},n.removeClasses=function(e,r){var t=this.appliedClasses[r],n=t.base,a=t.active,o=t.done;this.appliedClasses[r]={},n&&gh(e,n),a&&gh(e,a),o&&gh(e,o)},n.render=function(){var e=this.props,t=(e.classNames,ah(e,["classNames"]));return r.createElement(dh,nh({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(r.Component);vh.defaultProps={classNames:""},vh.propTypes={};var yh,bh,Ch="out-in",wh="in-out",kh=function(e,r,t){return function(){var n;e.props[r]&&(n=e.props)[r].apply(n,arguments),t()}},Bh=((ph={})[Ch]=function(e){var t=e.current,n=e.changeState;return r.cloneElement(t,{in:!1,onExited:kh(t,"onExited",(function(){n(uh,null)}))})},ph[wh]=function(e){var t=e.current,n=e.changeState,a=e.children;return[t,r.cloneElement(a,{in:!0,onEntered:kh(a,"onEntered",(function(){n(uh)}))})]},ph),Eh=((hh={})[Ch]=function(e){var t=e.children,n=e.changeState;return r.cloneElement(t,{in:!0,onEntered:kh(t,"onEntered",(function(){n(lh,r.cloneElement(t,{in:!0}))}))})},hh[wh]=function(e){var t=e.current,n=e.children,a=e.changeState;return[r.cloneElement(t,{in:!1,onExited:kh(t,"onExited",(function(){a(lh,r.cloneElement(n,{in:!0}))}))}),r.cloneElement(n,{in:!0})]},hh),Sh=function(e){function t(){for(var r,t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return(r=e.call.apply(e,[this].concat(n))||this).state={status:lh,current:null},r.appeared=!1,r.changeState=function(e,t){void 0===t&&(t=r.state.current),r.setState({status:e,current:t})},r}oh(t,e);var n=t.prototype;return n.componentDidMount=function(){this.appeared=!0},t.getDerivedStateFromProps=function(e,t){return null==e.children?{current:null}:t.status===uh&&e.mode===wh?{status:uh}:!t.current||(n=t.current,a=e.children,n===a||r.isValidElement(n)&&r.isValidElement(a)&&null!=n.key&&n.key===a.key)?{current:r.cloneElement(e.children,{in:!0})}:{status:"exiting"};var n,a},n.render=function(){var e,t=this.props,n=t.children,a=t.mode,o=this.state,i=o.status,s=o.current,c={children:n,current:s,changeState:this.changeState,status:i};switch(i){case uh:e=Eh[a](c);break;case"exiting":e=Bh[a](c);break;case lh:e=s}return r.createElement(ch.Provider,{value:{isMounting:!this.appeared}},e)},t}(r.Component);Sh.propTypes={},Sh.defaultProps={mode:Ch};var _h=m.div(yh||(yh=L(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: ","; // must be higher than BASE_Z_INDEX and lower than other layers\n"])),1001),Ah=v(["from{background:#000;}to{}"]),Ih=b([".splash-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}"],Ah,300),Th=m.div(bh||(bh=L(["\n ","\n"])),Ih),xh=function(e){var t=e.keyForTransition,n=void 0===t?0:t;return r.createElement(Th,null,r.createElement(Sh,null,r.createElement(vh,{key:n,timeout:{enter:300,exit:0},classNames:"splash",unmountOnExit:!1},r.createElement(_h,null))))},Ph=Object.freeze({__proto__:null,default:xh}),Rh=v(["from{transform:rotate(0deg);}to{transform:rotate(360deg);}"]),Dh=b([".spin{animation-name:",";animation-iteration-count:infinite;animation-duration:1000ms;animation-timing-function:linear;}"],Rh),Nh=Object.freeze({__proto__:null,default:Dh}),Lh=Object.freeze({__proto__:null,flipY:Xp,slide:Jp,blink:th,splash:Ph,spin:Nh}),Oh={DEFAULT:"default",ERROR:"error"};function Mh(e){var t=e.className,a=e.width,o=e.height,i=e.type,s=e.strokeStyles,c=e.strokeWidth,u=e.radius,l=e.paddingStyle,d=n((function(){var e;return x((A(e={},Oh.DEFAULT,{fill:"none",strokeWidth:c,stroke:"#fff",strokeDasharray:"7, 4",opacity:.6}),A(e,Oh.ERROR,{fill:"rgba(234,50,35, 0.1)",strokeWidth:c,stroke:"#ea3223"}),e),s)}),[c,s]),f=u+.8*c,p=d[i];return r.createElement("svg",{width:a,height:o,className:t},r.createElement("rect",{x:c/2,y:c/2,rx:u,ry:u,width:a-c,height:o-c,style:p}),r.createElement("path",{d:"M0,".concat(f," Q0,0 ").concat(f,",0 L0,0 Z"),style:l}),r.createElement("path",{d:"M0,".concat(o-f," Q0,").concat(o," ").concat(f,",").concat(o," L0,").concat(o," Z"),style:l}),r.createElement("path",{d:"M".concat(a-f,",").concat(o," Q").concat(a,",").concat(o," ").concat(a,",").concat(o-f," L").concat(a,",").concat(o," Z"),style:l}),r.createElement("path",{d:"M".concat(a-f,",0 Q").concat(a,",0 ").concat(a,",").concat(f," L").concat(a,",0 Z"),style:l}))}Mh.propTypes={className:h.string,width:h.number,height:h.number,strokeWidth:h.number,strokeStyles:h.shape({}),type:h.oneOf([Oh.DEFAULT,Oh.ERROR]),radius:h.number,paddingStyle:h.shape({})},Mh.defaultProps={className:"",width:600,height:400,strokeWidth:2,strokeStyles:{},type:Oh.DEFAULT,radius:10,paddingStyle:{fill:"rgba(0, 0, 0, 0.6)"}};var Fh,Uh,Vh,jh,zh,Kh,Hh,qh,Gh,Wh,Qh,Xh,Yh,Zh,$h,Jh,em,rm,tm,nm,am,om,im,sm,cm,um,lm,dm,fm,pm,hm,mm,gm=["width","height","type"],vm=m(Mh)(Fh||(Fh=L([""]))),ym=m.img(Uh||(Uh=L(["\n position: absolute;\n top: 0;\n left: 0;\n"]))),bm=xh,Cm=m.div(Vh||(Vh=L(["\n ","\n ","\n"])),Qp,Dh),wm=m.img(jh||(jh=L(["\n border-radius: 5px;\n opacity: 0.7;\n height: 38px;\n"]))),km=m.div(zh||(zh=L(["\n cursor: pointer;\n text-align: center;\n width: ","px;\n\n img {\n width: 100%;\n }\n\n z-index: ",";\n position: fixed;\n\n ","\n"])),60,1020,qs.isMobile?b(["top:",";"],(function(e){return e.y})):b(["bottom:","px;"],10)),Bm=m.div(Kh||(Kh=L(["\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n position: absolute;\n margin: auto;\n width: ","px;\n height: ","px;\n\n img {\n width: 100%;\n }\n\n z-index: ",";\n"])),100,100,1020),Em=m.div(Hh||(Hh=L(["\n color: #fff;\n text-align: center;\n"]))),Sm=m.div(qh||(qh=L(["\n transform: translateZ(1000px); // to fix rotating bug on safari\n transform-style: preserve-3d;\n position: absolute;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),_m=m.div(Gh||(Gh=L(["\n display: flex;\n align-items: center;\n"]))),Am=m(Em)(Wh||(Wh=L(["\n font-size: 20px;\n margin-left: 10px;\n color: #fff;\n"]))),Im=m(Em)(Qh||(Qh=L(["\n font-size: 20px;\n margin-left: 10px;\n color: green;\n position: absolute;\n left: 0;\n top: 10px;\n background: white;\n z-index: ",";\n"])),1030),Tm=m(Em)(Xh||(Xh=L(["\n position: absolute;\n font-size: 16px;\n text-align: center;\n color: #fff;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),xm=m(Tm)(Yh||(Yh=L(["\n background: #ea3223;\n padding: 5px 10px;\n border-radius: 3px;\n"]))),Pm=m(Em)(Zh||(Zh=L(["\n position: absolute;\n font-size: 18px;\n text-align: center;\n border-radius: 3px;\n padding: 5px 10px;\n background: #ea3223;\n color: #fff;\n margin: 0 10px;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),Rm=(m.div($h||($h=L(["\n font-size: 18px;\n text-align: center;\n padding: 10px;\n"]))),function(e){var t=e.width,n=e.height,a=e.type,o=N(e,gm),i=Nn.useAsset("id_card_frame.png"),s=Nn.useAsset("id_card_frame_error.png");return r.createElement(Cm,{width:t,height:n},r.createElement(ym,{src:a===Oh.ERROR?s:i,width:t,height:n}),r.createElement(vm,I({width:t,height:n,type:a},o)))}),Dm=Object.freeze({__proto__:null,CloseCameraButton:function(e){var t=e.className,n=e.onClick,a=Nn.useAsset("ic_close.png");return r.createElement(ou,{className:t,onClick:n},r.createElement("img",{src:a,alt:""}))}}),Nm=th,Lm=Jp,Om=Nh,Mm=b(["z-index:",";color:#ffffff;"],1020),Fm=m.div(Jh||(Jh=L(["\n ","\n"])),Mm),Um=m(_p)(em||(em=L(["\n ","\n ","\n ","\n ","\n font-size: 18px;\n background: #ea3223;\n color: #fff;\n padding: 5px 10px;\n border-radius: 3px;\n position: absolute;\n white-space: pre-wrap;\n text-align: center;\n max-width: 80%;\n"])),Mm,(function(e){var r=e.top;return r&&b(["top:","px;"],r)}),(function(e){var r=e.bottom;return r&&b(["bottom:","px;"],r)}),(function(e){return e.centerY&&b(["top:50%;transform:translateY(-50%);"])})),Vm=m(Fm)(rm||(rm=L(["\n ","\n font-size: 18px;\n background: #ea3223;\n color: #fff;\n padding: 5px 10px;\n border-radius: 3px;\n position: absolute;\n left: 50%;\n transform: translate(-50%, 0);\n white-space: nowrap;\n"])),(function(e){var r=e.top;return r&&b(["top:","px;"],r)})),jm=m(Fm)(tm||(tm=L(["\n position: absolute;\n ","\n ","\n font-size: ",";\n text-shadow: 2px 2px 4px #000000;\n"])),(function(e){var r=e.top;return r&&b(["top:","px;"],r)}),(function(e){var r=e.bottom;return r&&b(["bottom:","px;"],r)}),(function(){return qs.isMobile?"20px":"22px"})),zm=m.div(nm||(nm=L(["\n height: ",";\n position: absolute;\n ","\n ","\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: ",";\n"])),(function(){return qs.isMobile?"50px":"70px"}),(function(e){var r=e.top;return r&&b(["top:","px;"],r)}),(function(e){var r=e.bottom;return r&&b(["bottom:","px;"],r)}),1020),Km=m.div(am||(am=L(["\n width: ",";\n height: ",";\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n border: 2px solid #ffffff;\n font-size: 16px;\n color: #fff;\n font-weight: 700;\n\n & + & {\n margin-left: 10px;\n }\n\n ","\n img {\n width: 100%;\n margin: 0;\n border-radius: 50%;\n }\n"])),(function(){return qs.isMobile?"40px":"50px"}),(function(){return qs.isMobile?"40px":"50px"}),(function(e){return!e.active&&b(["opacity:0.6;"])})),Hm=m.div(om||(om=L(["\n color: #ffffff;\n height: 70px;\n position: absolute;\n bottom: 0;\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: ",";\n"])),1020),qm=m.div(im||(im=L(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),Gm=m.div(sm||(sm=L(["\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n color: #ffffff;\n font-size: 140px;\n opacity: 0.6;\n"]))),Wm=m.div(cm||(cm=L(["\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n ",";\n ",";\n"])),Lm.default,Nm.default),Qm=m(Ip)(um||(um=L(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"]))),Xm=m(Tp)(lm||(lm=L(["\n width: 100%;\n height: 100%;\n vertical-align: middle;\n margin: 0;\n color: ",";\n"])),(function(e){var r=e.color;return null!=r?r:"rgba(0, 0, 0, 0.6)"})),Ym=m.div(dm||(dm=L(["\n position: absolute;\n z-index: -1;\n background: rgba(223, 0, 0, 0.2);\n border-radius: 50%;\n width: 86%;\n height: 86%;\n top: 7%;\n left: 7%;\n"]))),Zm=v(["from{opacity:1;}to{opacity:0;}"]),$m=m.div(fm||(fm=L(["\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n z-index: -1;\n background: rgba(255, 255, 255, 0.3);\n animation: "," 1s infinite;\n border-radius: 50%;\n"])),Zm),Jm=m.div(pm||(pm=L(["\n ","\n"])),Om.default),eg=qs.isMobile?{width:{ideal:640}}:null,rg={background:"#000000",opacity:.6};function tg(e){var t=e.apiCheck,n=e.mode,a=e.onLivenessDetectionDone,s=e.onClose,u=e.onError,l=e.captureFrameSettings,d=e.onFramesCaptured,f=e.frontCamera,p=e.customDirectionIcon,h=e.customStepTimeConstraints,m=e.onProcessing,g=e.customErrors,v=e.livenessSettings,y=e.apiCredentials,b=e.outputEncryptionSettings,C=e.cameraScale,w=e.defaultCameraId,k=e.passiveModeAuto,B=e.offsetFaceY,E=e.styledComponent,S=e.sdkAdapter,_=e.isLoading,A=e.frontalMinSize,I=Nn.useAsset("bg_camera_mask.png"),T=Nn.useAsset("bg_camera_mask_red.png"),x=Nn.useAsset("ic_loading.png"),P=O(c({}),2),R=P[0],D=P[1],N=R.yFaceDetectionError,L=R.yFaceVerificationStepsWrapper,M=O(c(""),2),F=M[0],U=M[1],V=o((function(e){var r=e.lostY,t=e.height,n=e.clientHeight,a=r+25,o=a+30;D({yFaceDetectionError:a,yFaceVerificationStepsWrapper:o+t+20});var i=Math.floor(r),s=Math.floor(n-r),c=Math.floor(o);return 0!==B&&(c+B<i||c+B+t>s)?u({code:"offsetFaceY must be in [-".concat(c-i,", ").concat(s-t-c,"]")}):c+=B,{y:c}}),[B,u]),j=pp({apiCheck:t,mode:n,bgCameraMask:I,bgCameraMaskRed:T,surroundStyle:rg,onLivenessDetectionDone:a,onError:u,cropAreaDimension:V,customDirectionIcon:p,captureFrameSettings:l,onFramesCaptured:d,livenessSettings:v,setRemainingTime:U,customStepTimeConstraints:h,onProcessing:m,customErrors:g,apiCredentials:y,outputEncryptionSettings:b,cameraScale:C,passiveModeAuto:k,sdkAdapter:S,frontalMinSize:A}),z=j.countdownToTakePicture,K=j.cropArea,H=j.curStepIndex,q=j.directionIcon,G=j.directionIconAnimation,W=j.faceDetectionError,Q=j.handleTriggerPassiveMode,X=j.handleVideoPlayed,Y=j.instructions,Z=j.isActiveMode,$=j.refVideo,J=j.showCountdown,ee=j.steps,re=j.videoPlayed,te=j.activeCapturing,ne=j.isFirstValidFrameFound,ae=j.warmupDone,oe=j.showLoading;i((function(){var e;"string"==typeof(null===(e=ee[0])||void 0===e?void 0:e.directionIcon)&&Promise.all(ee.map((function(e){return r=e.directionIcon,new Promise((function(e){var t=new Image;t.onload=e,t.onerror=e,t.src=r}));var r})))}),[ee]);var ie=E.CloseCameraButton;return r.createElement(Jm,null,r.createElement(hu,{frontCamera:f,onVideoPlayed:X,onClose:s,flipHorizontal:f,ref:$,videoSettings:eg,onError:u,scale:C,defaultCameraId:w,closeButton:ie||null},!ae&&r.createElement(qp,null),re?r.createElement(r.Fragment,null,r.createElement(Um,{top:N-15,className:"face-detection-error",error:W}),K.current?r.createElement(Cu,{x:"".concat(K.current.x,"px"),y:"".concat(K.current.y,"px"),width:"".concat(K.current.width,"px"),height:"".concat(K.current.height,"px"),surroundStyle:K.current.surroundStyle},r.createElement(Xm,null),r.createElement(Qm,{progress:H/ee.length*100,hasError:!!W,showDashedRing:!1,showOutsideRing:!1,insideRingWidth:1,errorRingWidth:1,insideRingStrokeDash:"2"}),J?r.createElement(Gm,null,z):null,Z?r.createElement(r.Fragment,null,r.createElement(Wm,null,function(e,t){return e?"string"==typeof e?r.createElement("img",{className:t,src:e,alt:"",style:{maxWidth:"98px",maxHeight:"98px",marginBottom:"25px"}}):e:null}(q,G)),te&&r.createElement($m,null)):null,W&&r.createElement(Ym,null)):null,Z?r.createElement(r.Fragment,null,F&&r.createElement(Vm,{top:L-30},F),Y?r.createElement(r.Fragment,null,r.createElement(jm,{top:L+5,className:"instructions"},Y),r.createElement(zm,{top:L+35},ee.map((function(e,t){var n=e.name,a=e.image.objUrl;return r.createElement(Km,{key:n,active:H>=t,className:"step-item"},a?r.createElement("img",{src:a,alt:""}):r.createElement("span",null,t+1))})))):null):r.createElement(r.Fragment,null,!ne||W||k?null:r.createElement(Hm,null,r.createElement(qm,{onClick:Q},r.createElement(wu,null))))):null,(oe||_)&&r.createElement(Bm,null,r.createElement("img",{src:x,alt:"",className:"spin"}))))}tg.propTypes={apiCheck:h.bool,frontalMinSize:h.number,mode:h.string,onLivenessDetectionDone:h.func,onClose:h.func,onError:h.func,captureFrameSettings:h.shape({}),onFramesCaptured:h.func,frontCamera:h.bool,customDirectionIcon:h.shape({}),customStepTimeConstraints:h.shape({}),onProcessing:h.func,customErrors:h.shape({}),livenessSettings:h.shape({}),apiCredentials:h.shape({accessKey:h.string,secretKey:h.string,apiUrl:h.string}),outputEncryptionSettings:h.shape({}),cameraScale:h.number,defaultCameraId:h.string,passiveModeAuto:h.bool,offsetFaceY:h.number,styledComponent:h.shape({CloseCameraButton:h.node}),sdkAdapter:h.shape({}),isLoading:h.bool},tg.defaultProps={apiCheck:!1,frontalMinSize:null,mode:null,onLivenessDetectionDone:null,onClose:null,onError:function(){},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},onFramesCaptured:function(){},frontCamera:!0,customDirectionIcon:(hm={},A(hm,K.FaceDirection.LEFT,r.createElement(kp,{type:K.FaceDirection.LEFT})),A(hm,K.FaceDirection.RIGHT,r.createElement(kp,{type:K.FaceDirection.RIGHT})),A(hm,K.FaceDirection.UP,r.createElement(kp,{type:K.FaceDirection.UP})),A(hm,K.FaceDirection.FRONTAL,r.createElement(kp,{type:K.FaceDirection.FRONTAL})),hm),customStepTimeConstraints:(mm={},A(mm,K.FaceDirection.UP,{delayTime:0}),A(mm,K.FaceDirection.LEFT,{delayTime:0}),A(mm,K.FaceDirection.RIGHT,{delayTime:0}),A(mm,K.FaceDirection.FRONTAL,{delayTime:2e3}),mm),onProcessing:function(){},customErrors:null,livenessSettings:null,apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},outputEncryptionSettings:null,cameraScale:1,defaultCameraId:void 0,passiveModeAuto:!1,offsetFaceY:0,styledComponent:{CloseCameraButton:null},sdkAdapter:null,isLoading:!1};var ng,ag=Object.freeze({__proto__:null,Text:Fm,FaceDetectionError:Um,CountdownTime:Vm,FaceVerificationInstructions:jm,FaceVerificationStepsWrapper:zm,StepItem:Km,BottomButtonsOverlay:Hm,Button:qm,CountDownOverlay:Gm,InstructionsOverlay:Wm,LivenessStyledComponent:Dm,default:tg,useLivenessDetection:pp}),og=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.frontCamera,n=void 0===t||t,a=document.createElement("div");document.body.appendChild(a);var o=function(){w.unmountComponentAtNode(a)};return new Promise((function(e){w.render(r.createElement($t.SDKSettingsProvider,{value:{lang:"en"}},r.createElement(hu,{checkCameraMode:!0,frontCamera:n,onVideoPlayed:function(){o(),e(null)},onClose:o,onError:function(r){o(),e(r)}})),a)}))},ig=m.input(ng||(ng=L(["\n display: none;\n"]))),sg=l((function(e,t){var n=e.useFileBrowse,a=e.accept,i=e.frontCamera,s=e.onCaptureDone,c=e.outputEncryptionSettings,u=o(function(){var e=S(regeneratorRuntime.mark((function e(r){var t,n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.target.files,!s){e.next=8;break}if(n=t[0],!c||!c.key){e.next=7;break}return e.next=6,mi.encrypt({blob:n,key:c.key});case 6:a=e.sent;case 7:s({file:n,encrypted:a});case 8:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[s,c]);return r.createElement(ig,I({ref:t,type:"file",accept:a,onChange:u},n?{}:{capture:i?"user":"environment"}))}));sg.propTypes={useFileBrowse:h.bool,accept:h.string,frontCamera:h.bool,onCaptureDone:h.func,outputEncryptionSettings:h.shape({key:h.string})},sg.defaultProps={useFileBrowse:!1,accept:"image/*",frontCamera:!1,onCaptureDone:null,outputEncryptionSettings:{key:""}};var cg,ug=Object.freeze({__proto__:null,Camera:wu}),lg="landscape",dg="portrait",fg="desktop",pg=K.Errors,hg=m.div(cg||(cg=L(["\n text-align: center;\n font-size: 20px;\n font-weight: 600;\n"])));function mg(e){var t=e.children,n=$t.useSDKSettings().lang,o=pg.wrong_orientation.msg[n],s=function(){var e=a(window.matchMedia("(orientation: portrait)")),r=a(e.current.matches?dg:lg),t=O(c(r.current),2),n=t[0],o=t[1];return i((function(){function r(e){e.matches?o(dg):o(lg)}return e.current.addEventListener("change",r),function(){e.current.removeEventListener("change",r)}}),[]),qs.isMobile?{curOrientation:n,initOrientation:r.current}:{curOrientation:fg}}().curOrientation;return r.createElement(r.Fragment,null,s===lg&&r.createElement(zp,{open:!0},r.createElement(hg,null,o)),(s===dg||s===fg)&&r.createElement(r.Fragment,null,t))}var gg=["logCredentials","clientSettings","livenessSettings","livenessComponent"];function vg(e){var t=e.logCredentials,n=void 0===t?{enable:!0}:t,a=e.clientSettings,o=e.livenessSettings,i=e.livenessComponent,s=void 0===i?tg:i,c=N(e,gg),u=Pf(a,"data.settings.sdk_settings",{});return r.createElement(mg,null,r.createElement(Pn.SDKTrackingProvider,{value:{tracking:x({},n)}},r.createElement(s,I({},c,{livenessSettings:x(x(x({},o),null==u?void 0:u.active_liveness_settings),null==u?void 0:u.liveness_settings)}))))}var yg,bg,Cg,wg={BTN_OK:{en:"OK",vi:"Tôi đã hiểu"},FRONT:{en:"front",vi:"trước"},BACK:{en:"back",vi:"sau"},BTN_USE_THIS_PICTURE:{en:"Use this picture",vi:"Dùng ảnh này"},BTN_TRY_AGAIN:{en:"Try again",vi:"Thử lại"},CONFIRM_POPUP_VALID_QR:{en:"QR code scanned",vi:"Đã quét được mã QR"},CONFIRM_POPUP_INVALID_QR:{en:"Could not scan QR code",vi:"Không quét được mã QR"}},kg=K.IDCardMessage,Bg=m.div(yg||(yg=L(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),Eg=m.div(bg||(bg=L(["\n text-align: center;\n font-size: 1rem;\n"]))),Sg=m.button(Cg||(Cg=L(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n background-color: ",";\n border: 0;\n outline: none;\n border-radius: 0.25rem;\n color: #fff;\n font-weight: 400;\n cursor: pointer;\n font-size: 1rem;\n"])),(function(e){return e.theme.tsBlue})),_g=function(e){var t=e.onOk,n=e.maxSessionTime,a=$t.useSDKSettings().lang;return r.createElement(Bg,null,r.createElement(Eg,{className:"popup-message"},Kd(kg.TIMEOUT_INSTRUCTION[a])({x:n})),r.createElement(Sg,{className:"popup-button",onClick:t},wg.BTN_OK[a]))};_g.propTypes={onOk:h.func,maxSessionTime:h.number},_g.defaultProps={onOk:function(){},maxSessionTime:30};var Ag=function(){var e=O(c(!1),2),r=e[0],t=e[1],n=O(c(null),2),a=n[0],i=n[1],s=O(c({}),2),u=s[0],l=s[1];return{showPopup:o((function(e){var r=e.popupType,n=e.props;l(void 0===n?{}:n),i(r),t(null!==r)}),[]),popupShown:r,popupType:a,props:u}},Ig="SESSION_TIMEOUT",Tg="CONFIRM",xg="QR_INVALID",Pg="QR_INSTRUCTIONS",Rg=K.Errors;function Dg(e,r){return Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2)}function Ng(e,r){return Math.sqrt(Dg(e,r))}function Lg(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.canvas,t=e.imgMargin,n=window,a=n.cv,o=r.width,i=r.height,s=t;s<1&&(s=parseInt(.5*(i+o)*s,10));var c=a.imread(r),u=new a.Mat;return a.copyMakeBorder(c,u,s,s,s,s,a.BORDER_CONSTANT,new a.Scalar(0,0,0,255)),c.delete(),{mat:u,margin:s}}function Og(e,r){var t=window.cv,n=O(r.map((function(e){return e.location})),4),a=n[0],o=n[1],i=n[2],s=n[3],c=Ng(i,s),u=Ng(o,a),l=Math.max(c,u),d=Ng(o,i),f=Ng(a,s),p=Math.max(d,f),h=[a.x,a.y,o.x,o.y,i.x,i.y,s.x,s.y],m=[0,0,l-1,0,l-1,p-1,0,p-1],g=t.imread(e),v=new t.Mat,y=new t.Size(l,p),b=t.matFromArray(4,1,t.CV_32FC2,h),C=t.matFromArray(4,1,t.CV_32FC2,m),w=t.getPerspectiveTransform(b,C);t.warpPerspective(g,v,w,y,t.INTER_LINEAR,t.BORDER_CONSTANT,new t.Scalar);var k=new ImageData(new Uint8ClampedArray(v.data),v.cols,v.rows);return g.delete(),v.delete(),b.delete(),C.delete(),k}function Mg(e,r,t){var n={x:r.x-e.x,y:r.y-e.y},a={x:t.x-e.x,y:t.y-e.y},o=Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2)),i=Math.sqrt(Math.pow(a.x,2)+Math.pow(a.y,2));return 180*Math.acos((n.x*a.x+n.y*a.y)/(o*i))/Math.PI}function Fg(e){var r=e.corners,t=e.width,n=e.height,a=Number.MAX_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,i=Number.MIN_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;r.forEach((function(e){var r=e.location,t=r.x,n=r.y;a=Math.min(a,t),o=Math.min(o,n),i=Math.max(i,t),s=Math.max(s,n)}));var c=.02;return a/t>=c&&o/n>=c&&(n-s)/n>=c&&(t-i)/t>=c}function Ug(){return Vg.apply(this,arguments)}function Vg(){return(Vg=S(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c,u,l,d,f,p=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=p.length>0&&void 0!==p[0]?p[0]:{},t=r.canvas,n=r.paddingPercent,a=void 0===n?.04:n,o=t.width,i=t.height,s=Math.floor(o*a),c=Math.floor(i*a),u=o-2*s,l=i-2*c,d=document.createElement("canvas"),f=d.getContext("2d"),d.width=u,d.height=l,f.drawImage(t,s,c,u,l,0,0,u,l),e.abrupt("return",To.isCardGlare(d));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jg(e){for(var r=e.length,t=0;t<r;t++){var n=(t+r-1)%r,a=(t+1)%r,o=Mg(e[t].location,e[n].location,e[a].location);if(o<70||o>110)return!1}return!0}function zg(e){return Kg.apply(this,arguments)}function Kg(){return(Kg=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,u,l,d,f,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.blazefaceModel,n=r.predictedIdCardCanvas,a=r.frontSide,o=n.width,i=n.height,s=Math.floor(o/3),c=Math.floor(4*i/5),u=document.createElement("canvas"),l=u.getContext("2d"),u.width=s,u.height=c,l.drawImage(n,0,Math.floor(i/5),s,c,0,0,s,c),e.next=12,_a.getModelPredictions({model:t,sCanvas:u});case 12:if(d=e.sent,f=d.filter((function(e){var r=e.topLeft,t=e.bottomRight,n=O(e.probability,1)[0],a=e.landmarks;return!(n<.9||a.length<4)&&!(ga.rectAreaRatio({small:{coords:[r,t]},big:{coords:[[0,0],[_a.SIZE,_a.SIZE]]}})<.025)})),p=f.length,!a){e.next=22;break}if(0!==p){e.next=18;break}return e.abrupt("return",Rg.id_detector_error_front_side_no_faces);case 18:if(!(p>1)){e.next=20;break}return e.abrupt("return",Rg.id_detector_error_front_side_multiple_faces);case 20:e.next=24;break;case 22:if(!(p>0)){e.next=24;break}return e.abrupt("return",Rg.id_detector_error_back_side_has_faces);case 24:return e.abrupt("return",null);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Hg=function(){var e=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,B,E,_,A,I;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c=r.currentWorkingCanvas,u=r.refVirtualWorkingCanvas,l=r.refCountVirtualFrames,d=r.refVirtualFrames,f=r.refWorkingCanvas,(p=r.refCardResult).current.corners&&Array.isArray(p.current.corners)){e.next=3;break}return e.abrupt("return");case 3:return h=O(p.current.corners,3),m=h[0],g=h[1],v=h[2],y=(null==g||null===(t=g.location)||void 0===t?void 0:t.x)-(null==m||null===(n=m.location)||void 0===n?void 0:n.x)-100,b=(null==v||null===(a=v.location)||void 0===a?void 0:a.y)-(null==g||null===(o=g.location)||void 0===o?void 0:o.y)-100,C=performance.now(),(w=u.current).width=y,w.height=b,(k=w.getContext("2d")).drawImage(c,(null==m||null===(i=m.location)||void 0===i?void 0:i.x)+50,(null==m||null===(s=m.location)||void 0===s?void 0:s.y)+50,y,b,0,0,y,b),e.next=14,new Promise((function(e){w.toBlob(function(){var r=S(regeneratorRuntime.mark((function r(t){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Bn.MD5({blob:t});case 2:n=r.sent,d.current=[].concat(M(d.current),[n]),e();case 5:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}())}));case 14:return C=Math.floor(performance.now()-C),B=180-C>0?180-C:0,e.next=18,new Promise((function(e){return setTimeout(e,B)}));case 18:if(!(l.current<3)){e.next=29;break}return A=performance.now(),I=f.current,k.drawImage(I,(null==m||null===(E=m.location)||void 0===E?void 0:E.x)+50,(null==m||null===(_=m.location)||void 0===_?void 0:_.y)+50,y,b,0,0,y,b),e.next=24,new Promise((function(e){w.toBlob(function(){var r=S(regeneratorRuntime.mark((function r(t){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Bn.MD5({blob:t});case 2:n=r.sent,d.current=[].concat(M(d.current),[n]),e();case 5:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}())}));case 24:if(!(l.current<2)){e.next=26;break}return e.delegateYield(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return A=Math.floor(performance.now()-A),r=180-A>0?180-A:0,e.next=4,new Promise((function(e){return setTimeout(e,r)}));case 4:case"end":return e.stop()}}),e)}))(),"t0",26);case 26:l.current+=1,e.next=18;break;case 29:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}();var qg=function(e,r,t){return e==e&&(void 0!==t&&(e=e<=t?e:t),void 0!==r&&(e=e>=r?e:r)),e};var Gg=function(e,r,t){return void 0===t&&(t=r,r=void 0),void 0!==t&&(t=(t=Wu(t))==t?t:0),void 0!==r&&(r=(r=Wu(r))==r?r:0),qg(Wu(e),r,t)},Wg="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/libs/opencv-4.6.0.js";function Qg(){return(Qg=S(regeneratorRuntime.mark((function e(){var r,t,n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>0&&void 0!==a[0]?a[0]:{},t=r.url,n=void 0===t?Wg:t,e.abrupt("return",new Promise((function(e,r){var t=document.createElement("script");t.setAttribute("async",""),t.setAttribute("type","text/javascript"),t.setAttribute("id","opencvjs"),t.addEventListener("load",S(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!window.cv||!window.cv.getBuildInformation){r.next=4;break}e(),r.next=12;break;case 4:if(!(window.cv instanceof Promise)){r.next=11;break}return r.next=7,window.cv;case 7:window.cv=r.sent,e(),r.next=12;break;case 11:window.cv.onRuntimeInitialized=function(){e()};case 12:case"end":return r.stop()}}),r)})))),t.addEventListener("error",(function(){r()})),t.src=n;var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(t,a)})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Xg=Ff((function(){return Qg.apply(this,arguments)})),Yg={vn:"https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/models/id-card/tflite/model-v3.tflite",ph:"https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.3/models/id-card/tflite/ph_card_model.tflite"},Zg={vn:.4,ph:.5},$g={0:"top-left",1:"top-right",2:"bottom-right",3:"bottom-left",4:"cccd.front",5:"passport",6:"cmnd_old.front",7:"cmnd_old.back",8:"cmnd_new.front",9:"cmnd_new.back",10:"cccd_new.front",11:"cccd_new.back",12:"aadhaar_front",13:"aadhaar_back",14:"voter_front",15:"voter_back",16:"pan",17:"dl",18:"india_spassport",19:"aadhaar_letter",20:"pan_back",21:"passport_back",22:"unseen",23:"other",24:"BUREAU OF INTERNAL REVENUE",25:"COMMISSION ON ELECTIONS",26:"COVID VACCINATION CARD",27:"DRIVERS LICENSE",28:"HEALTH INSURANCE PHILHEALTH",29:"PAG-IBIG LOYALTY CARD",30:"PASSPORT",31:"PHILIPPINE IDENTIFICATION CARD",32:"POSTAL IDENTITY CARD",33:"PROFESSIONAL IDENTIFICATION CARD",34:"RESIDENT IDENTIFICATION CARD",35:"SOCIAL SECURITY SYSTEM",36:"UNIFIED MULTI PURPOSE ID",37:"VN_biz_license",38:"new_voter_front"};function Jg(e){var r,t,n,a,o,i=e.card,s=e.corners,c=i.box,u={x:(c[1]+c[3])/2,y:(c[0]+c[2])/2},l=c[2]-c[0],d=c[1]-c[3],f=V(s);try{for(f.s();!(o=f.n()).done;){var p=o.value;switch(p.label){case"top-left":r||(r=p.location);break;case"top-right":t||(t=p.location);break;case"bottom-right":n||(n=p.location);break;case"bottom-left":a||(a=p.location)}}}catch(e){f.e(e)}finally{f.f()}if(![r,t,n,a].every(Boolean))return console.debug("Not qualified, corners missing"),!1;var h={x:(r.x+n.x)/2,y:(r.y+n.y)/2},m={x:(t.x+a.x)/2,y:(t.y+a.y)/2},g=Dg(u,h),v=Dg(u,m);return Math.sqrt(g)>(l+d)/8||Math.sqrt(v)>(l+d)/8?(console.debug("Not qualified, not close enough"),!1):(console.debug("Qualified"),!0)}var ev=function(){function e(r){!function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e),this.country=r||"vn",this.defaultModelUrl=Yg[this.country]||Yg.vn}var r,t,n,a,o,i,s,c,u,l;return r=e,(t=[{key:"load",value:(l=S(regeneratorRuntime.mark((function e(){var r,t,n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>0&&void 0!==a[0]?a[0]:{},t=r.opencvUrl,n=r.modelUrl,e.next=3,Promise.all([Xg({url:t}),this.loadModel({modelUrl:n})]);case 3:return e.next=5,this.predictDummyInput();case 5:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"predictDummyInput",value:(u=S(regeneratorRuntime.mark((function e(){var r,t,n,a=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=window,t=r.tf,n=t.tidy((function(){var e=t.zeros(a.inputShape,"float32");return a.model.predict(e)})),e.abrupt("return",Promise.all([n[this.out_score_name].data()]));case 3:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"loadModel",value:(c=S(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=s.length>0&&void 0!==s[0]?s[0]:{},t=r.modelUrl,n=void 0===t?this.defaultModelUrl:t,e.next=3,di.initTensorFlow({preferredBackends:["wasm","cpu"]});case 3:return e.next=5,di.loadTFLiteModel({modelUrl:n});case 5:this.model=e.sent,a=this.model.inputs,this.inputShape=a[0].shape,o=this.model.outputs.map((function(e){return e.name})).splice(0,3).reverse(),i=O(o,3),this.out_score_name=i[0],this.out_class_name=i[1],this.out_box_name=i[2];case 13:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"loadResource",value:(s=S(regeneratorRuntime.mark((function e(){var r,t,n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>0&&void 0!==a[0]?a[0]:{},t=r.modelUrl,n=void 0===t?this.defaultModelUrl:t,e.next=3,di.preloadResource({modelUrl:n});case 3:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"dispose",value:(i=S(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.model&&this.model.dispose();case 1:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"predict",value:(o=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,B,E,S,_,A,I,T,x,P,R=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=R.length>1&&void 0!==R[1]?R[1]:{},n=t.imgMargin,a=t.detectThreshold,o=void 0===a?.3:a,i=t.maxNumReturns,s=void 0===i?100:i,c=window,u=c.cv,l={},d=r.width,f=r.height,l.originalWidth=d,l.originalHeight=f,p=Lg({canvas:r,imgMargin:"number"==typeof n?n:Zg[this.country]}),h=p.margin,m=p.mat,g=this.inputShape.slice(1,3),v=O(g,2),y=v[0],b=v[1],C=new u.Mat,u.resize(m,C,new u.Size(y,b),0,0,u.INTER_AREA),w=m.cols/y,k=m.rows/b,(B=document.createElement("canvas")).width=y,B.height=b,B.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(C.data),C.cols,C.rows),0,0),m.delete(),C.delete(),l.canvas=B,l.margin=h,E=performance.now(),e.next=25,this.detect(B,{detectThreshold:o,maxNumReturns:s});case 25:if(S=e.sent,_=Math.floor(performance.now()-E),A={inputImage:l,card:null,exeTime:_},I=[[],[],[],[]],T=[],x=[],S.forEach((function(e){var r=O(e.box,4),t=r[0],n=r[1],a=r[2],o=r[3];e.clazz<=3?I[e.clazz].push({clazz:e.clazz,label:e.label,score:e.score,location:{x:Gg(Math.floor((o+n)/2*w-h),0,d),y:Gg(Math.floor((t+a)/2*k-h),0,f)},scaledLocation:{x:Gg(Math.floor((o+n)/2),0,B.width),y:Gg(Math.floor((t+a)/2),0,B.height)}}):x.push({label:e.label,score:e.score,box:[Gg(Math.floor(t*k-h),0,f),Gg(Math.floor(n*w-h),0,d),Gg(Math.floor(a*k-h),0,f),Gg(Math.floor(o*w-h),0,d)]})})),I.forEach((function(e){e.length&&(e.sort((function(e,r){return r.score-e.score})),T.push(e[0]))})),!(x.length>0&&4===T.length)){e.next=49;break}if(x.sort((function(e,r){return r.score-e.score})),T.sort((function(e,r){return e.clazz-r.clazz})),P=x[0],e.prev=37,Jg({card:P,corners:T})){e.next=41;break}return console.debug("Not qualified.",P,T),e.abrupt("return",A);case 41:e.next=46;break;case 43:return e.prev=43,e.t0=e.catch(37),e.abrupt("return",A);case 46:return P.corners=T,A.card=P,e.abrupt("return",A);case 49:return e.abrupt("return",A);case 50:case"end":return e.stop()}}),e,this,[[37,43]])}))),function(e){return o.apply(this,arguments)})},{key:"detect",value:(a=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,B,E,S=this,_=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=_.length>1&&void 0!==_[1]?_[1]:{},n=t.detectThreshold,a=t.maxNumReturns,o=window,i=o.tf,s=r.width,c=r.height,u=i.tidy((function(){var e=i.expandDims(i.cast(i.image.resizeBilinear(i.browser.fromPixels(r),S.inputShape.slice(1,3)),"float32"));return S.model.predict(e)})),e.next=7,Promise.all([u[this.out_score_name].data(),u[this.out_class_name].data(),u[this.out_box_name].array()]);case 7:l=e.sent,d=O(l,3),f=d[0],p=d[1],h=O(d[2],1),m=h[0],g=Math.min(f.length,a),v=[];try{for(y=0;y<g;y++)b=f[y],C=p[y],b>n&&(k=null!==(w=$g[Math.round(C)])&&void 0!==w?w:"NA",B=m[y],E=[B[0]*c,B[3]*s,B[2]*c,B[1]*s],v.push({score:b,clazz:C,box:E,label:k}))}catch(e){console.log(e)}return e.abrupt("return",v.length>=5?v:[]);case 17:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})}])&&_(r.prototype,t),n&&_(r,n),e}();class rv{static hasCamera(){return rv.listCameras(!1).then((e=>!!e.length)).catch((()=>!1))}static listCameras(e=!1){if(!navigator.mediaDevices)return Promise.resolve([]);let r=null;return(e?navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then((e=>r=e)).catch((()=>{})):Promise.resolve()).then((()=>navigator.mediaDevices.enumerateDevices())).then((e=>e.filter((e=>"videoinput"===e.kind)).map(((e,r)=>({id:e.deviceId,label:e.label||(0===r?"Default Camera":`Camera ${r+1}`)}))))).finally((()=>{if(r)for(const e of r.getTracks())e.stop(),r.removeTrack(e)}))}constructor(e,r,t=this._onDecodeError,n=this._calculateScanRegion,a="environment"){this.$video=e,this.$canvas=document.createElement("canvas"),this._onDecode=r,this._legacyCanvasSize=rv.DEFAULT_CANVAS_SIZE,this._preferredCamera=a,this._active=!1,this._paused=!1,this._flashOn=!1,"number"==typeof t?(this._legacyCanvasSize=t,console.warn("You're using a deprecated version of the QrScanner constructor which will be removed in the future")):this._onDecodeError=t,"number"==typeof n?(this._legacyCanvasSize=n,console.warn("You're using a deprecated version of the QrScanner constructor which will be removed in the future")):this._calculateScanRegion=n,this._scanRegion=this._calculateScanRegion(e),this._onPlay=this._onPlay.bind(this),this._onLoadedMetaData=this._onLoadedMetaData.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),e.disablePictureInPicture=!0,e.playsInline=!0,e.muted=!0;let o=!1;e.hidden&&(e.hidden=!1,o=!0),document.body.contains(e)||(document.body.appendChild(e),o=!0),requestAnimationFrame((()=>{const r=window.getComputedStyle(e);"none"===r.display&&(e.style.setProperty("display","block","important"),o=!0),"visible"!==r.visibility&&(e.style.setProperty("visibility","visible","important"),o=!0),o&&(console.warn("QrScanner has overwritten the video hiding style to avoid Safari stopping the playback."),e.style.opacity=0,e.style.width=0,e.style.height=0)})),e.addEventListener("play",this._onPlay),e.addEventListener("loadedmetadata",this._onLoadedMetaData),document.addEventListener("visibilitychange",this._onVisibilityChange),this._qrEnginePromise=rv.createQrEngine()}hasFlash(){let e=null;return(this.$video.srcObject?Promise.resolve(this.$video.srcObject.getVideoTracks()[0]):this._getCameraStream().then((({stream:r})=>(console.warn("Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream"),e=r,r.getVideoTracks()[0])))).then((e=>"torch"in e.getSettings())).catch((()=>!1)).finally((()=>{if(e)for(const r of e.getTracks())r.stop(),e.removeTrack(r)}))}isFlashOn(){return this._flashOn}toggleFlash(){return this._flashOn?this.turnFlashOff():this.turnFlashOn()}turnFlashOn(){return this._flashOn?Promise.resolve():(this._flashOn=!0,!this._active||this._paused?Promise.resolve():this.hasFlash().then((e=>e?this.$video.srcObject.getVideoTracks()[0].applyConstraints({advanced:[{torch:!0}]}):Promise.reject("No flash available"))).catch((()=>{throw this._flashOn=!1,e})))}turnFlashOff(){if(this._flashOn)return this._flashOn=!1,this._restartVideoStream()}destroy(){this.$video.removeEventListener("loadedmetadata",this._onLoadedMetaData),this.$video.removeEventListener("play",this._onPlay),document.removeEventListener("visibilitychange",this._onVisibilityChange),this.stop(),rv._postWorkerMessage(this._qrEnginePromise,"close")}start(){return this._active&&!this._paused?Promise.resolve():("https:"!==window.location.protocol&&console.warn("The camera stream is only accessible if the page is transferred via https."),this._active=!0,document.hidden?Promise.resolve():(this._paused=!1,this.$video.srcObject?(this.$video.play(),Promise.resolve()):this._getCameraStream().then((({stream:e,facingMode:r})=>{this.$video.srcObject=e,this.$video.play(),this._setVideoMirror(r),this._flashOn&&(this._flashOn=!1,this.turnFlashOn().catch((()=>{})))})).catch((e=>{throw this._active=!1,e}))))}stop(){this.pause(),this._active=!1}pause(e=!1){if(this._paused=!0,!this._active)return Promise.resolve(!0);this.$video.pause();const r=()=>{const e=this.$video.srcObject?this.$video.srcObject.getTracks():[];for(const r of e)r.stop(),this.$video.srcObject.removeTrack(r);this.$video.srcObject=null};return e?(r(),Promise.resolve(!0)):new Promise((e=>setTimeout(e,300))).then((()=>!!this._paused&&(r(),!0)))}setCamera(e){return e===this._preferredCamera?Promise.resolve():(this._preferredCamera=e,this._restartVideoStream())}static scanImage(e,r=null,t=null,n=null,a=!1,o=!1){const i=t instanceof Worker;let s=Promise.all([t||rv.createQrEngine(),rv._loadImage(e)]).then((([e,o])=>{let s;return t=e,[n,s]=this._drawToCanvas(o,r,n,a),t instanceof Worker?(i||t.postMessage({type:"inversionMode",data:"both"}),new Promise(((e,r)=>{let a,o,i;o=n=>{"qrResult"===n.data.type&&(t.removeEventListener("message",o),t.removeEventListener("error",i),clearTimeout(a),null!==n.data.data?e(n.data.data):r(rv.NO_QR_CODE_FOUND))},i=e=>{t.removeEventListener("message",o),t.removeEventListener("error",i),clearTimeout(a);const n=e?e.message||e:"Unknown Error";r("Scanner error: "+n)},t.addEventListener("message",o),t.addEventListener("error",i),a=setTimeout((()=>i("timeout")),1e4);const c=s.getImageData(0,0,n.width,n.height);t.postMessage({type:"decode",data:c},[c.data.buffer])}))):new Promise(((e,r)=>{const a=setTimeout((()=>r("Scanner error: timeout")),1e4);t.detect(n).then((t=>{t.length?e(t[0].rawValue):r(rv.NO_QR_CODE_FOUND)})).catch((e=>r("Scanner error: "+(e.message||e)))).finally((()=>clearTimeout(a)))}))}));return r&&o&&(s=s.catch((()=>rv.scanImage(e,null,t,n,a)))),s=s.finally((()=>{i||rv._postWorkerMessage(t,"close")})),s}setGrayscaleWeights(e,r,t,n=!0){rv._postWorkerMessage(this._qrEnginePromise,"grayscaleWeights",{red:e,green:r,blue:t,useIntegerApproximation:n})}setInversionMode(e){rv._postWorkerMessage(this._qrEnginePromise,"inversionMode",e)}static createQrEngine(e=rv.WORKER_PATH){return("BarcodeDetector"in window&&BarcodeDetector.getSupportedFormats?BarcodeDetector.getSupportedFormats():Promise.resolve([])).then((r=>-1!==r.indexOf("qr_code")?new BarcodeDetector({formats:["qr_code"]}):new Worker(e)))}_onPlay(){this._scanRegion=this._calculateScanRegion(this.$video),this._scanFrame()}_onLoadedMetaData(){this._scanRegion=this._calculateScanRegion(this.$video)}_onVisibilityChange(){document.hidden?this.pause():this._active&&this.start()}_calculateScanRegion(e){const r=Math.min(e.videoWidth,e.videoHeight),t=Math.round(2/3*r);return{x:Math.round((e.videoWidth-t)/2),y:Math.round((e.videoHeight-t)/2),width:t,height:t,downScaledWidth:this._legacyCanvasSize,downScaledHeight:this._legacyCanvasSize}}_scanFrame(){if(!this._active||this.$video.paused||this.$video.ended)return!1;requestAnimationFrame((()=>{this.$video.readyState<=1?this._scanFrame():this._qrEnginePromise.then((e=>rv.scanImage(this.$video,this._scanRegion,e,this.$canvas))).then(this._onDecode,(e=>{if(!this._active)return;-1!==(e.message||e).indexOf("service unavailable")&&(this._qrEnginePromise=rv.createQrEngine()),this._onDecodeError(e)})).then((()=>this._scanFrame()))}))}_onDecodeError(e){e!==rv.NO_QR_CODE_FOUND&&console.log(e)}_getCameraStream(){if(!navigator.mediaDevices)return Promise.reject("Camera not found.");const e="environment"===this._preferredCamera||"user"===this._preferredCamera?"facingMode":"deviceId",r=[{width:{min:1024}},{width:{min:768}},{}];return[...r.map((r=>Object.assign({},r,{[e]:{exact:this._preferredCamera}}))),...r].reduceRight(((e,r)=>()=>navigator.mediaDevices.getUserMedia({video:r,audio:!1}).then((e=>({stream:e,facingMode:this._getFacingMode(e)||(r.facingMode?this._preferredCamera:"environment"===this._preferredCamera?"user":"environment")}))).catch(e)),(()=>Promise.reject("Camera not found.")))()}_restartVideoStream(){const e=this._paused;return this.pause(!0).then((r=>{if(r&&!e&&this._active)return this.start()}))}_setVideoMirror(e){const r="user"===e?-1:1;this.$video.style.transform="scaleX("+r+")"}_getFacingMode(e){const r=e.getVideoTracks()[0];return r?/rear|back|environment/i.test(r.label)?"environment":/front|user|face/i.test(r.label)?"user":null:null}static _drawToCanvas(e,r=null,t=null,n=!1){t=t||document.createElement("canvas");const a=r&&r.x?r.x:0,o=r&&r.y?r.y:0,i=r&&r.width?r.width:e.width||e.videoWidth,s=r&&r.height?r.height:e.height||e.videoHeight;if(!n){const e=r&&r.downScaledWidth?r.downScaledWidth:i,n=r&&r.downScaledHeight?r.downScaledHeight:s;t.width!==e&&(t.width=e),t.height!==n&&(t.height=n)}const c=t.getContext("2d",{alpha:!1});return c.imageSmoothingEnabled=!1,c.drawImage(e,a,o,i,s,0,0,t.width,t.height),[t,c]}static _loadImage(e){if(e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||window.ImageBitmap&&e instanceof window.ImageBitmap||window.OffscreenCanvas&&e instanceof window.OffscreenCanvas)return Promise.resolve(e);if(e instanceof Image)return rv._awaitImageLoad(e).then((()=>e));if(e instanceof File||e instanceof Blob||e instanceof URL||"string"==typeof e){const r=new Image;return e instanceof File||e instanceof Blob?r.src=URL.createObjectURL(e):r.src=e,rv._awaitImageLoad(r).then((()=>((e instanceof File||e instanceof Blob)&&URL.revokeObjectURL(r.src),r)))}return Promise.reject("Unsupported image type.")}static _awaitImageLoad(e){return new Promise(((r,t)=>{if(e.complete&&0!==e.naturalWidth)r();else{let n,a;n=()=>{e.removeEventListener("load",n),e.removeEventListener("error",a),r()},a=()=>{e.removeEventListener("load",n),e.removeEventListener("error",a),t("Image load error")},e.addEventListener("load",n),e.addEventListener("error",a)}}))}static _postWorkerMessage(e,r,t){return Promise.resolve(e).then((e=>{e instanceof Worker&&e.postMessage({type:r,data:t})}))}}function tv(){return nv.apply(this,arguments)}function nv(){return(nv=S(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return rv.WORKER_PATH=Ms(),e.next=3,rv.createQrEngine(rv.WORKER_PATH);case 3:return r=e.sent,e.abrupt("return",{qrEngine:r});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function av(){return ov.apply(this,arguments)}function ov(){return(ov=S(regeneratorRuntime.mark((function e(){var r,t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([tv()]);case 2:return r=e.sent,t=O(r,1),n=t[0].qrEngine,e.abrupt("return",{qrScannerResources:{engine:n,canvas:document.createElement("canvas")},noModel:!0});case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}rv.DEFAULT_CANVAS_SIZE=400,rv.NO_QR_CODE_FOUND="No QR code found",rv.WORKER_PATH="qr-scanner-worker.min.js";var iv="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/wechat_qr_models/";function sv(){return(sv=S(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=function(){return(s=S(regeneratorRuntime.mark((function e(){var r,t,n,i,s,c,u,l,d,f,p,h,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r="detect.prototxt",t="detect.caffemodel",n="sr.prototxt",i="sr.caffemodel",a){e.next=22;break}if(s=window,c=s.cv){e.next=8;break}throw new Error("Opencv not found!");case 8:return u=[o(r),o(t),o(n),o(i)],e.next=11,Promise.all(u);case 11:l=e.sent,d=O(l,4),f=d[0],p=d[1],h=d[2],m=d[3],c.FS_createDataFile("/","detect.prototxt",f,!0,!1,!1),c.FS_createDataFile("/","detect.caffemodel",p,!0,!1,!1),c.FS_createDataFile("/","sr.prototxt",h,!0,!1,!1),c.FS_createDataFile("/","sr.caffemodel",m,!0,!1,!1),a=new c.wechat_qrcode_WeChatQRCode("detect.prototxt","detect.caffemodel","sr.prototxt","sr.caffemodel");case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)},i=function(){return s.apply(this,arguments)},r=c.length>0&&void 0!==c[0]?c[0]:{},t=r.modelUrl,n=void 0===t?iv:t,o=function(){var e=S(regeneratorRuntime.mark((function e(r){var t,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(n).concat(r));case 2:return t=e.sent,e.next=5,t.arrayBuffer();case 5:return a=e.sent,e.abrupt("return",new Uint8Array(a));case 7:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),e.prev=4,e.next=7,i();case 7:e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(4),console.log(e.t0),e.abrupt("return",av());case 13:return e.abrupt("return",{qrModel:a});case 14:case"end":return e.stop()}}),e,null,[[4,9]])})))).apply(this,arguments)}var cv=Ff((function(){return sv.apply(this,arguments)}));function uv(e){return lv.apply(this,arguments)}function lv(){return(lv=S(regeneratorRuntime.mark((function e(r){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.idCardModel,e.abrupt("return",new Promise((function(e,r){setTimeout(r,900),t.predictDummyInput().then(e)})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function dv(e){return fv.apply(this,arguments)}function fv(){return(fv=S(regeneratorRuntime.mark((function e(r){var t,n,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.idCardModel,n=!0,e.prev=2,a=performance.now(),e.next=6,uv({idCardModel:t});case 6:(o=performance.now())-a+.6*(o-a)>900&&(n=!1),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),n=!1;case 13:return e.abrupt("return",{fastEnough:n});case 14:case"end":return e.stop()}}),e,null,[[2,10]])})))).apply(this,arguments)}function pv(){return(pv=S(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c,u,l,d,f,p,h=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=h.length>0&&void 0!==h[0]?h[0]:{},t=r.opencvUrl,n=r.idCardModelUrl,a=r.blazefaceModelUrl,o=r.tfScriptUrls,i=r.wechatQRModelsUrl,s=h.length>1?h[1]:void 0,e.next=4,Xf({blazefaceModelUrl:a,tfScriptUrls:o});case 4:return c=e.sent,u=c.blazefaceModel,l=!0,d=new ev(s),e.prev=8,e.next=11,d.load({opencvUrl:t,modelUrl:n});case 11:e.next=16;break;case 13:return e.prev=13,e.t0=e.catch(8),e.abrupt("return",{ableToUseModel:!1});case 16:return e.next=18,cv({modelUrl:i});case 18:return e.prev=18,e.next=21,dv({idCardModel:d});case 21:f=e.sent,p=f.fastEnough,l=p,e.next=29;break;case 26:e.prev=26,e.t1=e.catch(18),l=!1;case 29:return e.abrupt("return",{ableToUseModel:l,idCardModel:d,blazefaceModel:u});case 30:case"end":return e.stop()}}),e,null,[[8,13],[18,26]])})))).apply(this,arguments)}var hv=Ff((function(){return pv.apply(this,arguments)})),mv=K.Errors;function gv(e){var r=e.refVideo,t=e.shouldStart,n=e.cropArea,s=e.settings,c=a(null);null===c.current&&(c.current=document.createElement("canvas"));var u=a(!1),l=a(So.createResizer({width:960,height:640})),d=a(null),f=a([{id:null,frames:[]}]),p=o((function(){!0===u.current&&(u.current=!1)}),[]),h=o((function(){f.current=[{id:null,frames:[]}]}),[]),m=o((function(){var e=f.current;e[e.length-1].frames.length>0&&e.push({id:null,frames:[]})}),[]),g=o(function(){var e=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=r.workingCanvas,n=l.current,a=f.current,o=n.resize({srcCanvas:t}),i=o.toDataURL("image/jpeg",s.saveFrameQuality/100).split(",")[1],a[a.length-1].frames.push({base64:i});case 7:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[s]),v=o(S(regeneratorRuntime.mark((function e(){var t,n,a,o,i,l,f,p,h,m,v,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s){e.next=2;break}return e.abrupt("return");case 2:if(t=s.frameCaptureIntervalMs,n=void 0===t?180:t,s.enableRecording){e.next=5;break}return e.abrupt("return");case 5:a=d.current,o=r.current,u.current=!0,i=a.cropX,l=a.cropY,f=a.cropWidth,p=a.cropHeight,(h=c.current).width=f,h.height=p,m=h.getContext("2d");case 13:return v=performance.now(),m.drawImage(o,i,l,f,p,0,0,f,p),e.next=18,g({workingCanvas:h});case 18:if(v=Math.floor(performance.now()-v),u.current){e.next=21;break}return e.abrupt("break",27);case 21:return y=0,n-v>0&&(y=n-v),e.next=25,On.sleep(y);case 25:e.next=13;break;case 27:case"end":return e.stop()}}),e)}))),[r,g,s]);return i((function(){var e=r.current;function a(){return(a=S(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return d.current=ca.analyzeVideoAndWindowSizes(e,n),r.next=3,v();case 3:case"end":return r.stop()}}),r)})))).apply(this,arguments)}return t&&n&&function(){a.apply(this,arguments)}(),function(){p()}}),[t,n,r,p,m,v]),{refWorkingCanvas:c,stopCheckFrame:p,splitVideos:m,resetRecordedVideos:h,checkFrame:v,refRecordedVideos:f}}var vv=function(e){var r=e.lang,t=e.onAboutToTimeout,n=e.onSessionTimeout,s=e.onVideoTimeLimitReached,u=e.settings,l=e.shouldStartTimers,d=e.sessionTime,f=a(),p=O(c(0),2),h=p[0],m=p[1],g=o((function(){clearInterval(f.current)}),[]),v=o((function(){m((function(e){return e+1}))}),[]);return i((function(){if(l){var e=u.maxRecordingTimePerVideo,r=0,a=d/3;f.current=setInterval((function(){var o=d-(r+=1);o<=a&&t&&t({curTimeLeft:o}),r>0&&r%e==0&&s&&s(),0===o&&(g(),n&&n())}),1e3)}return function(){g()}}),[l,r,t,g,n,s,h,u,d]),{stopTimers:g,startTimers:v}};Rs.initExifData();var yv,bv,Cv,wv=function(e){var r=e.shouldStart,t=e.refVideo,n=e.cropArea,s=e.settings,u=e.onModelErrorChange,l=e.frontSide,d=e.onDebugInfoChange,f=e.onAboutToTimeout,p=e.onSessionTimeout,h=e.onCaptureDone,m=e.outputEncryptionSettings,g=e.quality,v=a(!1),y=O(c(!1),2),b=y[0],C=y[1],w=a((function(){})),k=Pn.useSDKTracking().sendEvent,B=a(),E=a(),_=a(),I=$t.useSDKSettings(),T=I.debug,P=I.lang,R=I.enableAntiDebug,D=Os(),N=D.startMotion,L=D.stopMotion,M=D.motionData,F=D.orientationData;i((function(){R&&fi.enableAntiDebug()}),[R]);var U=o(function(){var e=S(regeneratorRuntime.mark((function e(r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k({tag:l?"id_front":"id_back",event:"sdk_ui.auto_capture",log:{}}),e.next=3,w.current(r);case 3:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[k,l]),V=o((function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];u.apply(void 0,r);var n=Pf(r,"0.code");n&&n!==B.current&&(k({tag:l?"id_front":"id_back",event:"sdk_ui.show_alert",log:{alert:n}}),B.current=n)}),[u,l,k]),j=function(e){var r=e.refVideo,t=e.shouldStart,n=e.cropArea,s=e.settings,u=e.onError,l=e.frontSide,d=e.onAutoCaptureSuccess,f=e.quality,p=a(null);null===p.current&&(p.current=document.createElement("canvas"));var h=a(0),m=a([]),g=a(null);null===g.current&&(g.current=document.createElement("canvas"));var v=a({}),y=a(!1),b=a(null),C=O(c(!1),2),w=C[0],k=C[1],B=a({imageBlob:null,takenAt:null,blurScore:null,detectedCard:null}),E=a({imageBlob:null,blurScore:null,error:null,detectedCard:null,captureCount:0,captureDuration:0}),_=a(!1),A=a(!1),I=a(null),T=a(!1),x=a({}),P=$t.useSDKSettings(),R=P.customUrls,D=P.country;i((function(){var e=!1;function r(){return(r=S(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!s||w){r.next=14;break}if(!s.enableIdDetection){r.next=10;break}return r.next=4,hv(R,D);case 4:return x.current=r.sent,r.next=7,di.initTensorFlow();case 7:I.current=s.enableBlurCheck&&x.current.ableToUseModel,r.next=11;break;case 10:I.current=!1;case 11:if(!e){r.next=13;break}return r.abrupt("return");case 13:k(!0);case 14:case"end":return r.stop()}}),r)})))).apply(this,arguments)}return function(){r.apply(this,arguments)}(),function(){e=!0}}),[w,s,R,D]);var N=o((function(e){return Hg({currentWorkingCanvas:e,refVirtualWorkingCanvas:g,refCountVirtualFrames:h,refVirtualFrames:m,refWorkingCanvas:p,refCardResult:v})}),[]),L=o((function(){!0===y.current&&(y.current=!1)}),[]),M=o(function(){var e=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.blurScore,n=r.detectedCard,a=s.blurThreshold,o=B.current,i=E.current,!(t<a&&ia.hasBetterCardBlurScore(t,o.blurScore))){e.next=17;break}if(!T.current){e.next=9;break}o.imageBlob=i.imageBlob,e.next=13;break;case 9:return e.next=11,ca.takePicture({canvas:p.current,quality:f});case 11:o.imageBlob=e.sent,o.captureTime=Date.now();case 13:o.takenAt=(new Date).getTime(),o.blurScore=t,o.detectedCard=n,o.captureType="auto";case 17:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[s,f]),F=o(function(){var e=S(regeneratorRuntime.mark((function e(r){var t,n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.blurScore,n=r.detectedCard,A.current=!0,a=E.current,!ia.hasBetterCardBlurScore(t,a.blurScore)){e.next=14;break}return e.next=6,ca.takePicture({canvas:p.current,quality:f});case 6:a.imageBlob=e.sent,a.captureDuration+=Date.now()-a.captureTime,a.captureTime=Date.now(),a.blurScore=t,a.detectedCard=n,a.captureCount++,a.captureType="manual",T.current=!0;case 14:A.current=!1;case 15:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[f]),U=o(S(regeneratorRuntime.mark((function e(){var r,t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=s.waitForBestImageTimeMs,null===(t=B.current).imageBlob){e.next=8;break}if(!((new Date).getTime()-t.takenAt>r)){e.next=8;break}return e.next=7,d(t);case 7:L();case 8:case"end":return e.stop()}}),e)}))),[d,s,L]),V=o((function(){_.current=!0}),[]),j=o((function(){return new Promise((function(e){_.current=!1;var r=setInterval((function(){A.current||(clearInterval(r),e())}),150)}))}),[]),z=o(S(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var r=s.blurThreshold,t=s.enableVirtualCamHashes,n=E.current;n.captureTime=Date.now(),I.current?(V(),setTimeout((function(){j().then(S(regeneratorRuntime.mark((function a(){var o;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(ia.hasBetterCardBlurScore(n.blurScore,r)||(n.error=mv.id_detector_error_blur),o=p.current,null!==n.imageBlob){a.next=6;break}ca.takePicture({canvas:o,quality:f}).then(function(){var r=S(regeneratorRuntime.mark((function r(a){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n.imageBlob=a,n.captureTime=Date.now(),!t){r.next=5;break}return r.next=5,N(o);case 5:e(n);case 6:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}()),a.next=10;break;case 6:if(!t){a.next=9;break}return a.next=9,N(o);case 9:e(n);case 10:case"end":return a.stop()}}),a)}))))}),2e3)):ca.takePicture({canvas:p.current,quality:f}).then(function(){var r=S(regeneratorRuntime.mark((function r(a){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n.imageBlob=a,n.captureTime=Date.now(),!t){r.next=5;break}return r.next=5,N(p.current);case 5:e(n);case 6:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}())})));case 1:case"end":return e.stop()}}),e)}))),[s,V,j,f,N]),K=o(S(regeneratorRuntime.mark((function e(){var t,n,a,o,i,c,d,f,g,C,k,A,I,P,R,N,L,O,V,j;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s&&w&&!y.current){e.next=2;break}return e.abrupt("return");case 2:B.current={imageBlob:null,takenAt:null,blurScore:null,detectedCard:null},E.current={imageBlob:null,blurScore:null,error:null,detectedCard:null,captureCount:0,captureDuration:0},t=s.enableAutoCapture,n=s.enableBlurCheck,a=s.enableIdDetection,o=x.current,i=o.idCardModel,c=o.blazefaceModel,d=o.ableToUseModel,f=b.current,g=r.current,y.current=!0,C=f.cropX,k=f.cropY,A=f.cropWidth,I=f.cropHeight,P=f.cropWidthWithoutPadding,R=f.cropHeightWithoutPadding,(N=p.current).width=A,N.height=I,L=N.getContext("2d"),O=document.createElement("canvas"),V=O.getContext("2d"),j=function(){var e=S(regeneratorRuntime.mark((function e(){var r,o,s,f,p,b,w;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(L.drawImage(g,C,k,A,I,0,0,A,I),r=performance.now(),T.current=!1,!a||!d){e.next=60;break}return o=null,e.next=7,i.predict(N,{detectThreshold:.3});case 7:if(!(s=e.sent).card){e.next=56;break}if(v.current=s.card,!E.current.imageBlob&&m.current.length>0&&(m.current=[],h.current=0),!Fg({corners:s.card.corners,width:A,height:I})){e.next=53;break}if(!jg(s.card.corners)){e.next=50;break}if(f=Og(N,s.card.corners),!((p=ga.rectAreaRatio({small:{area:f.width*f.height},big:{area:P*R}}))<.5)){e.next=21;break}o=mv.id_detector_card_too_small,e.next=48;break;case 21:if(!(p>.95)){e.next=25;break}o=mv.id_detector_error_incomplete,e.next=48;break;case 25:return O.width=f.width,O.height=f.height,V.putImageData(f,0,0),e.next=30,Ug({canvas:O});case 30:if(!e.sent){e.next=35;break}o=mv.glare_detected,e.next=48;break;case 35:if("ph"===D){e.next=39;break}return e.next=38,zg({blazefaceModel:c,predictedIdCardCanvas:O,frontSide:l});case 38:o=e.sent;case 39:if(o){e.next=48;break}if(!n){e.next=48;break}if(b=ia.calculateIdCardBlurScore({canvas:O}),!_.current){e.next=45;break}return e.next=45,F({blurScore:b,detectedCard:s.card});case 45:if(!t){e.next=48;break}return e.next=48,M({blurScore:b,detectedCard:s.card});case 48:e.next=51;break;case 50:o=mv.id_detector_validate_angle_error;case 51:e.next=54;break;case 53:o=mv.id_detector_error_incomplete;case 54:e.next=57;break;case 56:o=mv.id_detector_no_cards;case 57:return u(o),e.next=60,U();case 60:return r=Math.floor(performance.now()-r),w=180-r>0?180-r:0,e.next=64,new Promise((function(e){return setTimeout(e,w)}));case 64:y.current&&window.requestAnimationFrame(j);case 65:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(j);case 19:case"end":return e.stop()}}),e)}))),[s,w,r,u,U,l,F,M,D]);i((function(){var e=r.current;function a(){return(a=S(regeneratorRuntime.mark((function r(){var t,a,o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(b.current=ca.analyzeVideoAndWindowSizes(e,n,.05),t=b.current,a=t.cropWidth,o=t.cropHeight,e.videoWidth&&e.videoHeight&&!Number.isNaN(a)&&!Number.isNaN(o)){r.next=4;break}return r.abrupt("return");case 4:return r.next=6,K();case 6:case"end":return r.stop()}}),r)})))).apply(this,arguments)}t&&n&&w&&function(){a.apply(this,arguments)}()}),[t,n,r,L,K,w]);var H=o((function(){L()}),[L]);return i((function(){return H}),[H]),{refWorkingCanvas:p,stopCheckFrame:L,checkFrame:K,warmupDone:w,takePictureManually:z,refAbleToRunBurstMode:I,refVirtualFrames:m}}({refVideo:t,shouldStart:r,cropArea:n,settings:s,onError:V,frontSide:l,onAutoCaptureSuccess:U,quality:g}),z=j.refWorkingCanvas,K=j.stopCheckFrame,H=j.checkFrame,q=j.warmupDone,G=j.takePictureManually,W=j.refAbleToRunBurstMode,Q=j.refVirtualFrames,X=gv({refVideo:t,shouldStart:!1,cropArea:n,settings:s}),Y=X.stopCheckFrame,Z=X.splitVideos,$=X.resetRecordedVideos,J=X.checkFrame;!function(e){var r=e.debug,t=e.refRecordedVideos,n=e.refWorkingCanvas,a=e.refVideo,o=e.onChange;i((function(){var e;return r&&(e=setInterval((function(){var e=a.current,r=t.current,i=n.current,s=r[r.length-1],c={videoWidth:e.videoWidth,videoHeight:e.videoHeight,framesCount:s.frames.length,"window.innerWidth":window.innerWidth,"window.innerHeight":window.innerHeight,"canvas.width":null==i?void 0:i.width,"canvas.height":null==i?void 0:i.height};o&&o(JSON.stringify(c,null,2))}),1e3)),function(){return clearInterval(e)}}),[o,r,t,n,a])}({debug:T,refRecordedVideos:X.refRecordedVideos,refWorkingCanvas:z,refVideo:t,onChange:d});var ee=o((function(){Y(),K(),$(),p()}),[$,Y,K,p]),re=o((function(){Z()}),[Z]),te=vv({lang:P,onAboutToTimeout:f,onSessionTimeout:ee,onVideoTimeLimitReached:re,settings:s,shouldStartTimers:q&&r&&(null==s?void 0:s.enableTimers),sessionTime:null==s?void 0:s.idCardSessionTime}),ne=te.stopTimers,ae=te.startTimers,oe=o((function(){v.current=!1}),[]),ie=o(S(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return oe(),ae(),e.next=4,Promise.all([J(),H()]);case 4:case"end":return e.stop()}}),e)}))),[oe,ae,J,H]),se=o(S(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,c,u,d,f,p,g,y,b,w=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=w.length>0&&void 0!==w[0]?w[0]:{},t=r.imageBlob,n=r.error,a=r.detectedCard,o=r.captureTime,i=r.captureCount,c=r.captureDuration,u=r.captureType,!v.current){e.next=3;break}return e.abrupt("return");case 3:return v.current=!0,C(!0),Y(),K(),ne(),V(null),d=null==s?void 0:s.enableVirtualCamHashes,f={},d&&(p=Q).current.length>0&&(f=p.current.reduce((function(e,r,t){return x(x({},e),{},A({},"hash".concat(t+1),r))}),f)),L(),Rs.preWriteExif({mode:Rs.MODE.ID_CARD,motionData:M,orientationData:F,startTime:E.current,endTime:Date.now()}),e.next=16,Rs.writeExif({mode:Rs.MODE.ID_CARD,imageData:x(x({detectedCard:a,captureTime:o,blob:t},d?{vCam:f}:{}),{},{captureCount:i,captureDuration:c,captureType:u}),enableExifData:null==s?void 0:s.enableExifData});case 16:if(g=e.sent,!m||!m.key){e.next=22;break}return b=m.key,e.next=21,mi.encrypt({blob:g,key:b});case 21:y=e.sent;case 22:h({image:{blob:g,encrypted:y,detectedCard:a},error:n,recordedVideos:[]}),C(!1),k({tag:l?"id_front":"id_back",event:"user_activity",log:{time_capture_in_seconds:(performance.now()-_.current)/1e3}});case 25:case"end":return e.stop()}}),e)}))),[Y,K,ne,V,h,l,k,m,M,F,L,null==s?void 0:s.enableExifData,null==s?void 0:s.enableVirtualCamHashes,Q]);w.current=se;var ce=o(S(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return C(!0),ne(),Y(),W.current||K(),e.next=6,G();case 6:return r=e.sent,e.next=9,se(r);case 9:C(!1),k({tag:l?"id_front":"id_back",event:"user_activity.capture",log:{}});case 11:case"end":return e.stop()}}),e)}))),[G,se,ne,W,Y,K,k,l]);return i((function(){r&&(k({tag:l?"id_front":"id_back",event:"user_activity.start",log:{}}),E.current=Date.now(),N())}),[k,l,r,N]),i((function(){q&&(k({tag:l?"id_front":"id_back",event:"user_activity.show",log:{}}),k({tag:l?"id_front":"id_back",event:"sdk.load_model",log:{status:"success",time_in_ms:Date.now()-E.current}}),_.current=performance.now())}),[k,l,q]),{warmupDone:q,isProcessing:b,takePictureManually:ce,restartSession:ie,resetIsProcessingImageBlobTaken:oe}},kv=K.IDCardMessage,Bv=l((function(e,t){var n=e.description,a=e.usePortraitMask,s=e.windowAndVideoInfo,u=e.refVideo,l=e.frontSide,f=e.settings,p=e.onCaptureDone,h=e.onUISpacingChange,m=e.outputEncryptionSettings,g=O(c({}),2),v=g[0],y=g[1],b=v.yDescription,C=v.yMessage,w=v.yCaptureButton,k=Nn.useAsset("ic_camera.svg"),B=Nn.useAsset("ic_loading.png"),E=O(c(""),2),_=E[0],A=E[1],I=$t.useSDKSettings(),T=I.debug,x=I.lang,P=O(c(null),2),R=P[0],D=P[1],N=O(c(""),2),L=N[0],M=N[1],F=O(c(null),2),U=F[0],V=F[1],j=Ag(),z=j.showPopup,K=j.popupShown,H=j.popupType,q=o((function(e){M(null===e?"":Kd(e.msg[x])({side:l?wg.FRONT[x]:wg.BACK[x]}))}),[x,l]),G=o((function(){D(""),z({popupType:Ig})}),[z]),W=o((function(){D(""),p.apply(void 0,arguments)}),[p]),Q=o((function(e){var r=e.curTimeLeft;D(Kd(kv.REMAINING_TIME[x])({x:r}))}),[x]),X=wv({shouldStart:!0,refVideo:u,cropArea:U,settings:f,onModelErrorChange:q,frontSide:l,onDebugInfoChange:A,onSessionTimeout:G,onCaptureDone:W,onAboutToTimeout:Q,outputEncryptionSettings:m}),Y=X.warmupDone,Z=X.isProcessing,$=X.takePictureManually,J=X.restartSession,ee=X.resetIsProcessingImageBlobTaken,re=o((function(){z({popupType:null}),ee()}),[z,ee]),te=o(S(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return re(),e.next=3,J();case 3:case"end":return e.stop()}}),e)}))),[J,re]);i((function(){if(s){var e,r,t,n,o,i,c,u=s.videoAreaWidth,l=s.videoAreaHeight,d=s.lostX,f=s.lostY,p=s.clientHeight;a?(o=.7*(i=l-165),t=(c=(e=f+10)+45)+20,n=(r=c+i+10)+60):(o=qs.isMobile?u-6:Math.floor(.7*u),t=(c=(e=f+10)+50)+20,n=(r=c+(i=Math.floor(Math.min(o/1.5,p-2*f-80-100)))+10)+60);var m=Math.floor((u-o)/2)+d;V({x:m,y:c,width:o,height:i,surroundStyle:{opacity:.6,background:"#000"}});var g={yTitle:e,yDescription:r,yMessage:t,yCaptureButton:n};y(g),h(g)}}),[s,a,h]);var ne=o(S(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return D(""),e.next=3,$();case 3:case"end":return e.stop()}}),e)}))),[$]);return d(t,(function(){return{restartSession:te}}),[te]),r.createElement(r.Fragment,null,!Y&&r.createElement(qp,null),T&&r.createElement(Im,null,_),Z&&r.createElement(Bm,null,r.createElement("img",{src:B,alt:"",className:"spin"})),U&&r.createElement(Cu,{x:"".concat(U.x,"px"),y:"".concat(U.y,"px"),width:"".concat(U.width,"px"),height:"".concat(U.height,"px"),surroundStyle:U.surroundStyle},r.createElement(Rm,{width:U.width,height:U.height,type:L?Oh.ERROR:Oh.DEFAULT})),!L&&r.createElement(Tm,{y:"".concat(b,"px"),className:"description"},n),L&&r.createElement(xm,{y:"".concat(b,"px")},L),!Z&&(!(null!=f&&f.disableCaptureButtonIfAlert)||!L)&&r.createElement(km,{onClick:ne,y:"".concat(w,"px")},r.createElement("img",{src:k,alt:""})),R&&r.createElement(Pm,{key:R,className:"message",y:"".concat(C,"px")},R),r.createElement(zp,{open:K},H===Ig&&r.createElement(_g,{onOk:te,maxSessionTime:null==f?void 0:f.idCardSessionTime})))}));Bv.propTypes={usePortraitMask:h.bool,description:h.string,windowAndVideoInfo:h.shape({}),refVideo:h.shape({}),frontSide:h.bool,settings:h.shape({}),onCaptureDone:h.func,onUISpacingChange:h.func,outputEncryptionSettings:h.shape({})},Bv.defaultProps={usePortraitMask:!1,description:"",windowAndVideoInfo:{},refVideo:{},frontSide:!0,settings:{},onCaptureDone:function(){},onUISpacingChange:function(){},outputEncryptionSettings:null};var Ev,Sv,_v=m.div(yv||(yv=L(["\n background: ",";\n backdrop-filter: blur(12px);\n border-radius: 8px;\n top: ",";\n position: absolute;\n z-index: ",";\n color: #fff;\n padding: 10px;\n margin: 0 10px;\n max-width: 275px;\n text-align: center;\n"])),(function(e){return e.background}),(function(e){return e.y}),1020),Av=m.div(bv||(bv=L(["\n width: 0;\n height: 0;\n border-left: 20px solid transparent;\n border-right: 20px solid transparent;\n border-bottom: ",";\n position: absolute;\n left: 50%;\n top: ",";\n transform: translateX(-50%);\n"])),(function(e){return"".concat(e.arrowSize,"px solid ").concat(e.color)}),(function(e){return"".concat(e.top,"px")})),Iv=function(e){var t=e.children,n=e.y;return r.createElement(_v,{y:n,background:"#00ce78"},r.createElement(Av,{arrowSize:10,top:-10,color:"#00ce78"}),t)},Tv=m.div(Cv||(Cv=L(["\n text-align: center;\n position: absolute;\n font-size: 18px;\n border-radius: 3px;\n padding: 5px 10px;\n background: #ea3223;\n color: #fff;\n margin: auto;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),xv={QR_INSTRUCTIONS_TEXT:{en:r.createElement("span",null,"Please follow the instructions below to scan QR code:",r.createElement("br",null),r.createElement("br",null)," Move camera to the position of QR code on ID card. Align QR code to fit into camera frame to scan it"),vi:r.createElement("span",null,"Vui lòng quét mã QR theo hướng dẫn sau:",r.createElement("br",null),r.createElement("br",null)," Đưa camera vào vị trí mã QR trên CCCD. Canh vừa mã QR vào 4 góc khung hình để quét mã")},QR_INSTRUCTIONS_START_BUTTON:{en:"Scan QR code",vi:"Tiến hành quét mã QR"},QR_INSTRUCTIONS_COUNTDOWN:{en:"Start in <%= x %> s",vi:"Bắt đầu trong <%= x %> giây"},QR_INVALID_POPUP_TITLE:{en:"Invalid QR code",vi:"QR không hợp lệ"},QR_INVALID_POPUP_DESCRIPTION:{en:"Please check and make sure scanning QR code on ID card",vi:"Vui lòng kiểm tra và đảm bảo việc thực hiện quét QR trên CCCD thật"},QR_INVALID_POPUP_RETRY_BUTTON:{en:"Scan QR (on ID card)",vi:"Quét lại QR (trên CCCD)"},QR_INVALID_POPUP_SKIP_BUTTON:{en:"Skip",vi:"Bỏ qua"},QR_TOOLTIP:{en:"Fit QR code to 4 corners of camera frame and try to move camera [in or out] to scan QR code",vi:"Canh vừa mã QR vào 4 góc khung hình và thử dịch chuyển camera [xa - gần] để quét được mã QR"},REMAINING_TIME:{en:"Remaining time: <%= x %> seconds",vi:"Thời gian còn lại: <%= x %> giây"},SESSION_TIMEOUT_POPUP_DESCRIPTION:{en:r.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",r.createElement("br",null),r.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",r.createElement("strong",{className:"text-primary"},"thử dịch chuyển camera [xa - gần]")," để camera điện thoại lấy nét chuẩn hơn."),vi:r.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",r.createElement("br",null),r.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",r.createElement("strong",{className:"text-primary"},"thử dịch chuyển camera [xa - gần]")," để camera điện thoại lấy nét chuẩn hơn.")},SESSION_TIMEOUT_POPUP_RETRY_BUTTON:{en:"Retry",vi:"Thực hiện lại"},SESSION_TIMEOUT_POPUP_SKIP_BUTTON:{en:"Skip",vi:"Bỏ qua"}},Pv=function(e){var t=e.children,n=e.mt,a=e.mb,o=e.ml,i=e.mr,s=e.mx,c=e.my,u=e.pt,l=e.pb,d=e.pl,f=e.pr,p=e.px,h=e.py,m=t.props.style||{},g={};return null!==s&&(g.marginLeft=s,g.marginRight=s),null!==c&&(g.marginTop=c,g.marginBottom=c),null!==n&&(g.marginTop=n),null!==a&&(g.marginBottom=a),null!==o&&(g.marginLeft=o),null!==i&&(g.marginRight=i),null!==p&&(g.paddingLeft=p,g.paddingRight=p),null!==h&&(g.paddingTop=h,g.paddingBottom=h),null!==u&&(g.paddingTop=u),null!==l&&(g.paddingBottom=l),null!==d&&(g.paddingLeft=d),null!==f&&(g.paddingRight=f),r.cloneElement(t,{style:x(x({},m),g)})};Pv.propTypes={mt:h.string,ml:h.string,mr:h.string,mb:h.string,mx:h.string,my:h.string,pt:h.string,pl:h.string,pr:h.string,pb:h.string,px:h.string,py:h.string},Pv.defaultProps={mt:null,ml:null,mr:null,mb:null,mx:null,my:null,pt:null,pl:null,pr:null,pb:null,px:null,py:null};var Rv,Dv,Nv,Lv=m.button(Ev||(Ev=L(["\n width: 100%;\n max-width: 294px;\n height: 66px;\n background-color: ",";\n border: 0;\n outline: none;\n border-radius: 3px;\n color: #fff;\n font-weight: normal;\n cursor: pointer;\n font-size: 1rem;\n"])),(function(e){return e.theme.tsBlue})),Ov=m.a(Sv||(Sv=L(["\n color: ",";\n cursor: pointer;\n"])),(function(e){return e.theme.tsBlue})),Mv=m.div(Rv||(Rv=L(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),Fv=m.div(Dv||(Dv=L(["\n color: ",";\n font-weight: bold;\n font-size: 16px;\n"])),(function(e){return e.theme.tsSecondary})),Uv=m.div(Nv||(Nv=L(["\n color: ",";\n font-weight: normal;\n font-size: 16px;\n text-align: center;\n"])),(function(e){return e.theme.tsSecondary})),Vv=function(e){var t=e.onRetry,n=e.onSkip,a=$t.useSDKSettings().lang;return r.createElement(Mv,null,r.createElement(Pv,{mt:"25px"},r.createElement(Fv,null,xv.QR_INVALID_POPUP_TITLE[a])),r.createElement(Pv,{mt:"30px"},r.createElement(Uv,null,xv.QR_INVALID_POPUP_DESCRIPTION[a])),r.createElement(Pv,{mt:"30px"},r.createElement(Lv,{onClick:t},xv.QR_INVALID_POPUP_RETRY_BUTTON[a])),r.createElement(Pv,{my:"20px"},r.createElement(Ov,{onClick:n},xv.QR_INVALID_POPUP_SKIP_BUTTON[a])))};Vv.propTypes={onRetry:h.func,onSkip:h.func},Vv.defaultProps={onRetry:function(){},onSkip:function(){}};var jv,zv,Kv,Hv,qv,Gv,Wv,Qv=["children","ratio","padding"],Xv=m.div(jv||(jv=L(["\n width: 100%;\n padding-bottom: ","%;\n position: relative;\n"])),(function(e){return 1/e.ratio*100})),Yv=m.div(zv||(zv=L(["\n position: absolute;\n top: ",";\n left: ",";\n right: ",";\n bottom: ",";\n"])),(function(e){return e.padding}),(function(e){return e.padding}),(function(e){return e.padding}),(function(e){return e.padding})),Zv=function(e){var t=e.children,n=e.ratio,a=e.padding,o=N(e,Qv);return r.createElement(Xv,I({ratio:n},o),r.createElement(Yv,{padding:a},t))};Zv.propTypes={children:h.node,ratio:h.number,padding:h.string},Zv.defaultProps={children:null,ratio:4/3,padding:"0"};var $v=m.div(Kv||(Kv=L(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),Jv=m.div(Hv||(Hv=L(["\n background: #e7e6e6;\n width: 100%;\n"]))),ey=m.img(qv||(qv=L(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),ry=m.div(Gv||(Gv=L(["\n color: ",";\n font-weight: normal;\n font-size: 16px;\n text-align: center;\n line-height: 20px;\n"])),(function(e){return e.theme.tsSecondary})),ty=m(ry)(Wv||(Wv=L(["\n white-space: nowrap;\n"]))),ny=function(e){var t=e.onClickStart,n=e.onTimeout,o=e.timeout,s=$t.useSDKSettings().lang,u=Nn.useAsset("qr_code_banner.png"),l=a(o),d=O(c((function(){return Kd(xv.QR_INSTRUCTIONS_COUNTDOWN[s])({x:o})})),2),f=d[0],p=d[1],h=Pn.useSDKTracking().sendEvent,m=a(!1);i((function(){h({tag:"id_qr",event:"sdk_ui.guideline_show",log:{}})}),[h]),i((function(){var e=Kd(xv.QR_INSTRUCTIONS_COUNTDOWN[s]),r=setInterval((function(){l.current--,p(e({x:l.current})),l.current<=0&&(clearInterval(r),m.current||h({tag:"id_qr",event:"sdk_ui.guideline_time_out",log:{}}),n&&n())}),1e3);return function(){clearInterval(r)}}),[s,n]);return r.createElement($v,null,r.createElement(Jv,null,r.createElement(Zv,{ratio:1.6},r.createElement(ey,{src:u}))),r.createElement(Pv,{mt:"30px"},r.createElement(ry,null,xv.QR_INSTRUCTIONS_TEXT[s])),r.createElement(Pv,{mt:"30px"},r.createElement(Lv,{onClick:function(){h({tag:"id_qr",event:"user_activity.click_start",log:{}}),m.current=!0,t()}},xv.QR_INSTRUCTIONS_START_BUTTON[s])),r.createElement(Pv,{my:"20px"},r.createElement(ty,null,f)))};ny.propTypes={onClickStart:h.func,onTimeout:h.func,timeout:h.number},ny.defaultProps={onClickStart:null,onTimeout:null,timeout:10};var ay=/^\d{12}\|(\d{9})?\|.+\|\d{8}\|((Nam)|(Nữ))\|.+\|\d{8}$/g;function oy(e){var r=e.canvas,t=e.qrModel,n=window.cv,a=n.imread(r,n.IMREAD_GRAYSCALE);return t.detectAndDecode(a).get(0)}var iy=function(){var e=S(regeneratorRuntime.mark((function e(r,t){var n,a,o,i,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,cv();case 2:if(n=e.sent,a=n.qrModel,!n.noModel){e.next=7;break}return e.abrupt("return",null);case 7:return o=document.createElement("canvas"),i=o.getContext("2d"),e.next=11,new Promise((function(e){var t=URL.createObjectURL(r),n=new Image;n.onload=function(){var r=n.width,a=n.height;o.width=r/2,o.height=a/2,i.drawImage(n,r/2,0,o.width,o.height,0,0,o.width,o.height),URL.revokeObjectURL(t),e()},n.src=t}));case 11:return e.next=13,oy({canvas:o,qrModel:a});case 13:if(s=e.sent){e.next=16;break}return e.abrupt("return",null);case 16:return e.next=18,Rs.writeExif({mode:"",imageData:{blob:r,result:s,type:"qr_from_front_image"},enableExifData:!0});case 18:if(c=e.sent,!t||!t.key){e.next=24;break}return l=t.key,e.next=23,mi.encrypt({imageBlobWithExif:c,key:l});case 23:u=e.sent;case 24:return e.abrupt("return",{result:s,validateResult:{valid:!0},image:{blob:c,encrypted:u},recordedVideos:[]});case 25:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}(),sy=Ks(Hs((function(e,r){var t;"undefined"!=typeof self&&self,t=function(){return function(e){var r={};function t(n){if(r[n])return r[n].exports;var a=r[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,t),a.l=!0,a.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=3)}([function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,r){this.width=r,this.height=e.length/r,this.data=e}return e.createEmpty=function(r,t){return new e(new Uint8ClampedArray(r*t),r)},e.prototype.get=function(e,r){return!(e<0||e>=this.width||r<0||r>=this.height||!this.data[r*this.width+e])},e.prototype.set=function(e,r,t){this.data[r*this.width+e]=t?1:0},e.prototype.setRegion=function(e,r,t,n,a){for(var o=r;o<r+n;o++)for(var i=e;i<e+t;i++)this.set(i,o,!!a)},e}();r.BitMatrix=n},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(2);r.addOrSubtractGF=function(e,r){return e^r};var a=function(){function e(e,r,t){this.primitive=e,this.size=r,this.generatorBase=t,this.expTable=new Array(this.size),this.logTable=new Array(this.size);for(var a=1,o=0;o<this.size;o++)this.expTable[o]=a,(a*=2)>=this.size&&(a=(a^this.primitive)&this.size-1);for(o=0;o<this.size-1;o++)this.logTable[this.expTable[o]]=o;this.zero=new n.default(this,Uint8ClampedArray.from([0])),this.one=new n.default(this,Uint8ClampedArray.from([1]))}return e.prototype.multiply=function(e,r){return 0===e||0===r?0:this.expTable[(this.logTable[e]+this.logTable[r])%(this.size-1)]},e.prototype.inverse=function(e){if(0===e)throw new Error("Can't invert 0");return this.expTable[this.size-this.logTable[e]-1]},e.prototype.buildMonomial=function(e,r){if(e<0)throw new Error("Invalid monomial degree less than 0");if(0===r)return this.zero;var t=new Uint8ClampedArray(e+1);return t[0]=r,new n.default(this,t)},e.prototype.log=function(e){if(0===e)throw new Error("Can't take log(0)");return this.logTable[e]},e.prototype.exp=function(e){return this.expTable[e]},e}();r.default=a},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(1),a=function(){function e(e,r){if(0===r.length)throw new Error("No coefficients.");this.field=e;var t=r.length;if(t>1&&0===r[0]){for(var n=1;n<t&&0===r[n];)n++;if(n===t)this.coefficients=e.zero.coefficients;else{this.coefficients=new Uint8ClampedArray(t-n);for(var a=0;a<this.coefficients.length;a++)this.coefficients[a]=r[n+a]}}else this.coefficients=r}return e.prototype.degree=function(){return this.coefficients.length-1},e.prototype.isZero=function(){return 0===this.coefficients[0]},e.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},e.prototype.addOrSubtract=function(r){var t;if(this.isZero())return r;if(r.isZero())return this;var a=this.coefficients,o=r.coefficients;a.length>o.length&&(a=(t=[o,a])[0],o=t[1]);for(var i=new Uint8ClampedArray(o.length),s=o.length-a.length,c=0;c<s;c++)i[c]=o[c];for(c=s;c<o.length;c++)i[c]=n.addOrSubtractGF(a[c-s],o[c]);return new e(this.field,i)},e.prototype.multiply=function(r){if(0===r)return this.field.zero;if(1===r)return this;for(var t=this.coefficients.length,n=new Uint8ClampedArray(t),a=0;a<t;a++)n[a]=this.field.multiply(this.coefficients[a],r);return new e(this.field,n)},e.prototype.multiplyPoly=function(r){if(this.isZero()||r.isZero())return this.field.zero;for(var t=this.coefficients,a=t.length,o=r.coefficients,i=o.length,s=new Uint8ClampedArray(a+i-1),c=0;c<a;c++)for(var u=t[c],l=0;l<i;l++)s[c+l]=n.addOrSubtractGF(s[c+l],this.field.multiply(u,o[l]));return new e(this.field,s)},e.prototype.multiplyByMonomial=function(r,t){if(r<0)throw new Error("Invalid degree less than 0");if(0===t)return this.field.zero;for(var n=this.coefficients.length,a=new Uint8ClampedArray(n+r),o=0;o<n;o++)a[o]=this.field.multiply(this.coefficients[o],t);return new e(this.field,a)},e.prototype.evaluateAt=function(e){var r=0;if(0===e)return this.getCoefficient(0);var t=this.coefficients.length;if(1===e)return this.coefficients.forEach((function(e){r=n.addOrSubtractGF(r,e)})),r;r=this.coefficients[0];for(var a=1;a<t;a++)r=n.addOrSubtractGF(this.field.multiply(e,r),this.coefficients[a]);return r},e}();r.default=a},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(4),a=t(5),o=t(11),i=t(12);function s(e){var r=i.locate(e);if(!r)return null;for(var t=0,n=r;t<n.length;t++){var s=n[t],c=o.extract(e,s),u=a.decode(c.matrix);if(u)return{binaryData:u.bytes,data:u.text,chunks:u.chunks,version:u.version,location:{topRightCorner:c.mappingFunction(s.dimension,0),topLeftCorner:c.mappingFunction(0,0),bottomRightCorner:c.mappingFunction(s.dimension,s.dimension),bottomLeftCorner:c.mappingFunction(0,s.dimension),topRightFinderPattern:s.topRight,topLeftFinderPattern:s.topLeft,bottomLeftFinderPattern:s.bottomLeft,bottomRightAlignmentPattern:s.alignmentPattern}}}return null}var c={inversionAttempts:"attemptBoth"};function u(e,r,t,a){void 0===a&&(a={});var o=c;Object.keys(o||{}).forEach((function(e){o[e]=a[e]||o[e]}));var i="attemptBoth"===o.inversionAttempts||"invertFirst"===o.inversionAttempts,u="onlyInvert"===o.inversionAttempts||"invertFirst"===o.inversionAttempts,l=n.binarize(e,r,t,i),d=l.binarized,f=l.inverted,p=s(u?f:d);return p||"attemptBoth"!==o.inversionAttempts&&"invertFirst"!==o.inversionAttempts||(p=s(u?d:f)),p}u.default=u,r.default=u},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(0);function a(e,r,t){return e<r?r:e>t?t:e}var o=function(){function e(e,r){this.width=e,this.data=new Uint8ClampedArray(e*r)}return e.prototype.get=function(e,r){return this.data[r*this.width+e]},e.prototype.set=function(e,r,t){this.data[r*this.width+e]=t},e}();r.binarize=function(e,r,t,i){if(e.length!==r*t*4)throw new Error("Malformed data passed to binarizer.");for(var s=new o(r,t),c=0;c<r;c++)for(var u=0;u<t;u++){var l=e[4*(u*r+c)+0],d=e[4*(u*r+c)+1],f=e[4*(u*r+c)+2];s.set(c,u,.2126*l+.7152*d+.0722*f)}for(var p=Math.ceil(r/8),h=Math.ceil(t/8),m=new o(p,h),g=0;g<h;g++)for(var v=0;v<p;v++){var y=0,b=1/0,C=0;for(u=0;u<8;u++)for(c=0;c<8;c++){var w=s.get(8*v+c,8*g+u);y+=w,b=Math.min(b,w),C=Math.max(C,w)}var k=y/Math.pow(8,2);if(C-b<=24&&(k=b/2,g>0&&v>0)){var B=(m.get(v,g-1)+2*m.get(v-1,g)+m.get(v-1,g-1))/4;b<B&&(k=B)}m.set(v,g,k)}var E=n.BitMatrix.createEmpty(r,t),S=null;for(i&&(S=n.BitMatrix.createEmpty(r,t)),g=0;g<h;g++)for(v=0;v<p;v++){for(var _=a(v,2,p-3),A=a(g,2,h-3),I=(y=0,-2);I<=2;I++)for(var T=-2;T<=2;T++)y+=m.get(_+I,A+T);var x=y/25;for(I=0;I<8;I++)for(T=0;T<8;T++){c=8*v+I,u=8*g+T;var P=s.get(c,u);E.set(c,u,P<=x),i&&S.set(c,u,!(P<=x))}}return i?{binarized:E,inverted:S}:{binarized:E}}},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(0),a=t(6),o=t(9),i=t(10);function s(e,r){for(var t=e^r,n=0;t;)n++,t&=t-1;return n}function c(e,r){return r<<1|e}var u=[{bits:21522,formatInfo:{errorCorrectionLevel:1,dataMask:0}},{bits:20773,formatInfo:{errorCorrectionLevel:1,dataMask:1}},{bits:24188,formatInfo:{errorCorrectionLevel:1,dataMask:2}},{bits:23371,formatInfo:{errorCorrectionLevel:1,dataMask:3}},{bits:17913,formatInfo:{errorCorrectionLevel:1,dataMask:4}},{bits:16590,formatInfo:{errorCorrectionLevel:1,dataMask:5}},{bits:20375,formatInfo:{errorCorrectionLevel:1,dataMask:6}},{bits:19104,formatInfo:{errorCorrectionLevel:1,dataMask:7}},{bits:30660,formatInfo:{errorCorrectionLevel:0,dataMask:0}},{bits:29427,formatInfo:{errorCorrectionLevel:0,dataMask:1}},{bits:32170,formatInfo:{errorCorrectionLevel:0,dataMask:2}},{bits:30877,formatInfo:{errorCorrectionLevel:0,dataMask:3}},{bits:26159,formatInfo:{errorCorrectionLevel:0,dataMask:4}},{bits:25368,formatInfo:{errorCorrectionLevel:0,dataMask:5}},{bits:27713,formatInfo:{errorCorrectionLevel:0,dataMask:6}},{bits:26998,formatInfo:{errorCorrectionLevel:0,dataMask:7}},{bits:5769,formatInfo:{errorCorrectionLevel:3,dataMask:0}},{bits:5054,formatInfo:{errorCorrectionLevel:3,dataMask:1}},{bits:7399,formatInfo:{errorCorrectionLevel:3,dataMask:2}},{bits:6608,formatInfo:{errorCorrectionLevel:3,dataMask:3}},{bits:1890,formatInfo:{errorCorrectionLevel:3,dataMask:4}},{bits:597,formatInfo:{errorCorrectionLevel:3,dataMask:5}},{bits:3340,formatInfo:{errorCorrectionLevel:3,dataMask:6}},{bits:2107,formatInfo:{errorCorrectionLevel:3,dataMask:7}},{bits:13663,formatInfo:{errorCorrectionLevel:2,dataMask:0}},{bits:12392,formatInfo:{errorCorrectionLevel:2,dataMask:1}},{bits:16177,formatInfo:{errorCorrectionLevel:2,dataMask:2}},{bits:14854,formatInfo:{errorCorrectionLevel:2,dataMask:3}},{bits:9396,formatInfo:{errorCorrectionLevel:2,dataMask:4}},{bits:8579,formatInfo:{errorCorrectionLevel:2,dataMask:5}},{bits:11994,formatInfo:{errorCorrectionLevel:2,dataMask:6}},{bits:11245,formatInfo:{errorCorrectionLevel:2,dataMask:7}}],l=[function(e){return(e.y+e.x)%2==0},function(e){return e.y%2==0},function(e){return e.x%3==0},function(e){return(e.y+e.x)%3==0},function(e){return(Math.floor(e.y/2)+Math.floor(e.x/3))%2==0},function(e){return e.x*e.y%2+e.x*e.y%3==0},function(e){return(e.y*e.x%2+e.y*e.x%3)%2==0},function(e){return((e.y+e.x)%2+e.y*e.x%3)%2==0}];function d(e,r,t){for(var a=l[t.dataMask],o=e.height,i=function(e){var r=17+4*e.versionNumber,t=n.BitMatrix.createEmpty(r,r);t.setRegion(0,0,9,9,!0),t.setRegion(r-8,0,8,9,!0),t.setRegion(0,r-8,9,8,!0);for(var a=0,o=e.alignmentPatternCenters;a<o.length;a++)for(var i=o[a],s=0,c=e.alignmentPatternCenters;s<c.length;s++){var u=c[s];6===i&&6===u||6===i&&u===r-7||i===r-7&&6===u||t.setRegion(i-2,u-2,5,5,!0)}return t.setRegion(6,9,1,r-17,!0),t.setRegion(9,6,r-17,1,!0),e.versionNumber>6&&(t.setRegion(r-11,0,3,6,!0),t.setRegion(0,r-11,6,3,!0)),t}(r),s=[],u=0,d=0,f=!0,p=o-1;p>0;p-=2){6===p&&p--;for(var h=0;h<o;h++)for(var m=f?o-1-h:h,g=0;g<2;g++){var v=p-g;if(!i.get(v,m)){d++;var y=e.get(v,m);a({y:m,x:v})&&(y=!y),u=c(y,u),8===d&&(s.push(u),d=0,u=0)}}f=!f}return s}function f(e){var r=function(e){var r=e.height,t=Math.floor((r-17)/4);if(t<=6)return i.VERSIONS[t-1];for(var n=0,a=5;a>=0;a--)for(var o=r-9;o>=r-11;o--)n=c(e.get(o,a),n);var u=0;for(o=5;o>=0;o--)for(a=r-9;a>=r-11;a--)u=c(e.get(o,a),u);for(var l,d=1/0,f=0,p=i.VERSIONS;f<p.length;f++){var h=p[f];if(h.infoBits===n||h.infoBits===u)return h;var m=s(n,h.infoBits);m<d&&(l=h,d=m),(m=s(u,h.infoBits))<d&&(l=h,d=m)}return d<=3?l:void 0}(e);if(!r)return null;var t=function(e){for(var r=0,t=0;t<=8;t++)6!==t&&(r=c(e.get(t,8),r));for(var n=7;n>=0;n--)6!==n&&(r=c(e.get(8,n),r));var a=e.height,o=0;for(n=a-1;n>=a-7;n--)o=c(e.get(8,n),o);for(t=a-8;t<a;t++)o=c(e.get(t,8),o);for(var i=1/0,l=null,d=0,f=u;d<f.length;d++){var p=f[d],h=p.bits,m=p.formatInfo;if(h===r||h===o)return m;var g=s(r,h);g<i&&(l=m,i=g),r!==o&&(g=s(o,h))<i&&(l=m,i=g)}return i<=3?l:null}(e);if(!t)return null;var n=function(e,r,t){var n=r.errorCorrectionLevels[t],a=[],o=0;if(n.ecBlocks.forEach((function(e){for(var r=0;r<e.numBlocks;r++)a.push({numDataCodewords:e.dataCodewordsPerBlock,codewords:[]}),o+=e.dataCodewordsPerBlock+n.ecCodewordsPerBlock})),e.length<o)return null;e=e.slice(0,o);for(var i=n.ecBlocks[0].dataCodewordsPerBlock,s=0;s<i;s++)for(var c=0,u=a;c<u.length;c++)u[c].codewords.push(e.shift());if(n.ecBlocks.length>1){var l=n.ecBlocks[0].numBlocks,d=n.ecBlocks[1].numBlocks;for(s=0;s<d;s++)a[l+s].codewords.push(e.shift())}for(;e.length>0;)for(var f=0,p=a;f<p.length;f++)p[f].codewords.push(e.shift());return a}(d(e,r,t),r,t.errorCorrectionLevel);if(!n)return null;for(var l=n.reduce((function(e,r){return e+r.numDataCodewords}),0),f=new Uint8ClampedArray(l),p=0,h=0,m=n;h<m.length;h++){var g=m[h],v=o.decode(g.codewords,g.codewords.length-g.numDataCodewords);if(!v)return null;for(var y=0;y<g.numDataCodewords;y++)f[p++]=v[y]}try{return a.decode(f,r.versionNumber)}catch(e){return null}}r.decode=function(e){if(null==e)return null;var r=f(e);if(r)return r;for(var t=0;t<e.width;t++)for(var n=t+1;n<e.height;n++)e.get(t,n)!==e.get(n,t)&&(e.set(t,n,!e.get(t,n)),e.set(n,t,!e.get(n,t)));return f(e)}},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n,a,o=t(7),i=t(8);function s(e,r){for(var t=[],n="",a=[10,12,14][r],o=e.readBits(a);o>=3;){if((u=e.readBits(10))>=1e3)throw new Error("Invalid numeric value above 999");var i=Math.floor(u/100),s=Math.floor(u/10)%10,c=u%10;t.push(48+i,48+s,48+c),n+=i.toString()+s.toString()+c.toString(),o-=3}if(2===o){if((u=e.readBits(7))>=100)throw new Error("Invalid numeric value above 99");i=Math.floor(u/10),s=u%10,t.push(48+i,48+s),n+=i.toString()+s.toString()}else if(1===o){var u;if((u=e.readBits(4))>=10)throw new Error("Invalid numeric value above 9");t.push(48+u),n+=u.toString()}return{bytes:t,text:n}}!function(e){e.Numeric="numeric",e.Alphanumeric="alphanumeric",e.Byte="byte",e.Kanji="kanji",e.ECI="eci"}(n=r.Mode||(r.Mode={})),function(e){e[e.Terminator=0]="Terminator",e[e.Numeric=1]="Numeric",e[e.Alphanumeric=2]="Alphanumeric",e[e.Byte=4]="Byte",e[e.Kanji=8]="Kanji",e[e.ECI=7]="ECI"}(a||(a={}));var c=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function u(e,r){for(var t=[],n="",a=[9,11,13][r],o=e.readBits(a);o>=2;){var i=e.readBits(11),s=Math.floor(i/45),u=i%45;t.push(c[s].charCodeAt(0),c[u].charCodeAt(0)),n+=c[s]+c[u],o-=2}return 1===o&&(s=e.readBits(6),t.push(c[s].charCodeAt(0)),n+=c[s]),{bytes:t,text:n}}function l(e,r){for(var t=[],n="",a=[8,16,16][r],o=e.readBits(a),i=0;i<o;i++){var s=e.readBits(8);t.push(s)}try{n+=decodeURIComponent(t.map((function(e){return"%"+("0"+e.toString(16)).substr(-2)})).join(""))}catch(e){}return{bytes:t,text:n}}function d(e,r){for(var t=[],n="",a=[8,10,12][r],o=e.readBits(a),s=0;s<o;s++){var c=e.readBits(13),u=Math.floor(c/192)<<8|c%192;u+=u<7936?33088:49472,t.push(u>>8,255&u),n+=String.fromCharCode(i.shiftJISTable[u])}return{bytes:t,text:n}}r.decode=function(e,r){for(var t,i,c,f,p=new o.BitStream(e),h=r<=9?0:r<=26?1:2,m={text:"",bytes:[],chunks:[],version:r};p.available()>=4;){var g=p.readBits(4);if(g===a.Terminator)return m;if(g===a.ECI)0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(7)}):0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(14)}):0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(21)}):m.chunks.push({type:n.ECI,assignmentNumber:-1});else if(g===a.Numeric){var v=s(p,h);m.text+=v.text,(t=m.bytes).push.apply(t,v.bytes),m.chunks.push({type:n.Numeric,text:v.text})}else if(g===a.Alphanumeric){var y=u(p,h);m.text+=y.text,(i=m.bytes).push.apply(i,y.bytes),m.chunks.push({type:n.Alphanumeric,text:y.text})}else if(g===a.Byte){var b=l(p,h);m.text+=b.text,(c=m.bytes).push.apply(c,b.bytes),m.chunks.push({type:n.Byte,bytes:b.bytes,text:b.text})}else if(g===a.Kanji){var C=d(p,h);m.text+=C.text,(f=m.bytes).push.apply(f,C.bytes),m.chunks.push({type:n.Kanji,bytes:C.bytes,text:C.text})}}if(0===p.available()||0===p.readBits(p.available()))return m}},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e){this.byteOffset=0,this.bitOffset=0,this.bytes=e}return e.prototype.readBits=function(e){if(e<1||e>32||e>this.available())throw new Error("Cannot read "+e.toString()+" bits");var r=0;if(this.bitOffset>0){var t=8-this.bitOffset,n=e<t?e:t,a=255>>8-n<<(o=t-n);r=(this.bytes[this.byteOffset]&a)>>o,e-=n,this.bitOffset+=n,8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(e>0){for(;e>=8;)r=r<<8|255&this.bytes[this.byteOffset],this.byteOffset++,e-=8;var o;if(e>0)a=255>>(o=8-e)<<o,r=r<<e|(this.bytes[this.byteOffset]&a)>>o,this.bitOffset+=e}return r},e.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},e}();r.BitStream=n},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.shiftJISTable={32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:165,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:8254,33088:12288,33089:12289,33090:12290,33091:65292,33092:65294,33093:12539,33094:65306,33095:65307,33096:65311,33097:65281,33098:12443,33099:12444,33100:180,33101:65344,33102:168,33103:65342,33104:65507,33105:65343,33106:12541,33107:12542,33108:12445,33109:12446,33110:12291,33111:20189,33112:12293,33113:12294,33114:12295,33115:12540,33116:8213,33117:8208,33118:65295,33119:92,33120:12316,33121:8214,33122:65372,33123:8230,33124:8229,33125:8216,33126:8217,33127:8220,33128:8221,33129:65288,33130:65289,33131:12308,33132:12309,33133:65339,33134:65341,33135:65371,33136:65373,33137:12296,33138:12297,33139:12298,33140:12299,33141:12300,33142:12301,33143:12302,33144:12303,33145:12304,33146:12305,33147:65291,33148:8722,33149:177,33150:215,33152:247,33153:65309,33154:8800,33155:65308,33156:65310,33157:8806,33158:8807,33159:8734,33160:8756,33161:9794,33162:9792,33163:176,33164:8242,33165:8243,33166:8451,33167:65509,33168:65284,33169:162,33170:163,33171:65285,33172:65283,33173:65286,33174:65290,33175:65312,33176:167,33177:9734,33178:9733,33179:9675,33180:9679,33181:9678,33182:9671,33183:9670,33184:9633,33185:9632,33186:9651,33187:9650,33188:9661,33189:9660,33190:8251,33191:12306,33192:8594,33193:8592,33194:8593,33195:8595,33196:12307,33208:8712,33209:8715,33210:8838,33211:8839,33212:8834,33213:8835,33214:8746,33215:8745,33224:8743,33225:8744,33226:172,33227:8658,33228:8660,33229:8704,33230:8707,33242:8736,33243:8869,33244:8978,33245:8706,33246:8711,33247:8801,33248:8786,33249:8810,33250:8811,33251:8730,33252:8765,33253:8733,33254:8757,33255:8747,33256:8748,33264:8491,33265:8240,33266:9839,33267:9837,33268:9834,33269:8224,33270:8225,33271:182,33276:9711,33359:65296,33360:65297,33361:65298,33362:65299,33363:65300,33364:65301,33365:65302,33366:65303,33367:65304,33368:65305,33376:65313,33377:65314,33378:65315,33379:65316,33380:65317,33381:65318,33382:65319,33383:65320,33384:65321,33385:65322,33386:65323,33387:65324,33388:65325,33389:65326,33390:65327,33391:65328,33392:65329,33393:65330,33394:65331,33395:65332,33396:65333,33397:65334,33398:65335,33399:65336,33400:65337,33401:65338,33409:65345,33410:65346,33411:65347,33412:65348,33413:65349,33414:65350,33415:65351,33416:65352,33417:65353,33418:65354,33419:65355,33420:65356,33421:65357,33422:65358,33423:65359,33424:65360,33425:65361,33426:65362,33427:65363,33428:65364,33429:65365,33430:65366,33431:65367,33432:65368,33433:65369,33434:65370,33439:12353,33440:12354,33441:12355,33442:12356,33443:12357,33444:12358,33445:12359,33446:12360,33447:12361,33448:12362,33449:12363,33450:12364,33451:12365,33452:12366,33453:12367,33454:12368,33455:12369,33456:12370,33457:12371,33458:12372,33459:12373,33460:12374,33461:12375,33462:12376,33463:12377,33464:12378,33465:12379,33466:12380,33467:12381,33468:12382,33469:12383,33470:12384,33471:12385,33472:12386,33473:12387,33474:12388,33475:12389,33476:12390,33477:12391,33478:12392,33479:12393,33480:12394,33481:12395,33482:12396,33483:12397,33484:12398,33485:12399,33486:12400,33487:12401,33488:12402,33489:12403,33490:12404,33491:12405,33492:12406,33493:12407,33494:12408,33495:12409,33496:12410,33497:12411,33498:12412,33499:12413,33500:12414,33501:12415,33502:12416,33503:12417,33504:12418,33505:12419,33506:12420,33507:12421,33508:12422,33509:12423,33510:12424,33511:12425,33512:12426,33513:12427,33514:12428,33515:12429,33516:12430,33517:12431,33518:12432,33519:12433,33520:12434,33521:12435,33600:12449,33601:12450,33602:12451,33603:12452,33604:12453,33605:12454,33606:12455,33607:12456,33608:12457,33609:12458,33610:12459,33611:12460,33612:12461,33613:12462,33614:12463,33615:12464,33616:12465,33617:12466,33618:12467,33619:12468,33620:12469,33621:12470,33622:12471,33623:12472,33624:12473,33625:12474,33626:12475,33627:12476,33628:12477,33629:12478,33630:12479,33631:12480,33632:12481,33633:12482,33634:12483,33635:12484,33636:12485,33637:12486,33638:12487,33639:12488,33640:12489,33641:12490,33642:12491,33643:12492,33644:12493,33645:12494,33646:12495,33647:12496,33648:12497,33649:12498,33650:12499,33651:12500,33652:12501,33653:12502,33654:12503,33655:12504,33656:12505,33657:12506,33658:12507,33659:12508,33660:12509,33661:12510,33662:12511,33664:12512,33665:12513,33666:12514,33667:12515,33668:12516,33669:12517,33670:12518,33671:12519,33672:12520,33673:12521,33674:12522,33675:12523,33676:12524,33677:12525,33678:12526,33679:12527,33680:12528,33681:12529,33682:12530,33683:12531,33684:12532,33685:12533,33686:12534,33695:913,33696:914,33697:915,33698:916,33699:917,33700:918,33701:919,33702:920,33703:921,33704:922,33705:923,33706:924,33707:925,33708:926,33709:927,33710:928,33711:929,33712:931,33713:932,33714:933,33715:934,33716:935,33717:936,33718:937,33727:945,33728:946,33729:947,33730:948,33731:949,33732:950,33733:951,33734:952,33735:953,33736:954,33737:955,33738:956,33739:957,33740:958,33741:959,33742:960,33743:961,33744:963,33745:964,33746:965,33747:966,33748:967,33749:968,33750:969,33856:1040,33857:1041,33858:1042,33859:1043,33860:1044,33861:1045,33862:1025,33863:1046,33864:1047,33865:1048,33866:1049,33867:1050,33868:1051,33869:1052,33870:1053,33871:1054,33872:1055,33873:1056,33874:1057,33875:1058,33876:1059,33877:1060,33878:1061,33879:1062,33880:1063,33881:1064,33882:1065,33883:1066,33884:1067,33885:1068,33886:1069,33887:1070,33888:1071,33904:1072,33905:1073,33906:1074,33907:1075,33908:1076,33909:1077,33910:1105,33911:1078,33912:1079,33913:1080,33914:1081,33915:1082,33916:1083,33917:1084,33918:1085,33920:1086,33921:1087,33922:1088,33923:1089,33924:1090,33925:1091,33926:1092,33927:1093,33928:1094,33929:1095,33930:1096,33931:1097,33932:1098,33933:1099,33934:1100,33935:1101,33936:1102,33937:1103,33951:9472,33952:9474,33953:9484,33954:9488,33955:9496,33956:9492,33957:9500,33958:9516,33959:9508,33960:9524,33961:9532,33962:9473,33963:9475,33964:9487,33965:9491,33966:9499,33967:9495,33968:9507,33969:9523,33970:9515,33971:9531,33972:9547,33973:9504,33974:9519,33975:9512,33976:9527,33977:9535,33978:9501,33979:9520,33980:9509,33981:9528,33982:9538,34975:20124,34976:21782,34977:23043,34978:38463,34979:21696,34980:24859,34981:25384,34982:23030,34983:36898,34984:33909,34985:33564,34986:31312,34987:24746,34988:25569,34989:28197,34990:26093,34991:33894,34992:33446,34993:39925,34994:26771,34995:22311,34996:26017,34997:25201,34998:23451,34999:22992,35e3:34427,35001:39156,35002:32098,35003:32190,35004:39822,35005:25110,35006:31903,35007:34999,35008:23433,35009:24245,35010:25353,35011:26263,35012:26696,35013:38343,35014:38797,35015:26447,35016:20197,35017:20234,35018:20301,35019:20381,35020:20553,35021:22258,35022:22839,35023:22996,35024:23041,35025:23561,35026:24799,35027:24847,35028:24944,35029:26131,35030:26885,35031:28858,35032:30031,35033:30064,35034:31227,35035:32173,35036:32239,35037:32963,35038:33806,35039:34915,35040:35586,35041:36949,35042:36986,35043:21307,35044:20117,35045:20133,35046:22495,35047:32946,35048:37057,35049:30959,35050:19968,35051:22769,35052:28322,35053:36920,35054:31282,35055:33576,35056:33419,35057:39983,35058:20801,35059:21360,35060:21693,35061:21729,35062:22240,35063:23035,35064:24341,35065:39154,35066:28139,35067:32996,35068:34093,35136:38498,35137:38512,35138:38560,35139:38907,35140:21515,35141:21491,35142:23431,35143:28879,35144:32701,35145:36802,35146:38632,35147:21359,35148:40284,35149:31418,35150:19985,35151:30867,35152:33276,35153:28198,35154:22040,35155:21764,35156:27421,35157:34074,35158:39995,35159:23013,35160:21417,35161:28006,35162:29916,35163:38287,35164:22082,35165:20113,35166:36939,35167:38642,35168:33615,35169:39180,35170:21473,35171:21942,35172:23344,35173:24433,35174:26144,35175:26355,35176:26628,35177:27704,35178:27891,35179:27945,35180:29787,35181:30408,35182:31310,35183:38964,35184:33521,35185:34907,35186:35424,35187:37613,35188:28082,35189:30123,35190:30410,35191:39365,35192:24742,35193:35585,35194:36234,35195:38322,35196:27022,35197:21421,35198:20870,35200:22290,35201:22576,35202:22852,35203:23476,35204:24310,35205:24616,35206:25513,35207:25588,35208:27839,35209:28436,35210:28814,35211:28948,35212:29017,35213:29141,35214:29503,35215:32257,35216:33398,35217:33489,35218:34199,35219:36960,35220:37467,35221:40219,35222:22633,35223:26044,35224:27738,35225:29989,35226:20985,35227:22830,35228:22885,35229:24448,35230:24540,35231:25276,35232:26106,35233:27178,35234:27431,35235:27572,35236:29579,35237:32705,35238:35158,35239:40236,35240:40206,35241:40644,35242:23713,35243:27798,35244:33659,35245:20740,35246:23627,35247:25014,35248:33222,35249:26742,35250:29281,35251:20057,35252:20474,35253:21368,35254:24681,35255:28201,35256:31311,35257:38899,35258:19979,35259:21270,35260:20206,35261:20309,35262:20285,35263:20385,35264:20339,35265:21152,35266:21487,35267:22025,35268:22799,35269:23233,35270:23478,35271:23521,35272:31185,35273:26247,35274:26524,35275:26550,35276:27468,35277:27827,35278:28779,35279:29634,35280:31117,35281:31166,35282:31292,35283:31623,35284:33457,35285:33499,35286:33540,35287:33655,35288:33775,35289:33747,35290:34662,35291:35506,35292:22057,35293:36008,35294:36838,35295:36942,35296:38686,35297:34442,35298:20420,35299:23784,35300:25105,35301:29273,35302:30011,35303:33253,35304:33469,35305:34558,35306:36032,35307:38597,35308:39187,35309:39381,35310:20171,35311:20250,35312:35299,35313:22238,35314:22602,35315:22730,35316:24315,35317:24555,35318:24618,35319:24724,35320:24674,35321:25040,35322:25106,35323:25296,35324:25913,35392:39745,35393:26214,35394:26800,35395:28023,35396:28784,35397:30028,35398:30342,35399:32117,35400:33445,35401:34809,35402:38283,35403:38542,35404:35997,35405:20977,35406:21182,35407:22806,35408:21683,35409:23475,35410:23830,35411:24936,35412:27010,35413:28079,35414:30861,35415:33995,35416:34903,35417:35442,35418:37799,35419:39608,35420:28012,35421:39336,35422:34521,35423:22435,35424:26623,35425:34510,35426:37390,35427:21123,35428:22151,35429:21508,35430:24275,35431:25313,35432:25785,35433:26684,35434:26680,35435:27579,35436:29554,35437:30906,35438:31339,35439:35226,35440:35282,35441:36203,35442:36611,35443:37101,35444:38307,35445:38548,35446:38761,35447:23398,35448:23731,35449:27005,35450:38989,35451:38990,35452:25499,35453:31520,35454:27179,35456:27263,35457:26806,35458:39949,35459:28511,35460:21106,35461:21917,35462:24688,35463:25324,35464:27963,35465:28167,35466:28369,35467:33883,35468:35088,35469:36676,35470:19988,35471:39993,35472:21494,35473:26907,35474:27194,35475:38788,35476:26666,35477:20828,35478:31427,35479:33970,35480:37340,35481:37772,35482:22107,35483:40232,35484:26658,35485:33541,35486:33841,35487:31909,35488:21e3,35489:33477,35490:29926,35491:20094,35492:20355,35493:20896,35494:23506,35495:21002,35496:21208,35497:21223,35498:24059,35499:21914,35500:22570,35501:23014,35502:23436,35503:23448,35504:23515,35505:24178,35506:24185,35507:24739,35508:24863,35509:24931,35510:25022,35511:25563,35512:25954,35513:26577,35514:26707,35515:26874,35516:27454,35517:27475,35518:27735,35519:28450,35520:28567,35521:28485,35522:29872,35523:29976,35524:30435,35525:30475,35526:31487,35527:31649,35528:31777,35529:32233,35530:32566,35531:32752,35532:32925,35533:33382,35534:33694,35535:35251,35536:35532,35537:36011,35538:36996,35539:37969,35540:38291,35541:38289,35542:38306,35543:38501,35544:38867,35545:39208,35546:33304,35547:20024,35548:21547,35549:23736,35550:24012,35551:29609,35552:30284,35553:30524,35554:23721,35555:32747,35556:36107,35557:38593,35558:38929,35559:38996,35560:39e3,35561:20225,35562:20238,35563:21361,35564:21916,35565:22120,35566:22522,35567:22855,35568:23305,35569:23492,35570:23696,35571:24076,35572:24190,35573:24524,35574:25582,35575:26426,35576:26071,35577:26082,35578:26399,35579:26827,35580:26820,35648:27231,35649:24112,35650:27589,35651:27671,35652:27773,35653:30079,35654:31048,35655:23395,35656:31232,35657:32e3,35658:24509,35659:35215,35660:35352,35661:36020,35662:36215,35663:36556,35664:36637,35665:39138,35666:39438,35667:39740,35668:20096,35669:20605,35670:20736,35671:22931,35672:23452,35673:25135,35674:25216,35675:25836,35676:27450,35677:29344,35678:30097,35679:31047,35680:32681,35681:34811,35682:35516,35683:35696,35684:25516,35685:33738,35686:38816,35687:21513,35688:21507,35689:21931,35690:26708,35691:27224,35692:35440,35693:30759,35694:26485,35695:40653,35696:21364,35697:23458,35698:33050,35699:34384,35700:36870,35701:19992,35702:20037,35703:20167,35704:20241,35705:21450,35706:21560,35707:23470,35708:24339,35709:24613,35710:25937,35712:26429,35713:27714,35714:27762,35715:27875,35716:28792,35717:29699,35718:31350,35719:31406,35720:31496,35721:32026,35722:31998,35723:32102,35724:26087,35725:29275,35726:21435,35727:23621,35728:24040,35729:25298,35730:25312,35731:25369,35732:28192,35733:34394,35734:35377,35735:36317,35736:37624,35737:28417,35738:31142,35739:39770,35740:20136,35741:20139,35742:20140,35743:20379,35744:20384,35745:20689,35746:20807,35747:31478,35748:20849,35749:20982,35750:21332,35751:21281,35752:21375,35753:21483,35754:21932,35755:22659,35756:23777,35757:24375,35758:24394,35759:24623,35760:24656,35761:24685,35762:25375,35763:25945,35764:27211,35765:27841,35766:29378,35767:29421,35768:30703,35769:33016,35770:33029,35771:33288,35772:34126,35773:37111,35774:37857,35775:38911,35776:39255,35777:39514,35778:20208,35779:20957,35780:23597,35781:26241,35782:26989,35783:23616,35784:26354,35785:26997,35786:29577,35787:26704,35788:31873,35789:20677,35790:21220,35791:22343,35792:24062,35793:37670,35794:26020,35795:27427,35796:27453,35797:29748,35798:31105,35799:31165,35800:31563,35801:32202,35802:33465,35803:33740,35804:34943,35805:35167,35806:35641,35807:36817,35808:37329,35809:21535,35810:37504,35811:20061,35812:20534,35813:21477,35814:21306,35815:29399,35816:29590,35817:30697,35818:33510,35819:36527,35820:39366,35821:39368,35822:39378,35823:20855,35824:24858,35825:34398,35826:21936,35827:31354,35828:20598,35829:23507,35830:36935,35831:38533,35832:20018,35833:27355,35834:37351,35835:23633,35836:23624,35904:25496,35905:31391,35906:27795,35907:38772,35908:36705,35909:31402,35910:29066,35911:38536,35912:31874,35913:26647,35914:32368,35915:26705,35916:37740,35917:21234,35918:21531,35919:34219,35920:35347,35921:32676,35922:36557,35923:37089,35924:21350,35925:34952,35926:31041,35927:20418,35928:20670,35929:21009,35930:20804,35931:21843,35932:22317,35933:29674,35934:22411,35935:22865,35936:24418,35937:24452,35938:24693,35939:24950,35940:24935,35941:25001,35942:25522,35943:25658,35944:25964,35945:26223,35946:26690,35947:28179,35948:30054,35949:31293,35950:31995,35951:32076,35952:32153,35953:32331,35954:32619,35955:33550,35956:33610,35957:34509,35958:35336,35959:35427,35960:35686,35961:36605,35962:38938,35963:40335,35964:33464,35965:36814,35966:39912,35968:21127,35969:25119,35970:25731,35971:28608,35972:38553,35973:26689,35974:20625,35975:27424,35976:27770,35977:28500,35978:31348,35979:32080,35980:34880,35981:35363,35982:26376,35983:20214,35984:20537,35985:20518,35986:20581,35987:20860,35988:21048,35989:21091,35990:21927,35991:22287,35992:22533,35993:23244,35994:24314,35995:25010,35996:25080,35997:25331,35998:25458,35999:26908,36e3:27177,36001:29309,36002:29356,36003:29486,36004:30740,36005:30831,36006:32121,36007:30476,36008:32937,36009:35211,36010:35609,36011:36066,36012:36562,36013:36963,36014:37749,36015:38522,36016:38997,36017:39443,36018:40568,36019:20803,36020:21407,36021:21427,36022:24187,36023:24358,36024:28187,36025:28304,36026:29572,36027:29694,36028:32067,36029:33335,36030:35328,36031:35578,36032:38480,36033:20046,36034:20491,36035:21476,36036:21628,36037:22266,36038:22993,36039:23396,36040:24049,36041:24235,36042:24359,36043:25144,36044:25925,36045:26543,36046:28246,36047:29392,36048:31946,36049:34996,36050:32929,36051:32993,36052:33776,36053:34382,36054:35463,36055:36328,36056:37431,36057:38599,36058:39015,36059:40723,36060:20116,36061:20114,36062:20237,36063:21320,36064:21577,36065:21566,36066:23087,36067:24460,36068:24481,36069:24735,36070:26791,36071:27278,36072:29786,36073:30849,36074:35486,36075:35492,36076:35703,36077:37264,36078:20062,36079:39881,36080:20132,36081:20348,36082:20399,36083:20505,36084:20502,36085:20809,36086:20844,36087:21151,36088:21177,36089:21246,36090:21402,36091:21475,36092:21521,36160:21518,36161:21897,36162:22353,36163:22434,36164:22909,36165:23380,36166:23389,36167:23439,36168:24037,36169:24039,36170:24055,36171:24184,36172:24195,36173:24218,36174:24247,36175:24344,36176:24658,36177:24908,36178:25239,36179:25304,36180:25511,36181:25915,36182:26114,36183:26179,36184:26356,36185:26477,36186:26657,36187:26775,36188:27083,36189:27743,36190:27946,36191:28009,36192:28207,36193:28317,36194:30002,36195:30343,36196:30828,36197:31295,36198:31968,36199:32005,36200:32024,36201:32094,36202:32177,36203:32789,36204:32771,36205:32943,36206:32945,36207:33108,36208:33167,36209:33322,36210:33618,36211:34892,36212:34913,36213:35611,36214:36002,36215:36092,36216:37066,36217:37237,36218:37489,36219:30783,36220:37628,36221:38308,36222:38477,36224:38917,36225:39321,36226:39640,36227:40251,36228:21083,36229:21163,36230:21495,36231:21512,36232:22741,36233:25335,36234:28640,36235:35946,36236:36703,36237:40633,36238:20811,36239:21051,36240:21578,36241:22269,36242:31296,36243:37239,36244:40288,36245:40658,36246:29508,36247:28425,36248:33136,36249:29969,36250:24573,36251:24794,36252:39592,36253:29403,36254:36796,36255:27492,36256:38915,36257:20170,36258:22256,36259:22372,36260:22718,36261:23130,36262:24680,36263:25031,36264:26127,36265:26118,36266:26681,36267:26801,36268:28151,36269:30165,36270:32058,36271:33390,36272:39746,36273:20123,36274:20304,36275:21449,36276:21766,36277:23919,36278:24038,36279:24046,36280:26619,36281:27801,36282:29811,36283:30722,36284:35408,36285:37782,36286:35039,36287:22352,36288:24231,36289:25387,36290:20661,36291:20652,36292:20877,36293:26368,36294:21705,36295:22622,36296:22971,36297:23472,36298:24425,36299:25165,36300:25505,36301:26685,36302:27507,36303:28168,36304:28797,36305:37319,36306:29312,36307:30741,36308:30758,36309:31085,36310:25998,36311:32048,36312:33756,36313:35009,36314:36617,36315:38555,36316:21092,36317:22312,36318:26448,36319:32618,36320:36001,36321:20916,36322:22338,36323:38442,36324:22586,36325:27018,36326:32948,36327:21682,36328:23822,36329:22524,36330:30869,36331:40442,36332:20316,36333:21066,36334:21643,36335:25662,36336:26152,36337:26388,36338:26613,36339:31364,36340:31574,36341:32034,36342:37679,36343:26716,36344:39853,36345:31545,36346:21273,36347:20874,36348:21047,36416:23519,36417:25334,36418:25774,36419:25830,36420:26413,36421:27578,36422:34217,36423:38609,36424:30352,36425:39894,36426:25420,36427:37638,36428:39851,36429:30399,36430:26194,36431:19977,36432:20632,36433:21442,36434:23665,36435:24808,36436:25746,36437:25955,36438:26719,36439:29158,36440:29642,36441:29987,36442:31639,36443:32386,36444:34453,36445:35715,36446:36059,36447:37240,36448:39184,36449:26028,36450:26283,36451:27531,36452:20181,36453:20180,36454:20282,36455:20351,36456:21050,36457:21496,36458:21490,36459:21987,36460:22235,36461:22763,36462:22987,36463:22985,36464:23039,36465:23376,36466:23629,36467:24066,36468:24107,36469:24535,36470:24605,36471:25351,36472:25903,36473:23388,36474:26031,36475:26045,36476:26088,36477:26525,36478:27490,36480:27515,36481:27663,36482:29509,36483:31049,36484:31169,36485:31992,36486:32025,36487:32043,36488:32930,36489:33026,36490:33267,36491:35222,36492:35422,36493:35433,36494:35430,36495:35468,36496:35566,36497:36039,36498:36060,36499:38604,36500:39164,36501:27503,36502:20107,36503:20284,36504:20365,36505:20816,36506:23383,36507:23546,36508:24904,36509:25345,36510:26178,36511:27425,36512:28363,36513:27835,36514:29246,36515:29885,36516:30164,36517:30913,36518:31034,36519:32780,36520:32819,36521:33258,36522:33940,36523:36766,36524:27728,36525:40575,36526:24335,36527:35672,36528:40235,36529:31482,36530:36600,36531:23437,36532:38635,36533:19971,36534:21489,36535:22519,36536:22833,36537:23241,36538:23460,36539:24713,36540:28287,36541:28422,36542:30142,36543:36074,36544:23455,36545:34048,36546:31712,36547:20594,36548:26612,36549:33437,36550:23649,36551:34122,36552:32286,36553:33294,36554:20889,36555:23556,36556:25448,36557:36198,36558:26012,36559:29038,36560:31038,36561:32023,36562:32773,36563:35613,36564:36554,36565:36974,36566:34503,36567:37034,36568:20511,36569:21242,36570:23610,36571:26451,36572:28796,36573:29237,36574:37196,36575:37320,36576:37675,36577:33509,36578:23490,36579:24369,36580:24825,36581:20027,36582:21462,36583:23432,36584:25163,36585:26417,36586:27530,36587:29417,36588:29664,36589:31278,36590:33131,36591:36259,36592:37202,36593:39318,36594:20754,36595:21463,36596:21610,36597:23551,36598:25480,36599:27193,36600:32172,36601:38656,36602:22234,36603:21454,36604:21608,36672:23447,36673:23601,36674:24030,36675:20462,36676:24833,36677:25342,36678:27954,36679:31168,36680:31179,36681:32066,36682:32333,36683:32722,36684:33261,36685:33311,36686:33936,36687:34886,36688:35186,36689:35728,36690:36468,36691:36655,36692:36913,36693:37195,36694:37228,36695:38598,36696:37276,36697:20160,36698:20303,36699:20805,36700:21313,36701:24467,36702:25102,36703:26580,36704:27713,36705:28171,36706:29539,36707:32294,36708:37325,36709:37507,36710:21460,36711:22809,36712:23487,36713:28113,36714:31069,36715:32302,36716:31899,36717:22654,36718:29087,36719:20986,36720:34899,36721:36848,36722:20426,36723:23803,36724:26149,36725:30636,36726:31459,36727:33308,36728:39423,36729:20934,36730:24490,36731:26092,36732:26991,36733:27529,36734:28147,36736:28310,36737:28516,36738:30462,36739:32020,36740:24033,36741:36981,36742:37255,36743:38918,36744:20966,36745:21021,36746:25152,36747:26257,36748:26329,36749:28186,36750:24246,36751:32210,36752:32626,36753:26360,36754:34223,36755:34295,36756:35576,36757:21161,36758:21465,36759:22899,36760:24207,36761:24464,36762:24661,36763:37604,36764:38500,36765:20663,36766:20767,36767:21213,36768:21280,36769:21319,36770:21484,36771:21736,36772:21830,36773:21809,36774:22039,36775:22888,36776:22974,36777:23100,36778:23477,36779:23558,36780:23567,36781:23569,36782:23578,36783:24196,36784:24202,36785:24288,36786:24432,36787:25215,36788:25220,36789:25307,36790:25484,36791:25463,36792:26119,36793:26124,36794:26157,36795:26230,36796:26494,36797:26786,36798:27167,36799:27189,36800:27836,36801:28040,36802:28169,36803:28248,36804:28988,36805:28966,36806:29031,36807:30151,36808:30465,36809:30813,36810:30977,36811:31077,36812:31216,36813:31456,36814:31505,36815:31911,36816:32057,36817:32918,36818:33750,36819:33931,36820:34121,36821:34909,36822:35059,36823:35359,36824:35388,36825:35412,36826:35443,36827:35937,36828:36062,36829:37284,36830:37478,36831:37758,36832:37912,36833:38556,36834:38808,36835:19978,36836:19976,36837:19998,36838:20055,36839:20887,36840:21104,36841:22478,36842:22580,36843:22732,36844:23330,36845:24120,36846:24773,36847:25854,36848:26465,36849:26454,36850:27972,36851:29366,36852:30067,36853:31331,36854:33976,36855:35698,36856:37304,36857:37664,36858:22065,36859:22516,36860:39166,36928:25325,36929:26893,36930:27542,36931:29165,36932:32340,36933:32887,36934:33394,36935:35302,36936:39135,36937:34645,36938:36785,36939:23611,36940:20280,36941:20449,36942:20405,36943:21767,36944:23072,36945:23517,36946:23529,36947:24515,36948:24910,36949:25391,36950:26032,36951:26187,36952:26862,36953:27035,36954:28024,36955:28145,36956:30003,36957:30137,36958:30495,36959:31070,36960:31206,36961:32051,36962:33251,36963:33455,36964:34218,36965:35242,36966:35386,36967:36523,36968:36763,36969:36914,36970:37341,36971:38663,36972:20154,36973:20161,36974:20995,36975:22645,36976:22764,36977:23563,36978:29978,36979:23613,36980:33102,36981:35338,36982:36805,36983:38499,36984:38765,36985:31525,36986:35535,36987:38920,36988:37218,36989:22259,36990:21416,36992:36887,36993:21561,36994:22402,36995:24101,36996:25512,36997:27700,36998:28810,36999:30561,37e3:31883,37001:32736,37002:34928,37003:36930,37004:37204,37005:37648,37006:37656,37007:38543,37008:29790,37009:39620,37010:23815,37011:23913,37012:25968,37013:26530,37014:36264,37015:38619,37016:25454,37017:26441,37018:26905,37019:33733,37020:38935,37021:38592,37022:35070,37023:28548,37024:25722,37025:23544,37026:19990,37027:28716,37028:30045,37029:26159,37030:20932,37031:21046,37032:21218,37033:22995,37034:24449,37035:24615,37036:25104,37037:25919,37038:25972,37039:26143,37040:26228,37041:26866,37042:26646,37043:27491,37044:28165,37045:29298,37046:29983,37047:30427,37048:31934,37049:32854,37050:22768,37051:35069,37052:35199,37053:35488,37054:35475,37055:35531,37056:36893,37057:37266,37058:38738,37059:38745,37060:25993,37061:31246,37062:33030,37063:38587,37064:24109,37065:24796,37066:25114,37067:26021,37068:26132,37069:26512,37070:30707,37071:31309,37072:31821,37073:32318,37074:33034,37075:36012,37076:36196,37077:36321,37078:36447,37079:30889,37080:20999,37081:25305,37082:25509,37083:25666,37084:25240,37085:35373,37086:31363,37087:31680,37088:35500,37089:38634,37090:32118,37091:33292,37092:34633,37093:20185,37094:20808,37095:21315,37096:21344,37097:23459,37098:23554,37099:23574,37100:24029,37101:25126,37102:25159,37103:25776,37104:26643,37105:26676,37106:27849,37107:27973,37108:27927,37109:26579,37110:28508,37111:29006,37112:29053,37113:26059,37114:31359,37115:31661,37116:32218,37184:32330,37185:32680,37186:33146,37187:33307,37188:33337,37189:34214,37190:35438,37191:36046,37192:36341,37193:36984,37194:36983,37195:37549,37196:37521,37197:38275,37198:39854,37199:21069,37200:21892,37201:28472,37202:28982,37203:20840,37204:31109,37205:32341,37206:33203,37207:31950,37208:22092,37209:22609,37210:23720,37211:25514,37212:26366,37213:26365,37214:26970,37215:29401,37216:30095,37217:30094,37218:30990,37219:31062,37220:31199,37221:31895,37222:32032,37223:32068,37224:34311,37225:35380,37226:38459,37227:36961,37228:40736,37229:20711,37230:21109,37231:21452,37232:21474,37233:20489,37234:21930,37235:22766,37236:22863,37237:29245,37238:23435,37239:23652,37240:21277,37241:24803,37242:24819,37243:25436,37244:25475,37245:25407,37246:25531,37248:25805,37249:26089,37250:26361,37251:24035,37252:27085,37253:27133,37254:28437,37255:29157,37256:20105,37257:30185,37258:30456,37259:31379,37260:31967,37261:32207,37262:32156,37263:32865,37264:33609,37265:33624,37266:33900,37267:33980,37268:34299,37269:35013,37270:36208,37271:36865,37272:36973,37273:37783,37274:38684,37275:39442,37276:20687,37277:22679,37278:24974,37279:33235,37280:34101,37281:36104,37282:36896,37283:20419,37284:20596,37285:21063,37286:21363,37287:24687,37288:25417,37289:26463,37290:28204,37291:36275,37292:36895,37293:20439,37294:23646,37295:36042,37296:26063,37297:32154,37298:21330,37299:34966,37300:20854,37301:25539,37302:23384,37303:23403,37304:23562,37305:25613,37306:26449,37307:36956,37308:20182,37309:22810,37310:22826,37311:27760,37312:35409,37313:21822,37314:22549,37315:22949,37316:24816,37317:25171,37318:26561,37319:33333,37320:26965,37321:38464,37322:39364,37323:39464,37324:20307,37325:22534,37326:23550,37327:32784,37328:23729,37329:24111,37330:24453,37331:24608,37332:24907,37333:25140,37334:26367,37335:27888,37336:28382,37337:32974,37338:33151,37339:33492,37340:34955,37341:36024,37342:36864,37343:36910,37344:38538,37345:40667,37346:39899,37347:20195,37348:21488,37349:22823,37350:31532,37351:37261,37352:38988,37353:40441,37354:28381,37355:28711,37356:21331,37357:21828,37358:23429,37359:25176,37360:25246,37361:25299,37362:27810,37363:28655,37364:29730,37365:35351,37366:37944,37367:28609,37368:35582,37369:33592,37370:20967,37371:34552,37372:21482,37440:21481,37441:20294,37442:36948,37443:36784,37444:22890,37445:33073,37446:24061,37447:31466,37448:36799,37449:26842,37450:35895,37451:29432,37452:40008,37453:27197,37454:35504,37455:20025,37456:21336,37457:22022,37458:22374,37459:25285,37460:25506,37461:26086,37462:27470,37463:28129,37464:28251,37465:28845,37466:30701,37467:31471,37468:31658,37469:32187,37470:32829,37471:32966,37472:34507,37473:35477,37474:37723,37475:22243,37476:22727,37477:24382,37478:26029,37479:26262,37480:27264,37481:27573,37482:30007,37483:35527,37484:20516,37485:30693,37486:22320,37487:24347,37488:24677,37489:26234,37490:27744,37491:30196,37492:31258,37493:32622,37494:33268,37495:34584,37496:36933,37497:39347,37498:31689,37499:30044,37500:31481,37501:31569,37502:33988,37504:36880,37505:31209,37506:31378,37507:33590,37508:23265,37509:30528,37510:20013,37511:20210,37512:23449,37513:24544,37514:25277,37515:26172,37516:26609,37517:27880,37518:34411,37519:34935,37520:35387,37521:37198,37522:37619,37523:39376,37524:27159,37525:28710,37526:29482,37527:33511,37528:33879,37529:36015,37530:19969,37531:20806,37532:20939,37533:21899,37534:23541,37535:24086,37536:24115,37537:24193,37538:24340,37539:24373,37540:24427,37541:24500,37542:25074,37543:25361,37544:26274,37545:26397,37546:28526,37547:29266,37548:30010,37549:30522,37550:32884,37551:33081,37552:33144,37553:34678,37554:35519,37555:35548,37556:36229,37557:36339,37558:37530,37559:38263,37560:38914,37561:40165,37562:21189,37563:25431,37564:30452,37565:26389,37566:27784,37567:29645,37568:36035,37569:37806,37570:38515,37571:27941,37572:22684,37573:26894,37574:27084,37575:36861,37576:37786,37577:30171,37578:36890,37579:22618,37580:26626,37581:25524,37582:27131,37583:20291,37584:28460,37585:26584,37586:36795,37587:34086,37588:32180,37589:37716,37590:26943,37591:28528,37592:22378,37593:22775,37594:23340,37595:32044,37596:29226,37597:21514,37598:37347,37599:40372,37600:20141,37601:20302,37602:20572,37603:20597,37604:21059,37605:35998,37606:21576,37607:22564,37608:23450,37609:24093,37610:24213,37611:24237,37612:24311,37613:24351,37614:24716,37615:25269,37616:25402,37617:25552,37618:26799,37619:27712,37620:30855,37621:31118,37622:31243,37623:32224,37624:33351,37625:35330,37626:35558,37627:36420,37628:36883,37696:37048,37697:37165,37698:37336,37699:40718,37700:27877,37701:25688,37702:25826,37703:25973,37704:28404,37705:30340,37706:31515,37707:36969,37708:37841,37709:28346,37710:21746,37711:24505,37712:25764,37713:36685,37714:36845,37715:37444,37716:20856,37717:22635,37718:22825,37719:23637,37720:24215,37721:28155,37722:32399,37723:29980,37724:36028,37725:36578,37726:39003,37727:28857,37728:20253,37729:27583,37730:28593,37731:3e4,37732:38651,37733:20814,37734:21520,37735:22581,37736:22615,37737:22956,37738:23648,37739:24466,37740:26007,37741:26460,37742:28193,37743:30331,37744:33759,37745:36077,37746:36884,37747:37117,37748:37709,37749:30757,37750:30778,37751:21162,37752:24230,37753:22303,37754:22900,37755:24594,37756:20498,37757:20826,37758:20908,37760:20941,37761:20992,37762:21776,37763:22612,37764:22616,37765:22871,37766:23445,37767:23798,37768:23947,37769:24764,37770:25237,37771:25645,37772:26481,37773:26691,37774:26812,37775:26847,37776:30423,37777:28120,37778:28271,37779:28059,37780:28783,37781:29128,37782:24403,37783:30168,37784:31095,37785:31561,37786:31572,37787:31570,37788:31958,37789:32113,37790:21040,37791:33891,37792:34153,37793:34276,37794:35342,37795:35588,37796:35910,37797:36367,37798:36867,37799:36879,37800:37913,37801:38518,37802:38957,37803:39472,37804:38360,37805:20685,37806:21205,37807:21516,37808:22530,37809:23566,37810:24999,37811:25758,37812:27934,37813:30643,37814:31461,37815:33012,37816:33796,37817:36947,37818:37509,37819:23776,37820:40199,37821:21311,37822:24471,37823:24499,37824:28060,37825:29305,37826:30563,37827:31167,37828:31716,37829:27602,37830:29420,37831:35501,37832:26627,37833:27233,37834:20984,37835:31361,37836:26932,37837:23626,37838:40182,37839:33515,37840:23493,37841:37193,37842:28702,37843:22136,37844:23663,37845:24775,37846:25958,37847:27788,37848:35930,37849:36929,37850:38931,37851:21585,37852:26311,37853:37389,37854:22856,37855:37027,37856:20869,37857:20045,37858:20970,37859:34201,37860:35598,37861:28760,37862:25466,37863:37707,37864:26978,37865:39348,37866:32260,37867:30071,37868:21335,37869:26976,37870:36575,37871:38627,37872:27741,37873:20108,37874:23612,37875:24336,37876:36841,37877:21250,37878:36049,37879:32905,37880:34425,37881:24319,37882:26085,37883:20083,37884:20837,37952:22914,37953:23615,37954:38894,37955:20219,37956:22922,37957:24525,37958:35469,37959:28641,37960:31152,37961:31074,37962:23527,37963:33905,37964:29483,37965:29105,37966:24180,37967:24565,37968:25467,37969:25754,37970:29123,37971:31896,37972:20035,37973:24316,37974:20043,37975:22492,37976:22178,37977:24745,37978:28611,37979:32013,37980:33021,37981:33075,37982:33215,37983:36786,37984:35223,37985:34468,37986:24052,37987:25226,37988:25773,37989:35207,37990:26487,37991:27874,37992:27966,37993:29750,37994:30772,37995:23110,37996:32629,37997:33453,37998:39340,37999:20467,38e3:24259,38001:25309,38002:25490,38003:25943,38004:26479,38005:30403,38006:29260,38007:32972,38008:32954,38009:36649,38010:37197,38011:20493,38012:22521,38013:23186,38014:26757,38016:26995,38017:29028,38018:29437,38019:36023,38020:22770,38021:36064,38022:38506,38023:36889,38024:34687,38025:31204,38026:30695,38027:33833,38028:20271,38029:21093,38030:21338,38031:25293,38032:26575,38033:27850,38034:30333,38035:31636,38036:31893,38037:33334,38038:34180,38039:36843,38040:26333,38041:28448,38042:29190,38043:32283,38044:33707,38045:39361,38046:40614,38047:20989,38048:31665,38049:30834,38050:31672,38051:32903,38052:31560,38053:27368,38054:24161,38055:32908,38056:30033,38057:30048,38058:20843,38059:37474,38060:28300,38061:30330,38062:37271,38063:39658,38064:20240,38065:32624,38066:25244,38067:31567,38068:38309,38069:40169,38070:22138,38071:22617,38072:34532,38073:38588,38074:20276,38075:21028,38076:21322,38077:21453,38078:21467,38079:24070,38080:25644,38081:26001,38082:26495,38083:27710,38084:27726,38085:29256,38086:29359,38087:29677,38088:30036,38089:32321,38090:33324,38091:34281,38092:36009,38093:31684,38094:37318,38095:29033,38096:38930,38097:39151,38098:25405,38099:26217,38100:30058,38101:30436,38102:30928,38103:34115,38104:34542,38105:21290,38106:21329,38107:21542,38108:22915,38109:24199,38110:24444,38111:24754,38112:25161,38113:25209,38114:25259,38115:26e3,38116:27604,38117:27852,38118:30130,38119:30382,38120:30865,38121:31192,38122:32203,38123:32631,38124:32933,38125:34987,38126:35513,38127:36027,38128:36991,38129:38750,38130:39131,38131:27147,38132:31800,38133:20633,38134:23614,38135:24494,38136:26503,38137:27608,38138:29749,38139:30473,38140:32654,38208:40763,38209:26570,38210:31255,38211:21305,38212:30091,38213:39661,38214:24422,38215:33181,38216:33777,38217:32920,38218:24380,38219:24517,38220:30050,38221:31558,38222:36924,38223:26727,38224:23019,38225:23195,38226:32016,38227:30334,38228:35628,38229:20469,38230:24426,38231:27161,38232:27703,38233:28418,38234:29922,38235:31080,38236:34920,38237:35413,38238:35961,38239:24287,38240:25551,38241:30149,38242:31186,38243:33495,38244:37672,38245:37618,38246:33948,38247:34541,38248:39981,38249:21697,38250:24428,38251:25996,38252:27996,38253:28693,38254:36007,38255:36051,38256:38971,38257:25935,38258:29942,38259:19981,38260:20184,38261:22496,38262:22827,38263:23142,38264:23500,38265:20904,38266:24067,38267:24220,38268:24598,38269:25206,38270:25975,38272:26023,38273:26222,38274:28014,38275:29238,38276:31526,38277:33104,38278:33178,38279:33433,38280:35676,38281:36e3,38282:36070,38283:36212,38284:38428,38285:38468,38286:20398,38287:25771,38288:27494,38289:33310,38290:33889,38291:34154,38292:37096,38293:23553,38294:26963,38295:39080,38296:33914,38297:34135,38298:20239,38299:21103,38300:24489,38301:24133,38302:26381,38303:31119,38304:33145,38305:35079,38306:35206,38307:28149,38308:24343,38309:25173,38310:27832,38311:20175,38312:29289,38313:39826,38314:20998,38315:21563,38316:22132,38317:22707,38318:24996,38319:25198,38320:28954,38321:22894,38322:31881,38323:31966,38324:32027,38325:38640,38326:25991,38327:32862,38328:19993,38329:20341,38330:20853,38331:22592,38332:24163,38333:24179,38334:24330,38335:26564,38336:20006,38337:34109,38338:38281,38339:38491,38340:31859,38341:38913,38342:20731,38343:22721,38344:30294,38345:30887,38346:21029,38347:30629,38348:34065,38349:31622,38350:20559,38351:22793,38352:29255,38353:31687,38354:32232,38355:36794,38356:36820,38357:36941,38358:20415,38359:21193,38360:23081,38361:24321,38362:38829,38363:20445,38364:33303,38365:37610,38366:22275,38367:25429,38368:27497,38369:29995,38370:35036,38371:36628,38372:31298,38373:21215,38374:22675,38375:24917,38376:25098,38377:26286,38378:27597,38379:31807,38380:33769,38381:20515,38382:20472,38383:21253,38384:21574,38385:22577,38386:22857,38387:23453,38388:23792,38389:23791,38390:23849,38391:24214,38392:25265,38393:25447,38394:25918,38395:26041,38396:26379,38464:27861,38465:27873,38466:28921,38467:30770,38468:32299,38469:32990,38470:33459,38471:33804,38472:34028,38473:34562,38474:35090,38475:35370,38476:35914,38477:37030,38478:37586,38479:39165,38480:40179,38481:40300,38482:20047,38483:20129,38484:20621,38485:21078,38486:22346,38487:22952,38488:24125,38489:24536,38490:24537,38491:25151,38492:26292,38493:26395,38494:26576,38495:26834,38496:20882,38497:32033,38498:32938,38499:33192,38500:35584,38501:35980,38502:36031,38503:37502,38504:38450,38505:21536,38506:38956,38507:21271,38508:20693,38509:21340,38510:22696,38511:25778,38512:26420,38513:29287,38514:30566,38515:31302,38516:37350,38517:21187,38518:27809,38519:27526,38520:22528,38521:24140,38522:22868,38523:26412,38524:32763,38525:20961,38526:30406,38528:25705,38529:30952,38530:39764,38531:40635,38532:22475,38533:22969,38534:26151,38535:26522,38536:27598,38537:21737,38538:27097,38539:24149,38540:33180,38541:26517,38542:39850,38543:26622,38544:40018,38545:26717,38546:20134,38547:20451,38548:21448,38549:25273,38550:26411,38551:27819,38552:36804,38553:20397,38554:32365,38555:40639,38556:19975,38557:24930,38558:28288,38559:28459,38560:34067,38561:21619,38562:26410,38563:39749,38564:24051,38565:31637,38566:23724,38567:23494,38568:34588,38569:28234,38570:34001,38571:31252,38572:33032,38573:22937,38574:31885,38575:27665,38576:30496,38577:21209,38578:22818,38579:28961,38580:29279,38581:30683,38582:38695,38583:40289,38584:26891,38585:23167,38586:23064,38587:20901,38588:21517,38589:21629,38590:26126,38591:30431,38592:36855,38593:37528,38594:40180,38595:23018,38596:29277,38597:28357,38598:20813,38599:26825,38600:32191,38601:32236,38602:38754,38603:40634,38604:25720,38605:27169,38606:33538,38607:22916,38608:23391,38609:27611,38610:29467,38611:30450,38612:32178,38613:32791,38614:33945,38615:20786,38616:26408,38617:40665,38618:30446,38619:26466,38620:21247,38621:39173,38622:23588,38623:25147,38624:31870,38625:36016,38626:21839,38627:24758,38628:32011,38629:38272,38630:21249,38631:20063,38632:20918,38633:22812,38634:29242,38635:32822,38636:37326,38637:24357,38638:30690,38639:21380,38640:24441,38641:32004,38642:34220,38643:35379,38644:36493,38645:38742,38646:26611,38647:34222,38648:37971,38649:24841,38650:24840,38651:27833,38652:30290,38720:35565,38721:36664,38722:21807,38723:20305,38724:20778,38725:21191,38726:21451,38727:23461,38728:24189,38729:24736,38730:24962,38731:25558,38732:26377,38733:26586,38734:28263,38735:28044,38736:29494,38737:29495,38738:30001,38739:31056,38740:35029,38741:35480,38742:36938,38743:37009,38744:37109,38745:38596,38746:34701,38747:22805,38748:20104,38749:20313,38750:19982,38751:35465,38752:36671,38753:38928,38754:20653,38755:24188,38756:22934,38757:23481,38758:24248,38759:25562,38760:25594,38761:25793,38762:26332,38763:26954,38764:27096,38765:27915,38766:28342,38767:29076,38768:29992,38769:31407,38770:32650,38771:32768,38772:33865,38773:33993,38774:35201,38775:35617,38776:36362,38777:36965,38778:38525,38779:39178,38780:24958,38781:25233,38782:27442,38784:27779,38785:28020,38786:32716,38787:32764,38788:28096,38789:32645,38790:34746,38791:35064,38792:26469,38793:33713,38794:38972,38795:38647,38796:27931,38797:32097,38798:33853,38799:37226,38800:20081,38801:21365,38802:23888,38803:27396,38804:28651,38805:34253,38806:34349,38807:35239,38808:21033,38809:21519,38810:23653,38811:26446,38812:26792,38813:29702,38814:29827,38815:30178,38816:35023,38817:35041,38818:37324,38819:38626,38820:38520,38821:24459,38822:29575,38823:31435,38824:33870,38825:25504,38826:30053,38827:21129,38828:27969,38829:28316,38830:29705,38831:30041,38832:30827,38833:31890,38834:38534,38835:31452,38836:40845,38837:20406,38838:24942,38839:26053,38840:34396,38841:20102,38842:20142,38843:20698,38844:20001,38845:20940,38846:23534,38847:26009,38848:26753,38849:28092,38850:29471,38851:30274,38852:30637,38853:31260,38854:31975,38855:33391,38856:35538,38857:36988,38858:37327,38859:38517,38860:38936,38861:21147,38862:32209,38863:20523,38864:21400,38865:26519,38866:28107,38867:29136,38868:29747,38869:33256,38870:36650,38871:38563,38872:40023,38873:40607,38874:29792,38875:22593,38876:28057,38877:32047,38878:39006,38879:20196,38880:20278,38881:20363,38882:20919,38883:21169,38884:23994,38885:24604,38886:29618,38887:31036,38888:33491,38889:37428,38890:38583,38891:38646,38892:38666,38893:40599,38894:40802,38895:26278,38896:27508,38897:21015,38898:21155,38899:28872,38900:35010,38901:24265,38902:24651,38903:24976,38904:28451,38905:29001,38906:31806,38907:32244,38908:32879,38976:34030,38977:36899,38978:37676,38979:21570,38980:39791,38981:27347,38982:28809,38983:36034,38984:36335,38985:38706,38986:21172,38987:23105,38988:24266,38989:24324,38990:26391,38991:27004,38992:27028,38993:28010,38994:28431,38995:29282,38996:29436,38997:31725,38998:32769,38999:32894,39e3:34635,39001:37070,39002:20845,39003:40595,39004:31108,39005:32907,39006:37682,39007:35542,39008:20525,39009:21644,39010:35441,39011:27498,39012:36036,39013:33031,39014:24785,39015:26528,39016:40434,39017:20121,39018:20120,39019:39952,39020:35435,39021:34241,39022:34152,39023:26880,39024:28286,39025:30871,39026:33109,39071:24332,39072:19984,39073:19989,39074:20010,39075:20017,39076:20022,39077:20028,39078:20031,39079:20034,39080:20054,39081:20056,39082:20098,39083:20101,39084:35947,39085:20106,39086:33298,39087:24333,39088:20110,39089:20126,39090:20127,39091:20128,39092:20130,39093:20144,39094:20147,39095:20150,39096:20174,39097:20173,39098:20164,39099:20166,39100:20162,39101:20183,39102:20190,39103:20205,39104:20191,39105:20215,39106:20233,39107:20314,39108:20272,39109:20315,39110:20317,39111:20311,39112:20295,39113:20342,39114:20360,39115:20367,39116:20376,39117:20347,39118:20329,39119:20336,39120:20369,39121:20335,39122:20358,39123:20374,39124:20760,39125:20436,39126:20447,39127:20430,39128:20440,39129:20443,39130:20433,39131:20442,39132:20432,39133:20452,39134:20453,39135:20506,39136:20520,39137:20500,39138:20522,39139:20517,39140:20485,39141:20252,39142:20470,39143:20513,39144:20521,39145:20524,39146:20478,39147:20463,39148:20497,39149:20486,39150:20547,39151:20551,39152:26371,39153:20565,39154:20560,39155:20552,39156:20570,39157:20566,39158:20588,39159:20600,39160:20608,39161:20634,39162:20613,39163:20660,39164:20658,39232:20681,39233:20682,39234:20659,39235:20674,39236:20694,39237:20702,39238:20709,39239:20717,39240:20707,39241:20718,39242:20729,39243:20725,39244:20745,39245:20737,39246:20738,39247:20758,39248:20757,39249:20756,39250:20762,39251:20769,39252:20794,39253:20791,39254:20796,39255:20795,39256:20799,39257:20800,39258:20818,39259:20812,39260:20820,39261:20834,39262:31480,39263:20841,39264:20842,39265:20846,39266:20864,39267:20866,39268:22232,39269:20876,39270:20873,39271:20879,39272:20881,39273:20883,39274:20885,39275:20886,39276:20900,39277:20902,39278:20898,39279:20905,39280:20906,39281:20907,39282:20915,39283:20913,39284:20914,39285:20912,39286:20917,39287:20925,39288:20933,39289:20937,39290:20955,39291:20960,39292:34389,39293:20969,39294:20973,39296:20976,39297:20981,39298:20990,39299:20996,39300:21003,39301:21012,39302:21006,39303:21031,39304:21034,39305:21038,39306:21043,39307:21049,39308:21071,39309:21060,39310:21067,39311:21068,39312:21086,39313:21076,39314:21098,39315:21108,39316:21097,39317:21107,39318:21119,39319:21117,39320:21133,39321:21140,39322:21138,39323:21105,39324:21128,39325:21137,39326:36776,39327:36775,39328:21164,39329:21165,39330:21180,39331:21173,39332:21185,39333:21197,39334:21207,39335:21214,39336:21219,39337:21222,39338:39149,39339:21216,39340:21235,39341:21237,39342:21240,39343:21241,39344:21254,39345:21256,39346:30008,39347:21261,39348:21264,39349:21263,39350:21269,39351:21274,39352:21283,39353:21295,39354:21297,39355:21299,39356:21304,39357:21312,39358:21318,39359:21317,39360:19991,39361:21321,39362:21325,39363:20950,39364:21342,39365:21353,39366:21358,39367:22808,39368:21371,39369:21367,39370:21378,39371:21398,39372:21408,39373:21414,39374:21413,39375:21422,39376:21424,39377:21430,39378:21443,39379:31762,39380:38617,39381:21471,39382:26364,39383:29166,39384:21486,39385:21480,39386:21485,39387:21498,39388:21505,39389:21565,39390:21568,39391:21548,39392:21549,39393:21564,39394:21550,39395:21558,39396:21545,39397:21533,39398:21582,39399:21647,39400:21621,39401:21646,39402:21599,39403:21617,39404:21623,39405:21616,39406:21650,39407:21627,39408:21632,39409:21622,39410:21636,39411:21648,39412:21638,39413:21703,39414:21666,39415:21688,39416:21669,39417:21676,39418:21700,39419:21704,39420:21672,39488:21675,39489:21698,39490:21668,39491:21694,39492:21692,39493:21720,39494:21733,39495:21734,39496:21775,39497:21780,39498:21757,39499:21742,39500:21741,39501:21754,39502:21730,39503:21817,39504:21824,39505:21859,39506:21836,39507:21806,39508:21852,39509:21829,39510:21846,39511:21847,39512:21816,39513:21811,39514:21853,39515:21913,39516:21888,39517:21679,39518:21898,39519:21919,39520:21883,39521:21886,39522:21912,39523:21918,39524:21934,39525:21884,39526:21891,39527:21929,39528:21895,39529:21928,39530:21978,39531:21957,39532:21983,39533:21956,39534:21980,39535:21988,39536:21972,39537:22036,39538:22007,39539:22038,39540:22014,39541:22013,39542:22043,39543:22009,39544:22094,39545:22096,39546:29151,39547:22068,39548:22070,39549:22066,39550:22072,39552:22123,39553:22116,39554:22063,39555:22124,39556:22122,39557:22150,39558:22144,39559:22154,39560:22176,39561:22164,39562:22159,39563:22181,39564:22190,39565:22198,39566:22196,39567:22210,39568:22204,39569:22209,39570:22211,39571:22208,39572:22216,39573:22222,39574:22225,39575:22227,39576:22231,39577:22254,39578:22265,39579:22272,39580:22271,39581:22276,39582:22281,39583:22280,39584:22283,39585:22285,39586:22291,39587:22296,39588:22294,39589:21959,39590:22300,39591:22310,39592:22327,39593:22328,39594:22350,39595:22331,39596:22336,39597:22351,39598:22377,39599:22464,39600:22408,39601:22369,39602:22399,39603:22409,39604:22419,39605:22432,39606:22451,39607:22436,39608:22442,39609:22448,39610:22467,39611:22470,39612:22484,39613:22482,39614:22483,39615:22538,39616:22486,39617:22499,39618:22539,39619:22553,39620:22557,39621:22642,39622:22561,39623:22626,39624:22603,39625:22640,39626:27584,39627:22610,39628:22589,39629:22649,39630:22661,39631:22713,39632:22687,39633:22699,39634:22714,39635:22750,39636:22715,39637:22712,39638:22702,39639:22725,39640:22739,39641:22737,39642:22743,39643:22745,39644:22744,39645:22757,39646:22748,39647:22756,39648:22751,39649:22767,39650:22778,39651:22777,39652:22779,39653:22780,39654:22781,39655:22786,39656:22794,39657:22800,39658:22811,39659:26790,39660:22821,39661:22828,39662:22829,39663:22834,39664:22840,39665:22846,39666:31442,39667:22869,39668:22864,39669:22862,39670:22874,39671:22872,39672:22882,39673:22880,39674:22887,39675:22892,39676:22889,39744:22904,39745:22913,39746:22941,39747:20318,39748:20395,39749:22947,39750:22962,39751:22982,39752:23016,39753:23004,39754:22925,39755:23001,39756:23002,39757:23077,39758:23071,39759:23057,39760:23068,39761:23049,39762:23066,39763:23104,39764:23148,39765:23113,39766:23093,39767:23094,39768:23138,39769:23146,39770:23194,39771:23228,39772:23230,39773:23243,39774:23234,39775:23229,39776:23267,39777:23255,39778:23270,39779:23273,39780:23254,39781:23290,39782:23291,39783:23308,39784:23307,39785:23318,39786:23346,39787:23248,39788:23338,39789:23350,39790:23358,39791:23363,39792:23365,39793:23360,39794:23377,39795:23381,39796:23386,39797:23387,39798:23397,39799:23401,39800:23408,39801:23411,39802:23413,39803:23416,39804:25992,39805:23418,39806:23424,39808:23427,39809:23462,39810:23480,39811:23491,39812:23495,39813:23497,39814:23508,39815:23504,39816:23524,39817:23526,39818:23522,39819:23518,39820:23525,39821:23531,39822:23536,39823:23542,39824:23539,39825:23557,39826:23559,39827:23560,39828:23565,39829:23571,39830:23584,39831:23586,39832:23592,39833:23608,39834:23609,39835:23617,39836:23622,39837:23630,39838:23635,39839:23632,39840:23631,39841:23409,39842:23660,39843:23662,39844:20066,39845:23670,39846:23673,39847:23692,39848:23697,39849:23700,39850:22939,39851:23723,39852:23739,39853:23734,39854:23740,39855:23735,39856:23749,39857:23742,39858:23751,39859:23769,39860:23785,39861:23805,39862:23802,39863:23789,39864:23948,39865:23786,39866:23819,39867:23829,39868:23831,39869:23900,39870:23839,39871:23835,39872:23825,39873:23828,39874:23842,39875:23834,39876:23833,39877:23832,39878:23884,39879:23890,39880:23886,39881:23883,39882:23916,39883:23923,39884:23926,39885:23943,39886:23940,39887:23938,39888:23970,39889:23965,39890:23980,39891:23982,39892:23997,39893:23952,39894:23991,39895:23996,39896:24009,39897:24013,39898:24019,39899:24018,39900:24022,39901:24027,39902:24043,39903:24050,39904:24053,39905:24075,39906:24090,39907:24089,39908:24081,39909:24091,39910:24118,39911:24119,39912:24132,39913:24131,39914:24128,39915:24142,39916:24151,39917:24148,39918:24159,39919:24162,39920:24164,39921:24135,39922:24181,39923:24182,39924:24186,39925:40636,39926:24191,39927:24224,39928:24257,39929:24258,39930:24264,39931:24272,39932:24271,4e4:24278,40001:24291,40002:24285,40003:24282,40004:24283,40005:24290,40006:24289,40007:24296,40008:24297,40009:24300,40010:24305,40011:24307,40012:24304,40013:24308,40014:24312,40015:24318,40016:24323,40017:24329,40018:24413,40019:24412,40020:24331,40021:24337,40022:24342,40023:24361,40024:24365,40025:24376,40026:24385,40027:24392,40028:24396,40029:24398,40030:24367,40031:24401,40032:24406,40033:24407,40034:24409,40035:24417,40036:24429,40037:24435,40038:24439,40039:24451,40040:24450,40041:24447,40042:24458,40043:24456,40044:24465,40045:24455,40046:24478,40047:24473,40048:24472,40049:24480,40050:24488,40051:24493,40052:24508,40053:24534,40054:24571,40055:24548,40056:24568,40057:24561,40058:24541,40059:24755,40060:24575,40061:24609,40062:24672,40064:24601,40065:24592,40066:24617,40067:24590,40068:24625,40069:24603,40070:24597,40071:24619,40072:24614,40073:24591,40074:24634,40075:24666,40076:24641,40077:24682,40078:24695,40079:24671,40080:24650,40081:24646,40082:24653,40083:24675,40084:24643,40085:24676,40086:24642,40087:24684,40088:24683,40089:24665,40090:24705,40091:24717,40092:24807,40093:24707,40094:24730,40095:24708,40096:24731,40097:24726,40098:24727,40099:24722,40100:24743,40101:24715,40102:24801,40103:24760,40104:24800,40105:24787,40106:24756,40107:24560,40108:24765,40109:24774,40110:24757,40111:24792,40112:24909,40113:24853,40114:24838,40115:24822,40116:24823,40117:24832,40118:24820,40119:24826,40120:24835,40121:24865,40122:24827,40123:24817,40124:24845,40125:24846,40126:24903,40127:24894,40128:24872,40129:24871,40130:24906,40131:24895,40132:24892,40133:24876,40134:24884,40135:24893,40136:24898,40137:24900,40138:24947,40139:24951,40140:24920,40141:24921,40142:24922,40143:24939,40144:24948,40145:24943,40146:24933,40147:24945,40148:24927,40149:24925,40150:24915,40151:24949,40152:24985,40153:24982,40154:24967,40155:25004,40156:24980,40157:24986,40158:24970,40159:24977,40160:25003,40161:25006,40162:25036,40163:25034,40164:25033,40165:25079,40166:25032,40167:25027,40168:25030,40169:25018,40170:25035,40171:32633,40172:25037,40173:25062,40174:25059,40175:25078,40176:25082,40177:25076,40178:25087,40179:25085,40180:25084,40181:25086,40182:25088,40183:25096,40184:25097,40185:25101,40186:25100,40187:25108,40188:25115,40256:25118,40257:25121,40258:25130,40259:25134,40260:25136,40261:25138,40262:25139,40263:25153,40264:25166,40265:25182,40266:25187,40267:25179,40268:25184,40269:25192,40270:25212,40271:25218,40272:25225,40273:25214,40274:25234,40275:25235,40276:25238,40277:25300,40278:25219,40279:25236,40280:25303,40281:25297,40282:25275,40283:25295,40284:25343,40285:25286,40286:25812,40287:25288,40288:25308,40289:25292,40290:25290,40291:25282,40292:25287,40293:25243,40294:25289,40295:25356,40296:25326,40297:25329,40298:25383,40299:25346,40300:25352,40301:25327,40302:25333,40303:25424,40304:25406,40305:25421,40306:25628,40307:25423,40308:25494,40309:25486,40310:25472,40311:25515,40312:25462,40313:25507,40314:25487,40315:25481,40316:25503,40317:25525,40318:25451,40320:25449,40321:25534,40322:25577,40323:25536,40324:25542,40325:25571,40326:25545,40327:25554,40328:25590,40329:25540,40330:25622,40331:25652,40332:25606,40333:25619,40334:25638,40335:25654,40336:25885,40337:25623,40338:25640,40339:25615,40340:25703,40341:25711,40342:25718,40343:25678,40344:25898,40345:25749,40346:25747,40347:25765,40348:25769,40349:25736,40350:25788,40351:25818,40352:25810,40353:25797,40354:25799,40355:25787,40356:25816,40357:25794,40358:25841,40359:25831,40360:33289,40361:25824,40362:25825,40363:25260,40364:25827,40365:25839,40366:25900,40367:25846,40368:25844,40369:25842,40370:25850,40371:25856,40372:25853,40373:25880,40374:25884,40375:25861,40376:25892,40377:25891,40378:25899,40379:25908,40380:25909,40381:25911,40382:25910,40383:25912,40384:30027,40385:25928,40386:25942,40387:25941,40388:25933,40389:25944,40390:25950,40391:25949,40392:25970,40393:25976,40394:25986,40395:25987,40396:35722,40397:26011,40398:26015,40399:26027,40400:26039,40401:26051,40402:26054,40403:26049,40404:26052,40405:26060,40406:26066,40407:26075,40408:26073,40409:26080,40410:26081,40411:26097,40412:26482,40413:26122,40414:26115,40415:26107,40416:26483,40417:26165,40418:26166,40419:26164,40420:26140,40421:26191,40422:26180,40423:26185,40424:26177,40425:26206,40426:26205,40427:26212,40428:26215,40429:26216,40430:26207,40431:26210,40432:26224,40433:26243,40434:26248,40435:26254,40436:26249,40437:26244,40438:26264,40439:26269,40440:26305,40441:26297,40442:26313,40443:26302,40444:26300,40512:26308,40513:26296,40514:26326,40515:26330,40516:26336,40517:26175,40518:26342,40519:26345,40520:26352,40521:26357,40522:26359,40523:26383,40524:26390,40525:26398,40526:26406,40527:26407,40528:38712,40529:26414,40530:26431,40531:26422,40532:26433,40533:26424,40534:26423,40535:26438,40536:26462,40537:26464,40538:26457,40539:26467,40540:26468,40541:26505,40542:26480,40543:26537,40544:26492,40545:26474,40546:26508,40547:26507,40548:26534,40549:26529,40550:26501,40551:26551,40552:26607,40553:26548,40554:26604,40555:26547,40556:26601,40557:26552,40558:26596,40559:26590,40560:26589,40561:26594,40562:26606,40563:26553,40564:26574,40565:26566,40566:26599,40567:27292,40568:26654,40569:26694,40570:26665,40571:26688,40572:26701,40573:26674,40574:26702,40576:26803,40577:26667,40578:26713,40579:26723,40580:26743,40581:26751,40582:26783,40583:26767,40584:26797,40585:26772,40586:26781,40587:26779,40588:26755,40589:27310,40590:26809,40591:26740,40592:26805,40593:26784,40594:26810,40595:26895,40596:26765,40597:26750,40598:26881,40599:26826,40600:26888,40601:26840,40602:26914,40603:26918,40604:26849,40605:26892,40606:26829,40607:26836,40608:26855,40609:26837,40610:26934,40611:26898,40612:26884,40613:26839,40614:26851,40615:26917,40616:26873,40617:26848,40618:26863,40619:26920,40620:26922,40621:26906,40622:26915,40623:26913,40624:26822,40625:27001,40626:26999,40627:26972,40628:27e3,40629:26987,40630:26964,40631:27006,40632:26990,40633:26937,40634:26996,40635:26941,40636:26969,40637:26928,40638:26977,40639:26974,40640:26973,40641:27009,40642:26986,40643:27058,40644:27054,40645:27088,40646:27071,40647:27073,40648:27091,40649:27070,40650:27086,40651:23528,40652:27082,40653:27101,40654:27067,40655:27075,40656:27047,40657:27182,40658:27025,40659:27040,40660:27036,40661:27029,40662:27060,40663:27102,40664:27112,40665:27138,40666:27163,40667:27135,40668:27402,40669:27129,40670:27122,40671:27111,40672:27141,40673:27057,40674:27166,40675:27117,40676:27156,40677:27115,40678:27146,40679:27154,40680:27329,40681:27171,40682:27155,40683:27204,40684:27148,40685:27250,40686:27190,40687:27256,40688:27207,40689:27234,40690:27225,40691:27238,40692:27208,40693:27192,40694:27170,40695:27280,40696:27277,40697:27296,40698:27268,40699:27298,40700:27299,40768:27287,40769:34327,40770:27323,40771:27331,40772:27330,40773:27320,40774:27315,40775:27308,40776:27358,40777:27345,40778:27359,40779:27306,40780:27354,40781:27370,40782:27387,40783:27397,40784:34326,40785:27386,40786:27410,40787:27414,40788:39729,40789:27423,40790:27448,40791:27447,40792:30428,40793:27449,40794:39150,40795:27463,40796:27459,40797:27465,40798:27472,40799:27481,40800:27476,40801:27483,40802:27487,40803:27489,40804:27512,40805:27513,40806:27519,40807:27520,40808:27524,40809:27523,40810:27533,40811:27544,40812:27541,40813:27550,40814:27556,40815:27562,40816:27563,40817:27567,40818:27570,40819:27569,40820:27571,40821:27575,40822:27580,40823:27590,40824:27595,40825:27603,40826:27615,40827:27628,40828:27627,40829:27635,40830:27631,40832:40638,40833:27656,40834:27667,40835:27668,40836:27675,40837:27684,40838:27683,40839:27742,40840:27733,40841:27746,40842:27754,40843:27778,40844:27789,40845:27802,40846:27777,40847:27803,40848:27774,40849:27752,40850:27763,40851:27794,40852:27792,40853:27844,40854:27889,40855:27859,40856:27837,40857:27863,40858:27845,40859:27869,40860:27822,40861:27825,40862:27838,40863:27834,40864:27867,40865:27887,40866:27865,40867:27882,40868:27935,40869:34893,40870:27958,40871:27947,40872:27965,40873:27960,40874:27929,40875:27957,40876:27955,40877:27922,40878:27916,40879:28003,40880:28051,40881:28004,40882:27994,40883:28025,40884:27993,40885:28046,40886:28053,40887:28644,40888:28037,40889:28153,40890:28181,40891:28170,40892:28085,40893:28103,40894:28134,40895:28088,40896:28102,40897:28140,40898:28126,40899:28108,40900:28136,40901:28114,40902:28101,40903:28154,40904:28121,40905:28132,40906:28117,40907:28138,40908:28142,40909:28205,40910:28270,40911:28206,40912:28185,40913:28274,40914:28255,40915:28222,40916:28195,40917:28267,40918:28203,40919:28278,40920:28237,40921:28191,40922:28227,40923:28218,40924:28238,40925:28196,40926:28415,40927:28189,40928:28216,40929:28290,40930:28330,40931:28312,40932:28361,40933:28343,40934:28371,40935:28349,40936:28335,40937:28356,40938:28338,40939:28372,40940:28373,40941:28303,40942:28325,40943:28354,40944:28319,40945:28481,40946:28433,40947:28748,40948:28396,40949:28408,40950:28414,40951:28479,40952:28402,40953:28465,40954:28399,40955:28466,40956:28364,161:65377,162:65378,163:65379,164:65380,165:65381,166:65382,167:65383,168:65384,169:65385,170:65386,171:65387,172:65388,173:65389,174:65390,175:65391,176:65392,177:65393,178:65394,179:65395,180:65396,181:65397,182:65398,183:65399,184:65400,185:65401,186:65402,187:65403,188:65404,189:65405,190:65406,191:65407,192:65408,193:65409,194:65410,195:65411,196:65412,197:65413,198:65414,199:65415,200:65416,201:65417,202:65418,203:65419,204:65420,205:65421,206:65422,207:65423,208:65424,209:65425,210:65426,211:65427,212:65428,213:65429,214:65430,215:65431,216:65432,217:65433,218:65434,219:65435,220:65436,221:65437,222:65438,223:65439,57408:28478,57409:28435,57410:28407,57411:28550,57412:28538,57413:28536,57414:28545,57415:28544,57416:28527,57417:28507,57418:28659,57419:28525,57420:28546,57421:28540,57422:28504,57423:28558,57424:28561,57425:28610,57426:28518,57427:28595,57428:28579,57429:28577,57430:28580,57431:28601,57432:28614,57433:28586,57434:28639,57435:28629,57436:28652,57437:28628,57438:28632,57439:28657,57440:28654,57441:28635,57442:28681,57443:28683,57444:28666,57445:28689,57446:28673,57447:28687,57448:28670,57449:28699,57450:28698,57451:28532,57452:28701,57453:28696,57454:28703,57455:28720,57456:28734,57457:28722,57458:28753,57459:28771,57460:28825,57461:28818,57462:28847,57463:28913,57464:28844,57465:28856,57466:28851,57467:28846,57468:28895,57469:28875,57470:28893,57472:28889,57473:28937,57474:28925,57475:28956,57476:28953,57477:29029,57478:29013,57479:29064,57480:29030,57481:29026,57482:29004,57483:29014,57484:29036,57485:29071,57486:29179,57487:29060,57488:29077,57489:29096,57490:29100,57491:29143,57492:29113,57493:29118,57494:29138,57495:29129,57496:29140,57497:29134,57498:29152,57499:29164,57500:29159,57501:29173,57502:29180,57503:29177,57504:29183,57505:29197,57506:29200,57507:29211,57508:29224,57509:29229,57510:29228,57511:29232,57512:29234,57513:29243,57514:29244,57515:29247,57516:29248,57517:29254,57518:29259,57519:29272,57520:29300,57521:29310,57522:29314,57523:29313,57524:29319,57525:29330,57526:29334,57527:29346,57528:29351,57529:29369,57530:29362,57531:29379,57532:29382,57533:29380,57534:29390,57535:29394,57536:29410,57537:29408,57538:29409,57539:29433,57540:29431,57541:20495,57542:29463,57543:29450,57544:29468,57545:29462,57546:29469,57547:29492,57548:29487,57549:29481,57550:29477,57551:29502,57552:29518,57553:29519,57554:40664,57555:29527,57556:29546,57557:29544,57558:29552,57559:29560,57560:29557,57561:29563,57562:29562,57563:29640,57564:29619,57565:29646,57566:29627,57567:29632,57568:29669,57569:29678,57570:29662,57571:29858,57572:29701,57573:29807,57574:29733,57575:29688,57576:29746,57577:29754,57578:29781,57579:29759,57580:29791,57581:29785,57582:29761,57583:29788,57584:29801,57585:29808,57586:29795,57587:29802,57588:29814,57589:29822,57590:29835,57591:29854,57592:29863,57593:29898,57594:29903,57595:29908,57596:29681,57664:29920,57665:29923,57666:29927,57667:29929,57668:29934,57669:29938,57670:29936,57671:29937,57672:29944,57673:29943,57674:29956,57675:29955,57676:29957,57677:29964,57678:29966,57679:29965,57680:29973,57681:29971,57682:29982,57683:29990,57684:29996,57685:30012,57686:30020,57687:30029,57688:30026,57689:30025,57690:30043,57691:30022,57692:30042,57693:30057,57694:30052,57695:30055,57696:30059,57697:30061,57698:30072,57699:30070,57700:30086,57701:30087,57702:30068,57703:30090,57704:30089,57705:30082,57706:30100,57707:30106,57708:30109,57709:30117,57710:30115,57711:30146,57712:30131,57713:30147,57714:30133,57715:30141,57716:30136,57717:30140,57718:30129,57719:30157,57720:30154,57721:30162,57722:30169,57723:30179,57724:30174,57725:30206,57726:30207,57728:30204,57729:30209,57730:30192,57731:30202,57732:30194,57733:30195,57734:30219,57735:30221,57736:30217,57737:30239,57738:30247,57739:30240,57740:30241,57741:30242,57742:30244,57743:30260,57744:30256,57745:30267,57746:30279,57747:30280,57748:30278,57749:30300,57750:30296,57751:30305,57752:30306,57753:30312,57754:30313,57755:30314,57756:30311,57757:30316,57758:30320,57759:30322,57760:30326,57761:30328,57762:30332,57763:30336,57764:30339,57765:30344,57766:30347,57767:30350,57768:30358,57769:30355,57770:30361,57771:30362,57772:30384,57773:30388,57774:30392,57775:30393,57776:30394,57777:30402,57778:30413,57779:30422,57780:30418,57781:30430,57782:30433,57783:30437,57784:30439,57785:30442,57786:34351,57787:30459,57788:30472,57789:30471,57790:30468,57791:30505,57792:30500,57793:30494,57794:30501,57795:30502,57796:30491,57797:30519,57798:30520,57799:30535,57800:30554,57801:30568,57802:30571,57803:30555,57804:30565,57805:30591,57806:30590,57807:30585,57808:30606,57809:30603,57810:30609,57811:30624,57812:30622,57813:30640,57814:30646,57815:30649,57816:30655,57817:30652,57818:30653,57819:30651,57820:30663,57821:30669,57822:30679,57823:30682,57824:30684,57825:30691,57826:30702,57827:30716,57828:30732,57829:30738,57830:31014,57831:30752,57832:31018,57833:30789,57834:30862,57835:30836,57836:30854,57837:30844,57838:30874,57839:30860,57840:30883,57841:30901,57842:30890,57843:30895,57844:30929,57845:30918,57846:30923,57847:30932,57848:30910,57849:30908,57850:30917,57851:30922,57852:30956,57920:30951,57921:30938,57922:30973,57923:30964,57924:30983,57925:30994,57926:30993,57927:31001,57928:31020,57929:31019,57930:31040,57931:31072,57932:31063,57933:31071,57934:31066,57935:31061,57936:31059,57937:31098,57938:31103,57939:31114,57940:31133,57941:31143,57942:40779,57943:31146,57944:31150,57945:31155,57946:31161,57947:31162,57948:31177,57949:31189,57950:31207,57951:31212,57952:31201,57953:31203,57954:31240,57955:31245,57956:31256,57957:31257,57958:31264,57959:31263,57960:31104,57961:31281,57962:31291,57963:31294,57964:31287,57965:31299,57966:31319,57967:31305,57968:31329,57969:31330,57970:31337,57971:40861,57972:31344,57973:31353,57974:31357,57975:31368,57976:31383,57977:31381,57978:31384,57979:31382,57980:31401,57981:31432,57982:31408,57984:31414,57985:31429,57986:31428,57987:31423,57988:36995,57989:31431,57990:31434,57991:31437,57992:31439,57993:31445,57994:31443,57995:31449,57996:31450,57997:31453,57998:31457,57999:31458,58e3:31462,58001:31469,58002:31472,58003:31490,58004:31503,58005:31498,58006:31494,58007:31539,58008:31512,58009:31513,58010:31518,58011:31541,58012:31528,58013:31542,58014:31568,58015:31610,58016:31492,58017:31565,58018:31499,58019:31564,58020:31557,58021:31605,58022:31589,58023:31604,58024:31591,58025:31600,58026:31601,58027:31596,58028:31598,58029:31645,58030:31640,58031:31647,58032:31629,58033:31644,58034:31642,58035:31627,58036:31634,58037:31631,58038:31581,58039:31641,58040:31691,58041:31681,58042:31692,58043:31695,58044:31668,58045:31686,58046:31709,58047:31721,58048:31761,58049:31764,58050:31718,58051:31717,58052:31840,58053:31744,58054:31751,58055:31763,58056:31731,58057:31735,58058:31767,58059:31757,58060:31734,58061:31779,58062:31783,58063:31786,58064:31775,58065:31799,58066:31787,58067:31805,58068:31820,58069:31811,58070:31828,58071:31823,58072:31808,58073:31824,58074:31832,58075:31839,58076:31844,58077:31830,58078:31845,58079:31852,58080:31861,58081:31875,58082:31888,58083:31908,58084:31917,58085:31906,58086:31915,58087:31905,58088:31912,58089:31923,58090:31922,58091:31921,58092:31918,58093:31929,58094:31933,58095:31936,58096:31941,58097:31938,58098:31960,58099:31954,58100:31964,58101:31970,58102:39739,58103:31983,58104:31986,58105:31988,58106:31990,58107:31994,58108:32006,58176:32002,58177:32028,58178:32021,58179:32010,58180:32069,58181:32075,58182:32046,58183:32050,58184:32063,58185:32053,58186:32070,58187:32115,58188:32086,58189:32078,58190:32114,58191:32104,58192:32110,58193:32079,58194:32099,58195:32147,58196:32137,58197:32091,58198:32143,58199:32125,58200:32155,58201:32186,58202:32174,58203:32163,58204:32181,58205:32199,58206:32189,58207:32171,58208:32317,58209:32162,58210:32175,58211:32220,58212:32184,58213:32159,58214:32176,58215:32216,58216:32221,58217:32228,58218:32222,58219:32251,58220:32242,58221:32225,58222:32261,58223:32266,58224:32291,58225:32289,58226:32274,58227:32305,58228:32287,58229:32265,58230:32267,58231:32290,58232:32326,58233:32358,58234:32315,58235:32309,58236:32313,58237:32323,58238:32311,58240:32306,58241:32314,58242:32359,58243:32349,58244:32342,58245:32350,58246:32345,58247:32346,58248:32377,58249:32362,58250:32361,58251:32380,58252:32379,58253:32387,58254:32213,58255:32381,58256:36782,58257:32383,58258:32392,58259:32393,58260:32396,58261:32402,58262:32400,58263:32403,58264:32404,58265:32406,58266:32398,58267:32411,58268:32412,58269:32568,58270:32570,58271:32581,58272:32588,58273:32589,58274:32590,58275:32592,58276:32593,58277:32597,58278:32596,58279:32600,58280:32607,58281:32608,58282:32616,58283:32617,58284:32615,58285:32632,58286:32642,58287:32646,58288:32643,58289:32648,58290:32647,58291:32652,58292:32660,58293:32670,58294:32669,58295:32666,58296:32675,58297:32687,58298:32690,58299:32697,58300:32686,58301:32694,58302:32696,58303:35697,58304:32709,58305:32710,58306:32714,58307:32725,58308:32724,58309:32737,58310:32742,58311:32745,58312:32755,58313:32761,58314:39132,58315:32774,58316:32772,58317:32779,58318:32786,58319:32792,58320:32793,58321:32796,58322:32801,58323:32808,58324:32831,58325:32827,58326:32842,58327:32838,58328:32850,58329:32856,58330:32858,58331:32863,58332:32866,58333:32872,58334:32883,58335:32882,58336:32880,58337:32886,58338:32889,58339:32893,58340:32895,58341:32900,58342:32902,58343:32901,58344:32923,58345:32915,58346:32922,58347:32941,58348:20880,58349:32940,58350:32987,58351:32997,58352:32985,58353:32989,58354:32964,58355:32986,58356:32982,58357:33033,58358:33007,58359:33009,58360:33051,58361:33065,58362:33059,58363:33071,58364:33099,58432:38539,58433:33094,58434:33086,58435:33107,58436:33105,58437:33020,58438:33137,58439:33134,58440:33125,58441:33126,58442:33140,58443:33155,58444:33160,58445:33162,58446:33152,58447:33154,58448:33184,58449:33173,58450:33188,58451:33187,58452:33119,58453:33171,58454:33193,58455:33200,58456:33205,58457:33214,58458:33208,58459:33213,58460:33216,58461:33218,58462:33210,58463:33225,58464:33229,58465:33233,58466:33241,58467:33240,58468:33224,58469:33242,58470:33247,58471:33248,58472:33255,58473:33274,58474:33275,58475:33278,58476:33281,58477:33282,58478:33285,58479:33287,58480:33290,58481:33293,58482:33296,58483:33302,58484:33321,58485:33323,58486:33336,58487:33331,58488:33344,58489:33369,58490:33368,58491:33373,58492:33370,58493:33375,58494:33380,58496:33378,58497:33384,58498:33386,58499:33387,58500:33326,58501:33393,58502:33399,58503:33400,58504:33406,58505:33421,58506:33426,58507:33451,58508:33439,58509:33467,58510:33452,58511:33505,58512:33507,58513:33503,58514:33490,58515:33524,58516:33523,58517:33530,58518:33683,58519:33539,58520:33531,58521:33529,58522:33502,58523:33542,58524:33500,58525:33545,58526:33497,58527:33589,58528:33588,58529:33558,58530:33586,58531:33585,58532:33600,58533:33593,58534:33616,58535:33605,58536:33583,58537:33579,58538:33559,58539:33560,58540:33669,58541:33690,58542:33706,58543:33695,58544:33698,58545:33686,58546:33571,58547:33678,58548:33671,58549:33674,58550:33660,58551:33717,58552:33651,58553:33653,58554:33696,58555:33673,58556:33704,58557:33780,58558:33811,58559:33771,58560:33742,58561:33789,58562:33795,58563:33752,58564:33803,58565:33729,58566:33783,58567:33799,58568:33760,58569:33778,58570:33805,58571:33826,58572:33824,58573:33725,58574:33848,58575:34054,58576:33787,58577:33901,58578:33834,58579:33852,58580:34138,58581:33924,58582:33911,58583:33899,58584:33965,58585:33902,58586:33922,58587:33897,58588:33862,58589:33836,58590:33903,58591:33913,58592:33845,58593:33994,58594:33890,58595:33977,58596:33983,58597:33951,58598:34009,58599:33997,58600:33979,58601:34010,58602:34e3,58603:33985,58604:33990,58605:34006,58606:33953,58607:34081,58608:34047,58609:34036,58610:34071,58611:34072,58612:34092,58613:34079,58614:34069,58615:34068,58616:34044,58617:34112,58618:34147,58619:34136,58620:34120,58688:34113,58689:34306,58690:34123,58691:34133,58692:34176,58693:34212,58694:34184,58695:34193,58696:34186,58697:34216,58698:34157,58699:34196,58700:34203,58701:34282,58702:34183,58703:34204,58704:34167,58705:34174,58706:34192,58707:34249,58708:34234,58709:34255,58710:34233,58711:34256,58712:34261,58713:34269,58714:34277,58715:34268,58716:34297,58717:34314,58718:34323,58719:34315,58720:34302,58721:34298,58722:34310,58723:34338,58724:34330,58725:34352,58726:34367,58727:34381,58728:20053,58729:34388,58730:34399,58731:34407,58732:34417,58733:34451,58734:34467,58735:34473,58736:34474,58737:34443,58738:34444,58739:34486,58740:34479,58741:34500,58742:34502,58743:34480,58744:34505,58745:34851,58746:34475,58747:34516,58748:34526,58749:34537,58750:34540,58752:34527,58753:34523,58754:34543,58755:34578,58756:34566,58757:34568,58758:34560,58759:34563,58760:34555,58761:34577,58762:34569,58763:34573,58764:34553,58765:34570,58766:34612,58767:34623,58768:34615,58769:34619,58770:34597,58771:34601,58772:34586,58773:34656,58774:34655,58775:34680,58776:34636,58777:34638,58778:34676,58779:34647,58780:34664,58781:34670,58782:34649,58783:34643,58784:34659,58785:34666,58786:34821,58787:34722,58788:34719,58789:34690,58790:34735,58791:34763,58792:34749,58793:34752,58794:34768,58795:38614,58796:34731,58797:34756,58798:34739,58799:34759,58800:34758,58801:34747,58802:34799,58803:34802,58804:34784,58805:34831,58806:34829,58807:34814,58808:34806,58809:34807,58810:34830,58811:34770,58812:34833,58813:34838,58814:34837,58815:34850,58816:34849,58817:34865,58818:34870,58819:34873,58820:34855,58821:34875,58822:34884,58823:34882,58824:34898,58825:34905,58826:34910,58827:34914,58828:34923,58829:34945,58830:34942,58831:34974,58832:34933,58833:34941,58834:34997,58835:34930,58836:34946,58837:34967,58838:34962,58839:34990,58840:34969,58841:34978,58842:34957,58843:34980,58844:34992,58845:35007,58846:34993,58847:35011,58848:35012,58849:35028,58850:35032,58851:35033,58852:35037,58853:35065,58854:35074,58855:35068,58856:35060,58857:35048,58858:35058,58859:35076,58860:35084,58861:35082,58862:35091,58863:35139,58864:35102,58865:35109,58866:35114,58867:35115,58868:35137,58869:35140,58870:35131,58871:35126,58872:35128,58873:35148,58874:35101,58875:35168,58876:35166,58944:35174,58945:35172,58946:35181,58947:35178,58948:35183,58949:35188,58950:35191,58951:35198,58952:35203,58953:35208,58954:35210,58955:35219,58956:35224,58957:35233,58958:35241,58959:35238,58960:35244,58961:35247,58962:35250,58963:35258,58964:35261,58965:35263,58966:35264,58967:35290,58968:35292,58969:35293,58970:35303,58971:35316,58972:35320,58973:35331,58974:35350,58975:35344,58976:35340,58977:35355,58978:35357,58979:35365,58980:35382,58981:35393,58982:35419,58983:35410,58984:35398,58985:35400,58986:35452,58987:35437,58988:35436,58989:35426,58990:35461,58991:35458,58992:35460,58993:35496,58994:35489,58995:35473,58996:35493,58997:35494,58998:35482,58999:35491,59e3:35524,59001:35533,59002:35522,59003:35546,59004:35563,59005:35571,59006:35559,59008:35556,59009:35569,59010:35604,59011:35552,59012:35554,59013:35575,59014:35550,59015:35547,59016:35596,59017:35591,59018:35610,59019:35553,59020:35606,59021:35600,59022:35607,59023:35616,59024:35635,59025:38827,59026:35622,59027:35627,59028:35646,59029:35624,59030:35649,59031:35660,59032:35663,59033:35662,59034:35657,59035:35670,59036:35675,59037:35674,59038:35691,59039:35679,59040:35692,59041:35695,59042:35700,59043:35709,59044:35712,59045:35724,59046:35726,59047:35730,59048:35731,59049:35734,59050:35737,59051:35738,59052:35898,59053:35905,59054:35903,59055:35912,59056:35916,59057:35918,59058:35920,59059:35925,59060:35938,59061:35948,59062:35960,59063:35962,59064:35970,59065:35977,59066:35973,59067:35978,59068:35981,59069:35982,59070:35988,59071:35964,59072:35992,59073:25117,59074:36013,59075:36010,59076:36029,59077:36018,59078:36019,59079:36014,59080:36022,59081:36040,59082:36033,59083:36068,59084:36067,59085:36058,59086:36093,59087:36090,59088:36091,59089:36100,59090:36101,59091:36106,59092:36103,59093:36111,59094:36109,59095:36112,59096:40782,59097:36115,59098:36045,59099:36116,59100:36118,59101:36199,59102:36205,59103:36209,59104:36211,59105:36225,59106:36249,59107:36290,59108:36286,59109:36282,59110:36303,59111:36314,59112:36310,59113:36300,59114:36315,59115:36299,59116:36330,59117:36331,59118:36319,59119:36323,59120:36348,59121:36360,59122:36361,59123:36351,59124:36381,59125:36382,59126:36368,59127:36383,59128:36418,59129:36405,59130:36400,59131:36404,59132:36426,59200:36423,59201:36425,59202:36428,59203:36432,59204:36424,59205:36441,59206:36452,59207:36448,59208:36394,59209:36451,59210:36437,59211:36470,59212:36466,59213:36476,59214:36481,59215:36487,59216:36485,59217:36484,59218:36491,59219:36490,59220:36499,59221:36497,59222:36500,59223:36505,59224:36522,59225:36513,59226:36524,59227:36528,59228:36550,59229:36529,59230:36542,59231:36549,59232:36552,59233:36555,59234:36571,59235:36579,59236:36604,59237:36603,59238:36587,59239:36606,59240:36618,59241:36613,59242:36629,59243:36626,59244:36633,59245:36627,59246:36636,59247:36639,59248:36635,59249:36620,59250:36646,59251:36659,59252:36667,59253:36665,59254:36677,59255:36674,59256:36670,59257:36684,59258:36681,59259:36678,59260:36686,59261:36695,59262:36700,59264:36706,59265:36707,59266:36708,59267:36764,59268:36767,59269:36771,59270:36781,59271:36783,59272:36791,59273:36826,59274:36837,59275:36834,59276:36842,59277:36847,59278:36999,59279:36852,59280:36869,59281:36857,59282:36858,59283:36881,59284:36885,59285:36897,59286:36877,59287:36894,59288:36886,59289:36875,59290:36903,59291:36918,59292:36917,59293:36921,59294:36856,59295:36943,59296:36944,59297:36945,59298:36946,59299:36878,59300:36937,59301:36926,59302:36950,59303:36952,59304:36958,59305:36968,59306:36975,59307:36982,59308:38568,59309:36978,59310:36994,59311:36989,59312:36993,59313:36992,59314:37002,59315:37001,59316:37007,59317:37032,59318:37039,59319:37041,59320:37045,59321:37090,59322:37092,59323:25160,59324:37083,59325:37122,59326:37138,59327:37145,59328:37170,59329:37168,59330:37194,59331:37206,59332:37208,59333:37219,59334:37221,59335:37225,59336:37235,59337:37234,59338:37259,59339:37257,59340:37250,59341:37282,59342:37291,59343:37295,59344:37290,59345:37301,59346:37300,59347:37306,59348:37312,59349:37313,59350:37321,59351:37323,59352:37328,59353:37334,59354:37343,59355:37345,59356:37339,59357:37372,59358:37365,59359:37366,59360:37406,59361:37375,59362:37396,59363:37420,59364:37397,59365:37393,59366:37470,59367:37463,59368:37445,59369:37449,59370:37476,59371:37448,59372:37525,59373:37439,59374:37451,59375:37456,59376:37532,59377:37526,59378:37523,59379:37531,59380:37466,59381:37583,59382:37561,59383:37559,59384:37609,59385:37647,59386:37626,59387:37700,59388:37678,59456:37657,59457:37666,59458:37658,59459:37667,59460:37690,59461:37685,59462:37691,59463:37724,59464:37728,59465:37756,59466:37742,59467:37718,59468:37808,59469:37804,59470:37805,59471:37780,59472:37817,59473:37846,59474:37847,59475:37864,59476:37861,59477:37848,59478:37827,59479:37853,59480:37840,59481:37832,59482:37860,59483:37914,59484:37908,59485:37907,59486:37891,59487:37895,59488:37904,59489:37942,59490:37931,59491:37941,59492:37921,59493:37946,59494:37953,59495:37970,59496:37956,59497:37979,59498:37984,59499:37986,59500:37982,59501:37994,59502:37417,59503:38e3,59504:38005,59505:38007,59506:38013,59507:37978,59508:38012,59509:38014,59510:38017,59511:38015,59512:38274,59513:38279,59514:38282,59515:38292,59516:38294,59517:38296,59518:38297,59520:38304,59521:38312,59522:38311,59523:38317,59524:38332,59525:38331,59526:38329,59527:38334,59528:38346,59529:28662,59530:38339,59531:38349,59532:38348,59533:38357,59534:38356,59535:38358,59536:38364,59537:38369,59538:38373,59539:38370,59540:38433,59541:38440,59542:38446,59543:38447,59544:38466,59545:38476,59546:38479,59547:38475,59548:38519,59549:38492,59550:38494,59551:38493,59552:38495,59553:38502,59554:38514,59555:38508,59556:38541,59557:38552,59558:38549,59559:38551,59560:38570,59561:38567,59562:38577,59563:38578,59564:38576,59565:38580,59566:38582,59567:38584,59568:38585,59569:38606,59570:38603,59571:38601,59572:38605,59573:35149,59574:38620,59575:38669,59576:38613,59577:38649,59578:38660,59579:38662,59580:38664,59581:38675,59582:38670,59583:38673,59584:38671,59585:38678,59586:38681,59587:38692,59588:38698,59589:38704,59590:38713,59591:38717,59592:38718,59593:38724,59594:38726,59595:38728,59596:38722,59597:38729,59598:38748,59599:38752,59600:38756,59601:38758,59602:38760,59603:21202,59604:38763,59605:38769,59606:38777,59607:38789,59608:38780,59609:38785,59610:38778,59611:38790,59612:38795,59613:38799,59614:38800,59615:38812,59616:38824,59617:38822,59618:38819,59619:38835,59620:38836,59621:38851,59622:38854,59623:38856,59624:38859,59625:38876,59626:38893,59627:40783,59628:38898,59629:31455,59630:38902,59631:38901,59632:38927,59633:38924,59634:38968,59635:38948,59636:38945,59637:38967,59638:38973,59639:38982,59640:38991,59641:38987,59642:39019,59643:39023,59644:39024,59712:39025,59713:39028,59714:39027,59715:39082,59716:39087,59717:39089,59718:39094,59719:39108,59720:39107,59721:39110,59722:39145,59723:39147,59724:39171,59725:39177,59726:39186,59727:39188,59728:39192,59729:39201,59730:39197,59731:39198,59732:39204,59733:39200,59734:39212,59735:39214,59736:39229,59737:39230,59738:39234,59739:39241,59740:39237,59741:39248,59742:39243,59743:39249,59744:39250,59745:39244,59746:39253,59747:39319,59748:39320,59749:39333,59750:39341,59751:39342,59752:39356,59753:39391,59754:39387,59755:39389,59756:39384,59757:39377,59758:39405,59759:39406,59760:39409,59761:39410,59762:39419,59763:39416,59764:39425,59765:39439,59766:39429,59767:39394,59768:39449,59769:39467,59770:39479,59771:39493,59772:39490,59773:39488,59774:39491,59776:39486,59777:39509,59778:39501,59779:39515,59780:39511,59781:39519,59782:39522,59783:39525,59784:39524,59785:39529,59786:39531,59787:39530,59788:39597,59789:39600,59790:39612,59791:39616,59792:39631,59793:39633,59794:39635,59795:39636,59796:39646,59797:39647,59798:39650,59799:39651,59800:39654,59801:39663,59802:39659,59803:39662,59804:39668,59805:39665,59806:39671,59807:39675,59808:39686,59809:39704,59810:39706,59811:39711,59812:39714,59813:39715,59814:39717,59815:39719,59816:39720,59817:39721,59818:39722,59819:39726,59820:39727,59821:39730,59822:39748,59823:39747,59824:39759,59825:39757,59826:39758,59827:39761,59828:39768,59829:39796,59830:39827,59831:39811,59832:39825,59833:39830,59834:39831,59835:39839,59836:39840,59837:39848,59838:39860,59839:39872,59840:39882,59841:39865,59842:39878,59843:39887,59844:39889,59845:39890,59846:39907,59847:39906,59848:39908,59849:39892,59850:39905,59851:39994,59852:39922,59853:39921,59854:39920,59855:39957,59856:39956,59857:39945,59858:39955,59859:39948,59860:39942,59861:39944,59862:39954,59863:39946,59864:39940,59865:39982,59866:39963,59867:39973,59868:39972,59869:39969,59870:39984,59871:40007,59872:39986,59873:40006,59874:39998,59875:40026,59876:40032,59877:40039,59878:40054,59879:40056,59880:40167,59881:40172,59882:40176,59883:40201,59884:40200,59885:40171,59886:40195,59887:40198,59888:40234,59889:40230,59890:40367,59891:40227,59892:40223,59893:40260,59894:40213,59895:40210,59896:40257,59897:40255,59898:40254,59899:40262,59900:40264,59968:40285,59969:40286,59970:40292,59971:40273,59972:40272,59973:40281,59974:40306,59975:40329,59976:40327,59977:40363,59978:40303,59979:40314,59980:40346,59981:40356,59982:40361,59983:40370,59984:40388,59985:40385,59986:40379,59987:40376,59988:40378,59989:40390,59990:40399,59991:40386,59992:40409,59993:40403,59994:40440,59995:40422,59996:40429,59997:40431,59998:40445,59999:40474,6e4:40475,60001:40478,60002:40565,60003:40569,60004:40573,60005:40577,60006:40584,60007:40587,60008:40588,60009:40594,60010:40597,60011:40593,60012:40605,60013:40613,60014:40617,60015:40632,60016:40618,60017:40621,60018:38753,60019:40652,60020:40654,60021:40655,60022:40656,60023:40660,60024:40668,60025:40670,60026:40669,60027:40672,60028:40677,60029:40680,60030:40687,60032:40692,60033:40694,60034:40695,60035:40697,60036:40699,60037:40700,60038:40701,60039:40711,60040:40712,60041:30391,60042:40725,60043:40737,60044:40748,60045:40766,60046:40778,60047:40786,60048:40788,60049:40803,60050:40799,60051:40800,60052:40801,60053:40806,60054:40807,60055:40812,60056:40810,60057:40823,60058:40818,60059:40822,60060:40853,60061:40860,60062:40864,60063:22575,60064:27079,60065:36953,60066:29796,60067:20956,60068:29081}},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(1),a=t(2);r.decode=function(e,r){var t=new Uint8ClampedArray(e.length);t.set(e);for(var o=new n.default(285,256,0),i=new a.default(o,t),s=new Uint8ClampedArray(r),c=!1,u=0;u<r;u++){var l=i.evaluateAt(o.exp(u+o.generatorBase));s[s.length-1-u]=l,0!==l&&(c=!0)}if(!c)return t;var d=new a.default(o,s),f=function(e,r,t,n){var a;r.degree()<t.degree()&&(r=(a=[t,r])[0],t=a[1]);for(var o=r,i=t,s=e.zero,c=e.one;i.degree()>=n/2;){var u=o,l=s;if(s=c,(o=i).isZero())return null;i=u;for(var d=e.zero,f=o.getCoefficient(o.degree()),p=e.inverse(f);i.degree()>=o.degree()&&!i.isZero();){var h=i.degree()-o.degree(),m=e.multiply(i.getCoefficient(i.degree()),p);d=d.addOrSubtract(e.buildMonomial(h,m)),i=i.addOrSubtract(o.multiplyByMonomial(h,m))}if(c=d.multiplyPoly(s).addOrSubtract(l),i.degree()>=o.degree())return null}var g=c.getCoefficient(0);if(0===g)return null;var v=e.inverse(g);return[c.multiply(v),i.multiply(v)]}(o,o.buildMonomial(r,1),d,r);if(null===f)return null;var p=function(e,r){var t=r.degree();if(1===t)return[r.getCoefficient(1)];for(var n=new Array(t),a=0,o=1;o<e.size&&a<t;o++)0===r.evaluateAt(o)&&(n[a]=e.inverse(o),a++);return a!==t?null:n}(o,f[0]);if(null==p)return null;for(var h=function(e,r,t){for(var a=t.length,o=new Array(a),i=0;i<a;i++){for(var s=e.inverse(t[i]),c=1,u=0;u<a;u++)i!==u&&(c=e.multiply(c,n.addOrSubtractGF(1,e.multiply(t[u],s))));o[i]=e.multiply(r.evaluateAt(s),e.inverse(c)),0!==e.generatorBase&&(o[i]=e.multiply(o[i],s))}return o}(o,f[1],p),m=0;m<p.length;m++){var g=t.length-1-o.log(p[m]);if(g<0)return null;t[g]=n.addOrSubtractGF(t[g],h[m])}return t}},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.VERSIONS=[{infoBits:null,versionNumber:1,alignmentPatternCenters:[],errorCorrectionLevels:[{ecCodewordsPerBlock:7,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:13,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:13}]},{ecCodewordsPerBlock:17,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:2,alignmentPatternCenters:[6,18],errorCorrectionLevels:[{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:34}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:28}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]}]},{infoBits:null,versionNumber:3,alignmentPatternCenters:[6,22],errorCorrectionLevels:[{ecCodewordsPerBlock:15,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:55}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:13}]}]},{infoBits:null,versionNumber:4,alignmentPatternCenters:[6,26],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:80}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:32}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:5,alignmentPatternCenters:[6,30],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:43}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:11},{numBlocks:2,dataCodewordsPerBlock:12}]}]},{infoBits:null,versionNumber:6,alignmentPatternCenters:[6,34],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:27}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:31892,versionNumber:7,alignmentPatternCenters:[6,22,38],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:78}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:31}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:13},{numBlocks:1,dataCodewordsPerBlock:14}]}]},{infoBits:34236,versionNumber:8,alignmentPatternCenters:[6,24,42],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:97}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:38},{numBlocks:2,dataCodewordsPerBlock:39}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:18},{numBlocks:2,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:14},{numBlocks:2,dataCodewordsPerBlock:15}]}]},{infoBits:39577,versionNumber:9,alignmentPatternCenters:[6,26,46],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:12},{numBlocks:4,dataCodewordsPerBlock:13}]}]},{infoBits:42195,versionNumber:10,alignmentPatternCenters:[6,28,50],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68},{numBlocks:2,dataCodewordsPerBlock:69}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:43},{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]}]},{infoBits:48118,versionNumber:11,alignmentPatternCenters:[6,30,54],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:81}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:50},{numBlocks:4,dataCodewordsPerBlock:51}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:22},{numBlocks:4,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:12},{numBlocks:8,dataCodewordsPerBlock:13}]}]},{infoBits:51042,versionNumber:12,alignmentPatternCenters:[6,32,58],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:92},{numBlocks:2,dataCodewordsPerBlock:93}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:20},{numBlocks:6,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:55367,versionNumber:13,alignmentPatternCenters:[6,34,62],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:37},{numBlocks:1,dataCodewordsPerBlock:38}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:20},{numBlocks:4,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:11},{numBlocks:4,dataCodewordsPerBlock:12}]}]},{infoBits:58893,versionNumber:14,alignmentPatternCenters:[6,26,46,66],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:40},{numBlocks:5,dataCodewordsPerBlock:41}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:16},{numBlocks:5,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:5,dataCodewordsPerBlock:13}]}]},{infoBits:63784,versionNumber:15,alignmentPatternCenters:[6,26,48,70],errorCorrectionLevels:[{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:87},{numBlocks:1,dataCodewordsPerBlock:88}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:41},{numBlocks:5,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:7,dataCodewordsPerBlock:13}]}]},{infoBits:68472,versionNumber:16,alignmentPatternCenters:[6,26,50,74],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:98},{numBlocks:1,dataCodewordsPerBlock:99}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:70749,versionNumber:17,alignmentPatternCenters:[6,30,54,78],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:1,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22},{numBlocks:15,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:17,dataCodewordsPerBlock:15}]}]},{infoBits:76311,versionNumber:18,alignmentPatternCenters:[6,30,56,82],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:120},{numBlocks:1,dataCodewordsPerBlock:121}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:43},{numBlocks:4,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:1,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:19,dataCodewordsPerBlock:15}]}]},{infoBits:79154,versionNumber:19,alignmentPatternCenters:[6,30,58,86],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:113},{numBlocks:4,dataCodewordsPerBlock:114}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:44},{numBlocks:11,dataCodewordsPerBlock:45}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:21},{numBlocks:4,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:13},{numBlocks:16,dataCodewordsPerBlock:14}]}]},{infoBits:84390,versionNumber:20,alignmentPatternCenters:[6,34,62,90],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:41},{numBlocks:13,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:5,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:15},{numBlocks:10,dataCodewordsPerBlock:16}]}]},{infoBits:87683,versionNumber:21,alignmentPatternCenters:[6,28,50,72,94],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:116},{numBlocks:4,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:16},{numBlocks:6,dataCodewordsPerBlock:17}]}]},{infoBits:92361,versionNumber:22,alignmentPatternCenters:[6,26,50,74,98],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:111},{numBlocks:7,dataCodewordsPerBlock:112}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:13}]}]},{infoBits:96236,versionNumber:23,alignmentPatternCenters:[6,30,54,74,102],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:121},{numBlocks:5,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:47},{numBlocks:14,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:16,dataCodewordsPerBlock:15},{numBlocks:14,dataCodewordsPerBlock:16}]}]},{infoBits:102084,versionNumber:24,alignmentPatternCenters:[6,28,54,80,106],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:45},{numBlocks:14,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:30,dataCodewordsPerBlock:16},{numBlocks:2,dataCodewordsPerBlock:17}]}]},{infoBits:102881,versionNumber:25,alignmentPatternCenters:[6,32,58,84,110],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:106},{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:47},{numBlocks:13,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:110507,versionNumber:26,alignmentPatternCenters:[6,30,58,86,114],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:114},{numBlocks:2,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:46},{numBlocks:4,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:28,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:33,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]}]},{infoBits:110734,versionNumber:27,alignmentPatternCenters:[6,34,62,90,118],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:23},{numBlocks:26,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:117786,versionNumber:28,alignmentPatternCenters:[6,26,50,74,98,122],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:117},{numBlocks:10,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:45},{numBlocks:23,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:24},{numBlocks:31,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:31,dataCodewordsPerBlock:16}]}]},{infoBits:119615,versionNumber:29,alignmentPatternCenters:[6,30,54,78,102,126],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:116},{numBlocks:7,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:21,dataCodewordsPerBlock:45},{numBlocks:7,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:23},{numBlocks:37,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:26,dataCodewordsPerBlock:16}]}]},{infoBits:126325,versionNumber:30,alignmentPatternCenters:[6,26,52,78,104,130],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:115},{numBlocks:10,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:47},{numBlocks:10,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:25,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:25,dataCodewordsPerBlock:16}]}]},{infoBits:127568,versionNumber:31,alignmentPatternCenters:[6,30,56,82,108,134],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:3,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:46},{numBlocks:29,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:24},{numBlocks:1,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:133589,versionNumber:32,alignmentPatternCenters:[6,34,60,86,112,138],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:24},{numBlocks:35,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:35,dataCodewordsPerBlock:16}]}]},{infoBits:136944,versionNumber:33,alignmentPatternCenters:[6,30,58,86,114,142],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:21,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:24},{numBlocks:19,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:141498,versionNumber:34,alignmentPatternCenters:[6,34,62,90,118,146],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:6,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:44,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:59,dataCodewordsPerBlock:16},{numBlocks:1,dataCodewordsPerBlock:17}]}]},{infoBits:145311,versionNumber:35,alignmentPatternCenters:[6,30,54,78,102,126,150],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:121},{numBlocks:7,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:47},{numBlocks:26,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:39,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:41,dataCodewordsPerBlock:16}]}]},{infoBits:150283,versionNumber:36,alignmentPatternCenters:[6,24,50,76,102,128,154],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:121},{numBlocks:14,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:47},{numBlocks:34,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:46,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:64,dataCodewordsPerBlock:16}]}]},{infoBits:152622,versionNumber:37,alignmentPatternCenters:[6,28,54,80,106,132,158],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:46},{numBlocks:14,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:49,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:24,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:158308,versionNumber:38,alignmentPatternCenters:[6,32,58,84,110,136,162],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:122},{numBlocks:18,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:46},{numBlocks:32,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:48,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:15},{numBlocks:32,dataCodewordsPerBlock:16}]}]},{infoBits:161089,versionNumber:39,alignmentPatternCenters:[6,26,54,82,110,138,166],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:40,dataCodewordsPerBlock:47},{numBlocks:7,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:43,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:15},{numBlocks:67,dataCodewordsPerBlock:16}]}]},{infoBits:167017,versionNumber:40,alignmentPatternCenters:[6,30,58,86,114,142,170],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:118},{numBlocks:6,dataCodewordsPerBlock:119}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:18,dataCodewordsPerBlock:47},{numBlocks:31,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:24},{numBlocks:34,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:15},{numBlocks:61,dataCodewordsPerBlock:16}]}]}]},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(0);function a(e,r,t,n){var a=e.x-r.x+t.x-n.x,o=e.y-r.y+t.y-n.y;if(0===a&&0===o)return{a11:r.x-e.x,a12:r.y-e.y,a13:0,a21:t.x-r.x,a22:t.y-r.y,a23:0,a31:e.x,a32:e.y,a33:1};var i=r.x-t.x,s=n.x-t.x,c=r.y-t.y,u=n.y-t.y,l=i*u-s*c,d=(a*u-s*o)/l,f=(i*o-a*c)/l;return{a11:r.x-e.x+d*r.x,a12:r.y-e.y+d*r.y,a13:d,a21:n.x-e.x+f*n.x,a22:n.y-e.y+f*n.y,a23:f,a31:e.x,a32:e.y,a33:1}}r.extract=function(e,r){for(var t=function(e,r,t,n){var o=a(e,r,t,n);return{a11:o.a22*o.a33-o.a23*o.a32,a12:o.a13*o.a32-o.a12*o.a33,a13:o.a12*o.a23-o.a13*o.a22,a21:o.a23*o.a31-o.a21*o.a33,a22:o.a11*o.a33-o.a13*o.a31,a23:o.a13*o.a21-o.a11*o.a23,a31:o.a21*o.a32-o.a22*o.a31,a32:o.a12*o.a31-o.a11*o.a32,a33:o.a11*o.a22-o.a12*o.a21}}({x:3.5,y:3.5},{x:r.dimension-3.5,y:3.5},{x:r.dimension-6.5,y:r.dimension-6.5},{x:3.5,y:r.dimension-3.5}),o=function(e,r){return{a11:e.a11*r.a11+e.a21*r.a12+e.a31*r.a13,a12:e.a12*r.a11+e.a22*r.a12+e.a32*r.a13,a13:e.a13*r.a11+e.a23*r.a12+e.a33*r.a13,a21:e.a11*r.a21+e.a21*r.a22+e.a31*r.a23,a22:e.a12*r.a21+e.a22*r.a22+e.a32*r.a23,a23:e.a13*r.a21+e.a23*r.a22+e.a33*r.a23,a31:e.a11*r.a31+e.a21*r.a32+e.a31*r.a33,a32:e.a12*r.a31+e.a22*r.a32+e.a32*r.a33,a33:e.a13*r.a31+e.a23*r.a32+e.a33*r.a33}}(a(r.topLeft,r.topRight,r.alignmentPattern,r.bottomLeft),t),i=n.BitMatrix.createEmpty(r.dimension,r.dimension),s=function(e,r){var t=o.a13*e+o.a23*r+o.a33;return{x:(o.a11*e+o.a21*r+o.a31)/t,y:(o.a12*e+o.a22*r+o.a32)/t}},c=0;c<r.dimension;c++)for(var u=0;u<r.dimension;u++){var l=s(u+.5,c+.5);i.set(u,c,e.get(Math.floor(l.x),Math.floor(l.y)))}return{matrix:i,mappingFunction:s}}},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=function(e,r){return Math.sqrt(Math.pow(r.x-e.x,2)+Math.pow(r.y-e.y,2))};function a(e){return e.reduce((function(e,r){return e+r}))}function o(e,r,t,a){var o,i,s,c,u=[{x:Math.floor(e.x),y:Math.floor(e.y)}],l=Math.abs(r.y-e.y)>Math.abs(r.x-e.x);l?(o=Math.floor(e.y),i=Math.floor(e.x),s=Math.floor(r.y),c=Math.floor(r.x)):(o=Math.floor(e.x),i=Math.floor(e.y),s=Math.floor(r.x),c=Math.floor(r.y));for(var d=Math.abs(s-o),f=Math.abs(c-i),p=Math.floor(-d/2),h=o<s?1:-1,m=i<c?1:-1,g=!0,v=o,y=i;v!==s+h;v+=h){var b=l?y:v,C=l?v:y;if(t.get(b,C)!==g&&(g=!g,u.push({x:b,y:C}),u.length===a+1))break;if((p+=f)>0){if(y===c)break;y+=m,p-=d}}for(var w=[],k=0;k<a;k++)u[k]&&u[k+1]?w.push(n(u[k],u[k+1])):w.push(0);return w}function i(e,r,t,n){var a,i=r.y-e.y,s=r.x-e.x,c=o(e,r,t,Math.ceil(n/2)),u=o(e,{x:e.x-s,y:e.y-i},t,Math.ceil(n/2)),l=c.shift()+u.shift()-1;return(a=u.concat(l)).concat.apply(a,c)}function s(e,r){var t=a(e)/a(r),n=0;return r.forEach((function(r,a){n+=Math.pow(e[a]-r*t,2)})),{averageSize:t,error:n}}function c(e,r,t){try{var n=i(e,{x:-1,y:e.y},t,r.length),a=i(e,{x:e.x,y:-1},t,r.length),o=i(e,{x:Math.max(0,e.x-e.y)-1,y:Math.max(0,e.y-e.x)-1},t,r.length),c=i(e,{x:Math.min(t.width,e.x+e.y)+1,y:Math.min(t.height,e.y+e.x)+1},t,r.length),u=s(n,r),l=s(a,r),d=s(o,r),f=s(c,r),p=Math.sqrt(u.error*u.error+l.error*l.error+d.error*d.error+f.error*f.error),h=(u.averageSize+l.averageSize+d.averageSize+f.averageSize)/4;return p+(Math.pow(u.averageSize-h,2)+Math.pow(l.averageSize-h,2)+Math.pow(d.averageSize-h,2)+Math.pow(f.averageSize-h,2))/h}catch(e){return 1/0}}function u(e,r){for(var t=Math.round(r.x);e.get(t,Math.round(r.y));)t--;for(var n=Math.round(r.x);e.get(n,Math.round(r.y));)n++;for(var a=(t+n)/2,o=Math.round(r.y);e.get(Math.round(a),o);)o--;for(var i=Math.round(r.y);e.get(Math.round(a),i);)i++;return{x:a,y:(o+i)/2}}function l(e,r,t,o,s){var u,l,d;try{u=function(e,r,t,o){var s=(a(i(e,t,o,5))/7+a(i(e,r,o,5))/7+a(i(t,e,o,5))/7+a(i(r,e,o,5))/7)/4;if(s<1)throw new Error("Invalid module size");var c=Math.round(n(e,r)/s),u=Math.round(n(e,t)/s),l=Math.floor((c+u)/2)+7;switch(l%4){case 0:l++;break;case 2:l--}return{dimension:l,moduleSize:s}}(o,t,s,e),l=u.dimension,d=u.moduleSize}catch(e){return null}var f=t.x-o.x+s.x,p=t.y-o.y+s.y,h=(n(o,s)+n(o,t))/2/d,m=1-3/h,g={x:o.x+m*(f-o.x),y:o.y+m*(p-o.y)},v=r.map((function(r){var t=(r.top.startX+r.top.endX+r.bottom.startX+r.bottom.endX)/4,o=(r.top.y+r.bottom.y+1)/2;if(e.get(Math.floor(t),Math.floor(o))){var i=[r.top.endX-r.top.startX,r.bottom.endX-r.bottom.startX,r.bottom.y-r.top.y+1];return a(i),{x:t,y:o,score:c({x:Math.floor(t),y:Math.floor(o)},[1,1,1],e)+n({x:t,y:o},g)}}})).filter((function(e){return!!e})).sort((function(e,r){return e.score-r.score}));return{alignmentPattern:h>=15&&v.length?v[0]:g,dimension:l}}r.locate=function(e){for(var r=[],t=[],o=[],i=[],s=function(n){for(var s=0,c=!1,u=[0,0,0,0,0],l=function(r){var o=e.get(r,n);if(o===c)s++;else{u=[u[1],u[2],u[3],u[4],s],s=1,c=o;var l=a(u)/7,d=Math.abs(u[0]-l)<l&&Math.abs(u[1]-l)<l&&Math.abs(u[2]-3*l)<3*l&&Math.abs(u[3]-l)<l&&Math.abs(u[4]-l)<l&&!o,f=a(u.slice(-3))/3,p=Math.abs(u[2]-f)<f&&Math.abs(u[3]-f)<f&&Math.abs(u[4]-f)<f&&o;if(d){var h=r-u[3]-u[4],m=h-u[2],g={startX:m,endX:h,y:n};(v=t.filter((function(e){return m>=e.bottom.startX&&m<=e.bottom.endX||h>=e.bottom.startX&&m<=e.bottom.endX||m<=e.bottom.startX&&h>=e.bottom.endX&&u[2]/(e.bottom.endX-e.bottom.startX)<1.5&&u[2]/(e.bottom.endX-e.bottom.startX)>.5}))).length>0?v[0].bottom=g:t.push({top:g,bottom:g})}if(p){var v,y=r-u[4],b=y-u[3];g={startX:b,y:n,endX:y},(v=i.filter((function(e){return b>=e.bottom.startX&&b<=e.bottom.endX||y>=e.bottom.startX&&b<=e.bottom.endX||b<=e.bottom.startX&&y>=e.bottom.endX&&u[2]/(e.bottom.endX-e.bottom.startX)<1.5&&u[2]/(e.bottom.endX-e.bottom.startX)>.5}))).length>0?v[0].bottom=g:i.push({top:g,bottom:g})}}},d=-1;d<=e.width;d++)l(d);r.push.apply(r,t.filter((function(e){return e.bottom.y!==n&&e.bottom.y-e.top.y>=2}))),t=t.filter((function(e){return e.bottom.y===n})),o.push.apply(o,i.filter((function(e){return e.bottom.y!==n}))),i=i.filter((function(e){return e.bottom.y===n}))},d=0;d<=e.height;d++)s(d);r.push.apply(r,t.filter((function(e){return e.bottom.y-e.top.y>=2}))),o.push.apply(o,i);var f=r.filter((function(e){return e.bottom.y-e.top.y>=2})).map((function(r){var t=(r.top.startX+r.top.endX+r.bottom.startX+r.bottom.endX)/4,n=(r.top.y+r.bottom.y+1)/2;if(e.get(Math.round(t),Math.round(n))){var o=[r.top.endX-r.top.startX,r.bottom.endX-r.bottom.startX,r.bottom.y-r.top.y+1],i=a(o)/o.length;return{score:c({x:Math.round(t),y:Math.round(n)},[1,1,3,1,1],e),x:t,y:n,size:i}}})).filter((function(e){return!!e})).sort((function(e,r){return e.score-r.score})).map((function(e,r,t){if(r>4)return null;var n=t.filter((function(e,t){return r!==t})).map((function(r){return{x:r.x,y:r.y,score:r.score+Math.pow(r.size-e.size,2)/e.size,size:r.size}})).sort((function(e,r){return e.score-r.score}));if(n.length<2)return null;var a=e.score+n[0].score+n[1].score;return{points:[e].concat(n.slice(0,2)),score:a}})).filter((function(e){return!!e})).sort((function(e,r){return e.score-r.score}));if(0===f.length)return null;var p=function(e,r,t){var a,o,i,s,c,u,l,d=n(e,r),f=n(r,t),p=n(e,t);return f>=d&&f>=p?(c=(a=[r,e,t])[0],u=a[1],l=a[2]):p>=f&&p>=d?(c=(o=[e,r,t])[0],u=o[1],l=o[2]):(c=(i=[e,t,r])[0],u=i[1],l=i[2]),(l.x-u.x)*(c.y-u.y)-(l.y-u.y)*(c.x-u.x)<0&&(c=(s=[l,c])[0],l=s[1]),{bottomLeft:c,topLeft:u,topRight:l}}(f[0].points[0],f[0].points[1],f[0].points[2]),h=p.topRight,m=p.topLeft,g=p.bottomLeft,v=l(e,o,h,m,g),y=[];v&&y.push({alignmentPattern:{x:v.alignmentPattern.x,y:v.alignmentPattern.y},bottomLeft:{x:g.x,y:g.y},dimension:v.dimension,topLeft:{x:m.x,y:m.y},topRight:{x:h.x,y:h.y}});var b=u(e,h),C=u(e,m),w=u(e,g),k=l(e,o,b,C,w);return k&&y.push({alignmentPattern:{x:k.alignmentPattern.x,y:k.alignmentPattern.y},bottomLeft:{x:w.x,y:w.y},topLeft:{x:C.x,y:C.y},topRight:{x:b.x,y:b.y},dimension:k.dimension}),0===y.length?null:y}}]).default},e.exports=t()})));function cy(e){return uy.apply(this,arguments)}function uy(){return(uy=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.imageData,n=r.canvas,(a=t)||(o=n.getContext("2d"),a=o.getImageData(0,0,n.width,n.height)),!(i=sy(a.data,a.width,a.height,{inversionAttempts:"dontInvert"}))){e.next=6;break}return e.abrupt("return",i.data);case 6:return e.abrupt("return","");case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ly(e){return dy.apply(this,arguments)}function dy(){return(dy=S(regeneratorRuntime.mark((function e(r){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.canvas,n=r.qrScannerResources,e.abrupt("return",new Promise((function(e){setTimeout((function(){return e("")}),1e3),rv.scanImage(t,void 0,void 0,n.canvas).then(e).catch((function(){return e("")}))})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var fy=function(){var e=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.canvas,n=r.blob,a=r.qrScannerResources,o=t,!n){e.next=6;break}return e.next=5,So.blobToCanvas({blob:n});case 5:o=e.sent;case 6:return i=o.getContext("2d"),e.next=9,cy({imageData:i.getImageData(0,0,o.width,o.height)});case 9:if(s=e.sent){e.next=14;break}return e.next=13,ly({canvas:o,qrScannerResources:a});case 13:s=e.sent;case 14:return e.abrupt("return",s);case 15:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}();var py,hy,my,gy,vy,yy,by=function(e){var r=e.shouldStart,t=e.refVideo,n=e.cropArea,s=e.settings,u=e.onSessionTimeout,l=e.onCaptureDone,d=e.onAboutToTimeout,f=e.outputEncryptionSettings,p=O(c(!1),2),h=p[0],m=p[1],g=a((function(){})),v=a((function(){})),y=$t.useSDKSettings().lang,b=function(e){var r=e.refVideo,t=e.shouldStart,n=e.cropArea,s=e.settings,u=e.onResult,l=e.outputEncryptionSettings,d=a(null);null===d.current&&(d.current=document.createElement("canvas"));var f=a(!1),p=a(null),h=O(c(!1),2),m=h[0],g=h[1],v=a({}),y=$t.useSDKSettings(),b=y.customUrls,C=y.qrSettings;i((function(){function e(){return(e=S(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(m){e.next=5;break}return e.next=3,cv({modelUrl:null==b?void 0:b.wechatQRModelsUrl});case 3:v.current=e.sent,g(!0);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[m,b]);var w=o((function(){!0===f.current&&(f.current=!1)}),[]),k=o(S(regeneratorRuntime.mark((function e(){var t,n,a,o,i,c,h,g,y,b,k,B,E;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(m&&s&&!f.current){e.next=2;break}return e.abrupt("return");case 2:t=v.current,n=t.qrModel,a=t.qrScannerResources,o=t.noModel,i=p.current,c=r.current,f.current=!0,h=i.cropX,g=i.cropY,y=i.cropWidth,b=i.cropHeight,(k=d.current).width=y,k.height=b,B=k.getContext("2d"),E=function(){var e=S(regeneratorRuntime.mark((function e(){var r,t,i,s,p,m,v,S;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(B.drawImage(c,h,g,y,b,0,0,y,b),r=performance.now(),o){e.next=8;break}return e.next=5,oy({canvas:k,qrModel:n});case 5:t=e.sent,e.next=11;break;case 8:return e.next=10,fy({canvas:k,qrScannerResources:a});case 10:t=e.sent;case 11:if(r=Math.floor(performance.now()-r),!t){e.next=27;break}return w(),_=void 0,_=t.match(ay),i={valid:Boolean(_)},e.next=17,ca.takePicture({canvas:d.current});case 17:return s=e.sent,e.next=20,Rs.writeExif({mode:"",imageData:{captureTime:Date.now(),blob:s,result:t,type:"qr"},enableExifData:"boolean"!=typeof(null==C?void 0:C.enableExif)||(null==C?void 0:C.enableExif)});case 20:if(p=e.sent,!l||!l.key){e.next=26;break}return v=l.key,e.next=25,mi.encrypt({blob:p,key:v});case 25:m=e.sent;case 26:u({result:t,validateResult:i,image:{blob:p,encrypted:m}});case 27:return S=180-r>0?180-r:0,e.next=30,new Promise((function(e){return setTimeout(e,S)}));case 30:f.current&&window.requestAnimationFrame(E);case 31:case"end":return e.stop()}var _}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(E);case 13:case"end":return e.stop()}}),e)}))),[m,s,r,w,null==C?void 0:C.enableExif,l,u]),B=o((function(){w()}),[w]);return i((function(){var e=r.current;t||B(),m&&t&&n&&e&&e.videoWidth>0&&(p.current=ca.analyzeVideoAndWindowSizes(e,n,0),k())}),[t,n,r,w,k,m,B]),i((function(){return B}),[B]),{refWorkingCanvas:d,stopCheckFrame:w,checkFrame:k,warmupDone:m}}({refVideo:t,shouldStart:r,cropArea:n,settings:s,onResult:o((function(){g.current.apply(g,arguments)}),[]),outputEncryptionSettings:f}),C=b.stopCheckFrame,w=b.checkFrame,k=b.warmupDone,B=gv({refVideo:t,shouldStart:r&&k,cropArea:n,settings:s}),E=B.stopCheckFrame,_=B.refRecordedVideos,A=B.splitVideos,I=B.resetRecordedVideos,T=B.checkFrame;g.current=o((function(e){m(!0),E(),C(),v.current(),l(x(x({},e),{},{recordedVideos:_.current})),m(!1)}),[E,l,_,C]);var P=o((function(){E(),C();var e=M(_.current);u({recordedVideos:e}),I()}),[I,E,C,u,_]),R=o((function(){A()}),[A]),D=vv({lang:y,onAboutToTimeout:d,onSessionTimeout:P,onVideoTimeLimitReached:R,settings:s,shouldStartTimers:r&&k,sessionTime:null==s?void 0:s.scanQrLimitTimeSecond}),N=D.stopTimers,L=D.startTimers;return v.current=N,{isProcessing:h,restartSession:o(S(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return L(),e.next=3,Promise.all([T(),w()]);case 3:case"end":return e.stop()}}),e)}))),[T,w,L]),refRecordedVideos:_,warmupDone:k}};function Cy(e){var t=e.windowAndVideoInfo,n=e.onUISpacingChange,s=e.refVideo,u=e.settings,l=e.onCaptureDone,d=e.outputEncryptionSettings,f=O(c(null),2),p=f[0],h=f[1],m=Nn.useAsset("qr_capture_cursor.png"),g=O(c({}),2),v=g[0],y=g[1],b=v.yTooltip,C=v.yMessage,w=$t.useSDKSettings().lang,k=Pn.useSDKTracking().sendEvent,B=Ag(),E=B.showPopup,_=B.popupShown,A=B.popupType,I=O(c(!1),2),T=I[0],x=I[1],P=O(c(null),2),R=P[0],D=P[1],N=Nn.useAsset("ic_loading.png"),L=a();i((function(){k({tag:"id_qr",event:"user_activity.start",log:{}}),L.current=performance.now()}),[k]),i((function(){E({popupType:Pg})}),[E]),i((function(){if(t){var e=t.videoAreaWidth,r=t.lostX,a=t.lostY,o=qs.isMobile?Math.min(e-6,145):145,i=o,s=a+10,c=s+90,u=c+40,l=u+i+20,d=Math.floor((e-o)/2)+r;h({x:d,y:u,width:o,height:i,surroundStyle:{opacity:.6,background:"#000"}});var f={yTitle:s,yTooltip:l,yMessage:c};y(f),n(f)}}),[t,n]);var M=o((function(e){k({tag:"id_qr",event:"sdk_ui.scan_time_out",log:{}}),D(""),l(e)}),[l,k]),F=o((function(e){var r=e.validateResult.valid;D("");var t=performance.now();r?(k({tag:"id_qr",event:"sdk_ui.scan_success",log:{time_capture_in_seconds:(t-L.current)/1e3}}),l(e)):(E({popupType:xg}),k({tag:"id_qr",event:"sdk_ui.invalid_qr_alert",log:{}}))}),[E,l,k]),U=o((function(e){var r=e.curTimeLeft;D(Kd(xv.REMAINING_TIME[w])({x:r}))}),[w]),V=by({shouldStart:T,refVideo:s,cropArea:p,settings:u,onSessionTimeout:M,onCaptureDone:F,onAboutToTimeout:U,outputEncryptionSettings:d}),j=V.isProcessing,z=V.restartSession,K=V.warmupDone,H=o((function(){E({popupType:null})}),[E]),q=o(S(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return H(),L.current=performance.now(),k({tag:"id_qr",event:"user_activity.invalid_qr_retry",log:{}}),e.next=5,z();case 5:case"end":return e.stop()}}),e)}))),[z,H,k]),G=o((function(){H(),k({tag:"id_qr",event:"user_activity.invalid_qr_skip",log:{}}),l()}),[H,l,k]),W=o((function(){H(),setTimeout((function(){x(!0)}),200)}),[H]);return r.createElement(r.Fragment,null,!K&&r.createElement(qp,{contentStyle:{maxWidth:"300px"}}),p&&r.createElement(Cu,{x:"".concat(p.x,"px"),y:"".concat(p.y,"px"),width:"".concat(p.width,"px"),height:"".concat(p.height,"px"),surroundStyle:p.surroundStyle},r.createElement("div",null,r.createElement("img",{src:m,width:p.width,height:p.height,alt:""}))),r.createElement(Iv,{y:"".concat(b,"px")},xv.QR_TOOLTIP[w]),R&&r.createElement(Tv,{key:R,className:"message",y:"".concat(C,"px")},R),j&&r.createElement(Bm,null,r.createElement("img",{src:N,alt:"",className:"spin"})),r.createElement(zp,{contentStyle:{maxWidth:"332px"},open:_},A===xg&&r.createElement(Vv,{onRetry:q,onSkip:G}),A===Pg&&r.createElement(ny,{onClickStart:W,onTimeout:W})))}Cy.propTypes={windowAndVideoInfo:h.shape({}),onUISpacingChange:h.func,refVideo:h.shape({}),settings:h.shape({}),onCaptureDone:h.func,outputEncryptionSettings:h.shape({})},Cy.defaultProps={windowAndVideoInfo:{},onUISpacingChange:function(){},refVideo:{},settings:{},onCaptureDone:function(){},outputEncryptionSettings:null};var wy,ky,By,Ey,Sy,_y={SUCCESS:"SUCCESS",WARNING:"WARNING"},Ay=(A(py={},_y.SUCCESS,"52,206,95"),A(py,_y.WARNING,"255,148,50"),py),Iy=(A(hy={},_y.SUCCESS,"✓"),A(hy,_y.WARNING,"!"),hy),Ty=m.div(my||(my=L(["\n font-weight: normal;\n"]))),xy=m.div(gy||(gy=L(["\n height: 2px;\n width: 100%;\n background: ",";\n"])),(function(e){return b(["linear-gradient(to right,rgba(",",0),rgba(",",1),rgba(",",0));"],Ay[e.type],Ay[e.type],Ay[e.type])})),Py=m.div(vy||(vy=L(["\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: ",";\n display: flex;\n justify-content: center;\n align-items: center;\n color: #fff;\n margin-right: 8px;\n font-weight: bold;\n"])),(function(e){return b(["rgb(",")"],Ay[e.type])})),Ry=m.div(yy||(yy=L(["\n display: flex;\n justify-content: center;\n align-items: center;\n margin: 10px 0;\n"]))),Dy=function(e){var t=e.children,n=e.type,a=e.className;return r.createElement(Ty,{className:a},r.createElement(xy,{type:n}),r.createElement(Ry,null,r.createElement(Py,{type:n},Iy[n]),t),r.createElement(xy,{type:n}))};Dy.propTypes={children:h.node,type:h.string,className:h.string},Dy.defaultProps={children:null,type:_y.SUCCESS,className:""};var Ny=m.div(wy||(wy=L(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),Ly=m.div(ky||(ky=L(["\n text-align: center;\n font-size: 1rem;\n color: #ea3223;\n margin-top: 10px;\n"]))),Oy=m.button(By||(By=L(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n background-color: ",";\n border: 0;\n outline: none;\n border-radius: 0.25rem;\n color: #fff;\n font-weight: 400;\n cursor: pointer;\n font-size: 1rem;\n"])),(function(e){return e.theme.tsBlue})),My=m.img(Ey||(Ey=L(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),Fy=m.div(Sy||(Sy=L(["\n margin: 20px 0;\n width: 100%;\n display: flex;\n justify-content: space-evenly;\n gap: 10px;\n"]))),Uy=function(e){var t=e.imageTaken,n=e.onConfirm,a=e.onTryAgain,o=e.error,s=e.hasValidQR,u=e.frontSide,l=O(c(null),2),d=l[0],f=l[1],p=$t.useSDKSettings().lang,h=Pn.useSDKTracking().sendEvent;return i((function(){h({tag:u?"id_front":"id_back",event:"user_activity.show_confirm",log:{}})}),[u,h]),i((function(){var e;return t&&(e=URL.createObjectURL(t.blob),f(e)),function(){URL.revokeObjectURL(e)}}),[t]),r.createElement(Ny,null,null!==s&&r.createElement(Pv,{mb:"20px"},r.createElement("div",null,r.createElement(Dy,{type:s?_y.SUCCESS:_y.WARNING},s?wg.CONFIRM_POPUP_VALID_QR[p]:wg.CONFIRM_POPUP_INVALID_QR[p]))),r.createElement(Zv,{ratio:1.5},r.createElement(My,{src:d})),o&&r.createElement(Ly,{className:"confirm-popup-error-message"},o.msg[p]),r.createElement(Fy,null,r.createElement(Oy,{onClick:function(){h({tag:u?"id_front":"id_back",event:"user_activity.retry",log:{}}),a()}},wg.BTN_TRY_AGAIN[p]),r.createElement(Oy,{onClick:function(){h({tag:u?"id_front":"id_back",event:"user_activity.submit",log:{}}),n()}},wg.BTN_USE_THIS_PICTURE[p])))};Uy.propTypes={imageTaken:h.shape({}),error:h.shape({msg:h.shape({})}),onConfirm:h.func,onTryAgain:h.func,hasValidQR:h.bool,frontSide:h.bool},Uy.defaultProps={imageTaken:null,error:null,onConfirm:function(){},onTryAgain:function(){},hasValidQR:null,frontSide:!0};var Vy,jy={tsBlue:"#0276f1",tsSecondary:"rgba(0, 47, 117, 0.6)"},zy=y(Vy||(Vy=L(["\n .text-primary {\n color: ",";\n }\n"])),(function(e){return e.theme.tsBlue})),Ky=["onClose","onError","settings","outputEncryptionSettings","defaultCameraId","globalStyle","styledComponent","frontCamera","scannerTypeCons","isLoading"];function Hy(e){var t=e.onClose,n=e.onError,s=e.settings,u=e.outputEncryptionSettings,l=e.defaultCameraId,d=e.globalStyle,f=e.styledComponent,p=e.frontCamera,h=e.scannerTypeCons,m=e.isLoading,g=N(e,Ky),v=g.numberOfCaptures,y=g.stepNumber,b=g.frontSide,w=g.titleIcon,k=g.title,B=g.description,E=g.scannerType,S=g.usePortraitMask,_=g.shouldShowSpinner,A=g.handleQRCaptureDone,T=g.handleIDCardCaptureDone,x=g.handleRestartSession,P=g.refIDCardReader,R=g.handleClickConfirm,D=g.popupType,L=g.popupShown,M=g.popupProps,F=a(null),U=O(c(null),2),V=U[0],j=U[1],z=O(c(!1),2),K=z[0],H=z[1],q=Nn.useAsset("ic_loading.png"),G=O(c({}),2),W=G[0],Q=G[1],X=W.yTitle,Y=o((function(e){j(e),H(!0)}),[]);i((function(){H(!1)}),[p]);var Z=Nn.useAsset(w),$=f.CloseCameraButton;return r.createElement(C,{theme:jy},r.createElement(Cm,null,r.createElement(hu,{key:p,frontCamera:p,onVideoPlayed:Y,onClose:t,flipHorizontal:p,ref:F,onError:n,defaultCameraId:l,closeButton:$||null},K&&r.createElement(r.Fragment,null,E===h.ID_CARD&&r.createElement(Bv,{key:y,ref:P,windowAndVideoInfo:V,refVideo:F,settings:s,onCaptureDone:T,onUISpacingChange:Q,frontSide:b,description:B,usePortraitMask:S,outputEncryptionSettings:u}),E===h.QR_CODE&&r.createElement(Cy,{key:y,refVideo:F,windowAndVideoInfo:V,settings:s,onCaptureDone:A,onUISpacingChange:Q,outputEncryptionSettings:u})),r.createElement(bm,{keyForTransition:v}),r.createElement(Sm,{y:"".concat(X,"px")},r.createElement(Sh,null,r.createElement(vh,{key:k,timeout:{enter:500,exit:500},classNames:"flipY",unmountOnExit:!0},r.createElement(_m,null,w&&r.createElement(wm,{src:Z,alt:""}),r.createElement(Am,{className:"title"},k))))),(_||m)&&r.createElement(Bm,null,r.createElement("img",{src:q,alt:"",className:"spin"}))),r.createElement(zp,{open:L},D===Tg&&r.createElement(Uy,I({},M,{onConfirm:R,onTryAgain:x,frontSide:b})))),r.createElement(d,null))}var qy={settings:h.shape({}),onClose:h.func,onError:h.func,outputEncryptionSettings:h.shape({}),defaultCameraId:h.string,globalStyle:h.shape({}),styledComponent:h.shape({CloseCameraButton:h.node}),frontCamera:h.bool,scannerTypeCons:h.shape({}).isRequired,isLoading:h.bool},Gy={settings:null,onClose:function(){},onError:function(){},outputEncryptionSettings:null,defaultCameraId:void 0,globalStyle:zy,styledComponent:{CloseCameraButton:null},frontCamera:!1,isLoading:!1};Hy.propTypes=qy,Hy.defaultProps=Gy;var Wy=K.IDCardSide,Qy=K.IDCardType,Xy=K.Errors,Yy={ID_CARD:"id_card",QR_CODE:"qr_code"},Zy=[{scannerType:Yy.ID_CARD,title:"Mặt trước CMND/CCCD",description:"Vui lòng đặt CMND mặt trước vào trong khung",titleIcon:"id_card_front.svg",cardSide:K.IDCardSide.FRONT,cardType:Qy.VN,enableConfirmPopup:!0},{scannerType:Yy.ID_CARD,title:"Mặt sau CMND/CCCD",description:"Vui lòng đặt CMND mặt sau vào trong khung",titleIcon:"id_card_back.svg",cardSide:K.IDCardSide.BACK,cardType:Qy.VN,enableConfirmPopup:!0}],$y={scannerType:Yy.QR_CODE,title:"Quét mã QR trên CCCD",titleIcon:""},Jy=function(){return Promise.resolve({card_label:""})},eb=function(e){var r=e.settings,t=e.onError,n=e.detectIdCard,i=void 0===n?Jy:n,s=e.outputEncryptionSettings,u=e.steps,l=e.onStepDone,d=$t.useSDKSettings().lang,f=null!=u?u:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en",t="ph"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null)||"en"===r,n={scannerType:Yy.ID_CARD,title:t?"Capture Front Side of ID Card":"Mặt trước CMND/CCCD",description:t?"":"Vui lòng đặt CMND mặt trước vào trong khung",titleIcon:"id_card_front.svg",cardSide:K.IDCardSide.FRONT,cardType:Qy.VN,enableConfirmPopup:!0},a={scannerType:Yy.ID_CARD,title:t?"Capture Back Side of ID Card":"Mặt sau CMND/CCCD",description:t?"":"Vui lòng đặt CMND mặt sau vào trong khung",titleIcon:"id_card_back.svg",cardSide:K.IDCardSide.BACK,cardType:Qy.VN,enableConfirmPopup:!0};return e?[n,a]:[n]}(Pf(r,"hasBackCard",!0),d,Pf(r,"country")),p=O(c(0),2),h=p[0],m=p[1],g=O(c(f[h]),2),v=g[0],y=g[1],b=O(c(0),2),C=b[0],w=b[1],k=O(c(!1),2),B=k[0],E=k[1],_=a({}),A=a([]),I=a(null),T=a(),P=a(null),R=Ag(),D=R.showPopup,N=R.popupShown,L=R.popupType,F=R.props,U=v.scannerType,V=v.title,j=v.titleIcon,z=v.cardSide,H=v.description,q=v.usePortraitMask,G=v.cardType,W=v.enableConfirmPopup,Q=o((function(e){e>=f.length||setTimeout((function(){m(e),y(f[e])}),200)}),[f]),X=o((function(){Q(h+1)}),[Q,h]),Y=o((function(){setTimeout((function(){y((function(e){return x(x({},e),$y)}))}),200)}),[]),Z=o((function(){D({popupType:null})}),[D]),$=o((function(){if(Z(),I.current=null,U===Yy.QR_CODE)Q(h);else if(U===Yy.ID_CARD){var e=null;P.current===Wy.FRONT?e=0:P.current===Wy.BACK&&(e=1),null!==e&&Q(e),T.current.restartSession()}}),[Q,h,Z,U]),J=o(S(regeneratorRuntime.mark((function e(){var t,n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={stepNumber:h,cardSide:z,cardType:G,image:_.current,recordedVideos:null!=r&&r.enableRecording?A.current:[]},(U===Yy.QR_CODE||null!==(t=I.current)&&void 0!==t&&t.result)&&(n.qrScannedResult=I.current),E(!0),e.next=5,l(n);case 5:(a=e.sent)?(P.current=a,E(!1)):(E(!1),I.current=null,X());case 7:case"end":return e.stop()}}),e)}))),[r,h,l,X,U,E,z,G]),ee=o((function(e){var r;if(I.current=e,e&&e.recordedVideos){var t,n=e.recordedVideos;(t=A.current).push.apply(t,M(n))}w((function(e){return e+1}));var a=Boolean(null==e||null===(r=e.validateResult)||void 0===r?void 0:r.valid);W?D({popupType:Tg,props:{hasValidQR:a,imageTaken:_.current}}):J()}),[D,W,J]),re=o(function(){var e=S(regeneratorRuntime.mark((function e(n){var a,o,c,u,l,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.image,o=n.error,c=n.recordedVideos,_.current=a,A.current=c,w((function(e){return e+1})),z!==K.IDCardSide.FRONT){e.next=28;break}if(!r.enableScanQr||!qs.isMobile){e.next=28;break}if(l=null==a||null===(u=a.detectedCard)||void 0===u?void 0:u.label){e.next=20;break}return E(!0),e.prev=9,e.next=12,i({image:a,cardType:G,cardSide:z});case 12:d=e.sent,l=d.card_label,e.next=19;break;case 16:e.prev=16,e.t0=e.catch(9),t(Xy.detect_id_card_error);case 19:E(!1);case 20:if(!l||!"vn.cccd_new.front".includes(l)){e.next=28;break}return E(!0),e.next=24,iy(_.current.blob,s);case 24:return(f=e.sent)?ee(f):Y(),E(!1),e.abrupt("return");case 28:W?D({popupType:Tg,props:{imageTaken:_.current,error:o}}):J();case 29:case"end":return e.stop()}}),e,null,[[9,16]])})));return function(r){return e.apply(this,arguments)}}(),[W,D,z,r,G,i,J,Y,t,ee,s,E]),te=o((function(){Z(),J()}),[J,Z]);return{numberOfCaptures:C,stepNumber:h,titleIcon:j,title:V,description:H,frontSide:z===Wy.FRONT,scannerType:U,usePortraitMask:q,shouldShowSpinner:B,handleQRCaptureDone:ee,handleIDCardCaptureDone:re,handleRestartSession:$,refIDCardReader:T,handleClickConfirm:te,showPopup:D,popupType:L,popupShown:N,popupProps:F}};var rb=function(){this.__data__=new ff,this.size=0};var tb=function(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t};var nb=function(e){return this.__data__.get(e)};var ab=function(e){return this.__data__.has(e)};var ob=function(e,r){var t=this.__data__;if(t instanceof ff){var n=t.__data__;if(!pf||n.length<199)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new kf(n)}return t.set(e,r),this.size=t.size,this};function ib(e){var r=this.__data__=new ff(e);this.size=r.size}ib.prototype.clear=rb,ib.prototype.delete=tb,ib.prototype.get=nb,ib.prototype.has=ab,ib.prototype.set=ob;var sb=ib;var cb=function(e,r,t){(void 0!==t&&!gl(e[r],t)||void 0===t&&!(r in e))&&ml(e,r,t)};var ub=function(e){return function(r,t,n){for(var a=-1,o=Object(r),i=n(r),s=i.length;s--;){var c=i[e?s:++a];if(!1===t(o[c],c,o))break}return r}}(),lb=Hs((function(e,r){var t=r&&!r.nodeType&&r,n=t&&e&&!e.nodeType&&e,a=n&&n.exports===t?Su.Buffer:void 0,o=a?a.allocUnsafe:void 0;e.exports=function(e,r){if(r)return e.slice();var t=e.length,n=o?o(t):new e.constructor(t);return e.copy(n),n}})),db=Su.Uint8Array;var fb=function(e){var r=new e.constructor(e.byteLength);return new db(r).set(new db(e)),r};var pb=function(e,r){var t=r?fb(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)};var hb=function(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r},mb=Object.create,gb=function(){function e(){}return function(r){if(!ku(r))return{};if(mb)return mb(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}();var vb=function(e){return"function"!=typeof e.constructor||Jl(e)?{}:gb(id(e))};var yb=function(e){return ju(e)&&xl(e)};var bb=function(e,r){if(("constructor"!==r||"function"!=typeof e[r])&&"__proto__"!=r)return e[r]};var Cb=function(e){return bl(e,nd(e))};var wb=function(e,r,t,n,a,o,i){var s=bb(e,t),c=bb(r,t),u=i.get(c);if(u)cb(e,t,u);else{var l=o?o(s,c,t+"",e,r,i):void 0,d=void 0===l;if(d){var f=jl(c),p=!f&&Kl(c),h=!f&&!p&&Xl(c);l=c,f||p||h?jl(s)?l=s:yb(s)?l=hb(s):p?(d=!1,l=lb(c,!0)):h?(d=!1,l=pb(c,!0)):l=[]:fd(c)||Vl(c)?(l=s,Vl(s)?l=Cb(s):ku(s)&&!Ju(s)||(l=vb(c))):d=!1}d&&(i.set(c,l),a(l,c,n,o,i),i.delete(c)),cb(e,t,l)}};var kb=function e(r,t,n,a,o){r!==t&&ub(t,(function(i,s){if(o||(o=new sb),ku(i))wb(r,t,s,n,e,a,o);else{var c=a?a(bb(r,s),i,s+"",r,t,o):void 0;void 0===c&&(c=i),cb(r,s,c)}}),nd)},Bb=Nl((function(e,r,t){kb(e,r,t)})),Eb={data:{settings:{sdk_settings:{id_detection_settings:{auto_capture:{enable:!1,show_capture_button:!0,wait_for_best_image_time_ms_web:1e3},blur_check:{enable:!0,threshold_web:.82},disable_capture_button_if_alert:!1,exif_data_settings:{enable:!0},id_detection:{enable:!0},limit_time_settings:{enable:!0,limit_time_second:30,video_partial_length_seconds:15},save_frame_settings:{enable:!1,frames_interval_ms:190,quality_web:80},scan_qr_settings:{enable:!0,limit_time_second:20},virtual_cam_hashes:{web:!1,mobile:!1}}}}}};function Sb(e){var r=e.clientSettings,t=O(c(null),2),n=t[0],a=t[1];return i((function(){var e=Bb(Eb,r),t=Pf(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.enable"),n=Pf(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.frames_interval_ms"),o=Pf(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.quality_web"),i=Pf(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.enable"),s=Pf(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.limit_time_second"),c=Pf(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.video_partial_length_seconds"),u=Pf(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.enable"),l=Pf(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.wait_for_best_image_time_ms_web"),d=Pf(e,"data.settings.sdk_settings.id_detection_settings.blur_check.enable"),f=Pf(e,"data.settings.sdk_settings.id_detection_settings.blur_check.threshold_web"),p=Pf(e,"data.settings.sdk_settings.id_detection_settings.disable_capture_button_if_alert"),h=Pf(e,"data.settings.sdk_settings.id_detection_settings.id_detection.enable"),m=Pf(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.enable"),g=Pf(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.limit_time_second"),v=Pf(e,"data.settings.sdk_settings.id_detection_settings.exif_data_settings.enable"),y=Pf(e,"data.settings.sdk_settings.id_detection_settings.virtual_cam_hashes.".concat(qs.isMobile?"mobile":"web")),b=Pf(e,"data.card_types[0].has_back_side",!0),C=Pf(e,"data.country","vi");a({enableRecording:t,frameCaptureIntervalMs:n,idCardSessionTime:s,maxRecordingTimePerVideo:c,saveFrameQuality:o,enableTimers:i,enableAutoCapture:u,waitForBestImageTimeMs:l,enableBlurCheck:d,blurThreshold:f,disableCaptureButtonIfAlert:p,enableIdDetection:h,enableScanQr:m,scanQrLimitTimeSecond:g,enableExifData:v,enableVirtualCamHashes:y,hasBackCard:b,country:C})}),[r]),{settings:n}}function _b(e){var t=e.logCredentials,n=e.clientSettings,a=e.uiOnlyComponent,o=e.onError,i=e.detectIdCard,s=e.outputEncryptionSettings,c=e.steps,u=e.onStepDone,l=Sb({clientSettings:n}).settings,d=I({},eb({settings:l,onError:o,detectIdCard:i,outputEncryptionSettings:s,steps:c,onStepDone:u}));return r.createElement(mg,null,r.createElement(Pn.SDKTrackingProvider,{value:{tracking:x({},t)}},r.createElement(a,I({},e,{settings:l,scannerTypeCons:Yy},d))))}var Ab={logCredentials:h.shape({}),clientSettings:h.shape({}),uiOnlyComponent:h.func,onError:h.func,onStepDone:h.func,steps:h.arrayOf(h.shape({})),detectIdCard:h.func,outputEncryptionSettings:h.shape({})};_b.propTypes=Ab,_b.defaultProps={logCredentials:void 0,clientSettings:void 0,uiOnlyComponent:Hy,onError:function(){},onStepDone:function(){},steps:void 0,detectIdCard:void 0,outputEncryptionSettings:null};var Ib=function(e){var t=I({},e),n=t.clientSettings,a=t.onError,i=t.onStepDone,s=t.logCredentials,c=t.uiOnlyComponent,u=t.detectIdCard,l=t.outputEncryptionSettings,d=t.steps,f=Sb({clientSettings:n}).settings,p=o(function(){var e=S(regeneratorRuntime.mark((function e(r){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i(x(x({},r),{},{restartSession:null==h?void 0:h.handleRestartSession}));case 2:return t=e.sent,e.abrupt("return",t);case 4:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[i,null==h?void 0:h.handleRestartSession]),h=I({},eb({settings:f,onError:a,detectIdCard:u,outputEncryptionSettings:l,steps:d,onStepDone:p}));return r.createElement(mg,null,r.createElement(Pn.SDKTrackingProvider,{value:{tracking:x({},s)}},r.createElement(c,I({},t,{onStepDone:p,settings:f,scannerTypeCons:Yy},h))))};function Tb(e){var t=e.sdkAdapter;return t instanceof js?r.createElement(Ib,x({sdkAdapter:t},e)):r.createElement(_b,e)}Ib.propTypes={clientSettings:h.shape({}),onError:h.func,onStepDone:h.func,logCredentials:h.shape({}),readIDCardUIOnlyComponent:h.func,uiOnlyComponent:h.func,sdkAdapter:h.shape({}),steps:h.arrayOf(h.shape({})),detectIdCard:h.func,outputEncryptionSettings:h.shape({})},Ib.defaultProps={clientSettings:void 0,onError:function(){},onStepDone:function(){},logCredentials:{enable:!0},readIDCardUIOnlyComponent:_b,uiOnlyComponent:Hy,sdkAdapter:null,steps:void 0,detectIdCard:void 0,outputEncryptionSettings:null};var xb={sdkAdapter:h.shape({})};Tb.propTypes=xb,Tb.defaultProps={sdkAdapter:null};var Pb=K.IDCardSide,Rb=K.Errors;function Db(e){return Nb.apply(this,arguments)}function Nb(){return(Nb=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.image,n=r.cardType,a=r.cardSide,o=r.apiClient,i=r.outputEncryptionSettings,s={label:"id_card.".concat(n,".").concat(a)},!i||!i.key){e.next=4;break}return e.abrupt("return",o.httpClient.post("/v1/images",x({base64:t.encrypted.hex},s),{"X-TV-Key":i.key}));case 4:return e.abrupt("return",o.uploadImage(x({file:t.blob},s)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Lb(e){return Ob.apply(this,arguments)}function Ob(){return(Ob=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.image,n=r.apiClient,a=r.rawString,o=r.outputEncryptionSettings,i={label:"qr_code",metadata:JSON.stringify({raw:a})},!o||!o.key){e.next=4;break}return e.abrupt("return",n.httpClient.post("/v1/images",x({base64:t.encrypted.hex},i),{"X-TV-Key":o.key}));case 4:return e.abrupt("return",n.uploadImage(x({file:t.blob},i)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Mb(e){return Fb.apply(this,arguments)}function Fb(){return(Fb=S(regeneratorRuntime.mark((function e(r){var t,n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.imageId,n=r.cardType,a=r.apiClient,e.abrupt("return",a.requestVerifyIDCard({card_type:n,image1:{id:t}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ub(e){return Vb.apply(this,arguments)}function Vb(){return(Vb=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,u,l,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.apiClient,n=r.cardType,a=r.frontCardId,o=r.isCapturingFrontSide,i=r.backCardId,s=r.recordedVideos,c=r.qrImageId,u=s.filter((function(e){return null!==e.id})),l=s.filter((function(e){return null===e.id&&e.frames.length>0})),e.next=5,Promise.all(l.map((function(e){return t.fileService.request({frames:e.frames})})));case 5:return d=e.sent,f={card_type:n,image:{id:a},image2:o?void 0:{id:i},videos:[].concat(M(u.map((function(e){return{id:e.id}}))),M(d.map((function(e){return{id:e.data.file_id}}))))},c&&(f.qr1_images=[{id:c}]),e.abrupt("return",t.detectIDTampering(f));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jb(e){return zb.apply(this,arguments)}function zb(){return(zb=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.cardType,n=r.apiClient,a=r.frontCardId,o=r.backCardId,i=r.isCapturingFrontSide,s=r.qrImageId,c={card_type:t,image1:i?{id:a}:{id:o}},s&&(c.qr1_images=[{id:s}]),e.abrupt("return",n.readIDCard(c));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Kb(e){return Hb.apply(this,arguments)}function Hb(){return(Hb=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,B,E,S;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.image,a=r.frontCardId,o=r.qrImageId,i=r.onError,s=r.recordedVideos,c=r.apiClient,u=r.cardType,l=r.cardSide,d=r.qrScannedResult,f=r.outputEncryptionSettings,l!==Pb.BACK||a){e.next=4;break}return i(Rb.missing_front_id_card),e.abrupt("return");case 4:return p=[Db({image:n,cardType:u,cardSide:l,apiClient:c,outputEncryptionSettings:f})],d&&d.image&&d.result&&p.push(Lb({image:d.image,apiClient:c,rawString:d.result,outputEncryptionSettings:f})),e.next=8,Promise.all(p);case 8:if(h=e.sent,m=O(h,2),g=m[0],v=m[1],!g.errors){e.next=15;break}return i(x(x({},Rb.upload_error),{},{details:g.errors})),e.abrupt("return");case 15:return y=g.data.image_id,b=(null==v||null===(t=v.data)||void 0===t?void 0:t.image_id)||o,(k=l===Pb.FRONT)?C=y:(C=a,w=y),e.next=21,Mb({imageId:y,cardType:u,apiClient:c});case 21:if(!(B=e.sent).errors){e.next=25;break}return i(x(x({},Rb.sanity_check_error),{},{details:B.errors})),e.abrupt("return");case 25:return e.next=27,jb({cardType:u,apiClient:c,frontCardId:C,backCardId:w,isCapturingFrontSide:k,qrImageId:b});case 27:if(!(E=e.sent).errors){e.next=31;break}return i(x(x({},Rb.read_id_card_error),{},{details:E.errors})),e.abrupt("return");case 31:return e.next=33,Ub({apiClient:c,cardType:u,frontCardId:C,isCapturingFrontSide:k,backCardId:w,recordedVideos:s,qrImageId:b});case 33:if(!(S=e.sent).errors){e.next=37;break}return i(x(x({},Rb.detect_id_tampering_error),{},{details:S.errors})),e.abrupt("return");case 37:return e.abrupt("return",{sanityResult:B.data,tamperingInfo:S.data,cardInfo:E.data,qrImageId:b});case 38:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var qb=["readIDCardUIOnlyComponent"],Gb=["onError","onStepDone","apiCredentials","logCredentials","outputEncryptionSettings"],Wb=K.Errors,Qb=function(e){var t=e.readIDCardUIOnlyComponent,n=N(e,qb),s=n.onError,u=n.onStepDone,l=n.apiCredentials,d=n.logCredentials,f=n.outputEncryptionSettings,p=N(n,Gb),h=O(c(null),2),m=h[0],g=h[1],v=Fo.useApiClient({apiCredentials:l,logCredentials:d}).apiClient,y=a(""),b=a("");i((function(){function e(){return(e=S(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v.clientSettings();case 2:r=e.sent,g(r);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[v]);var C=o(function(){var e=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.cardType,n=r.cardSide,a=r.recordedVideos,o=r.qrScannedResult,i=r.image,c=null,e.prev=2,e.next=5,Kb({image:i,cardSide:n,frontCardId:y.current,qrImageId:b.current,onError:s,apiClient:v,cardType:t,recordedVideos:a,qrScannedResult:o,outputEncryptionSettings:f});case 5:c=e.sent,n===K.IDCardSide.FRONT&&(y.current=c.cardInfo.image1.id),b.current=c.qrImageId,e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),s(x(x({},Wb.api_call_error),{},{details:e.t0}));case 13:c&&u(x(x({},r),{},{apiResult:c}));case 14:case"end":return e.stop()}}),e,null,[[2,10]])})));return function(r){return e.apply(this,arguments)}}(),[v,s,u,f]);return m&&r.createElement(t,I({logCredentials:d,onError:s,onStepDone:C,outputEncryptionSettings:f},p,{clientSettings:m}))};function Xb(){return(Xb=S(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=c.length>0&&void 0!==c[0]?c[0]:{},t=r.opencvUrl,n=r.idCardModelUrl,a=r.tfScriptUrls,o=r.blazefaceModelUrl,i=r.closeEyesModelUrl,s=new ev,e.prev=2,di.loadTensorFlow(a).then((function(){di.loadBlazefaceModel({modelUrl:o})})),e.next=6,Promise.all([Uf({closeEyesModelUrl:i}),s.loadResource({modelUrl:n}),Xg({url:t})]);case 6:e.next=10;break;case 8:e.prev=8,e.t0=e.catch(2);case 10:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}Qb.propTypes={onError:h.func,onStepDone:h.func,apiCredentials:h.shape({accessKey:h.string,secretKey:h.string,apiUrl:h.string}),logCredentials:h.shape({}),outputEncryptionSettings:h.shape({}),readIDCardUIOnlyComponent:h.func},Qb.defaultProps={onError:function(){},onStepDone:function(){},apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},logCredentials:{enable:!0},outputEncryptionSettings:{key:""},readIDCardUIOnlyComponent:Tb};var Yb=Ff((function(){return Xb.apply(this,arguments)})),Zb=function(){var e=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.blob,n=r.resultWarmup,a=n.idCardModel,o=n.ableToUseModel){e.next=4;break}return e.abrupt("return",{ableToUseModel:o});case 4:return e.next=6,So.blobToCanvas({blob:t});case 6:return i=e.sent,e.abrupt("return",a.predict(i,{detectThreshold:.3}));case 8:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),$b={id_card_sanity:3,portrait_sanity:3,face_liveness_with_card_tampering_ocr:3,compare_faces:3},Jb={card_sanity:!0,card_tampering:!0,card_ocr:!0,face_sanity:!0,face_liveness:!0,compare_faces:!0,search_face:!0,index_face:!0},eC="ID_CARD",rC="FACE_LIVENESS",tC="IDLE",nC={},aC={REACH_RETRY_LIMIT:{en:"You have reached the retry limit. Please try again later.",vi:"Bạn đã vượt quá số lần thử. Vui lòng thử lại sau."},FAIL_STEP:{en:"Please try again at step: <%= step %>.",vi:"Vui lòng thử lại ở bước: <%= step %>."},FAIL_FRONT_CARD_SANITY:{en:"The front side of your ID card failed sanity check.",vi:"Hình ảnh Mặt trước của GTTT không đạt chất lượng yêu cầu."},FAIL_FRONT_CARD_TAMPERING:{en:"The front side of your ID card failed tampering check.",vi:"Hình ảnh Mặt trước của GTTT không hợp lệ."},FAIL_FRONT_CARD_OCR:{en:"Cannot read information on the front side of your ID card.",vi:"Không đọc được thông tin từ hình ảnh Mặt trước của GTTT."},FAIL_BACK_CARD_SANITY:{en:"The back side of your ID card failed sanity check.",vi:"Hình ảnh Mặt sau của GTTT không đạt chất lượng yêu cầu."},FAIL_BACK_CARD_TAMPERING:{en:"The back side of your ID card failed tampering check.",vi:"Hình ảnh Mặt sau của GTTT không hợp lệ."},FAIL_BACK_CARD_OCR:{en:"Cannot read information on the back side of your ID card.",vi:"Không đọc được thông tin từ hình ảnh Mặt sau của GTTT."},FAIL_FACE_SANITY:{en:"Selfie step failed sanity check.",vi:"Hình ảnh khuôn mặt không đạt chất lượng yêu cầu."},FAIL_FACE_LIVENESS:{en:"Selfie step failed liveness check.",vi:"Hình ảnh khuôn mặt không hợp lệ."},FAIL_COMPARE_FACE:{en:"Failed compare faces between ID photo and selfie.",vi:"Hình ảnh khuôn mặt trên GTTT không giống hình chụp chân dung"},RETRY_BUTTON:{en:"Retry",vi:"Thử lại"},STOP_BUTTON:{en:"Stop",vi:"Dừng"},FRONT_CARD:{en:"Front Card",vi:"Mặt trước"},BACK_CARD:{en:"Back Card",vi:"Mặt sau"},ID_CARD:{en:"ID Card",vi:"Thẻ ID"},FACE_LIVENESS:{en:"Face Liveness",vi:"Nhận diện khuôn mặt"}},oC=Nl((function(e,r,t,n){kb(e,r,t,n)})),iC=["restartSession"],sC=["detectIDTamperingBackground","readIDCardBackground"],cC=["restartSession"],uC=["detectIDTamperingBackground","readIDCardBackground"];function lC(e){if(!function(e){return"object"===B(e)&&"function"==typeof e.then}(e))return"pending";var r={};return Promise.race([e,r]).then((function(e){return e===r?"pending":"fulfilled"}),(function(){return"rejected"}))}var dC,fC,pC,hC=function(e,r){return null===r?e:r},mC=function(e,r){if(!Pf(r,"face_sanity"))return!1;var t=Pf(e,"verifyFacePortraitResult.status",""),n=Pf(e,"verifyFacePortraitResult.portrait_sanity.verdict","");return"success"!==t||"good"!==n},gC=function(){var e=S(regeneratorRuntime.mark((function e(r,t,n){var a,o,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,B,E,S,_,A,I,T,P,R,D,N,L,O,M,F,U,V,j,z,K,H,q;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=!1,!Pf(t,"card_tampering")){e.next=29;break}return o=Pf(r.current,"frontCard.apiResult.detectIDTamperingBackground"),e.next=5,lC(o);case 5:if("fulfilled"!==e.sent){e.next=15;break}return e.next=9,Pf(r.current,"frontCard.apiResult.detectIDTamperingBackground");case 9:d=e.sent,f=d.result,p=d.message,h=bC(f,t),r.current=x(x({},r.current),{},{frontCard:x(x({},null!==(i=null===(s=r.current)||void 0===s?void 0:s.frontCard)&&void 0!==i?i:{}),{},{apiResult:x(x({},null!==(c=null===(u=r.current)||void 0===u||null===(l=u.frontCard)||void 0===l?void 0:l.apiResult)&&void 0!==c?c:{}),{},{tamperingInfo:x(x({},null==f?void 0:f.data),{},{message:Pf(p,h?"error":"success")})})})}),a=a||h;case 15:if(!n){e.next=29;break}return m=Pf(r.current,"backCard.apiResult.detectIDTamperingBackground"),e.next=19,lC(m);case 19:if("fulfilled"!==e.sent){e.next=29;break}return e.next=23,Pf(r.current,"backCard.apiResult.detectIDTamperingBackground");case 23:w=e.sent,k=w.result,B=w.message,E=bC(k,t),r.current=x(x({},r.current),{},{backCard:x(x({},null!==(g=null===(v=r.current)||void 0===v?void 0:v.backCard)&&void 0!==g?g:{}),{},{apiResult:x(x({},null!==(y=null===(b=r.current)||void 0===b||null===(C=b.backCard)||void 0===C?void 0:C.apiResult)&&void 0!==y?y:{}),{},{tamperingInfo:x(x({},null==k?void 0:k.data),{},{message:Pf(B,E?"error":"success")})})})}),a=a||E;case 29:if(!Pf(t,"card_ocr")){e.next=57;break}return S=Pf(r.current,"frontCard.apiResult.readIDCardBackground"),e.next=33,lC(S);case 33:if("fulfilled"!==e.sent){e.next=43;break}return e.next=37,Pf(r.current,"frontCard.apiResult.readIDCardBackground");case 37:R=e.sent,D=R.result,N=R.message,L="success"===Pf(D,"data.status",""),r.current=x(x({},r.current),{},{frontCard:x(x({},null!==(_=null===(A=r.current)||void 0===A?void 0:A.frontCard)&&void 0!==_?_:{}),{},{apiResult:x(x({},null!==(I=null===(T=r.current)||void 0===T||null===(P=T.frontCard)||void 0===P?void 0:P.apiResult)&&void 0!==I?I:{}),{},{cardInfo:x(x({},null==D?void 0:D.data),{},{message:Pf(N,L?"success":"error")})})})}),a=a||bC(D,t);case 43:if(!n){e.next=57;break}return O=Pf(r.current,"backCard.apiResult.readIDCardBackground"),e.next=47,lC(O);case 47:if("fulfilled"!==e.sent){e.next=57;break}return e.next=51,Pf(r.current,"backCard.apiResult.readIDCardBackground");case 51:z=e.sent,K=z.result,H=z.message,q="success"===Pf(K,"data.status",""),r.current=x(x({},r.current),{},{backCard:x(x({},null!==(M=null===(F=r.current)||void 0===F?void 0:F.backCard)&&void 0!==M?M:{}),{},{apiResult:x(x({},null!==(U=null===(V=r.current)||void 0===V||null===(j=V.backCard)||void 0===j?void 0:j.apiResult)&&void 0!==U?U:{}),{},{cardInfo:x(x({},null==K?void 0:K.data),{},{message:Pf(H,q?"success":"error")})})})}),a=a||bC(K,t);case 57:return e.abrupt("return",a);case 58:case"end":return e.stop()}}),e)})));return function(r,t,n){return e.apply(this,arguments)}}(),vC=function(e){var r=Pf(e,"verifyFaceLivenessResult.is_live",!1),t=Pf(e,"verifyFaceLivenessResult.status","");return!r||"success"!==t},yC=function(e,r){if(!Pf(r,"card_sanity"))return!1;var t=Pf(e,"apiResult.sanityResult.status",""),n=Pf(e,"apiResult.sanityResult.card_sanity.verdict","");return"success"!==t||"good"!==n},bC=function(e,r){return!!Pf(e,"errors")||(Pf(r,"card_tampering")&&Object.prototype.hasOwnProperty.call(null==e?void 0:e.data,"card_tampering")?"success"!==Pf(e,"data.status","")||"good"!==Pf(e,"data.card_tampering.verdict",""):!(!Pf(r,"card_ocr")||!Object.prototype.hasOwnProperty.call(null==e?void 0:e.data,"card_information"))&&"success"!==Pf(e,"data.status",""))},CC=function(e){var r,t=Pf(e,"compare_faces",[]);return"matched"!==(null===(r=t[0])||void 0===r?void 0:r.result)||1!==t.filter((function(e){return"matched"===(null==e?void 0:e.result)})).length||e.errors},wC=function(){var e=S(regeneratorRuntime.mark((function e(r,t,n){var a,o,i,s,c,u,l,d,f,p,h,m,g,v,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=!1,!Pf(t,"card_tampering")){e.next=18;break}return e.next=4,Pf(r.current,"frontCard.apiResult.detectIDTamperingBackground");case 4:if(o=e.sent,i=o.result,s=o.message,c=bC(i,t),a=a||c,r.current=x(x({},r.current),{},{frontCard:x(x({},r.current.frontCard),{},{apiResult:x(x({},r.current.frontCard.apiResult),{},{tamperingInfo:x(x({},null==i?void 0:i.data),{},{message:Pf(s,c?"error":"success")})})})}),!n){e.next=18;break}return e.next=13,Pf(r.current,"backCard.apiResult.detectIDTamperingBackground");case 13:u=e.sent,l=u.result,d=bC(l,t),a=a||d,r.current=x(x({},r.current),{},{backCard:x(x({},r.current.backCard),{},{apiResult:x(x({},r.current.backCard.apiResult),{},{tamperingInfo:x(x({},null==l?void 0:l.data),{},{message:Pf(s,d?"error":"success")})})})});case 18:if(!Pf(t,"card_ocr")){e.next=35;break}return e.next=21,Pf(r.current,"frontCard.apiResult.readIDCardBackground");case 21:if(f=e.sent,p=f.result,h=f.message,m="success"===Pf(p,"data.status",""),a=a||!m,r.current=x(x({},r.current),{},{frontCard:x(x({},r.current.frontCard),{},{apiResult:x(x({},r.current.frontCard.apiResult),{},{cardInfo:x(x({},null==p?void 0:p.data),{},{message:Pf(h,m?"success":"error")})})})}),!n){e.next=35;break}return e.next=30,Pf(r.current,"backCard.apiResult.readIDCardBackground");case 30:g=e.sent,v=g.result,y="success"===Pf(v,"data.status",""),a=a||!y,r.current=x(x({},r.current),{},{backCard:x(x({},r.current.backCard),{},{apiResult:x(x({},r.current.backCard.apiResult),{},{cardInfo:x(x({},null==v?void 0:v.data),{},{message:Pf(h,y?"success":"error")})})})});case 35:return e.abrupt("return",a);case 36:case"end":return e.stop()}}),e)})));return function(r,t,n){return e.apply(this,arguments)}}(),kC=function e(r){for(var t in r)"message"===t||"step"===t?delete r[t]:"object"===B(r[t])&&e(r[t]);return r},BC=function(){var e=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=kC(r.current),n=Pf(t,"frontCard",{}),n.restartSession,a=N(n,iC),o=Pf(t,"frontCard.apiResult",{}),o.detectIDTamperingBackground,o.readIDCardBackground,i=N(o,sC),s=Pf(t,"backCard",{}),s.restartSession,c=N(s,cC),u=Pf(t,"backCard.apiResult",{}),u.detectIDTamperingBackground,u.readIDCardBackground,l=N(u,uC),e.abrupt("return",x(x(x({},t),Pf(t,"frontCard",null)?{frontCard:x(x({},a),{},{apiResult:i})}:{}),Pf(t,"backCard",null)?{backCard:x(x({},c),{},{apiResult:l})}:{}));case 10:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),EC=function(e,r,t){var n=[];if(Pf(e,"frontCard.apiResult.sanityResult")&&"good"!==Pf(e,"frontCard.apiResult.sanityResult.card_sanity.verdict","")){var a=Pf(e,"frontCard.apiResult.sanityResult.message",null);null!=a&&a[t]?n.push(a[t]):n.push(aC.FAIL_FRONT_CARD_SANITY[t])}if(Pf(e,"frontCard.apiResult.tamperingInfo")&&"good"!==Pf(e,"frontCard.apiResult.tamperingInfo.card_tampering.verdict","")){var o=Pf(e,"frontCard.apiResult.tamperingInfo.message",null);null!=o&&o[t]?n.push(o[t]):n.push(aC.FAIL_FRONT_CARD_TAMPERING[t])}if(Pf(e,"frontCard.apiResult.cardInfo")&&"success"!==Pf(e,"frontCard.apiResult.cardInfo.status","")){var i=Pf(e,"frontCard.apiResult.cardInfo.message",null);null!=i&&i[t]?n.push(i[t]):n.push(aC.FAIL_FRONT_CARD_OCR[t])}if(Pf(e,"backCard.apiResult.sanityResult")&&"good"!==Pf(e,"backCard.apiResult.sanityResult.card_sanity.verdict","")){var s=Pf(e,"backCard.apiResult.sanityResult.message",null);null!=s&&s[t]?n.push(s[t]):n.push(aC.FAIL_BACK_CARD_SANITY[t])}if(Pf(e,"backCard.apiResult.tamperingInfo")&&"good"!==Pf(e,"backCard.apiResult.tamperingInfo.card_tampering.verdict","")){var c=Pf(e,"backCard.apiResult.tamperingInfo.message",null);null!=c&&c[t]?n.push(c[t]):n.push(aC.FAIL_BACK_CARD_TAMPERING[t])}if(Pf(e,"backCard.apiResult.cardInfo")&&"success"!==Pf(e,"backCard.apiResult.cardInfo.status","")){var u=Pf(e,"backCard.apiResult.cardInfo.message",null);null!=u&&u[t]?n.push(u[t]):n.push(aC.FAIL_BACK_CARD_OCR[t])}if(Pf(e,"faceLiveness.verifyFacePortraitResult")&&"good"!==Pf(e,"faceLiveness.verifyFacePortraitResult.portrait_sanity.verdict","")){var l=Pf(e,"faceLiveness.verifyFacePortraitResult.message",null);null!=l&&l[t]?n.push(l[t]):n.push(aC.FAIL_FACE_SANITY[t])}if(Pf(e,"faceLiveness.verifyFaceLivenessResult")&&!Pf(e,"faceLiveness.verifyFaceLivenessResult.is_live",!1)){var d=Pf(e,"faceLiveness.verifyFaceLivenessResult.message",null);null!=d&&d[t]?n.push(d[t]):n.push(aC.FAIL_FACE_LIVENESS[t])}if(Pf(e,"compareFaces",null)&&CC(Pf(e,"compareFaces"))){var f=Pf(e,"compareFaces.message",null);null!=f&&f[t]?n.push(f[t]):n.push(aC.FAIL_COMPARE_FACE[t])}return{retryAt:r,results:n}},SC=function(e){var r=Pf(e,"frontCard.apiResult.cardInfo.card_information",[]).find((function(e){return"id"===e.field}));return Pf(r,"value","")},_C=["livenessMode","sdkAdapter","onError","services","hasBackCard"],AC=K.Errors,IC=K.IDCardSide,TC=K.FaceDirection,xC=K.Mode;function PC(e){return RC.apply(this,arguments)}function RC(){return(RC=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,B,E,S,_,A,I,T,P,R,D,N,L,F,U,V,j,z,K,H,q,G;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=r.hasBackCard,o=r.stepResult,i=r.frontCardId,s=r.qrImageId,c=r.sdkAdapter,u=r.onError,l=r.checkFinishAndFailCardTamperingOrOCR,d=r.refEkycResult,f=r.handleFailCardTamperingOCRBackground,p=r.services,c instanceof js){e.next=3;break}return e.abrupt("return",o);case 3:if(h=o.cardSide,m=o.cardType,g=o.recordedVideos,v=o.qrScannedResult,y=o.image,h!==IC.BACK||i){e.next=7;break}return u(AC.missing_front_id_card),e.abrupt("return",!1);case 7:return b=c.uploadImage,C=c.uploadFiles,w=c.requestVerifyIDCard,k=c.detectIDTampering,B=c.readIDCard,E=[b({file:null==y?void 0:y.blob,label:"id_card.".concat(m,".").concat(h)})],v&&v.image&&v.result&&E.push(b({file:v.image.blob,label:"qr_code",rawString:v.result})),e.next=12,Promise.all(E);case 12:if(S=e.sent,_=O(S,2),A=_[0],I=_[1],!A.errors){e.next=19;break}return u(x(x({},AC.upload_error),{},{details:A.reason})),e.abrupt("return",!1);case 19:if(T=null==A||null===(t=A.data)||void 0===t?void 0:t.image_id,P=(null==I||null===(n=I.data)||void 0===n?void 0:n.image_data)||s,h===IC.FRONT?R=T:(R=i,D=T),N={qrImageId:P,frontCardId:R,backCardId:D},!Pf(p,"card_sanity")){e.next=32;break}return e.next=26,w({card_type:m,image1:{id:h===IC.FRONT?R:D}});case 26:if(L=e.sent,F=L.result,U=L.message,"good"===Pf(F,"data.card_sanity.verdict","")&&!F.errors){e.next=31;break}return e.abrupt("return",x(x({},o),{},{apiResult:x(x({},N),{},{sanityResult:x(x({},null==F?void 0:F.data),{},{message:Pf(U,"error")}),failSanity:!0})}));case 31:N=x(x({},N),{},{sanityResult:x(x({},null==F?void 0:F.data),{},{message:Pf(U,"success")})});case 32:if(h!==IC.BACK){e.next=40;break}if("function"!=typeof l||"function"!=typeof f){e.next=40;break}return e.next=36,l(d,p,a);case 36:if(!e.sent){e.next=40;break}return f(),e.abrupt("return",x(x({},o),{},{apiResult:x(x({},N),{},{failSanity:!0})}));case 40:if(!Pf(p,"card_tampering")){e.next=51;break}if(j=x({card_type:m,image:{id:R}},h===IC.FRONT?{image2:void 0,level:"1"}:{image2:{id:D},level:"concurrent"}),P&&(j.qr1_images=[{id:P}]),!(g.length>0)){e.next=50;break}return z=g.filter((function(e){return null!==e.id})),K=g.filter((function(e){return null===e.id&&e.frames.length>0})),e.next=48,Promise.all(K.map((function(e){return C({frames:e.frames})})));case 48:H=e.sent,j.videos=[].concat(M(z.map((function(e){return{id:e.id}}))),M(H.map((function(e){return{id:e.data.file_id}}))));case 50:V=k(j);case 51:return Pf(p,"card_ocr")&&(G={card_type:m,image1:h===IC.FRONT?{id:R}:{id:D}},P&&(G.qr1_images={id:P}),q=B(G)),e.abrupt("return",x(x({},o),{},{apiResult:x(x({},N),{},{detectIDTamperingBackground:V,readIDCardBackground:q})}));case 53:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function DC(e){return NC.apply(this,arguments)}function NC(){return(NC=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,B;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.stepResult,n=r.sdkAdapter,a=r.services,o=t.faceVerificationFlowData,i=t.captureFrameSettings,s=t.capturedFrames,c=n.uploadImage,u=n.verifyFaceLiveness,l=n.requestVerifyPortrait,d=o.current.steps,f=[],d.forEach((function(e){var r=e.name,t=e.image,n=e.frontalFaceImage;r!==TC.FRONTAL?f.push(c({file:t.blob,label:"portrait",metadata:JSON.stringify({gesture_score:t.leftRightScore,gesture:r})})):f.push(Promise.resolve({data:{image_id:null}})),n.blob?f.push(c({file:n.blob,label:"portrait",metadata:JSON.stringify({gesture_score:n.leftRightScore,gesture:TC.FRONTAL})})):f.push(Promise.resolve({data:{image_id:null}}))})),e.next=8,Promise.all(f);case 8:if(p=e.sent,d.forEach((function(e,r){e.image.imageId=p[2*r].data.image_id,e.frontalFaceImage.imageId=p[2*r+1].data.image_id})),0!==(h=d.filter((function(e){return e.frontalFaceImage.imageId}))).length){e.next=13;break}return e.abrupt("return",{error:"wrong_face_movement"});case 13:return e.next=15,ep();case 15:if(m=rp(i)){e.next=18;break}return e.abrupt("return",{error:"network_error"});case 18:if(g={frontalFaces:h.map((function(e){return{id:e.frontalFaceImage.imageId,blob:e.frontalFaceImage.blob}})),steps:d.filter((function(e){return e.image.imageId&&e.name!==TC.FRONTAL})).map((function(e){var r=e.name,t=e.image;return{name:r,blob:t.blob,id:t.imageId}})),capturedFrames:s},!Pf(a,"face_sanity")){e.next=28;break}return e.next=22,l({image:{id:h[h.length-1].frontalFaceImage.imageId}});case 22:if(v=e.sent,y=v.result,b=v.message,"good"===Pf(y,"data.portrait_sanity.verdict","")&&!Pf(y,"errors")){e.next=27;break}return e.abrupt("return",x(x({},g),{},{verifyFacePortraitResult:x(x({},y.data),{},{message:Pf(b,"error")})}));case 27:g=x(x({},g),{},{verifyFacePortraitResult:x(x({},y.data),{},{message:Pf(b,"success")})});case 28:if(!Pf(a,"face_liveness")){e.next=36;break}return e.next=31,u({images:h.map((function(e){return{id:e.frontalFaceImage.imageId}})),gesture_images:d.filter((function(e){return e.image.imageId&&e.name!==TC.FRONTAL})).map((function(e){return{gesture:e.name,images:[{id:e.image.imageId}]}})),videos:m});case 31:C=e.sent,w=C.result,k=C.message,B=Pf(w,"data.is_live"),g=x(x({},g),{},{verifyFaceLivenessResult:x(x({},w.data),{},{message:Pf(k,B?"success":"error")})});case 36:return e.abrupt("return",g);case 37:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function LC(e){return OC.apply(this,arguments)}function OC(){return(OC=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,u,l,d,f,p,h,m,g,v,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.stepResult,n=r.sdkAdapter,a=r.services,o=t.imageAddedExif,i=t.frontalFaceImages,s=t.capturedFrames,c=n.uploadImage,u=n.verifyFaceLiveness,l=n.requestVerifyPortrait,d=i.map((function(e,r){return c({file:o[r],label:"portrait",metadata:{gesture_score:e.leftRightScore,gesture:TC.FRONTAL}})})),e.next=6,Promise.all(d);case 6:if(f=e.sent,p=f.map((function(e){var r;return{id:null==e||null===(r=e.data)||void 0===r?void 0:r.image_id}})),h={images:p,capturedFrames:s,frontalFaces:o.map((function(e,r){var t;return{blob:e,id:null===(t=p[r])||void 0===t?void 0:t.id}}))},!Pf(a,"face_sanity")){e.next=17;break}return e.next=12,l({image:{id:p[p.length-1].id}});case 12:if(m=e.sent,g=m.result,"good"===Pf(g,"data.portrait_sanity.verdict","")&&!Pf(g,"errors")){e.next=16;break}return e.abrupt("return",x(x({},t),{},{verifyFacePortraitResult:g.data}));case 16:h=x(x({},h),{},{verifyFacePortraitResult:g.data});case 17:return e.next=19,u({images:p.map((function(e){return{id:e.id}}))});case 19:return v=e.sent,y=v.result,e.abrupt("return",x(x({},h),{},{verifyFaceLivenessResult:y.data}));case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function MC(e){return FC.apply(this,arguments)}function FC(){return(FC=S(regeneratorRuntime.mark((function e(r){var t,n,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.stepResult,n=r.sdkAdapter,a=r.services,(o=t.mode)!==xC.ACTIVE){e.next=4;break}return e.abrupt("return",DC({stepResult:t,sdkAdapter:n,services:a}));case 4:if(o!==xC.PASSIVE){e.next=6;break}return e.abrupt("return",LC({stepResult:t,sdkAdapter:n,services:a}));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function UC(e){return VC.apply(this,arguments)}function VC(){return(VC=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,B;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.livenessMode,n=r.sdkAdapter,r.onError,a=r.services,o=r.hasBackCard,i=N(r,_C),n instanceof js){e.next=3;break}return e.abrupt("return",i);case 3:if(s=n.compareFaces,c=n.searchFaces,u=n.indexFaces,l=Pf(r,"frontCard.apiResult.frontCardId",null),d=Pf(r,"backCard.apiResult.backCardId",null),f=null,p=Pf(r,"faceLiveness.frontalFaces",[]),f=null===(t=p[p.length-1])||void 0===t?void 0:t.id,l&&(!o||d)&&f){e.next=11;break}return e.abrupt("return");case 11:if(h=x({},i),!Pf(a,"compare_faces")){e.next=21;break}return e.next=15,s({image1:{id:l},image2:{id:f}});case 15:if(m=e.sent,g=m.result,v=m.message,!CC(Pf(g,"data"))){e.next=20;break}return e.abrupt("return",x(x({},h),{},{step:eC,compareFaces:x(x({},null==g?void 0:g.data),{},{message:v})}));case 20:h=x(x({},h),{},{compareFaces:x(x({},null==g?void 0:g.data),{},{message:v})});case 21:if(!Pf(a,"search_face")){e.next=30;break}return e.next=24,c({image:{id:f}});case 24:if(y=e.sent,b=y.result,!((C=Pf(b,"data.faces",null))||Array.isArray(C)&&C.length)){e.next=29;break}return e.abrupt("return",x(x({},h),{},{searchFaces:null==b?void 0:b.data}));case 29:h=x(x({},h),{},{searchFaces:null==b?void 0:b.data});case 30:if(!Pf(a,"index_face")){e.next=37;break}return w=SC(r),e.next=34,u({image:x({id:f},w?{metadata:JSON.stringify({id:SC(r)})}:{})});case 34:k=e.sent,B=k.result,h=x(x({},h),{},{indexFaces:null==B?void 0:B.data});case 37:return e.abrupt("return",h);case 38:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var jC,zC,KC=m.div(dC||(dC=L(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),HC=m.button(fC||(fC=L(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n background-color: #0276f1;\n border: 0;\n outline: none;\n border-radius: 0.25rem;\n color: #fff;\n font-weight: 400;\n cursor: pointer;\n font-size: 1rem;\n"]))),qC=m.div(pC||(pC=L(["\n margin: 20px 0;\n width: 100%;\n display: flex;\n justify-content: space-evenly;\n gap: 10px;\n"]))),GC=function(e){var t=e.onRetry,n=e.onStop,a=e.children,o=$t.useSDKSettings().lang;return r.createElement(KC,null,a,r.createElement(qC,null,r.createElement(HC,{onClick:n},aC.STOP_BUTTON[o]),r.createElement(HC,{onClick:t},aC.RETRY_BUTTON[o])))};GC.propTypes={children:h.node,onRetry:h.func,onStop:h.func},GC.defaultProps={children:null,onRetry:function(){},onStop:function(){}};var WC=m.div(jC||(jC=L(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),QC=m.button(zC||(zC=L(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n background-color: #0276f1;\n border: 0;\n outline: none;\n border-radius: 0.25rem;\n color: #fff;\n font-weight: 400;\n cursor: pointer;\n font-size: 1rem;\n"]))),XC=function(e){var t=e.onStop,n=e.children,a=$t.useSDKSettings().lang;return r.createElement(WC,null,n,r.createElement(QC,{onClick:t},aC.STOP_BUTTON[a]))};XC.propTypes={children:h.node,onStop:h.func},XC.defaultProps={children:null,onStop:function(){}};var YC="FAIL_CARD_SANITY",ZC="FAIL_FACE_SANITY",$C="FAIL_LIVENESS_TAMPERING_OCR_RETRY_ID",JC="FAIL_LIVENESS_TAMPERING_OCR_RETRY_FACE",ew="FAIL_COMPARE_FACES",rw="RESET_ACTIONS",tw="SET_STEP",nw={currentStep:null,readIdCardKey:0,faceLivenessKey:0,cardSanityTrials:-1,compareFacesTrials:-1,portraitSanityTrials:-1,faceLivenessCardTamperingOCRTrials:-1};function aw(e,r){switch(r.type){case YC:return x(x({},e),{},{cardSanityTrials:e.cardSanityTrials+1});case ZC:return x(x({},e),{},{portraitSanityTrials:e.portraitSanityTrials+1,faceLivenessKey:e.faceLivenessKey+1});case $C:return x(x({},e),{},{readIdCardKey:e.readIdCardKey+1,faceLivenessCardTamperingOCRTrials:e.faceLivenessCardTamperingOCRTrials+1,currentStep:eC});case JC:return x(x({},e),{},{faceLivenessKey:e.faceLivenessKey+1,faceLivenessCardTamperingOCRTrials:e.faceLivenessCardTamperingOCRTrials+1,currentStep:rC});case ew:return x(x({},e),{},{compareFacesTrials:e.compareFacesTrials+1,readIdCardKey:e.readIdCardKey+1,faceLivenessKey:e.faceLivenessKey+1,currentStep:eC});case tw:return x(x({},e),{},{currentStep:r.payload});case rw:return nw;default:return e}}var ow=K.IDCardSide,iw=K.Errors,sw={padding:50,paddingBottom:20},cw=function(e){var t=e.content,n=e.lang,a=e.isStopPopup,o=void 0!==a&&a;return r.createElement(r.Fragment,null,r.createElement("div",{style:sw},t.results.map((function(e,t){return r.createElement("div",{key:t},e)}))),o?null:r.createElement("div",{style:{padding:50,paddingBottom:0,color:"red"}},function(e,r){var t=Array.isArray(r)?r.map((function(r){return aC[r][e]})).join(", "):aC[r][e];return Kd(aC.FAIL_STEP[e])({step:t})}(n,t.retryAt)))};function uw(e){var t=$t.useSDKSettings().lang,s=e.onDoneEkyc,l=e.readIDCardProps,d=e.livenessDetectionProps,f=e.onError,p=e.onClose,h=e.sdkAdapter,m=e.flow,g=void 0===m?K.EkycFlow.FULL_FLOW:m,v=h.clientSettings,y=O(c(!1),2),b=y[0],C=y[1],w=O(c(!1),2),k=w[0],B=w[1],E=O(c(null),2),_=E[0],A=E[1],T=O(c(!1),2),P=T[0],R=T[1],D=O(u(aw,nw),2),N=D[0],L=D[1],M=N.currentStep,F=N.readIdCardKey,U=N.faceLivenessKey,V=N.cardSanityTrials,j=N.compareFacesTrials,z=N.portraitSanityTrials,H=N.faceLivenessCardTamperingOCRTrials,q=a(nC),G=a(),W=a(),Q=a(),X=a(""),Y=a(""),Z=n((function(){return function(e){var r=Pf(e,"data.settings.sdk_settings.sdk_adapter.services",null),t=Pf(e,"data.settings.sdk_settings.sdk_adapter.retries",null),n=oC(Jb,r,hC),a=oC($b,t,hC);return{cardSanityRetries:a.id_card_sanity,portraitSanityRetries:a.portrait_sanity,faceLivenessCardTamperingOCRRetries:a.face_liveness_with_card_tampering_ocr,compareFacesRetries:a.compare_faces,services:n}}(_)}),[_]),$=Z.cardSanityRetries,J=Z.portraitSanityRetries,ee=Z.faceLivenessCardTamperingOCRRetries,re=Z.compareFacesRetries,te=Z.services,ne=n((function(){return g===K.EkycFlow.FULL_FLOW||g===K.EkycFlow.ID_CARD}),[g]),ae=n((function(){return g===K.EkycFlow.FULL_FLOW||g===K.EkycFlow.FACE}),[g]),oe=Pf(_,"data.card_types[0].has_back_side",!0),ie=2===Pf(l,"steps",[]).length||oe;i((function(){function e(){return(e=S(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v();case 2:r=e.sent,A(r);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[v,h]),i((function(){L(ne?{type:tw,payload:eC}:{type:tw,payload:rC})}),[ne]),i((function(){(V>=$||z>=J||j>=re||H>=ee)&&B(!0)}),[$,V,j,re,J,z,ee,H,s]);var se=o((function(){L({type:"RESET_ACTIONS"}),C(!1),B(!1),q.current=nC,G.current=null,W.current=null}),[]);i((function(){return function(){return se()}}),[se]);var ce=o((function(){V+1<$?(W.current=EC(q.current,eC,t),G.current=function(){L({type:YC}),R(!1),"function"==typeof Q.current&&Q.current()},C(!0)):B(!0)}),[$,V,t]),ue=o((function(){H+1<ee?(W.current=EC(q.current,eC,t),G.current=function(){L({type:$C}),R(!1)},C(!0)):B(!0)}),[ee,H,t]),le=o((function(){z+1<J?(W.current=EC(q.current,rC,t),G.current=function(){L({type:ZC}),R(!1)},C(!0)):B(!0)}),[J,z,t]),de=o((function(e,r){H+1<ee?(W.current=EC(q.current,e,t),G.current=e===eC?function(){L({type:$C}),r||(q.current=nC)}:function(){L({type:JC})},C(!0)):B(!0)}),[ee,H,t]),fe=o((function(){j+1<re?(W.current=EC(q.current,[eC,rC],t),G.current=function(){L({type:ew}),q.current=nC,R(!1)},C(!0)):B(!0)}),[re,j,t]),pe=o(function(){var e=S(regeneratorRuntime.mark((function e(r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!ne){e.next=6;break}return e.next=3,wC(q,te,ie);case 3:if(!e.sent){e.next=6;break}return e.abrupt("return",eC);case 6:if(!r){e.next=8;break}return e.abrupt("return",rC);case 8:return e.abrupt("return",!1);case 9:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[ne,te,ie]),he=o(S(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,UC(x(x({},q.current),{},{livenessMode:d.mode,sdkAdapter:h,onError:f,services:te,hasBackCard:ie}));case 3:if(!(r=e.sent)){e.next=12;break}if(q.current=x(x({},q.current),r),!Pf(r,"step",null)){e.next=10;break}fe(),e.next=12;break;case 10:return BC(q).then((function(e){s(e)})),e.abrupt("return");case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(0),f(x(x({},iw.api_call_error),{},{details:e.t0}));case 17:case"end":return e.stop()}}),e,null,[[0,14]])}))),[ie,d.mode,h,f,te,fe,s]),me=o(function(){var e=S(regeneratorRuntime.mark((function e(r){var t,n,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"==typeof Pf(r,"restartSession")&&(Q.current=r.restartSession),R(!0),M!==eC){e.next=62;break}if(Pf(r,"cardSide")!==ow.FRONT){e.next=33;break}return e.next=6,PC({stepResult:r,frontCardId:X.current,qrImageId:Y.current,onError:f,sdkAdapter:h,services:te});case 6:if(!(t=e.sent)){e.next=12;break}X.current=t.apiResult.frontCardId,Y.current=t.apiResult.qrImageId,e.next=14;break;case 12:return R(!1),e.abrupt("return",!0);case 14:if(q.current=x(x({},q.current),{},{frontCard:t}),!yC(t,te)){e.next=18;break}return ce(),e.abrupt("return",ow.FRONT);case 18:if(ie){e.next=31;break}if(!ae){e.next=23;break}L({type:tw,payload:rC}),e.next=31;break;case 23:return e.next=25,wC(q,te,ie);case 25:if(!e.sent){e.next=29;break}return ue(),e.abrupt("return");case 29:return BC(q).then((function(e){s(e)})),e.abrupt("return");case 31:e.next=60;break;case 33:if(Pf(r,"cardSide")!==ow.BACK){e.next=60;break}return e.next=36,gC(q,te,ie);case 36:if(!e.sent){e.next=41;break}ue(),e.next=60;break;case 41:return e.next=43,PC({hasBackCard:ie,stepResult:r,frontCardId:X.current,qrImageId:Y.current,sdkAdapter:h,onError:f,refEkycResult:q,services:te,checkFinishAndFailCardTamperingOrOCR:gC,handleFailCardTamperingOCRBackground:ue});case 43:if(n=e.sent,q.current=x(x({},q.current),{},{backCard:n}),!yC(n,te)){e.next=48;break}return ce(),e.abrupt("return",ow.BACK);case 48:if(!ae){e.next=52;break}L({type:tw,payload:rC}),e.next=60;break;case 52:return e.next=54,wC(q,te,ie);case 54:if(!e.sent){e.next=58;break}return ue(),e.abrupt("return");case 58:return BC(q).then((function(e){s(e)})),e.abrupt("return");case 60:e.next=89;break;case 62:if(M!==rC){e.next=89;break}if(!ne){e.next=77;break}return e.next=66,gC(q,te,ie);case 66:if(!e.sent){e.next=70;break}return ue(),R(!1),e.abrupt("return");case 70:return e.next=72,wC(q,te,ie);case 72:if(!e.sent){e.next=77;break}return L({type:$C}),R(!1),e.abrupt("return");case 77:return e.next=79,MC({stepResult:r,sdkAdapter:h,services:te});case 79:if(a=e.sent,q.current=x(x({},q.current),{},{faceLiveness:a}),!mC(a,te)){e.next=85;break}le(),e.next=89;break;case 85:return e.next=87,pe(vC(a));case 87:(o=e.sent)?de(o,!vC(a)):ne?he():BC(q).then((function(e){s(e)}));case 89:R(!1);case 90:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[ie,te,M,h,ne,ae,s,f,ce,ue,le,pe,he,de]),ge=o((function(){C(!1),G.current()}),[]),ve=o((function(){C(!1),B(!1),BC(q).then((function(e){s(e),L({type:tw,payload:tC})}))}),[s]);return r.createElement(r.Fragment,null,M===eC?r.createElement(Tb,I({},l,e,{onStepDone:me,sdkAdapter:h,onError:f,onClose:p,clientSettings:_,key:F,isLoading:P})):null,M===rC?r.createElement(vg,I({},d,e,{onLivenessDetectionDone:me,sdkAdapter:h,onError:f,onClose:p,clientSettings:_,key:U,isLoading:P})):null,r.createElement(zp,{open:b||k},b&&r.createElement(GC,{onRetry:ge,onStop:ve},r.createElement(cw,{content:W.current,lang:t})),k&&r.createElement(XC,{onStop:ve},r.createElement(cw,{content:W.current,lang:t,isStopPopup:!0}))))}function lw(e){var t=e.logCredentials,n=e.ekycFlowComponent;return r.createElement(mg,null,r.createElement(Pn.SDKTrackingProvider,{value:{tracking:x({},t)}},r.createElement(n,e)))}uw.propTypes={sdkAdapter:h.shape({}),onDoneEkyc:h.func,onError:h.func,onClose:h.func,readIDCardProps:h.shape({}),livenessDetectionProps:h.shape({})},uw.defaultProps={sdkAdapter:null,onDoneEkyc:function(){},onError:function(){},onClose:function(){},readIDCardProps:{},livenessDetectionProps:{}},lw.propTypes={logCredentials:h.shape({}),clientSettings:h.shape({}),ekycFlowComponent:h.func},lw.defaultProps={logCredentials:void 0,clientSettings:void 0,ekycFlowComponent:uw};var dw,fw=function(e){var t=e.className;return r.createElement("svg",{className:t,width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.createElement("circle",{cx:"48",cy:"48",r:"45",stroke:"#0276F1",strokeWidth:"6"}),r.createElement("path",{d:"M27.9314 34.8653C27.9314 32.9955 29.4472 31.4797 31.317 31.4797C33.1868 31.4797 34.7026 32.9955 34.7026 34.8653V41.6365C34.7026 43.5063 33.1868 45.0221 31.317 45.0221C29.4472 45.0221 27.9314 43.5063 27.9314 41.6365V34.8653Z",fill:"#0276F1"}),r.createElement("path",{d:"M61.7878 34.8653C61.7878 32.9955 63.3036 31.4797 65.1734 31.4797C67.0432 31.4797 68.559 32.9955 68.559 34.8653V41.6365C68.559 43.5063 67.0432 45.0221 65.1734 45.0221C63.3036 45.0221 61.7878 43.5063 61.7878 41.6365V34.8653Z",fill:"#0276F1"}),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M48.2455 31.2466C50.2428 31.2466 51.8619 32.8657 51.8619 34.863V50.0982C51.8619 53.9653 48.727 57.1003 44.8599 57.1003H43.1671C41.1698 57.1003 39.5506 55.4811 39.5506 53.4838C39.5506 51.4865 41.1698 49.8674 43.1671 49.8674H44.629V34.863C44.629 32.8657 46.2482 31.2466 48.2455 31.2466Z",fill:"#0276F1"}),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M64.642 59.7309C65.8682 61.3075 65.5842 63.5796 64.0076 64.8058C57.154 70.1364 50.3848 71.402 44.6352 70.566C39.029 69.7509 34.6106 66.9737 32.1453 64.5084C30.733 63.0961 30.733 60.8063 32.1453 59.3939C33.5576 57.9816 35.8474 57.9816 37.2597 59.3939C38.7443 60.8785 41.7742 62.8411 45.6759 63.4084C49.4342 63.9549 54.2325 63.2456 59.567 59.0965C61.1436 57.8703 63.4157 58.1543 64.642 59.7309Z",fill:"#0276F1"}))};fw.defaultProps={className:""},fw.propTypes={className:h.string};var pw=m.button(dw||(dw=L(["\n background-color: #0276f1;\n color: white;\n text-align: center;\n border-radius: 25px;\n outline: none;\n padding: 12px 93px;\n border: none;\n cursor: pointer;\n"]))),hw={en:{face_authentication:"Face authentication",hold_still:"Hold still",uploading:"Uploading",start:"Start",continue:"Continue",retry:"Retry","face_authentication.successful":"Successful face authetication","face_authentication.unsuccessful":"Unsuccessful face authetication",move_face_into_frame:"Fit your face into the oval",face_not_found:"No face detected",processing_result:"Processing result",please_move_face_into_center_frame:"Face is not in the center of the oval",please_move_face_closer:"Face is too small",please_move_face_farther:"Face is too big",please_open_your_eyes:"Please open your eyes",please_look_straight_at_the_camera:"Please look straight at the camera",please_only_one_face:"Multiple faces detected",please_move_face_down:"Please move your face down","timeout.remaining":"Remaining time: <%= remain %> seconds","timeout.expired":"You need to complete within <%= timeout %> seconds. Please try again."},vi:{face_authentication:"Xác thực khuôn mặt",hold_still:"Giữ yên",uploading:"Đang tải lên",start:"Bắt đầu",continue:"Tiếp tục",retry:"Thử lại","face_authentication.successful":"Xác thực khuôn mặt thành công","face_authentication.unsuccessful":"Xác thực khuôn mặt không thành công",move_face_into_frame:"Đưa mặt vào khung",face_not_found:"Không tìm thấy khuôn mặt",processing_result:"Đang xử lý kết quả",please_move_face_into_center_frame:"Đưa khuôn mặt vào giữa hình oval",please_move_face_closer:"Khuôn mặt quá nhỏ",please_move_face_farther:"Khuôn mặt quá to",please_open_your_eyes:"Vui lòng mở to mắt",please_look_straight_at_the_camera:"Nhìn thẳng vào camera",please_only_one_face:"Có nhiều mặt trong khung hình",please_move_face_down:"Vui lòng đưa khuôn mặt xuống một chút","timeout.remaining":"Thời gian còn lại: <%= remain %> giây","timeout.expired":"Bạn cần hoàn thành trong <%= timeout %> giây. Xin vui lòng thử lại."}},mw=p({}),gw=function(e){var t,n=e.lang,a=e.children;return r.createElement(mw.Provider,{value:null!==(t=hw[n])&&void 0!==t?t:hw.vi},a)};gw.propTypes={lang:h.oneOf(["en","vi"]).isRequired,children:h.node.isRequired};var vw,yw,bw,Cw,ww=function(){var e=t(mw);return o((function(r,t){var n,a;return t?Kd(null!==(n=e[r])&&void 0!==n?n:r)(t):null!==(a=e[r])&&void 0!==a?a:r}),[e])},kw=m.div(vw||(vw=L(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n\n background-color: white;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n"]))),Bw=v(["0%{box-shadow:0 0 0 0 rgba(231,241,255,0.8);}80%{box-shadow:0 0 0 30px rgba(231,241,255,0);}100%{box-shadow:0 0 0 0 rgba(231,241,255,0);}"]),Ew=m.div(yw||(yw=L(["\n width: 160px;\n height: 160px;\n\n border-radius: 50%;\n\n display: grid;\n place-items: center;\n\n box-shadow: 0 0 0 0 rgba(0, 0, 0, 1);\n\n background-color: #d9e8ff;\n\n animation: "," 1s infinite;\n\n margin-block-end: 48px;\n"])),Bw),Sw=m.h2(bw||(bw=L(["\n color: #1d1d1d;\n font-weight: 700;\n font-size: 24px;\n margin: 0;\n margin-block-end: 8px;\n"]))),_w=m.p(Cw||(Cw=L(["\n font-weight: 400;\n font-size: 16px;\n color: #5e5e5e;\n text-align: center;\n\n margin: 0;\n margin-block-end: 16px;\n"]))),Aw=function(e){var t=e.onStart,n=ww();return r.createElement(kw,null,r.createElement(Ew,null,r.createElement(fw,null)),r.createElement(Sw,null,n("face_authentication")),r.createElement(_w,null,n("please_move_face_into_center_frame")),r.createElement(pw,{onClick:t},n("start")))};Aw.propTypes={onStart:function(){}},Aw.defaultProps={onStart:function(){}};var Iw=0,Tw=1,xw=2,Pw=3,Rw=4,Dw=5,Nw="far_face",Lw="close_face",Ow="flashing";function Mw(){return(Mw=S(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c,u=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=u.length>0&&void 0!==u[0]?u[0]:{},t=r.tfScriptUrls,n=r.closeEyesModelUrl,a=new Ns(n),e.next=4,di.loadTensorFlow(t);case 4:return e.next=6,di.initTensorFlow({preferredBackends:["wasm","cpu"]});case 6:return o=[di.loadFaceDetectionModel({detectorConfig:{runtime:"mediapipe",solutionPath:"https://cdn.jsdelivr.net/npm/@mediapipe/face_detection"}}),a.load()],e.next=9,Promise.all(o);case 9:return i=e.sent,s=O(i,1),c=s[0].faceDetector,e.abrupt("return",{faceDetector:c,closeEyesModel:a});case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Fw=Ff((function(){return Mw.apply(this,arguments)})),Uw=function(e){var r=e.width,t=e.height,n=e.cameraScale,a=e.debug,o=O(c(null),2),s=o[0],u=o[1];return i((function(){var e=document.createElement("canvas");e.width=r,e.height=t;var o=e.getContext("2d");return o.translate(r,0),o.scale(-1*n,1*n),a&&(document.body.appendChild(e),e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.zIndex="9999"),u(e),function(){a&&document.body.removeChild(e)}}),[n,a,t,r]),s},Vw=function(e){switch(e){case"partial_face":case"no_face":case"face_out_of_box":return"face_not_found";case"face_too_small":return"please_move_face_closer";case"face_too_large":return"please_move_face_farther";case"eye_close":return"please_open_your_eyes";case"face_not_frontal":return"please_look_straight_at_the_camera";case"multiple_faces":return"please_only_one_face";case"face_too_high":return"please_move_face_down";default:return""}},jw=function(e,r){var t=e.getContext("2d");t.clearRect(0,0,e.width,e.height),t.beginPath(),t.lineWidth="1",t.strokeStyle="red",t.rect(0,0,e.width,e.height),t.stroke(),t.closePath(),Object.entries(r).forEach((function(e,r){var n=O(e,2),a=n[0],o=n[1];t.beginPath(),t.fillStyle="red",t.font="16px",t.fillText("".concat(a,": ").concat(o),10,20+20*r),t.closePath()}))},zw=p(!1),Kw=function(e){var t=e.children,n=e.debug;return r.createElement(zw.Provider,{value:n},t)};Kw.defaultProps={debug:!1,children:null},Kw.propTypes={debug:h.bool,children:h.node};var Hw=function(e,r,t){var n=e.getContext("2d");n.strokeStyle=t,n.lineWidth=2,n.beginPath(),n.rect(r.x,r.y,r.width,r.height),n.stroke(),n.closePath()},qw=function(e,r){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e.getContext("2d"),a=e.width;n.strokeStyle="blue",n.fillStyle="blue",n.lineWidth=2,r.forEach((function(e){e.landmarks.forEach((function(e){n.beginPath(),n.arc(t?a-e[0]:e[0],e[1],2,0,2*Math.PI),n.fill(),n.closePath()})),n.beginPath();var r={x:t?a-e.bottomRight[0]:e.bottomRight[0],y:e.topLeft[1],width:e.bottomRight[0]-e.topLeft[0],height:e.bottomRight[1]-e.topLeft[1]};n.rect(r.x,r.y,r.width,r.height),n.stroke(),n.closePath()}))};function Gw(e){var r=e.cameraScale,s=void 0===r?1:r,u=e.warmupUrls,l=e.isVideoPlaying,d=e.step,f=e.cropArea,p=e.videoRef,h=e.onCloseFaceDetected,m=e.onMovingCloseFace,g=e.onFarFaceDetected,v=e.onFarFullFaceDetected,y=e.onFlashingFramesCaptured,b=e.frameInterval,C=void 0===b?180:b,w=e.useFaceDetectorWhenFlashing,k=e.onFaceError,B=e.onError,E=e.faceSettings,_=e.ovalBoundingRect,A=e.ovalPadding,I=e.isOvalTransitioning,T=e.chinToMaskBottomPadding,x=e.closeEyesSettings,P=x.enable,R=x.timeout,D=t(zw),N=function(e){var r=e.cropArea;return n((function(){var e=r.width,t=r.height,n=e/400,a=t/400,o=Math.max(n,a);return{width:e/o,height:t/o}}),[r])}({cropArea:f}),L=function(e){var r=e.cropArea,t=e.ovalBoundingRect,a=e.ovalPadding;return n((function(){var e,n,o,i,s=r.width,c=r.height,u=r.x,l=r.y,d=s/400,f=c/400,p=Math.max(d,f),h=s/p,m=c/p,g=null!==(e=null==t?void 0:t.left)&&void 0!==e?e:0,v=null!==(n=null==t?void 0:t.top)&&void 0!==n?n:0,y=null!==(o=null==t?void 0:t.right)&&void 0!==o?o:s,b=null!==(i=null==t?void 0:t.bottom)&&void 0!==i?i:c;return{left:Math.max((g-u)/p-a.left,0),right:Math.min((y-u)/p+a.right,h-0),top:Math.max((v-l)/p-a.top,0),bottom:Math.min((b-l)/p+a.bottom,m-0)}}),[r,null==t?void 0:t.bottom,null==t?void 0:t.left,null==t?void 0:t.right,null==t?void 0:t.top,a.bottom,a.left,a.right,a.top])}({cropArea:f,ovalBoundingRect:_,ovalPadding:A}),M=E.minFarFaceRatio,F=E.maxFarFaceRatio,U=E.closeFaceRatio,V=Uw({width:N.width,height:N.height,cameraScale:s,debug:!1}),j=Uw({width:N.width,height:N.height,cameraScale:s,debug:D}),z=function(e){var r=e.width,t=e.height,o=a(null),s=n((function(){var e=document.createElement("canvas");return e.width=r,e.height=t,e.style.position="fixed",e.style.bottom="0",e.style.left="0",e.style.zIndex="99999",o.current=e,document.body.appendChild(e),e}),[t,r]);return i((function(){return function(){document.body.removeChild(o.current)}}),[]),s}({width:160,height:150,cameraScale:s}),K=function(e){var r=e.videoRef,t=e.cropArea;return n((function(){return r.current?0===Object.keys(t).length?{}:ca.analyzeVideoAndWindowSizes(r.current,t):{}}),[r,t])}({videoRef:p,cropArea:f}),H=function(e,r){var t=O(c({}),2),n=t[0],a=t[1],o=Object.keys(n).length>0;return i((function(){var t=!1;return function(){var n=S(regeneratorRuntime.mark((function n(){var o;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,Fw(e);case 3:if(o=n.sent,!t){n.next=6;break}return n.abrupt("return");case 6:a(o),n.next=13;break;case 9:n.prev=9,n.t0=n.catch(0),r({error:n.t0}),console.error(n.t0);case 13:case"end":return n.stop()}}),n,null,[[0,9]])})));return function(){return n.apply(this,arguments)}}()(),function(){t=!0}}),[o,e,r]),[n,o]}(u,B),q=O(H,2),G=q[0],W=q[1],Q=a(null),X=function(e){var r=e.timeout,t=a(null),n=o((function(){t.current=performance.now()}),[]),i=o((function(){return null===t.current?(n(),!1):performance.now()-t.current>r}),[n,r]);return{markTime:n,checkIfEllapsed:i}}({timeout:1e3*R}),Y=X.markTime,Z=X.checkIfEllapsed,$=W&&l,J=O(c(""),2),ee=J[0],re=J[1],te=G.closeEyesModel,ne=G.faceDetector,ae=n((function(){return Zu(re,500)}),[]),oe=o(function(){var e=S(regeneratorRuntime.mark((function e(r,t){var n,a,o,i,c,u,l,f,b,C,E,S,_,A,x,R,O,V,K,H,q,G,W,Q,X;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,0!==(null==t?void 0:t.width)&&0!==(null==t?void 0:t.height)){e.next=3;break}return e.abrupt("return");case 3:if(null!==p.current){e.next=5;break}return e.abrupt("return");case 5:if(!I){e.next=7;break}return e.abrupt("return");case 7:if(n=r.cropX,a=r.cropY,o=r.cropWidth,i=r.cropHeight,t.getContext("2d").drawImage(p.current,n,a,o,i,(o-o*s)/2/s,(i-i*s)/2/s,N.width,N.height),D&&j.getContext("2d").drawImage(p.current,n,a,o,i,(o-o*s)/2/s,(i-i*s)/2/s,N.width,N.height),w||d!==Pw){e.next=14;break}return"function"==typeof y&&y(null,t,null),e.abrupt("return");case 14:return e.next=16,ne.estimateFaces(t);case 16:return c=e.sent,u=Ea.faceDetectorToBlazefacePredictions(c),e.next=20,Ea.validatePredictions({predictions:u,width:N.width,height:N.height});case 20:return l=e.sent,f=l.fullFace,b=l.ratio,e.next=25,Ea.validatePredictions({predictions:u,cropAreaCoordinates:[[L.left,L.top],[L.right,L.bottom]]});case 25:if(C=e.sent,E=C.error,S=C.fullFace,_=C.faceRatio,D&&(Hw(j,{x:L.left,y:L.top,width:L.right-L.left,height:L.bottom-L.top},"red"),qw(j,u,!0)),A="frontal",!S){e.next=36;break}return e.next=34,Ea.calculateFaceDirection({landmarks:S.landmarks});case 34:R=e.sent,A=null!==(x=null==R?void 0:R.gesture)&&void 0!==x?x:"";case 36:if(f&&d===Tw&&"function"==typeof g&&g(u[0],t,f.landmarks),f&&d===xw&&"function"==typeof m&&m(u[0],t,f.landmarks),O=null==E?void 0:E.code,e.prev=39,"no_face"!==O){e.next=42;break}throw new Error("no_face");case 42:if(!("multiple_faces"===O||u.length>1)){e.next=47;break}if(V=Ea.calculateFaceArea(u[0]),K=Ea.calculateFaceArea(u[1]),!(V<=2*K)){e.next=47;break}throw new Error("multiple_faces");case 47:if("frontal"===A){e.next=49;break}throw new Error("face_not_frontal");case 49:if(d!==Tw){e.next=54;break}if(!(_>F)){e.next=52;break}throw new Error("face_too_large");case 52:if(!(_<M)){e.next=54;break}throw new Error("face_too_small");case 54:if(d!==xw){e.next=57;break}if(!(_<U)){e.next=57;break}throw new Error("face_too_small");case 57:if(!(Array.isArray(u)&&u.length>0&&L.bottom-u[0].bottomRight[1]>T)){e.next=59;break}throw new Error("face_too_high");case 59:if("face_out_of_box"!==O){e.next=66;break}if(d!==Tw){e.next=63;break}if(!(_>=M&&_<=F)){e.next=63;break}throw new Error("");case 63:if(d!==xw){e.next=66;break}if(!(_>=U)){e.next=66;break}throw new Error("");case 66:e.next=71;break;case 68:e.prev=68,e.t0=e.catch(39),O=e.t0.message;case 71:if(!P){e.next=81;break}if(O){e.next=80;break}return e.next=75,te.predict(t,f.landmarks);case 75:H=e.sent,q=Z(),H.isEyeClose&&!q&&(O="eye_close"),e.next=81;break;case 80:Y();case 81:if(D&&jw(z,{ratio:null!==(G=null==b?void 0:b.toFixed(3))&&void 0!==G?G:"undefined",error:O,ovalFaceRatio:null!==(W=null==_?void 0:_.toFixed(3))&&void 0!==W?W:"undefined",ovalError:null!==(Q=null==E?void 0:E.code)&&void 0!==Q?Q:"undefined",step:d===Tw?"far":"close"}),X=Vw(O),ae(X),!X){e.next=87;break}return"function"==typeof k&&k({error:O,currentStep:d}),e.abrupt("return");case 87:f&&d===Tw&&M<=_&&_<=F&&"function"==typeof g&&v(u[0],t,f.landmarks),f&&d===xw&&_>=U&&"function"==typeof h&&h(u[0],t,f.landmarks),f&&d===Pw&&_>=U&&"function"==typeof y&&y(u[0],t,f.landmarks),e.next=96;break;case 92:e.prev=92,e.t1=e.catch(0),console.error(e.t1),B({error:e.t1});case 96:case"end":return e.stop()}}),e,null,[[0,92],[39,68]])})));return function(r,t){return e.apply(this,arguments)}}(),[j,z,D,p,I,s,N.width,N.height,d,ne,L.left,L.top,L.right,L.bottom,ae,M,F,U,y,g,k,v,m,h,B,T,w,P,te,Z,Y]);return i((function(){var e=null,r=!1;return $&&function t(){e=requestAnimationFrame(function(){var e=S(regeneratorRuntime.mark((function e(n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r){e.next=2;break}return e.abrupt("return");case 2:if(null!==p.current){e.next=4;break}return e.abrupt("return");case 4:if(null===Q.current&&(Q.current=n),!(n-Q.current-C<1e-7)){e.next=9;break}return t(),e.abrupt("return");case 9:return Q.current=n,e.next=12,oe(K,V);case 12:t();case 13:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}())}(),function(){r=!0,cancelAnimationFrame(e)}}),[V,K,oe,$,p,C]),{warmupDone:W,faceError:ee}}var Ww,Qw,Xw={r:"#ff0000",g:"#00ff00",b:"#0000ff"," ":"#00000099",default:"#00000099"},Yw=function(e){var r=e.onVideoPlayed,t=e.surroundStyle,a=e.maskSize,o=O(c(!1),2),i=o[0],s=o[1],u=O(c({}),2),l=u[0],d=u[1];return{onVideoPlayed:function(e){d(e),s(!0),"function"==typeof r&&r(l)},cropArea:n((function(){if(0===Object.keys(l).length)return{};var e=function(e,r){var t,n,a=e.videoAreaWidth,o=e.videoAreaHeight,i=e.lostX,s=e.lostY,c=r.width,u=r.height;return qs.isMobile?(t=a,n=o):(t=c,n=u),{width:t,height:n,x:Math.max(Math.round((a-t)/2+i),0),y:Math.max(Math.round((o-n)/2+s),0)}}(l,a);return e.surroundStyle=t,e}),[l,t,a]),isPlaying:i}},Zw=Ea.faceTracker(),$w=function(e,r,t,n){var a=r.toDataURL("image/jpeg",.8);if(!e)return{label:"portrait",base64:a.split(",")[1],index:n};var o=e.topLeft,i=e.bottomRight,s=[].concat(M(o),M(i)),c=[o[0]/_a.SIZE*r.width,o[1]/_a.SIZE*r.height,i[0]/_a.SIZE*r.width,i[1]/_a.SIZE*r.height],u=Zw(e,0===n),l=u.score,d=u.time;return{label:"portrait",base64:a.split(",")[1],landmarks:t,original_landmarks:t.map((function(e){return[e[0]/_a.SIZE*r.width,e[1]/_a.SIZE*r.height]})),score:l,time:d,index:n,bbox:s,original_bbox:c}},Jw=function(){var e=S(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",30);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ek=function(e){var t=e.className;return r.createElement("svg",{className:t,width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.createElement("rect",{x:"0.5",y:"0.5",width:"47",height:"47",rx:"23.5",fill:"#0276F1"}),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24 36.1124C30.6895 36.1124 36.1124 30.6895 36.1124 24C36.1124 17.3105 30.6895 11.8876 24 11.8876C17.3105 11.8876 11.8876 17.3105 11.8876 24C11.8876 30.6895 17.3105 36.1124 24 36.1124ZM24 38C31.732 38 38 31.732 38 24C38 16.268 31.732 10 24 10C16.268 10 10 16.268 10 24C10 31.732 16.268 38 24 38Z",fill:"white"}),r.createElement("path",{d:"M18.1465 20.169C18.1465 19.6236 18.5886 19.1815 19.134 19.1815C19.6793 19.1815 20.1214 19.6236 20.1214 20.169V22.1439C20.1214 22.6893 19.6793 23.1314 19.134 23.1314C18.5886 23.1314 18.1465 22.6893 18.1465 22.1439V20.169Z",fill:"white"}),r.createElement("path",{d:"M28.0213 20.169C28.0213 19.6236 28.4634 19.1815 29.0087 19.1815C29.5541 19.1815 29.9962 19.6236 29.9962 20.169V22.1439C29.9962 22.6893 29.5541 23.1314 29.0087 23.1314C28.4634 23.1314 28.0213 22.6893 28.0213 22.1439V20.169Z",fill:"white"}),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24.0714 19.1135C24.654 19.1135 25.1262 19.5858 25.1262 20.1683V24.6119C25.1262 25.7398 24.2119 26.6542 23.084 26.6542H22.5902C22.0077 26.6542 21.5354 26.1819 21.5354 25.5994C21.5354 25.0168 22.0077 24.5446 22.5902 24.5446H23.0166V20.1683C23.0166 19.5858 23.4889 19.1135 24.0714 19.1135Z",fill:"white"}),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28.8537 27.4214C29.2114 27.8813 29.1285 28.544 28.6687 28.9016C26.6697 30.4564 24.6954 30.8255 23.0184 30.5817C21.3833 30.344 20.0946 29.5339 19.3755 28.8149C18.9636 28.403 18.9636 27.7351 19.3755 27.3232C19.7875 26.9113 20.4553 26.9113 20.8672 27.3232C21.3002 27.7562 22.184 28.3286 23.322 28.4941C24.4181 28.6534 25.8176 28.4466 27.3735 27.2364C27.8334 26.8788 28.4961 26.9616 28.8537 27.4214Z",fill:"white"}),r.createElement("rect",{x:"0.5",y:"0.5",width:"47",height:"47",rx:"23.5",stroke:"#DAEAFB"}))};ek.defaultProps={className:""},ek.propTypes={className:h.string};var rk,tk=m.div(Ww||(Ww=L(["\n --color: #0276f1;\n\n & .indicator {\n color: var(--color);\n }\n\n & .gauge {\n background-color: var(--color);\n }\n"]))),nk=m.div(Qw||(Qw=L(["\n height: 10px;\n position: relative;\n background: #daeafb;\n border-radius: 100px;\n margin-block-end: 8px;\n\n & > span {\n display: block;\n height: 100%;\n border-radius: 100px;\n width: 0;\n overflow: hidden;\n }\n"]))),ak=function(e){var t=e.value,n=e.className;return r.createElement(tk,{className:n},r.createElement(nk,null,r.createElement("span",{className:"gauge",style:{width:"".concat(t,"%")}})),r.createElement("div",null,r.createElement("span",{className:"indicator"},"•")," ",t,"%"))};ak.defaultProps={value:0,className:""},ak.propTypes={value:h.number,className:h.string};var ok,ik=m.b(rk||(rk=L(["\n color: #1d1d1d;\n padding: 18px 16px;\n background: #fafafa;\n border: 1px solid rgba(29, 29, 29, 0.04);\n border-radius: 100px;\n display: flex;\n align-items: center;\n flex-direction: row;\n font-size: 16px;\n"]))),sk=function(e){var t=e.children,n=e.className;return r.createElement(ik,{className:n},t)};sk.defaultProps={children:null,className:""},sk.propTypes={children:h.node,className:h.string};var ck,uk=m.span(ok||(ok=L(["\n color: #1d1d1d;\n font-weight: bold;\n background: rgba(255, 255, 255, 0.8);\n border-radius: 12px;\n padding: 12px 16px;\n max-width: 200px;\n text-align: center;\n display: inline-block;\n"]))),lk=function(e){var t=e.children,n=e.className;return r.createElement(uk,{className:n},t)};lk.defaultProps={children:null,className:""},lk.propTypes={children:h.node,className:h.string};var dk,fk,pk=m.div(ck||(ck=L(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 1001;\n\n background-color: ",";\n"])),(function(e){return e.$overlay?"white":"transparent"})),hk=function(e){var t=e.children,n=e.overlay;return r.createElement(pk,{$overlay:n},n&&r.createElement(qp,null),r.createElement("div",{style:{visibility:n?"hidden":"visible"}},t))};hk.defaultProps={children:null,overlay:!1},hk.propTypes={children:h.node,overlay:h.bool};var mk={width:210,height:300},gk={width:qs.isMobile?window.innerWidth:window.innerHeight,height:window.innerHeight},vk=m.ellipse(dk||(dk=L(["\n transition: all 0.3s ease-in-out;\n transform-origin: center;\n transform: scale(",");\n"])),(function(e){return e.$scale})),yk=m.rect(fk||(fk=L(["\n transition: all 0.3s ease-in-out;\n transform-origin: center;\n transform: scale(",");\n"])),(function(e){return e.$scale})),bk=l((function(e,t){var n=e.className,a=e.scale,o=e.debug,i=e.width,s=e.height,c=e.padding,u=e.verticalOffset,l={left:i/2-mk.width/2-c.left,top:s/2-mk.height/2-c.top+u,right:i/2+mk.width/2+c.right,bottom:s/2+mk.height/2+c.bottom+u};return r.createElement("svg",{className:n,viewBox:"0 0 ".concat(i," ").concat(s),width:i,height:s},r.createElement("mask",{id:"OVAL_MASK"},r.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white",mask:"url(#OVAL_MASK)"}),r.createElement(vk,{ref:t,cx:i/2,cy:s/2+u,rx:mk.width/2,ry:mk.height/2,$scale:a})),r.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white",mask:"url(#OVAL_MASK)"}),o&&r.createElement("rect",{x:"0",y:"0",width:i,height:s,stroke:"red",fill:"none"}),o&&r.createElement(yk,{x:l.left,y:l.top,width:l.right-l.left,height:l.bottom-l.top,$scale:a,fill:"none",stroke:"red",strokeWidth:.5}))}));bk.propTypes={className:h.string,scale:h.oneOfType([h.number,h.string]),debug:h.bool,width:h.number,height:h.number,padding:h.oneOfType([h.number,h.shape({top:h.number,right:h.number,bottom:h.number,left:h.number})]),verticalOffset:h.number},bk.defaultProps={className:"",scale:1,debug:!1,width:gk.width,height:gk.height,padding:0,verticalOffset:0};var Ck=function(e,r){var t,n,a=e.smallScale,o=e.largeScale,i=e.ovalPadding,s=e.ovalVerticalOffset,c=r.width/r.height,u=a/o,l=(t=window.innerWidth-30,n=c,Math.floor(t/n)),d=a*window.innerHeight,f=o*window.innerHeight,p=i.top+i.bottom+s,h=i.left+i.right,m=d-p,g=f-p;if((g*c).toFixed(2)+h>window.innerWidth){var v=((l-p)/r.height).toFixed(2);return{smallScale:(v*u).toFixed(2),largeScale:v}}return{smallScale:(m/r.height).toFixed(2),largeScale:(g/r.height).toFixed(2)}},wk=p({}),kk=function(e){var t=e.apiClient,n=e.children,a=O(c({}),2),o=a[0],s=a[1];return i((function(){function e(){return(e=S(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"==typeof t.clientSettings){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,t.clientSettings();case 4:r=e.sent,s(r);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[t]),r.createElement(wk.Provider,{value:o},n)};kk.propTypes={apiClient:h.shape({clientSettings:h.func.isRequired}).isRequired,children:h.node.isRequired};var Bk,Ek=function(e){var r=t(wk);return Array.isArray(e)?e.reduce((function(e,t){var n=Pf(r,t);return e.push(n),e}),[]):Pf(r,e)},Sk=function(){var e=a(),r=Pn.useSDKTracking().sendEvent;return o((function(t,n){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=performance.now();if("object"===B(a)){var i=x({},a);e.current&&(i.interval_vs_previous_in_ms=o-e.current),e.current=o,r({tag:t,event:n,log:i})}if("function"==typeof a){var s=a({lastTimeLog:e.current});e.current=o,r({tag:t,event:n,log:s})}}),[r])},_k=function(e,r){var t=a(e);i((function(){r&&"function"==typeof t.current&&t.current()}),[r])},Ak=Object.freeze({READY:"READY",RUNNING:"RUNNING",STOPPED:"STOPPED"}),Ik=m.span(Bk||(Bk=L(["\n margin-block-start: 10px;\n color: red;\n"]))),Tk=function(e){var t=e.onTimeout,n=e.timeout,s=e.shouldStart,u=e.shouldStop,l=ww(),d=function(e){var r=e.startTime,t=void 0===r?3:r,n=e.onCountDownDone,s=e.autoRestartAfter,u=void 0===s?-1:s,l=O(c(t),2),d=l[0],f=l[1],p=O(c(Ak.READY),2),h=p[0],m=p[1],g=a(),v=o((function(){m(Ak.RUNNING),g.current=setInterval((function(){f((function(e){return e-1}))}),1e3)}),[]),y=o((function(){m(Ak.READY),f(t),clearInterval(g.current)}),[t]);return i((function(){0===d&&(m(Ak.STOPPED),clearInterval(g.current),"function"==typeof n&&n(),-1!==u&&setTimeout((function(){y(),v()}),1e3*u))}),[d,n,u,y,v]),{state:h,countdown:d,startCountDown:v,stopCountDown:y}}({startTime:n,onCountDownDone:t,autoRestartAfter:3}),f=d.countdown,p=d.startCountDown,h=d.stopCountDown;return _k(p,s),_k(h,u),r.createElement(r.Fragment,null,f>0&&f<10&&r.createElement(Ik,null,l("timeout.remaining",{remain:f})),0===f&&r.createElement(Ik,null,l("timeout.expired",{timeout:n})))};Tk.propTypes={onTimeout:h.func.isRequired,timeout:h.number.isRequired,shouldStart:h.bool.isRequired,shouldStop:h.bool.isRequired};var xk,Pk,Rk,Dk,Nk,Lk,Ok,Mk,Fk={8:[" r rrr"," r rr"," r r rr "," r rrr "," r r r "," rr r rr"," rr r "," rr rrr"," rr r"," rrr r"," r rrr "," r r r "," r r rr"," r r r "," r rrr r"," r r "," rrr r "," r rr r"," rrr rrr"," r r "," rr r "," r rrr "," r rr "," r r rr"," r r r"," r r r"," r rr r"," r r r "," r rr r"," r rr rr"," rr rr "," rr rr"," r rrr"," r r"," r rrr"," r rr "," r rr r "," rr r "," rr r r "," r r "," rr r "," rr r "," r r r"," rr rr"," rr "," r rr "," rrr r r"," r r r"," rrr rr"," r rr"," rrr "," rr rrr"," r r "," rrr "," r r "," r r r"," r rr "," rr rr "," rrr r"," rr r r"," r r r r"," rr rrr "," rrr rr "," rrr r"," rrr rr"," r rr "," rrr r "," rr rr"," rr rr r"," r rr "," rr r"," r r rr"," r r r"," r r rrr"," rr r r"," rrr r "," rr r r"," r r "," rr r "," rr rr "," r r "],9:[" r r r "," r r r"," rrr r r "," r rrr "," r r rr"," rr r "," r r r "," r rrr "," rr rr "," rr r r "," r r rrr"," r r r r"," r rr r"," rr r r"," r rr "," rrr r "," r rr r"," rr rr "," rr r r"," rr r rr"," rr rrr "," r r r"," r r r "," rr rr r"," r rr r"," rrr rrr "," rr r r"," r r r "," rrr "," r r rr"," r r rrr"," r r r rr"," r r r "," rrr rr"," r rrr r "," rrr r "," rrr r "," rrr r "," r rr r r"," rr r r "," rr r r"," r r r"," rr rr r"," rr r r r"," r r r "," r r rr "," rr r r "," r rr r "," rr rr "," rr r "," rr r"," r r r"," rrr r"," r rr "," r r "," r r "," rrr r "," r rr "," r rr r "," r rr rr"," rr r "," r r rr "," rrr rr"," r rrr "," rrr rrr"," r rr "," r r rrr"," r rrr r"," r r rr r"," rr rr r "," r rrr "," r r rr"," rr r "," r r r "," r r r r "," r r "," r rr rr "," r rrr "," r rr "," rr rrr "," r r "," r r r r"," rr rr r"," r rr rr"," r r r "," rr rr"," r r rrr "," r r r "," rr rr rr"," r rr rrr"," rr rr "," rr r rr"," rrr rr "," rrr rr "," rr rrr "," r rrr"," rr r r"," rrr rr "," rrr rr"," rrr r r"," rr rr"," r rrr r"," r rr "," rr rrr"," rr r r"," r rr r"," r r rr "," r rr rr"," r rrr rr"," rrr r r"," r rr"," r r rr "," r r r"," rrr rrr"," rr r "," rr rr "," r r rr"," rr rrr r"," rrr r rr"," r rr r "," r r r"," r rr r"," rrr r r"," rr r rr"," rr r rrr"," r r "," r rrr"," rrr r "," r r r r"," rr rrr"," r r "," rr r "," rr r rr "," r rrr r"," rr r "," rrr r"," r rr r "," r rr r"," r rr "," r r rr"," r r r "," rr rrr"," rr rr "," r rrr "," rrr rr r"," r r rr"," rr r r "," r r r r"," r r r"],10:[" r rr r"," rrr rrr "," rr r rr "," r r rrr"," r rr r"," r r rr "," r rrr rr"," r r rr "," rr r r"," r r rr "," rr rrr "," r rr r r"," rr r rr "," r r r r "," r rrr "," r rr rr "," rr rr r"," rr r r "," r rrr r"," r r r "," r r r"," rrr r "," r r r"," rr r rrr"," r r r rr"," r rr rr"," r rr r "," rrr r r "," rr rr r"," r r rr"," r r r r"," rrr r rrr"," r r r r "," r r rrr "," r rrr rr "," rrr r"," r rrr "," r r r "," r rrr r "," r rr rrr"," r rrr rrr"," rr r r "," rr r r "," rrr r rr"," rr rrr "," rrr r "," rrr rr r"," rrr r "," r rrr r "," r r rrr r"," r r r r "," rrr r r "," rrr rrr "," rr r rr "," r r r rr"," rr r r r"," rr rr "," r rr rr "," rr rrr r"," rr rr "," r rr r "," r rrr r"," r r r r"," rr rrr "," r r "," rr r r "," rrr rr r"," rr r rr"," r rr r"," r r r"," rr r rr r"," r r rr r"," rrr rrr "," r r r r "," r r rrr "," rr r "," rrr r r "," r r rr "," r r r r "," r rrr r"," rr rrr "," r rrr rr"," rr r rr"," r r r "," r r rr r"," r r r r"," rr rr "," rrr rr "," r r r"," rr rr "," rr rrr"," r rr r"," r r rrr"," rr rr "," r rrr rr"," rr r "," r rr r "," rr r "," rr rr r "," rr rr r r"," r rrr r "," r rrr "," r rrr "," r rr rr"," rr rr rr"," rr rrr "," r r rr "," rr r r"," rr r "," rr r rr"," r rr rrr "," rr rrr r"," rr r r "," rr r rr "," r rrr "," r rr r r"," r r r "," rr rr r "," r r rr "," r rr r "," r rr r "," r rr r r"," rrr rrr"," rr r r rr"," rrr rr "," r rr rr r"," rr r r r"," r rr r"," r rr rr "," r r r "," r r rr r "," rrr r rr"," r r "," r rrr r "," r r rr r"," r r r r"," r rrr r r"," rr r rrr "," rrr rr "," r r rrr"," r r r "," rr r rr"," r rr r"," r r "," rrr r r "," rr rrr r"," rrr rr "," rr r r "," r r r r"," rrr r "," r rr rrr"," r rr r "," rrr r r"," rr r r"," r r r "," r r rrr"," rr r "," rr rr r"," r r r r"," r rr "," r rr rr "," rr r r "," rr r rrr"," rr rr r"," rrr rrr"," r r rrr"," r r r"," r r r "," rrr r r"," r rr r "," r rr rr"," rr rrr r "," r r r r"," rr r r r "," r rr r "," rr r r "," r rr "," r rr rr"," r rr rrr"," rrr r rr "," r r rrr "," r r r rr"," r r r "," r rrr r"," rr r "," rr rr"," r rr r "," rr r rr"," rr r rrr"," r rr r rr"," r r r "," r r r rr "," rr r r r"," r r r rr"," rr rr rr "," rrr r r"," r rr r r"," rr rr r "," rr r r"," r rr "," rrr rr r"," r r r "," r r rr "," rr rr r"," rrr rr rr"," r rrr "," rr rr rr"," rrr r r"," rrr r rr"," r r r "," rr rrr"," rrr rr "," rr rrr rr"," r r r"," r rrr "," r r rr"," r rr "," rr rr "," rrr r r r"," r rrr"," r r r rrr"," rrr rr"," r r rr "," r rrr r"," rr r r"," rrr r r"," rr rr rrr"," r r r r"," rrr r "," r r r r"," r r rr"," r rr rr"," rrr rr r "," r r r r r"," r r r "," r r r "," r rr r "," r r rr rr"," rrr r "," rr rr r "," r rr r r "," rr r r r"," rr rr r"," rr rrr "," rrr rrr r"," r r rrr "," r r rr"," rr r r"," rr r rr"," r r rr"," r r rr "," rrr r "," r rrr r"," r rr "," r r r "," r r r r"," rr r r "," rr rr "," rrr r r"," r rr "," rr r r"," rrr rr "," r r rr"," r r rr"," r r rr r"," r r r "," rrr rrr"," rrr rr"," r rr rr"," r r rr "," rr r r "," r rr r"," r r rrr"," rr rr rr"],11:[" rrr rrr "," r r r r r"," r r rrr"," r rr rr "," r rr rrr"," r r r r r"," rr r rrr"," rrr rrr r"," rr r r "," rr rrr rrr"," r rrr rrr"," r r r "," rr rrr r"," r rrr "," rr r rrr "," r rr rr"," rrr rr r"," rr r r "," r rrr rr"," r r rrr r"," rr r r r"," rrr r r"," r r rrr "," r rr rr r"," rr rrr r"," rrr r rrr"," rr rr r"," r rrr r "," r rr rrr "," r r rr"," rr r r "," r r r r "," r rr rr"," r rr r"," rrr rr "," rrr rr r "," rr r r r"," rr rrr rr"," rrr rr "," r rrr "," r rr r "," rrr rrr"," r rr rr rr"," r r r rr "," rr r rr rr"," r rr r "," r r r "," r rrr r "," rrr r r r"," rrr r rr "," r r r "," rr r rrr "," rrr r r"," rr rr r "," rr r r "," r rr r rrr"," r r r r"," rr r rrr "," r rr r"," r r rr"," rr r r "," rr r r"," r r r rr"," rrr r rr "," r r r r"," r rr r rr "," r r rr "," r r rr r"," r rrr rr "," r r r "," r rr r "," rr r r r"," rr r r r"," r rrr rr "," rr rrr "," rrr r r "," rrr r rr "," rr r rr"," rr rrr r"," r r rrr "," r r rr r "," r rr rr r "," rr r r r "," r r r "," rr r r "," r r r rrr "," rrr rr r"," r rr r "," rr rr r "," rr rr rr "," rrr r r "," rrr rr r r"," r r rrr "," r rr r rr"," rr rrr rr"," rr rr rr r"," r r r"," r rrr r"," rr r r r"," r r rrr "," r rr r rr"," rrr r r "," r rr r "," r rr rr "," r rr rr "," rr rrr rr "," rr rr rr "," rr r rr "," r r r r r"," rr rr rrr"," r r rr r "," r r r "," r r r r"," rr r rrr"," r rr r "," r r rr"," rrr r r"," rr rr r "," rrr r rr"," r r rr r"," rr rr r r"," r r r r "," r r rrr rr"," r rr "," r r r r "," rrr r rrr"," rrr r r r"," rr r rrr r"," rr rr r r"," rrr r r "," r rr r r "," rrr rr "," rr r rr"," r r rrr"," r r r r r "," r rrr r r"," r r rr r"," r r rrr "," r r rrr r "," r r r rr"," r rr rr "," rr rr rr "," r rrr r "," r rr rrr"," r r r r"," rrr r "," rr rr "," rr rrr "," rrr r r"," r rr r r "," r r rr "," r r rr "," r rr rr "," r r rr "," rr rr rr"," r rr "," rr r rr "," r rr r r "," r r r r"," r r r "," r rr rr "," rrr r r "," rr r r "," r r rr "," rr r rr r "," rr rrr"," rr rr rrr "," rr rr r"," r r r r "," rr r rrr"," rr rrr "," rr r r "," r rr r "," rr r r "," rr rrr r r"," rr r "," r r r rr "," rr rr rr "," rrr r "," r r rr r"," rr r r r "," rr r r r "," rrr r r"," rrr r rr"," r r r r "," rr rr r "," rrr rr "," r rr rrr"," r rr rr"," r rrr r r"," r rrr "," r rrr r"," rrr rrr r"," r r r "," r r rr "," r r rrr"," rr rr r"," r r rrr"," rrr rrr r "," rr r r r"," rrr rrr"," r r rrr r"," rr r r rr"," r r r "," rr rrr r "," rr rr r "," r r r "," r rrr "," r r r r "," r rrr r"," r r rr r "," r rr rrr "," rr r rrr"," rrr rr"," rrr r r r"," rrr rr r"," r rr r "," rr rr r r"," r r rrr "," r r r rr"," r r rrr "," rrr rr r "," rr rrr r"," rrr r rr"," r r rr rr"," rr rr "," r rr r"," r rr "," rrr r r "," r r rr "," r rrr r"," r rr r"," r r rr r"," r rr r r"," rr r rr"," rrr r rr"," r r rr"," r rrr rrr"," r rrr rr "," r r r r "," rrr r rr"," r r r r "," rrr rr rr"," r r rr rrr"," r r r r"," r rrr "," rr r r r"," rr rrr "," rr r r r"," rr r rrr "," rr r r"," r r r r"," rr rrr r"," rrr r r "," r r r "," r rr r r r"," r rr rrr r"," r r r r"," r r r rr r"," rrr r r r"," r r rrr"," rr rrr "," r r r r"," r r r"," r r rr rr"," rrr rr r"," r r rr "," r r r rr"," r rr r r "," r r r rr"," r rrr rr"," r r r"," r r rr"," r rrr r "," rr rr r "," rrr r "," rr rr r "," r r r r "," r r rr "," rrr r rr"," r rr r "," rr r r r r"," r r r r "," rr r r "," rrr rr "," rr rr rrr"," rr r rr"," r rrr rrr"," r rr r "," rr rr rr"," rr r r "," r rr rr "," r r r r "," r r r "," rr r rr "," r r rr "," r r r rr"," rr r r r "," r r rr "," r r r rr"," r r rrr"," rr rr r r"," r rrr rr r"," r rr rr"," r r rr "," r rr r r"," rr rr r "," r r rrr r"," r rrr rr "," rr rrr "," rrr r r "," rrr r r"," rrr rr "," rr r "," r rrr r rr"," r rrr r"," r rr r r "," rr r rr "," r r rr r r"," r rr r r"," rr r r "," r r r rr"," rrr rrr r"," rrr r r"," r rr r rr"," rr r r r "," rr r r "," rrr rrr "," r r rr"," r r rrr"," r r r r"," rr rr "," r r r r"," rrr rr rr"," rrr r "," r r r r r"," rrr r rrr"," rr rr "," rrr rrr "," r rrr r r "," rr r rr "," rr rr r"," rr r r"," rr r rr r"," r r r r "," r r rr r"," rrr rrr "," rr rrr r "," r rr rrr "," r rrr r"," rr r r"," r rrr "," r rr r "," rrr rrr "," rr r rr r"," rr rrr r "," rr rr rr"," rr r r"," r rr rr r"," r rrr rr"," rr r r "," r r r r "," rr r rr"," r r r r"," r rrr rr"," rr r rrr"," r r r rr "," rrr r rr r"," rrr r "," r rr r r"," r rr rrr"," rr rr rr"," r r rr rr"," r rr rr "," rr r rr"," r rr rr r"," r rrr r "," r rrr r "," rr r rrr"," r r rr "," r r r rr"," r r rrr "," r r r "," rr r r rr"," rr rr rr"," r rrr r "," rr rr "," r rr r r"," rr r r rrr"," rrr r "," r rr rr "," r rr r "," r r r rrr"," r r r rr"," rrr rr rr"," r rr rrr "," r rr rr r"," rrr r r rr"," r r r r"," r rr rrr"," r r rrr r"," r rr r r"," r rrr r r"," r r rr r"," rr rrr "," r rr r "," rr rrr r "," r r r r"," rr rr "," r rr rr"," r rr r "," r r rr r"," rr r rr"," rrr rr r "," rr rr rr"," r rr r "," r r r r rr"," rrr r r "," r r rrr "," rrr r rrr "," r r "," r r r "," r r r r"," r rr r"," r rrr r "," r r rr rr"," rrr rr r"," r rr r rr"," r rrr rr"," rr rrr r"," rr r r r"," rr rr r r "," r r rr r"," r rrr r "," r r r rr "," rrr rr r "," r rr r "," r r r r "," rrr rrr rr"," rrr r r "," r r r "," rr rr rrr"," r r r "," rr r rr "," rr r rr r"," rr rr r"," r rrr rrr "," r rr r r"," r rrr r r"," rrr r rr "," rr r r r"," r r r "," rrr rr rrr"," rr r rr "," rrr rr "," rr r rr "," rr r r rr"," rr r r "," r rr r r"," r rr r r"," r r rr r "," r r rr "," r r rr rr "," rr r r"," rrr rr r"," rr r r rr"," r rrr r"," rr r rr r"," r r r r r"," rr r r "," rr rr r"," r r r "," rr r "," r rr r"," r r r rrr"," rr r rr "," rr rr r "," r r rr "," r rr rrr"," r rrr rr"," r rr r r"," r r rrr "," r rr rr "," r rr rr"," rr rrr rr"," r r r "," rr rr r "," r r r r "," rrr r r r "," rr r rr "," rrr rr rr "," r r rr "," r r r rrr"," r r r rr "," rrr rrr "," rr rr r"," r r rr r"," r r r rrr"," r r rr r "," r r r r"," rr rr r rr"," rr r r rr "," r rrr r "," r rr rr"],12:[" rr rr rr r"," r r r rr"," r rr r r "," rr r r rr "," r rr r r"," rrr r r "," r r rr "," rrr rr r "," rr r rr "," rr rr r "," r r r r "," rr r rr r "," r r r rr"," rr rr r rr "," rr r rr "," rrr rr "," r rr r rr"," rrr rr rrr"," r rrr rr "," rr rr r "," r rr r r"," rrr rr rr "," rr r r r "," rrr r r "," r r rr "," r rr rr rr"," r rrr r "," rr rr r"," rr r r r "," rr rr r rr"," rr r r r"," r rr rr"," r r r r"," r rrr rr "," rr r rr "," rrr r r "," r rr rrr"," r rrr rrr "," r rrr rrr "," rr r r rrr"," r rr r r r"," r r r r rr"," r rrr "," r r rr rrr"," rrr r rr r"," r rrr r "," r rr r"," r rrr r "," rr rr r"," r rr r "," rrr r rr"," rr rr "," rrr r rr "," r rr rr r"," r rrr r r "," r r rr rr"," r rr rr r"," rr r r r "," rr r rrr r"," rr r r r"," r r rr rrr"," r rrr rr r"," rr rr r "," r rr r r "," r r r r"," rr rr r r"," rr r rrr"," rr r rr r"," r r r rr "," r rr r "," r rrr r r"," rrr r rr r"," r rrr rr rr"," r rr r r r"," r rr r rr"," rrr r r "," rr rrr rr "," rrr rr "," rrr rrr r"," rrr rr rr"," rrr rr rr"," r r rr rr"," rr r rr "," rr r r "," r rrr r r"," rr rr r "," rr rr rr "," rr r r "," rr r r "," rr rrr r "," rr rr rrr"," rrr r rr "," r r rr rr "," rr r r r "," rrr rr "," r rr r rr"," r r r r r"," r rr r r"," r r rr rr"," r rrr r r "," r rrr r r r"," r r rrr r"," rr r rr r"," r rr r rr "," rrr r r"," rrr r r "," rrr rrr r "," r r r rr "," rr r rr "," r rr rrr"," r rr r "," r r rr "," r r r r"," r r r r r "," r r rrr r"," rr r rr r"," r rr r rr "," r rr rr "," r r r r"," r r r r"," r r r r "," rr r r "," r r r r "," r rr rr "," rr rr r "," rr r rr rr "," rrr rr r "," r r rr r "," rr r rrr "," r rrr rrr"," rr rrr r "," r rr rrr rr"," rr r r"," rr r rr rr"," rr r r"," rrr r r "," r r rrr r "," r rr r rr r"," rrr rr r "," rr rrr r r"," r rrr r r"," rrr rrr rr "," rr rrr rr "," rr r r r"," r rrr r r"," rr r rr"," rr r r r rr"," rr rr r r"," rr rrr rr"," rr r r r"," rrr r rrr "," r r rrr r "," rrr rr r "," rr r r rrr"," r rr rr rrr"," rr r r "," r r rr r "," r rr rrr"," r r r rr rr"," r r rrr "," r r rrr "," rr rrr rrr"," r r rrr "," rr r rr r r"," rr rr rrr"," rrr r rr "," rr rr rr"," r r r r rr"," rr r rrr"," r rr r r r"," rr r r rr "," rrr rrr r"," rrr rr rr "," r r r r "," rr r rrr "," r rrr r r"," r rr r "," rr r r "," r r r rr"," r rrr rr "," r r r r r r"," r r rrr "," rr r rr"," rr r r r "," rr rrr r "," rr rrr r"," r r r "," rrr r rr"," rr rr r"," r rr r "," r rr r "," rr rr rr"," r rr rrr "," r rrr r r"," rr rr r r"," rrr rrr "," r rrr rrr"," rr r rrr r"," rr rr r r"," r rr r r"," r r rrr r"," r r r r"," rr rrr rrr "," r rr r r "," rr rr "," rr r rr "," r rr rrr r"," rr r r r "," rr r r r "," r rr r rr"," r rrr rr r"," rr r r r"," r rr r rrr"," rr r r r r"," rrr rrr r"," r rr rrr "," r r rrr r"," r r rr rr "," r r r r"," rr rr rr "," r rr r r "," r rr rr r"," rrr rrr rr"," rr rrr r r"," r rr r r"," r rr r rrr"," r r rr r"," r r r r r "," r r r r r "," r r r rr"," r r rr r "," r r rr rr"," r r r rrr r"," rr r rr rr"," r r rr r"," r r rr rr"," r r r r"," r r rrr r"," r rrr r rrr"," r r rr rr"," r r r rr"," r rr r "," r rr rrr "," r r r "," rrr r r rr"," r rrr r "," r r r r "," r rr r r"," r r rr r"," r r r rr "," rrr r r"," rr r r "," rrr r r r "," rr r r "," rr rr r "," r rr r r "," r r r rrr"," r rr rr r"," r r r r "," r r r "," r r rrr r r"," r rr r rr"," r rr r "," rrr r r "," r rr rr rr"," r rr r rr"," rr rrr "," rr rrr rr "," rrr r rr "," rrr r rr r"," r r rr rrr "," r r r r r"," rrr r rrr r"," rr r r rr "," rrr r r"," r rr r r"," rr rr r "," rr rr rrr "," r r r rrr"," rr rr rr "," rrr r rrr"," r rr rr r "," r rrr r "," r r rr "," rr r r r "," r r rr "," r r r r "," r rrr r"," rr rrr r "," rr rrr rr "," rr r r r"," rrr rr r"," r r r r rr"," r r rr r"," rrr rr r "," rr rrr rrr"," r rr rr "," rr rr "," r r rrr "," r r rr r"," r r rr r "," r r rr r r "," r r rr rrr"," r rrr rrr"," rrr r r "," r r r r r"," rr rr r rr"," rr r rrr "," rr r r r "," r r r rr"," rrr rr rrr"," r r r rrr"," r r rr r"," r r rr r "," r rrr rr"," r r rrr rr"," r r rr r r"," rr rr r r "," r rrr r"," rrr rr r r"," r rrr rr"," r rrr rr "," r rr r "," rrr r r r"," r r r r r"," r r r r"," r r r r r"," rr r r r"," r r r rr "," rrr rr r "," r rr rr r"," r rrr rr "," r rrr r rr "," rrr r r rr "," rrr rr "," rr r rr r"," r r r "," r rr r "," r rrr r"," rrr r rr r"," rr r rr"," r r rr r r"," r rrr r "," rr r r r"," rr r r "," r r rrr r"," rr rr r r r"," rrr rrr "," rr r r rrr"," rrr rr r"," r rr rrr "," rr r r "," rrr r r "," rr rrr r "," rr r r "," r rrr rrr"," r r rr "," rr rr rrr "," rrr rrr "," rrr r r r "," rrr r r r "," r r r rr"," r r rr r "," r rrr r "," r rr r r"," r r rr "," rr r rrr "," rr rr rr r "," r r r rrr"," r rr rr rr"," r rrr r rr"," rr r r rr"," r r r r"," rr rr rrr "," r rrr r r"," r rr r r r "," r r rr "," r rr r r "," rr rr r "," r rr r "," r rrr rr r"," r r rrr rr"," r r r "," r r r rr"," r r r rrr"," rr r r "," r r rrr "," r r r "," r r r r "," rr rr rr"," r rrr rr"," rr r rrr"," r rr rr r"," r r rr r"," rrr rr r"," r r r r rrr"," r rr rr "," r rr rrr "," rrr rrr r "," rr r r rr"," r r r r "," r r r "," rr rrr r"," r r r r "," rr r r "," r r rr r"," rrr r r r "," rr rr r r "," rrr r r r"," r r r r "," r rr r r"," rrr r "," rr r rr"," r rr rr "," rr rrr "," r r rr r"," rr rr rr"," rrr r rr"," rr r rr "," rrr rr rr"," rrr rr rrr "," r r rr r "," r r r rr "," r rrr r "," r r rrr "," rrr r rr "," rr r rr rr"," r r rr r"," r rr r r r"," r r rr r "," rr rr rrr"," rrr rr rr r"," r rr r "," r r r rr"," rrr rr r"," rr r rrr "," r rr rr r"," r r r rr r"," r rr r "," r r r r r "," rr r rr r "," r r rr r"," rr r r rr"," r r rrr"," r r r rr "," r r r rrr"," rr r rrr"," rrr r r "," r rrr r "," rr rrr rr"," r rr rr "," rr r rrr"," rr r rr "," r r r r r"," rr rr rr "," rr rrr rr"," rr r r "," r r r r "," rr r rr "," rrr r rr "," r rrr r r "," rr r r r r"," r rr r rr"," r rrr rr "," rr rr rr r"," r r r r"," rr rr r "," r r r r "," rr r rr r"," rr r rr r "," r r rr r "," rr rr rr "," rrr r r "," rr r r rr"," r r r "," rr r rrr"," rr r rrr "," r rrr r"," rrr r rrr"," rrr r r r"," rrr r r r"," r r r r"," r rr r rr "," rr r r r "," rr r r r"," r rrr rrr"," rr rr r rrr"," rr r r r "," rr rrr rr r"," rr r r r "," r r rrr r "," rr rrr rrr"," r r r r r "," r rrr rr"," rrr rr r "," r rr r r rr"," rrr r r r "," r rrr "," r rrr r "," r r rrr r"," r rrr r r"," rrr rr r"," rr r r rr r"," rr rr rrr"," r r r r r"," r r rrr "," rr r r r r"," r rr r r "," rr rr rrr r"," r rr rr "," rr rr r "," r r r r "," r rr r r "," rr rr r rr"," r r r "," rrr rrr r "," rr r rrr "," r rr r rr"," rrr rr rr "," rr rr rrr "," rr rr r r"," rr r r r "," r r r r"," rrr r "," r r r"," r rrr r"," r r r r"," r r rr r "," r r rr "," r r r "," rr r r "," r rr rrr"," r r r r "," r r rrr rr"," r r r r r"," r rrr rr"," rr r r r"," r rr rr "," r r rrr rr "," rrr r r r"," r rr r r "," r r rrr "," r rr r"," rr r r rr"," r r r rrr "," r r r r "," rrr r r r"," rr rrr r r"," rrr r rrr"," r rr rrr"," r rr r rrr"," rr rr r "," r rrr r r "," r rr rr"," r rr "," rrr r r rr"," rr rr r "," rr r rr "," r r r rr"," rrr r r "," rrr r r "," r r r r "," r r rrr r"," r r rr r"," r rr r r"," rr rrr r"," r r rr rrr"," r rr r r "," r rrr rrr "," rr rr r rr"," rrr rr r r "," r r r rr r"," rr rrr "," r rrr rrr"," rr rrr r "," rr r r r r"," rrr r rr rr"," r rrr rr"," r rrr r"," rr rr rrr"," r rr rrr "," r r rrr "," r rr rr "," rr rrr r"," r r r rr "," r r r rr "," rr rr rr "," rr r rr rr"," rrr rrr r r"," r rr rr"," r rr r rr "," rrr rr rr"," r r r rrr "," rr rr r r"," r r r rrr "," rrr rr rrr"," r r r r "," rr rr rr "," rr rrr r"," rr r r r "," rrr r rrr"," r rrr r "," rrr r r r"," rrr rr r r"," rrr rr r"," rr rrr r "," rr r r rr"," r r r "," rrr rrr r"," rr r r r"," r r rr "," r r r r rr"," r rrr rr r "," rr rr rr r"," r r rr "," r r r rr r"," r r rr r r"," r rr rr "," r rrr rr "," r r rr rr r"," r r rrr rrr"," rr rrr r "," r r r r r "," r r rr "," r rr r r"," r r rr r"," r r r r"," r rr r "," r r rrr rr"," rrr r rr r "," rrr r rrr"," r rrr rr "," r r rr r "," r rr rrr r"," r rr r r "," rr rr r r "," rr rr r "," r r r r r"," rr r rrr r "," r r rrr "," rr rrr rr"," r r r r"," rrr r r r"," r r r "," r rr rrr"," rr rrr rr"," rr rrr "," r r rr r rr"," r r r r r"," r r r rr "," r r rrr "," r rr rrr r"," rr rr r "," r r r "," r rr rr "," r r r "," r rr rr "," r r r r r"," r r r r "," r r rrr"," r r rr "," r r rr rr "," r rr rr rr "," r r r r"," r r r r"," r rr r "," rr r rr r "," rr rr r"," rr rrr r rr"," rrr rr rr"," r rrr r "," rrr rr r "," r r rrr"," r rr r "," rr rr r"," rrr r rr "," rr r rr r"," r r rrr r "," rr rr r r "," r rr r r"," r rr rr r"," r rr r rr "," rrr r rr"," r r r rrr"," rr r rr r"," rrr rr r"," rr r rrr r"," r rr r r"," rr r rr "," rr rr rr"," r r r r rr "," rr rr rr rr"," rr rrr r"," r rrr rr "," r r rr r"," r r r rrr"," r r rr r "," r r r rr "," r r r rr r "," r rrr r rr"," rrr rr rr "," rrr rrr rr"," r r rr rr"," r r rr "," r rr r r"," rr r r rr "," rr r r rr"," rr rr rr r"," rr r rr"," rr r r r "," r rrr rr "," rr r rr "," rr r rrr"," r rr r r"," rr r rr "," r rrr rrr "," rr r rr r"," rrr rrr "," r r rrr r"," rrr rr r r"," rr r r"," rr rrr rr"," rr r r r"," rr rrr "," rr r rrr rr"," rr r rr "," r rr rrr "," r r rr r r"," rr r r "," r r r "," r r rrr"," r r rr "," r r rrr"," rr r rr r "," rr rr r"," rr rrr r "," r r r "," r r r r"," rr rr r r"," r r r r "," r rr rr r "," rr rr rr "," rrr r rr"," r r rrr "," rrr rrr"," r r r r "," r r r r "," r rr rrr "," r rr rrr r"," rr r r rrr"," r r rrr "," rr r r r"," r r rr"," r rr rr r "," rrr r rr "," rrr r rrr "," rr r rrr "," rr r rrr "," r r r r r"," rrr rrr r"," r r rrr "," r rr r r "," rrr r r r r"," rr r r rrr "," rrr r "," rrr rr "," rrr rrr r "," rr r r r r"," r rr rr rr"," rr rrr r "," r r rr "," r r r r r"," rr rr r "," r r r r "," rr r r r"," rrr rrr "," r r rr r"," r rrr rr"," r r r r "," r r r r "," r r r r "," r rrr r "," r r r rrr"," r rrr r r"," r r rrr r "," r rrr "," r r r rr "," r rr rr "," r r r rr r"," r rr r rrr "," r rrr r r"," r rr rr "," r r r r "," r r rrr r"," rrr r r"," r r r rr"," r r r rrr "," r r r rr"," rr r r rr "," rr r r rr"," r rr rr"," rrr r r rr"," rrr r r "," rrr r rr "," rr rr rrr"," rr rrr r"," r r r rr"," rr r rr "," r r r rr"," r rr rr r r"," r rr r r "," r rr r rr"," r r rr rr"," r r rr rr "," rrr r rrr "," r r rrr "," rr r r r"," rr rrr r r "," rrr rr r rr"," r rr rrr "," r rr r rr"," r r r rrr "," rr r r "," rrr r rrr "," rrr r r r"," rrr r r r"," r r r rr "," r r r r rr"," r rr r r"," rrr r r rr"," rr rr r "," rrr rrr r"," rrr r rr"," r rr rr r"," r rr rr r "," r rr rrr r "," r rr rr"," rr rrr r r"," rr r rr rrr"," rr r r "," r rr r"," r rr r r "," rrr rr r "," r r rr rr "," r rr r "," rr r r rr"," rr r rrr "," rrr r r "," r rrr rrr r"," r r rr r"," r rr rrr "," rrr r rr"," r r r rr "," r rr rr"," rr r rr "," rrr rr r r"," rr r r "," r rrr r "," r r rr rr"," rrr r r"," rr r rr r"," rr r r rr"," r r r rr "," r r rr"," rrr rrr rr"," r r r r r"," rrr rrr "," r r r rr"," rrr r r "," rrr rrr "," rr rr rr"," rrr rr r "," r r r r "," r rrr r "," rrr r r rrr"," r rrr r "," rrr r rr "," r r r r "," rr r "," rr rr rr "," r rr r r "," r r r rr "," r r r r r"," rrr rrr rrr"," r r rr r r"," r r rr rr"," r r r r "," rr rr r r"," r rr rr r"," rrr rr "," rrr r r"," r rr rrr"," r r rr "," rr rr rr "," r r rr r "," r r rr r "," r rr r "," r r rrr"," r r r rr r"," r rrr r rr"," rr rr r r"," rr r rrr r"," rr r rr r"," r rr rr "," rrr r rrr"," r r r rr"," r r rr"," rr r r r"," rr rr r r "," rr rr r r"," rrr rr rr"," r rr rr "," r rrr rr r"," r r rr "," r rrr r r "," r rr r r r"," r r r rrr"," rr r r r r "," rr rr rr"," rr rrr "," r rrr r rr"," r r rr r "," r rr r rrr"," r r rr "," r rr r "," r rr rr r "," rr r rr"]},Uk="#ffffff",Vk=(m.div(xk||(xk=L(["\n z-index: ",";\n color: #ffffff;\n"])),1020),m(bk)(Pk||(Pk=L(["\n z-index: 2010;\n color: #ffffff;\n width: 100%;\n height: 100%;\n opacity: 1;\n margin: 0;\n"])))),jk=v(["from{transform:translateY(calc(50vh - 12px));}to{transform:translateY(0%);}"]),zk=m(sk)(Rk||(Rk=L(["\n margin-block-start: 12px;\n animation: "," 1s ease-in-out;\n\n & svg {\n margin-inline-end: 8px;\n width: 24px;\n height: 24px;\n }\n\n color: ",";\n background: ",";\n"])),jk,(function(e){var r=e.theme;return e.$flashing?r.instruction.flashing.color:"#1d1d1d"}),(function(e){var r=e.theme;return e.$flashing?r.instruction.flashing.backgroundColor:"#fafafa"})),Kk=m.div(Dk||(Dk=L(["\n width: 100vw;\n height: 100vh;\n position: absolute;\n top: 0;\n left: 0;\n z-index: ",";\n background-color: ",";\n opacity: ",";\n"])),1001,(function(e){return e.$backgroundColor}),(function(e){return e.$intensity})),Hk=m.div(Nk||(Nk=L(["\n background: red;\n opacity: 0.2;\n width: 100vw;\n height: 100vh;\n position: absolute;\n top: 0;\n left: 0;\n z-index: ",";\n"])),1001),qk=m(ak)(Lk||(Lk=L(["\n margin-block-start: 10px;\n color: #1d1d1d;\n mix-blend-mode: difference;\n width: 300px;\n"]))),Gk=m.div(Ok||(Ok=L(["\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n z-index: ",";\n"])),1002),Wk=m.div(Mk||(Mk=L(["\n position: absolute;\n left: 50%;\n transform: translateX(-50%);\n top: ","px;\n"])),(function(e){return e.$top})),Qk=qs.isMobile?{aspectRatio:window.innerHeight/window.innerWidth}:null,Xk={background:Uk,opacity:.6};function Yk(e){var s,u=e.onFlashDone,l=e.onClose,d=e.onError,f=e.frontCamera,p=e.cameraScale,h=e.defaultCameraId,m=e.styledComponent,g=e.frameInterval,v=e.flashSettings,y=e.maskSettings,b=e.faceSettings,C=e.closeEyesSettings,w=e.livenessSettings;if(y.smallScale>y.largeScale)throw new Error("smallScale must be smaller than largeScale");var E,_,I=a(),T=Sk(),x=ww(),P=t(zw),R=function(e){if("number"==typeof e)return{top:e,right:e,bottom:e,left:e};if("object"===B(e)){var r=e.top,t=e.right,n=e.bottom,a=e.left;return{top:null!=r?r:0,right:null!=t?t:0,bottom:null!=n?n:0,left:null!=a?a:0}}return{top:0,right:0,bottom:0,left:0}}(y.ovalPadding),D=v.colorsLength,N=v.framesPerColor,L=v.delayBetweenColors,M=v.useFaceDetectorWhenFlashing,F=v.flashIntensity,U=n((function(){var e=Fk[E];return e[Math.floor(Math.random()*e.length)]}),[E=D]),V=Ck(y,mk),j=V.smallScale,z=V.largeScale,K=function(e){var r=O(c(e),2),t=r[0],n=r[1];return{maskScale:t,handleMaskScale:o((function(e){n(e)}),[])}}(j),H=K.maskScale,q=K.handleMaskScale,G=function(e){var r=O(c(e),2),t=r[0],n=r[1];return i((function(){!function(){var r=S(regeneratorRuntime.mark((function r(){var t,a,o,i,s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,Promise.all([new Promise((function(e){requestAnimationFrame((function(r){requestAnimationFrame((function(t){e(Math.round(1e3/(t-r)))}))}))})),Jw()]);case 3:t=r.sent,a=O(t,2),o=a[0],i=a[1],s=Math.max(1e3/o,1e3/i,e),n(s),r.next=15;break;case 11:r.prev=11,r.t0=r.catch(0),console.error(r.t0),n(20);case 15:case"end":return r.stop()}}),r,null,[[0,11]])})));return function(){return r.apply(this,arguments)}}()()}),[e]),t}(g),W=a(null),Q=function(){var e,r=O(c(null),2),t=r[0],n=r[1],o=O(c(!1),2),s=o[0],u=o[1],l=a(null);return i((function(){if(!l.current)return function(){};var e=l.current,r=function(){n(e.getBoundingClientRect()),u(!1)},t=function(){u(!0)};return e.addEventListener("transitionrun",t),e.addEventListener("transitionend",r),function(){e.removeEventListener("transitionrun",t),e.removeEventListener("transitionend",r)}}),[]),[l,null!=t?t:null===(e=l.current)||void 0===e?void 0:e.getBoundingClientRect(),s]}(),X=O(Q,3),Y=X[0],Z=X[1],$=X[2],J=O(c(Iw),2),ee=J[0],re=J[1],te=O(c(""),2),ne=te[0],ae=te[1],oe=a({frames:(s={},A(s,Nw,[]),A(s,Lw,[]),A(s,Ow,[]),s),images:[]}),ie=function(e){var r,t=e.mode,n=a(Date.now()),s=null!==(r=Ek("data.settings.sdk_settings.id_detection_settings.exif_data_settings.enable"))&&void 0!==r&&r,c=o((function(){if(s){var e=Date.now();Rs.preWriteExif({mode:t,startTime:n.current,endTime:e})}}),[t,s]),u=o(function(){var e=S(regeneratorRuntime.mark((function e(r){var n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.imageData){e.next=3;break}return e.abrupt("return",null);case 3:if(s){e.next=5;break}return e.abrupt("return",n.blob);case 5:return e.next=7,Rs.writeExif({mode:t,imageData:n,enableExifData:!0});case 7:return a=e.sent,e.abrupt("return",a);case 9:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[t,s]);return i((function(){s&&Rs.initExifData()}),[s]),{prepareExifData:c,writeExifData:u}}({mode:Rs.MODE.SELFIE}),se=ie.prepareExifData,ce=ie.writeExifData,ue=o((function(){oe.current.frames[Nw]=[],oe.current.frames[Lw]=[],oe.current.images=[],w.enableFarStep&&(q(j),re(Tw)),ae(x("move_face_into_frame"))}),[q,j,x,w.enableFarStep]),le=o((function(){ae(x("move_face_into_frame"))}),[x]),de=Yw({surroundStyle:Xk,onVideoPlayed:le,maskSize:gk}),fe=de.onVideoPlayed,pe=de.cropArea,he=de.isPlaying,me=function(e){var r=e.offset,t=e.ovalPadding,n=e.largeScale,a=e.ovalHeight,o=e.maskHeight,i=a/2+t.bottom;return(i+r)*n>o/2?o/2/n-i:r}({offset:y.ovalVerticalOffset,ovalPadding:R,largeScale:z,maskHeight:pe.height,ovalHeight:mk.height}),ge=function(e){var r,t=e.colors,a=e.onFlashDone,s=e.framesPerColor,u=O(c(-1),2),l=u[0],d=u[1],f=n((function(){return t.split("").reduce((function(e,r){return e+r.repeat(s)}),"")}),[t,s]),p=null!==(r=Xw[f[l]])&&void 0!==r?r:Xw.default,h=o((function(){d((function(e){return e+1}))}),[]),m=o((function(){d(0)}),[]);return i((function(){l>f.length-1&&(d(-1),"function"==typeof a&&a())}),[l,f.length,a]),{colorIndex:l,currentColor:p,goToNextColor:h,startFlashing:m}}({colors:U,onFlashDone:o(S(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return re(Rw),ae("".concat(x("uploading"),"...")),console.timeEnd("Flash duration"),T("selfie","user_activity.finish_flash"),T("selfie","user_activity",(function(e){return{flash_liveness_in_ms:e.lastTimeLog-I.current}})),se(),e.next=8,Promise.all([ce({imageData:oe.current.images[0]}),ce({imageData:oe.current.images[1]})]);case 8:if(oe.current.images=e.sent,oe.current.images=oe.current.images.filter((function(e){return null!==e})),e.prev=10,"function"!=typeof u){e.next=14;break}return e.next=14,u(oe.current);case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(10),d({error:e.t0});case 19:re(Dw),ae("");case 21:case"end":return e.stop()}}),e,null,[[10,16]])}))),[se,ce,u,d,x,T]),framesPerColor:N}),ve=ge.currentColor,ye=ge.colorIndex,be=ge.startFlashing,Ce=ge.goToNextColor,we=o((function(e,r,t){var n=oe.current.frames[Nw],a=$w(e,r,t,n.length);a.color="",n.push(a)}),[]),ke=o((function(e,r){ca.takePicture({canvas:r}).then((function(e){oe.current.images[0]||(oe.current.images[0]={blob:e,gesture:"frontal",capture_time:Date.now(),frames:oe.current.frames[Nw].length})})),q(z),re(xw),ae(x("move_face_into_frame"))}),[q,z,x]),Be=o((function(e,r,t){var n=oe.current.frames[Lw],a=$w(e,r,t,n.length);a.color="",n.push(a),ca.takePicture({canvas:r}).then((function(e){oe.current.images[1]||(oe.current.images[1]={blob:e,gesture:"frontal",capture_time:Date.now(),frames:oe.current.frames[Lw].length})})),k((function(){console.time("Flash duration"),re(Pw),ae(x("hold_still")),be()}))}),[be,x]),Ee=-1!==ye&&ee===Pw,Se=o((function(e,r,t){var n=oe.current.frames[Ow],a=$w(e,r,t,n.length);a.color=ve,n.push(a),Ee&&Ce()}),[ve,Ce,Ee]),_e=o((function(e){var r=e.error;"no_face"!==r&&"multiple_faces"!==r||ue()}),[ue]),Ae=o((function(e,r,t){var n=oe.current.frames[Lw],a=$w(e,r,t,n.length);a.color=Uk,n.push(a)}),[]),Ie=n((function(){return ye%N==0?Math.max(L,G):G}),[ye,L,G,N]),Te=Gw({cameraScale:p,onError:d,isVideoPlaying:he,step:ee,cropArea:pe,videoRef:W,onCloseFaceDetected:Be,onFarFullFaceDetected:ke,onFlashingFramesCaptured:Se,frameInterval:Ie,useFaceDetectorWhenFlashing:M,onFaceError:_e,onMovingCloseFace:Ae,onFarFaceDetected:we,faceSettings:b,ovalPadding:R,ovalBoundingRect:Z,isOvalTransitioning:$,chinToMaskBottomPadding:y.chinToMaskBottomPadding,closeEyesSettings:C}),xe=Te.faceError,Pe=Te.warmupDone;_=W.current,i((function(){return function(){var e;_&&(null===(e=_.srcObject)||void 0===e||e.getTracks().forEach((function(e){e.stop()})))}}),[_]);_k((function(){w.enableFarStep?re(Tw):re(xw),I.current||(I.current=performance.now())}),Pe&&he),_k((function(){return T("selfie","user_activity.start_far")}),ee===Tw),_k((function(){return T("selfie","user_activity.start_close")}),ee===xw),_k((function(){return T("selfie","user_activity.start_flash")}),ee===Pw),_k((function(){return q(z)}),!w.enableFarStep);var Re,De=Math.min(Math.round((ye+1)/(U.length*N)*100),100),Ne=m.CloseCameraButton;return r.createElement(r.Fragment,null,r.createElement(hu,{frontCamera:f,onVideoPlayed:fe,onClose:l,flipHorizontal:f,ref:W,onError:d,scale:p,defaultCameraId:h,videoSettings:Qk,closeButton:Ne||null}),""!==xe&&r.createElement(Hk,null),r.createElement(hk,{overlay:!Pe||!he},ee!==Dw&&r.createElement(Cu,{x:"".concat(Math.round(pe.x),"px"),y:"".concat(Math.round(pe.y),"px"),width:"".concat(pe.width,"px"),height:"".concat(pe.height,"px"),surroundStyle:{background:Re||Uk,opacity:1}},r.createElement(Vk,{ref:Y,scale:H,debug:P,width:pe.width,height:pe.height,padding:R,verticalOffset:me})),r.createElement(Gk,null,ne&&r.createElement(zk,{key:ee,$flashing:ee===Pw},ee===Pw?ne:r.createElement(r.Fragment,null,r.createElement(ek,null)," ",ne)),r.createElement(Tk,{onTimeout:ue,timeout:w.timeout,shouldStart:Pe&&he,shouldStop:ee===Pw}),ee===Pw&&r.createElement(qk,{value:De,max:100})),r.createElement(Wk,{$top:Math.round(pe.y+pe.height/3)},""!==xe&&r.createElement(lk,null,x(xe))),ee===Pw&&r.createElement(Kk,{$backgroundColor:ve,$intensity:F})))}Yk.propTypes={onFlashDone:h.func,onClose:h.func,onError:h.func,captureFrameSettings:h.shape({}),frontCamera:h.bool,customErrors:h.shape({}),livenessSettings:h.shape({timeout:h.number,enableFarStep:h.bool}),outputEncryptionSettings:h.shape({}),cameraScale:h.number,defaultCameraId:h.string,styledComponent:h.shape({CloseCameraButton:h.node}),frameInterval:h.number,flashSettings:h.shape({colorsLength:h.number,delayBetweenColors:h.number,framesPerColor:h.number,flashIntensity:h.number,useFaceDetectorWhenFlashing:h.bool}),themeSettings:h.shape({}),maskSettings:h.shape({smallScale:h.number,largeScale:h.number,ovalPadding:h.oneOfType([h.number,h.shape({top:h.number,right:h.number,bottom:h.number,left:h.number})]),ovalVerticalOffset:h.number,chinToMaskBottomPadding:h.number}),faceSettings:h.shape({minFarFaceRatio:h.number,maxFarFaceRatio:h.number,closeFaceRatio:h.number}),closeEyesSettings:h.shape({enable:h.bool,timeout:h.number})},Yk.defaultProps={onFlashDone:function(){},onClose:function(){},onError:function(){},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},frontCamera:!0,customErrors:null,livenessSettings:{timeout:30,enableFarStep:!0},outputEncryptionSettings:null,cameraScale:1,defaultCameraId:void 0,styledComponent:{CloseCameraButton:null},frameInterval:0,flashSettings:{colorsLength:10,delayBetweenColors:120,framesPerColor:4,flashIntensity:1,useFaceDetectorWhenFlashing:!1},themeSettings:{},maskSettings:{smallScale:qs.isMobile?.65:.6,largeScale:qs.isMobile?.9:.85,ovalPadding:{left:qs.isMobile?20:30,right:qs.isMobile?20:30,top:0,bottom:20},ovalVerticalOffset:qs.isMobile?60:0,chinToMaskBottomPadding:20},faceSettings:{minFarFaceRatio:qs.isMobile?.85:.8,maxFarFaceRatio:.9,closeFaceRatio:qs.isMobile?.95:.82},closeEyesSettings:{enable:!1,timeout:5}};var Zk,$k,Jk,eB,rB=function(e){var t=e.className;return r.createElement("svg",{className:t,width:"89",height:"22",viewBox:"0 0 89 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{d:"M59.5591 14.4581C59.5591 14.911 59.494 15.3432 59.3636 15.7549C59.2333 16.1666 59.0343 16.5337 58.7668 16.8561C58.4992 17.1786 58.1631 17.4359 57.7584 17.628C57.3536 17.8202 56.87 17.9162 56.3075 17.9162C55.841 17.9162 55.4157 17.8407 55.0315 17.6898C54.6473 17.5388 54.3146 17.3261 54.0333 17.0517C53.7521 16.7772 53.536 16.4479 53.3851 16.0637C53.2342 15.6794 53.1587 15.254 53.1587 14.7875V13.923L54.9697 14.3141V14.7875C54.9697 15.1854 55.0932 15.5045 55.3402 15.7446C55.5872 15.9848 55.9096 16.1048 56.3075 16.1048C57.2404 16.1048 57.7069 15.6657 57.7069 14.7875C57.7069 14.4581 57.6657 14.1803 57.5834 13.9538C57.5011 13.7274 57.3845 13.5182 57.2336 13.326C57.014 13.079 56.7808 12.8526 56.5338 12.6468C56.2869 12.4409 56.0365 12.2351 55.7827 12.0293C55.5288 11.8234 55.2784 11.6107 55.0315 11.3912C54.7845 11.1716 54.5513 10.9315 54.3318 10.6707C54.0299 10.3139 53.7864 9.916 53.6012 9.47688C53.4159 9.03776 53.3233 8.53003 53.3233 7.95368C53.3233 7.50084 53.3988 7.08574 53.5497 6.70837C53.7006 6.331 53.9133 6.00852 54.1877 5.74093C54.4621 5.47334 54.788 5.26408 55.1653 5.11313C55.5426 4.96218 55.9576 4.88671 56.4104 4.88671C57.3571 4.88671 58.0842 5.16801 58.5919 5.73064C59.0995 6.29326 59.3533 7.02741 59.3533 7.9331V8.79762L57.5834 8.38594V7.9331C57.5834 7.52142 57.4702 7.19552 57.2439 6.95537C57.0175 6.71523 56.7191 6.59516 56.3486 6.59516C55.9645 6.59516 55.666 6.71866 55.4534 6.96566C55.2407 7.21267 55.1344 7.54887 55.1344 7.97427C55.1344 8.45456 55.2853 8.88681 55.5872 9.27104C55.889 9.65527 56.2526 10.0258 56.6779 10.3826C57.1032 10.7393 57.5388 11.1064 57.9847 11.4838C58.4306 11.8612 58.7977 12.2831 59.0858 12.7497C59.2367 12.9967 59.3533 13.2677 59.4356 13.5627C59.518 13.8578 59.5591 14.1562 59.5591 14.4581ZM66.9474 14.7875C66.9474 15.2678 66.8651 15.7035 66.7004 16.0945C66.5358 16.4856 66.3094 16.815 66.0213 17.0826C65.7332 17.3502 65.4005 17.556 65.0232 17.7001C64.6459 17.8442 64.2445 17.9162 63.8192 17.9162C63.3802 17.9162 62.9686 17.8442 62.5844 17.7001C62.2002 17.556 61.8675 17.3502 61.5863 17.0826C61.305 16.815 61.0855 16.4856 60.9277 16.0945C60.7699 15.7035 60.691 15.2678 60.691 14.7875V7.9331C60.691 7.46653 60.7699 7.04457 60.9277 6.6672C61.0855 6.28983 61.305 5.96735 61.5863 5.69976C61.8675 5.43217 62.2002 5.22977 62.5844 5.09254C62.9686 4.95532 63.3802 4.88671 63.8192 4.88671C64.2445 4.88671 64.6459 4.95532 65.0232 5.09254C65.4005 5.22977 65.7332 5.43217 66.0213 5.69976C66.3094 5.96735 66.5358 6.28983 66.7004 6.6672C66.8651 7.04457 66.9474 7.46653 66.9474 7.9331V14.7875ZM65.1364 7.9331C65.1364 7.49398 65.006 7.16121 64.7453 6.93479C64.4846 6.70836 64.1759 6.59516 63.8192 6.59516C63.4488 6.59516 63.1366 6.70836 62.8828 6.93479C62.629 7.16121 62.5021 7.49398 62.5021 7.9331V14.7875C62.5021 15.2129 62.629 15.5388 62.8828 15.7652C63.1366 15.9916 63.4488 16.1048 63.8192 16.1048C64.1759 16.1048 64.4846 15.9916 64.7453 15.7652C65.006 15.5388 65.1364 15.2129 65.1364 14.7875V7.9331ZM71.331 6.59516C70.9605 6.59516 70.6484 6.70836 70.3946 6.93479C70.1408 7.16121 70.0139 7.49398 70.0139 7.9331V14.7875C70.0139 15.2129 70.1408 15.5388 70.3946 15.7652C70.6484 15.9916 70.9605 16.1048 71.331 16.1048C71.6877 16.1048 71.9964 15.9951 72.2571 15.7755C72.5178 15.5559 72.6481 15.2266 72.6481 14.7875V14.5816L74.4592 13.9847V14.7875C74.4592 15.3227 74.3769 15.7858 74.2122 16.1769C74.0476 16.568 73.8212 16.8904 73.5331 17.1443C73.2449 17.3982 72.9122 17.5903 72.5349 17.7207C72.1576 17.851 71.7563 17.9162 71.331 17.9162C70.8919 17.9162 70.4803 17.8476 70.0962 17.7104C69.712 17.5731 69.3793 17.3707 69.098 17.1032C68.8168 16.8356 68.5973 16.5097 68.4395 16.1254C68.2817 15.7412 68.2028 15.2952 68.2028 14.7875V7.9331C68.2028 7.37047 68.2817 6.89705 68.4395 6.51282C68.5973 6.12859 68.8168 5.81641 69.098 5.57626C69.3793 5.33612 69.712 5.16116 70.0962 5.05138C70.4803 4.9416 70.8919 4.88671 71.331 4.88671C71.7563 4.88671 72.1576 4.9416 72.5349 5.05138C72.9122 5.16116 73.2449 5.33955 73.5331 5.58655C73.8212 5.83356 74.0476 6.14917 74.2122 6.5334C74.3769 6.91764 74.4592 7.3842 74.4592 7.9331V8.46828H72.6481V7.9331C72.6481 7.49398 72.5178 7.16121 72.2571 6.93479C71.9964 6.70836 71.6877 6.59516 71.331 6.59516ZM77.505 1.96382C77.4913 2.27944 77.4021 2.54702 77.2375 2.76658C77.0729 2.98614 76.8533 3.09592 76.5789 3.09592C76.3045 3.09592 76.0781 2.98614 75.8998 2.76658C75.7214 2.54702 75.6322 2.27944 75.6322 1.96382C75.6322 1.67564 75.7214 1.41835 75.8998 1.19193C76.0781 0.965504 76.3045 0.852295 76.5789 0.852295C76.8533 0.852295 77.0763 0.962074 77.2478 1.18163C77.4193 1.4012 77.505 1.66192 77.505 1.96382ZM77.4433 17.628H75.6322V5.05138H77.4433V17.628ZM84.8933 17.628H83.6997L83.2881 16.9076C83.1371 17.1821 82.9039 17.4188 82.5883 17.6177C82.2728 17.8167 81.8543 17.9162 81.333 17.9162C81.0037 17.9162 80.6744 17.8545 80.3451 17.731C80.0158 17.6075 79.7208 17.4119 79.4602 17.1443C79.1995 16.8767 78.9902 16.5371 78.8325 16.1254C78.6747 15.7137 78.5958 15.2129 78.5958 14.6228C78.5958 14.0053 78.6781 13.4598 78.8428 12.9864C79.0074 12.513 79.2201 12.091 79.4807 11.7205C79.7414 11.35 80.0364 11.0172 80.3657 10.7222C80.695 10.4272 81.0242 10.1596 81.3535 9.91943C81.6828 9.67928 81.9984 9.44943 82.3002 9.22987C82.6021 9.01031 82.8628 8.78389 83.0823 8.55061V7.9331C83.0823 7.53514 82.9965 7.21267 82.825 6.96566C82.6535 6.71866 82.3825 6.59516 82.0121 6.59516C81.3124 6.59516 80.8665 6.87646 80.6744 7.43909L79.1515 6.45107C79.2887 6.24523 79.4361 6.04626 79.5939 5.85414C79.7517 5.66203 79.9438 5.49393 80.1702 5.34984C80.3966 5.20575 80.6607 5.09254 80.9625 5.01021C81.2644 4.92787 81.6211 4.88671 82.0327 4.88671C82.897 4.88671 83.5899 5.15429 84.1113 5.68947C84.6326 6.22465 84.8933 6.97252 84.8933 7.9331V17.628ZM83.1234 10.8972C82.8902 11.0481 82.6158 11.2299 82.3002 11.4426C81.9847 11.6553 81.6828 11.9092 81.3947 12.2042C81.1066 12.4993 80.863 12.832 80.6641 13.2025C80.4652 13.573 80.3657 13.9916 80.3657 14.4581C80.3657 14.9796 80.4823 15.3844 80.7155 15.6726C80.9488 15.9608 81.2849 16.1048 81.724 16.1048C82.2042 16.1048 82.5575 15.9402 82.7839 15.6108C83.0102 15.2815 83.1234 14.8973 83.1234 14.4581V10.8972ZM88.0421 17.628H86.231V1.44922L88.0421 0.852295V17.628Z",fill:"#D1D1D1"}),r.createElement("path",{d:"M48.0547 4.88671C48.5349 4.88671 48.9328 4.91758 49.2484 4.97933C49.5639 5.04108 49.7972 5.11313 49.9481 5.19546H52.1913L51.3064 6.57457V11.5147C51.3064 12.3792 51.08 13.0653 50.6272 13.573C50.1745 14.0808 49.4267 14.3827 48.384 14.4787C47.9038 14.5199 47.5951 14.6297 47.4579 14.8081C47.3207 14.9865 47.2521 15.1717 47.2521 15.3638C47.2521 15.4873 47.2967 15.628 47.3859 15.7858C47.475 15.9436 47.6225 16.0362 47.8283 16.0637H51.7591L50.7507 17.875H47.0669C46.3397 17.875 45.9761 18.122 45.9761 18.6161C45.9761 18.8768 46.0687 19.0655 46.2539 19.1821C46.4392 19.2987 46.669 19.3571 46.9434 19.3571H50.2568L49.2689 21.1479H46.9022C46.0378 21.1479 45.3724 20.9214 44.9059 20.4686C44.4395 20.0157 44.2062 19.4051 44.2062 18.6366C44.2062 18.0191 44.388 17.4977 44.7516 17.0723C45.1152 16.6469 45.6262 16.3518 46.2848 16.1872C46.0653 16.1186 45.9075 16.0019 45.8115 15.8372C45.7154 15.6726 45.6674 15.4873 45.6674 15.2815C45.6674 15.0894 45.7463 14.8938 45.9041 14.6949C46.0619 14.4959 46.3191 14.3552 46.6758 14.2729C45.5782 13.7103 45.0294 12.7909 45.0294 11.5147V7.9331C45.0294 6.98624 45.3004 6.2418 45.8423 5.69976C46.3843 5.15772 47.1217 4.88671 48.0547 4.88671ZM2.96355 2.14907V5.05138H5.35085V6.65691H2.96355V14.8081C2.96355 15.6726 3.27224 16.1048 3.88965 16.1048C4.27382 16.1048 4.54822 15.9676 4.71286 15.6932L5.96825 17.0517C5.73501 17.3261 5.43317 17.5388 5.06272 17.6898C4.69228 17.8407 4.3287 17.9162 3.97197 17.9162C3.02528 17.9162 2.3187 17.6521 1.85222 17.1237C1.38573 16.5954 1.15249 15.8235 1.15249 14.8081V6.65691H0V5.05138H1.15249V2.76658L2.96355 2.14907ZM13.727 5.05138V14.7875C13.727 15.2129 13.847 15.5388 14.0871 15.7652C14.3272 15.9916 14.6325 16.1048 15.0029 16.1048C15.3597 16.1048 15.6615 15.9985 15.9085 15.7858C16.1554 15.5731 16.2789 15.2403 16.2789 14.7875V5.05138H18.09V17.628H16.8963L16.4847 17.0311C16.3612 17.2095 16.1589 17.4016 15.8776 17.6075C15.5963 17.8133 15.1607 17.9162 14.5708 17.9162C13.7476 17.9162 13.0993 17.628 12.6259 17.0517C12.1526 16.4753 11.9159 15.652 11.9159 14.5816V5.05138H13.727ZM22.597 4.88671C23.5437 4.88671 24.2709 5.16801 24.7785 5.73064C25.2862 6.29326 25.54 7.02741 25.54 7.9331V8.79762L23.7701 8.38594V7.9331C23.7701 7.52142 23.6569 7.19552 23.4305 6.95537C23.2041 6.71523 22.9057 6.59516 22.5353 6.59516C22.1511 6.59516 21.8527 6.71866 21.6401 6.96566C21.4274 7.21267 21.3211 7.54887 21.3211 7.97427C21.3211 8.45456 21.472 8.88681 21.7738 9.27104C22.0757 9.65527 22.4392 10.0258 22.8646 10.3826C23.2899 10.7393 23.7255 11.1064 24.1714 11.4838C24.6173 11.8612 24.9843 12.2831 25.2725 12.7497C25.4234 12.9967 25.54 13.2677 25.6223 13.5627C25.7046 13.8578 25.7458 14.1562 25.7458 14.4581C25.7458 14.911 25.6806 15.3432 25.5503 15.7549C25.4199 16.1666 25.221 16.5337 24.9535 16.8561C24.6859 17.1786 24.3498 17.4359 23.945 17.628C23.5403 17.8202 23.0567 17.9162 22.4941 17.9162C22.0276 17.9162 21.6023 17.8407 21.2182 17.6898C20.834 17.5388 20.5013 17.3261 20.22 17.0517C19.9388 16.7772 19.7227 16.4479 19.5717 16.0637C19.4208 15.6794 19.3454 15.254 19.3454 14.7875V13.923L21.1564 14.3141V14.7875C21.1564 15.1854 21.2799 15.5045 21.5269 15.7446C21.7738 15.9848 22.0962 16.1048 22.4941 16.1048C23.4271 16.1048 23.8936 15.6657 23.8936 14.7875C23.8936 14.4581 23.8524 14.1803 23.7701 13.9538C23.6878 13.7274 23.5712 13.5182 23.4202 13.326C23.2007 13.079 22.9675 12.8526 22.7205 12.6468C22.4736 12.4409 22.2232 12.2351 21.9693 12.0293C21.7155 11.8234 21.4651 11.6107 21.2182 11.3912C20.9712 11.1716 20.738 10.9315 20.5184 10.6707C20.2166 10.3139 19.9731 9.916 19.7878 9.47688C19.6026 9.03776 19.51 8.53003 19.51 7.95368C19.51 7.50084 19.5855 7.08574 19.7364 6.70837C19.8873 6.331 20.1 6.00852 20.3744 5.74093C20.6488 5.47334 20.9746 5.26408 21.3519 5.11313C21.7292 4.96218 22.1443 4.88671 22.597 4.88671ZM29.6355 2.14907V5.05138H32.0228V6.65691H29.6355V14.8081C29.6355 15.6726 29.9442 16.1048 30.5616 16.1048C30.9457 16.1048 31.2201 15.9676 31.3848 15.6932L32.6402 17.0517C32.4069 17.3261 32.1051 17.5388 31.7346 17.6898C31.3642 17.8407 31.0006 17.9162 30.6439 17.9162C29.6972 17.9162 28.9906 17.6521 28.5241 17.1237C28.0576 16.5954 27.8244 15.8235 27.8244 14.8081V6.65691H26.6719V5.05138H27.8244V2.76658L29.6355 2.14907ZM10.1049 4.88671C10.5851 4.88671 10.9418 5.00335 11.175 5.23663L10.5576 6.86274C10.4616 6.75296 10.2764 6.69807 10.002 6.69807C9.6864 6.69807 9.40514 6.83187 9.15818 7.09946C8.91121 7.36705 8.78773 7.70668 8.78773 8.11835V17.628H6.97668V5.05138H8.17033L8.58193 5.85414C8.6917 5.63458 8.87348 5.41845 9.12731 5.20575C9.38113 4.99305 9.70698 4.88671 10.1049 4.88671ZM35.3979 5.05138V17.628H33.5868V5.05138H35.3979ZM40.3166 4.88671C41.1809 4.88671 41.8772 5.15772 42.4054 5.69976C42.9337 6.2418 43.1978 6.96566 43.1978 7.87135V17.628H41.3867V7.9331C41.3867 7.49398 41.2427 7.16121 40.9545 6.93479C40.6664 6.70836 40.3371 6.59516 39.9667 6.59516C39.61 6.59516 39.2841 6.70836 38.9891 6.93479C38.6942 7.16121 38.5467 7.49398 38.5467 7.9331V17.628H36.7356V5.05138H37.9293L38.3409 5.6483C38.5467 5.41502 38.8005 5.22977 39.1023 5.09254C39.4042 4.95532 39.8089 4.88671 40.3166 4.88671ZM48.1576 6.55399C47.7872 6.55399 47.4682 6.66034 47.2006 6.87304C46.9331 7.08574 46.7993 7.42536 46.7993 7.89193V11.5558C46.7993 11.995 46.9331 12.3243 47.2006 12.5439C47.4682 12.7634 47.7872 12.8732 48.1576 12.8732C48.5143 12.8732 48.8299 12.7634 49.1043 12.5439C49.3787 12.3243 49.5159 11.995 49.5159 11.5558V7.89193C49.5159 7.42536 49.3787 7.08574 49.1043 6.87304C48.8299 6.66034 48.5143 6.55399 48.1576 6.55399ZM34.5335 0.852295C34.8079 0.852295 35.0309 0.962074 35.2024 1.18163C35.3739 1.4012 35.4596 1.66192 35.4596 1.96382C35.4459 2.27944 35.3567 2.54702 35.1921 2.76658C35.0275 2.98614 34.8079 3.09592 34.5335 3.09592C34.2591 3.09592 34.0327 2.98614 33.8544 2.76658C33.676 2.54702 33.5868 2.27944 33.5868 1.96382C33.5868 1.67564 33.676 1.41835 33.8544 1.19193C34.0327 0.965504 34.2591 0.852295 34.5335 0.852295Z",fill:"#D1D1D1"}))};rB.defaultProps={className:""},rB.propTypes={className:h.string};var tB,nB,aB,oB=m.div(Zk||(Zk=L(["\n display: flex;\n flex-direction: row;\n gap: 8px;\n width: fit-content;\n"]))),iB=m.div($k||($k=L(["\n border: 0;\n border-left: 1px solid #e5e5e5;\n width: 1px;\n"]))),sB=m(rB)(Jk||(Jk=L(["\n margin-block: auto;\n transform: scale(0.75);\n"]))),cB=m.span(eB||(eB=L(["\n color: #d1d1d1;\n width: max-content;\n font-size: 13px;\n"]))),uB=function(e){var t=e.className;return r.createElement(oB,{className:t},r.createElement(sB,null),r.createElement(iB,null),r.createElement(cB,null,"AI-powered vision",r.createElement("br",null),"by Trusting Social"))};uB.defaultProps={className:""},uB.propTypes={className:h.string};var lB,dB,fB=m.div(tB||(tB=L(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n\n background-color: white;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n"]))),pB=m.div(nB||(nB=L(["\n & > img {\n width: 100%;\n }\n\n ","\n"])),Dh),hB=m.p(aB||(aB=L(["\n color: #1d1d1d;\n font-size: 20px;\n"]))),mB=function(){var e=Nn.useAsset("loader.jpg"),t=ww();return r.createElement(fB,null,r.createElement(pB,null,r.createElement("img",{src:e,className:"spin",alt:"loading-icon"})),r.createElement(hB,null,t("processing_result")))},gB=m.div(lB||(lB=L(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n\n background-color: white;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n"]))),vB=m.p(dB||(dB=L(["\n color: #1d1d1d;\n font-size: 24px;\n text-align: center;\n"])));function yB(e){var t=e.error,n=e.onRetry,a=e.onDone,o=Nn.useAsset(t?"yellow-exclamation.jpg":"green-checked.jpg"),i=ww();return r.createElement(gB,null,t?r.createElement(r.Fragment,null,r.createElement("img",{src:o,alt:"result-icon",width:"130"}),r.createElement(vB,null,i("face_authentication.unsuccessful")),r.createElement(pw,{onClick:n},i("retry"))):r.createElement(r.Fragment,null,r.createElement("img",{src:o,alt:"result-icon",width:"130"}),r.createElement(vB,null,i("face_authentication.successful")),r.createElement(pw,{onClick:a},i("continue"))))}yB.defaultProps={error:null,onRetry:function(){},onDone:function(){}},yB.propTypes={error:h.shape({}),onRetry:h.func,onDone:h.func};var bB,CB={instruction:{flashing:{color:"white",backgroundColor:"#E54D2E"}}},wB=["onDone","debug"],kB=m(uB)(bB||(bB=L(["\n position: fixed;\n bottom: 20px;\n left: 50%;\n transform: translateX(-50%);\n z-index: ",";\n\n // Hide trademark\n display: none;\n"])),1010),BB=0,EB=1,SB=2,_B=3;function AB(e){var t=e.onDone,n=e.debug,a=N(e,wB),o=O(c(BB),2),s=o[0],u=o[1],l=O(c(null),2),d=l[0],f=l[1],p=$t.useSDKSettings().lang,h=Sk(),m=function(){var r=S(regeneratorRuntime.mark((function r(t){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,u(SB),"function"!=typeof e.onFlashDone){r.next=5;break}return r.next=5,e.onFlashDone(t);case 5:r.next=10;break;case 7:r.prev=7,r.t0=r.catch(0),f({error:r.t0});case 10:return r.prev=10,u(_B),r.finish(10);case 13:case"end":return r.stop()}}),r,null,[[0,7,10,13]])})));return function(e){return r.apply(this,arguments)}}();return i((function(){h("selfie","user_activity.start")}),[h]),r.createElement(C,{theme:CB},r.createElement(mg,null,r.createElement(gw,{lang:p},r.createElement(Kw,{debug:n},r.createElement("div",null,s===BB&&r.createElement(Aw,{onStart:function(){u(EB)}}),s===EB&&r.createElement(Yk,I({},a,{onFlashDone:m})),s===SB&&r.createElement(mB,null),s===_B&&r.createElement(yB,{onRetry:function(){u(BB)},error:d,onDone:t}),r.createElement(kB,null))))))}AB.defaultProps={onFlashDone:function(){},onDone:function(){},debug:!1},AB.propTypes={onFlashDone:h.func,onDone:h.func,debug:h.bool};var IB=function(e){var t=e.value,n=e.children,a=Ek("data.settings.sdk_settings.server_log_settings.enable"),o=null!=a?a:null==t?void 0:t.enable;return r.createElement(Pn.SDKTrackingProvider,{value:{tracking:x(x({},t),{},{enable:o})}},n)};IB.propTypes={value:h.shape({enable:h.bool,accessKey:h.string,secretKey:h.string,apiUrl:h.string}).isRequired,children:h.node.isRequired};var TB,xB,PB,RB,DB,NB,LB,OB=function(e){var t=e.apiCredentials,n=e.onFlashDone,a=Fo.useApiClient({apiCredentials:t}).apiClient,i=function(e){var r=e.apiClient,t=O(c(!1),2),n=t[0],a=t[1],i=O(c(""),2),s=i[0],u=i[1];return{apiLoading:n,apiError:s,verifyFaceLiveness:o(function(){var e=S(regeneratorRuntime.mark((function e(t){var n,o,i,s,c,l,d,f,p,h,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.motionData,o=t.orientationData,i=t.frames,s=t.images,c=t.flashSettings,l=t.frameInterval,e.prev=1,a(!0),u(""),e.next=6,Promise.all(s.map((function(e){return r.uploadImage({label:"portrait",file:e})})));case 6:return d=e.sent,f=i[Lw],p=i[Ow],h=[f[f.length-1]].concat(M(p)),e.next=12,r.verifyFaceLiveness({images:d.map((function(e){var r;return{id:null==e||null===(r=e.data)||void 0===r?void 0:r.image_id,label:"portrait"}})),videos:[{frames:f.map((function(e){var r=e.base64,t=e.label,n=e.index,a=e.color;return{base64:r,label:t,index:n,metadata:JSON.stringify({color:a})}}))},{frames:h.map((function(e){var r=e.base64,t=e.label,n=e.index,a=e.color;return{base64:r,label:t,index:n,metadata:JSON.stringify({color:a})}}))}],metadata:{face_infos:{motionData:n,ori:o},colors:c.colors,frames_per_color:c.framesPerColor,frame_interval:l,delay_between_colors:c.delayBetweenColors,use_face_detector_when_flashing:c.useFaceDetectorWhenFlashing}});case 12:if(!(m=e.sent).errors){e.next=15;break}throw new Error(JSON.stringify(m.errors[0].message));case 15:return e.abrupt("return",m);case 18:return e.prev=18,e.t0=e.catch(1),console.error(e.t0),u(e.t0),e.abrupt("return",null);case 23:return e.prev=23,a(!1),e.finish(23);case 26:case"end":return e.stop()}}),e,null,[[1,18,23,26]])})));return function(r){return e.apply(this,arguments)}}(),[r])}}({apiClient:a}).verifyFaceLiveness,s=e.flashSettings,u=e.frameInterval,l=function(){var e=S(regeneratorRuntime.mark((function e(r){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i({frames:r.frames,images:r.images,flashSettings:s,frameInterval:u});case 3:return t=e.sent,e.next=6,n(r,t);case 6:e.next=12;break;case 8:throw e.prev=8,e.t0=e.catch(0),console.error(e.t0),e.t0;case 12:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(r){return e.apply(this,arguments)}}();return r.createElement(kk,{apiClient:a},r.createElement(IB,{value:x({enable:!0},t)},r.createElement(AB,I({},e,{onFlashDone:l}))))},MB=function(){return{checkCamera:og,LivenessDetection:vg,NativeCamera:sg,ReadIDCardUIOnly:Tb,ReadIDCardWithApiCall:Qb,EkycFlow:lw,warmUpReadIdCard:hv,preloadEKYCResources:Yb,getListCamera:Hc,FlashLiveness:OB}},FB=pp,UB=N(ag,["useLivenessDetection"]);function VB(e){var t=e.className;return r.createElement("svg",{className:t,width:"320",height:"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M320 0H0V320H320V0ZM160 296C235.111 296 296 235.111 296 160C296 84.8893 235.111 24 160 24C84.8893 24 24 84.8893 24 160C24 235.111 84.8893 296 160 296Z",fill:"currentColor"}))}VB.propTypes={className:h.string},VB.defaultProps={className:""};var jB,zB,KB,HB,qB,GB,WB,QB,XB,YB,ZB,$B,JB=(A(TB={},K.FaceDirection.LEFT,90),A(TB,K.FaceDirection.RIGHT,270),A(TB,K.FaceDirection.UP,180),A(TB,K.FaceDirection.DOWN,0),TB),eE=v(["0%{opacity:0.15;}50%{opacity:0.3;}100%{opacity:1;}"]),rE=m.div(xB||(xB=L(["\n width: 200px;\n height: 200px;\n position: relative;\n transform: scale(0.48);\n\n .top,\n .right,\n .bottom,\n .left {\n position: absolute;\n }\n\n .top {\n top: 0;\n left: 50%;\n transform: rotate(","deg) translateX(-50%);\n }\n\n .right {\n right: 0;\n top: 50%;\n transform: rotate(","deg) translateX(-50%);\n }\n\n .bottom {\n bottom: 0;\n left: 50%;\n transform: rotate(","deg) translateX(50%);\n }\n\n .left {\n left: 0;\n top: 50%;\n transform: rotate(","deg) translateX(50%);\n }\n"])),JB[K.FaceDirection.DOWN],JB[K.FaceDirection.LEFT],JB[K.FaceDirection.UP],JB[K.FaceDirection.RIGHT]),tE=m.div(PB||(PB=L(["\n width: 70px;\n transform: rotate(","deg);\n"])),(function(e){var r,t=e.direction;return null!==(r=JB[t])&&void 0!==r?r:0})),nE=m.span(RB||(RB=L(["\n display: flex;\n margin: 4px 0;\n width: 100%;\n height: 15px;\n animation: "," 1s infinite;\n animation-direction: alternate;\n\n &::before,\n &::after {\n content: '';\n height: 100%;\n width: 50%;\n background: rgba(255, 255, 255, 0.8);\n }\n\n &::before {\n transform: skewY(32deg);\n }\n\n &::after {\n width: 50%;\n transform: skewY(-32deg);\n }\n"])),eE),aE=m(nE)(DB||(DB=L(["\n animation-delay: 0s;\n"]))),oE=m(nE)(NB||(NB=L(["\n animation-delay: 0.5s;\n"]))),iE=m(nE)(LB||(LB=L(["\n animation-delay: 1s;\n"])));function sE(e){var t=e.type;return t!==K.FaceDirection.FRONTAL?r.createElement(tE,{direction:t},r.createElement(aE,null),r.createElement(oE,null),r.createElement(iE,null)):r.createElement(rE,null,r.createElement(tE,{className:"top"},r.createElement(aE,null),r.createElement(oE,null),r.createElement(iE,null)),r.createElement(tE,{className:"right"},r.createElement(aE,null),r.createElement(oE,null),r.createElement(iE,null)),r.createElement(tE,{className:"bottom"},r.createElement(aE,null),r.createElement(oE,null),r.createElement(iE,null)),r.createElement(tE,{className:"left"},r.createElement(aE,null),r.createElement(oE,null),r.createElement(iE,null)))}sE.propTypes={type:h.oneOf([K.FaceDirection.LEFT,K.FaceDirection.RIGHT,K.FaceDirection.UP,K.FaceDirection.FRONTAL])},sE.defaultProps={type:K.FaceDirection.LEFT};var cE=650,uE=750,lE=wu,dE=UB.Text,fE=UB.FaceDetectionError,pE=UB.FaceVerificationInstructions,hE=UB.FaceVerificationStepsWrapper,mE=UB.StepItem,gE=UB.BottomButtonsOverlay,vE=UB.Button,yE=UB.CountDownOverlay,bE=UB.InstructionsOverlay,CE=m(hE)(jB||(jB=L(["\n height: 50px;\n"]))),wE=m(dE)(zB||(zB=L(["\n position: absolute;\n font-style: normal;\n font-weight: bold;\n font-size: 1.5rem;\n text-align: center;\n padding: 0 1.75rem;\n color: ",";\n\n ","\n\n ",";\n"])),(function(e){return e.color}),(function(e){var r=e.top;return r&&b(["top:","px;"],r)}),(function(e){return e.isMobile&&b(["font-size:1.125rem;"])})),kE=m(fE)(KB||(KB=L(["\n position: absolute;\n font-size: 1.125rem;\n text-align: center;\n\n ",";\n"])),(function(e){return e.isMobile&&b(["font-size:0.875rem;"])})),BE=m(pE)(HB||(HB=L(["\n position: absolute;\n font-size: 1.125rem;\n text-align: center;\n padding: 0 1.75rem;\n color: ",";\n text-shadow: none;\n\n ",";\n"])),(function(e){return e.color}),(function(e){return e.isMobile&&b(["font-size:0.875rem;"])})),EE=m(VB)(qB||(qB=L(["\n width: 100%;\n height: 100%;\n vertical-align: middle;\n margin: 0;\n color: ",";\n"])),(function(e){var r=e.color;return null!=r?r:"#06243c"})),SE=m.img(GB||(GB=L(["\n && {\n width: 20px;\n border-radius: 50%;\n margin: 0;\n\n ","\n }\n"])),(function(e){return"preview"===e.mode&&b(["width:42px;"])})),_E=m(mE)(WB||(WB=L(["\n width: 50px;\n height: 50px;\n border: 1px solid #005993;\n border-radius: 50%;\n\n & + & {\n margin-left: 10px;\n }\n\n ","\n"])),(function(e){return!e.active&&b(["border-color:#f2f6f9;opacity:0.3;"])})),AE=m(Ip)(QB||(QB=L(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"]))),IE=m.div(XB||(XB=L(["\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n z-index: -1;\n"]))),TE=m(IE)(YB||(YB=L(["\n background: rgba(223, 0, 0, 0.2);\n"]))),xE=v(["from{opacity:1;}to{opacity:0;}"]),PE=m(IE)(ZB||(ZB=L(["\n background: rgba(255, 255, 255, 0.3);\n animation: "," 1s infinite;\n"])),xE),RE=qs.isMobile?{width:640}:null;function DE(e){var t=e.className,a=e.apiCheck,i=e.enableInstructionsOverlay,s=e.enableErrorOverlay,c=e.enableCapturingOverlay,u=e.frontalMinSize,l=e.mode,d=e.minPadding,f=e.backgroundColor,p=e.textColor,h=e.progressProps,m=e.title,g=e.description,v=e.customInstructions,y=e.customIcon,b=e.customDirectionIcon,C=e.onLivenessDetectionDone,w=e.onClose,k=e.onError,B=e.captureFrameSettings,E=e.onFramesCaptured,S=e.livenessSettings,_=e.initFirstGestureTimeout,A=o((function(e){var r=e.clientWidth,t=e.clientHeight,n=e.videoAreaWidth,a=e.videoAreaHeight,o=e.lostX,i=e.lostY,s=Math.max(80,i),c=Math.max(140,i);t>cE&&(s=Math.max(110,i),c=Math.max(170,i)),t>uE&&(s=Math.max(140,i),c=Math.max(200,i));var u=Math.max(d,o),l=Math.max(d,o),f=Math.min(n,a),p=Math.max(Math.floor(Math.min(r-(u+l),t-(s+c),f)),160);return{x:Math.min(Math.floor(u+(r-l-u)/2-p/2),r-p),y:Math.min(Math.floor(s+(t-c-s)/2-p/2),t-p),width:p,height:p}}),[d]),T=n((function(){return{background:f,opacity:1}}),[f]),x=FB({apiCheck:a,frontalMinSize:u,mode:l,bgCameraMask:null,bgCameraMaskRed:null,surroundStyle:T,cropAreaDimension:A,customInstructions:v,customIcon:y,customDirectionIcon:b,onLivenessDetectionDone:C,captureFrameSettings:B,onFramesCaptured:E,livenessSettings:S,initFirstGestureTimeout:_}),P=x.countdownToTakePicture,R=x.cropArea,D=x.curStepIndex,N=x.directionIcon,L=x.faceDetectionError,O=x.handleTriggerPassiveMode,M=x.handleVideoPlayed,F=x.instructions,U=x.isActiveMode,V=x.refVideo,j=x.showCountdown,z=x.steps,K=x.videoPlayed,H=x.activeCapturing,q=x.warmupDone,G=10,W=45,Q=2,X=50,Y=12,Z=14;window.innerHeight>cE&&(G=25,W=65,Q=3,X=50,Y=24,Z=34),window.innerHeight>uE&&(G=30,W=80,Q=5,X=50,Y=32,Z=54);var $=R.current?R.current.y+R.current.height+Q:0,J=Z+X+Y,ee=s&&L;return r.createElement(hu,{ref:V,className:t,frontCamera:!0,flipHorizontal:!0,videoSettings:RE,onVideoPlayed:M,onClose:w,onError:k},!q&&r.createElement(qp,null),K?r.createElement(r.Fragment,null,r.createElement(wE,{top:G,isMobile:qs.isMobile,color:p},m),R.current?r.createElement(Cu,{x:"".concat(R.current.x,"px"),y:"".concat(R.current.y,"px"),width:"".concat(R.current.width,"px"),height:"".concat(R.current.height,"px"),surroundStyle:R.current.surroundStyle},r.createElement(EE,{color:f}),r.createElement(AE,I({progress:D/z.length*100,hasError:ee},h)),j?r.createElement(yE,null,P):null,U&&i&&N?r.createElement(bE,null,N):null,U&&c&&H?r.createElement(PE,null):null,ee?r.createElement(TE,null):null):null,L?r.createElement(kE,{top:$,isMobile:qs.isMobile,error:L}):null,U?r.createElement(r.Fragment,null,r.createElement(BE,{top:W,isMobile:qs.isMobile,color:p},g),F?r.createElement(BE,{bottom:J,isMobile:qs.isMobile,color:p},F):null,r.createElement(CE,{bottom:Z},z.map((function(e,t){var n=e.name,a=e.icon,o=e.image.objUrl,i=D>=t;return r.createElement(_E,{key:n,active:i},o?r.createElement(SE,{src:o,alt:"",mode:"preview"}):function(e,t){return"string"==typeof e?r.createElement(SE,{src:e,alt:""}):r.cloneElement(e,t)}(a,{active:i}))})))):r.createElement(r.Fragment,null,L?null:r.createElement(gE,null,r.createElement(vE,{onClick:O},r.createElement(lE,null))))):null)}DE.propTypes={className:h.string,apiCheck:h.bool,enableInstructionsOverlay:h.bool,enableErrorOverlay:h.bool,enableCapturingOverlay:h.bool,frontalMinSize:h.number,mode:h.string,minPadding:h.number,backgroundColor:h.string,textColor:h.string,progressProps:h.shape({className:h.string,style:h.shape({}),radius:h.number,strokeWidth:h.number,progress:h.number,activeColor:h.string,innerPadding:h.number,outsideRingColor:h.string,insideRingColor:h.string,insideRingWidth:h.number,dashedRingColor:h.string,dashedRingWidth:h.number,dashedRingLineThick:h.number,dashedRingLineSpacing:h.number,showOutsideRing:h.bool,showDashedRing:h.bool,showInsideRing:h.bool}),title:h.string,description:h.string,customInstructions:h.shape({}),customIcon:h.shape({}),customDirectionIcon:h.shape({}),onLivenessDetectionDone:h.func,onClose:h.func,onError:h.func,captureFrameSettings:h.shape({}),onFramesCaptured:h.func,livenessSettings:h.shape({}),initFirstGestureTimeout:h.number},DE.defaultProps={className:"",apiCheck:!1,enableInstructionsOverlay:!1,enableErrorOverlay:!1,enableCapturingOverlay:!1,frontalMinSize:720,mode:null,minPadding:30,backgroundColor:"#06243c",textColor:"#ffffff",progressProps:null,title:"Chụp ảnh chân dung",description:"Xin đưa khuôn mặt vào khung hình. Hình ảnh sẽ tự động được ghi lại.",customInstructions:null,customIcon:null,customDirectionIcon:($B={},A($B,K.FaceDirection.LEFT,r.createElement(sE,{type:K.FaceDirection.LEFT})),A($B,K.FaceDirection.RIGHT,r.createElement(sE,{type:K.FaceDirection.RIGHT})),A($B,K.FaceDirection.UP,r.createElement(sE,{type:K.FaceDirection.UP})),A($B,K.FaceDirection.FRONTAL,r.createElement(sE,{type:K.FaceDirection.FRONTAL})),$B),onLivenessDetectionDone:null,onClose:null,onError:function(){},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},onFramesCaptured:function(){},livenessSettings:null,initFirstGestureTimeout:2e3};export{Fo as APIUtils,Lh as Animations,fi as AntiDebugUtils,Nn as AssetUtils,On as AsyncUtils,ru as BASE_Z_INDEX,Us as BaseTVWebSDK,ia as BlurUtils,Lv as Button,Ov as ButtonLink,hu as Camera,ca as CameraUtils,ou as CloseButton,Ns as CloseEyesDetector,la as CommonUtils,K as Constants,ga as CoordinateUtils,Cu as CropAreaOverlayWrapper,mi as CryptoUtils,Ds as DEFAULT_CLOSE_EYE_MODEL,Rs as ExifUtils,Ea as FaceUtils,To as GlareUtils,Bn as HashUtils,Dy as HighlightResult,_y as HighlightResultType,ug as Icons,So as ImageUtils,DE as LivenessDetection,UB as LivenessDetectionComponents,Wo as LoadResourceUtils,bn as LocalStorageUtils,Ws as MobileDetect,di as ModelUtils,sg as NativeCamera,mg as OrientationDetection,bu as PlacementArea,zp as Popup,_a as PredictionUtils,Ip as ProgressCircle,Cy as QRCodeScanner,Zv as RatioWrapper,Tb as ReadIDCardUIOnly,Qb as ReadIDCardWithApiCall,Mh as RectangleMask,Oh as RectangleMaskType,js as SDKAdapter,gi as SDKTimer,Yy as ScannerType,$t as SettingsContext,Pv as Spacing,pi as ThemeUtils,gn as TimeUtils,Pn as TrackingContext,Gy as UIOnlyDefaultProps,qy as UIOnlyPropTypes,pn as UserAgentUtils,qp as WarmupPopup,og as checkCamera,Eb as defaultClientSettings,Zy as defaultReadIDCardSteps,MB as getBaseSDKComponent,Wt as getCustomUrlsBySettings,Ms as getQrScannerWorkerPath,dn as getSDKVersion,Kb as handleApiCheckReadIdCard,Yb as preloadEKYCResources,Zb as readIdCardFromImage,iy as readQRFromFrontImage,Ls as requestMotionPermission,Os as useDeviceMotion,FB as useLivenessDetection,by as useMainProcessQRCodeScanner,wv as useMainProcessReadIdCard,Sb as useSettingsReadIdCard,Ag as useShowPopup,cv as warmUpQRCodeScanner,hv as warmUpReadIdCard,Xf as warmupSelfieActive};
|
|
71
|
+
*/function Ic(e){if("object"==typeof e&&null!==e){var r=e.$$typeof;switch(r){case lc:switch(e=e.type){case vc:case yc:case fc:case hc:case pc:case Cc:return e;default:switch(e=e&&e.$$typeof){case gc:case bc:case Bc:case kc:case mc:return e;default:return r}}case dc:return r}}}function Tc(e){return Ic(e)===yc}var xc={AsyncMode:vc,ConcurrentMode:yc,ContextConsumer:gc,ContextProvider:mc,Element:lc,ForwardRef:bc,Fragment:fc,Lazy:Bc,Memo:kc,Portal:dc,Profiler:hc,StrictMode:pc,Suspense:Cc,isAsyncMode:function(e){return Tc(e)||Ic(e)===vc},isConcurrentMode:Tc,isContextConsumer:function(e){return Ic(e)===gc},isContextProvider:function(e){return Ic(e)===mc},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===lc},isForwardRef:function(e){return Ic(e)===bc},isFragment:function(e){return Ic(e)===fc},isLazy:function(e){return Ic(e)===Bc},isMemo:function(e){return Ic(e)===kc},isPortal:function(e){return Ic(e)===dc},isProfiler:function(e){return Ic(e)===hc},isStrictMode:function(e){return Ic(e)===pc},isSuspense:function(e){return Ic(e)===Cc},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===fc||e===yc||e===hc||e===pc||e===Cc||e===wc||"object"==typeof e&&null!==e&&(e.$$typeof===Bc||e.$$typeof===kc||e.$$typeof===mc||e.$$typeof===gc||e.$$typeof===bc||e.$$typeof===Sc||e.$$typeof===_c||e.$$typeof===Ac||e.$$typeof===Ec)},typeOf:Ic},Pc=(Hs((function(e,r){})),Hs((function(e){e.exports=xc}))),Rc={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Dc={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Nc={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Lc={};function Oc(e){return Pc.isMemo(e)?Nc:Lc[e.$$typeof]||Rc}Lc[Pc.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Lc[Pc.Memo]=Nc;var Mc=Object.defineProperty,Fc=Object.getOwnPropertyNames,Uc=Object.getOwnPropertySymbols,Vc=Object.getOwnPropertyDescriptor,jc=Object.getPrototypeOf,zc=Object.prototype;var Kc=function e(r,t,n){if("string"!=typeof t){if(zc){var a=jc(t);a&&a!==zc&&e(r,a,n)}var o=Fc(t);Uc&&(o=o.concat(Uc(t)));for(var i=Oc(r),s=Oc(t),c=0;c<o.length;++c){var u=o[c];if(!(Dc[u]||n&&n[u]||s&&s[u]||i&&i[u])){var l=Vc(t,u);try{Mc(r,u,l)}catch(e){}}}}return r};function Hc(){return"function"==typeof navigator.enumerateDevices?navigator.enumerateDevices():"object"===B(navigator.mediaDevices)&&"function"==typeof navigator.mediaDevices.enumerateDevices?navigator.mediaDevices.enumerateDevices():new Promise((function(e,r){try{if(null==window.MediaStreamTrack||null==window.MediaStreamTrack.getSources)throw new Error;window.MediaStreamTrack.getSources((function(r){e(r.filter((function(e){return"video"===e.kind.toLowerCase()||"videoinput"===e.kind.toLowerCase()})).map((function(e){return{deviceId:null!=e.deviceId?e.deviceId:"",groupId:e.groupId,kind:"videoinput",label:e.label,toJSON:function(){return this}}})))}))}catch(e){return r(e)}}))}var qc,Gc,Wc,Qc,Xc,Yc=["camtwist","manycam","obs virtual","logi capture","iglasses","splitcam","virtual"],Zc=function(e){if(!e)return{isVirtual:!1};var r=e.getTracks();if(!r||!r.length)return{isVirtual:!1};var t=r[0].label,n=t&&Yc.some((function(e){return t.toLowerCase().includes(e)}));return{deviceLabel:t,isVirtual:n}},$c=function(e,r){return!e||(1===navigator.maxTouchPoints||navigator.plugins.length>0&&!r)},Jc=function(){var e,r;return{updateTime:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"start";"start"===n?e=t:"end"===n&&(r=t)},getStart:function(){return e},getEnd:function(){return r}}},eu=K.Errors,ru=1e3,tu=m.div(qc||(qc=L(["\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background: #000;\n display: flex;\n justify-content: center;\n z-index: ",";\n ","\n"])),1e3,(function(e){return e.checkCameraMode&&"opacity: 0;"})),nu=m.video(Gc||(Gc=L(["\n width: 100%;\n ","\n"])),(function(e){return e.flipHorizontal&&"\n transform: scale(".concat(-1*e.scale,", ").concat(1*e.scale,");\n ")})),au=m.div(Wc||(Wc=L(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),ou=m(au)(Qc||(Qc=L(["\n z-index: ",";\n position: fixed;\n top: 20px;\n right: 20px;\n width: 20px;\n"])),2e3),iu=m.div(Xc||(Xc=L(["\n z-index: ",";\n position: absolute;\n top: 40px;\n color: red;\n"])),1020),su=r.createRef(),cu=function(){if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)return navigator.mediaDevices;var e=navigator.mozGetUserMedia||navigator.webkitGetUserMedia;return e?{getUserMedia:function(r){return new Promise((function(t,n){e.call(navigator,r,t,n)}))}}:null}();function uu(e){var t=e.checkCameraMode,n=e.frontCamera,s=e.onClose,u=e.children,l=e.onVideoPlayed,d=e.flipHorizontal,f=e.videoSettings,p=e.refVideo,h=e.onError,m=e.closeButton,g=e.videoClassName,v=e.scale,y=e.defaultCameraId,b=e.onWarning,C=a(),w=$t.useSDKSettings().lang,k=Pn.useSDKTracking().sendEvent,B=Nn.useAsset("ic_close.png"),E=O(c(""),2),_=E[0],A=E[1],I=a(!1),T=a(!1),P=a(!1),R=a(),D=a([]),N=a(""),L=o((function(e){h&&h(e)}),[h]),M=o((function(){try{var e;clearInterval(C.current),(null==p||null===(e=p.current)||void 0===e?void 0:e.srcObject)instanceof MediaStream&&(p.current.srcObject.getTracks().forEach((function(e){return e.stop()})),p.current.srcObject=null)}catch(e){}clearTimeout(R)}),[p]);function F(){return U.apply(this,arguments)}function U(){return(U=S(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Hc();case 3:r=e.sent,D.current=r.filter((function(e){return e.deviceId&&"videoinput"===e.kind})),Rs.addExifData("device_info.camera_list",JSON.stringify(D.current.map((function(e){return e.label})))),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),console.error(e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})))).apply(this,arguments)}C.current||(C.current=setInterval((function(){document.getElementById("tv-camera-".concat(C.current))||M()}),1e3)),i((function(){return function(){P.current=!0}}),[]);var V=o((function(){R.current||(R.current=setTimeout((function(){I.current||(A(eu.camera_timeout.msg[w]),L(eu.camera_timeout))}),2e4))}),[w,L]),j=o(function(){var e=S(regeneratorRuntime.mark((function e(r){var t,a,o,i,s,c,u,l,d,p,h=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=h.length>1&&void 0!==h[1]&&h[1],a={},!1!==window.tv_last_req_camera_complete){e.next=5;break}return b&&b("too_many_request_to_camera"),e.abrupt("return",new Promise((function(e){return e(null)})));case 5:return window.tv_last_req_camera_complete=!1,a=qs.isMobile?qs.isIOS?{width:{ideal:1460},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{height:{ideal:720},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{width:{ideal:9999}},o=Jc(),i=o.updateTime,s=o.getStart,c=o.getEnd,e.prev=8,u=f||a,i(performance.now(),"start"),$c(qs.isMobile,qs.isIOS)&&n&&(u={}),t&&(u={}),Rs.addExifData("device_info.camera_label_dimension.req",JSON.stringify(u)),l={audio:!1,video:x(x({},r?{deviceId:r}:{facingMode:n?"user":"environment"}),u)},e.next=17,cu.getUserMedia(l);case 17:return d=e.sent,e.next=20,F();case 20:return e.next=22,new Promise((function(e){return setTimeout(e,300)}));case 22:if(V(),d){e.next=27;break}return A(eu.not_supported.msg[w]),L(eu.not_supported),e.abrupt("return",null);case 27:i(performance.now(),"end"),window.tv_last_req_camera_complete=!0,c()-s()<1600?k({tag:"cam_permission",event:"user_activity.cam",log:{already_enable:!0}}):k({tag:"cam_permission",event:"user_activity.allow",log:{}});try{p=d.getVideoTracks()[0].getSettings(),Rs.addExifData("device_info.camera_label_dimension.got","".concat(p.width,"x").concat(p.height))}catch(e){}return e.abrupt("return",d);case 34:e.prev=34,e.t0=e.catch(8),i(performance.now(),"end"),"NotAllowedError"===e.t0.name?(A(eu.no_permission.msg[w]),L(eu.no_permission),T.current=!0,k({tag:"cam_permission",event:"user_activity.cam",log:c()-s()<1600?{already_block:!0}:{click_block_on_popup:!0}})):T.current&&("NotReadableError"===e.t0.name?(L(eu.not_readable),A(eu.not_readable.msg[w])):(A(e.t0.message),L({code:e.t0.name||e.t0.code,message:e.t0.message})));case 38:return window.tv_last_req_camera_complete=!0,e.abrupt("return",null);case 40:case"end":return e.stop()}}),e,null,[[8,34]])})));return function(r){return e.apply(this,arguments)}}(),[n,f,w,L,b,V,k]),z=o(S(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c,u,d,f=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=f.length>0&&void 0!==f[0]?f[0]:y,a=f.length>1&&void 0!==f[1]&&f[1],!(null!=(o=p.current)&&null!==(r=o.srcObject)&&void 0!==r&&r.id&&null!=o&&null!==(t=o.srcObject)&&void 0!==t&&t.active&&I.current)){e.next=5;break}return e.abrupt("return");case 5:return o.oncanplaythrough=function(){var e,r,t;o.play(),Rs.addExifData("device_info.camera_label",null===(e=i)||void 0===e||null===(r=e.getVideoTracks())||void 0===r||null===(t=r[0])||void 0===t?void 0:t.label),I.current=!0,A("");var n=window.innerWidth,a=window.innerHeight,s=ca.analyzeVideoAndWindowSizes(o),c=s.lostX,u=void 0===c?0:c,d=s.lostY,f=void 0===d?0:d,p=Math.min(n,Math.floor(n-2*u)),h=Math.min(a,Math.floor(a-2*f));l&&l({clientWidth:n,clientHeight:a,videoAreaWidth:p,videoAreaHeight:h,lostX:u,lostY:f})},e.next=8,j(n,a);case 8:i=e.sent,s=Zc(i),c=s.deviceLabel,(u=s.isVirtual)&&(N.current+="".concat(c,", "),(d=D.current.filter((function(e){return!N.current.includes(e.label)})))[0]&&d[0].deviceId&&z(d[0].deviceId)),i||T.current||(Rs.addExifData("device_info.camera_label_retry","yes"),T.current=!0,z(n,!0)),i&&P.current&&(p.current.srcObject=i,M()),!i||P.current||u||(o.srcObject=i);case 14:case"end":return e.stop()}}),e)}))),[p,j,l,y,M]);i((function(){function e(){return(e=S(regeneratorRuntime.mark((function e(){var r,t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z();case 2:return e.next=4,Hc();case 4:r=e.sent,(t=r.filter((function(e){return"videoinput"===e.kind&&e.label.includes("back")&&e.label.includes("0")}))).length>0&&(n=t[0].deviceId,M(),z(n));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var r=p.current;return I.current?function(){}:(!cu||qs.browserName&&["facebook"].includes(qs.browserName.toLowerCase())||qs.getUA.includes("Zalo iOS")?(A(eu.not_supported.msg[w]),L(eu.not_supported)):r&&(qs.isAndroid&&!1===n?function(){e.apply(this,arguments)}():z()),function(){P.current&&M()})}),[p,w,n,z,M,L]);var K=o((function(){M(),s&&s(),k({tag:"result",event:"user_activity.cancel",log:{}})}),[s,M,k]);return r.createElement(tu,{id:"tv-camera-".concat(C.current),checkCameraMode:t},function(){if(!_)return null;var e=eu.no_permission.msg[w];return _===e&&qs.isIOS?r.createElement(iu,null,_," ",r.createElement("button",{onClick:function(){window.location.reload()}},{vi:"Cấp lại quyền truy cập camera",en:"Request camera permission"}[w])):r.createElement(iu,null,_)}(),r.createElement(nu,{ref:p,playsInline:!0,muted:!0,flipHorizontal:d,className:g,scale:v}),u,m?r.cloneElement(m,{onClick:K,"data-testid":"close-camera"}):r.createElement(ou,{onClick:K,"data-testid":"close-camera"},r.createElement("img",{src:B,alt:""})))}uu.propTypes={checkCameraMode:h.bool,frontCamera:h.bool,onClose:h.func,onError:h.func,onVideoPlayed:h.func,children:h.node,flipHorizontal:h.bool,videoSettings:h.object,refVideo:h.object,closeButton:h.node,videoClassName:h.string,scale:h.number,defaultCameraId:h.string,onWarning:h.func},uu.defaultProps={checkCameraMode:!1,frontCamera:!0,onClose:null,onError:null,onVideoPlayed:null,children:null,flipHorizontal:!1,videoSettings:null,refVideo:null,closeButton:null,videoClassName:"",scale:1,defaultCameraId:void 0,onWarning:null};var lu,du,fu,pu=function(e,t,n){class a extends s{constructor(){super(...arguments),this.updateDebounced=cc(this.forceUpdate,t,n)}shouldComponentUpdate(){return this.updateDebounced(),!1}componentWillUnmount(){this.updateDebounced.cancel()}render(){return r.createElement(e,Object.assign({},this.props))}}return a.displayName=`debounceRender(${e.displayName||e.name||"Component"})`,Kc(a,e)}(uu,250),hu=r.forwardRef((function(e,t){return r.createElement(pu,I({},e,{refVideo:t||su}))})),mu=m.table(lu||(lu=L(["\n width: 100%;\n height: 100%;\n td {\n text-align: center;\n vertical-align: middle;\n padding: 0;\n border: 0;\n }\n border-spacing: 0;\n table-layout: auto;\n border-collapse: collapse;\n"]))),gu=m.div(du||(du=L(["\n position: relative;\n"]))),vu=Array.from(Array(3).keys()),yu=Array.from(Array(3).keys());function bu(e){var t=e.children,n=e.x,a=e.y,o=e.width,i=e.height,s=e.className,c=e.surroundStyle;return r.createElement(mu,{className:s},r.createElement("tbody",null,vu.map((function(e,s){return r.createElement("tr",{key:e,style:{height:0===s?a:"auto"},"data-testid":"row"},yu.map((function(e,a){var u=1===s&&1===a,l="auto";return u?l=o:0===a&&(l=n),r.createElement("td",{"data-testid":u?"centeredCell":"cell",key:e,style:x({width:l,height:u?i:"auto"},u?{}:c)},u?r.createElement(gu,{style:{width:l,height:i}},t):null)})))}))))}bu.propTypes={children:h.node,x:h.string,y:h.string,width:h.string,height:h.string,className:h.string,surroundStyle:h.object},bu.defaultProps={children:null,x:"auto",y:"auto",width:"auto",height:"auto",className:"",surroundStyle:{}};var Cu=m(bu)(fu||(fu=L(["\n background: transparent;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n"])));function wu(e){var t=e.className;return r.createElement("svg",{className:t,width:"38px",height:"32px",viewBox:"0 0 24 21","data-testid":"camera-icon"},r.createElement("title",null,"FA45C15C-1E21-4D7B-9585-07FB9F999CB8"),r.createElement("desc",null,"Created with sketchtool."),r.createElement("g",{id:"Web-demo",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"step1",transform:"translate(-950.000000, -380.000000)",fill:"currentColor",fillRule:"nonzero"},r.createElement("g",{id:"Group",transform:"translate(950.000000, 380.000000)"},r.createElement("g",{id:"Group-2"},r.createElement("g",{id:"camera"},r.createElement("path",{d:"M21,3 L17,3 L15,0 L9,0 L7,3 L3,3 C1.34314575,3 0,4.34314575 0,6 L0,18 C0,19.6568542 1.34314575,21 3,21 L21,21 C22.6568542,21 24,19.6568542 24,18 L24,6 C24,4.34314575 22.6568542,3 21,3 Z M12,17 C9.23857625,17 7,14.7614237 7,12 C7,9.23857625 9.23857625,7 12,7 C14.7614237,7 17,9.23857625 17,12 C17,14.7614237 14.7614237,17 12,17 L12,17 Z",id:"Shape"})))))))}wu.propTypes={className:h.string},wu.defaultProps={className:""};var ku=function(e){var r=typeof e;return null!=e&&("object"==r||"function"==r)},Bu="object"==typeof zs&&zs&&zs.Object===Object&&zs,Eu="object"==typeof self&&self&&self.Object===Object&&self,Su=Bu||Eu||Function("return this")(),_u=function(){return Su.Date.now()},Au=/\s/;var Iu=function(e){for(var r=e.length;r--&&Au.test(e.charAt(r)););return r},Tu=/^\s+/;var xu=function(e){return e?e.slice(0,Iu(e)+1).replace(Tu,""):e},Pu=Su.Symbol,Ru=Object.prototype,Du=Ru.hasOwnProperty,Nu=Ru.toString,Lu=Pu?Pu.toStringTag:void 0;var Ou=function(e){var r=Du.call(e,Lu),t=e[Lu];try{e[Lu]=void 0;var n=!0}catch(e){}var a=Nu.call(e);return n&&(r?e[Lu]=t:delete e[Lu]),a},Mu=Object.prototype.toString;var Fu=function(e){return Mu.call(e)},Uu=Pu?Pu.toStringTag:void 0;var Vu=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Uu&&Uu in Object(e)?Ou(e):Fu(e)};var ju=function(e){return null!=e&&"object"==typeof e};var zu=function(e){return"symbol"==typeof e||ju(e)&&"[object Symbol]"==Vu(e)},Ku=/^[-+]0x[0-9a-f]+$/i,Hu=/^0b[01]+$/i,qu=/^0o[0-7]+$/i,Gu=parseInt;var Wu=function(e){if("number"==typeof e)return e;if(zu(e))return NaN;if(ku(e)){var r="function"==typeof e.valueOf?e.valueOf():e;e=ku(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=xu(e);var t=Hu.test(e);return t||qu.test(e)?Gu(e.slice(2),t?2:8):Ku.test(e)?NaN:+e},Qu=Math.max,Xu=Math.min;var Yu=function(e,r,t){var n,a,o,i,s,c,u=0,l=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(r){var t=n,o=a;return n=a=void 0,u=r,i=e.apply(o,t)}function h(e){return u=e,s=setTimeout(g,r),l?p(e):i}function m(e){var t=e-c;return void 0===c||t>=r||t<0||d&&e-u>=o}function g(){var e=_u();if(m(e))return v(e);s=setTimeout(g,function(e){var t=r-(e-c);return d?Xu(t,o-(e-u)):t}(e))}function v(e){return s=void 0,f&&n?p(e):(n=a=void 0,i)}function y(){var e=_u(),t=m(e);if(n=arguments,a=this,c=e,t){if(void 0===s)return h(c);if(d)return clearTimeout(s),s=setTimeout(g,r),p(c)}return void 0===s&&(s=setTimeout(g,r)),i}return r=Wu(r)||0,ku(t)&&(l=!!t.leading,o=(d="maxWait"in t)?Qu(Wu(t.maxWait)||0,r):o,f="trailing"in t?!!t.trailing:f),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,n=c=a=s=void 0},y.flush=function(){return void 0===s?i:v(_u())},y};var Zu=function(e,r,t){var n=!0,a=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return ku(t)&&(n="leading"in t?!!t.leading:n,a="trailing"in t?!!t.trailing:a),Yu(e,r,{leading:n,maxWait:r,trailing:a})};var $u,Ju=function(e){if(!ku(e))return!1;var r=Vu(e);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r},el=Su["__core-js_shared__"],rl=($u=/[^.]+$/.exec(el&&el.keys&&el.keys.IE_PROTO||""))?"Symbol(src)_1."+$u:"";var tl=function(e){return!!rl&&rl in e},nl=Function.prototype.toString;var al=function(e){if(null!=e){try{return nl.call(e)}catch(e){}try{return e+""}catch(e){}}return""},ol=/^\[object .+?Constructor\]$/,il=Function.prototype,sl=Object.prototype,cl=il.toString,ul=sl.hasOwnProperty,ll=RegExp("^"+cl.call(ul).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var dl=function(e){return!(!ku(e)||tl(e))&&(Ju(e)?ll:ol).test(al(e))};var fl=function(e,r){return null==e?void 0:e[r]};var pl=function(e,r){var t=fl(e,r);return dl(t)?t:void 0},hl=function(){try{var e=pl(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var ml=function(e,r,t){"__proto__"==r&&hl?hl(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t};var gl=function(e,r){return e===r||e!=e&&r!=r},vl=Object.prototype.hasOwnProperty;var yl=function(e,r,t){var n=e[r];vl.call(e,r)&&gl(n,t)&&(void 0!==t||r in e)||ml(e,r,t)};var bl=function(e,r,t,n){var a=!t;t||(t={});for(var o=-1,i=r.length;++o<i;){var s=r[o],c=n?n(t[s],e[s],s,t,e):void 0;void 0===c&&(c=e[s]),a?ml(t,s,c):yl(t,s,c)}return t};var Cl=function(e){return e};var wl=function(e,r,t){switch(t.length){case 0:return e.call(r);case 1:return e.call(r,t[0]);case 2:return e.call(r,t[0],t[1]);case 3:return e.call(r,t[0],t[1],t[2])}return e.apply(r,t)},kl=Math.max;var Bl=function(e,r,t){return r=kl(void 0===r?e.length-1:r,0),function(){for(var n=arguments,a=-1,o=kl(n.length-r,0),i=Array(o);++a<o;)i[a]=n[r+a];a=-1;for(var s=Array(r+1);++a<r;)s[a]=n[a];return s[r]=t(i),wl(e,this,s)}};var El=function(e){return function(){return e}},Sl=hl?function(e,r){return hl(e,"toString",{configurable:!0,enumerable:!1,value:El(r),writable:!0})}:Cl,_l=Date.now;var Al=function(e){var r=0,t=0;return function(){var n=_l(),a=16-(n-t);if(t=n,a>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}(Sl);var Il=function(e,r){return Al(Bl(e,r,Cl),e+"")};var Tl=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var xl=function(e){return null!=e&&Tl(e.length)&&!Ju(e)},Pl=/^(?:0|[1-9]\d*)$/;var Rl=function(e,r){var t=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==t||"symbol"!=t&&Pl.test(e))&&e>-1&&e%1==0&&e<r};var Dl=function(e,r,t){if(!ku(t))return!1;var n=typeof r;return!!("number"==n?xl(t)&&Rl(r,t.length):"string"==n&&r in t)&&gl(t[r],e)};var Nl=function(e){return Il((function(r,t){var n=-1,a=t.length,o=a>1?t[a-1]:void 0,i=a>2?t[2]:void 0;for(o=e.length>3&&"function"==typeof o?(a--,o):void 0,i&&Dl(t[0],t[1],i)&&(o=a<3?void 0:o,a=1),r=Object(r);++n<a;){var s=t[n];s&&e(r,s,n,o)}return r}))};var Ll=function(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n};var Ol=function(e){return ju(e)&&"[object Arguments]"==Vu(e)},Ml=Object.prototype,Fl=Ml.hasOwnProperty,Ul=Ml.propertyIsEnumerable,Vl=Ol(function(){return arguments}())?Ol:function(e){return ju(e)&&Fl.call(e,"callee")&&!Ul.call(e,"callee")},jl=Array.isArray;var zl=function(){return!1},Kl=Hs((function(e,r){var t=r&&!r.nodeType&&r,n=t&&e&&!e.nodeType&&e,a=n&&n.exports===t?Su.Buffer:void 0,o=(a?a.isBuffer:void 0)||zl;e.exports=o})),Hl={};Hl["[object Float32Array]"]=Hl["[object Float64Array]"]=Hl["[object Int8Array]"]=Hl["[object Int16Array]"]=Hl["[object Int32Array]"]=Hl["[object Uint8Array]"]=Hl["[object Uint8ClampedArray]"]=Hl["[object Uint16Array]"]=Hl["[object Uint32Array]"]=!0,Hl["[object Arguments]"]=Hl["[object Array]"]=Hl["[object ArrayBuffer]"]=Hl["[object Boolean]"]=Hl["[object DataView]"]=Hl["[object Date]"]=Hl["[object Error]"]=Hl["[object Function]"]=Hl["[object Map]"]=Hl["[object Number]"]=Hl["[object Object]"]=Hl["[object RegExp]"]=Hl["[object Set]"]=Hl["[object String]"]=Hl["[object WeakMap]"]=!1;var ql=function(e){return ju(e)&&Tl(e.length)&&!!Hl[Vu(e)]};var Gl=function(e){return function(r){return e(r)}},Wl=Hs((function(e,r){var t=r&&!r.nodeType&&r,n=t&&e&&!e.nodeType&&e,a=n&&n.exports===t&&Bu.process,o=function(){try{var e=n&&n.require&&n.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=o})),Ql=Wl&&Wl.isTypedArray,Xl=Ql?Gl(Ql):ql,Yl=Object.prototype.hasOwnProperty;var Zl=function(e,r){var t=jl(e),n=!t&&Vl(e),a=!t&&!n&&Kl(e),o=!t&&!n&&!a&&Xl(e),i=t||n||a||o,s=i?Ll(e.length,String):[],c=s.length;for(var u in e)!r&&!Yl.call(e,u)||i&&("length"==u||a&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Rl(u,c))||s.push(u);return s},$l=Object.prototype;var Jl=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||$l)};var ed=function(e){var r=[];if(null!=e)for(var t in Object(e))r.push(t);return r},rd=Object.prototype.hasOwnProperty;var td=function(e){if(!ku(e))return ed(e);var r=Jl(e),t=[];for(var n in e)("constructor"!=n||!r&&rd.call(e,n))&&t.push(n);return t};var nd=function(e){return xl(e)?Zl(e,!0):td(e)},ad=Nl((function(e,r,t,n){bl(r,nd(r),e,n)}));var od=function(e,r){return function(t){return e(r(t))}},id=od(Object.getPrototypeOf,Object),sd=Function.prototype,cd=Object.prototype,ud=sd.toString,ld=cd.hasOwnProperty,dd=ud.call(Object);var fd=function(e){if(!ju(e)||"[object Object]"!=Vu(e))return!1;var r=id(e);if(null===r)return!0;var t=ld.call(r,"constructor")&&r.constructor;return"function"==typeof t&&t instanceof t&&ud.call(t)==dd};var pd=function(e){if(!ju(e))return!1;var r=Vu(e);return"[object Error]"==r||"[object DOMException]"==r||"string"==typeof e.message&&"string"==typeof e.name&&!fd(e)},hd=Il((function(e,r){try{return wl(e,void 0,r)}catch(e){return pd(e)?e:new Error(e)}}));var md=function(e,r){for(var t=-1,n=null==e?0:e.length,a=Array(n);++t<n;)a[t]=r(e[t],t,e);return a};var gd=function(e,r){return md(r,(function(r){return e[r]}))},vd=Object.prototype,yd=vd.hasOwnProperty;var bd=function(e,r,t,n){return void 0===e||gl(e,vd[t])&&!yd.call(n,t)?r:e},Cd={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};var wd=function(e){return"\\"+Cd[e]},kd=od(Object.keys,Object),Bd=Object.prototype.hasOwnProperty;var Ed=function(e){if(!Jl(e))return kd(e);var r=[];for(var t in Object(e))Bd.call(e,t)&&"constructor"!=t&&r.push(t);return r};var Sd=function(e){return xl(e)?Zl(e):Ed(e)},_d=/<%=([\s\S]+?)%>/g;var Ad=function(e){return function(r){return null==e?void 0:e[r]}}({"&":"&","<":"<",">":">",'"':""","'":"'"}),Id=Pu?Pu.prototype:void 0,Td=Id?Id.toString:void 0;var xd=function e(r){if("string"==typeof r)return r;if(jl(r))return md(r,e)+"";if(zu(r))return Td?Td.call(r):"";var t=r+"";return"0"==t&&1/r==-Infinity?"-0":t};var Pd=function(e){return null==e?"":xd(e)},Rd=/[&<>"']/g,Dd=RegExp(Rd.source);var Nd={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:_d,variable:"",imports:{_:{escape:function(e){return(e=Pd(e))&&Dd.test(e)?e.replace(Rd,Ad):e}}}},Ld=/\b__p \+= '';/g,Od=/\b(__p \+=) '' \+/g,Md=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Fd=/[()=,{}\[\]\/\s]/,Ud=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Vd=/($^)/,jd=/['\n\r\u2028\u2029\\]/g,zd=Object.prototype.hasOwnProperty;var Kd=function(e,r,t){var n=Nd.imports._.templateSettings||Nd;t&&Dl(e,r,t)&&(r=void 0),e=Pd(e),r=ad({},r,n,bd);var a,o,i=ad({},r.imports,n.imports,bd),s=Sd(i),c=gd(i,s),u=0,l=r.interpolate||Vd,d="__p += '",f=RegExp((r.escape||Vd).source+"|"+l.source+"|"+(l===_d?Ud:Vd).source+"|"+(r.evaluate||Vd).source+"|$","g"),p=zd.call(r,"sourceURL")?"//# sourceURL="+(r.sourceURL+"").replace(/\s/g," ")+"\n":"";e.replace(f,(function(r,t,n,i,s,c){return n||(n=i),d+=e.slice(u,c).replace(jd,wd),t&&(a=!0,d+="' +\n__e("+t+") +\n'"),s&&(o=!0,d+="';\n"+s+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=c+r.length,r})),d+="';\n";var h=zd.call(r,"variable")&&r.variable;if(h){if(Fd.test(h))throw new Error("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(o?d.replace(Ld,""):d).replace(Od,"$1").replace(Md,"$1;"),d="function("+(h||"obj")+") {\n"+(h?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(a?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=hd((function(){return Function(s,p+"return "+d).apply(void 0,c)}));if(m.source=d,pd(m))throw m;return m},Hd=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qd=/^\w*$/;var Gd=function(e,r){if(jl(e))return!1;var t=typeof e;return!("number"!=t&&"symbol"!=t&&"boolean"!=t&&null!=e&&!zu(e))||(qd.test(e)||!Hd.test(e)||null!=r&&e in Object(r))},Wd=pl(Object,"create");var Qd=function(){this.__data__=Wd?Wd(null):{},this.size=0};var Xd=function(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r},Yd=Object.prototype.hasOwnProperty;var Zd=function(e){var r=this.__data__;if(Wd){var t=r[e];return"__lodash_hash_undefined__"===t?void 0:t}return Yd.call(r,e)?r[e]:void 0},$d=Object.prototype.hasOwnProperty;var Jd=function(e){var r=this.__data__;return Wd?void 0!==r[e]:$d.call(r,e)};var ef=function(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=Wd&&void 0===r?"__lodash_hash_undefined__":r,this};function rf(e){var r=-1,t=null==e?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}rf.prototype.clear=Qd,rf.prototype.delete=Xd,rf.prototype.get=Zd,rf.prototype.has=Jd,rf.prototype.set=ef;var tf=rf;var nf=function(){this.__data__=[],this.size=0};var af=function(e,r){for(var t=e.length;t--;)if(gl(e[t][0],r))return t;return-1},of=Array.prototype.splice;var sf=function(e){var r=this.__data__,t=af(r,e);return!(t<0)&&(t==r.length-1?r.pop():of.call(r,t,1),--this.size,!0)};var cf=function(e){var r=this.__data__,t=af(r,e);return t<0?void 0:r[t][1]};var uf=function(e){return af(this.__data__,e)>-1};var lf=function(e,r){var t=this.__data__,n=af(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this};function df(e){var r=-1,t=null==e?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}df.prototype.clear=nf,df.prototype.delete=sf,df.prototype.get=cf,df.prototype.has=uf,df.prototype.set=lf;var ff=df,pf=pl(Su,"Map");var hf=function(){this.size=0,this.__data__={hash:new tf,map:new(pf||ff),string:new tf}};var mf=function(e){var r=typeof e;return"string"==r||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==e:null===e};var gf=function(e,r){var t=e.__data__;return mf(r)?t["string"==typeof r?"string":"hash"]:t.map};var vf=function(e){var r=gf(this,e).delete(e);return this.size-=r?1:0,r};var yf=function(e){return gf(this,e).get(e)};var bf=function(e){return gf(this,e).has(e)};var Cf=function(e,r){var t=gf(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this};function wf(e){var r=-1,t=null==e?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}wf.prototype.clear=hf,wf.prototype.delete=vf,wf.prototype.get=yf,wf.prototype.has=bf,wf.prototype.set=Cf;var kf=wf;function Bf(e,r){if("function"!=typeof e||null!=r&&"function"!=typeof r)throw new TypeError("Expected a function");var t=function(){var n=arguments,a=r?r.apply(this,n):n[0],o=t.cache;if(o.has(a))return o.get(a);var i=e.apply(this,n);return t.cache=o.set(a,i)||o,i};return t.cache=new(Bf.Cache||kf),t}Bf.Cache=kf;var Ef=Bf;var Sf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_f=/\\(\\)?/g,Af=function(e){var r=Ef(e,(function(e){return 500===t.size&&t.clear(),e})),t=r.cache;return r}((function(e){var r=[];return 46===e.charCodeAt(0)&&r.push(""),e.replace(Sf,(function(e,t,n,a){r.push(n?a.replace(_f,"$1"):t||e)})),r}));var If=function(e,r){return jl(e)?e:Gd(e,r)?[e]:Af(Pd(e))};var Tf=function(e){if("string"==typeof e||zu(e))return e;var r=e+"";return"0"==r&&1/e==-Infinity?"-0":r};var xf=function(e,r){for(var t=0,n=(r=If(r,e)).length;null!=e&&t<n;)e=e[Tf(r[t++])];return t&&t==n?e:void 0};var Pf=function(e,r,t){var n=null==e?void 0:xf(e,r);return void 0===n?t:n},Rf=K.Errors;function Df(e){var r=e.livenessSettings,t=e.apiClient,n=e.apiCheck,a=e.onError,o=O(c({face_tracking_setting:{enable:!1,web_terminate_threshold:.0030152991993743408,web_warning_threshold:.0017317430600108828,limit_for:"all_flow",max_warning_time:5},flow_interval_time_ms:3e3,take_one_picture_time_ms:3e3,limit_time_liveness_check:{enable:!1,limit_time_second:45},terminate_if_no_face:{enable:!1,max_invalid_frame:5,max_time_ms:1e3},close_eye_detector:{enable:!0,web_threshold:.342,web_timeout:5},exif_data_settings:{enable:!0}}),2),s=o[0],u=o[1];return i((function(){r&&Object.keys(r).length>0?u((function(e){return x(x({},e),r)})):n&&t.clientSettings().then((function(e){if(e&&e.data){var r,t=Pf(e,"data.settings.sdk_settings.active_liveness_settings"),n=Pf(e,"data.settings.sdk_settings.liveness_settings"),o=Pf(t,"save_encoded_frames",{});o.enable&&(r={enable:!0,framesIntervalTime:o.frames_interval_ms,framesBatchLength:o.frames_batch_len});var i=Pf(e,"data.settings.sdk_settings.liveness_settings.exif_data_settings",{enable:!0});u(x(x(x({},t),n),{},{captureFrameSettings:r,exif_data_settings:i}))}e&&e.errors&&a(Rf.server_error)})).catch((function(e){a(e)}))}),[r,t,a,n]),s}var Nf=function(e){var r=e.curStep,t=e.faceDirection,n=Pf(r,"stepTimeConstraints.delayTime");return!!n&&(null===r.firstFrameSpottedAt?(r.name===t&&(r.firstFrameSpottedAt=(new Date).getTime()),!0):(new Date).getTime()-r.firstFrameSpottedAt<n)};var Lf=function(e){return e?Infinity===(e=Wu(e))||-Infinity===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0};var Of=function(e){var r=Lf(e),t=r%1;return r==r?t?r-t:r:0};var Mf=function(e,r){var t;if("function"!=typeof r)throw new TypeError("Expected a function");return e=Of(e),function(){return--e>0&&(t=r.apply(this,arguments)),e<=1&&(r=void 0),t}};var Ff=function(e){return Mf(2,e)},Uf=function(){var e=S(regeneratorRuntime.mark((function e(r){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.closeEyesModelUrl,n=void 0===t?Ds:t,e.next=3,di.preloadResource({modelUrl:n});case 3:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}();function Vf(){return(Vf=S(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c,u,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=l.length>0&&void 0!==l[0]?l[0]:{},t=r.blazefaceModelUrl,n=r.tfScriptUrls,a=r.closeEyesModelUrl,o=new Ns(a),e.next=4,di.loadTensorFlow(n);case 4:return e.next=6,di.initTensorFlow({preferredBackends:["wasm","cpu"]});case 6:return i=[di.loadBlazefaceModel({modelUrl:t}),o.load()],e.next=9,Promise.all(i);case 9:return s=e.sent,c=O(s,1),u=c[0].blazefaceModel,e.abrupt("return",{blazefaceModel:u,closeEyesModel:o});case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var jf,zf,Kf,Hf,qf,Gf,Wf,Qf,Xf=Ff((function(){return Vf.apply(this,arguments)})),Yf=[],Zf=function(){Yf=[]},$f=function(e,r,t){t&&Zf(),Yf.push({id:null});var n=Yf.length-1;r.httpClient.post("/v1/files",{frames:e,metadata:JSON.stringify({type:"selfie"})}).then((function(e){e&&e.data&&e.data.file_id?Yf[n].id=e.data.file_id:Yf[n].id=-1}))},Jf=function(e,r,t){t&&Zf(),Yf.push({id:null});var n=Yf.length-1;r.uploadFiles({frames:e,metadata:JSON.stringify({type:"selfie"})}).then((function(e){e&&e.data&&e.data.file_id?Yf[n].id=e.data.file_id:Yf[n].id=-1}))},ep=function(){return new Promise((function(e){var r=setInterval((function(){Yf.every((function(e){return e.id}))&&(e(),clearInterval(r))}),200)}))},rp=function(e){return e.enable?Yf.some((function(e){return-1===e.id}))?null:Yf:[]},tp=function(){var e=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.steps,n=r.apiClient,a=r.FaceDirection,o=r.outputEncryptionSettings,i=[],t.forEach((function(e){var r=e.name,t=e.image,s=e.frontalFaceImage;if(r!==a.FRONTAL){var c={label:"portrait",metadata:JSON.stringify({gesture_score:t.leftRightScore,gesture:r})};o&&o.key?i.push(n.httpClient.post("/v1/images",x({base64:t.encrypted.hex},c),{"X-TV-Key":o.key})):i.push(n.uploadImage(x({file:t.blob},c)))}else i.push(Promise.resolve({data:{image_id:null}}));if(s.blob){var u={label:"portrait",metadata:JSON.stringify({gesture_score:s.leftRightScore,gesture:a.FRONTAL})};o&&o.key?i.push(n.httpClient.post("/v1/images",x({base64:s.encrypted.hex},u),{"X-TV-Key":o.key})):i.push(n.uploadImage(x({file:s.blob},u)))}else i.push(Promise.resolve({data:{image_id:null}}))})),e.next=5,Promise.all(i);case 5:s=e.sent,t.forEach((function(e,r){e.image.imageId=s[2*r].data.image_id,e.frontalFaceImage.imageId=s[2*r+1].data.image_id}));case 7:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),np=function(){var e=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,u,l,d,f,p,h,m,g,v,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.apiClient,n=r.faceVerificationFlowData,a=r.onLivenessDetectionDone,o=r.captureFrameSettings,i=r.FaceDirection,s=r.onError,c=r.outputEncryptionSettings,e.prev=1,u=n.current.steps,e.next=5,tp({steps:u,apiClient:t,FaceDirection:i,outputEncryptionSettings:c});case 5:if(0!==(l=u.filter((function(e){return e.frontalFaceImage.imageId}))).length){e.next=10;break}a({error:"wrong_face_movement"}),e.next=27;break;case 10:return e.next=12,ep();case 12:if(d=rp(o)){e.next=17;break}a({error:"network_error"}),e.next=27;break;case 17:return f=t.verifyFaceLiveness({images:l.map((function(e){return{id:e.frontalFaceImage.imageId}})),gesture_images:u.filter((function(e){return e.image.imageId&&e.name!==i.FRONTAL})).map((function(e){return{gesture:e.name,images:[{id:e.image.imageId}]}})),videos:d}),p=t.requestVerifyPortrait({image:{id:l[l.length-1].frontalFaceImage.imageId}}),e.next=21,Promise.all([f,p]);case 21:h=e.sent,m=O(h,2),g=m[0],v=m[1],y=!0===g.data.is_live,a({apiCheckPassed:y,verifyFaceLivenessResult:g.data,verifyFacePortraitResult:v.data,frontalFaces:l.map((function(e){return{id:e.frontalFaceImage.imageId,blob:e.frontalFaceImage.blob}})),steps:u.filter((function(e){return e.image.imageId&&e.name!==i.FRONTAL})).map((function(e){var r=e.name,t=e.image;return{name:r,blob:t.blob,id:t.imageId}}))});case 27:e.next=32;break;case 29:e.prev=29,e.t0=e.catch(1),s({error:e.t0});case 32:case"end":return e.stop()}}),e,null,[[1,29]])})));return function(r){return e.apply(this,arguments)}}(),ap=Ea.faceTracker(),op=new gi,ip=K.Mode,sp=K.FaceDirection,cp=K.Errors,up=K.Messages,lp=K.TrackLivenessEvents,dp={captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},customStepTimeConstraints:(jf={},A(jf,K.FaceDirection.UP,{delayTime:0}),A(jf,K.FaceDirection.LEFT,{delayTime:0}),A(jf,K.FaceDirection.RIGHT,{delayTime:0}),A(jf,K.FaceDirection.FRONTAL,{delayTime:2e3}),jf),setRemainingTime:function(){},onFramesCaptured:function(){},onProcessing:function(){}},fp=function(e){var r=e.apiCredentials,t=e.sdkAdapter,n=Fo.useApiClient({apiCredentials:r}).apiClient;return{apiClient:t instanceof js?t:n,apiClientFromUtils:n}};function pp(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.apiCheck,t=e.mode,s=e.bgCameraMask,l=e.bgCameraMaskRed,d=e.surroundStyle,f=e.cropAreaDimension,p=e.customInstructions,h=e.customIcon,m=e.customDirectionIcon,g=e.customStepTimeConstraints,v=void 0===g?dp.customStepTimeConstraints:g,y=e.onLivenessDetectionDone,b=e.onError,C=e.frontalMinSize,w=e.waitingTimeToGetBetterFrames,k=void 0===w?500:w,E=e.captureFrameSettings,_=void 0===E?dp.captureFrameSettings:E,I=e.livenessSettings,T=e.setRemainingTime,P=void 0===T?dp.setRemainingTime:T,R=e.onProcessing,D=void 0===R?dp.onProcessing:R,N=e.customErrors,L=e.customMessages,F=e.apiCredentials,U=void 0===F?{}:F,V=e.onFramesCaptured,j=void 0===V?dp.onFramesCaptured:V,z=e.initFirstGestureTimeout,H=void 0===z?2e3:z,q=e.outputEncryptionSettings,G=e.cameraScale,W=void 0===G?1:G,Q=e.passiveModeAuto,X=void 0!==Q&&Q,Y=e.sendCustomEvent,Z=e.sdkAdapter,$=void 0===Z?null:Z,J=c(!1),ee=O(J,2),re=ee[0],te=ee[1],ne=c(!1),ae=O(ne,2),oe=ae[0],ie=ae[1],se=c(!1),ce=O(se,2),ue=ce[0],le=ce[1],de=c(!1),fe=O(de,2),pe=fe[0],he=fe[1],me=a(null),ge=$t.useSDKSettings(),ve=ge.lang,ye=ge.assetRoot,be=ge.customUrls,Ce=t===ip.ACTIVE,we=u((function(e){return e+1}),0),ke=O(we,2),Be=(ke[0],ke[1]),Ee=a(null),Se=a(!1),_e=c(!1),Ae=O(_e,2),Ie=Ae[0],Te=Ae[1],xe=a({}),Pe=fp({apiCredentials:U,sdkAdapter:$}),Re=Pe.apiClient,De=Pe.apiClientFromUtils,Ne=Pn.useSDKTracking(),Le=Ne.sendEvent,Oe=Os(),Me=Oe.startMotion,Fe=Oe.stopMotion,Ue=Oe.motionData,Ve=Oe.orientationData,je=a(null);null===je.current&&(je.current=Ea.initFaceVerificationData({assetRoot:ye,customInstructions:p,customIcon:h,customDirectionIcon:m,customStepTimeConstraints:v}));var ze=c(),Ke=O(ze,2),He=Ke[0],qe=Ke[1],Ge=o((function(e){qe(e)}),[]),We=n((function(){return Zu(Ge,500)}),[Ge]),Qe=a([]),Xe=a(),Ye=Df({livenessSettings:I,apiClient:De,apiCheck:r,onError:b}),Ze=Ye.face_tracking_setting,$e=Ye.flow_interval_time_ms,Je=Ye.limit_time_liveness_check,er=Ye.terminate_if_no_face,rr=Ye.close_eye_detector,tr=void 0===rr?{}:rr,nr=Ye.captureFrameSettings,ar=void 0===nr?_:nr,or=Ye.exif_data_settings,ir=Ye.take_one_picture_time_ms,sr=a(""),cr=o((function(e){if(null!=e&&e.event){if(e.event===(null==lp?void 0:lp.show_alert)){var r,t=null===(r=e.log)||void 0===r?void 0:r.alert;if(t===sr.current)return;sr.current=t}Le(e),Y&&Y(e)}}),[Y,Le]),ur=n((function(){return Zu((function(e){cr(e)}),2e3)}),[cr]),lr=a(0),dr=a();i((function(){cr({tag:"selfie",event:null==lp?void 0:lp.start_camera,log:{}})}),[cr]),i((function(){return op.start(),Rs.initExifData(),function(){op.stop()}}),[]),i((function(){var e=!1;function r(){return(r=S(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(Ie){r.next=13;break}return Xe.current=performance.now(),r.next=4,Xf(be);case 4:return xe.current=r.sent,r.next=7,di.initTensorFlow({preferredBackends:["wasm","webgl","cpu"]});case 7:if(!e){r.next=9;break}return r.abrupt("return");case 9:Te(!0),cr({tag:"selfie",event:null==lp?void 0:lp.show_warmup,log:{}}),cr({tag:"selfie",event:null==lp?void 0:lp.finish_load_model,log:{status:"success",time_in_ms:performance.now()-Xe.current}}),Xe.current=null;case 13:case"end":return r.stop()}}),r)})))).apply(this,arguments)}return function(){r.apply(this,arguments)}(),function(){e=!0}}),[Ie,be,cr]);var fr=o((function(){P(""),je.current.curStepIndex=je.current.steps.length,le(!1),op.stop(),setTimeout((function(){je.current=Ea.initFaceVerificationData({assetRoot:ye,customInstructions:p,customIcon:h,customDirectionIcon:m}),op.start(),lr.current=0,dr.current=null,Qe.current=[],he(!1),Zf(),Be()}),$e)}),[ye,p,h,m,$e,P]),pr=n((function(){return x(x({},cp),N)}),[N]),hr=n((function(){return x(x({},up),L)}),[L]),mr=400;i((function(){if(oe&&Je.enable&&pe){var e=Je.limit_time_second+1,r=Je.remain_time_show||10,t=Je.format||"s";op.start("limit",(function(n){var a=e-n;if(je.current.curStepIndex<je.current.steps.length){if(a<=r&&a>=1){var o=Kd(hr.REMAIN_TIME[ve]),i=a;switch(t){case"mm:ss":i=a.toString().padStart(5,"00:00");break;case"ss":i=a.toString().padStart(2,"0")}P(o({x:i}))}if(0===a){var s,c={};Object.keys(null===(s=pr.liveness_terminated_time_out)||void 0===s?void 0:s.msg).forEach((function(e){var r,t=Kd(null===(r=pr.liveness_terminated_time_out)||void 0===r?void 0:r.msg[e]);c[e]=t({x:Je.limit_time_second})})),qe(x(x({},pr.liveness_terminated_time_out),{},{msg:c,duration:$e})),cr({tag:"selfie",event:null==lp?void 0:lp.show_alert,log:{alert:"liveness_terminated_time_out,"}}),fr()}}}))}}),[fr,P,oe,ve,$e,Je.enable,Je.limit_time_second,pe,pr.liveness_terminated_time_out,hr.REMAIN_TIME,Je.format,Je.remain_time_show,cr]);var gr=o((function(e){var r,t,n=e.clientWidth,a=e.clientHeight,o=e.videoAreaWidth,i=e.videoAreaHeight,c=e.lostX,u=e.lostY;qs.isMobile?t=r=o:r=t=i-200;var l=Math.floor((o-r)/2)+c,p=5+u,h=s;Ee.current={x:l,y:p,width:r,height:t,image:h,surroundStyle:d},"object"===B(f)?Ee.current=x(x({},Ee.current),f):"function"==typeof f&&(Ee.current=x(x({},Ee.current),f({clientWidth:n,clientHeight:a,videoAreaWidth:o,videoAreaHeight:i,lostX:c,lostY:u,isMobile:qs.isMobile,width:r,height:t}))),Be(),ie(!0)}),[s,d,f]),vr=c(3),yr=O(vr,2),br=yr[0],Cr=yr[1],wr=c(!1),kr=O(wr,2),Br=kr[0],Er=kr[1],Sr=a(!1),_r=o((function(e){Er(e),Sr.current=e}),[]),Ar=a(null),Ir=a([]),Tr=o((function(){Cr(3),clearInterval(Ar.current),_r(!0);var e=function(){var e=S(regeneratorRuntime.mark((function e(t){var n,a,o,i,s,c,u,l,d,f,p,h,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t-1!=0){e.next=25;break}return clearInterval(Ar.current),n=Ir.current,D(),te(!0),Fe(),Rs.preWriteExif({mode:Rs.MODE.SELFIE,motionData:Ue,orientationData:Ve,startTime:Date.now()-1e3*op.duration("from_1st_frame"),endTime:Date.now()}),a=n.map((function(e){return So.resizeBlobImg(e.blob,mr,mr)})),e.next=10,Promise.all(a);case 10:return o=e.sent,i=o.map((function(e,r){return Rs.writeExif({mode:Rs.MODE.SELFIE,imageData:x(x({},n[r]),{},{blob:e,gesture:"frontal"}),enableExifData:or.enable})})),e.next=14,Promise.all(i);case 14:if(s=e.sent,c={},!q||!q.key){e.next=23;break}return u=q.key,l=s.map((function(e){return mi.encrypt({blob:e,key:u})})),e.next=21,Promise.all(l);case 21:d=e.sent,c={frontalFacesEncrypted:d};case 23:r?(p=M(Qe.current),h=function(e){return{label:"portrait",metadata:JSON.stringify({gesture_score:e,gesture:sp.FRONTAL})}},m=n.map((function(e,r){return Re.uploadImage(x({file:s[r]},h(e.leftRightScore)))})),q&&q.key&&(m=n.map((function(e,r){return De.httpClient.post("/v1/images",x({base64:c.frontalFacesEncrypted[r].hex},h(e.leftRightScore)),{"X-TV-Key":q.key})}))),Promise.all(m).then((function(e){return Re.verifyFaceLiveness({images:e.map((function(e){return{id:e.data.image_id}})),videos:[{frames:p}]})})).then((function(e){y({apiCheckPassed:e.data.is_live,verifyFaceLivenessResult:e.data})})).catch((function(e){b({error:e})}))):$ instanceof js?(te(!0),f=x(x({mode:ip.PASSIVE,imageAddedExif:s,frontalFaceImages:n},c),{},{capturedFrames:Qe.current,steps:je.current.steps}),y(f),te(!1)):y(x(x({frontalFaces:s},c),{},{capturedFrames:Qe.current})),te(!1);case 25:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}();Ar.current=setInterval((function(){Cr((function(r){return e(r),r-1}))}),ir/3)}),[ir,_r,r,y,Re,De,b,D,q,Fe,Ue,Ve,or.enable,$]),xr=a({});i((function(){xr.current.isFirstValidFrameFoundRef=pe}),[pe]),i((function(){var e,t=me.current,n=function(){var e=S(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=je.current.steps,t=[],r.map((function(e){return t.push({name:e.name,blob:e.image.blob,captureTime:e.image.captureTime,gesture:e.name}),e.frontalFaceImage.blob&&t.push({name:e.name,blob:e.frontalFaceImage.blob,captureTime:e.frontalFaceImage.captureTime,gesture:sp.FRONTAL}),0})),n=t.map((function(e){return So.resizeBlobImg(e.blob,mr,mr)})),e.next=6,Promise.all(n);case 6:return a=e.sent,o="0",_.framesBatchLength>0&&(i="".concat(Math.floor(Qe.current.length/_.framesBatchLength),"x").concat(_.framesBatchLength),s=Qe.current.length%_.framesBatchLength>0?"+".concat(Qe.current.length%_.framesBatchLength):"",o="".concat(Qe.current.length,":").concat(i).concat(s)),c=a.map((function(e,r){return Rs.writeExif({mode:Rs.MODE.SELFIE,imageData:x(x({},t[r]),{},{blob:e,frames:o}),enableExifData:or.enable})})),e.next=12,Promise.all(c);case 12:return u=e.sent,l=t.map((function(e,r){return{name:e.name,blob:u[r]}})),e.next=16,Promise.all(r.map(function(){var e=S(regeneratorRuntime.mark((function e(t,n){var a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=l.filter((function(e){return e.name===t.name})),r[n].image.blob=a[0].blob,t.frontalFaceImage.blob&&(r[n].frontalFaceImage.blob=a[1].blob),!q||!q.key){e.next=12;break}return o=q.key,e.next=7,mi.encrypt({blob:a[0].blob,key:o});case 7:if(r[n].image.encrypted=e.sent,!t.frontalFaceImage.blob){e.next=12;break}return e.next=11,mi.encrypt({blob:a[1].blob,key:o});case 11:r[n].frontalFaceImage.encrypted=e.sent;case 12:return e.abrupt("return",0);case 13:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}()));case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),a=function(){var e=S(regeneratorRuntime.mark((function e(){var t,a,o,i,s,c,u,l,d,f,p,h,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=je.current.steps,o=a[je.current.curStepIndex],A(t={},K.FaceDirection.UP,null==lp?void 0:lp.capture_up_face),A(t,K.FaceDirection.LEFT,null==lp?void 0:lp.capture_left_face),A(t,K.FaceDirection.RIGHT,null==lp?void 0:lp.capture_right_face),A(t,K.FaceDirection.FRONTAL,null==lp?void 0:lp.capture_frontal_face),cr({tag:"selfie",event:t[o.name],log:{time_capture_in_seconds:((performance.now()-Xe.current)/1e3).toFixed(1)}}),je.current.curStepIndex++,Xe.current=performance.now(),Ze.enable&&"each_gesture"===Ze.limit_for&&(lr.current=0),je.current.curStepIndex!==a.length){e.next=45;break}if(Je.enable&&P(""),!y){e.next=45;break}return ar.enable&&ar.framesBatchLength>0&&Qe.current.length%ar.framesBatchLength>0&&(j(Qe.current.slice(Qe.current.length%ar.framesBatchLength*-1).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),r?$f(Qe.current.slice(Qe.current.length%ar.framesBatchLength*-1),De):$ instanceof js&&Jf(Qe.current.slice(Qe.current.length%ar.framesBatchLength*-1),Re)),cr({tag:"selfie",event:null==lp?void 0:lp.finish_capture,log:{time_capture_in_seconds:op.duration("from_1st_frame")}}),D(),te(!0),Fe(),Rs.preWriteExif({mode:Rs.MODE.SELFIE,motionData:Ue,orientationData:Ve,startTime:Date.now()-1e3*op.duration("from_1st_frame"),endTime:Date.now()}),e.next=18,n();case 18:if(r){e.next=38;break}if(l=a.filter((function(e){return e.name!==sp.FRONTAL})).map((function(e){return{name:e.name,image:{blob:e.image.blob,encrypted:e.image.encrypted}}})),d=a.filter((function(e){return e.name!==sp.FRONTAL})).map((function(e){return e.frontalFaceImage.blob})).filter((function(e){return null!==e})),f=a.filter((function(e){return e.name!==sp.FRONTAL})).map((function(e){return e.frontalFaceImage.encrypted})).filter((function(e){return e&&e.hex})),p=null===(i=a.find((function(e){return e.name===sp.FRONTAL})))||void 0===i||null===(s=i.image)||void 0===s?void 0:s.blob,h=null===(c=a.find((function(e){return e.name===sp.FRONTAL})))||void 0===c||null===(u=c.image)||void 0===u?void 0:u.encrypted,!p||!C){e.next=30;break}return e.next=27,So.scaleImage(p,{minSize:C});case 27:e.t0=e.sent,e.next=31;break;case 30:e.t0=null;case 31:m=e.t0,p&&d.push(p),h&&f.push(h),cr({tag:"result",event:null==lp?void 0:lp.liveness_detection_done,log:{result_object:{steps:l,frontalFaces:d,frontalScaledImage:m}}}),y($ instanceof js?{mode:ip.ACTIVE,faceVerificationFlowData:je,captureFrameSettings:ar,FaceDirection:sp,capturedFrames:Qe.current}:{steps:l,frontalFaces:d,frontalFacesEncrypted:f,frontalScaledImage:m,capturedFrames:Qe.current}),e.next=44;break;case 38:if(!($ instanceof js)){e.next=42;break}y({mode:ip.ACTIVE,faceVerificationFlowData:je,captureFrameSettings:ar,FaceDirection:sp,capturedFrames:Qe.current}),e.next=44;break;case 42:return e.next=44,np({apiClient:Re,faceVerificationFlowData:je,onLivenessDetectionDone:y,captureFrameSettings:ar,FaceDirection:sp,onError:b,outputEncryptionSettings:q});case 44:te(!1);case 45:Be();case 46:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),o=Yu((function(){var e=je.current,r=e.curStepIndex,t=e.steps,n=t[r],o=null!==(null==n?void 0:n.image.blob),i=null!==(null==n?void 0:n.frontalFaceImage.blob),s=t.filter((function(e){return e.frontalFaceImage.blob})).length,c=!1;return o&&(i||![1].includes(r)||s>=1)?(Se.current=!1,a(),c=!0):Se.current=!(!o||i),le(!1),c}),k);function i(e){return c.apply(this,arguments)}function c(){return(c=S(regeneratorRuntime.mark((function e(r){var t,n,i,s,c,u,l,d,f,p,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.faceDirection,n=r.canvas,i=r.blurScore,s=r.leftRightScore,c=r.isEyeClose,u=je.current,l=u.curStepIndex,d=u.steps,!(l<d.length)){e.next=29;break}if(f=d[l],!Nf({faceDirection:t,curStep:f})){e.next=6;break}return e.abrupt("return");case 6:if(!c){e.next=8;break}return e.abrupt("return");case 8:if(t!==sp.FRONTAL||null!==f.frontalFaceImage.blurScore&&!ia.hasBetterBlurScore(i,f.frontalFaceImage.blurScore)){e.next=17;break}return f.frontalFaceImage.blurScore=i,e.next=12,ca.takePicture({canvas:n});case 12:p=e.sent,f.frontalFaceImage.blob=p,f.frontalFaceImage.leftRightScore=s,f.frontalFaceImage.captureTime=Date.now(),Se.current&&(Se.current=!1,a());case 17:if(f.name!==t||null!==f.image.blurScore&&!ia.hasBetterBlurScore(i,f.image.blurScore)){e.next=29;break}return le(!0),f.image.blurScore=i,e.next=22,ca.takePicture({canvas:n});case 22:h=e.sent,f.image.blob=h,f.image.leftRightScore=s,f.image.captureTime=Date.now(),f.image.objUrl&&URL.revokeObjectURL(f.image.objUrl),f.image.objUrl=URL.createObjectURL(h),o();case 29:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function u(e,r,t){return d.apply(this,arguments)}function d(){return(d=S(regeneratorRuntime.mark((function e(r,t,n){var a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(!0===Sr.current&&r===sp.FRONTAL&&Ir.current.length<3)){e.next=5;break}return e.next=3,ca.takePicture({canvas:t});case 3:a=e.sent,Ir.current.push({blob:a,leftRightScore:n,captureTime:Date.now()});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function f(e,t,n,a){if(Qe.current.length&&Date.now()-Qe.current[Qe.current.length-1].time<ar.framesIntervalTime)return null;if(ar.enable&&!a){var o=e.topLeft,i=e.bottomRight,s=[].concat(M(o),M(i)),c=ap(e,0===Qe.current.length),u=c.score,l=c.time,d=t.toDataURL("image/jpeg",.8);return Qe.current.push({label:"portrait",base64:d.split(",")[1],landmarks:n,original_landmarks:n,score:u,time:l,index:Qe.current.length,bbox:s,original_bbox:s}),ar.framesBatchLength>0&&Qe.current.length%ar.framesBatchLength==0&&j&&(j(Qe.current.slice(-ar.framesBatchLength).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),r?$f(Qe.current.slice(-ar.framesBatchLength),De,Qe.current.length===ar.framesBatchLength):$ instanceof js&&Jf(Qe.current.slice(-ar.framesBatchLength),Re,Qe.current.length===ar.framesBatchLength)),u}return null}function p(e){var r=e.trackingScore,t=e.isFirstValidFrameFoundRef;if(!Ze.enable||null===r||!t)return!0;var n=Ze.web_warning_threshold,a=Ze.web_terminate_threshold,o=Ze.max_warning_time;return r<n||(r<a&&lr.current<o?(lr.current++,lr.current===o?(qe(x(x({},pr.liveness_terminated_face_tracking),{},{duration:$e})),cr({tag:"selfie",event:null==lp?void 0:lp.show_alert,log:{alert:"liveness_terminated_face_tracking"}})):qe(x(x({},pr.liveness_too_fast),{},{duration:1500})),!0):(qe(x(x({},pr.liveness_terminated),{},{duration:$e})),cr({tag:"selfie",event:null==lp?void 0:lp.show_alert,log:{alert:"liveness_terminated"}}),fr(),!1))}function h(e){var r=e.noFace,t=e.isFirstValidFrameFoundRef;if(er.enable&&t){var n=er.max_time_ms;dr.current&&r||(dr.current={time:Date.now(),frame:0}),r&&dr.current.frame++;var a=dr.current.time;r&&Date.now()-a>=n&&(qe(x(x({},pr.liveness_terminated_no_face),{},{duration:$e})),cr({tag:"selfie",event:null==lp?void 0:lp.show_alert,log:{alert:"liveness_terminated_no_face"}}),fr())}}function m(e,r){return g.apply(this,arguments)}function g(){return(g=S(regeneratorRuntime.mark((function r(n,a){var o,c,d,g,y,b,C,w,k,B,E,S,_,A,I,T,x,P,R,D,N,L,M,F,U,V,j,z,H,q,G,Q,Y,Z,$,J,ee;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(0!==(null==a?void 0:a.width)&&0!==(null==a?void 0:a.height)){r.next=2;break}return r.abrupt("return");case 2:return g=xr.current.isFirstValidFrameFoundRef,y=n.cropX,b=n.cropY,C=n.cropWidth,w=n.cropHeight,a.getContext("2d").drawImage(t,y,b,C,w,-(mr*W-mr)/2/W,-(mr*W-mr)/2/W,mr,mr),k=xe.current,B=k.blazefaceModel,E=k.closeEyesModel,r.next=9,Promise.all([ia.calculateBlurScore(a),_a.getModelPredictions({model:B,sCanvas:a})]);case 9:return S=r.sent,_=O(S,2),A=_[0],I=_[1],r.next=15,Ea.validatePredictions({predictions:I,width:_a.SIZE,height:_a.SIZE});case 15:if(x=r.sent,P=x.error,R=x.fullFace,D=x.faceRatio,N=x.faceNotFrontalMinThreshold,T=P,Ee.current.image=s,M=null,F=null,U=null,V=null,j=je.current,z=j.curStepIndex,H=j.steps,!R){r.next=44;break}return q=H[z],G=q&&q.name===sp.FRONTAL,U=R.landmarks,r.next=33,Ea.calculateFaceDirection({landmarks:U,getPerfectFrontal:G});case 33:if((Q=r.sent)&&(M=Q.gesture,F=Q.leftRightScore),Y=(null==tr?void 0:tr.web_timeout)+v[K.FaceDirection.FRONTAL].delayTime/1e3,!(G&&null!=tr&&tr.enable&&(-1===op.duration("limit_close_eye")||op.duration("limit_close_eye")<Y))){r.next=44;break}return-1===op.duration("limit_close_eye")&&op.start("limit_close_eye"),r.next=40,E.predict(a,U,null==tr?void 0:tr.web_threshold);case 40:Z=r.sent,$=Z.isEyeClose,(V=$)&&!T&&(T=cp.close_eye);case 44:if(J="no_face"===(null===(o=T)||void 0===o?void 0:o.code)||"partial_face"===(null===(c=T)||void 0===c?void 0:c.code),ee=z<H.length,h({noFace:J&&ee,isFirstValidFrameFoundRef:g}),null!==(d=T)&&void 0!==d&&d.code&&ur({tag:"selfie",event:null==lp?void 0:lp.show_alert,log:{alert:T.code}}),T&&!("face_too_small"===T.code&&M!==sp.FRONTAL&&D>=N)){r.next=70;break}if(Ce||f(I[0],a,U),!Ce){r.next=58;break}if(g||(he(!0),Xe.current=performance.now(),op.start("from_1st_frame")),!p({trackingScore:f(I[0],a,U,z>=H.length),isFirstValidFrameFoundRef:g})){r.next=56;break}return r.next=56,i({faceDirection:M,canvas:a,blurScore:A,leftRightScore:F,isEyeClose:V});case 56:r.next=68;break;case 58:if(M===sp.FRONTAL){r.next=63;break}L=pr.not_frontal_face,Ee.current.image=l,r.next=68;break;case 63:if(T){r.next=68;break}return g||(he(!0),op.start("from_1st_frame")),X&&!Sr.current&&0===Ir.current.length&&setTimeout((function(){Tr()}),500),r.next=68,u(M,a,F);case 68:r.next=71;break;case 70:z<H.length&&(L=pr[T.code],Ee.current.image=l);case 71:We(L),-1!==e&&(e=requestAnimationFrame((function(){return m(n,a)})));case 73:case"end":return r.stop()}}),r)})))).apply(this,arguments)}function w(){return(w=S(regeneratorRuntime.mark((function e(){var r,n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=ca.analyzeVideoAndWindowSizes(t,Ee.current),(n=document.createElement("canvas")).width=mr,n.height=mr,(a=n.getContext("2d")).translate(mr,0),a.scale(-1*W,1*W),m(r,n);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return oe&&Ie&&setTimeout((function(){!function(){w.apply(this,arguments)}()}),H),function(){cancelAnimationFrame(e),e=-1}}),[H,oe,ve,Ce,Re,De,r,s,l,y,b,C,k,ar,D,Ze,Je.enable,P,We,v,$e,fr,er,pr,Ie,cr,j,q,W,Tr,X,tr.enable,tr.web_threshold,tr.web_timeout,Ue,Ve,Fe,or.enable,ur,_.framesBatchLength,$]),i((function(){He&&(clearInterval(Ar.current),_r(!1),Ir.current=[]),Me()}),[He,_r,Me]);var Pr=je.current,Rr=Pr.curStepIndex,Dr=Pr.steps,Nr=n((function(){return Dr.find((function(e){return e.name===K.FaceDirection.FRONTAL}))}),[Dr]),Lr=Se.current?Nr:Dr[Rr],Or=Lr&&pe?Lr.instructions[ve]:null,Mr=Lr&&pe?Lr.directionIcon:"",Fr=Lr?Lr.directionIconAnimation:"";return{countdownToTakePicture:br,cropArea:Ee,curStepIndex:Rr,directionIcon:Mr,directionIconAnimation:Fr,faceDetectionError:He,handleTriggerPassiveMode:Tr,handleVideoPlayed:gr,instructions:Or,isActiveMode:Ce,refVideo:me,showCountdown:Br,steps:Dr,videoPlayed:oe,activeCapturing:ue,isFirstValidFrameFound:pe,warmupDone:Ie,motionData:Ue,orientationData:Ve,showLoading:re}}var hp=(A(zf={},K.FaceDirection.LEFT,90),A(zf,K.FaceDirection.RIGHT,270),A(zf,K.FaceDirection.UP,180),A(zf,K.FaceDirection.DOWN,0),zf),mp=v(["0%{opacity:0.15;}50%{opacity:0.3;}100%{opacity:1;}"]),gp=m.div(Kf||(Kf=L(["\n width: 200px;\n height: 200px;\n position: relative;\n transform: scale(0.48);\n\n .top,\n .right,\n .bottom,\n .left {\n position: absolute;\n }\n\n .top {\n top: 0;\n left: 50%;\n transform: rotate(","deg) translateX(-50%);\n }\n\n .right {\n right: 0;\n top: 50%;\n transform: rotate(","deg) translateX(-50%);\n }\n\n .bottom {\n bottom: 0;\n left: 50%;\n transform: rotate(","deg) translateX(50%);\n }\n\n .left {\n left: 0;\n top: 50%;\n transform: rotate(","deg) translateX(50%);\n }\n"])),hp[K.FaceDirection.DOWN],hp[K.FaceDirection.LEFT],hp[K.FaceDirection.UP],hp[K.FaceDirection.RIGHT]),vp=m.div(Hf||(Hf=L(["\n width: 70px;\n transform: rotate(","deg);\n"])),(function(e){var r,t=e.direction;return null!==(r=hp[t])&&void 0!==r?r:0})),yp=m.span(qf||(qf=L(["\n display: flex;\n margin: 4px 0;\n width: 100%;\n height: 15px;\n animation: "," 1s infinite;\n animation-direction: alternate;\n\n &::before,\n &::after {\n content: '';\n height: 100%;\n width: 50%;\n background: rgba(255, 255, 255, 0.8);\n }\n\n &::before {\n transform: skewY(32deg);\n }\n\n &::after {\n width: 50%;\n transform: skewY(-32deg);\n }\n"])),mp),bp=m(yp)(Gf||(Gf=L(["\n animation-delay: 0s;\n"]))),Cp=m(yp)(Wf||(Wf=L(["\n animation-delay: 0.5s;\n"]))),wp=m(yp)(Qf||(Qf=L(["\n animation-delay: 1s;\n"])));function kp(e){var t=e.type;return t!==K.FaceDirection.FRONTAL?r.createElement(vp,{direction:t},r.createElement(bp,null),r.createElement(Cp,null),r.createElement(wp,null)):r.createElement(gp,null,r.createElement(vp,{className:"top"},r.createElement(bp,null),r.createElement(Cp,null),r.createElement(wp,null)),r.createElement(vp,{className:"right"},r.createElement(bp,null),r.createElement(Cp,null),r.createElement(wp,null)),r.createElement(vp,{className:"bottom"},r.createElement(bp,null),r.createElement(Cp,null),r.createElement(wp,null)),r.createElement(vp,{className:"left"},r.createElement(bp,null),r.createElement(Cp,null),r.createElement(wp,null)))}kp.propTypes={type:h.oneOf([K.FaceDirection.LEFT,K.FaceDirection.RIGHT,K.FaceDirection.UP,K.FaceDirection.FRONTAL])},kp.defaultProps={type:K.FaceDirection.LEFT};var Bp,Ep=K.ErrorDuration;function Sp(e){var t=e.children,n=e.errorMsg,a=e.className;return r.isValidElement(t)?n?r.createElement("div",{className:a},r.cloneElement(t,{errorMsg:n})):null:n?r.createElement("div",{className:a},n):null}function _p(e){var r=e.children,t=e.className,n=e.error,o=a(0),i=a(""),s=$t.useSDKSettings().lang,c=a(Ep.SHORT),u=n||{},l=u.msg,d=u.duration,f=void 0===d?Ep.SHORT:d,p=null==l?void 0:l[s];return Date.now()-o.current>=c.current?(o.current=Date.now(),c.current=f,i.current=p,Sp({children:r,errorMsg:p,className:t})):Sp({children:r,errorMsg:i.current,className:t})}_p.propTypes={children:h.node,className:h.string},_p.defaultProps={className:""};var Ap=m.circle(Bp||(Bp=L(["\n transition: stroke-dashoffset 0.4s;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n"])));function Ip(e){var t=e.className,n=e.style,a=e.radius,o=e.strokeWidth,i=e.progress,s=e.hasError,c=e.activeColor,u=e.innerPadding,l=e.outsideRingColor,d=e.outsideRingOpacity,f=e.insideRingColor,p=e.insideRingWidth,h=e.insideRingStrokeDash,m=e.errorRingWidth,g=e.errorRingColor,v=e.dashedRingColor,y=e.dashedRingOpacity,b=e.dashedRingWidth,C=e.dashedRingLineThick,w=e.dashedRingLineSpacing,k=e.dashedInsideRingColor,B=e.dashedInsideRingWidth,E=e.showOutsideRing,S=e.showInsideRing,_=e.showDashedRing,A=2*a,I=2*a,T=a-2*o,x=2*Math.PI*T,P=x-i/100*x,R=T-b/2-o/2-u,D=2*Math.PI*R,N=D-i/100*D,L=R-B/2-b/2,O=2*Math.PI*L,M=O-i/100*O,F=L-p/2-B/2,U=L-m/2-B/2;return r.createElement("svg",{className:t,style:n,width:A,height:I,viewBox:"0 0 ".concat(A," ").concat(I),fill:"none",xmlns:"http://www.w3.org/2000/svg"},E?r.createElement(r.Fragment,null,r.createElement("circle",{"data-testid":"outsideRing",opacity:d,cx:a,cy:a,r:T,stroke:l}),r.createElement(Ap,{"data-testid":"outsideAnimateRing",cx:a,cy:a,r:T,stroke:c,strokeWidth:o,strokeLinecap:"round",strokeDasharray:"".concat(x," ").concat(x),style:{strokeDashoffset:P}})):null,_?r.createElement(r.Fragment,null,r.createElement("circle",{"data-testid":"dashedRing",opacity:y,cx:a,cy:a,r:R,stroke:v,strokeWidth:b,strokeDasharray:"".concat(C," ").concat(w)}),r.createElement("mask",{id:"mask0","mask-type":"alpha",maskUnits:"userSpaceOnUse"},r.createElement("circle",{cx:a,cy:a,r:R,stroke:c,strokeWidth:b,strokeDasharray:"".concat(C," ").concat(w)})),r.createElement("g",{mask:"url(#mask0)"},r.createElement(Ap,{"data-testid":"dashedAnimateRing",cx:a,cy:a,r:R,stroke:c,strokeWidth:b,strokeDasharray:"".concat(D," ").concat(D),style:{strokeDashoffset:N}})),r.createElement("circle",{"data-testid":"dashedInsideRing",opacity:y,cx:a,cy:a,r:L,stroke:k,strokeWidth:B}),r.createElement(Ap,{"data-testid":"dashedInsideAnimateRing",cx:a,cy:a,r:L,stroke:c,strokeWidth:B,strokeLinecap:"round",strokeDasharray:"".concat(O," ").concat(O),style:{strokeDashoffset:M}})):null,S?r.createElement("circle",{"data-testid":"insideRing",strokeDasharray:h,cx:a,cy:a,r:F,stroke:f,strokeWidth:p}):null,s?r.createElement("circle",{"data-testid":"errorRing",strokeDasharray:h,cx:a,cy:a,r:U,stroke:g,strokeWidth:m}):null)}function Tp(e){var t=e.className;return r.createElement("svg",{className:t,width:"320",height:"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M320 0H0V320H320V0ZM160 296C235.111 296 296 235.111 296 160C296 84.8893 235.111 24 160 24C84.8893 24 24 84.8893 24 160C24 235.111 84.8893 296 160 296Z",fill:"currentColor"}))}function xp(){return(xp=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}Ip.propTypes={className:h.string,style:h.shape({}),radius:h.number,strokeWidth:h.number,progress:h.number,hasError:h.bool,activeColor:h.string,innerPadding:h.number,outsideRingColor:h.string,outsideRingOpacity:h.number,insideRingColor:h.string,insideRingWidth:h.number,insideRingStrokeDash:h.string,errorRingColor:h.string,errorRingWidth:h.number,dashedRingColor:h.string,dashedRingOpacity:h.number,dashedRingWidth:h.number,dashedRingLineThick:h.number,dashedRingLineSpacing:h.number,dashedInsideRingColor:h.string,dashedInsideRingWidth:h.number,showOutsideRing:h.bool,showDashedRing:h.bool,showInsideRing:h.bool},Ip.defaultProps={className:"",style:null,radius:160,strokeWidth:3,progress:0,hasError:!1,activeColor:"#0092ff",innerPadding:5,outsideRingColor:"#f2f6f9",outsideRingOpacity:.1,insideRingColor:"#f2f6f9",insideRingWidth:3,insideRingStrokeDash:"0",errorRingColor:"#df0000",errorRingWidth:3,dashedRingColor:"#ffffff",dashedRingOpacity:.3,dashedRingWidth:10,dashedRingLineThick:1,dashedRingLineSpacing:6,dashedInsideRingColor:"#ffffff",dashedInsideRingWidth:0,showOutsideRing:!0,showDashedRing:!0,showInsideRing:!0},Tp.propTypes={className:h.string},Tp.defaultProps={className:""};var Pp,Rp,Dp="undefined"!=typeof window?f:i,Np={popupContent:{tooltip:{position:"absolute",zIndex:999},modal:{position:"relative",margin:"auto"}},popupArrow:{height:"8px",width:"16px",position:"absolute",background:"transparent",color:"#FFF",zIndex:-1},overlay:{tooltip:{position:"fixed",top:"0",bottom:"0",left:"0",right:"0",zIndex:999},modal:{position:"fixed",top:"0",bottom:"0",left:"0",right:"0",display:"flex",zIndex:999}}},Lp=["top left","top center","top right","right top","right center","right bottom","bottom left","bottom center","bottom right","left top","left center","left bottom"],Op=function(e,r,t,n,a){var o=a.offsetX,i=a.offsetY,s=n?8:0,c=t.split(" "),u=e.top+e.height/2,l=e.left+e.width/2,d=r.height,f=r.width,p=u-d/2,h=l-f/2,m="",g="0%",v="0%";switch(c[0]){case"top":p-=d/2+e.height/2+s,m="rotate(180deg) translateX(50%)",g="100%",v="50%";break;case"bottom":p+=d/2+e.height/2+s,m="rotate(0deg) translateY(-100%) translateX(-50%)",v="50%";break;case"left":h-=f/2+e.width/2+s,m=" rotate(90deg) translateY(50%) translateX(-25%)",v="100%",g="50%";break;case"right":h+=f/2+e.width/2+s,m="rotate(-90deg) translateY(-150%) translateX(25%)",g="50%"}switch(c[1]){case"top":p=e.top,g=e.height/2+"px";break;case"bottom":p=e.top-d+e.height,g=d-e.height/2+"px";break;case"left":h=e.left,v=e.width/2+"px";break;case"right":h=e.left-f+e.width,v=f-e.width/2+"px"}return{top:p="top"===c[0]?p-i:p+i,left:h="left"===c[0]?h-o:h+o,transform:m,arrowLeft:v,arrowTop:g}},Mp=function(e,r,t,n,a,o){var i=a.offsetX,s=a.offsetY,c={arrowLeft:"0%",arrowTop:"0%",left:0,top:0,transform:"rotate(135deg)"},u=0,l=function(e){var r={top:0,left:0,width:window.innerWidth,height:window.innerHeight};if("string"==typeof e){var t=document.querySelector(e);null!==t&&(r=t.getBoundingClientRect())}return r}(o),d=Array.isArray(t)?t:[t];for((o||Array.isArray(t))&&(d=[].concat(d,Lp));u<d.length;){var f={top:(c=Op(e,r,d[u],n,{offsetX:i,offsetY:s})).top,left:c.left,width:r.width,height:r.height};if(!(f.top<=l.top||f.left<=l.left||f.top+f.height>=l.top+l.height||f.left+f.width>=l.left+l.width))break;u++}return c},Fp=0,Up=l((function(e,t){var n=e.trigger,o=void 0===n?null:n,s=e.onOpen,u=void 0===s?function(){}:s,l=e.onClose,f=void 0===l?function(){}:l,p=e.defaultOpen,h=void 0!==p&&p,m=e.open,g=void 0===m?void 0:m,v=e.disabled,y=void 0!==v&&v,b=e.nested,C=void 0!==b&&b,k=e.closeOnDocumentClick,B=void 0===k||k,E=e.repositionOnResize,S=void 0===E||E,_=e.closeOnEscape,A=void 0===_||_,I=e.on,T=void 0===I?["click"]:I,x=e.contentStyle,P=void 0===x?{}:x,R=e.arrowStyle,D=void 0===R?{}:R,N=e.overlayStyle,L=void 0===N?{}:N,O=e.className,M=void 0===O?"":O,F=e.position,U=void 0===F?"bottom center":F,V=e.modal,j=void 0!==V&&V,z=e.lockScroll,K=void 0!==z&&z,H=e.arrow,q=void 0===H||H,G=e.offsetX,W=void 0===G?0:G,Q=e.offsetY,X=void 0===Q?0:Q,Y=e.mouseEnterDelay,Z=void 0===Y?100:Y,$=e.mouseLeaveDelay,J=void 0===$?100:$,ee=e.keepTooltipInside,re=void 0!==ee&&ee,te=e.children,ne=c(g||h),ae=ne[0],oe=ne[1],ie=a(null),se=a(null),ce=a(null),ue=a(null),le=a("popup-"+ ++Fp),de=!!j||!o,fe=a(0);Dp((function(){return ae?(ue.current=document.activeElement,Ee(),we(),be()):Ce(),function(){clearTimeout(fe.current)}}),[ae]),i((function(){"boolean"==typeof g&&(g?pe():he())}),[g,y]);var pe=function(e){ae||y||(oe(!0),setTimeout((function(){return u(e)}),0))},he=function(e){var r;ae&&!y&&(oe(!1),de&&(null===(r=ue.current)||void 0===r||r.focus()),setTimeout((function(){return f(e)}),0))},me=function(e){null==e||e.stopPropagation(),ae?he(e):pe(e)},ge=function(e){clearTimeout(fe.current),fe.current=setTimeout((function(){return pe(e)}),Z)},ve=function(e){null==e||e.preventDefault(),me()},ye=function(e){clearTimeout(fe.current),fe.current=setTimeout((function(){return he(e)}),J)},be=function(){de&&K&&(document.getElementsByTagName("body")[0].style.overflow="hidden")},Ce=function(){de&&K&&(document.getElementsByTagName("body")[0].style.overflow="auto")},we=function(){var e,r=null==se||null===(e=se.current)||void 0===e?void 0:e.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'),t=Array.prototype.slice.call(r)[0];null==t||t.focus()};d(t,(function(){return{open:function(){pe()},close:function(){he()},toggle:function(){me()}}}));var ke,Be,Ee=function(){if(!de&&ae&&(null==ie?void 0:ie.current)&&(null==ie?void 0:ie.current)&&(null==se?void 0:se.current)){var e,r,t=ie.current.getBoundingClientRect(),n=se.current.getBoundingClientRect(),a=Mp(t,n,U,q,{offsetX:W,offsetY:X},re);if(se.current.style.top=a.top+window.scrollY+"px",se.current.style.left=a.left+window.scrollX+"px",q&&ce.current)ce.current.style.transform=a.transform,ce.current.style.setProperty("-ms-transform",a.transform),ce.current.style.setProperty("-webkit-transform",a.transform),ce.current.style.top=(null===(e=D.top)||void 0===e?void 0:e.toString())||a.arrowTop,ce.current.style.left=(null===(r=D.left)||void 0===r?void 0:r.toString())||a.arrowLeft}};void 0===(Be=A)&&(Be=!0),i((function(){if(Be){var e=function(e){"Escape"===e.key&&ke(e)};return document.addEventListener("keyup",e),function(){Be&&document.removeEventListener("keyup",e)}}}),[ke=he,Be]),function(e,r){void 0===r&&(r=!0),i((function(){if(r){var t=function(r){if(9===r.keyCode){var t,n=null==e||null===(t=e.current)||void 0===t?void 0:t.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'),a=Array.prototype.slice.call(n);if(1===a.length)return void r.preventDefault();var o=a[0],i=a[a.length-1];r.shiftKey&&document.activeElement===o?(r.preventDefault(),i.focus()):document.activeElement===i&&(r.preventDefault(),o.focus())}};return document.addEventListener("keydown",t),function(){r&&document.removeEventListener("keydown",t)}}}),[e,r])}(se,ae&&de),function(e,r){void 0===r&&(r=!0),i((function(){if(r){var t=function(){e()};return window.addEventListener("resize",t),function(){r&&window.removeEventListener("resize",t)}}}),[e,r])}(Ee,S),function(e,r,t){void 0===t&&(t=!0),i((function(){if(t){var n=function(t){var n=Array.isArray(e)?e:[e],a=!1;n.forEach((function(e){e.current&&!e.current.contains(t.target)||(a=!0)})),t.stopPropagation(),a||r(t)};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),function(){t&&(document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n))}}}),[e,r,t])}(o?[se,ie]:[se],he,B&&!C);var Se,_e=function(){return r.createElement("div",Object.assign({},(e=de?Np.popupContent.modal:Np.popupContent.tooltip,t={className:"popup-content "+(""!==M?M.split(" ").map((function(e){return e+"-content"})).join(" "):""),style:xp({},e,P,{pointerEvents:"auto"}),ref:se,onClick:function(e){e.stopPropagation()}},!j&&T.indexOf("hover")>=0&&(t.onMouseEnter=ge,t.onMouseLeave=ye),t),{key:"C",role:de?"dialog":"tooltip",id:le.current}),q&&!de&&r.createElement("div",{ref:ce,style:Np.popupArrow},r.createElement("svg",{"data-testid":"arrow",className:"popup-arrow "+(""!==M?M.split(" ").map((function(e){return e+"-arrow"})).join(" "):""),viewBox:"0 0 32 16",style:xp({position:"absolute"},D)},r.createElement("path",{d:"M16 0l16 16H0z",fill:"currentcolor"}))),te&&"function"==typeof te?te(he,ae):te);var e,t},Ae=!(T.indexOf("hover")>=0),Ie=de?Np.overlay.modal:Np.overlay.tooltip,Te=[Ae&&r.createElement("div",{key:"O","data-testid":"overlay","data-popup":de?"modal":"tooltip",className:"popup-overlay "+(""!==M?M.split(" ").map((function(e){return e+"-overlay"})).join(" "):""),style:xp({},Ie,L,{pointerEvents:B&&C||de?"auto":"none"}),onClick:B&&C?he:void 0,tabIndex:-1},de&&_e()),!de&&_e()];return r.createElement(r.Fragment,null,function(){for(var e={key:"T",ref:ie,"aria-describedby":le.current},t=Array.isArray(T)?T:[T],n=0,a=t.length;n<a;n++)switch(t[n]){case"click":e.onClick=me;break;case"right-click":e.onContextMenu=ve;break;case"hover":e.onMouseEnter=ge,e.onMouseLeave=ye;break;case"focus":e.onFocus=ge,e.onBlur=ye}if("function"==typeof o){var i=o(ae);return!!o&&r.cloneElement(i,e)}return!!o&&r.cloneElement(o,e)}(),ae&&w.createPortal(Te,(null===(Se=document.getElementById("popup-root"))&&((Se=document.createElement("div")).setAttribute("id","popup-root"),document.body.appendChild(Se)),Se)))})),Vp=y(Pp||(Pp=L(["\n .popup-content {\n margin: auto;\n background: #fff;\n width: 100%;\n padding: 5px;\n border: 1px solid #d7d7d7;\n max-width: 568px;\n border-radius: 10px;\n }\n\n [role=tooltip].popup-content {\n width: 200px;\n box-shadow: 0 0 3px rgba(0, 0, 0, .16);\n border-radius: 5px\n }\n\n .popup-overlay {\n background: rgba(0, 0, 0, .5);\n padding: 10px;\n }\n\n [data-popup=tooltip].popup-overlay {\n background: transparent\n }\n\n .popup-arrow {\n -webkit-filter: drop-shadow(0 -3px 3px rgba(0, 0, 0, .16));\n filter: drop-shadow(0 -3px 3px rgba(0, 0, 0, .16));\n color: #fff;\n stroke-width: 2px;\n stroke: #d7d7d7;\n stroke-dasharray: 30px;\n stroke-dashoffset: -54px;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0\n }\n"]))),jp=["open","children","overlayStyle"],zp=function(e){var t=e.open,n=e.children,a=e.overlayStyle,o=N(e,jp);return r.createElement(r.Fragment,null,t&&r.createElement(r.Fragment,null,r.createElement(Up,I({overlayStyle:x(x({},a),{},{zIndex:2e3}),closeOnDocumentClick:!1,closeOnEscape:!1,modal:!0,open:t},o),n),r.createElement(Vp,null)))};zp.propTypes={open:h.bool,children:h.node,overlayStyle:h.shape({})},zp.defaultProps={open:!1,children:null,overlayStyle:{}};var Kp={WARMUP_INTRO:{en:"Warming up... Please wait a moment",vi:"Đang khởi động, vui lòng chờ trong giây lát..."}},Hp=m.div(Rp||(Rp=L(["\n font-size: 18px;\n text-align: center;\n padding: 10px;\n"]))),qp=function(e){var t=e.contentStyle,n=$t.useSDKSettings(),a=n.lang,o=n.warmupMessage,i=o?o[a]:Kp.WARMUP_INTRO[a];return r.createElement(zp,{open:!0,contentStyle:t},r.createElement(Hp,{className:"warmup-message"},i))};qp.propTypes={contentStyle:h.shape({})},qp.defaultProps={contentStyle:{}};var Gp=v(["from{transform:perspective(400px);}to{transform:perspective(400px) rotateY(90deg);}"]),Wp=v(["from{transform:perspective(400px) rotateY(-90deg);}to{transform:perspective(400px);}"]),Qp=b([".flipY-exit{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}.flipY-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-out;}"],Gp,500,Wp,500),Xp=Object.freeze({__proto__:null,animationDuration:500,default:Qp}),Yp=v(["from,to{transform:translate3d(-","px,0,0);}50%{transform:translate3d(","px,0,0);}"],20,20),Zp=v(["from,to{transform:translate3d(0,-","px,0);}50%{transform:translate3d(0,","px,0);}"],20,20),$p=b([".slide-horizontal{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}.slide-vertical{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}"],Yp,Zp),Jp=Object.freeze({__proto__:null,default:$p}),eh=v(["from,to{opacity:1;}50%{opacity:0;}"]),rh=b([".blink{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}"],eh),th=Object.freeze({__proto__:null,default:rh});function nh(){return(nh=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function ah(e,r){if(null==e)return{};var t,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||(a[t]=e[t]);return a}function oh(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,e.__proto__=r}function ih(e,r){return e.replace(new RegExp("(^|\\s)"+r+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var sh=!1,ch=r.createContext(null),uh="entering",lh="entered",dh=function(e){function t(r,t){var n;n=e.call(this,r,t)||this;var a,o=t&&!t.isMounting?r.enter:r.appear;return n.appearStatus=null,r.in?o?(a="exited",n.appearStatus=uh):a=lh:a=r.unmountOnExit||r.mountOnEnter?"unmounted":"exited",n.state={status:a},n.nextCallback=null,n}oh(t,e),t.getDerivedStateFromProps=function(e,r){return e.in&&"unmounted"===r.status?{status:"exited"}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var r=null;if(e!==this.props){var t=this.state.status;this.props.in?t!==uh&&t!==lh&&(r=uh):t!==uh&&t!==lh||(r="exiting")}this.updateStatus(!1,r)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,r,t,n=this.props.timeout;return e=r=t=n,null!=n&&"number"!=typeof n&&(e=n.exit,r=n.enter,t=void 0!==n.appear?n.appear:r),{exit:e,enter:r,appear:t}},n.updateStatus=function(e,r){void 0===e&&(e=!1),null!==r?(this.cancelNextCallback(),r===uh?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&"exited"===this.state.status&&this.setState({status:"unmounted"})},n.performEnter=function(e){var r=this,t=this.props.enter,n=this.context?this.context.isMounting:e,a=this.props.nodeRef?[n]:[w.findDOMNode(this),n],o=a[0],i=a[1],s=this.getTimeouts(),c=n?s.appear:s.enter;!e&&!t||sh?this.safeSetState({status:lh},(function(){r.props.onEntered(o)})):(this.props.onEnter(o,i),this.safeSetState({status:uh},(function(){r.props.onEntering(o,i),r.onTransitionEnd(c,(function(){r.safeSetState({status:lh},(function(){r.props.onEntered(o,i)}))}))})))},n.performExit=function(){var e=this,r=this.props.exit,t=this.getTimeouts(),n=this.props.nodeRef?void 0:w.findDOMNode(this);r&&!sh?(this.props.onExit(n),this.safeSetState({status:"exiting"},(function(){e.props.onExiting(n),e.onTransitionEnd(t.exit,(function(){e.safeSetState({status:"exited"},(function(){e.props.onExited(n)}))}))}))):this.safeSetState({status:"exited"},(function(){e.props.onExited(n)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,r){r=this.setNextCallback(r),this.setState(e,r)},n.setNextCallback=function(e){var r=this,t=!0;return this.nextCallback=function(n){t&&(t=!1,r.nextCallback=null,e(n))},this.nextCallback.cancel=function(){t=!1},this.nextCallback},n.onTransitionEnd=function(e,r){this.setNextCallback(r);var t=this.props.nodeRef?this.props.nodeRef.current:w.findDOMNode(this),n=null==e&&!this.props.addEndListener;if(t&&!n){if(this.props.addEndListener){var a=this.props.nodeRef?[this.nextCallback]:[t,this.nextCallback],o=a[0],i=a[1];this.props.addEndListener(o,i)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if("unmounted"===e)return null;var t=this.props,n=t.children,a=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,ah(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return r.createElement(ch.Provider,{value:null},"function"==typeof n?n(e,a):r.cloneElement(r.Children.only(n),a))},t}(r.Component);function fh(){}dh.contextType=ch,dh.propTypes={},dh.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:fh,onEntering:fh,onEntered:fh,onExit:fh,onExiting:fh,onExited:fh},dh.UNMOUNTED="unmounted",dh.EXITED="exited",dh.ENTERING=uh,dh.ENTERED=lh,dh.EXITING="exiting";var ph,hh,mh=function(e,r){return e&&r&&r.split(" ").forEach((function(r){return n=r,void((t=e).classList?t.classList.add(n):function(e,r){return e.classList?!!r&&e.classList.contains(r):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+r+" ")}(t,n)||("string"==typeof t.className?t.className=t.className+" "+n:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+n)));var t,n}))},gh=function(e,r){return e&&r&&r.split(" ").forEach((function(r){return n=r,void((t=e).classList?t.classList.remove(n):"string"==typeof t.className?t.className=ih(t.className,n):t.setAttribute("class",ih(t.className&&t.className.baseVal||"",n)));var t,n}))},vh=function(e){function t(){for(var r,t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return(r=e.call.apply(e,[this].concat(n))||this).appliedClasses={appear:{},enter:{},exit:{}},r.onEnter=function(e,t){var n=r.resolveArguments(e,t),a=n[0],o=n[1];r.removeClasses(a,"exit"),r.addClass(a,o?"appear":"enter","base"),r.props.onEnter&&r.props.onEnter(e,t)},r.onEntering=function(e,t){var n=r.resolveArguments(e,t),a=n[0],o=n[1]?"appear":"enter";r.addClass(a,o,"active"),r.props.onEntering&&r.props.onEntering(e,t)},r.onEntered=function(e,t){var n=r.resolveArguments(e,t),a=n[0],o=n[1]?"appear":"enter";r.removeClasses(a,o),r.addClass(a,o,"done"),r.props.onEntered&&r.props.onEntered(e,t)},r.onExit=function(e){var t=r.resolveArguments(e)[0];r.removeClasses(t,"appear"),r.removeClasses(t,"enter"),r.addClass(t,"exit","base"),r.props.onExit&&r.props.onExit(e)},r.onExiting=function(e){var t=r.resolveArguments(e)[0];r.addClass(t,"exit","active"),r.props.onExiting&&r.props.onExiting(e)},r.onExited=function(e){var t=r.resolveArguments(e)[0];r.removeClasses(t,"exit"),r.addClass(t,"exit","done"),r.props.onExited&&r.props.onExited(e)},r.resolveArguments=function(e,t){return r.props.nodeRef?[r.props.nodeRef.current,e]:[e,t]},r.getClassNames=function(e){var t=r.props.classNames,n="string"==typeof t,a=n?""+(n&&t?t+"-":"")+e:t[e];return{baseClassName:a,activeClassName:n?a+"-active":t[e+"Active"],doneClassName:n?a+"-done":t[e+"Done"]}},r}oh(t,e);var n=t.prototype;return n.addClass=function(e,r,t){var n=this.getClassNames(r)[t+"ClassName"],a=this.getClassNames("enter").doneClassName;"appear"===r&&"done"===t&&a&&(n+=" "+a),"active"===t&&e&&e.scrollTop,n&&(this.appliedClasses[r][t]=n,mh(e,n))},n.removeClasses=function(e,r){var t=this.appliedClasses[r],n=t.base,a=t.active,o=t.done;this.appliedClasses[r]={},n&&gh(e,n),a&&gh(e,a),o&&gh(e,o)},n.render=function(){var e=this.props,t=(e.classNames,ah(e,["classNames"]));return r.createElement(dh,nh({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(r.Component);vh.defaultProps={classNames:""},vh.propTypes={};var yh,bh,Ch="out-in",wh="in-out",kh=function(e,r,t){return function(){var n;e.props[r]&&(n=e.props)[r].apply(n,arguments),t()}},Bh=((ph={})[Ch]=function(e){var t=e.current,n=e.changeState;return r.cloneElement(t,{in:!1,onExited:kh(t,"onExited",(function(){n(uh,null)}))})},ph[wh]=function(e){var t=e.current,n=e.changeState,a=e.children;return[t,r.cloneElement(a,{in:!0,onEntered:kh(a,"onEntered",(function(){n(uh)}))})]},ph),Eh=((hh={})[Ch]=function(e){var t=e.children,n=e.changeState;return r.cloneElement(t,{in:!0,onEntered:kh(t,"onEntered",(function(){n(lh,r.cloneElement(t,{in:!0}))}))})},hh[wh]=function(e){var t=e.current,n=e.children,a=e.changeState;return[r.cloneElement(t,{in:!1,onExited:kh(t,"onExited",(function(){a(lh,r.cloneElement(n,{in:!0}))}))}),r.cloneElement(n,{in:!0})]},hh),Sh=function(e){function t(){for(var r,t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return(r=e.call.apply(e,[this].concat(n))||this).state={status:lh,current:null},r.appeared=!1,r.changeState=function(e,t){void 0===t&&(t=r.state.current),r.setState({status:e,current:t})},r}oh(t,e);var n=t.prototype;return n.componentDidMount=function(){this.appeared=!0},t.getDerivedStateFromProps=function(e,t){return null==e.children?{current:null}:t.status===uh&&e.mode===wh?{status:uh}:!t.current||(n=t.current,a=e.children,n===a||r.isValidElement(n)&&r.isValidElement(a)&&null!=n.key&&n.key===a.key)?{current:r.cloneElement(e.children,{in:!0})}:{status:"exiting"};var n,a},n.render=function(){var e,t=this.props,n=t.children,a=t.mode,o=this.state,i=o.status,s=o.current,c={children:n,current:s,changeState:this.changeState,status:i};switch(i){case uh:e=Eh[a](c);break;case"exiting":e=Bh[a](c);break;case lh:e=s}return r.createElement(ch.Provider,{value:{isMounting:!this.appeared}},e)},t}(r.Component);Sh.propTypes={},Sh.defaultProps={mode:Ch};var _h=m.div(yh||(yh=L(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: ","; // must be higher than BASE_Z_INDEX and lower than other layers\n"])),1001),Ah=v(["from{background:#000;}to{}"]),Ih=b([".splash-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}"],Ah,300),Th=m.div(bh||(bh=L(["\n ","\n"])),Ih),xh=function(e){var t=e.keyForTransition,n=void 0===t?0:t;return r.createElement(Th,null,r.createElement(Sh,null,r.createElement(vh,{key:n,timeout:{enter:300,exit:0},classNames:"splash",unmountOnExit:!1},r.createElement(_h,null))))},Ph=Object.freeze({__proto__:null,default:xh}),Rh=v(["from{transform:rotate(0deg);}to{transform:rotate(360deg);}"]),Dh=b([".spin{animation-name:",";animation-iteration-count:infinite;animation-duration:1000ms;animation-timing-function:linear;}"],Rh),Nh=Object.freeze({__proto__:null,default:Dh}),Lh=Object.freeze({__proto__:null,flipY:Xp,slide:Jp,blink:th,splash:Ph,spin:Nh}),Oh={DEFAULT:"default",ERROR:"error"};function Mh(e){var t=e.className,a=e.width,o=e.height,i=e.type,s=e.strokeStyles,c=e.strokeWidth,u=e.radius,l=e.paddingStyle,d=n((function(){var e;return x((A(e={},Oh.DEFAULT,{fill:"none",strokeWidth:c,stroke:"#fff",strokeDasharray:"7, 4",opacity:.6}),A(e,Oh.ERROR,{fill:"rgba(234,50,35, 0.1)",strokeWidth:c,stroke:"#ea3223"}),e),s)}),[c,s]),f=u+.8*c,p=d[i];return r.createElement("svg",{width:a,height:o,className:t},r.createElement("rect",{x:c/2,y:c/2,rx:u,ry:u,width:a-c,height:o-c,style:p}),r.createElement("path",{d:"M0,".concat(f," Q0,0 ").concat(f,",0 L0,0 Z"),style:l}),r.createElement("path",{d:"M0,".concat(o-f," Q0,").concat(o," ").concat(f,",").concat(o," L0,").concat(o," Z"),style:l}),r.createElement("path",{d:"M".concat(a-f,",").concat(o," Q").concat(a,",").concat(o," ").concat(a,",").concat(o-f," L").concat(a,",").concat(o," Z"),style:l}),r.createElement("path",{d:"M".concat(a-f,",0 Q").concat(a,",0 ").concat(a,",").concat(f," L").concat(a,",0 Z"),style:l}))}Mh.propTypes={className:h.string,width:h.number,height:h.number,strokeWidth:h.number,strokeStyles:h.shape({}),type:h.oneOf([Oh.DEFAULT,Oh.ERROR]),radius:h.number,paddingStyle:h.shape({})},Mh.defaultProps={className:"",width:600,height:400,strokeWidth:2,strokeStyles:{},type:Oh.DEFAULT,radius:10,paddingStyle:{fill:"rgba(0, 0, 0, 0.6)"}};var Fh,Uh,Vh,jh,zh,Kh,Hh,qh,Gh,Wh,Qh,Xh,Yh,Zh,$h,Jh,em,rm,tm,nm,am,om,im,sm,cm,um,lm,dm,fm,pm,hm,mm,gm=["width","height","type"],vm=m(Mh)(Fh||(Fh=L([""]))),ym=m.img(Uh||(Uh=L(["\n position: absolute;\n top: 0;\n left: 0;\n"]))),bm=xh,Cm=m.div(Vh||(Vh=L(["\n ","\n ","\n"])),Qp,Dh),wm=m.img(jh||(jh=L(["\n border-radius: 5px;\n opacity: 0.7;\n height: 38px;\n"]))),km=m.div(zh||(zh=L(["\n cursor: pointer;\n text-align: center;\n width: ","px;\n\n img {\n width: 100%;\n }\n\n z-index: ",";\n position: fixed;\n\n ","\n"])),60,1020,qs.isMobile?b(["top:",";"],(function(e){return e.y})):b(["bottom:","px;"],10)),Bm=m.div(Kh||(Kh=L(["\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n position: absolute;\n margin: auto;\n width: ","px;\n height: ","px;\n\n img {\n width: 100%;\n }\n\n z-index: ",";\n"])),100,100,1020),Em=m.div(Hh||(Hh=L(["\n color: #fff;\n text-align: center;\n"]))),Sm=m.div(qh||(qh=L(["\n transform: translateZ(1000px); // to fix rotating bug on safari\n transform-style: preserve-3d;\n position: absolute;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),_m=m.div(Gh||(Gh=L(["\n display: flex;\n align-items: center;\n"]))),Am=m(Em)(Wh||(Wh=L(["\n font-size: 20px;\n margin-left: 10px;\n color: #fff;\n"]))),Im=m(Em)(Qh||(Qh=L(["\n font-size: 20px;\n margin-left: 10px;\n color: green;\n position: absolute;\n left: 0;\n top: 10px;\n background: white;\n z-index: ",";\n"])),1030),Tm=m(Em)(Xh||(Xh=L(["\n position: absolute;\n font-size: 16px;\n text-align: center;\n color: #fff;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),xm=m(Tm)(Yh||(Yh=L(["\n background: #ea3223;\n padding: 5px 10px;\n border-radius: 3px;\n"]))),Pm=m(Em)(Zh||(Zh=L(["\n position: absolute;\n font-size: 18px;\n text-align: center;\n border-radius: 3px;\n padding: 5px 10px;\n background: #ea3223;\n color: #fff;\n margin: 0 10px;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),Rm=(m.div($h||($h=L(["\n font-size: 18px;\n text-align: center;\n padding: 10px;\n"]))),function(e){var t=e.width,n=e.height,a=e.type,o=N(e,gm),i=Nn.useAsset("id_card_frame.png"),s=Nn.useAsset("id_card_frame_error.png");return r.createElement(Cm,{width:t,height:n},r.createElement(ym,{src:a===Oh.ERROR?s:i,width:t,height:n}),r.createElement(vm,I({width:t,height:n,type:a},o)))}),Dm=Object.freeze({__proto__:null,CloseCameraButton:function(e){var t=e.className,n=e.onClick,a=Nn.useAsset("ic_close.png");return r.createElement(ou,{className:t,onClick:n},r.createElement("img",{src:a,alt:""}))}}),Nm=th,Lm=Jp,Om=Nh,Mm=b(["z-index:",";color:#ffffff;"],1020),Fm=m.div(Jh||(Jh=L(["\n ","\n"])),Mm),Um=m(_p)(em||(em=L(["\n ","\n ","\n ","\n ","\n font-size: 18px;\n background: #ea3223;\n color: #fff;\n padding: 5px 10px;\n border-radius: 3px;\n position: absolute;\n white-space: pre-wrap;\n text-align: center;\n max-width: 80%;\n"])),Mm,(function(e){var r=e.top;return r&&b(["top:","px;"],r)}),(function(e){var r=e.bottom;return r&&b(["bottom:","px;"],r)}),(function(e){return e.centerY&&b(["top:50%;transform:translateY(-50%);"])})),Vm=m(Fm)(rm||(rm=L(["\n ","\n font-size: 18px;\n background: #ea3223;\n color: #fff;\n padding: 5px 10px;\n border-radius: 3px;\n position: absolute;\n left: 50%;\n transform: translate(-50%, 0);\n white-space: nowrap;\n"])),(function(e){var r=e.top;return r&&b(["top:","px;"],r)})),jm=m(Fm)(tm||(tm=L(["\n position: absolute;\n ","\n ","\n font-size: ",";\n text-shadow: 2px 2px 4px #000000;\n"])),(function(e){var r=e.top;return r&&b(["top:","px;"],r)}),(function(e){var r=e.bottom;return r&&b(["bottom:","px;"],r)}),(function(){return qs.isMobile?"20px":"22px"})),zm=m.div(nm||(nm=L(["\n height: ",";\n position: absolute;\n ","\n ","\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: ",";\n"])),(function(){return qs.isMobile?"50px":"70px"}),(function(e){var r=e.top;return r&&b(["top:","px;"],r)}),(function(e){var r=e.bottom;return r&&b(["bottom:","px;"],r)}),1020),Km=m.div(am||(am=L(["\n width: ",";\n height: ",";\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n border: 2px solid #ffffff;\n font-size: 16px;\n color: #fff;\n font-weight: 700;\n\n & + & {\n margin-left: 10px;\n }\n\n ","\n img {\n width: 100%;\n margin: 0;\n border-radius: 50%;\n }\n"])),(function(){return qs.isMobile?"40px":"50px"}),(function(){return qs.isMobile?"40px":"50px"}),(function(e){return!e.active&&b(["opacity:0.6;"])})),Hm=m.div(om||(om=L(["\n color: #ffffff;\n height: 70px;\n position: absolute;\n bottom: 0;\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: ",";\n"])),1020),qm=m.div(im||(im=L(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),Gm=m.div(sm||(sm=L(["\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n color: #ffffff;\n font-size: 140px;\n opacity: 0.6;\n"]))),Wm=m.div(cm||(cm=L(["\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n ",";\n ",";\n"])),Lm.default,Nm.default),Qm=m(Ip)(um||(um=L(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"]))),Xm=m(Tp)(lm||(lm=L(["\n width: 100%;\n height: 100%;\n vertical-align: middle;\n margin: 0;\n color: ",";\n"])),(function(e){var r=e.color;return null!=r?r:"rgba(0, 0, 0, 0.6)"})),Ym=m.div(dm||(dm=L(["\n position: absolute;\n z-index: -1;\n background: rgba(223, 0, 0, 0.2);\n border-radius: 50%;\n width: 86%;\n height: 86%;\n top: 7%;\n left: 7%;\n"]))),Zm=v(["from{opacity:1;}to{opacity:0;}"]),$m=m.div(fm||(fm=L(["\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n z-index: -1;\n background: rgba(255, 255, 255, 0.3);\n animation: "," 1s infinite;\n border-radius: 50%;\n"])),Zm),Jm=m.div(pm||(pm=L(["\n ","\n"])),Om.default),eg=qs.isMobile?{width:{ideal:640}}:null,rg={background:"#000000",opacity:.6};function tg(e){var t=e.apiCheck,n=e.mode,a=e.onLivenessDetectionDone,s=e.onClose,u=e.onError,l=e.captureFrameSettings,d=e.onFramesCaptured,f=e.frontCamera,p=e.customDirectionIcon,h=e.customStepTimeConstraints,m=e.onProcessing,g=e.customErrors,v=e.livenessSettings,y=e.apiCredentials,b=e.outputEncryptionSettings,C=e.cameraScale,w=e.defaultCameraId,k=e.passiveModeAuto,B=e.offsetFaceY,E=e.styledComponent,S=e.sdkAdapter,_=e.isLoading,A=e.frontalMinSize,I=Nn.useAsset("bg_camera_mask.png"),T=Nn.useAsset("bg_camera_mask_red.png"),x=Nn.useAsset("ic_loading.png"),P=O(c({}),2),R=P[0],D=P[1],N=R.yFaceDetectionError,L=R.yFaceVerificationStepsWrapper,M=O(c(""),2),F=M[0],U=M[1],V=o((function(e){var r=e.lostY,t=e.height,n=e.clientHeight,a=r+25,o=a+30;D({yFaceDetectionError:a,yFaceVerificationStepsWrapper:o+t+20});var i=Math.floor(r),s=Math.floor(n-r),c=Math.floor(o);return 0!==B&&(c+B<i||c+B+t>s)?u({code:"offsetFaceY must be in [-".concat(c-i,", ").concat(s-t-c,"]")}):c+=B,{y:c}}),[B,u]),j=pp({apiCheck:t,mode:n,bgCameraMask:I,bgCameraMaskRed:T,surroundStyle:rg,onLivenessDetectionDone:a,onError:u,cropAreaDimension:V,customDirectionIcon:p,captureFrameSettings:l,onFramesCaptured:d,livenessSettings:v,setRemainingTime:U,customStepTimeConstraints:h,onProcessing:m,customErrors:g,apiCredentials:y,outputEncryptionSettings:b,cameraScale:C,passiveModeAuto:k,sdkAdapter:S,frontalMinSize:A}),z=j.countdownToTakePicture,K=j.cropArea,H=j.curStepIndex,q=j.directionIcon,G=j.directionIconAnimation,W=j.faceDetectionError,Q=j.handleTriggerPassiveMode,X=j.handleVideoPlayed,Y=j.instructions,Z=j.isActiveMode,$=j.refVideo,J=j.showCountdown,ee=j.steps,re=j.videoPlayed,te=j.activeCapturing,ne=j.isFirstValidFrameFound,ae=j.warmupDone,oe=j.showLoading;i((function(){var e;"string"==typeof(null===(e=ee[0])||void 0===e?void 0:e.directionIcon)&&Promise.all(ee.map((function(e){return r=e.directionIcon,new Promise((function(e){var t=new Image;t.onload=e,t.onerror=e,t.src=r}));var r})))}),[ee]);var ie=E.CloseCameraButton;return r.createElement(Jm,null,r.createElement(hu,{frontCamera:f,onVideoPlayed:X,onClose:s,flipHorizontal:f,ref:$,videoSettings:eg,onError:u,scale:C,defaultCameraId:w,closeButton:ie||null},!ae&&r.createElement(qp,null),re?r.createElement(r.Fragment,null,r.createElement(Um,{top:N-15,className:"face-detection-error",error:W}),K.current?r.createElement(Cu,{x:"".concat(K.current.x,"px"),y:"".concat(K.current.y,"px"),width:"".concat(K.current.width,"px"),height:"".concat(K.current.height,"px"),surroundStyle:K.current.surroundStyle},r.createElement(Xm,null),r.createElement(Qm,{progress:H/ee.length*100,hasError:!!W,showDashedRing:!1,showOutsideRing:!1,insideRingWidth:1,errorRingWidth:1,insideRingStrokeDash:"2"}),J?r.createElement(Gm,null,z):null,Z?r.createElement(r.Fragment,null,r.createElement(Wm,null,function(e,t){return e?"string"==typeof e?r.createElement("img",{className:t,src:e,alt:"",style:{maxWidth:"98px",maxHeight:"98px",marginBottom:"25px"}}):e:null}(q,G)),te&&r.createElement($m,null)):null,W&&r.createElement(Ym,null)):null,Z?r.createElement(r.Fragment,null,F&&r.createElement(Vm,{top:L-30},F),Y?r.createElement(r.Fragment,null,r.createElement(jm,{top:L+5,className:"instructions"},Y),r.createElement(zm,{top:L+35},ee.map((function(e,t){var n=e.name,a=e.image.objUrl;return r.createElement(Km,{key:n,active:H>=t,className:"step-item"},a?r.createElement("img",{src:a,alt:""}):r.createElement("span",null,t+1))})))):null):r.createElement(r.Fragment,null,!ne||W||k?null:r.createElement(Hm,null,r.createElement(qm,{onClick:Q},r.createElement(wu,null))))):null,(oe||_)&&r.createElement(Bm,null,r.createElement("img",{src:x,alt:"",className:"spin"}))))}tg.propTypes={apiCheck:h.bool,frontalMinSize:h.number,mode:h.string,onLivenessDetectionDone:h.func,onClose:h.func,onError:h.func,captureFrameSettings:h.shape({}),onFramesCaptured:h.func,frontCamera:h.bool,customDirectionIcon:h.shape({}),customStepTimeConstraints:h.shape({}),onProcessing:h.func,customErrors:h.shape({}),livenessSettings:h.shape({}),apiCredentials:h.shape({accessKey:h.string,secretKey:h.string,apiUrl:h.string}),outputEncryptionSettings:h.shape({}),cameraScale:h.number,defaultCameraId:h.string,passiveModeAuto:h.bool,offsetFaceY:h.number,styledComponent:h.shape({CloseCameraButton:h.node}),sdkAdapter:h.shape({}),isLoading:h.bool},tg.defaultProps={apiCheck:!1,frontalMinSize:null,mode:null,onLivenessDetectionDone:null,onClose:null,onError:function(){},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},onFramesCaptured:function(){},frontCamera:!0,customDirectionIcon:(hm={},A(hm,K.FaceDirection.LEFT,r.createElement(kp,{type:K.FaceDirection.LEFT})),A(hm,K.FaceDirection.RIGHT,r.createElement(kp,{type:K.FaceDirection.RIGHT})),A(hm,K.FaceDirection.UP,r.createElement(kp,{type:K.FaceDirection.UP})),A(hm,K.FaceDirection.FRONTAL,r.createElement(kp,{type:K.FaceDirection.FRONTAL})),hm),customStepTimeConstraints:(mm={},A(mm,K.FaceDirection.UP,{delayTime:0}),A(mm,K.FaceDirection.LEFT,{delayTime:0}),A(mm,K.FaceDirection.RIGHT,{delayTime:0}),A(mm,K.FaceDirection.FRONTAL,{delayTime:2e3}),mm),onProcessing:function(){},customErrors:null,livenessSettings:null,apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},outputEncryptionSettings:null,cameraScale:1,defaultCameraId:void 0,passiveModeAuto:!1,offsetFaceY:0,styledComponent:{CloseCameraButton:null},sdkAdapter:null,isLoading:!1};var ng,ag=Object.freeze({__proto__:null,Text:Fm,FaceDetectionError:Um,CountdownTime:Vm,FaceVerificationInstructions:jm,FaceVerificationStepsWrapper:zm,StepItem:Km,BottomButtonsOverlay:Hm,Button:qm,CountDownOverlay:Gm,InstructionsOverlay:Wm,LivenessStyledComponent:Dm,default:tg,useLivenessDetection:pp}),og=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.frontCamera,n=void 0===t||t,a=document.createElement("div");document.body.appendChild(a);var o=function(){w.unmountComponentAtNode(a)};return new Promise((function(e){w.render(r.createElement($t.SDKSettingsProvider,{value:{lang:"en"}},r.createElement(hu,{checkCameraMode:!0,frontCamera:n,onVideoPlayed:function(){o(),e(null)},onClose:o,onError:function(r){o(),e(r)}})),a)}))},ig=m.input(ng||(ng=L(["\n display: none;\n"]))),sg=l((function(e,t){var n=e.useFileBrowse,a=e.accept,i=e.frontCamera,s=e.onCaptureDone,c=e.outputEncryptionSettings,u=o(function(){var e=S(regeneratorRuntime.mark((function e(r){var t,n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.target.files,!s){e.next=8;break}if(n=t[0],!c||!c.key){e.next=7;break}return e.next=6,mi.encrypt({blob:n,key:c.key});case 6:a=e.sent;case 7:s({file:n,encrypted:a});case 8:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[s,c]);return r.createElement(ig,I({ref:t,type:"file",accept:a,onChange:u},n?{}:{capture:i?"user":"environment"}))}));sg.propTypes={useFileBrowse:h.bool,accept:h.string,frontCamera:h.bool,onCaptureDone:h.func,outputEncryptionSettings:h.shape({key:h.string})},sg.defaultProps={useFileBrowse:!1,accept:"image/*",frontCamera:!1,onCaptureDone:null,outputEncryptionSettings:{key:""}};var cg,ug=Object.freeze({__proto__:null,Camera:wu}),lg="landscape",dg="portrait",fg="desktop",pg=K.Errors,hg=m.div(cg||(cg=L(["\n text-align: center;\n font-size: 20px;\n font-weight: 600;\n"])));function mg(e){var t=e.children,n=$t.useSDKSettings().lang,o=pg.wrong_orientation.msg[n],s=function(){var e=a(window.matchMedia("(orientation: portrait)")),r=a(e.current.matches?dg:lg),t=O(c(r.current),2),n=t[0],o=t[1];return i((function(){function r(e){e.matches?o(dg):o(lg)}return e.current.addEventListener("change",r),function(){e.current.removeEventListener("change",r)}}),[]),qs.isMobile?{curOrientation:n,initOrientation:r.current}:{curOrientation:fg}}().curOrientation;return r.createElement(r.Fragment,null,s===lg&&r.createElement(zp,{open:!0},r.createElement(hg,null,o)),(s===dg||s===fg)&&r.createElement(r.Fragment,null,t))}var gg=["logCredentials","clientSettings","livenessSettings","livenessComponent"];function vg(e){var t=e.logCredentials,n=void 0===t?{enable:!0}:t,a=e.clientSettings,o=e.livenessSettings,i=e.livenessComponent,s=void 0===i?tg:i,c=N(e,gg),u=Pf(a,"data.settings.sdk_settings",{});return r.createElement(mg,null,r.createElement(Pn.SDKTrackingProvider,{value:{tracking:x({},n)}},r.createElement(s,I({},c,{livenessSettings:x(x(x({},o),null==u?void 0:u.active_liveness_settings),null==u?void 0:u.liveness_settings)}))))}var yg,bg,Cg,wg={BTN_OK:{en:"OK",vi:"Tôi đã hiểu"},FRONT:{en:"front",vi:"trước"},BACK:{en:"back",vi:"sau"},BTN_USE_THIS_PICTURE:{en:"Use this picture",vi:"Dùng ảnh này"},BTN_TRY_AGAIN:{en:"Try again",vi:"Thử lại"},CONFIRM_POPUP_VALID_QR:{en:"QR code scanned",vi:"Đã quét được mã QR"},CONFIRM_POPUP_INVALID_QR:{en:"Could not scan QR code",vi:"Không quét được mã QR"}},kg=K.IDCardMessage,Bg=m.div(yg||(yg=L(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),Eg=m.div(bg||(bg=L(["\n text-align: center;\n font-size: 1rem;\n"]))),Sg=m.button(Cg||(Cg=L(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n background-color: ",";\n border: 0;\n outline: none;\n border-radius: 0.25rem;\n color: #fff;\n font-weight: 400;\n cursor: pointer;\n font-size: 1rem;\n"])),(function(e){return e.theme.tsBlue})),_g=function(e){var t=e.onOk,n=e.maxSessionTime,a=$t.useSDKSettings().lang;return r.createElement(Bg,null,r.createElement(Eg,{className:"popup-message"},Kd(kg.TIMEOUT_INSTRUCTION[a])({x:n})),r.createElement(Sg,{className:"popup-button",onClick:t},wg.BTN_OK[a]))};_g.propTypes={onOk:h.func,maxSessionTime:h.number},_g.defaultProps={onOk:function(){},maxSessionTime:30};var Ag=function(){var e=O(c(!1),2),r=e[0],t=e[1],n=O(c(null),2),a=n[0],i=n[1],s=O(c({}),2),u=s[0],l=s[1];return{showPopup:o((function(e){var r=e.popupType,n=e.props;l(void 0===n?{}:n),i(r),t(null!==r)}),[]),popupShown:r,popupType:a,props:u}},Ig="SESSION_TIMEOUT",Tg="CONFIRM",xg="QR_INVALID",Pg="QR_INSTRUCTIONS",Rg=K.Errors;function Dg(e,r){return Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2)}function Ng(e,r){return Math.sqrt(Dg(e,r))}function Lg(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.canvas,t=e.imgMargin,n=window,a=n.cv,o=r.width,i=r.height,s=t;s<1&&(s=parseInt(.5*(i+o)*s,10));var c=a.imread(r),u=new a.Mat;return a.copyMakeBorder(c,u,s,s,s,s,a.BORDER_CONSTANT,new a.Scalar(0,0,0,255)),c.delete(),{mat:u,margin:s}}function Og(e,r){var t=window.cv,n=O(r.map((function(e){return e.location})),4),a=n[0],o=n[1],i=n[2],s=n[3],c=Ng(i,s),u=Ng(o,a),l=Math.max(c,u),d=Ng(o,i),f=Ng(a,s),p=Math.max(d,f),h=[a.x,a.y,o.x,o.y,i.x,i.y,s.x,s.y],m=[0,0,l-1,0,l-1,p-1,0,p-1],g=t.imread(e),v=new t.Mat,y=new t.Size(l,p),b=t.matFromArray(4,1,t.CV_32FC2,h),C=t.matFromArray(4,1,t.CV_32FC2,m),w=t.getPerspectiveTransform(b,C);t.warpPerspective(g,v,w,y,t.INTER_LINEAR,t.BORDER_CONSTANT,new t.Scalar);var k=new ImageData(new Uint8ClampedArray(v.data),v.cols,v.rows);return g.delete(),v.delete(),b.delete(),C.delete(),k}function Mg(e,r,t){var n={x:r.x-e.x,y:r.y-e.y},a={x:t.x-e.x,y:t.y-e.y},o=Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2)),i=Math.sqrt(Math.pow(a.x,2)+Math.pow(a.y,2));return 180*Math.acos((n.x*a.x+n.y*a.y)/(o*i))/Math.PI}function Fg(e){var r=e.corners,t=e.width,n=e.height,a=Number.MAX_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,i=Number.MIN_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;r.forEach((function(e){var r=e.location,t=r.x,n=r.y;a=Math.min(a,t),o=Math.min(o,n),i=Math.max(i,t),s=Math.max(s,n)}));var c=.02;return a/t>=c&&o/n>=c&&(n-s)/n>=c&&(t-i)/t>=c}function Ug(){return Vg.apply(this,arguments)}function Vg(){return(Vg=S(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c,u,l,d,f,p=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=p.length>0&&void 0!==p[0]?p[0]:{},t=r.canvas,n=r.paddingPercent,a=void 0===n?.04:n,o=t.width,i=t.height,s=Math.floor(o*a),c=Math.floor(i*a),u=o-2*s,l=i-2*c,d=document.createElement("canvas"),f=d.getContext("2d"),d.width=u,d.height=l,f.drawImage(t,s,c,u,l,0,0,u,l),e.abrupt("return",To.isCardGlare(d));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jg(e){for(var r=e.length,t=0;t<r;t++){var n=(t+r-1)%r,a=(t+1)%r,o=Mg(e[t].location,e[n].location,e[a].location);if(o<70||o>110)return!1}return!0}function zg(e){return Kg.apply(this,arguments)}function Kg(){return(Kg=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,u,l,d,f,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.blazefaceModel,n=r.predictedIdCardCanvas,a=r.frontSide,o=n.width,i=n.height,s=Math.floor(o/3),c=Math.floor(4*i/5),u=document.createElement("canvas"),l=u.getContext("2d"),u.width=s,u.height=c,l.drawImage(n,0,Math.floor(i/5),s,c,0,0,s,c),e.next=12,_a.getModelPredictions({model:t,sCanvas:u});case 12:if(d=e.sent,f=d.filter((function(e){var r=e.topLeft,t=e.bottomRight,n=O(e.probability,1)[0],a=e.landmarks;return!(n<.9||a.length<4)&&!(ga.rectAreaRatio({small:{coords:[r,t]},big:{coords:[[0,0],[_a.SIZE,_a.SIZE]]}})<.025)})),p=f.length,!a){e.next=22;break}if(0!==p){e.next=18;break}return e.abrupt("return",Rg.id_detector_error_front_side_no_faces);case 18:if(!(p>1)){e.next=20;break}return e.abrupt("return",Rg.id_detector_error_front_side_multiple_faces);case 20:e.next=24;break;case 22:if(!(p>0)){e.next=24;break}return e.abrupt("return",Rg.id_detector_error_back_side_has_faces);case 24:return e.abrupt("return",null);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Hg=function(){var e=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,B,E,_,A,I;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c=r.currentWorkingCanvas,u=r.refVirtualWorkingCanvas,l=r.refCountVirtualFrames,d=r.refVirtualFrames,f=r.refWorkingCanvas,(p=r.refCardResult).current.corners&&Array.isArray(p.current.corners)){e.next=3;break}return e.abrupt("return");case 3:return h=O(p.current.corners,3),m=h[0],g=h[1],v=h[2],y=(null==g||null===(t=g.location)||void 0===t?void 0:t.x)-(null==m||null===(n=m.location)||void 0===n?void 0:n.x)-100,b=(null==v||null===(a=v.location)||void 0===a?void 0:a.y)-(null==g||null===(o=g.location)||void 0===o?void 0:o.y)-100,C=performance.now(),(w=u.current).width=y,w.height=b,(k=w.getContext("2d")).drawImage(c,(null==m||null===(i=m.location)||void 0===i?void 0:i.x)+50,(null==m||null===(s=m.location)||void 0===s?void 0:s.y)+50,y,b,0,0,y,b),e.next=14,new Promise((function(e){w.toBlob(function(){var r=S(regeneratorRuntime.mark((function r(t){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Bn.MD5({blob:t});case 2:n=r.sent,d.current=[].concat(M(d.current),[n]),e();case 5:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}())}));case 14:return C=Math.floor(performance.now()-C),B=180-C>0?180-C:0,e.next=18,new Promise((function(e){return setTimeout(e,B)}));case 18:if(!(l.current<3)){e.next=29;break}return A=performance.now(),I=f.current,k.drawImage(I,(null==m||null===(E=m.location)||void 0===E?void 0:E.x)+50,(null==m||null===(_=m.location)||void 0===_?void 0:_.y)+50,y,b,0,0,y,b),e.next=24,new Promise((function(e){w.toBlob(function(){var r=S(regeneratorRuntime.mark((function r(t){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Bn.MD5({blob:t});case 2:n=r.sent,d.current=[].concat(M(d.current),[n]),e();case 5:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}())}));case 24:if(!(l.current<2)){e.next=26;break}return e.delegateYield(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return A=Math.floor(performance.now()-A),r=180-A>0?180-A:0,e.next=4,new Promise((function(e){return setTimeout(e,r)}));case 4:case"end":return e.stop()}}),e)}))(),"t0",26);case 26:l.current+=1,e.next=18;break;case 29:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}();var qg=function(e,r,t){return e==e&&(void 0!==t&&(e=e<=t?e:t),void 0!==r&&(e=e>=r?e:r)),e};var Gg=function(e,r,t){return void 0===t&&(t=r,r=void 0),void 0!==t&&(t=(t=Wu(t))==t?t:0),void 0!==r&&(r=(r=Wu(r))==r?r:0),qg(Wu(e),r,t)},Wg="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/libs/opencv-4.6.0.js";function Qg(){return(Qg=S(regeneratorRuntime.mark((function e(){var r,t,n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>0&&void 0!==a[0]?a[0]:{},t=r.url,n=void 0===t?Wg:t,e.abrupt("return",new Promise((function(e,r){var t=document.createElement("script");t.setAttribute("async",""),t.setAttribute("type","text/javascript"),t.setAttribute("id","opencvjs"),t.addEventListener("load",S(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!window.cv||!window.cv.getBuildInformation){r.next=4;break}e(),r.next=12;break;case 4:if(!(window.cv instanceof Promise)){r.next=11;break}return r.next=7,window.cv;case 7:window.cv=r.sent,e(),r.next=12;break;case 11:window.cv.onRuntimeInitialized=function(){e()};case 12:case"end":return r.stop()}}),r)})))),t.addEventListener("error",(function(){r()})),t.src=n;var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(t,a)})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Xg=Ff((function(){return Qg.apply(this,arguments)})),Yg={vn:"https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/models/id-card/tflite/model-v3.tflite",ph:"https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.3/models/id-card/tflite/ph_card_model.tflite"},Zg={vn:.4,ph:.5},$g={0:"top-left",1:"top-right",2:"bottom-right",3:"bottom-left",4:"cccd.front",5:"passport",6:"cmnd_old.front",7:"cmnd_old.back",8:"cmnd_new.front",9:"cmnd_new.back",10:"cccd_new.front",11:"cccd_new.back",12:"aadhaar_front",13:"aadhaar_back",14:"voter_front",15:"voter_back",16:"pan",17:"dl",18:"india_spassport",19:"aadhaar_letter",20:"pan_back",21:"passport_back",22:"unseen",23:"other",24:"BUREAU OF INTERNAL REVENUE",25:"COMMISSION ON ELECTIONS",26:"COVID VACCINATION CARD",27:"DRIVERS LICENSE",28:"HEALTH INSURANCE PHILHEALTH",29:"PAG-IBIG LOYALTY CARD",30:"PASSPORT",31:"PHILIPPINE IDENTIFICATION CARD",32:"POSTAL IDENTITY CARD",33:"PROFESSIONAL IDENTIFICATION CARD",34:"RESIDENT IDENTIFICATION CARD",35:"SOCIAL SECURITY SYSTEM",36:"UNIFIED MULTI PURPOSE ID",37:"VN_biz_license",38:"new_voter_front"};function Jg(e){var r,t,n,a,o,i=e.card,s=e.corners,c=i.box,u={x:(c[1]+c[3])/2,y:(c[0]+c[2])/2},l=c[2]-c[0],d=c[1]-c[3],f=V(s);try{for(f.s();!(o=f.n()).done;){var p=o.value;switch(p.label){case"top-left":r||(r=p.location);break;case"top-right":t||(t=p.location);break;case"bottom-right":n||(n=p.location);break;case"bottom-left":a||(a=p.location)}}}catch(e){f.e(e)}finally{f.f()}if(![r,t,n,a].every(Boolean))return console.debug("Not qualified, corners missing"),!1;var h={x:(r.x+n.x)/2,y:(r.y+n.y)/2},m={x:(t.x+a.x)/2,y:(t.y+a.y)/2},g=Dg(u,h),v=Dg(u,m);return Math.sqrt(g)>(l+d)/8||Math.sqrt(v)>(l+d)/8?(console.debug("Not qualified, not close enough"),!1):(console.debug("Qualified"),!0)}var ev=function(){function e(r){!function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e),this.country=r||"vn",this.defaultModelUrl=Yg[this.country]||Yg.vn}var r,t,n,a,o,i,s,c,u,l;return r=e,(t=[{key:"load",value:(l=S(regeneratorRuntime.mark((function e(){var r,t,n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>0&&void 0!==a[0]?a[0]:{},t=r.opencvUrl,n=r.modelUrl,e.next=3,Promise.all([Xg({url:t}),this.loadModel({modelUrl:n})]);case 3:return e.next=5,this.predictDummyInput();case 5:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"predictDummyInput",value:(u=S(regeneratorRuntime.mark((function e(){var r,t,n,a=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=window,t=r.tf,n=t.tidy((function(){var e=t.zeros(a.inputShape,"float32");return a.model.predict(e)})),e.abrupt("return",Promise.all([n[this.out_score_name].data()]));case 3:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"loadModel",value:(c=S(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=s.length>0&&void 0!==s[0]?s[0]:{},t=r.modelUrl,n=void 0===t?this.defaultModelUrl:t,e.next=3,di.initTensorFlow({preferredBackends:["wasm","cpu"]});case 3:return e.next=5,di.loadTFLiteModel({modelUrl:n});case 5:this.model=e.sent,a=this.model.inputs,this.inputShape=a[0].shape,o=this.model.outputs.map((function(e){return e.name})).splice(0,3).reverse(),i=O(o,3),this.out_score_name=i[0],this.out_class_name=i[1],this.out_box_name=i[2];case 13:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"loadResource",value:(s=S(regeneratorRuntime.mark((function e(){var r,t,n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>0&&void 0!==a[0]?a[0]:{},t=r.modelUrl,n=void 0===t?this.defaultModelUrl:t,e.next=3,di.preloadResource({modelUrl:n});case 3:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"dispose",value:(i=S(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.model&&this.model.dispose();case 1:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"predict",value:(o=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,B,E,S,_,A,I,T,x,P,R=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=R.length>1&&void 0!==R[1]?R[1]:{},n=t.imgMargin,a=t.detectThreshold,o=void 0===a?.3:a,i=t.maxNumReturns,s=void 0===i?100:i,c=window,u=c.cv,l={},d=r.width,f=r.height,l.originalWidth=d,l.originalHeight=f,p=Lg({canvas:r,imgMargin:"number"==typeof n?n:Zg[this.country]}),h=p.margin,m=p.mat,g=this.inputShape.slice(1,3),v=O(g,2),y=v[0],b=v[1],C=new u.Mat,u.resize(m,C,new u.Size(y,b),0,0,u.INTER_AREA),w=m.cols/y,k=m.rows/b,(B=document.createElement("canvas")).width=y,B.height=b,B.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(C.data),C.cols,C.rows),0,0),m.delete(),C.delete(),l.canvas=B,l.margin=h,E=performance.now(),e.next=25,this.detect(B,{detectThreshold:o,maxNumReturns:s});case 25:if(S=e.sent,_=Math.floor(performance.now()-E),A={inputImage:l,card:null,exeTime:_},I=[[],[],[],[]],T=[],x=[],S.forEach((function(e){var r=O(e.box,4),t=r[0],n=r[1],a=r[2],o=r[3];e.clazz<=3?I[e.clazz].push({clazz:e.clazz,label:e.label,score:e.score,location:{x:Gg(Math.floor((o+n)/2*w-h),0,d),y:Gg(Math.floor((t+a)/2*k-h),0,f)},scaledLocation:{x:Gg(Math.floor((o+n)/2),0,B.width),y:Gg(Math.floor((t+a)/2),0,B.height)}}):x.push({label:e.label,score:e.score,box:[Gg(Math.floor(t*k-h),0,f),Gg(Math.floor(n*w-h),0,d),Gg(Math.floor(a*k-h),0,f),Gg(Math.floor(o*w-h),0,d)]})})),I.forEach((function(e){e.length&&(e.sort((function(e,r){return r.score-e.score})),T.push(e[0]))})),!(x.length>0&&4===T.length)){e.next=49;break}if(x.sort((function(e,r){return r.score-e.score})),T.sort((function(e,r){return e.clazz-r.clazz})),P=x[0],e.prev=37,Jg({card:P,corners:T})){e.next=41;break}return console.debug("Not qualified.",P,T),e.abrupt("return",A);case 41:e.next=46;break;case 43:return e.prev=43,e.t0=e.catch(37),e.abrupt("return",A);case 46:return P.corners=T,A.card=P,e.abrupt("return",A);case 49:return e.abrupt("return",A);case 50:case"end":return e.stop()}}),e,this,[[37,43]])}))),function(e){return o.apply(this,arguments)})},{key:"detect",value:(a=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,B,E,S=this,_=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=_.length>1&&void 0!==_[1]?_[1]:{},n=t.detectThreshold,a=t.maxNumReturns,o=window,i=o.tf,s=r.width,c=r.height,u=i.tidy((function(){var e=i.expandDims(i.cast(i.image.resizeBilinear(i.browser.fromPixels(r),S.inputShape.slice(1,3)),"float32"));return S.model.predict(e)})),e.next=7,Promise.all([u[this.out_score_name].data(),u[this.out_class_name].data(),u[this.out_box_name].array()]);case 7:l=e.sent,d=O(l,3),f=d[0],p=d[1],h=O(d[2],1),m=h[0],g=Math.min(f.length,a),v=[];try{for(y=0;y<g;y++)b=f[y],C=p[y],b>n&&(k=null!==(w=$g[Math.round(C)])&&void 0!==w?w:"NA",B=m[y],E=[B[0]*c,B[3]*s,B[2]*c,B[1]*s],v.push({score:b,clazz:C,box:E,label:k}))}catch(e){console.log(e)}return e.abrupt("return",v.length>=5?v:[]);case 17:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})}])&&_(r.prototype,t),n&&_(r,n),e}();class rv{static hasCamera(){return rv.listCameras(!1).then((e=>!!e.length)).catch((()=>!1))}static listCameras(e=!1){if(!navigator.mediaDevices)return Promise.resolve([]);let r=null;return(e?navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then((e=>r=e)).catch((()=>{})):Promise.resolve()).then((()=>navigator.mediaDevices.enumerateDevices())).then((e=>e.filter((e=>"videoinput"===e.kind)).map(((e,r)=>({id:e.deviceId,label:e.label||(0===r?"Default Camera":`Camera ${r+1}`)}))))).finally((()=>{if(r)for(const e of r.getTracks())e.stop(),r.removeTrack(e)}))}constructor(e,r,t=this._onDecodeError,n=this._calculateScanRegion,a="environment"){this.$video=e,this.$canvas=document.createElement("canvas"),this._onDecode=r,this._legacyCanvasSize=rv.DEFAULT_CANVAS_SIZE,this._preferredCamera=a,this._active=!1,this._paused=!1,this._flashOn=!1,"number"==typeof t?(this._legacyCanvasSize=t,console.warn("You're using a deprecated version of the QrScanner constructor which will be removed in the future")):this._onDecodeError=t,"number"==typeof n?(this._legacyCanvasSize=n,console.warn("You're using a deprecated version of the QrScanner constructor which will be removed in the future")):this._calculateScanRegion=n,this._scanRegion=this._calculateScanRegion(e),this._onPlay=this._onPlay.bind(this),this._onLoadedMetaData=this._onLoadedMetaData.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),e.disablePictureInPicture=!0,e.playsInline=!0,e.muted=!0;let o=!1;e.hidden&&(e.hidden=!1,o=!0),document.body.contains(e)||(document.body.appendChild(e),o=!0),requestAnimationFrame((()=>{const r=window.getComputedStyle(e);"none"===r.display&&(e.style.setProperty("display","block","important"),o=!0),"visible"!==r.visibility&&(e.style.setProperty("visibility","visible","important"),o=!0),o&&(console.warn("QrScanner has overwritten the video hiding style to avoid Safari stopping the playback."),e.style.opacity=0,e.style.width=0,e.style.height=0)})),e.addEventListener("play",this._onPlay),e.addEventListener("loadedmetadata",this._onLoadedMetaData),document.addEventListener("visibilitychange",this._onVisibilityChange),this._qrEnginePromise=rv.createQrEngine()}hasFlash(){let e=null;return(this.$video.srcObject?Promise.resolve(this.$video.srcObject.getVideoTracks()[0]):this._getCameraStream().then((({stream:r})=>(console.warn("Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream"),e=r,r.getVideoTracks()[0])))).then((e=>"torch"in e.getSettings())).catch((()=>!1)).finally((()=>{if(e)for(const r of e.getTracks())r.stop(),e.removeTrack(r)}))}isFlashOn(){return this._flashOn}toggleFlash(){return this._flashOn?this.turnFlashOff():this.turnFlashOn()}turnFlashOn(){return this._flashOn?Promise.resolve():(this._flashOn=!0,!this._active||this._paused?Promise.resolve():this.hasFlash().then((e=>e?this.$video.srcObject.getVideoTracks()[0].applyConstraints({advanced:[{torch:!0}]}):Promise.reject("No flash available"))).catch((()=>{throw this._flashOn=!1,e})))}turnFlashOff(){if(this._flashOn)return this._flashOn=!1,this._restartVideoStream()}destroy(){this.$video.removeEventListener("loadedmetadata",this._onLoadedMetaData),this.$video.removeEventListener("play",this._onPlay),document.removeEventListener("visibilitychange",this._onVisibilityChange),this.stop(),rv._postWorkerMessage(this._qrEnginePromise,"close")}start(){return this._active&&!this._paused?Promise.resolve():("https:"!==window.location.protocol&&console.warn("The camera stream is only accessible if the page is transferred via https."),this._active=!0,document.hidden?Promise.resolve():(this._paused=!1,this.$video.srcObject?(this.$video.play(),Promise.resolve()):this._getCameraStream().then((({stream:e,facingMode:r})=>{this.$video.srcObject=e,this.$video.play(),this._setVideoMirror(r),this._flashOn&&(this._flashOn=!1,this.turnFlashOn().catch((()=>{})))})).catch((e=>{throw this._active=!1,e}))))}stop(){this.pause(),this._active=!1}pause(e=!1){if(this._paused=!0,!this._active)return Promise.resolve(!0);this.$video.pause();const r=()=>{const e=this.$video.srcObject?this.$video.srcObject.getTracks():[];for(const r of e)r.stop(),this.$video.srcObject.removeTrack(r);this.$video.srcObject=null};return e?(r(),Promise.resolve(!0)):new Promise((e=>setTimeout(e,300))).then((()=>!!this._paused&&(r(),!0)))}setCamera(e){return e===this._preferredCamera?Promise.resolve():(this._preferredCamera=e,this._restartVideoStream())}static scanImage(e,r=null,t=null,n=null,a=!1,o=!1){const i=t instanceof Worker;let s=Promise.all([t||rv.createQrEngine(),rv._loadImage(e)]).then((([e,o])=>{let s;return t=e,[n,s]=this._drawToCanvas(o,r,n,a),t instanceof Worker?(i||t.postMessage({type:"inversionMode",data:"both"}),new Promise(((e,r)=>{let a,o,i;o=n=>{"qrResult"===n.data.type&&(t.removeEventListener("message",o),t.removeEventListener("error",i),clearTimeout(a),null!==n.data.data?e(n.data.data):r(rv.NO_QR_CODE_FOUND))},i=e=>{t.removeEventListener("message",o),t.removeEventListener("error",i),clearTimeout(a);const n=e?e.message||e:"Unknown Error";r("Scanner error: "+n)},t.addEventListener("message",o),t.addEventListener("error",i),a=setTimeout((()=>i("timeout")),1e4);const c=s.getImageData(0,0,n.width,n.height);t.postMessage({type:"decode",data:c},[c.data.buffer])}))):new Promise(((e,r)=>{const a=setTimeout((()=>r("Scanner error: timeout")),1e4);t.detect(n).then((t=>{t.length?e(t[0].rawValue):r(rv.NO_QR_CODE_FOUND)})).catch((e=>r("Scanner error: "+(e.message||e)))).finally((()=>clearTimeout(a)))}))}));return r&&o&&(s=s.catch((()=>rv.scanImage(e,null,t,n,a)))),s=s.finally((()=>{i||rv._postWorkerMessage(t,"close")})),s}setGrayscaleWeights(e,r,t,n=!0){rv._postWorkerMessage(this._qrEnginePromise,"grayscaleWeights",{red:e,green:r,blue:t,useIntegerApproximation:n})}setInversionMode(e){rv._postWorkerMessage(this._qrEnginePromise,"inversionMode",e)}static createQrEngine(e=rv.WORKER_PATH){return("BarcodeDetector"in window&&BarcodeDetector.getSupportedFormats?BarcodeDetector.getSupportedFormats():Promise.resolve([])).then((r=>-1!==r.indexOf("qr_code")?new BarcodeDetector({formats:["qr_code"]}):new Worker(e)))}_onPlay(){this._scanRegion=this._calculateScanRegion(this.$video),this._scanFrame()}_onLoadedMetaData(){this._scanRegion=this._calculateScanRegion(this.$video)}_onVisibilityChange(){document.hidden?this.pause():this._active&&this.start()}_calculateScanRegion(e){const r=Math.min(e.videoWidth,e.videoHeight),t=Math.round(2/3*r);return{x:Math.round((e.videoWidth-t)/2),y:Math.round((e.videoHeight-t)/2),width:t,height:t,downScaledWidth:this._legacyCanvasSize,downScaledHeight:this._legacyCanvasSize}}_scanFrame(){if(!this._active||this.$video.paused||this.$video.ended)return!1;requestAnimationFrame((()=>{this.$video.readyState<=1?this._scanFrame():this._qrEnginePromise.then((e=>rv.scanImage(this.$video,this._scanRegion,e,this.$canvas))).then(this._onDecode,(e=>{if(!this._active)return;-1!==(e.message||e).indexOf("service unavailable")&&(this._qrEnginePromise=rv.createQrEngine()),this._onDecodeError(e)})).then((()=>this._scanFrame()))}))}_onDecodeError(e){e!==rv.NO_QR_CODE_FOUND&&console.log(e)}_getCameraStream(){if(!navigator.mediaDevices)return Promise.reject("Camera not found.");const e="environment"===this._preferredCamera||"user"===this._preferredCamera?"facingMode":"deviceId",r=[{width:{min:1024}},{width:{min:768}},{}];return[...r.map((r=>Object.assign({},r,{[e]:{exact:this._preferredCamera}}))),...r].reduceRight(((e,r)=>()=>navigator.mediaDevices.getUserMedia({video:r,audio:!1}).then((e=>({stream:e,facingMode:this._getFacingMode(e)||(r.facingMode?this._preferredCamera:"environment"===this._preferredCamera?"user":"environment")}))).catch(e)),(()=>Promise.reject("Camera not found.")))()}_restartVideoStream(){const e=this._paused;return this.pause(!0).then((r=>{if(r&&!e&&this._active)return this.start()}))}_setVideoMirror(e){const r="user"===e?-1:1;this.$video.style.transform="scaleX("+r+")"}_getFacingMode(e){const r=e.getVideoTracks()[0];return r?/rear|back|environment/i.test(r.label)?"environment":/front|user|face/i.test(r.label)?"user":null:null}static _drawToCanvas(e,r=null,t=null,n=!1){t=t||document.createElement("canvas");const a=r&&r.x?r.x:0,o=r&&r.y?r.y:0,i=r&&r.width?r.width:e.width||e.videoWidth,s=r&&r.height?r.height:e.height||e.videoHeight;if(!n){const e=r&&r.downScaledWidth?r.downScaledWidth:i,n=r&&r.downScaledHeight?r.downScaledHeight:s;t.width!==e&&(t.width=e),t.height!==n&&(t.height=n)}const c=t.getContext("2d",{alpha:!1});return c.imageSmoothingEnabled=!1,c.drawImage(e,a,o,i,s,0,0,t.width,t.height),[t,c]}static _loadImage(e){if(e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||window.ImageBitmap&&e instanceof window.ImageBitmap||window.OffscreenCanvas&&e instanceof window.OffscreenCanvas)return Promise.resolve(e);if(e instanceof Image)return rv._awaitImageLoad(e).then((()=>e));if(e instanceof File||e instanceof Blob||e instanceof URL||"string"==typeof e){const r=new Image;return e instanceof File||e instanceof Blob?r.src=URL.createObjectURL(e):r.src=e,rv._awaitImageLoad(r).then((()=>((e instanceof File||e instanceof Blob)&&URL.revokeObjectURL(r.src),r)))}return Promise.reject("Unsupported image type.")}static _awaitImageLoad(e){return new Promise(((r,t)=>{if(e.complete&&0!==e.naturalWidth)r();else{let n,a;n=()=>{e.removeEventListener("load",n),e.removeEventListener("error",a),r()},a=()=>{e.removeEventListener("load",n),e.removeEventListener("error",a),t("Image load error")},e.addEventListener("load",n),e.addEventListener("error",a)}}))}static _postWorkerMessage(e,r,t){return Promise.resolve(e).then((e=>{e instanceof Worker&&e.postMessage({type:r,data:t})}))}}function tv(){return nv.apply(this,arguments)}function nv(){return(nv=S(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return rv.WORKER_PATH=Ms(),e.next=3,rv.createQrEngine(rv.WORKER_PATH);case 3:return r=e.sent,e.abrupt("return",{qrEngine:r});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function av(){return ov.apply(this,arguments)}function ov(){return(ov=S(regeneratorRuntime.mark((function e(){var r,t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([tv()]);case 2:return r=e.sent,t=O(r,1),n=t[0].qrEngine,e.abrupt("return",{qrScannerResources:{engine:n,canvas:document.createElement("canvas")},noModel:!0});case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}rv.DEFAULT_CANVAS_SIZE=400,rv.NO_QR_CODE_FOUND="No QR code found",rv.WORKER_PATH="qr-scanner-worker.min.js";var iv="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/wechat_qr_models/";function sv(){return(sv=S(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=function(){return(s=S(regeneratorRuntime.mark((function e(){var r,t,n,i,s,c,u,l,d,f,p,h,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r="detect.prototxt",t="detect.caffemodel",n="sr.prototxt",i="sr.caffemodel",a){e.next=22;break}if(s=window,c=s.cv){e.next=8;break}throw new Error("Opencv not found!");case 8:return u=[o(r),o(t),o(n),o(i)],e.next=11,Promise.all(u);case 11:l=e.sent,d=O(l,4),f=d[0],p=d[1],h=d[2],m=d[3],c.FS_createDataFile("/","detect.prototxt",f,!0,!1,!1),c.FS_createDataFile("/","detect.caffemodel",p,!0,!1,!1),c.FS_createDataFile("/","sr.prototxt",h,!0,!1,!1),c.FS_createDataFile("/","sr.caffemodel",m,!0,!1,!1),a=new c.wechat_qrcode_WeChatQRCode("detect.prototxt","detect.caffemodel","sr.prototxt","sr.caffemodel");case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)},i=function(){return s.apply(this,arguments)},r=c.length>0&&void 0!==c[0]?c[0]:{},t=r.modelUrl,n=void 0===t?iv:t,o=function(){var e=S(regeneratorRuntime.mark((function e(r){var t,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(n).concat(r));case 2:return t=e.sent,e.next=5,t.arrayBuffer();case 5:return a=e.sent,e.abrupt("return",new Uint8Array(a));case 7:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),e.prev=4,e.next=7,i();case 7:e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(4),console.log(e.t0),e.abrupt("return",av());case 13:return e.abrupt("return",{qrModel:a});case 14:case"end":return e.stop()}}),e,null,[[4,9]])})))).apply(this,arguments)}var cv=Ff((function(){return sv.apply(this,arguments)}));function uv(e){return lv.apply(this,arguments)}function lv(){return(lv=S(regeneratorRuntime.mark((function e(r){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.idCardModel,e.abrupt("return",new Promise((function(e,r){setTimeout(r,900),t.predictDummyInput().then(e)})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function dv(e){return fv.apply(this,arguments)}function fv(){return(fv=S(regeneratorRuntime.mark((function e(r){var t,n,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.idCardModel,n=!0,e.prev=2,a=performance.now(),e.next=6,uv({idCardModel:t});case 6:(o=performance.now())-a+.6*(o-a)>900&&(n=!1),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),n=!1;case 13:return e.abrupt("return",{fastEnough:n});case 14:case"end":return e.stop()}}),e,null,[[2,10]])})))).apply(this,arguments)}function pv(){return(pv=S(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c,u,l,d,f,p,h=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=h.length>0&&void 0!==h[0]?h[0]:{},t=r.opencvUrl,n=r.idCardModelUrl,a=r.blazefaceModelUrl,o=r.tfScriptUrls,i=r.wechatQRModelsUrl,s=h.length>1?h[1]:void 0,e.next=4,Xf({blazefaceModelUrl:a,tfScriptUrls:o});case 4:return c=e.sent,u=c.blazefaceModel,l=!0,d=new ev(s),e.prev=8,e.next=11,d.load({opencvUrl:t,modelUrl:n});case 11:e.next=16;break;case 13:return e.prev=13,e.t0=e.catch(8),e.abrupt("return",{ableToUseModel:!1});case 16:return e.next=18,cv({modelUrl:i});case 18:return e.prev=18,e.next=21,dv({idCardModel:d});case 21:f=e.sent,p=f.fastEnough,l=p,e.next=29;break;case 26:e.prev=26,e.t1=e.catch(18),l=!1;case 29:return e.abrupt("return",{ableToUseModel:l,idCardModel:d,blazefaceModel:u});case 30:case"end":return e.stop()}}),e,null,[[8,13],[18,26]])})))).apply(this,arguments)}var hv=Ff((function(){return pv.apply(this,arguments)})),mv=K.Errors;function gv(e){var r=e.refVideo,t=e.shouldStart,n=e.cropArea,s=e.settings,c=a(null);null===c.current&&(c.current=document.createElement("canvas"));var u=a(!1),l=a(So.createResizer({width:960,height:640})),d=a(null),f=a([{id:null,frames:[]}]),p=o((function(){!0===u.current&&(u.current=!1)}),[]),h=o((function(){f.current=[{id:null,frames:[]}]}),[]),m=o((function(){var e=f.current;e[e.length-1].frames.length>0&&e.push({id:null,frames:[]})}),[]),g=o(function(){var e=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=r.workingCanvas,n=l.current,a=f.current,o=n.resize({srcCanvas:t}),i=o.toDataURL("image/jpeg",s.saveFrameQuality/100).split(",")[1],a[a.length-1].frames.push({base64:i});case 7:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[s]),v=o(S(regeneratorRuntime.mark((function e(){var t,n,a,o,i,l,f,p,h,m,v,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s){e.next=2;break}return e.abrupt("return");case 2:if(t=s.frameCaptureIntervalMs,n=void 0===t?180:t,s.enableRecording){e.next=5;break}return e.abrupt("return");case 5:a=d.current,o=r.current,u.current=!0,i=a.cropX,l=a.cropY,f=a.cropWidth,p=a.cropHeight,(h=c.current).width=f,h.height=p,m=h.getContext("2d");case 13:return v=performance.now(),m.drawImage(o,i,l,f,p,0,0,f,p),e.next=18,g({workingCanvas:h});case 18:if(v=Math.floor(performance.now()-v),u.current){e.next=21;break}return e.abrupt("break",27);case 21:return y=0,n-v>0&&(y=n-v),e.next=25,On.sleep(y);case 25:e.next=13;break;case 27:case"end":return e.stop()}}),e)}))),[r,g,s]);return i((function(){var e=r.current;function a(){return(a=S(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return d.current=ca.analyzeVideoAndWindowSizes(e,n),r.next=3,v();case 3:case"end":return r.stop()}}),r)})))).apply(this,arguments)}return t&&n&&function(){a.apply(this,arguments)}(),function(){p()}}),[t,n,r,p,m,v]),{refWorkingCanvas:c,stopCheckFrame:p,splitVideos:m,resetRecordedVideos:h,checkFrame:v,refRecordedVideos:f}}var vv=function(e){var r=e.lang,t=e.onAboutToTimeout,n=e.onSessionTimeout,s=e.onVideoTimeLimitReached,u=e.settings,l=e.shouldStartTimers,d=e.sessionTime,f=a(),p=O(c(0),2),h=p[0],m=p[1],g=o((function(){clearInterval(f.current)}),[]),v=o((function(){m((function(e){return e+1}))}),[]);return i((function(){if(l){var e=u.maxRecordingTimePerVideo,r=0,a=d/3;f.current=setInterval((function(){var o=d-(r+=1);o<=a&&t&&t({curTimeLeft:o}),r>0&&r%e==0&&s&&s(),0===o&&(g(),n&&n())}),1e3)}return function(){g()}}),[l,r,t,g,n,s,h,u,d]),{stopTimers:g,startTimers:v}};Rs.initExifData();var yv,bv,Cv,wv=function(e){var r=e.shouldStart,t=e.refVideo,n=e.cropArea,s=e.settings,u=e.onModelErrorChange,l=e.frontSide,d=e.onDebugInfoChange,f=e.onAboutToTimeout,p=e.onSessionTimeout,h=e.onCaptureDone,m=e.outputEncryptionSettings,g=e.quality,v=a(!1),y=O(c(!1),2),b=y[0],C=y[1],w=a((function(){})),k=Pn.useSDKTracking().sendEvent,B=a(),E=a(),_=a(),I=$t.useSDKSettings(),T=I.debug,P=I.lang,R=I.enableAntiDebug,D=Os(),N=D.startMotion,L=D.stopMotion,M=D.motionData,F=D.orientationData;i((function(){R&&fi.enableAntiDebug()}),[R]);var U=o(function(){var e=S(regeneratorRuntime.mark((function e(r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k({tag:l?"id_front":"id_back",event:"sdk_ui.auto_capture",log:{}}),e.next=3,w.current(r);case 3:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[k,l]),V=o((function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];u.apply(void 0,r);var n=Pf(r,"0.code");n&&n!==B.current&&(k({tag:l?"id_front":"id_back",event:"sdk_ui.show_alert",log:{alert:n}}),B.current=n)}),[u,l,k]),j=function(e){var r=e.refVideo,t=e.shouldStart,n=e.cropArea,s=e.settings,u=e.onError,l=e.frontSide,d=e.onAutoCaptureSuccess,f=e.quality,p=a(null);null===p.current&&(p.current=document.createElement("canvas"));var h=a(0),m=a([]),g=a(null);null===g.current&&(g.current=document.createElement("canvas"));var v=a({}),y=a(!1),b=a(null),C=O(c(!1),2),w=C[0],k=C[1],B=a({imageBlob:null,takenAt:null,blurScore:null,detectedCard:null}),E=a({imageBlob:null,blurScore:null,error:null,detectedCard:null,captureCount:0,captureDuration:0}),_=a(!1),A=a(!1),I=a(null),T=a(!1),x=a({}),P=$t.useSDKSettings(),R=P.customUrls,D=P.country;i((function(){var e=!1;function r(){return(r=S(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!s||w){r.next=14;break}if(!s.enableIdDetection){r.next=10;break}return r.next=4,hv(R,D);case 4:return x.current=r.sent,r.next=7,di.initTensorFlow();case 7:I.current=s.enableBlurCheck&&x.current.ableToUseModel,r.next=11;break;case 10:I.current=!1;case 11:if(!e){r.next=13;break}return r.abrupt("return");case 13:k(!0);case 14:case"end":return r.stop()}}),r)})))).apply(this,arguments)}return function(){r.apply(this,arguments)}(),function(){e=!0}}),[w,s,R,D]);var N=o((function(e){return Hg({currentWorkingCanvas:e,refVirtualWorkingCanvas:g,refCountVirtualFrames:h,refVirtualFrames:m,refWorkingCanvas:p,refCardResult:v})}),[]),L=o((function(){!0===y.current&&(y.current=!1)}),[]),M=o(function(){var e=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.blurScore,n=r.detectedCard,a=s.blurThreshold,o=B.current,i=E.current,!(t<a&&ia.hasBetterCardBlurScore(t,o.blurScore))){e.next=17;break}if(!T.current){e.next=9;break}o.imageBlob=i.imageBlob,e.next=13;break;case 9:return e.next=11,ca.takePicture({canvas:p.current,quality:f});case 11:o.imageBlob=e.sent,o.captureTime=Date.now();case 13:o.takenAt=(new Date).getTime(),o.blurScore=t,o.detectedCard=n,o.captureType="auto";case 17:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[s,f]),F=o(function(){var e=S(regeneratorRuntime.mark((function e(r){var t,n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.blurScore,n=r.detectedCard,A.current=!0,a=E.current,!ia.hasBetterCardBlurScore(t,a.blurScore)){e.next=14;break}return e.next=6,ca.takePicture({canvas:p.current,quality:f});case 6:a.imageBlob=e.sent,a.captureDuration+=Date.now()-a.captureTime,a.captureTime=Date.now(),a.blurScore=t,a.detectedCard=n,a.captureCount++,a.captureType="manual",T.current=!0;case 14:A.current=!1;case 15:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[f]),U=o(S(regeneratorRuntime.mark((function e(){var r,t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=s.waitForBestImageTimeMs,null===(t=B.current).imageBlob){e.next=8;break}if(!((new Date).getTime()-t.takenAt>r)){e.next=8;break}return e.next=7,d(t);case 7:L();case 8:case"end":return e.stop()}}),e)}))),[d,s,L]),V=o((function(){_.current=!0}),[]),j=o((function(){return new Promise((function(e){_.current=!1;var r=setInterval((function(){A.current||(clearInterval(r),e())}),150)}))}),[]),z=o(S(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var r=s.blurThreshold,t=s.enableVirtualCamHashes,n=E.current;n.captureTime=Date.now(),I.current?(V(),setTimeout((function(){j().then(S(regeneratorRuntime.mark((function a(){var o;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(ia.hasBetterCardBlurScore(n.blurScore,r)||(n.error=mv.id_detector_error_blur),o=p.current,null!==n.imageBlob){a.next=6;break}ca.takePicture({canvas:o,quality:f}).then(function(){var r=S(regeneratorRuntime.mark((function r(a){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n.imageBlob=a,n.captureTime=Date.now(),!t){r.next=5;break}return r.next=5,N(o);case 5:e(n);case 6:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}()),a.next=10;break;case 6:if(!t){a.next=9;break}return a.next=9,N(o);case 9:e(n);case 10:case"end":return a.stop()}}),a)}))))}),2e3)):ca.takePicture({canvas:p.current,quality:f}).then(function(){var r=S(regeneratorRuntime.mark((function r(a){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n.imageBlob=a,n.captureTime=Date.now(),!t){r.next=5;break}return r.next=5,N(p.current);case 5:e(n);case 6:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}())})));case 1:case"end":return e.stop()}}),e)}))),[s,V,j,f,N]),K=o(S(regeneratorRuntime.mark((function e(){var t,n,a,o,i,c,d,f,g,C,k,A,I,P,R,N,L,O,V,j;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s&&w&&!y.current){e.next=2;break}return e.abrupt("return");case 2:B.current={imageBlob:null,takenAt:null,blurScore:null,detectedCard:null},E.current={imageBlob:null,blurScore:null,error:null,detectedCard:null,captureCount:0,captureDuration:0},t=s.enableAutoCapture,n=s.enableBlurCheck,a=s.enableIdDetection,o=x.current,i=o.idCardModel,c=o.blazefaceModel,d=o.ableToUseModel,f=b.current,g=r.current,y.current=!0,C=f.cropX,k=f.cropY,A=f.cropWidth,I=f.cropHeight,P=f.cropWidthWithoutPadding,R=f.cropHeightWithoutPadding,(N=p.current).width=A,N.height=I,L=N.getContext("2d"),O=document.createElement("canvas"),V=O.getContext("2d"),j=function(){var e=S(regeneratorRuntime.mark((function e(){var r,o,s,f,p,b,w;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(L.drawImage(g,C,k,A,I,0,0,A,I),r=performance.now(),T.current=!1,!a||!d){e.next=60;break}return o=null,e.next=7,i.predict(N,{detectThreshold:.3});case 7:if(!(s=e.sent).card){e.next=56;break}if(v.current=s.card,!E.current.imageBlob&&m.current.length>0&&(m.current=[],h.current=0),!Fg({corners:s.card.corners,width:A,height:I})){e.next=53;break}if(!jg(s.card.corners)){e.next=50;break}if(f=Og(N,s.card.corners),!((p=ga.rectAreaRatio({small:{area:f.width*f.height},big:{area:P*R}}))<.5)){e.next=21;break}o=mv.id_detector_card_too_small,e.next=48;break;case 21:if(!(p>.95)){e.next=25;break}o=mv.id_detector_error_incomplete,e.next=48;break;case 25:return O.width=f.width,O.height=f.height,V.putImageData(f,0,0),e.next=30,Ug({canvas:O});case 30:if(!e.sent){e.next=35;break}o=mv.glare_detected,e.next=48;break;case 35:if("ph"===D){e.next=39;break}return e.next=38,zg({blazefaceModel:c,predictedIdCardCanvas:O,frontSide:l});case 38:o=e.sent;case 39:if(o){e.next=48;break}if(!n){e.next=48;break}if(b=ia.calculateIdCardBlurScore({canvas:O}),!_.current){e.next=45;break}return e.next=45,F({blurScore:b,detectedCard:s.card});case 45:if(!t){e.next=48;break}return e.next=48,M({blurScore:b,detectedCard:s.card});case 48:e.next=51;break;case 50:o=mv.id_detector_validate_angle_error;case 51:e.next=54;break;case 53:o=mv.id_detector_error_incomplete;case 54:e.next=57;break;case 56:o=mv.id_detector_no_cards;case 57:return u(o),e.next=60,U();case 60:return r=Math.floor(performance.now()-r),w=180-r>0?180-r:0,e.next=64,new Promise((function(e){return setTimeout(e,w)}));case 64:y.current&&window.requestAnimationFrame(j);case 65:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(j);case 19:case"end":return e.stop()}}),e)}))),[s,w,r,u,U,l,F,M,D]);i((function(){var e=r.current;function a(){return(a=S(regeneratorRuntime.mark((function r(){var t,a,o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(b.current=ca.analyzeVideoAndWindowSizes(e,n,.05),t=b.current,a=t.cropWidth,o=t.cropHeight,e.videoWidth&&e.videoHeight&&!Number.isNaN(a)&&!Number.isNaN(o)){r.next=4;break}return r.abrupt("return");case 4:return r.next=6,K();case 6:case"end":return r.stop()}}),r)})))).apply(this,arguments)}t&&n&&w&&function(){a.apply(this,arguments)}()}),[t,n,r,L,K,w]);var H=o((function(){L()}),[L]);return i((function(){return H}),[H]),{refWorkingCanvas:p,stopCheckFrame:L,checkFrame:K,warmupDone:w,takePictureManually:z,refAbleToRunBurstMode:I,refVirtualFrames:m}}({refVideo:t,shouldStart:r,cropArea:n,settings:s,onError:V,frontSide:l,onAutoCaptureSuccess:U,quality:g}),z=j.refWorkingCanvas,K=j.stopCheckFrame,H=j.checkFrame,q=j.warmupDone,G=j.takePictureManually,W=j.refAbleToRunBurstMode,Q=j.refVirtualFrames,X=gv({refVideo:t,shouldStart:!1,cropArea:n,settings:s}),Y=X.stopCheckFrame,Z=X.splitVideos,$=X.resetRecordedVideos,J=X.checkFrame;!function(e){var r=e.debug,t=e.refRecordedVideos,n=e.refWorkingCanvas,a=e.refVideo,o=e.onChange;i((function(){var e;return r&&(e=setInterval((function(){var e=a.current,r=t.current,i=n.current,s=r[r.length-1],c={videoWidth:e.videoWidth,videoHeight:e.videoHeight,framesCount:s.frames.length,"window.innerWidth":window.innerWidth,"window.innerHeight":window.innerHeight,"canvas.width":null==i?void 0:i.width,"canvas.height":null==i?void 0:i.height};o&&o(JSON.stringify(c,null,2))}),1e3)),function(){return clearInterval(e)}}),[o,r,t,n,a])}({debug:T,refRecordedVideos:X.refRecordedVideos,refWorkingCanvas:z,refVideo:t,onChange:d});var ee=o((function(){Y(),K(),$(),p()}),[$,Y,K,p]),re=o((function(){Z()}),[Z]),te=vv({lang:P,onAboutToTimeout:f,onSessionTimeout:ee,onVideoTimeLimitReached:re,settings:s,shouldStartTimers:q&&r&&(null==s?void 0:s.enableTimers),sessionTime:null==s?void 0:s.idCardSessionTime}),ne=te.stopTimers,ae=te.startTimers,oe=o((function(){v.current=!1}),[]),ie=o(S(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return oe(),ae(),e.next=4,Promise.all([J(),H()]);case 4:case"end":return e.stop()}}),e)}))),[oe,ae,J,H]),se=o(S(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,c,u,d,f,p,g,y,b,w=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=w.length>0&&void 0!==w[0]?w[0]:{},t=r.imageBlob,n=r.error,a=r.detectedCard,o=r.captureTime,i=r.captureCount,c=r.captureDuration,u=r.captureType,!v.current){e.next=3;break}return e.abrupt("return");case 3:return v.current=!0,C(!0),Y(),K(),ne(),V(null),d=null==s?void 0:s.enableVirtualCamHashes,f={},d&&(p=Q).current.length>0&&(f=p.current.reduce((function(e,r,t){return x(x({},e),{},A({},"hash".concat(t+1),r))}),f)),L(),Rs.preWriteExif({mode:Rs.MODE.ID_CARD,motionData:M,orientationData:F,startTime:E.current,endTime:Date.now()}),e.next=16,Rs.writeExif({mode:Rs.MODE.ID_CARD,imageData:x(x({detectedCard:a,captureTime:o,blob:t},d?{vCam:f}:{}),{},{captureCount:i,captureDuration:c,captureType:u}),enableExifData:null==s?void 0:s.enableExifData});case 16:if(g=e.sent,!m||!m.key){e.next=22;break}return b=m.key,e.next=21,mi.encrypt({blob:g,key:b});case 21:y=e.sent;case 22:h({image:{blob:g,encrypted:y,detectedCard:a},error:n,recordedVideos:[]}),C(!1),k({tag:l?"id_front":"id_back",event:"user_activity",log:{time_capture_in_seconds:(performance.now()-_.current)/1e3}});case 25:case"end":return e.stop()}}),e)}))),[Y,K,ne,V,h,l,k,m,M,F,L,null==s?void 0:s.enableExifData,null==s?void 0:s.enableVirtualCamHashes,Q]);w.current=se;var ce=o(S(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return C(!0),ne(),Y(),W.current||K(),e.next=6,G();case 6:return r=e.sent,e.next=9,se(r);case 9:C(!1),k({tag:l?"id_front":"id_back",event:"user_activity.capture",log:{}});case 11:case"end":return e.stop()}}),e)}))),[G,se,ne,W,Y,K,k,l]);return i((function(){r&&(k({tag:l?"id_front":"id_back",event:"user_activity.start",log:{}}),E.current=Date.now(),N())}),[k,l,r,N]),i((function(){q&&(k({tag:l?"id_front":"id_back",event:"user_activity.show",log:{}}),k({tag:l?"id_front":"id_back",event:"sdk.load_model",log:{status:"success",time_in_ms:Date.now()-E.current}}),_.current=performance.now())}),[k,l,q]),{warmupDone:q,isProcessing:b,takePictureManually:ce,restartSession:ie,resetIsProcessingImageBlobTaken:oe}},kv=K.IDCardMessage,Bv=l((function(e,t){var n=e.description,a=e.usePortraitMask,s=e.windowAndVideoInfo,u=e.refVideo,l=e.frontSide,f=e.settings,p=e.onCaptureDone,h=e.onUISpacingChange,m=e.outputEncryptionSettings,g=O(c({}),2),v=g[0],y=g[1],b=v.yDescription,C=v.yMessage,w=v.yCaptureButton,k=Nn.useAsset("ic_camera.svg"),B=Nn.useAsset("ic_loading.png"),E=O(c(""),2),_=E[0],A=E[1],I=$t.useSDKSettings(),T=I.debug,x=I.lang,P=O(c(null),2),R=P[0],D=P[1],N=O(c(""),2),L=N[0],M=N[1],F=O(c(null),2),U=F[0],V=F[1],j=Ag(),z=j.showPopup,K=j.popupShown,H=j.popupType,q=o((function(e){M(null===e?"":Kd(e.msg[x])({side:l?wg.FRONT[x]:wg.BACK[x]}))}),[x,l]),G=o((function(){D(""),z({popupType:Ig})}),[z]),W=o((function(){D(""),p.apply(void 0,arguments)}),[p]),Q=o((function(e){var r=e.curTimeLeft;D(Kd(kv.REMAINING_TIME[x])({x:r}))}),[x]),X=wv({shouldStart:!0,refVideo:u,cropArea:U,settings:f,onModelErrorChange:q,frontSide:l,onDebugInfoChange:A,onSessionTimeout:G,onCaptureDone:W,onAboutToTimeout:Q,outputEncryptionSettings:m}),Y=X.warmupDone,Z=X.isProcessing,$=X.takePictureManually,J=X.restartSession,ee=X.resetIsProcessingImageBlobTaken,re=o((function(){z({popupType:null}),ee()}),[z,ee]),te=o(S(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return re(),e.next=3,J();case 3:case"end":return e.stop()}}),e)}))),[J,re]);i((function(){if(s){var e,r,t,n,o,i,c,u=s.videoAreaWidth,l=s.videoAreaHeight,d=s.lostX,f=s.lostY,p=s.clientHeight;a?(o=.7*(i=l-165),t=(c=(e=f+10)+45)+20,n=(r=c+i+10)+60):(o=qs.isMobile?u-6:Math.floor(.7*u),t=(c=(e=f+10)+50)+20,n=(r=c+(i=Math.floor(Math.min(o/1.5,p-2*f-80-100)))+10)+60);var m=Math.floor((u-o)/2)+d;V({x:m,y:c,width:o,height:i,surroundStyle:{opacity:.6,background:"#000"}});var g={yTitle:e,yDescription:r,yMessage:t,yCaptureButton:n};y(g),h(g)}}),[s,a,h]);var ne=o(S(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return D(""),e.next=3,$();case 3:case"end":return e.stop()}}),e)}))),[$]);return d(t,(function(){return{restartSession:te}}),[te]),r.createElement(r.Fragment,null,!Y&&r.createElement(qp,null),T&&r.createElement(Im,null,_),Z&&r.createElement(Bm,null,r.createElement("img",{src:B,alt:"",className:"spin"})),U&&r.createElement(Cu,{x:"".concat(U.x,"px"),y:"".concat(U.y,"px"),width:"".concat(U.width,"px"),height:"".concat(U.height,"px"),surroundStyle:U.surroundStyle},r.createElement(Rm,{width:U.width,height:U.height,type:L?Oh.ERROR:Oh.DEFAULT})),!L&&r.createElement(Tm,{y:"".concat(b,"px"),className:"description"},n),L&&r.createElement(xm,{y:"".concat(b,"px")},L),!Z&&(!(null!=f&&f.disableCaptureButtonIfAlert)||!L)&&r.createElement(km,{onClick:ne,y:"".concat(w,"px")},r.createElement("img",{src:k,alt:""})),R&&r.createElement(Pm,{key:R,className:"message",y:"".concat(C,"px")},R),r.createElement(zp,{open:K},H===Ig&&r.createElement(_g,{onOk:te,maxSessionTime:null==f?void 0:f.idCardSessionTime})))}));Bv.propTypes={usePortraitMask:h.bool,description:h.string,windowAndVideoInfo:h.shape({}),refVideo:h.shape({}),frontSide:h.bool,settings:h.shape({}),onCaptureDone:h.func,onUISpacingChange:h.func,outputEncryptionSettings:h.shape({})},Bv.defaultProps={usePortraitMask:!1,description:"",windowAndVideoInfo:{},refVideo:{},frontSide:!0,settings:{},onCaptureDone:function(){},onUISpacingChange:function(){},outputEncryptionSettings:null};var Ev,Sv,_v=m.div(yv||(yv=L(["\n background: ",";\n backdrop-filter: blur(12px);\n border-radius: 8px;\n top: ",";\n position: absolute;\n z-index: ",";\n color: #fff;\n padding: 10px;\n margin: 0 10px;\n max-width: 275px;\n text-align: center;\n"])),(function(e){return e.background}),(function(e){return e.y}),1020),Av=m.div(bv||(bv=L(["\n width: 0;\n height: 0;\n border-left: 20px solid transparent;\n border-right: 20px solid transparent;\n border-bottom: ",";\n position: absolute;\n left: 50%;\n top: ",";\n transform: translateX(-50%);\n"])),(function(e){return"".concat(e.arrowSize,"px solid ").concat(e.color)}),(function(e){return"".concat(e.top,"px")})),Iv=function(e){var t=e.children,n=e.y;return r.createElement(_v,{y:n,background:"#00ce78"},r.createElement(Av,{arrowSize:10,top:-10,color:"#00ce78"}),t)},Tv=m.div(Cv||(Cv=L(["\n text-align: center;\n position: absolute;\n font-size: 18px;\n border-radius: 3px;\n padding: 5px 10px;\n background: #ea3223;\n color: #fff;\n margin: auto;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),xv={QR_INSTRUCTIONS_TEXT:{en:r.createElement("span",null,"Please follow the instructions below to scan QR code:",r.createElement("br",null),r.createElement("br",null)," Move camera to the position of QR code on ID card. Align QR code to fit into camera frame to scan it"),vi:r.createElement("span",null,"Vui lòng quét mã QR theo hướng dẫn sau:",r.createElement("br",null),r.createElement("br",null)," Đưa camera vào vị trí mã QR trên CCCD. Canh vừa mã QR vào 4 góc khung hình để quét mã")},QR_INSTRUCTIONS_START_BUTTON:{en:"Scan QR code",vi:"Tiến hành quét mã QR"},QR_INSTRUCTIONS_COUNTDOWN:{en:"Start in <%= x %> s",vi:"Bắt đầu trong <%= x %> giây"},QR_INVALID_POPUP_TITLE:{en:"Invalid QR code",vi:"QR không hợp lệ"},QR_INVALID_POPUP_DESCRIPTION:{en:"Please check and make sure scanning QR code on ID card",vi:"Vui lòng kiểm tra và đảm bảo việc thực hiện quét QR trên CCCD thật"},QR_INVALID_POPUP_RETRY_BUTTON:{en:"Scan QR (on ID card)",vi:"Quét lại QR (trên CCCD)"},QR_INVALID_POPUP_SKIP_BUTTON:{en:"Skip",vi:"Bỏ qua"},QR_TOOLTIP:{en:"Fit QR code to 4 corners of camera frame and try to move camera [in or out] to scan QR code",vi:"Canh vừa mã QR vào 4 góc khung hình và thử dịch chuyển camera [xa - gần] để quét được mã QR"},REMAINING_TIME:{en:"Remaining time: <%= x %> seconds",vi:"Thời gian còn lại: <%= x %> giây"},SESSION_TIMEOUT_POPUP_DESCRIPTION:{en:r.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",r.createElement("br",null),r.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",r.createElement("strong",{className:"text-primary"},"thử dịch chuyển camera [xa - gần]")," để camera điện thoại lấy nét chuẩn hơn."),vi:r.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",r.createElement("br",null),r.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",r.createElement("strong",{className:"text-primary"},"thử dịch chuyển camera [xa - gần]")," để camera điện thoại lấy nét chuẩn hơn.")},SESSION_TIMEOUT_POPUP_RETRY_BUTTON:{en:"Retry",vi:"Thực hiện lại"},SESSION_TIMEOUT_POPUP_SKIP_BUTTON:{en:"Skip",vi:"Bỏ qua"}},Pv=function(e){var t=e.children,n=e.mt,a=e.mb,o=e.ml,i=e.mr,s=e.mx,c=e.my,u=e.pt,l=e.pb,d=e.pl,f=e.pr,p=e.px,h=e.py,m=t.props.style||{},g={};return null!==s&&(g.marginLeft=s,g.marginRight=s),null!==c&&(g.marginTop=c,g.marginBottom=c),null!==n&&(g.marginTop=n),null!==a&&(g.marginBottom=a),null!==o&&(g.marginLeft=o),null!==i&&(g.marginRight=i),null!==p&&(g.paddingLeft=p,g.paddingRight=p),null!==h&&(g.paddingTop=h,g.paddingBottom=h),null!==u&&(g.paddingTop=u),null!==l&&(g.paddingBottom=l),null!==d&&(g.paddingLeft=d),null!==f&&(g.paddingRight=f),r.cloneElement(t,{style:x(x({},m),g)})};Pv.propTypes={mt:h.string,ml:h.string,mr:h.string,mb:h.string,mx:h.string,my:h.string,pt:h.string,pl:h.string,pr:h.string,pb:h.string,px:h.string,py:h.string},Pv.defaultProps={mt:null,ml:null,mr:null,mb:null,mx:null,my:null,pt:null,pl:null,pr:null,pb:null,px:null,py:null};var Rv,Dv,Nv,Lv=m.button(Ev||(Ev=L(["\n width: 100%;\n max-width: 294px;\n height: 66px;\n background-color: ",";\n border: 0;\n outline: none;\n border-radius: 3px;\n color: #fff;\n font-weight: normal;\n cursor: pointer;\n font-size: 1rem;\n"])),(function(e){return e.theme.tsBlue})),Ov=m.a(Sv||(Sv=L(["\n color: ",";\n cursor: pointer;\n"])),(function(e){return e.theme.tsBlue})),Mv=m.div(Rv||(Rv=L(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),Fv=m.div(Dv||(Dv=L(["\n color: ",";\n font-weight: bold;\n font-size: 16px;\n"])),(function(e){return e.theme.tsSecondary})),Uv=m.div(Nv||(Nv=L(["\n color: ",";\n font-weight: normal;\n font-size: 16px;\n text-align: center;\n"])),(function(e){return e.theme.tsSecondary})),Vv=function(e){var t=e.onRetry,n=e.onSkip,a=$t.useSDKSettings().lang;return r.createElement(Mv,null,r.createElement(Pv,{mt:"25px"},r.createElement(Fv,null,xv.QR_INVALID_POPUP_TITLE[a])),r.createElement(Pv,{mt:"30px"},r.createElement(Uv,null,xv.QR_INVALID_POPUP_DESCRIPTION[a])),r.createElement(Pv,{mt:"30px"},r.createElement(Lv,{onClick:t},xv.QR_INVALID_POPUP_RETRY_BUTTON[a])),r.createElement(Pv,{my:"20px"},r.createElement(Ov,{onClick:n},xv.QR_INVALID_POPUP_SKIP_BUTTON[a])))};Vv.propTypes={onRetry:h.func,onSkip:h.func},Vv.defaultProps={onRetry:function(){},onSkip:function(){}};var jv,zv,Kv,Hv,qv,Gv,Wv,Qv=["children","ratio","padding"],Xv=m.div(jv||(jv=L(["\n width: 100%;\n padding-bottom: ","%;\n position: relative;\n"])),(function(e){return 1/e.ratio*100})),Yv=m.div(zv||(zv=L(["\n position: absolute;\n top: ",";\n left: ",";\n right: ",";\n bottom: ",";\n"])),(function(e){return e.padding}),(function(e){return e.padding}),(function(e){return e.padding}),(function(e){return e.padding})),Zv=function(e){var t=e.children,n=e.ratio,a=e.padding,o=N(e,Qv);return r.createElement(Xv,I({ratio:n},o),r.createElement(Yv,{padding:a},t))};Zv.propTypes={children:h.node,ratio:h.number,padding:h.string},Zv.defaultProps={children:null,ratio:4/3,padding:"0"};var $v=m.div(Kv||(Kv=L(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),Jv=m.div(Hv||(Hv=L(["\n background: #e7e6e6;\n width: 100%;\n"]))),ey=m.img(qv||(qv=L(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),ry=m.div(Gv||(Gv=L(["\n color: ",";\n font-weight: normal;\n font-size: 16px;\n text-align: center;\n line-height: 20px;\n"])),(function(e){return e.theme.tsSecondary})),ty=m(ry)(Wv||(Wv=L(["\n white-space: nowrap;\n"]))),ny=function(e){var t=e.onClickStart,n=e.onTimeout,o=e.timeout,s=$t.useSDKSettings().lang,u=Nn.useAsset("qr_code_banner.png"),l=a(o),d=O(c((function(){return Kd(xv.QR_INSTRUCTIONS_COUNTDOWN[s])({x:o})})),2),f=d[0],p=d[1],h=Pn.useSDKTracking().sendEvent,m=a(!1);i((function(){h({tag:"id_qr",event:"sdk_ui.guideline_show",log:{}})}),[h]),i((function(){var e=Kd(xv.QR_INSTRUCTIONS_COUNTDOWN[s]),r=setInterval((function(){l.current--,p(e({x:l.current})),l.current<=0&&(clearInterval(r),m.current||h({tag:"id_qr",event:"sdk_ui.guideline_time_out",log:{}}),n&&n())}),1e3);return function(){clearInterval(r)}}),[s,n]);return r.createElement($v,null,r.createElement(Jv,null,r.createElement(Zv,{ratio:1.6},r.createElement(ey,{src:u}))),r.createElement(Pv,{mt:"30px"},r.createElement(ry,null,xv.QR_INSTRUCTIONS_TEXT[s])),r.createElement(Pv,{mt:"30px"},r.createElement(Lv,{onClick:function(){h({tag:"id_qr",event:"user_activity.click_start",log:{}}),m.current=!0,t()}},xv.QR_INSTRUCTIONS_START_BUTTON[s])),r.createElement(Pv,{my:"20px"},r.createElement(ty,null,f)))};ny.propTypes={onClickStart:h.func,onTimeout:h.func,timeout:h.number},ny.defaultProps={onClickStart:null,onTimeout:null,timeout:10};var ay=/^\d{12}\|(\d{9})?\|.+\|\d{8}\|((Nam)|(Nữ))\|.+\|\d{8}$/g;function oy(e){var r=e.canvas,t=e.qrModel,n=window.cv,a=n.imread(r,n.IMREAD_GRAYSCALE);return t.detectAndDecode(a).get(0)}var iy=function(){var e=S(regeneratorRuntime.mark((function e(r,t){var n,a,o,i,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,cv();case 2:if(n=e.sent,a=n.qrModel,!n.noModel){e.next=7;break}return e.abrupt("return",null);case 7:return o=document.createElement("canvas"),i=o.getContext("2d"),e.next=11,new Promise((function(e){var t=URL.createObjectURL(r),n=new Image;n.onload=function(){var r=n.width,a=n.height;o.width=r/2,o.height=a/2,i.drawImage(n,r/2,0,o.width,o.height,0,0,o.width,o.height),URL.revokeObjectURL(t),e()},n.src=t}));case 11:return e.next=13,oy({canvas:o,qrModel:a});case 13:if(s=e.sent){e.next=16;break}return e.abrupt("return",null);case 16:return e.next=18,Rs.writeExif({mode:"",imageData:{blob:r,result:s,type:"qr_from_front_image"},enableExifData:!0});case 18:if(c=e.sent,!t||!t.key){e.next=24;break}return l=t.key,e.next=23,mi.encrypt({imageBlobWithExif:c,key:l});case 23:u=e.sent;case 24:return e.abrupt("return",{result:s,validateResult:{valid:!0},image:{blob:c,encrypted:u},recordedVideos:[]});case 25:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}(),sy=Ks(Hs((function(e,r){var t;"undefined"!=typeof self&&self,t=function(){return function(e){var r={};function t(n){if(r[n])return r[n].exports;var a=r[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,t),a.l=!0,a.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=3)}([function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,r){this.width=r,this.height=e.length/r,this.data=e}return e.createEmpty=function(r,t){return new e(new Uint8ClampedArray(r*t),r)},e.prototype.get=function(e,r){return!(e<0||e>=this.width||r<0||r>=this.height||!this.data[r*this.width+e])},e.prototype.set=function(e,r,t){this.data[r*this.width+e]=t?1:0},e.prototype.setRegion=function(e,r,t,n,a){for(var o=r;o<r+n;o++)for(var i=e;i<e+t;i++)this.set(i,o,!!a)},e}();r.BitMatrix=n},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(2);r.addOrSubtractGF=function(e,r){return e^r};var a=function(){function e(e,r,t){this.primitive=e,this.size=r,this.generatorBase=t,this.expTable=new Array(this.size),this.logTable=new Array(this.size);for(var a=1,o=0;o<this.size;o++)this.expTable[o]=a,(a*=2)>=this.size&&(a=(a^this.primitive)&this.size-1);for(o=0;o<this.size-1;o++)this.logTable[this.expTable[o]]=o;this.zero=new n.default(this,Uint8ClampedArray.from([0])),this.one=new n.default(this,Uint8ClampedArray.from([1]))}return e.prototype.multiply=function(e,r){return 0===e||0===r?0:this.expTable[(this.logTable[e]+this.logTable[r])%(this.size-1)]},e.prototype.inverse=function(e){if(0===e)throw new Error("Can't invert 0");return this.expTable[this.size-this.logTable[e]-1]},e.prototype.buildMonomial=function(e,r){if(e<0)throw new Error("Invalid monomial degree less than 0");if(0===r)return this.zero;var t=new Uint8ClampedArray(e+1);return t[0]=r,new n.default(this,t)},e.prototype.log=function(e){if(0===e)throw new Error("Can't take log(0)");return this.logTable[e]},e.prototype.exp=function(e){return this.expTable[e]},e}();r.default=a},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(1),a=function(){function e(e,r){if(0===r.length)throw new Error("No coefficients.");this.field=e;var t=r.length;if(t>1&&0===r[0]){for(var n=1;n<t&&0===r[n];)n++;if(n===t)this.coefficients=e.zero.coefficients;else{this.coefficients=new Uint8ClampedArray(t-n);for(var a=0;a<this.coefficients.length;a++)this.coefficients[a]=r[n+a]}}else this.coefficients=r}return e.prototype.degree=function(){return this.coefficients.length-1},e.prototype.isZero=function(){return 0===this.coefficients[0]},e.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},e.prototype.addOrSubtract=function(r){var t;if(this.isZero())return r;if(r.isZero())return this;var a=this.coefficients,o=r.coefficients;a.length>o.length&&(a=(t=[o,a])[0],o=t[1]);for(var i=new Uint8ClampedArray(o.length),s=o.length-a.length,c=0;c<s;c++)i[c]=o[c];for(c=s;c<o.length;c++)i[c]=n.addOrSubtractGF(a[c-s],o[c]);return new e(this.field,i)},e.prototype.multiply=function(r){if(0===r)return this.field.zero;if(1===r)return this;for(var t=this.coefficients.length,n=new Uint8ClampedArray(t),a=0;a<t;a++)n[a]=this.field.multiply(this.coefficients[a],r);return new e(this.field,n)},e.prototype.multiplyPoly=function(r){if(this.isZero()||r.isZero())return this.field.zero;for(var t=this.coefficients,a=t.length,o=r.coefficients,i=o.length,s=new Uint8ClampedArray(a+i-1),c=0;c<a;c++)for(var u=t[c],l=0;l<i;l++)s[c+l]=n.addOrSubtractGF(s[c+l],this.field.multiply(u,o[l]));return new e(this.field,s)},e.prototype.multiplyByMonomial=function(r,t){if(r<0)throw new Error("Invalid degree less than 0");if(0===t)return this.field.zero;for(var n=this.coefficients.length,a=new Uint8ClampedArray(n+r),o=0;o<n;o++)a[o]=this.field.multiply(this.coefficients[o],t);return new e(this.field,a)},e.prototype.evaluateAt=function(e){var r=0;if(0===e)return this.getCoefficient(0);var t=this.coefficients.length;if(1===e)return this.coefficients.forEach((function(e){r=n.addOrSubtractGF(r,e)})),r;r=this.coefficients[0];for(var a=1;a<t;a++)r=n.addOrSubtractGF(this.field.multiply(e,r),this.coefficients[a]);return r},e}();r.default=a},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(4),a=t(5),o=t(11),i=t(12);function s(e){var r=i.locate(e);if(!r)return null;for(var t=0,n=r;t<n.length;t++){var s=n[t],c=o.extract(e,s),u=a.decode(c.matrix);if(u)return{binaryData:u.bytes,data:u.text,chunks:u.chunks,version:u.version,location:{topRightCorner:c.mappingFunction(s.dimension,0),topLeftCorner:c.mappingFunction(0,0),bottomRightCorner:c.mappingFunction(s.dimension,s.dimension),bottomLeftCorner:c.mappingFunction(0,s.dimension),topRightFinderPattern:s.topRight,topLeftFinderPattern:s.topLeft,bottomLeftFinderPattern:s.bottomLeft,bottomRightAlignmentPattern:s.alignmentPattern}}}return null}var c={inversionAttempts:"attemptBoth"};function u(e,r,t,a){void 0===a&&(a={});var o=c;Object.keys(o||{}).forEach((function(e){o[e]=a[e]||o[e]}));var i="attemptBoth"===o.inversionAttempts||"invertFirst"===o.inversionAttempts,u="onlyInvert"===o.inversionAttempts||"invertFirst"===o.inversionAttempts,l=n.binarize(e,r,t,i),d=l.binarized,f=l.inverted,p=s(u?f:d);return p||"attemptBoth"!==o.inversionAttempts&&"invertFirst"!==o.inversionAttempts||(p=s(u?d:f)),p}u.default=u,r.default=u},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(0);function a(e,r,t){return e<r?r:e>t?t:e}var o=function(){function e(e,r){this.width=e,this.data=new Uint8ClampedArray(e*r)}return e.prototype.get=function(e,r){return this.data[r*this.width+e]},e.prototype.set=function(e,r,t){this.data[r*this.width+e]=t},e}();r.binarize=function(e,r,t,i){if(e.length!==r*t*4)throw new Error("Malformed data passed to binarizer.");for(var s=new o(r,t),c=0;c<r;c++)for(var u=0;u<t;u++){var l=e[4*(u*r+c)+0],d=e[4*(u*r+c)+1],f=e[4*(u*r+c)+2];s.set(c,u,.2126*l+.7152*d+.0722*f)}for(var p=Math.ceil(r/8),h=Math.ceil(t/8),m=new o(p,h),g=0;g<h;g++)for(var v=0;v<p;v++){var y=0,b=1/0,C=0;for(u=0;u<8;u++)for(c=0;c<8;c++){var w=s.get(8*v+c,8*g+u);y+=w,b=Math.min(b,w),C=Math.max(C,w)}var k=y/Math.pow(8,2);if(C-b<=24&&(k=b/2,g>0&&v>0)){var B=(m.get(v,g-1)+2*m.get(v-1,g)+m.get(v-1,g-1))/4;b<B&&(k=B)}m.set(v,g,k)}var E=n.BitMatrix.createEmpty(r,t),S=null;for(i&&(S=n.BitMatrix.createEmpty(r,t)),g=0;g<h;g++)for(v=0;v<p;v++){for(var _=a(v,2,p-3),A=a(g,2,h-3),I=(y=0,-2);I<=2;I++)for(var T=-2;T<=2;T++)y+=m.get(_+I,A+T);var x=y/25;for(I=0;I<8;I++)for(T=0;T<8;T++){c=8*v+I,u=8*g+T;var P=s.get(c,u);E.set(c,u,P<=x),i&&S.set(c,u,!(P<=x))}}return i?{binarized:E,inverted:S}:{binarized:E}}},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(0),a=t(6),o=t(9),i=t(10);function s(e,r){for(var t=e^r,n=0;t;)n++,t&=t-1;return n}function c(e,r){return r<<1|e}var u=[{bits:21522,formatInfo:{errorCorrectionLevel:1,dataMask:0}},{bits:20773,formatInfo:{errorCorrectionLevel:1,dataMask:1}},{bits:24188,formatInfo:{errorCorrectionLevel:1,dataMask:2}},{bits:23371,formatInfo:{errorCorrectionLevel:1,dataMask:3}},{bits:17913,formatInfo:{errorCorrectionLevel:1,dataMask:4}},{bits:16590,formatInfo:{errorCorrectionLevel:1,dataMask:5}},{bits:20375,formatInfo:{errorCorrectionLevel:1,dataMask:6}},{bits:19104,formatInfo:{errorCorrectionLevel:1,dataMask:7}},{bits:30660,formatInfo:{errorCorrectionLevel:0,dataMask:0}},{bits:29427,formatInfo:{errorCorrectionLevel:0,dataMask:1}},{bits:32170,formatInfo:{errorCorrectionLevel:0,dataMask:2}},{bits:30877,formatInfo:{errorCorrectionLevel:0,dataMask:3}},{bits:26159,formatInfo:{errorCorrectionLevel:0,dataMask:4}},{bits:25368,formatInfo:{errorCorrectionLevel:0,dataMask:5}},{bits:27713,formatInfo:{errorCorrectionLevel:0,dataMask:6}},{bits:26998,formatInfo:{errorCorrectionLevel:0,dataMask:7}},{bits:5769,formatInfo:{errorCorrectionLevel:3,dataMask:0}},{bits:5054,formatInfo:{errorCorrectionLevel:3,dataMask:1}},{bits:7399,formatInfo:{errorCorrectionLevel:3,dataMask:2}},{bits:6608,formatInfo:{errorCorrectionLevel:3,dataMask:3}},{bits:1890,formatInfo:{errorCorrectionLevel:3,dataMask:4}},{bits:597,formatInfo:{errorCorrectionLevel:3,dataMask:5}},{bits:3340,formatInfo:{errorCorrectionLevel:3,dataMask:6}},{bits:2107,formatInfo:{errorCorrectionLevel:3,dataMask:7}},{bits:13663,formatInfo:{errorCorrectionLevel:2,dataMask:0}},{bits:12392,formatInfo:{errorCorrectionLevel:2,dataMask:1}},{bits:16177,formatInfo:{errorCorrectionLevel:2,dataMask:2}},{bits:14854,formatInfo:{errorCorrectionLevel:2,dataMask:3}},{bits:9396,formatInfo:{errorCorrectionLevel:2,dataMask:4}},{bits:8579,formatInfo:{errorCorrectionLevel:2,dataMask:5}},{bits:11994,formatInfo:{errorCorrectionLevel:2,dataMask:6}},{bits:11245,formatInfo:{errorCorrectionLevel:2,dataMask:7}}],l=[function(e){return(e.y+e.x)%2==0},function(e){return e.y%2==0},function(e){return e.x%3==0},function(e){return(e.y+e.x)%3==0},function(e){return(Math.floor(e.y/2)+Math.floor(e.x/3))%2==0},function(e){return e.x*e.y%2+e.x*e.y%3==0},function(e){return(e.y*e.x%2+e.y*e.x%3)%2==0},function(e){return((e.y+e.x)%2+e.y*e.x%3)%2==0}];function d(e,r,t){for(var a=l[t.dataMask],o=e.height,i=function(e){var r=17+4*e.versionNumber,t=n.BitMatrix.createEmpty(r,r);t.setRegion(0,0,9,9,!0),t.setRegion(r-8,0,8,9,!0),t.setRegion(0,r-8,9,8,!0);for(var a=0,o=e.alignmentPatternCenters;a<o.length;a++)for(var i=o[a],s=0,c=e.alignmentPatternCenters;s<c.length;s++){var u=c[s];6===i&&6===u||6===i&&u===r-7||i===r-7&&6===u||t.setRegion(i-2,u-2,5,5,!0)}return t.setRegion(6,9,1,r-17,!0),t.setRegion(9,6,r-17,1,!0),e.versionNumber>6&&(t.setRegion(r-11,0,3,6,!0),t.setRegion(0,r-11,6,3,!0)),t}(r),s=[],u=0,d=0,f=!0,p=o-1;p>0;p-=2){6===p&&p--;for(var h=0;h<o;h++)for(var m=f?o-1-h:h,g=0;g<2;g++){var v=p-g;if(!i.get(v,m)){d++;var y=e.get(v,m);a({y:m,x:v})&&(y=!y),u=c(y,u),8===d&&(s.push(u),d=0,u=0)}}f=!f}return s}function f(e){var r=function(e){var r=e.height,t=Math.floor((r-17)/4);if(t<=6)return i.VERSIONS[t-1];for(var n=0,a=5;a>=0;a--)for(var o=r-9;o>=r-11;o--)n=c(e.get(o,a),n);var u=0;for(o=5;o>=0;o--)for(a=r-9;a>=r-11;a--)u=c(e.get(o,a),u);for(var l,d=1/0,f=0,p=i.VERSIONS;f<p.length;f++){var h=p[f];if(h.infoBits===n||h.infoBits===u)return h;var m=s(n,h.infoBits);m<d&&(l=h,d=m),(m=s(u,h.infoBits))<d&&(l=h,d=m)}return d<=3?l:void 0}(e);if(!r)return null;var t=function(e){for(var r=0,t=0;t<=8;t++)6!==t&&(r=c(e.get(t,8),r));for(var n=7;n>=0;n--)6!==n&&(r=c(e.get(8,n),r));var a=e.height,o=0;for(n=a-1;n>=a-7;n--)o=c(e.get(8,n),o);for(t=a-8;t<a;t++)o=c(e.get(t,8),o);for(var i=1/0,l=null,d=0,f=u;d<f.length;d++){var p=f[d],h=p.bits,m=p.formatInfo;if(h===r||h===o)return m;var g=s(r,h);g<i&&(l=m,i=g),r!==o&&(g=s(o,h))<i&&(l=m,i=g)}return i<=3?l:null}(e);if(!t)return null;var n=function(e,r,t){var n=r.errorCorrectionLevels[t],a=[],o=0;if(n.ecBlocks.forEach((function(e){for(var r=0;r<e.numBlocks;r++)a.push({numDataCodewords:e.dataCodewordsPerBlock,codewords:[]}),o+=e.dataCodewordsPerBlock+n.ecCodewordsPerBlock})),e.length<o)return null;e=e.slice(0,o);for(var i=n.ecBlocks[0].dataCodewordsPerBlock,s=0;s<i;s++)for(var c=0,u=a;c<u.length;c++)u[c].codewords.push(e.shift());if(n.ecBlocks.length>1){var l=n.ecBlocks[0].numBlocks,d=n.ecBlocks[1].numBlocks;for(s=0;s<d;s++)a[l+s].codewords.push(e.shift())}for(;e.length>0;)for(var f=0,p=a;f<p.length;f++)p[f].codewords.push(e.shift());return a}(d(e,r,t),r,t.errorCorrectionLevel);if(!n)return null;for(var l=n.reduce((function(e,r){return e+r.numDataCodewords}),0),f=new Uint8ClampedArray(l),p=0,h=0,m=n;h<m.length;h++){var g=m[h],v=o.decode(g.codewords,g.codewords.length-g.numDataCodewords);if(!v)return null;for(var y=0;y<g.numDataCodewords;y++)f[p++]=v[y]}try{return a.decode(f,r.versionNumber)}catch(e){return null}}r.decode=function(e){if(null==e)return null;var r=f(e);if(r)return r;for(var t=0;t<e.width;t++)for(var n=t+1;n<e.height;n++)e.get(t,n)!==e.get(n,t)&&(e.set(t,n,!e.get(t,n)),e.set(n,t,!e.get(n,t)));return f(e)}},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n,a,o=t(7),i=t(8);function s(e,r){for(var t=[],n="",a=[10,12,14][r],o=e.readBits(a);o>=3;){if((u=e.readBits(10))>=1e3)throw new Error("Invalid numeric value above 999");var i=Math.floor(u/100),s=Math.floor(u/10)%10,c=u%10;t.push(48+i,48+s,48+c),n+=i.toString()+s.toString()+c.toString(),o-=3}if(2===o){if((u=e.readBits(7))>=100)throw new Error("Invalid numeric value above 99");i=Math.floor(u/10),s=u%10,t.push(48+i,48+s),n+=i.toString()+s.toString()}else if(1===o){var u;if((u=e.readBits(4))>=10)throw new Error("Invalid numeric value above 9");t.push(48+u),n+=u.toString()}return{bytes:t,text:n}}!function(e){e.Numeric="numeric",e.Alphanumeric="alphanumeric",e.Byte="byte",e.Kanji="kanji",e.ECI="eci"}(n=r.Mode||(r.Mode={})),function(e){e[e.Terminator=0]="Terminator",e[e.Numeric=1]="Numeric",e[e.Alphanumeric=2]="Alphanumeric",e[e.Byte=4]="Byte",e[e.Kanji=8]="Kanji",e[e.ECI=7]="ECI"}(a||(a={}));var c=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function u(e,r){for(var t=[],n="",a=[9,11,13][r],o=e.readBits(a);o>=2;){var i=e.readBits(11),s=Math.floor(i/45),u=i%45;t.push(c[s].charCodeAt(0),c[u].charCodeAt(0)),n+=c[s]+c[u],o-=2}return 1===o&&(s=e.readBits(6),t.push(c[s].charCodeAt(0)),n+=c[s]),{bytes:t,text:n}}function l(e,r){for(var t=[],n="",a=[8,16,16][r],o=e.readBits(a),i=0;i<o;i++){var s=e.readBits(8);t.push(s)}try{n+=decodeURIComponent(t.map((function(e){return"%"+("0"+e.toString(16)).substr(-2)})).join(""))}catch(e){}return{bytes:t,text:n}}function d(e,r){for(var t=[],n="",a=[8,10,12][r],o=e.readBits(a),s=0;s<o;s++){var c=e.readBits(13),u=Math.floor(c/192)<<8|c%192;u+=u<7936?33088:49472,t.push(u>>8,255&u),n+=String.fromCharCode(i.shiftJISTable[u])}return{bytes:t,text:n}}r.decode=function(e,r){for(var t,i,c,f,p=new o.BitStream(e),h=r<=9?0:r<=26?1:2,m={text:"",bytes:[],chunks:[],version:r};p.available()>=4;){var g=p.readBits(4);if(g===a.Terminator)return m;if(g===a.ECI)0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(7)}):0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(14)}):0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(21)}):m.chunks.push({type:n.ECI,assignmentNumber:-1});else if(g===a.Numeric){var v=s(p,h);m.text+=v.text,(t=m.bytes).push.apply(t,v.bytes),m.chunks.push({type:n.Numeric,text:v.text})}else if(g===a.Alphanumeric){var y=u(p,h);m.text+=y.text,(i=m.bytes).push.apply(i,y.bytes),m.chunks.push({type:n.Alphanumeric,text:y.text})}else if(g===a.Byte){var b=l(p,h);m.text+=b.text,(c=m.bytes).push.apply(c,b.bytes),m.chunks.push({type:n.Byte,bytes:b.bytes,text:b.text})}else if(g===a.Kanji){var C=d(p,h);m.text+=C.text,(f=m.bytes).push.apply(f,C.bytes),m.chunks.push({type:n.Kanji,bytes:C.bytes,text:C.text})}}if(0===p.available()||0===p.readBits(p.available()))return m}},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e){this.byteOffset=0,this.bitOffset=0,this.bytes=e}return e.prototype.readBits=function(e){if(e<1||e>32||e>this.available())throw new Error("Cannot read "+e.toString()+" bits");var r=0;if(this.bitOffset>0){var t=8-this.bitOffset,n=e<t?e:t,a=255>>8-n<<(o=t-n);r=(this.bytes[this.byteOffset]&a)>>o,e-=n,this.bitOffset+=n,8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(e>0){for(;e>=8;)r=r<<8|255&this.bytes[this.byteOffset],this.byteOffset++,e-=8;var o;if(e>0)a=255>>(o=8-e)<<o,r=r<<e|(this.bytes[this.byteOffset]&a)>>o,this.bitOffset+=e}return r},e.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},e}();r.BitStream=n},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.shiftJISTable={32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:165,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:8254,33088:12288,33089:12289,33090:12290,33091:65292,33092:65294,33093:12539,33094:65306,33095:65307,33096:65311,33097:65281,33098:12443,33099:12444,33100:180,33101:65344,33102:168,33103:65342,33104:65507,33105:65343,33106:12541,33107:12542,33108:12445,33109:12446,33110:12291,33111:20189,33112:12293,33113:12294,33114:12295,33115:12540,33116:8213,33117:8208,33118:65295,33119:92,33120:12316,33121:8214,33122:65372,33123:8230,33124:8229,33125:8216,33126:8217,33127:8220,33128:8221,33129:65288,33130:65289,33131:12308,33132:12309,33133:65339,33134:65341,33135:65371,33136:65373,33137:12296,33138:12297,33139:12298,33140:12299,33141:12300,33142:12301,33143:12302,33144:12303,33145:12304,33146:12305,33147:65291,33148:8722,33149:177,33150:215,33152:247,33153:65309,33154:8800,33155:65308,33156:65310,33157:8806,33158:8807,33159:8734,33160:8756,33161:9794,33162:9792,33163:176,33164:8242,33165:8243,33166:8451,33167:65509,33168:65284,33169:162,33170:163,33171:65285,33172:65283,33173:65286,33174:65290,33175:65312,33176:167,33177:9734,33178:9733,33179:9675,33180:9679,33181:9678,33182:9671,33183:9670,33184:9633,33185:9632,33186:9651,33187:9650,33188:9661,33189:9660,33190:8251,33191:12306,33192:8594,33193:8592,33194:8593,33195:8595,33196:12307,33208:8712,33209:8715,33210:8838,33211:8839,33212:8834,33213:8835,33214:8746,33215:8745,33224:8743,33225:8744,33226:172,33227:8658,33228:8660,33229:8704,33230:8707,33242:8736,33243:8869,33244:8978,33245:8706,33246:8711,33247:8801,33248:8786,33249:8810,33250:8811,33251:8730,33252:8765,33253:8733,33254:8757,33255:8747,33256:8748,33264:8491,33265:8240,33266:9839,33267:9837,33268:9834,33269:8224,33270:8225,33271:182,33276:9711,33359:65296,33360:65297,33361:65298,33362:65299,33363:65300,33364:65301,33365:65302,33366:65303,33367:65304,33368:65305,33376:65313,33377:65314,33378:65315,33379:65316,33380:65317,33381:65318,33382:65319,33383:65320,33384:65321,33385:65322,33386:65323,33387:65324,33388:65325,33389:65326,33390:65327,33391:65328,33392:65329,33393:65330,33394:65331,33395:65332,33396:65333,33397:65334,33398:65335,33399:65336,33400:65337,33401:65338,33409:65345,33410:65346,33411:65347,33412:65348,33413:65349,33414:65350,33415:65351,33416:65352,33417:65353,33418:65354,33419:65355,33420:65356,33421:65357,33422:65358,33423:65359,33424:65360,33425:65361,33426:65362,33427:65363,33428:65364,33429:65365,33430:65366,33431:65367,33432:65368,33433:65369,33434:65370,33439:12353,33440:12354,33441:12355,33442:12356,33443:12357,33444:12358,33445:12359,33446:12360,33447:12361,33448:12362,33449:12363,33450:12364,33451:12365,33452:12366,33453:12367,33454:12368,33455:12369,33456:12370,33457:12371,33458:12372,33459:12373,33460:12374,33461:12375,33462:12376,33463:12377,33464:12378,33465:12379,33466:12380,33467:12381,33468:12382,33469:12383,33470:12384,33471:12385,33472:12386,33473:12387,33474:12388,33475:12389,33476:12390,33477:12391,33478:12392,33479:12393,33480:12394,33481:12395,33482:12396,33483:12397,33484:12398,33485:12399,33486:12400,33487:12401,33488:12402,33489:12403,33490:12404,33491:12405,33492:12406,33493:12407,33494:12408,33495:12409,33496:12410,33497:12411,33498:12412,33499:12413,33500:12414,33501:12415,33502:12416,33503:12417,33504:12418,33505:12419,33506:12420,33507:12421,33508:12422,33509:12423,33510:12424,33511:12425,33512:12426,33513:12427,33514:12428,33515:12429,33516:12430,33517:12431,33518:12432,33519:12433,33520:12434,33521:12435,33600:12449,33601:12450,33602:12451,33603:12452,33604:12453,33605:12454,33606:12455,33607:12456,33608:12457,33609:12458,33610:12459,33611:12460,33612:12461,33613:12462,33614:12463,33615:12464,33616:12465,33617:12466,33618:12467,33619:12468,33620:12469,33621:12470,33622:12471,33623:12472,33624:12473,33625:12474,33626:12475,33627:12476,33628:12477,33629:12478,33630:12479,33631:12480,33632:12481,33633:12482,33634:12483,33635:12484,33636:12485,33637:12486,33638:12487,33639:12488,33640:12489,33641:12490,33642:12491,33643:12492,33644:12493,33645:12494,33646:12495,33647:12496,33648:12497,33649:12498,33650:12499,33651:12500,33652:12501,33653:12502,33654:12503,33655:12504,33656:12505,33657:12506,33658:12507,33659:12508,33660:12509,33661:12510,33662:12511,33664:12512,33665:12513,33666:12514,33667:12515,33668:12516,33669:12517,33670:12518,33671:12519,33672:12520,33673:12521,33674:12522,33675:12523,33676:12524,33677:12525,33678:12526,33679:12527,33680:12528,33681:12529,33682:12530,33683:12531,33684:12532,33685:12533,33686:12534,33695:913,33696:914,33697:915,33698:916,33699:917,33700:918,33701:919,33702:920,33703:921,33704:922,33705:923,33706:924,33707:925,33708:926,33709:927,33710:928,33711:929,33712:931,33713:932,33714:933,33715:934,33716:935,33717:936,33718:937,33727:945,33728:946,33729:947,33730:948,33731:949,33732:950,33733:951,33734:952,33735:953,33736:954,33737:955,33738:956,33739:957,33740:958,33741:959,33742:960,33743:961,33744:963,33745:964,33746:965,33747:966,33748:967,33749:968,33750:969,33856:1040,33857:1041,33858:1042,33859:1043,33860:1044,33861:1045,33862:1025,33863:1046,33864:1047,33865:1048,33866:1049,33867:1050,33868:1051,33869:1052,33870:1053,33871:1054,33872:1055,33873:1056,33874:1057,33875:1058,33876:1059,33877:1060,33878:1061,33879:1062,33880:1063,33881:1064,33882:1065,33883:1066,33884:1067,33885:1068,33886:1069,33887:1070,33888:1071,33904:1072,33905:1073,33906:1074,33907:1075,33908:1076,33909:1077,33910:1105,33911:1078,33912:1079,33913:1080,33914:1081,33915:1082,33916:1083,33917:1084,33918:1085,33920:1086,33921:1087,33922:1088,33923:1089,33924:1090,33925:1091,33926:1092,33927:1093,33928:1094,33929:1095,33930:1096,33931:1097,33932:1098,33933:1099,33934:1100,33935:1101,33936:1102,33937:1103,33951:9472,33952:9474,33953:9484,33954:9488,33955:9496,33956:9492,33957:9500,33958:9516,33959:9508,33960:9524,33961:9532,33962:9473,33963:9475,33964:9487,33965:9491,33966:9499,33967:9495,33968:9507,33969:9523,33970:9515,33971:9531,33972:9547,33973:9504,33974:9519,33975:9512,33976:9527,33977:9535,33978:9501,33979:9520,33980:9509,33981:9528,33982:9538,34975:20124,34976:21782,34977:23043,34978:38463,34979:21696,34980:24859,34981:25384,34982:23030,34983:36898,34984:33909,34985:33564,34986:31312,34987:24746,34988:25569,34989:28197,34990:26093,34991:33894,34992:33446,34993:39925,34994:26771,34995:22311,34996:26017,34997:25201,34998:23451,34999:22992,35e3:34427,35001:39156,35002:32098,35003:32190,35004:39822,35005:25110,35006:31903,35007:34999,35008:23433,35009:24245,35010:25353,35011:26263,35012:26696,35013:38343,35014:38797,35015:26447,35016:20197,35017:20234,35018:20301,35019:20381,35020:20553,35021:22258,35022:22839,35023:22996,35024:23041,35025:23561,35026:24799,35027:24847,35028:24944,35029:26131,35030:26885,35031:28858,35032:30031,35033:30064,35034:31227,35035:32173,35036:32239,35037:32963,35038:33806,35039:34915,35040:35586,35041:36949,35042:36986,35043:21307,35044:20117,35045:20133,35046:22495,35047:32946,35048:37057,35049:30959,35050:19968,35051:22769,35052:28322,35053:36920,35054:31282,35055:33576,35056:33419,35057:39983,35058:20801,35059:21360,35060:21693,35061:21729,35062:22240,35063:23035,35064:24341,35065:39154,35066:28139,35067:32996,35068:34093,35136:38498,35137:38512,35138:38560,35139:38907,35140:21515,35141:21491,35142:23431,35143:28879,35144:32701,35145:36802,35146:38632,35147:21359,35148:40284,35149:31418,35150:19985,35151:30867,35152:33276,35153:28198,35154:22040,35155:21764,35156:27421,35157:34074,35158:39995,35159:23013,35160:21417,35161:28006,35162:29916,35163:38287,35164:22082,35165:20113,35166:36939,35167:38642,35168:33615,35169:39180,35170:21473,35171:21942,35172:23344,35173:24433,35174:26144,35175:26355,35176:26628,35177:27704,35178:27891,35179:27945,35180:29787,35181:30408,35182:31310,35183:38964,35184:33521,35185:34907,35186:35424,35187:37613,35188:28082,35189:30123,35190:30410,35191:39365,35192:24742,35193:35585,35194:36234,35195:38322,35196:27022,35197:21421,35198:20870,35200:22290,35201:22576,35202:22852,35203:23476,35204:24310,35205:24616,35206:25513,35207:25588,35208:27839,35209:28436,35210:28814,35211:28948,35212:29017,35213:29141,35214:29503,35215:32257,35216:33398,35217:33489,35218:34199,35219:36960,35220:37467,35221:40219,35222:22633,35223:26044,35224:27738,35225:29989,35226:20985,35227:22830,35228:22885,35229:24448,35230:24540,35231:25276,35232:26106,35233:27178,35234:27431,35235:27572,35236:29579,35237:32705,35238:35158,35239:40236,35240:40206,35241:40644,35242:23713,35243:27798,35244:33659,35245:20740,35246:23627,35247:25014,35248:33222,35249:26742,35250:29281,35251:20057,35252:20474,35253:21368,35254:24681,35255:28201,35256:31311,35257:38899,35258:19979,35259:21270,35260:20206,35261:20309,35262:20285,35263:20385,35264:20339,35265:21152,35266:21487,35267:22025,35268:22799,35269:23233,35270:23478,35271:23521,35272:31185,35273:26247,35274:26524,35275:26550,35276:27468,35277:27827,35278:28779,35279:29634,35280:31117,35281:31166,35282:31292,35283:31623,35284:33457,35285:33499,35286:33540,35287:33655,35288:33775,35289:33747,35290:34662,35291:35506,35292:22057,35293:36008,35294:36838,35295:36942,35296:38686,35297:34442,35298:20420,35299:23784,35300:25105,35301:29273,35302:30011,35303:33253,35304:33469,35305:34558,35306:36032,35307:38597,35308:39187,35309:39381,35310:20171,35311:20250,35312:35299,35313:22238,35314:22602,35315:22730,35316:24315,35317:24555,35318:24618,35319:24724,35320:24674,35321:25040,35322:25106,35323:25296,35324:25913,35392:39745,35393:26214,35394:26800,35395:28023,35396:28784,35397:30028,35398:30342,35399:32117,35400:33445,35401:34809,35402:38283,35403:38542,35404:35997,35405:20977,35406:21182,35407:22806,35408:21683,35409:23475,35410:23830,35411:24936,35412:27010,35413:28079,35414:30861,35415:33995,35416:34903,35417:35442,35418:37799,35419:39608,35420:28012,35421:39336,35422:34521,35423:22435,35424:26623,35425:34510,35426:37390,35427:21123,35428:22151,35429:21508,35430:24275,35431:25313,35432:25785,35433:26684,35434:26680,35435:27579,35436:29554,35437:30906,35438:31339,35439:35226,35440:35282,35441:36203,35442:36611,35443:37101,35444:38307,35445:38548,35446:38761,35447:23398,35448:23731,35449:27005,35450:38989,35451:38990,35452:25499,35453:31520,35454:27179,35456:27263,35457:26806,35458:39949,35459:28511,35460:21106,35461:21917,35462:24688,35463:25324,35464:27963,35465:28167,35466:28369,35467:33883,35468:35088,35469:36676,35470:19988,35471:39993,35472:21494,35473:26907,35474:27194,35475:38788,35476:26666,35477:20828,35478:31427,35479:33970,35480:37340,35481:37772,35482:22107,35483:40232,35484:26658,35485:33541,35486:33841,35487:31909,35488:21e3,35489:33477,35490:29926,35491:20094,35492:20355,35493:20896,35494:23506,35495:21002,35496:21208,35497:21223,35498:24059,35499:21914,35500:22570,35501:23014,35502:23436,35503:23448,35504:23515,35505:24178,35506:24185,35507:24739,35508:24863,35509:24931,35510:25022,35511:25563,35512:25954,35513:26577,35514:26707,35515:26874,35516:27454,35517:27475,35518:27735,35519:28450,35520:28567,35521:28485,35522:29872,35523:29976,35524:30435,35525:30475,35526:31487,35527:31649,35528:31777,35529:32233,35530:32566,35531:32752,35532:32925,35533:33382,35534:33694,35535:35251,35536:35532,35537:36011,35538:36996,35539:37969,35540:38291,35541:38289,35542:38306,35543:38501,35544:38867,35545:39208,35546:33304,35547:20024,35548:21547,35549:23736,35550:24012,35551:29609,35552:30284,35553:30524,35554:23721,35555:32747,35556:36107,35557:38593,35558:38929,35559:38996,35560:39e3,35561:20225,35562:20238,35563:21361,35564:21916,35565:22120,35566:22522,35567:22855,35568:23305,35569:23492,35570:23696,35571:24076,35572:24190,35573:24524,35574:25582,35575:26426,35576:26071,35577:26082,35578:26399,35579:26827,35580:26820,35648:27231,35649:24112,35650:27589,35651:27671,35652:27773,35653:30079,35654:31048,35655:23395,35656:31232,35657:32e3,35658:24509,35659:35215,35660:35352,35661:36020,35662:36215,35663:36556,35664:36637,35665:39138,35666:39438,35667:39740,35668:20096,35669:20605,35670:20736,35671:22931,35672:23452,35673:25135,35674:25216,35675:25836,35676:27450,35677:29344,35678:30097,35679:31047,35680:32681,35681:34811,35682:35516,35683:35696,35684:25516,35685:33738,35686:38816,35687:21513,35688:21507,35689:21931,35690:26708,35691:27224,35692:35440,35693:30759,35694:26485,35695:40653,35696:21364,35697:23458,35698:33050,35699:34384,35700:36870,35701:19992,35702:20037,35703:20167,35704:20241,35705:21450,35706:21560,35707:23470,35708:24339,35709:24613,35710:25937,35712:26429,35713:27714,35714:27762,35715:27875,35716:28792,35717:29699,35718:31350,35719:31406,35720:31496,35721:32026,35722:31998,35723:32102,35724:26087,35725:29275,35726:21435,35727:23621,35728:24040,35729:25298,35730:25312,35731:25369,35732:28192,35733:34394,35734:35377,35735:36317,35736:37624,35737:28417,35738:31142,35739:39770,35740:20136,35741:20139,35742:20140,35743:20379,35744:20384,35745:20689,35746:20807,35747:31478,35748:20849,35749:20982,35750:21332,35751:21281,35752:21375,35753:21483,35754:21932,35755:22659,35756:23777,35757:24375,35758:24394,35759:24623,35760:24656,35761:24685,35762:25375,35763:25945,35764:27211,35765:27841,35766:29378,35767:29421,35768:30703,35769:33016,35770:33029,35771:33288,35772:34126,35773:37111,35774:37857,35775:38911,35776:39255,35777:39514,35778:20208,35779:20957,35780:23597,35781:26241,35782:26989,35783:23616,35784:26354,35785:26997,35786:29577,35787:26704,35788:31873,35789:20677,35790:21220,35791:22343,35792:24062,35793:37670,35794:26020,35795:27427,35796:27453,35797:29748,35798:31105,35799:31165,35800:31563,35801:32202,35802:33465,35803:33740,35804:34943,35805:35167,35806:35641,35807:36817,35808:37329,35809:21535,35810:37504,35811:20061,35812:20534,35813:21477,35814:21306,35815:29399,35816:29590,35817:30697,35818:33510,35819:36527,35820:39366,35821:39368,35822:39378,35823:20855,35824:24858,35825:34398,35826:21936,35827:31354,35828:20598,35829:23507,35830:36935,35831:38533,35832:20018,35833:27355,35834:37351,35835:23633,35836:23624,35904:25496,35905:31391,35906:27795,35907:38772,35908:36705,35909:31402,35910:29066,35911:38536,35912:31874,35913:26647,35914:32368,35915:26705,35916:37740,35917:21234,35918:21531,35919:34219,35920:35347,35921:32676,35922:36557,35923:37089,35924:21350,35925:34952,35926:31041,35927:20418,35928:20670,35929:21009,35930:20804,35931:21843,35932:22317,35933:29674,35934:22411,35935:22865,35936:24418,35937:24452,35938:24693,35939:24950,35940:24935,35941:25001,35942:25522,35943:25658,35944:25964,35945:26223,35946:26690,35947:28179,35948:30054,35949:31293,35950:31995,35951:32076,35952:32153,35953:32331,35954:32619,35955:33550,35956:33610,35957:34509,35958:35336,35959:35427,35960:35686,35961:36605,35962:38938,35963:40335,35964:33464,35965:36814,35966:39912,35968:21127,35969:25119,35970:25731,35971:28608,35972:38553,35973:26689,35974:20625,35975:27424,35976:27770,35977:28500,35978:31348,35979:32080,35980:34880,35981:35363,35982:26376,35983:20214,35984:20537,35985:20518,35986:20581,35987:20860,35988:21048,35989:21091,35990:21927,35991:22287,35992:22533,35993:23244,35994:24314,35995:25010,35996:25080,35997:25331,35998:25458,35999:26908,36e3:27177,36001:29309,36002:29356,36003:29486,36004:30740,36005:30831,36006:32121,36007:30476,36008:32937,36009:35211,36010:35609,36011:36066,36012:36562,36013:36963,36014:37749,36015:38522,36016:38997,36017:39443,36018:40568,36019:20803,36020:21407,36021:21427,36022:24187,36023:24358,36024:28187,36025:28304,36026:29572,36027:29694,36028:32067,36029:33335,36030:35328,36031:35578,36032:38480,36033:20046,36034:20491,36035:21476,36036:21628,36037:22266,36038:22993,36039:23396,36040:24049,36041:24235,36042:24359,36043:25144,36044:25925,36045:26543,36046:28246,36047:29392,36048:31946,36049:34996,36050:32929,36051:32993,36052:33776,36053:34382,36054:35463,36055:36328,36056:37431,36057:38599,36058:39015,36059:40723,36060:20116,36061:20114,36062:20237,36063:21320,36064:21577,36065:21566,36066:23087,36067:24460,36068:24481,36069:24735,36070:26791,36071:27278,36072:29786,36073:30849,36074:35486,36075:35492,36076:35703,36077:37264,36078:20062,36079:39881,36080:20132,36081:20348,36082:20399,36083:20505,36084:20502,36085:20809,36086:20844,36087:21151,36088:21177,36089:21246,36090:21402,36091:21475,36092:21521,36160:21518,36161:21897,36162:22353,36163:22434,36164:22909,36165:23380,36166:23389,36167:23439,36168:24037,36169:24039,36170:24055,36171:24184,36172:24195,36173:24218,36174:24247,36175:24344,36176:24658,36177:24908,36178:25239,36179:25304,36180:25511,36181:25915,36182:26114,36183:26179,36184:26356,36185:26477,36186:26657,36187:26775,36188:27083,36189:27743,36190:27946,36191:28009,36192:28207,36193:28317,36194:30002,36195:30343,36196:30828,36197:31295,36198:31968,36199:32005,36200:32024,36201:32094,36202:32177,36203:32789,36204:32771,36205:32943,36206:32945,36207:33108,36208:33167,36209:33322,36210:33618,36211:34892,36212:34913,36213:35611,36214:36002,36215:36092,36216:37066,36217:37237,36218:37489,36219:30783,36220:37628,36221:38308,36222:38477,36224:38917,36225:39321,36226:39640,36227:40251,36228:21083,36229:21163,36230:21495,36231:21512,36232:22741,36233:25335,36234:28640,36235:35946,36236:36703,36237:40633,36238:20811,36239:21051,36240:21578,36241:22269,36242:31296,36243:37239,36244:40288,36245:40658,36246:29508,36247:28425,36248:33136,36249:29969,36250:24573,36251:24794,36252:39592,36253:29403,36254:36796,36255:27492,36256:38915,36257:20170,36258:22256,36259:22372,36260:22718,36261:23130,36262:24680,36263:25031,36264:26127,36265:26118,36266:26681,36267:26801,36268:28151,36269:30165,36270:32058,36271:33390,36272:39746,36273:20123,36274:20304,36275:21449,36276:21766,36277:23919,36278:24038,36279:24046,36280:26619,36281:27801,36282:29811,36283:30722,36284:35408,36285:37782,36286:35039,36287:22352,36288:24231,36289:25387,36290:20661,36291:20652,36292:20877,36293:26368,36294:21705,36295:22622,36296:22971,36297:23472,36298:24425,36299:25165,36300:25505,36301:26685,36302:27507,36303:28168,36304:28797,36305:37319,36306:29312,36307:30741,36308:30758,36309:31085,36310:25998,36311:32048,36312:33756,36313:35009,36314:36617,36315:38555,36316:21092,36317:22312,36318:26448,36319:32618,36320:36001,36321:20916,36322:22338,36323:38442,36324:22586,36325:27018,36326:32948,36327:21682,36328:23822,36329:22524,36330:30869,36331:40442,36332:20316,36333:21066,36334:21643,36335:25662,36336:26152,36337:26388,36338:26613,36339:31364,36340:31574,36341:32034,36342:37679,36343:26716,36344:39853,36345:31545,36346:21273,36347:20874,36348:21047,36416:23519,36417:25334,36418:25774,36419:25830,36420:26413,36421:27578,36422:34217,36423:38609,36424:30352,36425:39894,36426:25420,36427:37638,36428:39851,36429:30399,36430:26194,36431:19977,36432:20632,36433:21442,36434:23665,36435:24808,36436:25746,36437:25955,36438:26719,36439:29158,36440:29642,36441:29987,36442:31639,36443:32386,36444:34453,36445:35715,36446:36059,36447:37240,36448:39184,36449:26028,36450:26283,36451:27531,36452:20181,36453:20180,36454:20282,36455:20351,36456:21050,36457:21496,36458:21490,36459:21987,36460:22235,36461:22763,36462:22987,36463:22985,36464:23039,36465:23376,36466:23629,36467:24066,36468:24107,36469:24535,36470:24605,36471:25351,36472:25903,36473:23388,36474:26031,36475:26045,36476:26088,36477:26525,36478:27490,36480:27515,36481:27663,36482:29509,36483:31049,36484:31169,36485:31992,36486:32025,36487:32043,36488:32930,36489:33026,36490:33267,36491:35222,36492:35422,36493:35433,36494:35430,36495:35468,36496:35566,36497:36039,36498:36060,36499:38604,36500:39164,36501:27503,36502:20107,36503:20284,36504:20365,36505:20816,36506:23383,36507:23546,36508:24904,36509:25345,36510:26178,36511:27425,36512:28363,36513:27835,36514:29246,36515:29885,36516:30164,36517:30913,36518:31034,36519:32780,36520:32819,36521:33258,36522:33940,36523:36766,36524:27728,36525:40575,36526:24335,36527:35672,36528:40235,36529:31482,36530:36600,36531:23437,36532:38635,36533:19971,36534:21489,36535:22519,36536:22833,36537:23241,36538:23460,36539:24713,36540:28287,36541:28422,36542:30142,36543:36074,36544:23455,36545:34048,36546:31712,36547:20594,36548:26612,36549:33437,36550:23649,36551:34122,36552:32286,36553:33294,36554:20889,36555:23556,36556:25448,36557:36198,36558:26012,36559:29038,36560:31038,36561:32023,36562:32773,36563:35613,36564:36554,36565:36974,36566:34503,36567:37034,36568:20511,36569:21242,36570:23610,36571:26451,36572:28796,36573:29237,36574:37196,36575:37320,36576:37675,36577:33509,36578:23490,36579:24369,36580:24825,36581:20027,36582:21462,36583:23432,36584:25163,36585:26417,36586:27530,36587:29417,36588:29664,36589:31278,36590:33131,36591:36259,36592:37202,36593:39318,36594:20754,36595:21463,36596:21610,36597:23551,36598:25480,36599:27193,36600:32172,36601:38656,36602:22234,36603:21454,36604:21608,36672:23447,36673:23601,36674:24030,36675:20462,36676:24833,36677:25342,36678:27954,36679:31168,36680:31179,36681:32066,36682:32333,36683:32722,36684:33261,36685:33311,36686:33936,36687:34886,36688:35186,36689:35728,36690:36468,36691:36655,36692:36913,36693:37195,36694:37228,36695:38598,36696:37276,36697:20160,36698:20303,36699:20805,36700:21313,36701:24467,36702:25102,36703:26580,36704:27713,36705:28171,36706:29539,36707:32294,36708:37325,36709:37507,36710:21460,36711:22809,36712:23487,36713:28113,36714:31069,36715:32302,36716:31899,36717:22654,36718:29087,36719:20986,36720:34899,36721:36848,36722:20426,36723:23803,36724:26149,36725:30636,36726:31459,36727:33308,36728:39423,36729:20934,36730:24490,36731:26092,36732:26991,36733:27529,36734:28147,36736:28310,36737:28516,36738:30462,36739:32020,36740:24033,36741:36981,36742:37255,36743:38918,36744:20966,36745:21021,36746:25152,36747:26257,36748:26329,36749:28186,36750:24246,36751:32210,36752:32626,36753:26360,36754:34223,36755:34295,36756:35576,36757:21161,36758:21465,36759:22899,36760:24207,36761:24464,36762:24661,36763:37604,36764:38500,36765:20663,36766:20767,36767:21213,36768:21280,36769:21319,36770:21484,36771:21736,36772:21830,36773:21809,36774:22039,36775:22888,36776:22974,36777:23100,36778:23477,36779:23558,36780:23567,36781:23569,36782:23578,36783:24196,36784:24202,36785:24288,36786:24432,36787:25215,36788:25220,36789:25307,36790:25484,36791:25463,36792:26119,36793:26124,36794:26157,36795:26230,36796:26494,36797:26786,36798:27167,36799:27189,36800:27836,36801:28040,36802:28169,36803:28248,36804:28988,36805:28966,36806:29031,36807:30151,36808:30465,36809:30813,36810:30977,36811:31077,36812:31216,36813:31456,36814:31505,36815:31911,36816:32057,36817:32918,36818:33750,36819:33931,36820:34121,36821:34909,36822:35059,36823:35359,36824:35388,36825:35412,36826:35443,36827:35937,36828:36062,36829:37284,36830:37478,36831:37758,36832:37912,36833:38556,36834:38808,36835:19978,36836:19976,36837:19998,36838:20055,36839:20887,36840:21104,36841:22478,36842:22580,36843:22732,36844:23330,36845:24120,36846:24773,36847:25854,36848:26465,36849:26454,36850:27972,36851:29366,36852:30067,36853:31331,36854:33976,36855:35698,36856:37304,36857:37664,36858:22065,36859:22516,36860:39166,36928:25325,36929:26893,36930:27542,36931:29165,36932:32340,36933:32887,36934:33394,36935:35302,36936:39135,36937:34645,36938:36785,36939:23611,36940:20280,36941:20449,36942:20405,36943:21767,36944:23072,36945:23517,36946:23529,36947:24515,36948:24910,36949:25391,36950:26032,36951:26187,36952:26862,36953:27035,36954:28024,36955:28145,36956:30003,36957:30137,36958:30495,36959:31070,36960:31206,36961:32051,36962:33251,36963:33455,36964:34218,36965:35242,36966:35386,36967:36523,36968:36763,36969:36914,36970:37341,36971:38663,36972:20154,36973:20161,36974:20995,36975:22645,36976:22764,36977:23563,36978:29978,36979:23613,36980:33102,36981:35338,36982:36805,36983:38499,36984:38765,36985:31525,36986:35535,36987:38920,36988:37218,36989:22259,36990:21416,36992:36887,36993:21561,36994:22402,36995:24101,36996:25512,36997:27700,36998:28810,36999:30561,37e3:31883,37001:32736,37002:34928,37003:36930,37004:37204,37005:37648,37006:37656,37007:38543,37008:29790,37009:39620,37010:23815,37011:23913,37012:25968,37013:26530,37014:36264,37015:38619,37016:25454,37017:26441,37018:26905,37019:33733,37020:38935,37021:38592,37022:35070,37023:28548,37024:25722,37025:23544,37026:19990,37027:28716,37028:30045,37029:26159,37030:20932,37031:21046,37032:21218,37033:22995,37034:24449,37035:24615,37036:25104,37037:25919,37038:25972,37039:26143,37040:26228,37041:26866,37042:26646,37043:27491,37044:28165,37045:29298,37046:29983,37047:30427,37048:31934,37049:32854,37050:22768,37051:35069,37052:35199,37053:35488,37054:35475,37055:35531,37056:36893,37057:37266,37058:38738,37059:38745,37060:25993,37061:31246,37062:33030,37063:38587,37064:24109,37065:24796,37066:25114,37067:26021,37068:26132,37069:26512,37070:30707,37071:31309,37072:31821,37073:32318,37074:33034,37075:36012,37076:36196,37077:36321,37078:36447,37079:30889,37080:20999,37081:25305,37082:25509,37083:25666,37084:25240,37085:35373,37086:31363,37087:31680,37088:35500,37089:38634,37090:32118,37091:33292,37092:34633,37093:20185,37094:20808,37095:21315,37096:21344,37097:23459,37098:23554,37099:23574,37100:24029,37101:25126,37102:25159,37103:25776,37104:26643,37105:26676,37106:27849,37107:27973,37108:27927,37109:26579,37110:28508,37111:29006,37112:29053,37113:26059,37114:31359,37115:31661,37116:32218,37184:32330,37185:32680,37186:33146,37187:33307,37188:33337,37189:34214,37190:35438,37191:36046,37192:36341,37193:36984,37194:36983,37195:37549,37196:37521,37197:38275,37198:39854,37199:21069,37200:21892,37201:28472,37202:28982,37203:20840,37204:31109,37205:32341,37206:33203,37207:31950,37208:22092,37209:22609,37210:23720,37211:25514,37212:26366,37213:26365,37214:26970,37215:29401,37216:30095,37217:30094,37218:30990,37219:31062,37220:31199,37221:31895,37222:32032,37223:32068,37224:34311,37225:35380,37226:38459,37227:36961,37228:40736,37229:20711,37230:21109,37231:21452,37232:21474,37233:20489,37234:21930,37235:22766,37236:22863,37237:29245,37238:23435,37239:23652,37240:21277,37241:24803,37242:24819,37243:25436,37244:25475,37245:25407,37246:25531,37248:25805,37249:26089,37250:26361,37251:24035,37252:27085,37253:27133,37254:28437,37255:29157,37256:20105,37257:30185,37258:30456,37259:31379,37260:31967,37261:32207,37262:32156,37263:32865,37264:33609,37265:33624,37266:33900,37267:33980,37268:34299,37269:35013,37270:36208,37271:36865,37272:36973,37273:37783,37274:38684,37275:39442,37276:20687,37277:22679,37278:24974,37279:33235,37280:34101,37281:36104,37282:36896,37283:20419,37284:20596,37285:21063,37286:21363,37287:24687,37288:25417,37289:26463,37290:28204,37291:36275,37292:36895,37293:20439,37294:23646,37295:36042,37296:26063,37297:32154,37298:21330,37299:34966,37300:20854,37301:25539,37302:23384,37303:23403,37304:23562,37305:25613,37306:26449,37307:36956,37308:20182,37309:22810,37310:22826,37311:27760,37312:35409,37313:21822,37314:22549,37315:22949,37316:24816,37317:25171,37318:26561,37319:33333,37320:26965,37321:38464,37322:39364,37323:39464,37324:20307,37325:22534,37326:23550,37327:32784,37328:23729,37329:24111,37330:24453,37331:24608,37332:24907,37333:25140,37334:26367,37335:27888,37336:28382,37337:32974,37338:33151,37339:33492,37340:34955,37341:36024,37342:36864,37343:36910,37344:38538,37345:40667,37346:39899,37347:20195,37348:21488,37349:22823,37350:31532,37351:37261,37352:38988,37353:40441,37354:28381,37355:28711,37356:21331,37357:21828,37358:23429,37359:25176,37360:25246,37361:25299,37362:27810,37363:28655,37364:29730,37365:35351,37366:37944,37367:28609,37368:35582,37369:33592,37370:20967,37371:34552,37372:21482,37440:21481,37441:20294,37442:36948,37443:36784,37444:22890,37445:33073,37446:24061,37447:31466,37448:36799,37449:26842,37450:35895,37451:29432,37452:40008,37453:27197,37454:35504,37455:20025,37456:21336,37457:22022,37458:22374,37459:25285,37460:25506,37461:26086,37462:27470,37463:28129,37464:28251,37465:28845,37466:30701,37467:31471,37468:31658,37469:32187,37470:32829,37471:32966,37472:34507,37473:35477,37474:37723,37475:22243,37476:22727,37477:24382,37478:26029,37479:26262,37480:27264,37481:27573,37482:30007,37483:35527,37484:20516,37485:30693,37486:22320,37487:24347,37488:24677,37489:26234,37490:27744,37491:30196,37492:31258,37493:32622,37494:33268,37495:34584,37496:36933,37497:39347,37498:31689,37499:30044,37500:31481,37501:31569,37502:33988,37504:36880,37505:31209,37506:31378,37507:33590,37508:23265,37509:30528,37510:20013,37511:20210,37512:23449,37513:24544,37514:25277,37515:26172,37516:26609,37517:27880,37518:34411,37519:34935,37520:35387,37521:37198,37522:37619,37523:39376,37524:27159,37525:28710,37526:29482,37527:33511,37528:33879,37529:36015,37530:19969,37531:20806,37532:20939,37533:21899,37534:23541,37535:24086,37536:24115,37537:24193,37538:24340,37539:24373,37540:24427,37541:24500,37542:25074,37543:25361,37544:26274,37545:26397,37546:28526,37547:29266,37548:30010,37549:30522,37550:32884,37551:33081,37552:33144,37553:34678,37554:35519,37555:35548,37556:36229,37557:36339,37558:37530,37559:38263,37560:38914,37561:40165,37562:21189,37563:25431,37564:30452,37565:26389,37566:27784,37567:29645,37568:36035,37569:37806,37570:38515,37571:27941,37572:22684,37573:26894,37574:27084,37575:36861,37576:37786,37577:30171,37578:36890,37579:22618,37580:26626,37581:25524,37582:27131,37583:20291,37584:28460,37585:26584,37586:36795,37587:34086,37588:32180,37589:37716,37590:26943,37591:28528,37592:22378,37593:22775,37594:23340,37595:32044,37596:29226,37597:21514,37598:37347,37599:40372,37600:20141,37601:20302,37602:20572,37603:20597,37604:21059,37605:35998,37606:21576,37607:22564,37608:23450,37609:24093,37610:24213,37611:24237,37612:24311,37613:24351,37614:24716,37615:25269,37616:25402,37617:25552,37618:26799,37619:27712,37620:30855,37621:31118,37622:31243,37623:32224,37624:33351,37625:35330,37626:35558,37627:36420,37628:36883,37696:37048,37697:37165,37698:37336,37699:40718,37700:27877,37701:25688,37702:25826,37703:25973,37704:28404,37705:30340,37706:31515,37707:36969,37708:37841,37709:28346,37710:21746,37711:24505,37712:25764,37713:36685,37714:36845,37715:37444,37716:20856,37717:22635,37718:22825,37719:23637,37720:24215,37721:28155,37722:32399,37723:29980,37724:36028,37725:36578,37726:39003,37727:28857,37728:20253,37729:27583,37730:28593,37731:3e4,37732:38651,37733:20814,37734:21520,37735:22581,37736:22615,37737:22956,37738:23648,37739:24466,37740:26007,37741:26460,37742:28193,37743:30331,37744:33759,37745:36077,37746:36884,37747:37117,37748:37709,37749:30757,37750:30778,37751:21162,37752:24230,37753:22303,37754:22900,37755:24594,37756:20498,37757:20826,37758:20908,37760:20941,37761:20992,37762:21776,37763:22612,37764:22616,37765:22871,37766:23445,37767:23798,37768:23947,37769:24764,37770:25237,37771:25645,37772:26481,37773:26691,37774:26812,37775:26847,37776:30423,37777:28120,37778:28271,37779:28059,37780:28783,37781:29128,37782:24403,37783:30168,37784:31095,37785:31561,37786:31572,37787:31570,37788:31958,37789:32113,37790:21040,37791:33891,37792:34153,37793:34276,37794:35342,37795:35588,37796:35910,37797:36367,37798:36867,37799:36879,37800:37913,37801:38518,37802:38957,37803:39472,37804:38360,37805:20685,37806:21205,37807:21516,37808:22530,37809:23566,37810:24999,37811:25758,37812:27934,37813:30643,37814:31461,37815:33012,37816:33796,37817:36947,37818:37509,37819:23776,37820:40199,37821:21311,37822:24471,37823:24499,37824:28060,37825:29305,37826:30563,37827:31167,37828:31716,37829:27602,37830:29420,37831:35501,37832:26627,37833:27233,37834:20984,37835:31361,37836:26932,37837:23626,37838:40182,37839:33515,37840:23493,37841:37193,37842:28702,37843:22136,37844:23663,37845:24775,37846:25958,37847:27788,37848:35930,37849:36929,37850:38931,37851:21585,37852:26311,37853:37389,37854:22856,37855:37027,37856:20869,37857:20045,37858:20970,37859:34201,37860:35598,37861:28760,37862:25466,37863:37707,37864:26978,37865:39348,37866:32260,37867:30071,37868:21335,37869:26976,37870:36575,37871:38627,37872:27741,37873:20108,37874:23612,37875:24336,37876:36841,37877:21250,37878:36049,37879:32905,37880:34425,37881:24319,37882:26085,37883:20083,37884:20837,37952:22914,37953:23615,37954:38894,37955:20219,37956:22922,37957:24525,37958:35469,37959:28641,37960:31152,37961:31074,37962:23527,37963:33905,37964:29483,37965:29105,37966:24180,37967:24565,37968:25467,37969:25754,37970:29123,37971:31896,37972:20035,37973:24316,37974:20043,37975:22492,37976:22178,37977:24745,37978:28611,37979:32013,37980:33021,37981:33075,37982:33215,37983:36786,37984:35223,37985:34468,37986:24052,37987:25226,37988:25773,37989:35207,37990:26487,37991:27874,37992:27966,37993:29750,37994:30772,37995:23110,37996:32629,37997:33453,37998:39340,37999:20467,38e3:24259,38001:25309,38002:25490,38003:25943,38004:26479,38005:30403,38006:29260,38007:32972,38008:32954,38009:36649,38010:37197,38011:20493,38012:22521,38013:23186,38014:26757,38016:26995,38017:29028,38018:29437,38019:36023,38020:22770,38021:36064,38022:38506,38023:36889,38024:34687,38025:31204,38026:30695,38027:33833,38028:20271,38029:21093,38030:21338,38031:25293,38032:26575,38033:27850,38034:30333,38035:31636,38036:31893,38037:33334,38038:34180,38039:36843,38040:26333,38041:28448,38042:29190,38043:32283,38044:33707,38045:39361,38046:40614,38047:20989,38048:31665,38049:30834,38050:31672,38051:32903,38052:31560,38053:27368,38054:24161,38055:32908,38056:30033,38057:30048,38058:20843,38059:37474,38060:28300,38061:30330,38062:37271,38063:39658,38064:20240,38065:32624,38066:25244,38067:31567,38068:38309,38069:40169,38070:22138,38071:22617,38072:34532,38073:38588,38074:20276,38075:21028,38076:21322,38077:21453,38078:21467,38079:24070,38080:25644,38081:26001,38082:26495,38083:27710,38084:27726,38085:29256,38086:29359,38087:29677,38088:30036,38089:32321,38090:33324,38091:34281,38092:36009,38093:31684,38094:37318,38095:29033,38096:38930,38097:39151,38098:25405,38099:26217,38100:30058,38101:30436,38102:30928,38103:34115,38104:34542,38105:21290,38106:21329,38107:21542,38108:22915,38109:24199,38110:24444,38111:24754,38112:25161,38113:25209,38114:25259,38115:26e3,38116:27604,38117:27852,38118:30130,38119:30382,38120:30865,38121:31192,38122:32203,38123:32631,38124:32933,38125:34987,38126:35513,38127:36027,38128:36991,38129:38750,38130:39131,38131:27147,38132:31800,38133:20633,38134:23614,38135:24494,38136:26503,38137:27608,38138:29749,38139:30473,38140:32654,38208:40763,38209:26570,38210:31255,38211:21305,38212:30091,38213:39661,38214:24422,38215:33181,38216:33777,38217:32920,38218:24380,38219:24517,38220:30050,38221:31558,38222:36924,38223:26727,38224:23019,38225:23195,38226:32016,38227:30334,38228:35628,38229:20469,38230:24426,38231:27161,38232:27703,38233:28418,38234:29922,38235:31080,38236:34920,38237:35413,38238:35961,38239:24287,38240:25551,38241:30149,38242:31186,38243:33495,38244:37672,38245:37618,38246:33948,38247:34541,38248:39981,38249:21697,38250:24428,38251:25996,38252:27996,38253:28693,38254:36007,38255:36051,38256:38971,38257:25935,38258:29942,38259:19981,38260:20184,38261:22496,38262:22827,38263:23142,38264:23500,38265:20904,38266:24067,38267:24220,38268:24598,38269:25206,38270:25975,38272:26023,38273:26222,38274:28014,38275:29238,38276:31526,38277:33104,38278:33178,38279:33433,38280:35676,38281:36e3,38282:36070,38283:36212,38284:38428,38285:38468,38286:20398,38287:25771,38288:27494,38289:33310,38290:33889,38291:34154,38292:37096,38293:23553,38294:26963,38295:39080,38296:33914,38297:34135,38298:20239,38299:21103,38300:24489,38301:24133,38302:26381,38303:31119,38304:33145,38305:35079,38306:35206,38307:28149,38308:24343,38309:25173,38310:27832,38311:20175,38312:29289,38313:39826,38314:20998,38315:21563,38316:22132,38317:22707,38318:24996,38319:25198,38320:28954,38321:22894,38322:31881,38323:31966,38324:32027,38325:38640,38326:25991,38327:32862,38328:19993,38329:20341,38330:20853,38331:22592,38332:24163,38333:24179,38334:24330,38335:26564,38336:20006,38337:34109,38338:38281,38339:38491,38340:31859,38341:38913,38342:20731,38343:22721,38344:30294,38345:30887,38346:21029,38347:30629,38348:34065,38349:31622,38350:20559,38351:22793,38352:29255,38353:31687,38354:32232,38355:36794,38356:36820,38357:36941,38358:20415,38359:21193,38360:23081,38361:24321,38362:38829,38363:20445,38364:33303,38365:37610,38366:22275,38367:25429,38368:27497,38369:29995,38370:35036,38371:36628,38372:31298,38373:21215,38374:22675,38375:24917,38376:25098,38377:26286,38378:27597,38379:31807,38380:33769,38381:20515,38382:20472,38383:21253,38384:21574,38385:22577,38386:22857,38387:23453,38388:23792,38389:23791,38390:23849,38391:24214,38392:25265,38393:25447,38394:25918,38395:26041,38396:26379,38464:27861,38465:27873,38466:28921,38467:30770,38468:32299,38469:32990,38470:33459,38471:33804,38472:34028,38473:34562,38474:35090,38475:35370,38476:35914,38477:37030,38478:37586,38479:39165,38480:40179,38481:40300,38482:20047,38483:20129,38484:20621,38485:21078,38486:22346,38487:22952,38488:24125,38489:24536,38490:24537,38491:25151,38492:26292,38493:26395,38494:26576,38495:26834,38496:20882,38497:32033,38498:32938,38499:33192,38500:35584,38501:35980,38502:36031,38503:37502,38504:38450,38505:21536,38506:38956,38507:21271,38508:20693,38509:21340,38510:22696,38511:25778,38512:26420,38513:29287,38514:30566,38515:31302,38516:37350,38517:21187,38518:27809,38519:27526,38520:22528,38521:24140,38522:22868,38523:26412,38524:32763,38525:20961,38526:30406,38528:25705,38529:30952,38530:39764,38531:40635,38532:22475,38533:22969,38534:26151,38535:26522,38536:27598,38537:21737,38538:27097,38539:24149,38540:33180,38541:26517,38542:39850,38543:26622,38544:40018,38545:26717,38546:20134,38547:20451,38548:21448,38549:25273,38550:26411,38551:27819,38552:36804,38553:20397,38554:32365,38555:40639,38556:19975,38557:24930,38558:28288,38559:28459,38560:34067,38561:21619,38562:26410,38563:39749,38564:24051,38565:31637,38566:23724,38567:23494,38568:34588,38569:28234,38570:34001,38571:31252,38572:33032,38573:22937,38574:31885,38575:27665,38576:30496,38577:21209,38578:22818,38579:28961,38580:29279,38581:30683,38582:38695,38583:40289,38584:26891,38585:23167,38586:23064,38587:20901,38588:21517,38589:21629,38590:26126,38591:30431,38592:36855,38593:37528,38594:40180,38595:23018,38596:29277,38597:28357,38598:20813,38599:26825,38600:32191,38601:32236,38602:38754,38603:40634,38604:25720,38605:27169,38606:33538,38607:22916,38608:23391,38609:27611,38610:29467,38611:30450,38612:32178,38613:32791,38614:33945,38615:20786,38616:26408,38617:40665,38618:30446,38619:26466,38620:21247,38621:39173,38622:23588,38623:25147,38624:31870,38625:36016,38626:21839,38627:24758,38628:32011,38629:38272,38630:21249,38631:20063,38632:20918,38633:22812,38634:29242,38635:32822,38636:37326,38637:24357,38638:30690,38639:21380,38640:24441,38641:32004,38642:34220,38643:35379,38644:36493,38645:38742,38646:26611,38647:34222,38648:37971,38649:24841,38650:24840,38651:27833,38652:30290,38720:35565,38721:36664,38722:21807,38723:20305,38724:20778,38725:21191,38726:21451,38727:23461,38728:24189,38729:24736,38730:24962,38731:25558,38732:26377,38733:26586,38734:28263,38735:28044,38736:29494,38737:29495,38738:30001,38739:31056,38740:35029,38741:35480,38742:36938,38743:37009,38744:37109,38745:38596,38746:34701,38747:22805,38748:20104,38749:20313,38750:19982,38751:35465,38752:36671,38753:38928,38754:20653,38755:24188,38756:22934,38757:23481,38758:24248,38759:25562,38760:25594,38761:25793,38762:26332,38763:26954,38764:27096,38765:27915,38766:28342,38767:29076,38768:29992,38769:31407,38770:32650,38771:32768,38772:33865,38773:33993,38774:35201,38775:35617,38776:36362,38777:36965,38778:38525,38779:39178,38780:24958,38781:25233,38782:27442,38784:27779,38785:28020,38786:32716,38787:32764,38788:28096,38789:32645,38790:34746,38791:35064,38792:26469,38793:33713,38794:38972,38795:38647,38796:27931,38797:32097,38798:33853,38799:37226,38800:20081,38801:21365,38802:23888,38803:27396,38804:28651,38805:34253,38806:34349,38807:35239,38808:21033,38809:21519,38810:23653,38811:26446,38812:26792,38813:29702,38814:29827,38815:30178,38816:35023,38817:35041,38818:37324,38819:38626,38820:38520,38821:24459,38822:29575,38823:31435,38824:33870,38825:25504,38826:30053,38827:21129,38828:27969,38829:28316,38830:29705,38831:30041,38832:30827,38833:31890,38834:38534,38835:31452,38836:40845,38837:20406,38838:24942,38839:26053,38840:34396,38841:20102,38842:20142,38843:20698,38844:20001,38845:20940,38846:23534,38847:26009,38848:26753,38849:28092,38850:29471,38851:30274,38852:30637,38853:31260,38854:31975,38855:33391,38856:35538,38857:36988,38858:37327,38859:38517,38860:38936,38861:21147,38862:32209,38863:20523,38864:21400,38865:26519,38866:28107,38867:29136,38868:29747,38869:33256,38870:36650,38871:38563,38872:40023,38873:40607,38874:29792,38875:22593,38876:28057,38877:32047,38878:39006,38879:20196,38880:20278,38881:20363,38882:20919,38883:21169,38884:23994,38885:24604,38886:29618,38887:31036,38888:33491,38889:37428,38890:38583,38891:38646,38892:38666,38893:40599,38894:40802,38895:26278,38896:27508,38897:21015,38898:21155,38899:28872,38900:35010,38901:24265,38902:24651,38903:24976,38904:28451,38905:29001,38906:31806,38907:32244,38908:32879,38976:34030,38977:36899,38978:37676,38979:21570,38980:39791,38981:27347,38982:28809,38983:36034,38984:36335,38985:38706,38986:21172,38987:23105,38988:24266,38989:24324,38990:26391,38991:27004,38992:27028,38993:28010,38994:28431,38995:29282,38996:29436,38997:31725,38998:32769,38999:32894,39e3:34635,39001:37070,39002:20845,39003:40595,39004:31108,39005:32907,39006:37682,39007:35542,39008:20525,39009:21644,39010:35441,39011:27498,39012:36036,39013:33031,39014:24785,39015:26528,39016:40434,39017:20121,39018:20120,39019:39952,39020:35435,39021:34241,39022:34152,39023:26880,39024:28286,39025:30871,39026:33109,39071:24332,39072:19984,39073:19989,39074:20010,39075:20017,39076:20022,39077:20028,39078:20031,39079:20034,39080:20054,39081:20056,39082:20098,39083:20101,39084:35947,39085:20106,39086:33298,39087:24333,39088:20110,39089:20126,39090:20127,39091:20128,39092:20130,39093:20144,39094:20147,39095:20150,39096:20174,39097:20173,39098:20164,39099:20166,39100:20162,39101:20183,39102:20190,39103:20205,39104:20191,39105:20215,39106:20233,39107:20314,39108:20272,39109:20315,39110:20317,39111:20311,39112:20295,39113:20342,39114:20360,39115:20367,39116:20376,39117:20347,39118:20329,39119:20336,39120:20369,39121:20335,39122:20358,39123:20374,39124:20760,39125:20436,39126:20447,39127:20430,39128:20440,39129:20443,39130:20433,39131:20442,39132:20432,39133:20452,39134:20453,39135:20506,39136:20520,39137:20500,39138:20522,39139:20517,39140:20485,39141:20252,39142:20470,39143:20513,39144:20521,39145:20524,39146:20478,39147:20463,39148:20497,39149:20486,39150:20547,39151:20551,39152:26371,39153:20565,39154:20560,39155:20552,39156:20570,39157:20566,39158:20588,39159:20600,39160:20608,39161:20634,39162:20613,39163:20660,39164:20658,39232:20681,39233:20682,39234:20659,39235:20674,39236:20694,39237:20702,39238:20709,39239:20717,39240:20707,39241:20718,39242:20729,39243:20725,39244:20745,39245:20737,39246:20738,39247:20758,39248:20757,39249:20756,39250:20762,39251:20769,39252:20794,39253:20791,39254:20796,39255:20795,39256:20799,39257:20800,39258:20818,39259:20812,39260:20820,39261:20834,39262:31480,39263:20841,39264:20842,39265:20846,39266:20864,39267:20866,39268:22232,39269:20876,39270:20873,39271:20879,39272:20881,39273:20883,39274:20885,39275:20886,39276:20900,39277:20902,39278:20898,39279:20905,39280:20906,39281:20907,39282:20915,39283:20913,39284:20914,39285:20912,39286:20917,39287:20925,39288:20933,39289:20937,39290:20955,39291:20960,39292:34389,39293:20969,39294:20973,39296:20976,39297:20981,39298:20990,39299:20996,39300:21003,39301:21012,39302:21006,39303:21031,39304:21034,39305:21038,39306:21043,39307:21049,39308:21071,39309:21060,39310:21067,39311:21068,39312:21086,39313:21076,39314:21098,39315:21108,39316:21097,39317:21107,39318:21119,39319:21117,39320:21133,39321:21140,39322:21138,39323:21105,39324:21128,39325:21137,39326:36776,39327:36775,39328:21164,39329:21165,39330:21180,39331:21173,39332:21185,39333:21197,39334:21207,39335:21214,39336:21219,39337:21222,39338:39149,39339:21216,39340:21235,39341:21237,39342:21240,39343:21241,39344:21254,39345:21256,39346:30008,39347:21261,39348:21264,39349:21263,39350:21269,39351:21274,39352:21283,39353:21295,39354:21297,39355:21299,39356:21304,39357:21312,39358:21318,39359:21317,39360:19991,39361:21321,39362:21325,39363:20950,39364:21342,39365:21353,39366:21358,39367:22808,39368:21371,39369:21367,39370:21378,39371:21398,39372:21408,39373:21414,39374:21413,39375:21422,39376:21424,39377:21430,39378:21443,39379:31762,39380:38617,39381:21471,39382:26364,39383:29166,39384:21486,39385:21480,39386:21485,39387:21498,39388:21505,39389:21565,39390:21568,39391:21548,39392:21549,39393:21564,39394:21550,39395:21558,39396:21545,39397:21533,39398:21582,39399:21647,39400:21621,39401:21646,39402:21599,39403:21617,39404:21623,39405:21616,39406:21650,39407:21627,39408:21632,39409:21622,39410:21636,39411:21648,39412:21638,39413:21703,39414:21666,39415:21688,39416:21669,39417:21676,39418:21700,39419:21704,39420:21672,39488:21675,39489:21698,39490:21668,39491:21694,39492:21692,39493:21720,39494:21733,39495:21734,39496:21775,39497:21780,39498:21757,39499:21742,39500:21741,39501:21754,39502:21730,39503:21817,39504:21824,39505:21859,39506:21836,39507:21806,39508:21852,39509:21829,39510:21846,39511:21847,39512:21816,39513:21811,39514:21853,39515:21913,39516:21888,39517:21679,39518:21898,39519:21919,39520:21883,39521:21886,39522:21912,39523:21918,39524:21934,39525:21884,39526:21891,39527:21929,39528:21895,39529:21928,39530:21978,39531:21957,39532:21983,39533:21956,39534:21980,39535:21988,39536:21972,39537:22036,39538:22007,39539:22038,39540:22014,39541:22013,39542:22043,39543:22009,39544:22094,39545:22096,39546:29151,39547:22068,39548:22070,39549:22066,39550:22072,39552:22123,39553:22116,39554:22063,39555:22124,39556:22122,39557:22150,39558:22144,39559:22154,39560:22176,39561:22164,39562:22159,39563:22181,39564:22190,39565:22198,39566:22196,39567:22210,39568:22204,39569:22209,39570:22211,39571:22208,39572:22216,39573:22222,39574:22225,39575:22227,39576:22231,39577:22254,39578:22265,39579:22272,39580:22271,39581:22276,39582:22281,39583:22280,39584:22283,39585:22285,39586:22291,39587:22296,39588:22294,39589:21959,39590:22300,39591:22310,39592:22327,39593:22328,39594:22350,39595:22331,39596:22336,39597:22351,39598:22377,39599:22464,39600:22408,39601:22369,39602:22399,39603:22409,39604:22419,39605:22432,39606:22451,39607:22436,39608:22442,39609:22448,39610:22467,39611:22470,39612:22484,39613:22482,39614:22483,39615:22538,39616:22486,39617:22499,39618:22539,39619:22553,39620:22557,39621:22642,39622:22561,39623:22626,39624:22603,39625:22640,39626:27584,39627:22610,39628:22589,39629:22649,39630:22661,39631:22713,39632:22687,39633:22699,39634:22714,39635:22750,39636:22715,39637:22712,39638:22702,39639:22725,39640:22739,39641:22737,39642:22743,39643:22745,39644:22744,39645:22757,39646:22748,39647:22756,39648:22751,39649:22767,39650:22778,39651:22777,39652:22779,39653:22780,39654:22781,39655:22786,39656:22794,39657:22800,39658:22811,39659:26790,39660:22821,39661:22828,39662:22829,39663:22834,39664:22840,39665:22846,39666:31442,39667:22869,39668:22864,39669:22862,39670:22874,39671:22872,39672:22882,39673:22880,39674:22887,39675:22892,39676:22889,39744:22904,39745:22913,39746:22941,39747:20318,39748:20395,39749:22947,39750:22962,39751:22982,39752:23016,39753:23004,39754:22925,39755:23001,39756:23002,39757:23077,39758:23071,39759:23057,39760:23068,39761:23049,39762:23066,39763:23104,39764:23148,39765:23113,39766:23093,39767:23094,39768:23138,39769:23146,39770:23194,39771:23228,39772:23230,39773:23243,39774:23234,39775:23229,39776:23267,39777:23255,39778:23270,39779:23273,39780:23254,39781:23290,39782:23291,39783:23308,39784:23307,39785:23318,39786:23346,39787:23248,39788:23338,39789:23350,39790:23358,39791:23363,39792:23365,39793:23360,39794:23377,39795:23381,39796:23386,39797:23387,39798:23397,39799:23401,39800:23408,39801:23411,39802:23413,39803:23416,39804:25992,39805:23418,39806:23424,39808:23427,39809:23462,39810:23480,39811:23491,39812:23495,39813:23497,39814:23508,39815:23504,39816:23524,39817:23526,39818:23522,39819:23518,39820:23525,39821:23531,39822:23536,39823:23542,39824:23539,39825:23557,39826:23559,39827:23560,39828:23565,39829:23571,39830:23584,39831:23586,39832:23592,39833:23608,39834:23609,39835:23617,39836:23622,39837:23630,39838:23635,39839:23632,39840:23631,39841:23409,39842:23660,39843:23662,39844:20066,39845:23670,39846:23673,39847:23692,39848:23697,39849:23700,39850:22939,39851:23723,39852:23739,39853:23734,39854:23740,39855:23735,39856:23749,39857:23742,39858:23751,39859:23769,39860:23785,39861:23805,39862:23802,39863:23789,39864:23948,39865:23786,39866:23819,39867:23829,39868:23831,39869:23900,39870:23839,39871:23835,39872:23825,39873:23828,39874:23842,39875:23834,39876:23833,39877:23832,39878:23884,39879:23890,39880:23886,39881:23883,39882:23916,39883:23923,39884:23926,39885:23943,39886:23940,39887:23938,39888:23970,39889:23965,39890:23980,39891:23982,39892:23997,39893:23952,39894:23991,39895:23996,39896:24009,39897:24013,39898:24019,39899:24018,39900:24022,39901:24027,39902:24043,39903:24050,39904:24053,39905:24075,39906:24090,39907:24089,39908:24081,39909:24091,39910:24118,39911:24119,39912:24132,39913:24131,39914:24128,39915:24142,39916:24151,39917:24148,39918:24159,39919:24162,39920:24164,39921:24135,39922:24181,39923:24182,39924:24186,39925:40636,39926:24191,39927:24224,39928:24257,39929:24258,39930:24264,39931:24272,39932:24271,4e4:24278,40001:24291,40002:24285,40003:24282,40004:24283,40005:24290,40006:24289,40007:24296,40008:24297,40009:24300,40010:24305,40011:24307,40012:24304,40013:24308,40014:24312,40015:24318,40016:24323,40017:24329,40018:24413,40019:24412,40020:24331,40021:24337,40022:24342,40023:24361,40024:24365,40025:24376,40026:24385,40027:24392,40028:24396,40029:24398,40030:24367,40031:24401,40032:24406,40033:24407,40034:24409,40035:24417,40036:24429,40037:24435,40038:24439,40039:24451,40040:24450,40041:24447,40042:24458,40043:24456,40044:24465,40045:24455,40046:24478,40047:24473,40048:24472,40049:24480,40050:24488,40051:24493,40052:24508,40053:24534,40054:24571,40055:24548,40056:24568,40057:24561,40058:24541,40059:24755,40060:24575,40061:24609,40062:24672,40064:24601,40065:24592,40066:24617,40067:24590,40068:24625,40069:24603,40070:24597,40071:24619,40072:24614,40073:24591,40074:24634,40075:24666,40076:24641,40077:24682,40078:24695,40079:24671,40080:24650,40081:24646,40082:24653,40083:24675,40084:24643,40085:24676,40086:24642,40087:24684,40088:24683,40089:24665,40090:24705,40091:24717,40092:24807,40093:24707,40094:24730,40095:24708,40096:24731,40097:24726,40098:24727,40099:24722,40100:24743,40101:24715,40102:24801,40103:24760,40104:24800,40105:24787,40106:24756,40107:24560,40108:24765,40109:24774,40110:24757,40111:24792,40112:24909,40113:24853,40114:24838,40115:24822,40116:24823,40117:24832,40118:24820,40119:24826,40120:24835,40121:24865,40122:24827,40123:24817,40124:24845,40125:24846,40126:24903,40127:24894,40128:24872,40129:24871,40130:24906,40131:24895,40132:24892,40133:24876,40134:24884,40135:24893,40136:24898,40137:24900,40138:24947,40139:24951,40140:24920,40141:24921,40142:24922,40143:24939,40144:24948,40145:24943,40146:24933,40147:24945,40148:24927,40149:24925,40150:24915,40151:24949,40152:24985,40153:24982,40154:24967,40155:25004,40156:24980,40157:24986,40158:24970,40159:24977,40160:25003,40161:25006,40162:25036,40163:25034,40164:25033,40165:25079,40166:25032,40167:25027,40168:25030,40169:25018,40170:25035,40171:32633,40172:25037,40173:25062,40174:25059,40175:25078,40176:25082,40177:25076,40178:25087,40179:25085,40180:25084,40181:25086,40182:25088,40183:25096,40184:25097,40185:25101,40186:25100,40187:25108,40188:25115,40256:25118,40257:25121,40258:25130,40259:25134,40260:25136,40261:25138,40262:25139,40263:25153,40264:25166,40265:25182,40266:25187,40267:25179,40268:25184,40269:25192,40270:25212,40271:25218,40272:25225,40273:25214,40274:25234,40275:25235,40276:25238,40277:25300,40278:25219,40279:25236,40280:25303,40281:25297,40282:25275,40283:25295,40284:25343,40285:25286,40286:25812,40287:25288,40288:25308,40289:25292,40290:25290,40291:25282,40292:25287,40293:25243,40294:25289,40295:25356,40296:25326,40297:25329,40298:25383,40299:25346,40300:25352,40301:25327,40302:25333,40303:25424,40304:25406,40305:25421,40306:25628,40307:25423,40308:25494,40309:25486,40310:25472,40311:25515,40312:25462,40313:25507,40314:25487,40315:25481,40316:25503,40317:25525,40318:25451,40320:25449,40321:25534,40322:25577,40323:25536,40324:25542,40325:25571,40326:25545,40327:25554,40328:25590,40329:25540,40330:25622,40331:25652,40332:25606,40333:25619,40334:25638,40335:25654,40336:25885,40337:25623,40338:25640,40339:25615,40340:25703,40341:25711,40342:25718,40343:25678,40344:25898,40345:25749,40346:25747,40347:25765,40348:25769,40349:25736,40350:25788,40351:25818,40352:25810,40353:25797,40354:25799,40355:25787,40356:25816,40357:25794,40358:25841,40359:25831,40360:33289,40361:25824,40362:25825,40363:25260,40364:25827,40365:25839,40366:25900,40367:25846,40368:25844,40369:25842,40370:25850,40371:25856,40372:25853,40373:25880,40374:25884,40375:25861,40376:25892,40377:25891,40378:25899,40379:25908,40380:25909,40381:25911,40382:25910,40383:25912,40384:30027,40385:25928,40386:25942,40387:25941,40388:25933,40389:25944,40390:25950,40391:25949,40392:25970,40393:25976,40394:25986,40395:25987,40396:35722,40397:26011,40398:26015,40399:26027,40400:26039,40401:26051,40402:26054,40403:26049,40404:26052,40405:26060,40406:26066,40407:26075,40408:26073,40409:26080,40410:26081,40411:26097,40412:26482,40413:26122,40414:26115,40415:26107,40416:26483,40417:26165,40418:26166,40419:26164,40420:26140,40421:26191,40422:26180,40423:26185,40424:26177,40425:26206,40426:26205,40427:26212,40428:26215,40429:26216,40430:26207,40431:26210,40432:26224,40433:26243,40434:26248,40435:26254,40436:26249,40437:26244,40438:26264,40439:26269,40440:26305,40441:26297,40442:26313,40443:26302,40444:26300,40512:26308,40513:26296,40514:26326,40515:26330,40516:26336,40517:26175,40518:26342,40519:26345,40520:26352,40521:26357,40522:26359,40523:26383,40524:26390,40525:26398,40526:26406,40527:26407,40528:38712,40529:26414,40530:26431,40531:26422,40532:26433,40533:26424,40534:26423,40535:26438,40536:26462,40537:26464,40538:26457,40539:26467,40540:26468,40541:26505,40542:26480,40543:26537,40544:26492,40545:26474,40546:26508,40547:26507,40548:26534,40549:26529,40550:26501,40551:26551,40552:26607,40553:26548,40554:26604,40555:26547,40556:26601,40557:26552,40558:26596,40559:26590,40560:26589,40561:26594,40562:26606,40563:26553,40564:26574,40565:26566,40566:26599,40567:27292,40568:26654,40569:26694,40570:26665,40571:26688,40572:26701,40573:26674,40574:26702,40576:26803,40577:26667,40578:26713,40579:26723,40580:26743,40581:26751,40582:26783,40583:26767,40584:26797,40585:26772,40586:26781,40587:26779,40588:26755,40589:27310,40590:26809,40591:26740,40592:26805,40593:26784,40594:26810,40595:26895,40596:26765,40597:26750,40598:26881,40599:26826,40600:26888,40601:26840,40602:26914,40603:26918,40604:26849,40605:26892,40606:26829,40607:26836,40608:26855,40609:26837,40610:26934,40611:26898,40612:26884,40613:26839,40614:26851,40615:26917,40616:26873,40617:26848,40618:26863,40619:26920,40620:26922,40621:26906,40622:26915,40623:26913,40624:26822,40625:27001,40626:26999,40627:26972,40628:27e3,40629:26987,40630:26964,40631:27006,40632:26990,40633:26937,40634:26996,40635:26941,40636:26969,40637:26928,40638:26977,40639:26974,40640:26973,40641:27009,40642:26986,40643:27058,40644:27054,40645:27088,40646:27071,40647:27073,40648:27091,40649:27070,40650:27086,40651:23528,40652:27082,40653:27101,40654:27067,40655:27075,40656:27047,40657:27182,40658:27025,40659:27040,40660:27036,40661:27029,40662:27060,40663:27102,40664:27112,40665:27138,40666:27163,40667:27135,40668:27402,40669:27129,40670:27122,40671:27111,40672:27141,40673:27057,40674:27166,40675:27117,40676:27156,40677:27115,40678:27146,40679:27154,40680:27329,40681:27171,40682:27155,40683:27204,40684:27148,40685:27250,40686:27190,40687:27256,40688:27207,40689:27234,40690:27225,40691:27238,40692:27208,40693:27192,40694:27170,40695:27280,40696:27277,40697:27296,40698:27268,40699:27298,40700:27299,40768:27287,40769:34327,40770:27323,40771:27331,40772:27330,40773:27320,40774:27315,40775:27308,40776:27358,40777:27345,40778:27359,40779:27306,40780:27354,40781:27370,40782:27387,40783:27397,40784:34326,40785:27386,40786:27410,40787:27414,40788:39729,40789:27423,40790:27448,40791:27447,40792:30428,40793:27449,40794:39150,40795:27463,40796:27459,40797:27465,40798:27472,40799:27481,40800:27476,40801:27483,40802:27487,40803:27489,40804:27512,40805:27513,40806:27519,40807:27520,40808:27524,40809:27523,40810:27533,40811:27544,40812:27541,40813:27550,40814:27556,40815:27562,40816:27563,40817:27567,40818:27570,40819:27569,40820:27571,40821:27575,40822:27580,40823:27590,40824:27595,40825:27603,40826:27615,40827:27628,40828:27627,40829:27635,40830:27631,40832:40638,40833:27656,40834:27667,40835:27668,40836:27675,40837:27684,40838:27683,40839:27742,40840:27733,40841:27746,40842:27754,40843:27778,40844:27789,40845:27802,40846:27777,40847:27803,40848:27774,40849:27752,40850:27763,40851:27794,40852:27792,40853:27844,40854:27889,40855:27859,40856:27837,40857:27863,40858:27845,40859:27869,40860:27822,40861:27825,40862:27838,40863:27834,40864:27867,40865:27887,40866:27865,40867:27882,40868:27935,40869:34893,40870:27958,40871:27947,40872:27965,40873:27960,40874:27929,40875:27957,40876:27955,40877:27922,40878:27916,40879:28003,40880:28051,40881:28004,40882:27994,40883:28025,40884:27993,40885:28046,40886:28053,40887:28644,40888:28037,40889:28153,40890:28181,40891:28170,40892:28085,40893:28103,40894:28134,40895:28088,40896:28102,40897:28140,40898:28126,40899:28108,40900:28136,40901:28114,40902:28101,40903:28154,40904:28121,40905:28132,40906:28117,40907:28138,40908:28142,40909:28205,40910:28270,40911:28206,40912:28185,40913:28274,40914:28255,40915:28222,40916:28195,40917:28267,40918:28203,40919:28278,40920:28237,40921:28191,40922:28227,40923:28218,40924:28238,40925:28196,40926:28415,40927:28189,40928:28216,40929:28290,40930:28330,40931:28312,40932:28361,40933:28343,40934:28371,40935:28349,40936:28335,40937:28356,40938:28338,40939:28372,40940:28373,40941:28303,40942:28325,40943:28354,40944:28319,40945:28481,40946:28433,40947:28748,40948:28396,40949:28408,40950:28414,40951:28479,40952:28402,40953:28465,40954:28399,40955:28466,40956:28364,161:65377,162:65378,163:65379,164:65380,165:65381,166:65382,167:65383,168:65384,169:65385,170:65386,171:65387,172:65388,173:65389,174:65390,175:65391,176:65392,177:65393,178:65394,179:65395,180:65396,181:65397,182:65398,183:65399,184:65400,185:65401,186:65402,187:65403,188:65404,189:65405,190:65406,191:65407,192:65408,193:65409,194:65410,195:65411,196:65412,197:65413,198:65414,199:65415,200:65416,201:65417,202:65418,203:65419,204:65420,205:65421,206:65422,207:65423,208:65424,209:65425,210:65426,211:65427,212:65428,213:65429,214:65430,215:65431,216:65432,217:65433,218:65434,219:65435,220:65436,221:65437,222:65438,223:65439,57408:28478,57409:28435,57410:28407,57411:28550,57412:28538,57413:28536,57414:28545,57415:28544,57416:28527,57417:28507,57418:28659,57419:28525,57420:28546,57421:28540,57422:28504,57423:28558,57424:28561,57425:28610,57426:28518,57427:28595,57428:28579,57429:28577,57430:28580,57431:28601,57432:28614,57433:28586,57434:28639,57435:28629,57436:28652,57437:28628,57438:28632,57439:28657,57440:28654,57441:28635,57442:28681,57443:28683,57444:28666,57445:28689,57446:28673,57447:28687,57448:28670,57449:28699,57450:28698,57451:28532,57452:28701,57453:28696,57454:28703,57455:28720,57456:28734,57457:28722,57458:28753,57459:28771,57460:28825,57461:28818,57462:28847,57463:28913,57464:28844,57465:28856,57466:28851,57467:28846,57468:28895,57469:28875,57470:28893,57472:28889,57473:28937,57474:28925,57475:28956,57476:28953,57477:29029,57478:29013,57479:29064,57480:29030,57481:29026,57482:29004,57483:29014,57484:29036,57485:29071,57486:29179,57487:29060,57488:29077,57489:29096,57490:29100,57491:29143,57492:29113,57493:29118,57494:29138,57495:29129,57496:29140,57497:29134,57498:29152,57499:29164,57500:29159,57501:29173,57502:29180,57503:29177,57504:29183,57505:29197,57506:29200,57507:29211,57508:29224,57509:29229,57510:29228,57511:29232,57512:29234,57513:29243,57514:29244,57515:29247,57516:29248,57517:29254,57518:29259,57519:29272,57520:29300,57521:29310,57522:29314,57523:29313,57524:29319,57525:29330,57526:29334,57527:29346,57528:29351,57529:29369,57530:29362,57531:29379,57532:29382,57533:29380,57534:29390,57535:29394,57536:29410,57537:29408,57538:29409,57539:29433,57540:29431,57541:20495,57542:29463,57543:29450,57544:29468,57545:29462,57546:29469,57547:29492,57548:29487,57549:29481,57550:29477,57551:29502,57552:29518,57553:29519,57554:40664,57555:29527,57556:29546,57557:29544,57558:29552,57559:29560,57560:29557,57561:29563,57562:29562,57563:29640,57564:29619,57565:29646,57566:29627,57567:29632,57568:29669,57569:29678,57570:29662,57571:29858,57572:29701,57573:29807,57574:29733,57575:29688,57576:29746,57577:29754,57578:29781,57579:29759,57580:29791,57581:29785,57582:29761,57583:29788,57584:29801,57585:29808,57586:29795,57587:29802,57588:29814,57589:29822,57590:29835,57591:29854,57592:29863,57593:29898,57594:29903,57595:29908,57596:29681,57664:29920,57665:29923,57666:29927,57667:29929,57668:29934,57669:29938,57670:29936,57671:29937,57672:29944,57673:29943,57674:29956,57675:29955,57676:29957,57677:29964,57678:29966,57679:29965,57680:29973,57681:29971,57682:29982,57683:29990,57684:29996,57685:30012,57686:30020,57687:30029,57688:30026,57689:30025,57690:30043,57691:30022,57692:30042,57693:30057,57694:30052,57695:30055,57696:30059,57697:30061,57698:30072,57699:30070,57700:30086,57701:30087,57702:30068,57703:30090,57704:30089,57705:30082,57706:30100,57707:30106,57708:30109,57709:30117,57710:30115,57711:30146,57712:30131,57713:30147,57714:30133,57715:30141,57716:30136,57717:30140,57718:30129,57719:30157,57720:30154,57721:30162,57722:30169,57723:30179,57724:30174,57725:30206,57726:30207,57728:30204,57729:30209,57730:30192,57731:30202,57732:30194,57733:30195,57734:30219,57735:30221,57736:30217,57737:30239,57738:30247,57739:30240,57740:30241,57741:30242,57742:30244,57743:30260,57744:30256,57745:30267,57746:30279,57747:30280,57748:30278,57749:30300,57750:30296,57751:30305,57752:30306,57753:30312,57754:30313,57755:30314,57756:30311,57757:30316,57758:30320,57759:30322,57760:30326,57761:30328,57762:30332,57763:30336,57764:30339,57765:30344,57766:30347,57767:30350,57768:30358,57769:30355,57770:30361,57771:30362,57772:30384,57773:30388,57774:30392,57775:30393,57776:30394,57777:30402,57778:30413,57779:30422,57780:30418,57781:30430,57782:30433,57783:30437,57784:30439,57785:30442,57786:34351,57787:30459,57788:30472,57789:30471,57790:30468,57791:30505,57792:30500,57793:30494,57794:30501,57795:30502,57796:30491,57797:30519,57798:30520,57799:30535,57800:30554,57801:30568,57802:30571,57803:30555,57804:30565,57805:30591,57806:30590,57807:30585,57808:30606,57809:30603,57810:30609,57811:30624,57812:30622,57813:30640,57814:30646,57815:30649,57816:30655,57817:30652,57818:30653,57819:30651,57820:30663,57821:30669,57822:30679,57823:30682,57824:30684,57825:30691,57826:30702,57827:30716,57828:30732,57829:30738,57830:31014,57831:30752,57832:31018,57833:30789,57834:30862,57835:30836,57836:30854,57837:30844,57838:30874,57839:30860,57840:30883,57841:30901,57842:30890,57843:30895,57844:30929,57845:30918,57846:30923,57847:30932,57848:30910,57849:30908,57850:30917,57851:30922,57852:30956,57920:30951,57921:30938,57922:30973,57923:30964,57924:30983,57925:30994,57926:30993,57927:31001,57928:31020,57929:31019,57930:31040,57931:31072,57932:31063,57933:31071,57934:31066,57935:31061,57936:31059,57937:31098,57938:31103,57939:31114,57940:31133,57941:31143,57942:40779,57943:31146,57944:31150,57945:31155,57946:31161,57947:31162,57948:31177,57949:31189,57950:31207,57951:31212,57952:31201,57953:31203,57954:31240,57955:31245,57956:31256,57957:31257,57958:31264,57959:31263,57960:31104,57961:31281,57962:31291,57963:31294,57964:31287,57965:31299,57966:31319,57967:31305,57968:31329,57969:31330,57970:31337,57971:40861,57972:31344,57973:31353,57974:31357,57975:31368,57976:31383,57977:31381,57978:31384,57979:31382,57980:31401,57981:31432,57982:31408,57984:31414,57985:31429,57986:31428,57987:31423,57988:36995,57989:31431,57990:31434,57991:31437,57992:31439,57993:31445,57994:31443,57995:31449,57996:31450,57997:31453,57998:31457,57999:31458,58e3:31462,58001:31469,58002:31472,58003:31490,58004:31503,58005:31498,58006:31494,58007:31539,58008:31512,58009:31513,58010:31518,58011:31541,58012:31528,58013:31542,58014:31568,58015:31610,58016:31492,58017:31565,58018:31499,58019:31564,58020:31557,58021:31605,58022:31589,58023:31604,58024:31591,58025:31600,58026:31601,58027:31596,58028:31598,58029:31645,58030:31640,58031:31647,58032:31629,58033:31644,58034:31642,58035:31627,58036:31634,58037:31631,58038:31581,58039:31641,58040:31691,58041:31681,58042:31692,58043:31695,58044:31668,58045:31686,58046:31709,58047:31721,58048:31761,58049:31764,58050:31718,58051:31717,58052:31840,58053:31744,58054:31751,58055:31763,58056:31731,58057:31735,58058:31767,58059:31757,58060:31734,58061:31779,58062:31783,58063:31786,58064:31775,58065:31799,58066:31787,58067:31805,58068:31820,58069:31811,58070:31828,58071:31823,58072:31808,58073:31824,58074:31832,58075:31839,58076:31844,58077:31830,58078:31845,58079:31852,58080:31861,58081:31875,58082:31888,58083:31908,58084:31917,58085:31906,58086:31915,58087:31905,58088:31912,58089:31923,58090:31922,58091:31921,58092:31918,58093:31929,58094:31933,58095:31936,58096:31941,58097:31938,58098:31960,58099:31954,58100:31964,58101:31970,58102:39739,58103:31983,58104:31986,58105:31988,58106:31990,58107:31994,58108:32006,58176:32002,58177:32028,58178:32021,58179:32010,58180:32069,58181:32075,58182:32046,58183:32050,58184:32063,58185:32053,58186:32070,58187:32115,58188:32086,58189:32078,58190:32114,58191:32104,58192:32110,58193:32079,58194:32099,58195:32147,58196:32137,58197:32091,58198:32143,58199:32125,58200:32155,58201:32186,58202:32174,58203:32163,58204:32181,58205:32199,58206:32189,58207:32171,58208:32317,58209:32162,58210:32175,58211:32220,58212:32184,58213:32159,58214:32176,58215:32216,58216:32221,58217:32228,58218:32222,58219:32251,58220:32242,58221:32225,58222:32261,58223:32266,58224:32291,58225:32289,58226:32274,58227:32305,58228:32287,58229:32265,58230:32267,58231:32290,58232:32326,58233:32358,58234:32315,58235:32309,58236:32313,58237:32323,58238:32311,58240:32306,58241:32314,58242:32359,58243:32349,58244:32342,58245:32350,58246:32345,58247:32346,58248:32377,58249:32362,58250:32361,58251:32380,58252:32379,58253:32387,58254:32213,58255:32381,58256:36782,58257:32383,58258:32392,58259:32393,58260:32396,58261:32402,58262:32400,58263:32403,58264:32404,58265:32406,58266:32398,58267:32411,58268:32412,58269:32568,58270:32570,58271:32581,58272:32588,58273:32589,58274:32590,58275:32592,58276:32593,58277:32597,58278:32596,58279:32600,58280:32607,58281:32608,58282:32616,58283:32617,58284:32615,58285:32632,58286:32642,58287:32646,58288:32643,58289:32648,58290:32647,58291:32652,58292:32660,58293:32670,58294:32669,58295:32666,58296:32675,58297:32687,58298:32690,58299:32697,58300:32686,58301:32694,58302:32696,58303:35697,58304:32709,58305:32710,58306:32714,58307:32725,58308:32724,58309:32737,58310:32742,58311:32745,58312:32755,58313:32761,58314:39132,58315:32774,58316:32772,58317:32779,58318:32786,58319:32792,58320:32793,58321:32796,58322:32801,58323:32808,58324:32831,58325:32827,58326:32842,58327:32838,58328:32850,58329:32856,58330:32858,58331:32863,58332:32866,58333:32872,58334:32883,58335:32882,58336:32880,58337:32886,58338:32889,58339:32893,58340:32895,58341:32900,58342:32902,58343:32901,58344:32923,58345:32915,58346:32922,58347:32941,58348:20880,58349:32940,58350:32987,58351:32997,58352:32985,58353:32989,58354:32964,58355:32986,58356:32982,58357:33033,58358:33007,58359:33009,58360:33051,58361:33065,58362:33059,58363:33071,58364:33099,58432:38539,58433:33094,58434:33086,58435:33107,58436:33105,58437:33020,58438:33137,58439:33134,58440:33125,58441:33126,58442:33140,58443:33155,58444:33160,58445:33162,58446:33152,58447:33154,58448:33184,58449:33173,58450:33188,58451:33187,58452:33119,58453:33171,58454:33193,58455:33200,58456:33205,58457:33214,58458:33208,58459:33213,58460:33216,58461:33218,58462:33210,58463:33225,58464:33229,58465:33233,58466:33241,58467:33240,58468:33224,58469:33242,58470:33247,58471:33248,58472:33255,58473:33274,58474:33275,58475:33278,58476:33281,58477:33282,58478:33285,58479:33287,58480:33290,58481:33293,58482:33296,58483:33302,58484:33321,58485:33323,58486:33336,58487:33331,58488:33344,58489:33369,58490:33368,58491:33373,58492:33370,58493:33375,58494:33380,58496:33378,58497:33384,58498:33386,58499:33387,58500:33326,58501:33393,58502:33399,58503:33400,58504:33406,58505:33421,58506:33426,58507:33451,58508:33439,58509:33467,58510:33452,58511:33505,58512:33507,58513:33503,58514:33490,58515:33524,58516:33523,58517:33530,58518:33683,58519:33539,58520:33531,58521:33529,58522:33502,58523:33542,58524:33500,58525:33545,58526:33497,58527:33589,58528:33588,58529:33558,58530:33586,58531:33585,58532:33600,58533:33593,58534:33616,58535:33605,58536:33583,58537:33579,58538:33559,58539:33560,58540:33669,58541:33690,58542:33706,58543:33695,58544:33698,58545:33686,58546:33571,58547:33678,58548:33671,58549:33674,58550:33660,58551:33717,58552:33651,58553:33653,58554:33696,58555:33673,58556:33704,58557:33780,58558:33811,58559:33771,58560:33742,58561:33789,58562:33795,58563:33752,58564:33803,58565:33729,58566:33783,58567:33799,58568:33760,58569:33778,58570:33805,58571:33826,58572:33824,58573:33725,58574:33848,58575:34054,58576:33787,58577:33901,58578:33834,58579:33852,58580:34138,58581:33924,58582:33911,58583:33899,58584:33965,58585:33902,58586:33922,58587:33897,58588:33862,58589:33836,58590:33903,58591:33913,58592:33845,58593:33994,58594:33890,58595:33977,58596:33983,58597:33951,58598:34009,58599:33997,58600:33979,58601:34010,58602:34e3,58603:33985,58604:33990,58605:34006,58606:33953,58607:34081,58608:34047,58609:34036,58610:34071,58611:34072,58612:34092,58613:34079,58614:34069,58615:34068,58616:34044,58617:34112,58618:34147,58619:34136,58620:34120,58688:34113,58689:34306,58690:34123,58691:34133,58692:34176,58693:34212,58694:34184,58695:34193,58696:34186,58697:34216,58698:34157,58699:34196,58700:34203,58701:34282,58702:34183,58703:34204,58704:34167,58705:34174,58706:34192,58707:34249,58708:34234,58709:34255,58710:34233,58711:34256,58712:34261,58713:34269,58714:34277,58715:34268,58716:34297,58717:34314,58718:34323,58719:34315,58720:34302,58721:34298,58722:34310,58723:34338,58724:34330,58725:34352,58726:34367,58727:34381,58728:20053,58729:34388,58730:34399,58731:34407,58732:34417,58733:34451,58734:34467,58735:34473,58736:34474,58737:34443,58738:34444,58739:34486,58740:34479,58741:34500,58742:34502,58743:34480,58744:34505,58745:34851,58746:34475,58747:34516,58748:34526,58749:34537,58750:34540,58752:34527,58753:34523,58754:34543,58755:34578,58756:34566,58757:34568,58758:34560,58759:34563,58760:34555,58761:34577,58762:34569,58763:34573,58764:34553,58765:34570,58766:34612,58767:34623,58768:34615,58769:34619,58770:34597,58771:34601,58772:34586,58773:34656,58774:34655,58775:34680,58776:34636,58777:34638,58778:34676,58779:34647,58780:34664,58781:34670,58782:34649,58783:34643,58784:34659,58785:34666,58786:34821,58787:34722,58788:34719,58789:34690,58790:34735,58791:34763,58792:34749,58793:34752,58794:34768,58795:38614,58796:34731,58797:34756,58798:34739,58799:34759,58800:34758,58801:34747,58802:34799,58803:34802,58804:34784,58805:34831,58806:34829,58807:34814,58808:34806,58809:34807,58810:34830,58811:34770,58812:34833,58813:34838,58814:34837,58815:34850,58816:34849,58817:34865,58818:34870,58819:34873,58820:34855,58821:34875,58822:34884,58823:34882,58824:34898,58825:34905,58826:34910,58827:34914,58828:34923,58829:34945,58830:34942,58831:34974,58832:34933,58833:34941,58834:34997,58835:34930,58836:34946,58837:34967,58838:34962,58839:34990,58840:34969,58841:34978,58842:34957,58843:34980,58844:34992,58845:35007,58846:34993,58847:35011,58848:35012,58849:35028,58850:35032,58851:35033,58852:35037,58853:35065,58854:35074,58855:35068,58856:35060,58857:35048,58858:35058,58859:35076,58860:35084,58861:35082,58862:35091,58863:35139,58864:35102,58865:35109,58866:35114,58867:35115,58868:35137,58869:35140,58870:35131,58871:35126,58872:35128,58873:35148,58874:35101,58875:35168,58876:35166,58944:35174,58945:35172,58946:35181,58947:35178,58948:35183,58949:35188,58950:35191,58951:35198,58952:35203,58953:35208,58954:35210,58955:35219,58956:35224,58957:35233,58958:35241,58959:35238,58960:35244,58961:35247,58962:35250,58963:35258,58964:35261,58965:35263,58966:35264,58967:35290,58968:35292,58969:35293,58970:35303,58971:35316,58972:35320,58973:35331,58974:35350,58975:35344,58976:35340,58977:35355,58978:35357,58979:35365,58980:35382,58981:35393,58982:35419,58983:35410,58984:35398,58985:35400,58986:35452,58987:35437,58988:35436,58989:35426,58990:35461,58991:35458,58992:35460,58993:35496,58994:35489,58995:35473,58996:35493,58997:35494,58998:35482,58999:35491,59e3:35524,59001:35533,59002:35522,59003:35546,59004:35563,59005:35571,59006:35559,59008:35556,59009:35569,59010:35604,59011:35552,59012:35554,59013:35575,59014:35550,59015:35547,59016:35596,59017:35591,59018:35610,59019:35553,59020:35606,59021:35600,59022:35607,59023:35616,59024:35635,59025:38827,59026:35622,59027:35627,59028:35646,59029:35624,59030:35649,59031:35660,59032:35663,59033:35662,59034:35657,59035:35670,59036:35675,59037:35674,59038:35691,59039:35679,59040:35692,59041:35695,59042:35700,59043:35709,59044:35712,59045:35724,59046:35726,59047:35730,59048:35731,59049:35734,59050:35737,59051:35738,59052:35898,59053:35905,59054:35903,59055:35912,59056:35916,59057:35918,59058:35920,59059:35925,59060:35938,59061:35948,59062:35960,59063:35962,59064:35970,59065:35977,59066:35973,59067:35978,59068:35981,59069:35982,59070:35988,59071:35964,59072:35992,59073:25117,59074:36013,59075:36010,59076:36029,59077:36018,59078:36019,59079:36014,59080:36022,59081:36040,59082:36033,59083:36068,59084:36067,59085:36058,59086:36093,59087:36090,59088:36091,59089:36100,59090:36101,59091:36106,59092:36103,59093:36111,59094:36109,59095:36112,59096:40782,59097:36115,59098:36045,59099:36116,59100:36118,59101:36199,59102:36205,59103:36209,59104:36211,59105:36225,59106:36249,59107:36290,59108:36286,59109:36282,59110:36303,59111:36314,59112:36310,59113:36300,59114:36315,59115:36299,59116:36330,59117:36331,59118:36319,59119:36323,59120:36348,59121:36360,59122:36361,59123:36351,59124:36381,59125:36382,59126:36368,59127:36383,59128:36418,59129:36405,59130:36400,59131:36404,59132:36426,59200:36423,59201:36425,59202:36428,59203:36432,59204:36424,59205:36441,59206:36452,59207:36448,59208:36394,59209:36451,59210:36437,59211:36470,59212:36466,59213:36476,59214:36481,59215:36487,59216:36485,59217:36484,59218:36491,59219:36490,59220:36499,59221:36497,59222:36500,59223:36505,59224:36522,59225:36513,59226:36524,59227:36528,59228:36550,59229:36529,59230:36542,59231:36549,59232:36552,59233:36555,59234:36571,59235:36579,59236:36604,59237:36603,59238:36587,59239:36606,59240:36618,59241:36613,59242:36629,59243:36626,59244:36633,59245:36627,59246:36636,59247:36639,59248:36635,59249:36620,59250:36646,59251:36659,59252:36667,59253:36665,59254:36677,59255:36674,59256:36670,59257:36684,59258:36681,59259:36678,59260:36686,59261:36695,59262:36700,59264:36706,59265:36707,59266:36708,59267:36764,59268:36767,59269:36771,59270:36781,59271:36783,59272:36791,59273:36826,59274:36837,59275:36834,59276:36842,59277:36847,59278:36999,59279:36852,59280:36869,59281:36857,59282:36858,59283:36881,59284:36885,59285:36897,59286:36877,59287:36894,59288:36886,59289:36875,59290:36903,59291:36918,59292:36917,59293:36921,59294:36856,59295:36943,59296:36944,59297:36945,59298:36946,59299:36878,59300:36937,59301:36926,59302:36950,59303:36952,59304:36958,59305:36968,59306:36975,59307:36982,59308:38568,59309:36978,59310:36994,59311:36989,59312:36993,59313:36992,59314:37002,59315:37001,59316:37007,59317:37032,59318:37039,59319:37041,59320:37045,59321:37090,59322:37092,59323:25160,59324:37083,59325:37122,59326:37138,59327:37145,59328:37170,59329:37168,59330:37194,59331:37206,59332:37208,59333:37219,59334:37221,59335:37225,59336:37235,59337:37234,59338:37259,59339:37257,59340:37250,59341:37282,59342:37291,59343:37295,59344:37290,59345:37301,59346:37300,59347:37306,59348:37312,59349:37313,59350:37321,59351:37323,59352:37328,59353:37334,59354:37343,59355:37345,59356:37339,59357:37372,59358:37365,59359:37366,59360:37406,59361:37375,59362:37396,59363:37420,59364:37397,59365:37393,59366:37470,59367:37463,59368:37445,59369:37449,59370:37476,59371:37448,59372:37525,59373:37439,59374:37451,59375:37456,59376:37532,59377:37526,59378:37523,59379:37531,59380:37466,59381:37583,59382:37561,59383:37559,59384:37609,59385:37647,59386:37626,59387:37700,59388:37678,59456:37657,59457:37666,59458:37658,59459:37667,59460:37690,59461:37685,59462:37691,59463:37724,59464:37728,59465:37756,59466:37742,59467:37718,59468:37808,59469:37804,59470:37805,59471:37780,59472:37817,59473:37846,59474:37847,59475:37864,59476:37861,59477:37848,59478:37827,59479:37853,59480:37840,59481:37832,59482:37860,59483:37914,59484:37908,59485:37907,59486:37891,59487:37895,59488:37904,59489:37942,59490:37931,59491:37941,59492:37921,59493:37946,59494:37953,59495:37970,59496:37956,59497:37979,59498:37984,59499:37986,59500:37982,59501:37994,59502:37417,59503:38e3,59504:38005,59505:38007,59506:38013,59507:37978,59508:38012,59509:38014,59510:38017,59511:38015,59512:38274,59513:38279,59514:38282,59515:38292,59516:38294,59517:38296,59518:38297,59520:38304,59521:38312,59522:38311,59523:38317,59524:38332,59525:38331,59526:38329,59527:38334,59528:38346,59529:28662,59530:38339,59531:38349,59532:38348,59533:38357,59534:38356,59535:38358,59536:38364,59537:38369,59538:38373,59539:38370,59540:38433,59541:38440,59542:38446,59543:38447,59544:38466,59545:38476,59546:38479,59547:38475,59548:38519,59549:38492,59550:38494,59551:38493,59552:38495,59553:38502,59554:38514,59555:38508,59556:38541,59557:38552,59558:38549,59559:38551,59560:38570,59561:38567,59562:38577,59563:38578,59564:38576,59565:38580,59566:38582,59567:38584,59568:38585,59569:38606,59570:38603,59571:38601,59572:38605,59573:35149,59574:38620,59575:38669,59576:38613,59577:38649,59578:38660,59579:38662,59580:38664,59581:38675,59582:38670,59583:38673,59584:38671,59585:38678,59586:38681,59587:38692,59588:38698,59589:38704,59590:38713,59591:38717,59592:38718,59593:38724,59594:38726,59595:38728,59596:38722,59597:38729,59598:38748,59599:38752,59600:38756,59601:38758,59602:38760,59603:21202,59604:38763,59605:38769,59606:38777,59607:38789,59608:38780,59609:38785,59610:38778,59611:38790,59612:38795,59613:38799,59614:38800,59615:38812,59616:38824,59617:38822,59618:38819,59619:38835,59620:38836,59621:38851,59622:38854,59623:38856,59624:38859,59625:38876,59626:38893,59627:40783,59628:38898,59629:31455,59630:38902,59631:38901,59632:38927,59633:38924,59634:38968,59635:38948,59636:38945,59637:38967,59638:38973,59639:38982,59640:38991,59641:38987,59642:39019,59643:39023,59644:39024,59712:39025,59713:39028,59714:39027,59715:39082,59716:39087,59717:39089,59718:39094,59719:39108,59720:39107,59721:39110,59722:39145,59723:39147,59724:39171,59725:39177,59726:39186,59727:39188,59728:39192,59729:39201,59730:39197,59731:39198,59732:39204,59733:39200,59734:39212,59735:39214,59736:39229,59737:39230,59738:39234,59739:39241,59740:39237,59741:39248,59742:39243,59743:39249,59744:39250,59745:39244,59746:39253,59747:39319,59748:39320,59749:39333,59750:39341,59751:39342,59752:39356,59753:39391,59754:39387,59755:39389,59756:39384,59757:39377,59758:39405,59759:39406,59760:39409,59761:39410,59762:39419,59763:39416,59764:39425,59765:39439,59766:39429,59767:39394,59768:39449,59769:39467,59770:39479,59771:39493,59772:39490,59773:39488,59774:39491,59776:39486,59777:39509,59778:39501,59779:39515,59780:39511,59781:39519,59782:39522,59783:39525,59784:39524,59785:39529,59786:39531,59787:39530,59788:39597,59789:39600,59790:39612,59791:39616,59792:39631,59793:39633,59794:39635,59795:39636,59796:39646,59797:39647,59798:39650,59799:39651,59800:39654,59801:39663,59802:39659,59803:39662,59804:39668,59805:39665,59806:39671,59807:39675,59808:39686,59809:39704,59810:39706,59811:39711,59812:39714,59813:39715,59814:39717,59815:39719,59816:39720,59817:39721,59818:39722,59819:39726,59820:39727,59821:39730,59822:39748,59823:39747,59824:39759,59825:39757,59826:39758,59827:39761,59828:39768,59829:39796,59830:39827,59831:39811,59832:39825,59833:39830,59834:39831,59835:39839,59836:39840,59837:39848,59838:39860,59839:39872,59840:39882,59841:39865,59842:39878,59843:39887,59844:39889,59845:39890,59846:39907,59847:39906,59848:39908,59849:39892,59850:39905,59851:39994,59852:39922,59853:39921,59854:39920,59855:39957,59856:39956,59857:39945,59858:39955,59859:39948,59860:39942,59861:39944,59862:39954,59863:39946,59864:39940,59865:39982,59866:39963,59867:39973,59868:39972,59869:39969,59870:39984,59871:40007,59872:39986,59873:40006,59874:39998,59875:40026,59876:40032,59877:40039,59878:40054,59879:40056,59880:40167,59881:40172,59882:40176,59883:40201,59884:40200,59885:40171,59886:40195,59887:40198,59888:40234,59889:40230,59890:40367,59891:40227,59892:40223,59893:40260,59894:40213,59895:40210,59896:40257,59897:40255,59898:40254,59899:40262,59900:40264,59968:40285,59969:40286,59970:40292,59971:40273,59972:40272,59973:40281,59974:40306,59975:40329,59976:40327,59977:40363,59978:40303,59979:40314,59980:40346,59981:40356,59982:40361,59983:40370,59984:40388,59985:40385,59986:40379,59987:40376,59988:40378,59989:40390,59990:40399,59991:40386,59992:40409,59993:40403,59994:40440,59995:40422,59996:40429,59997:40431,59998:40445,59999:40474,6e4:40475,60001:40478,60002:40565,60003:40569,60004:40573,60005:40577,60006:40584,60007:40587,60008:40588,60009:40594,60010:40597,60011:40593,60012:40605,60013:40613,60014:40617,60015:40632,60016:40618,60017:40621,60018:38753,60019:40652,60020:40654,60021:40655,60022:40656,60023:40660,60024:40668,60025:40670,60026:40669,60027:40672,60028:40677,60029:40680,60030:40687,60032:40692,60033:40694,60034:40695,60035:40697,60036:40699,60037:40700,60038:40701,60039:40711,60040:40712,60041:30391,60042:40725,60043:40737,60044:40748,60045:40766,60046:40778,60047:40786,60048:40788,60049:40803,60050:40799,60051:40800,60052:40801,60053:40806,60054:40807,60055:40812,60056:40810,60057:40823,60058:40818,60059:40822,60060:40853,60061:40860,60062:40864,60063:22575,60064:27079,60065:36953,60066:29796,60067:20956,60068:29081}},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(1),a=t(2);r.decode=function(e,r){var t=new Uint8ClampedArray(e.length);t.set(e);for(var o=new n.default(285,256,0),i=new a.default(o,t),s=new Uint8ClampedArray(r),c=!1,u=0;u<r;u++){var l=i.evaluateAt(o.exp(u+o.generatorBase));s[s.length-1-u]=l,0!==l&&(c=!0)}if(!c)return t;var d=new a.default(o,s),f=function(e,r,t,n){var a;r.degree()<t.degree()&&(r=(a=[t,r])[0],t=a[1]);for(var o=r,i=t,s=e.zero,c=e.one;i.degree()>=n/2;){var u=o,l=s;if(s=c,(o=i).isZero())return null;i=u;for(var d=e.zero,f=o.getCoefficient(o.degree()),p=e.inverse(f);i.degree()>=o.degree()&&!i.isZero();){var h=i.degree()-o.degree(),m=e.multiply(i.getCoefficient(i.degree()),p);d=d.addOrSubtract(e.buildMonomial(h,m)),i=i.addOrSubtract(o.multiplyByMonomial(h,m))}if(c=d.multiplyPoly(s).addOrSubtract(l),i.degree()>=o.degree())return null}var g=c.getCoefficient(0);if(0===g)return null;var v=e.inverse(g);return[c.multiply(v),i.multiply(v)]}(o,o.buildMonomial(r,1),d,r);if(null===f)return null;var p=function(e,r){var t=r.degree();if(1===t)return[r.getCoefficient(1)];for(var n=new Array(t),a=0,o=1;o<e.size&&a<t;o++)0===r.evaluateAt(o)&&(n[a]=e.inverse(o),a++);return a!==t?null:n}(o,f[0]);if(null==p)return null;for(var h=function(e,r,t){for(var a=t.length,o=new Array(a),i=0;i<a;i++){for(var s=e.inverse(t[i]),c=1,u=0;u<a;u++)i!==u&&(c=e.multiply(c,n.addOrSubtractGF(1,e.multiply(t[u],s))));o[i]=e.multiply(r.evaluateAt(s),e.inverse(c)),0!==e.generatorBase&&(o[i]=e.multiply(o[i],s))}return o}(o,f[1],p),m=0;m<p.length;m++){var g=t.length-1-o.log(p[m]);if(g<0)return null;t[g]=n.addOrSubtractGF(t[g],h[m])}return t}},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.VERSIONS=[{infoBits:null,versionNumber:1,alignmentPatternCenters:[],errorCorrectionLevels:[{ecCodewordsPerBlock:7,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:13,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:13}]},{ecCodewordsPerBlock:17,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:2,alignmentPatternCenters:[6,18],errorCorrectionLevels:[{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:34}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:28}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]}]},{infoBits:null,versionNumber:3,alignmentPatternCenters:[6,22],errorCorrectionLevels:[{ecCodewordsPerBlock:15,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:55}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:13}]}]},{infoBits:null,versionNumber:4,alignmentPatternCenters:[6,26],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:80}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:32}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:5,alignmentPatternCenters:[6,30],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:43}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:11},{numBlocks:2,dataCodewordsPerBlock:12}]}]},{infoBits:null,versionNumber:6,alignmentPatternCenters:[6,34],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:27}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:31892,versionNumber:7,alignmentPatternCenters:[6,22,38],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:78}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:31}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:13},{numBlocks:1,dataCodewordsPerBlock:14}]}]},{infoBits:34236,versionNumber:8,alignmentPatternCenters:[6,24,42],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:97}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:38},{numBlocks:2,dataCodewordsPerBlock:39}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:18},{numBlocks:2,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:14},{numBlocks:2,dataCodewordsPerBlock:15}]}]},{infoBits:39577,versionNumber:9,alignmentPatternCenters:[6,26,46],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:12},{numBlocks:4,dataCodewordsPerBlock:13}]}]},{infoBits:42195,versionNumber:10,alignmentPatternCenters:[6,28,50],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68},{numBlocks:2,dataCodewordsPerBlock:69}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:43},{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]}]},{infoBits:48118,versionNumber:11,alignmentPatternCenters:[6,30,54],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:81}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:50},{numBlocks:4,dataCodewordsPerBlock:51}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:22},{numBlocks:4,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:12},{numBlocks:8,dataCodewordsPerBlock:13}]}]},{infoBits:51042,versionNumber:12,alignmentPatternCenters:[6,32,58],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:92},{numBlocks:2,dataCodewordsPerBlock:93}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:20},{numBlocks:6,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:55367,versionNumber:13,alignmentPatternCenters:[6,34,62],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:37},{numBlocks:1,dataCodewordsPerBlock:38}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:20},{numBlocks:4,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:11},{numBlocks:4,dataCodewordsPerBlock:12}]}]},{infoBits:58893,versionNumber:14,alignmentPatternCenters:[6,26,46,66],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:40},{numBlocks:5,dataCodewordsPerBlock:41}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:16},{numBlocks:5,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:5,dataCodewordsPerBlock:13}]}]},{infoBits:63784,versionNumber:15,alignmentPatternCenters:[6,26,48,70],errorCorrectionLevels:[{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:87},{numBlocks:1,dataCodewordsPerBlock:88}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:41},{numBlocks:5,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:7,dataCodewordsPerBlock:13}]}]},{infoBits:68472,versionNumber:16,alignmentPatternCenters:[6,26,50,74],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:98},{numBlocks:1,dataCodewordsPerBlock:99}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:70749,versionNumber:17,alignmentPatternCenters:[6,30,54,78],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:1,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22},{numBlocks:15,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:17,dataCodewordsPerBlock:15}]}]},{infoBits:76311,versionNumber:18,alignmentPatternCenters:[6,30,56,82],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:120},{numBlocks:1,dataCodewordsPerBlock:121}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:43},{numBlocks:4,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:1,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:19,dataCodewordsPerBlock:15}]}]},{infoBits:79154,versionNumber:19,alignmentPatternCenters:[6,30,58,86],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:113},{numBlocks:4,dataCodewordsPerBlock:114}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:44},{numBlocks:11,dataCodewordsPerBlock:45}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:21},{numBlocks:4,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:13},{numBlocks:16,dataCodewordsPerBlock:14}]}]},{infoBits:84390,versionNumber:20,alignmentPatternCenters:[6,34,62,90],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:41},{numBlocks:13,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:5,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:15},{numBlocks:10,dataCodewordsPerBlock:16}]}]},{infoBits:87683,versionNumber:21,alignmentPatternCenters:[6,28,50,72,94],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:116},{numBlocks:4,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:16},{numBlocks:6,dataCodewordsPerBlock:17}]}]},{infoBits:92361,versionNumber:22,alignmentPatternCenters:[6,26,50,74,98],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:111},{numBlocks:7,dataCodewordsPerBlock:112}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:13}]}]},{infoBits:96236,versionNumber:23,alignmentPatternCenters:[6,30,54,74,102],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:121},{numBlocks:5,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:47},{numBlocks:14,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:16,dataCodewordsPerBlock:15},{numBlocks:14,dataCodewordsPerBlock:16}]}]},{infoBits:102084,versionNumber:24,alignmentPatternCenters:[6,28,54,80,106],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:45},{numBlocks:14,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:30,dataCodewordsPerBlock:16},{numBlocks:2,dataCodewordsPerBlock:17}]}]},{infoBits:102881,versionNumber:25,alignmentPatternCenters:[6,32,58,84,110],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:106},{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:47},{numBlocks:13,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:110507,versionNumber:26,alignmentPatternCenters:[6,30,58,86,114],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:114},{numBlocks:2,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:46},{numBlocks:4,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:28,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:33,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]}]},{infoBits:110734,versionNumber:27,alignmentPatternCenters:[6,34,62,90,118],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:23},{numBlocks:26,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:117786,versionNumber:28,alignmentPatternCenters:[6,26,50,74,98,122],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:117},{numBlocks:10,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:45},{numBlocks:23,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:24},{numBlocks:31,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:31,dataCodewordsPerBlock:16}]}]},{infoBits:119615,versionNumber:29,alignmentPatternCenters:[6,30,54,78,102,126],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:116},{numBlocks:7,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:21,dataCodewordsPerBlock:45},{numBlocks:7,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:23},{numBlocks:37,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:26,dataCodewordsPerBlock:16}]}]},{infoBits:126325,versionNumber:30,alignmentPatternCenters:[6,26,52,78,104,130],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:115},{numBlocks:10,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:47},{numBlocks:10,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:25,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:25,dataCodewordsPerBlock:16}]}]},{infoBits:127568,versionNumber:31,alignmentPatternCenters:[6,30,56,82,108,134],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:3,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:46},{numBlocks:29,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:24},{numBlocks:1,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:133589,versionNumber:32,alignmentPatternCenters:[6,34,60,86,112,138],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:24},{numBlocks:35,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:35,dataCodewordsPerBlock:16}]}]},{infoBits:136944,versionNumber:33,alignmentPatternCenters:[6,30,58,86,114,142],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:21,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:24},{numBlocks:19,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:141498,versionNumber:34,alignmentPatternCenters:[6,34,62,90,118,146],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:6,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:44,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:59,dataCodewordsPerBlock:16},{numBlocks:1,dataCodewordsPerBlock:17}]}]},{infoBits:145311,versionNumber:35,alignmentPatternCenters:[6,30,54,78,102,126,150],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:121},{numBlocks:7,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:47},{numBlocks:26,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:39,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:41,dataCodewordsPerBlock:16}]}]},{infoBits:150283,versionNumber:36,alignmentPatternCenters:[6,24,50,76,102,128,154],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:121},{numBlocks:14,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:47},{numBlocks:34,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:46,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:64,dataCodewordsPerBlock:16}]}]},{infoBits:152622,versionNumber:37,alignmentPatternCenters:[6,28,54,80,106,132,158],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:46},{numBlocks:14,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:49,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:24,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:158308,versionNumber:38,alignmentPatternCenters:[6,32,58,84,110,136,162],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:122},{numBlocks:18,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:46},{numBlocks:32,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:48,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:15},{numBlocks:32,dataCodewordsPerBlock:16}]}]},{infoBits:161089,versionNumber:39,alignmentPatternCenters:[6,26,54,82,110,138,166],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:40,dataCodewordsPerBlock:47},{numBlocks:7,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:43,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:15},{numBlocks:67,dataCodewordsPerBlock:16}]}]},{infoBits:167017,versionNumber:40,alignmentPatternCenters:[6,30,58,86,114,142,170],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:118},{numBlocks:6,dataCodewordsPerBlock:119}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:18,dataCodewordsPerBlock:47},{numBlocks:31,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:24},{numBlocks:34,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:15},{numBlocks:61,dataCodewordsPerBlock:16}]}]}]},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(0);function a(e,r,t,n){var a=e.x-r.x+t.x-n.x,o=e.y-r.y+t.y-n.y;if(0===a&&0===o)return{a11:r.x-e.x,a12:r.y-e.y,a13:0,a21:t.x-r.x,a22:t.y-r.y,a23:0,a31:e.x,a32:e.y,a33:1};var i=r.x-t.x,s=n.x-t.x,c=r.y-t.y,u=n.y-t.y,l=i*u-s*c,d=(a*u-s*o)/l,f=(i*o-a*c)/l;return{a11:r.x-e.x+d*r.x,a12:r.y-e.y+d*r.y,a13:d,a21:n.x-e.x+f*n.x,a22:n.y-e.y+f*n.y,a23:f,a31:e.x,a32:e.y,a33:1}}r.extract=function(e,r){for(var t=function(e,r,t,n){var o=a(e,r,t,n);return{a11:o.a22*o.a33-o.a23*o.a32,a12:o.a13*o.a32-o.a12*o.a33,a13:o.a12*o.a23-o.a13*o.a22,a21:o.a23*o.a31-o.a21*o.a33,a22:o.a11*o.a33-o.a13*o.a31,a23:o.a13*o.a21-o.a11*o.a23,a31:o.a21*o.a32-o.a22*o.a31,a32:o.a12*o.a31-o.a11*o.a32,a33:o.a11*o.a22-o.a12*o.a21}}({x:3.5,y:3.5},{x:r.dimension-3.5,y:3.5},{x:r.dimension-6.5,y:r.dimension-6.5},{x:3.5,y:r.dimension-3.5}),o=function(e,r){return{a11:e.a11*r.a11+e.a21*r.a12+e.a31*r.a13,a12:e.a12*r.a11+e.a22*r.a12+e.a32*r.a13,a13:e.a13*r.a11+e.a23*r.a12+e.a33*r.a13,a21:e.a11*r.a21+e.a21*r.a22+e.a31*r.a23,a22:e.a12*r.a21+e.a22*r.a22+e.a32*r.a23,a23:e.a13*r.a21+e.a23*r.a22+e.a33*r.a23,a31:e.a11*r.a31+e.a21*r.a32+e.a31*r.a33,a32:e.a12*r.a31+e.a22*r.a32+e.a32*r.a33,a33:e.a13*r.a31+e.a23*r.a32+e.a33*r.a33}}(a(r.topLeft,r.topRight,r.alignmentPattern,r.bottomLeft),t),i=n.BitMatrix.createEmpty(r.dimension,r.dimension),s=function(e,r){var t=o.a13*e+o.a23*r+o.a33;return{x:(o.a11*e+o.a21*r+o.a31)/t,y:(o.a12*e+o.a22*r+o.a32)/t}},c=0;c<r.dimension;c++)for(var u=0;u<r.dimension;u++){var l=s(u+.5,c+.5);i.set(u,c,e.get(Math.floor(l.x),Math.floor(l.y)))}return{matrix:i,mappingFunction:s}}},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=function(e,r){return Math.sqrt(Math.pow(r.x-e.x,2)+Math.pow(r.y-e.y,2))};function a(e){return e.reduce((function(e,r){return e+r}))}function o(e,r,t,a){var o,i,s,c,u=[{x:Math.floor(e.x),y:Math.floor(e.y)}],l=Math.abs(r.y-e.y)>Math.abs(r.x-e.x);l?(o=Math.floor(e.y),i=Math.floor(e.x),s=Math.floor(r.y),c=Math.floor(r.x)):(o=Math.floor(e.x),i=Math.floor(e.y),s=Math.floor(r.x),c=Math.floor(r.y));for(var d=Math.abs(s-o),f=Math.abs(c-i),p=Math.floor(-d/2),h=o<s?1:-1,m=i<c?1:-1,g=!0,v=o,y=i;v!==s+h;v+=h){var b=l?y:v,C=l?v:y;if(t.get(b,C)!==g&&(g=!g,u.push({x:b,y:C}),u.length===a+1))break;if((p+=f)>0){if(y===c)break;y+=m,p-=d}}for(var w=[],k=0;k<a;k++)u[k]&&u[k+1]?w.push(n(u[k],u[k+1])):w.push(0);return w}function i(e,r,t,n){var a,i=r.y-e.y,s=r.x-e.x,c=o(e,r,t,Math.ceil(n/2)),u=o(e,{x:e.x-s,y:e.y-i},t,Math.ceil(n/2)),l=c.shift()+u.shift()-1;return(a=u.concat(l)).concat.apply(a,c)}function s(e,r){var t=a(e)/a(r),n=0;return r.forEach((function(r,a){n+=Math.pow(e[a]-r*t,2)})),{averageSize:t,error:n}}function c(e,r,t){try{var n=i(e,{x:-1,y:e.y},t,r.length),a=i(e,{x:e.x,y:-1},t,r.length),o=i(e,{x:Math.max(0,e.x-e.y)-1,y:Math.max(0,e.y-e.x)-1},t,r.length),c=i(e,{x:Math.min(t.width,e.x+e.y)+1,y:Math.min(t.height,e.y+e.x)+1},t,r.length),u=s(n,r),l=s(a,r),d=s(o,r),f=s(c,r),p=Math.sqrt(u.error*u.error+l.error*l.error+d.error*d.error+f.error*f.error),h=(u.averageSize+l.averageSize+d.averageSize+f.averageSize)/4;return p+(Math.pow(u.averageSize-h,2)+Math.pow(l.averageSize-h,2)+Math.pow(d.averageSize-h,2)+Math.pow(f.averageSize-h,2))/h}catch(e){return 1/0}}function u(e,r){for(var t=Math.round(r.x);e.get(t,Math.round(r.y));)t--;for(var n=Math.round(r.x);e.get(n,Math.round(r.y));)n++;for(var a=(t+n)/2,o=Math.round(r.y);e.get(Math.round(a),o);)o--;for(var i=Math.round(r.y);e.get(Math.round(a),i);)i++;return{x:a,y:(o+i)/2}}function l(e,r,t,o,s){var u,l,d;try{u=function(e,r,t,o){var s=(a(i(e,t,o,5))/7+a(i(e,r,o,5))/7+a(i(t,e,o,5))/7+a(i(r,e,o,5))/7)/4;if(s<1)throw new Error("Invalid module size");var c=Math.round(n(e,r)/s),u=Math.round(n(e,t)/s),l=Math.floor((c+u)/2)+7;switch(l%4){case 0:l++;break;case 2:l--}return{dimension:l,moduleSize:s}}(o,t,s,e),l=u.dimension,d=u.moduleSize}catch(e){return null}var f=t.x-o.x+s.x,p=t.y-o.y+s.y,h=(n(o,s)+n(o,t))/2/d,m=1-3/h,g={x:o.x+m*(f-o.x),y:o.y+m*(p-o.y)},v=r.map((function(r){var t=(r.top.startX+r.top.endX+r.bottom.startX+r.bottom.endX)/4,o=(r.top.y+r.bottom.y+1)/2;if(e.get(Math.floor(t),Math.floor(o))){var i=[r.top.endX-r.top.startX,r.bottom.endX-r.bottom.startX,r.bottom.y-r.top.y+1];return a(i),{x:t,y:o,score:c({x:Math.floor(t),y:Math.floor(o)},[1,1,1],e)+n({x:t,y:o},g)}}})).filter((function(e){return!!e})).sort((function(e,r){return e.score-r.score}));return{alignmentPattern:h>=15&&v.length?v[0]:g,dimension:l}}r.locate=function(e){for(var r=[],t=[],o=[],i=[],s=function(n){for(var s=0,c=!1,u=[0,0,0,0,0],l=function(r){var o=e.get(r,n);if(o===c)s++;else{u=[u[1],u[2],u[3],u[4],s],s=1,c=o;var l=a(u)/7,d=Math.abs(u[0]-l)<l&&Math.abs(u[1]-l)<l&&Math.abs(u[2]-3*l)<3*l&&Math.abs(u[3]-l)<l&&Math.abs(u[4]-l)<l&&!o,f=a(u.slice(-3))/3,p=Math.abs(u[2]-f)<f&&Math.abs(u[3]-f)<f&&Math.abs(u[4]-f)<f&&o;if(d){var h=r-u[3]-u[4],m=h-u[2],g={startX:m,endX:h,y:n};(v=t.filter((function(e){return m>=e.bottom.startX&&m<=e.bottom.endX||h>=e.bottom.startX&&m<=e.bottom.endX||m<=e.bottom.startX&&h>=e.bottom.endX&&u[2]/(e.bottom.endX-e.bottom.startX)<1.5&&u[2]/(e.bottom.endX-e.bottom.startX)>.5}))).length>0?v[0].bottom=g:t.push({top:g,bottom:g})}if(p){var v,y=r-u[4],b=y-u[3];g={startX:b,y:n,endX:y},(v=i.filter((function(e){return b>=e.bottom.startX&&b<=e.bottom.endX||y>=e.bottom.startX&&b<=e.bottom.endX||b<=e.bottom.startX&&y>=e.bottom.endX&&u[2]/(e.bottom.endX-e.bottom.startX)<1.5&&u[2]/(e.bottom.endX-e.bottom.startX)>.5}))).length>0?v[0].bottom=g:i.push({top:g,bottom:g})}}},d=-1;d<=e.width;d++)l(d);r.push.apply(r,t.filter((function(e){return e.bottom.y!==n&&e.bottom.y-e.top.y>=2}))),t=t.filter((function(e){return e.bottom.y===n})),o.push.apply(o,i.filter((function(e){return e.bottom.y!==n}))),i=i.filter((function(e){return e.bottom.y===n}))},d=0;d<=e.height;d++)s(d);r.push.apply(r,t.filter((function(e){return e.bottom.y-e.top.y>=2}))),o.push.apply(o,i);var f=r.filter((function(e){return e.bottom.y-e.top.y>=2})).map((function(r){var t=(r.top.startX+r.top.endX+r.bottom.startX+r.bottom.endX)/4,n=(r.top.y+r.bottom.y+1)/2;if(e.get(Math.round(t),Math.round(n))){var o=[r.top.endX-r.top.startX,r.bottom.endX-r.bottom.startX,r.bottom.y-r.top.y+1],i=a(o)/o.length;return{score:c({x:Math.round(t),y:Math.round(n)},[1,1,3,1,1],e),x:t,y:n,size:i}}})).filter((function(e){return!!e})).sort((function(e,r){return e.score-r.score})).map((function(e,r,t){if(r>4)return null;var n=t.filter((function(e,t){return r!==t})).map((function(r){return{x:r.x,y:r.y,score:r.score+Math.pow(r.size-e.size,2)/e.size,size:r.size}})).sort((function(e,r){return e.score-r.score}));if(n.length<2)return null;var a=e.score+n[0].score+n[1].score;return{points:[e].concat(n.slice(0,2)),score:a}})).filter((function(e){return!!e})).sort((function(e,r){return e.score-r.score}));if(0===f.length)return null;var p=function(e,r,t){var a,o,i,s,c,u,l,d=n(e,r),f=n(r,t),p=n(e,t);return f>=d&&f>=p?(c=(a=[r,e,t])[0],u=a[1],l=a[2]):p>=f&&p>=d?(c=(o=[e,r,t])[0],u=o[1],l=o[2]):(c=(i=[e,t,r])[0],u=i[1],l=i[2]),(l.x-u.x)*(c.y-u.y)-(l.y-u.y)*(c.x-u.x)<0&&(c=(s=[l,c])[0],l=s[1]),{bottomLeft:c,topLeft:u,topRight:l}}(f[0].points[0],f[0].points[1],f[0].points[2]),h=p.topRight,m=p.topLeft,g=p.bottomLeft,v=l(e,o,h,m,g),y=[];v&&y.push({alignmentPattern:{x:v.alignmentPattern.x,y:v.alignmentPattern.y},bottomLeft:{x:g.x,y:g.y},dimension:v.dimension,topLeft:{x:m.x,y:m.y},topRight:{x:h.x,y:h.y}});var b=u(e,h),C=u(e,m),w=u(e,g),k=l(e,o,b,C,w);return k&&y.push({alignmentPattern:{x:k.alignmentPattern.x,y:k.alignmentPattern.y},bottomLeft:{x:w.x,y:w.y},topLeft:{x:C.x,y:C.y},topRight:{x:b.x,y:b.y},dimension:k.dimension}),0===y.length?null:y}}]).default},e.exports=t()})));function cy(e){return uy.apply(this,arguments)}function uy(){return(uy=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.imageData,n=r.canvas,(a=t)||(o=n.getContext("2d"),a=o.getImageData(0,0,n.width,n.height)),!(i=sy(a.data,a.width,a.height,{inversionAttempts:"dontInvert"}))){e.next=6;break}return e.abrupt("return",i.data);case 6:return e.abrupt("return","");case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ly(e){return dy.apply(this,arguments)}function dy(){return(dy=S(regeneratorRuntime.mark((function e(r){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.canvas,n=r.qrScannerResources,e.abrupt("return",new Promise((function(e){setTimeout((function(){return e("")}),1e3),rv.scanImage(t,void 0,void 0,n.canvas).then(e).catch((function(){return e("")}))})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var fy=function(){var e=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.canvas,n=r.blob,a=r.qrScannerResources,o=t,!n){e.next=6;break}return e.next=5,So.blobToCanvas({blob:n});case 5:o=e.sent;case 6:return i=o.getContext("2d"),e.next=9,cy({imageData:i.getImageData(0,0,o.width,o.height)});case 9:if(s=e.sent){e.next=14;break}return e.next=13,ly({canvas:o,qrScannerResources:a});case 13:s=e.sent;case 14:return e.abrupt("return",s);case 15:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}();var py,hy,my,gy,vy,yy,by=function(e){var r=e.shouldStart,t=e.refVideo,n=e.cropArea,s=e.settings,u=e.onSessionTimeout,l=e.onCaptureDone,d=e.onAboutToTimeout,f=e.outputEncryptionSettings,p=O(c(!1),2),h=p[0],m=p[1],g=a((function(){})),v=a((function(){})),y=$t.useSDKSettings().lang,b=function(e){var r=e.refVideo,t=e.shouldStart,n=e.cropArea,s=e.settings,u=e.onResult,l=e.outputEncryptionSettings,d=a(null);null===d.current&&(d.current=document.createElement("canvas"));var f=a(!1),p=a(null),h=O(c(!1),2),m=h[0],g=h[1],v=a({}),y=$t.useSDKSettings(),b=y.customUrls,C=y.qrSettings;i((function(){function e(){return(e=S(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(m){e.next=5;break}return e.next=3,cv({modelUrl:null==b?void 0:b.wechatQRModelsUrl});case 3:v.current=e.sent,g(!0);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[m,b]);var w=o((function(){!0===f.current&&(f.current=!1)}),[]),k=o(S(regeneratorRuntime.mark((function e(){var t,n,a,o,i,c,h,g,y,b,k,B,E;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(m&&s&&!f.current){e.next=2;break}return e.abrupt("return");case 2:t=v.current,n=t.qrModel,a=t.qrScannerResources,o=t.noModel,i=p.current,c=r.current,f.current=!0,h=i.cropX,g=i.cropY,y=i.cropWidth,b=i.cropHeight,(k=d.current).width=y,k.height=b,B=k.getContext("2d"),E=function(){var e=S(regeneratorRuntime.mark((function e(){var r,t,i,s,p,m,v,S;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(B.drawImage(c,h,g,y,b,0,0,y,b),r=performance.now(),o){e.next=8;break}return e.next=5,oy({canvas:k,qrModel:n});case 5:t=e.sent,e.next=11;break;case 8:return e.next=10,fy({canvas:k,qrScannerResources:a});case 10:t=e.sent;case 11:if(r=Math.floor(performance.now()-r),!t){e.next=27;break}return w(),_=void 0,_=t.match(ay),i={valid:Boolean(_)},e.next=17,ca.takePicture({canvas:d.current});case 17:return s=e.sent,e.next=20,Rs.writeExif({mode:"",imageData:{captureTime:Date.now(),blob:s,result:t,type:"qr"},enableExifData:"boolean"!=typeof(null==C?void 0:C.enableExif)||(null==C?void 0:C.enableExif)});case 20:if(p=e.sent,!l||!l.key){e.next=26;break}return v=l.key,e.next=25,mi.encrypt({blob:p,key:v});case 25:m=e.sent;case 26:u({result:t,validateResult:i,image:{blob:p,encrypted:m}});case 27:return S=180-r>0?180-r:0,e.next=30,new Promise((function(e){return setTimeout(e,S)}));case 30:f.current&&window.requestAnimationFrame(E);case 31:case"end":return e.stop()}var _}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(E);case 13:case"end":return e.stop()}}),e)}))),[m,s,r,w,null==C?void 0:C.enableExif,l,u]),B=o((function(){w()}),[w]);return i((function(){var e=r.current;t||B(),m&&t&&n&&e&&e.videoWidth>0&&(p.current=ca.analyzeVideoAndWindowSizes(e,n,0),k())}),[t,n,r,w,k,m,B]),i((function(){return B}),[B]),{refWorkingCanvas:d,stopCheckFrame:w,checkFrame:k,warmupDone:m}}({refVideo:t,shouldStart:r,cropArea:n,settings:s,onResult:o((function(){g.current.apply(g,arguments)}),[]),outputEncryptionSettings:f}),C=b.stopCheckFrame,w=b.checkFrame,k=b.warmupDone,B=gv({refVideo:t,shouldStart:r&&k,cropArea:n,settings:s}),E=B.stopCheckFrame,_=B.refRecordedVideos,A=B.splitVideos,I=B.resetRecordedVideos,T=B.checkFrame;g.current=o((function(e){m(!0),E(),C(),v.current(),l(x(x({},e),{},{recordedVideos:_.current})),m(!1)}),[E,l,_,C]);var P=o((function(){E(),C();var e=M(_.current);u({recordedVideos:e}),I()}),[I,E,C,u,_]),R=o((function(){A()}),[A]),D=vv({lang:y,onAboutToTimeout:d,onSessionTimeout:P,onVideoTimeLimitReached:R,settings:s,shouldStartTimers:r&&k,sessionTime:null==s?void 0:s.scanQrLimitTimeSecond}),N=D.stopTimers,L=D.startTimers;return v.current=N,{isProcessing:h,restartSession:o(S(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return L(),e.next=3,Promise.all([T(),w()]);case 3:case"end":return e.stop()}}),e)}))),[T,w,L]),refRecordedVideos:_,warmupDone:k}};function Cy(e){var t=e.windowAndVideoInfo,n=e.onUISpacingChange,s=e.refVideo,u=e.settings,l=e.onCaptureDone,d=e.outputEncryptionSettings,f=O(c(null),2),p=f[0],h=f[1],m=Nn.useAsset("qr_capture_cursor.png"),g=O(c({}),2),v=g[0],y=g[1],b=v.yTooltip,C=v.yMessage,w=$t.useSDKSettings().lang,k=Pn.useSDKTracking().sendEvent,B=Ag(),E=B.showPopup,_=B.popupShown,A=B.popupType,I=O(c(!1),2),T=I[0],x=I[1],P=O(c(null),2),R=P[0],D=P[1],N=Nn.useAsset("ic_loading.png"),L=a();i((function(){k({tag:"id_qr",event:"user_activity.start",log:{}}),L.current=performance.now()}),[k]),i((function(){E({popupType:Pg})}),[E]),i((function(){if(t){var e=t.videoAreaWidth,r=t.lostX,a=t.lostY,o=qs.isMobile?Math.min(e-6,145):145,i=o,s=a+10,c=s+90,u=c+40,l=u+i+20,d=Math.floor((e-o)/2)+r;h({x:d,y:u,width:o,height:i,surroundStyle:{opacity:.6,background:"#000"}});var f={yTitle:s,yTooltip:l,yMessage:c};y(f),n(f)}}),[t,n]);var M=o((function(e){k({tag:"id_qr",event:"sdk_ui.scan_time_out",log:{}}),D(""),l(e)}),[l,k]),F=o((function(e){var r=e.validateResult.valid;D("");var t=performance.now();r?(k({tag:"id_qr",event:"sdk_ui.scan_success",log:{time_capture_in_seconds:(t-L.current)/1e3}}),l(e)):(E({popupType:xg}),k({tag:"id_qr",event:"sdk_ui.invalid_qr_alert",log:{}}))}),[E,l,k]),U=o((function(e){var r=e.curTimeLeft;D(Kd(xv.REMAINING_TIME[w])({x:r}))}),[w]),V=by({shouldStart:T,refVideo:s,cropArea:p,settings:u,onSessionTimeout:M,onCaptureDone:F,onAboutToTimeout:U,outputEncryptionSettings:d}),j=V.isProcessing,z=V.restartSession,K=V.warmupDone,H=o((function(){E({popupType:null})}),[E]),q=o(S(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return H(),L.current=performance.now(),k({tag:"id_qr",event:"user_activity.invalid_qr_retry",log:{}}),e.next=5,z();case 5:case"end":return e.stop()}}),e)}))),[z,H,k]),G=o((function(){H(),k({tag:"id_qr",event:"user_activity.invalid_qr_skip",log:{}}),l()}),[H,l,k]),W=o((function(){H(),setTimeout((function(){x(!0)}),200)}),[H]);return r.createElement(r.Fragment,null,!K&&r.createElement(qp,{contentStyle:{maxWidth:"300px"}}),p&&r.createElement(Cu,{x:"".concat(p.x,"px"),y:"".concat(p.y,"px"),width:"".concat(p.width,"px"),height:"".concat(p.height,"px"),surroundStyle:p.surroundStyle},r.createElement("div",null,r.createElement("img",{src:m,width:p.width,height:p.height,alt:""}))),r.createElement(Iv,{y:"".concat(b,"px")},xv.QR_TOOLTIP[w]),R&&r.createElement(Tv,{key:R,className:"message",y:"".concat(C,"px")},R),j&&r.createElement(Bm,null,r.createElement("img",{src:N,alt:"",className:"spin"})),r.createElement(zp,{contentStyle:{maxWidth:"332px"},open:_},A===xg&&r.createElement(Vv,{onRetry:q,onSkip:G}),A===Pg&&r.createElement(ny,{onClickStart:W,onTimeout:W})))}Cy.propTypes={windowAndVideoInfo:h.shape({}),onUISpacingChange:h.func,refVideo:h.shape({}),settings:h.shape({}),onCaptureDone:h.func,outputEncryptionSettings:h.shape({})},Cy.defaultProps={windowAndVideoInfo:{},onUISpacingChange:function(){},refVideo:{},settings:{},onCaptureDone:function(){},outputEncryptionSettings:null};var wy,ky,By,Ey,Sy,_y={SUCCESS:"SUCCESS",WARNING:"WARNING"},Ay=(A(py={},_y.SUCCESS,"52,206,95"),A(py,_y.WARNING,"255,148,50"),py),Iy=(A(hy={},_y.SUCCESS,"✓"),A(hy,_y.WARNING,"!"),hy),Ty=m.div(my||(my=L(["\n font-weight: normal;\n"]))),xy=m.div(gy||(gy=L(["\n height: 2px;\n width: 100%;\n background: ",";\n"])),(function(e){return b(["linear-gradient(to right,rgba(",",0),rgba(",",1),rgba(",",0));"],Ay[e.type],Ay[e.type],Ay[e.type])})),Py=m.div(vy||(vy=L(["\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: ",";\n display: flex;\n justify-content: center;\n align-items: center;\n color: #fff;\n margin-right: 8px;\n font-weight: bold;\n"])),(function(e){return b(["rgb(",")"],Ay[e.type])})),Ry=m.div(yy||(yy=L(["\n display: flex;\n justify-content: center;\n align-items: center;\n margin: 10px 0;\n"]))),Dy=function(e){var t=e.children,n=e.type,a=e.className;return r.createElement(Ty,{className:a},r.createElement(xy,{type:n}),r.createElement(Ry,null,r.createElement(Py,{type:n},Iy[n]),t),r.createElement(xy,{type:n}))};Dy.propTypes={children:h.node,type:h.string,className:h.string},Dy.defaultProps={children:null,type:_y.SUCCESS,className:""};var Ny=m.div(wy||(wy=L(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),Ly=m.div(ky||(ky=L(["\n text-align: center;\n font-size: 1rem;\n color: #ea3223;\n margin-top: 10px;\n"]))),Oy=m.button(By||(By=L(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n background-color: ",";\n border: 0;\n outline: none;\n border-radius: 0.25rem;\n color: #fff;\n font-weight: 400;\n cursor: pointer;\n font-size: 1rem;\n"])),(function(e){return e.theme.tsBlue})),My=m.img(Ey||(Ey=L(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),Fy=m.div(Sy||(Sy=L(["\n margin: 20px 0;\n width: 100%;\n display: flex;\n justify-content: space-evenly;\n gap: 10px;\n"]))),Uy=function(e){var t=e.imageTaken,n=e.onConfirm,a=e.onTryAgain,o=e.error,s=e.hasValidQR,u=e.frontSide,l=O(c(null),2),d=l[0],f=l[1],p=$t.useSDKSettings().lang,h=Pn.useSDKTracking().sendEvent;return i((function(){h({tag:u?"id_front":"id_back",event:"user_activity.show_confirm",log:{}})}),[u,h]),i((function(){var e;return t&&(e=URL.createObjectURL(t.blob),f(e)),function(){URL.revokeObjectURL(e)}}),[t]),r.createElement(Ny,null,null!==s&&r.createElement(Pv,{mb:"20px"},r.createElement("div",null,r.createElement(Dy,{type:s?_y.SUCCESS:_y.WARNING},s?wg.CONFIRM_POPUP_VALID_QR[p]:wg.CONFIRM_POPUP_INVALID_QR[p]))),r.createElement(Zv,{ratio:1.5},r.createElement(My,{src:d})),o&&r.createElement(Ly,{className:"confirm-popup-error-message"},o.msg[p]),r.createElement(Fy,null,r.createElement(Oy,{onClick:function(){h({tag:u?"id_front":"id_back",event:"user_activity.retry",log:{}}),a()}},wg.BTN_TRY_AGAIN[p]),r.createElement(Oy,{onClick:function(){h({tag:u?"id_front":"id_back",event:"user_activity.submit",log:{}}),n()}},wg.BTN_USE_THIS_PICTURE[p])))};Uy.propTypes={imageTaken:h.shape({}),error:h.shape({msg:h.shape({})}),onConfirm:h.func,onTryAgain:h.func,hasValidQR:h.bool,frontSide:h.bool},Uy.defaultProps={imageTaken:null,error:null,onConfirm:function(){},onTryAgain:function(){},hasValidQR:null,frontSide:!0};var Vy,jy={tsBlue:"#0276f1",tsSecondary:"rgba(0, 47, 117, 0.6)"},zy=y(Vy||(Vy=L(["\n .text-primary {\n color: ",";\n }\n"])),(function(e){return e.theme.tsBlue})),Ky=["onClose","onError","settings","outputEncryptionSettings","defaultCameraId","globalStyle","styledComponent","frontCamera","scannerTypeCons","isLoading"];function Hy(e){var t=e.onClose,n=e.onError,s=e.settings,u=e.outputEncryptionSettings,l=e.defaultCameraId,d=e.globalStyle,f=e.styledComponent,p=e.frontCamera,h=e.scannerTypeCons,m=e.isLoading,g=N(e,Ky),v=g.numberOfCaptures,y=g.stepNumber,b=g.frontSide,w=g.titleIcon,k=g.title,B=g.description,E=g.scannerType,S=g.usePortraitMask,_=g.shouldShowSpinner,A=g.handleQRCaptureDone,T=g.handleIDCardCaptureDone,x=g.handleRestartSession,P=g.refIDCardReader,R=g.handleClickConfirm,D=g.popupType,L=g.popupShown,M=g.popupProps,F=a(null),U=O(c(null),2),V=U[0],j=U[1],z=O(c(!1),2),K=z[0],H=z[1],q=Nn.useAsset("ic_loading.png"),G=O(c({}),2),W=G[0],Q=G[1],X=W.yTitle,Y=o((function(e){j(e),H(!0)}),[]);i((function(){H(!1)}),[p]);var Z=Nn.useAsset(w),$=f.CloseCameraButton;return r.createElement(C,{theme:jy},r.createElement(Cm,null,r.createElement(hu,{key:p,frontCamera:p,onVideoPlayed:Y,onClose:t,flipHorizontal:p,ref:F,onError:n,defaultCameraId:l,closeButton:$||null},K&&r.createElement(r.Fragment,null,E===h.ID_CARD&&r.createElement(Bv,{key:y,ref:P,windowAndVideoInfo:V,refVideo:F,settings:s,onCaptureDone:T,onUISpacingChange:Q,frontSide:b,description:B,usePortraitMask:S,outputEncryptionSettings:u}),E===h.QR_CODE&&r.createElement(Cy,{key:y,refVideo:F,windowAndVideoInfo:V,settings:s,onCaptureDone:A,onUISpacingChange:Q,outputEncryptionSettings:u})),r.createElement(bm,{keyForTransition:v}),r.createElement(Sm,{y:"".concat(X,"px")},r.createElement(Sh,null,r.createElement(vh,{key:k,timeout:{enter:500,exit:500},classNames:"flipY",unmountOnExit:!0},r.createElement(_m,null,w&&r.createElement(wm,{src:Z,alt:""}),r.createElement(Am,{className:"title"},k))))),(_||m)&&r.createElement(Bm,null,r.createElement("img",{src:q,alt:"",className:"spin"}))),r.createElement(zp,{open:L},D===Tg&&r.createElement(Uy,I({},M,{onConfirm:R,onTryAgain:x,frontSide:b})))),r.createElement(d,null))}var qy={settings:h.shape({}),onClose:h.func,onError:h.func,outputEncryptionSettings:h.shape({}),defaultCameraId:h.string,globalStyle:h.shape({}),styledComponent:h.shape({CloseCameraButton:h.node}),frontCamera:h.bool,scannerTypeCons:h.shape({}).isRequired,isLoading:h.bool},Gy={settings:null,onClose:function(){},onError:function(){},outputEncryptionSettings:null,defaultCameraId:void 0,globalStyle:zy,styledComponent:{CloseCameraButton:null},frontCamera:!1,isLoading:!1};Hy.propTypes=qy,Hy.defaultProps=Gy;var Wy=K.IDCardSide,Qy=K.IDCardType,Xy=K.Errors,Yy={ID_CARD:"id_card",QR_CODE:"qr_code"},Zy=[{scannerType:Yy.ID_CARD,title:"Mặt trước CMND/CCCD",description:"Vui lòng đặt CMND mặt trước vào trong khung",titleIcon:"id_card_front.svg",cardSide:K.IDCardSide.FRONT,cardType:Qy.VN,enableConfirmPopup:!0},{scannerType:Yy.ID_CARD,title:"Mặt sau CMND/CCCD",description:"Vui lòng đặt CMND mặt sau vào trong khung",titleIcon:"id_card_back.svg",cardSide:K.IDCardSide.BACK,cardType:Qy.VN,enableConfirmPopup:!0}],$y={scannerType:Yy.QR_CODE,title:"Quét mã QR trên CCCD",titleIcon:""},Jy=function(){return Promise.resolve({card_label:""})},eb=function(e){var r=e.settings,t=e.onError,n=e.detectIdCard,i=void 0===n?Jy:n,s=e.outputEncryptionSettings,u=e.steps,l=e.onStepDone,d=$t.useSDKSettings().lang,f=null!=u?u:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en",t="ph"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null)||"en"===r,n={scannerType:Yy.ID_CARD,title:t?"Capture Front Side of ID Card":"Mặt trước CMND/CCCD",description:t?"":"Vui lòng đặt CMND mặt trước vào trong khung",titleIcon:"id_card_front.svg",cardSide:K.IDCardSide.FRONT,cardType:Qy.VN,enableConfirmPopup:!0},a={scannerType:Yy.ID_CARD,title:t?"Capture Back Side of ID Card":"Mặt sau CMND/CCCD",description:t?"":"Vui lòng đặt CMND mặt sau vào trong khung",titleIcon:"id_card_back.svg",cardSide:K.IDCardSide.BACK,cardType:Qy.VN,enableConfirmPopup:!0};return e?[n,a]:[n]}(Pf(r,"hasBackCard",!0),d,Pf(r,"country")),p=O(c(0),2),h=p[0],m=p[1],g=O(c(f[h]),2),v=g[0],y=g[1],b=O(c(0),2),C=b[0],w=b[1],k=O(c(!1),2),B=k[0],E=k[1],_=a({}),A=a([]),I=a(null),T=a(),P=a(null),R=Ag(),D=R.showPopup,N=R.popupShown,L=R.popupType,F=R.props,U=v.scannerType,V=v.title,j=v.titleIcon,z=v.cardSide,H=v.description,q=v.usePortraitMask,G=v.cardType,W=v.enableConfirmPopup,Q=o((function(e){e>=f.length||setTimeout((function(){m(e),y(f[e])}),200)}),[f]),X=o((function(){Q(h+1)}),[Q,h]),Y=o((function(){setTimeout((function(){y((function(e){return x(x({},e),$y)}))}),200)}),[]),Z=o((function(){D({popupType:null})}),[D]),$=o((function(){if(Z(),I.current=null,U===Yy.QR_CODE)Q(h);else if(U===Yy.ID_CARD){var e=null;P.current===Wy.FRONT?e=0:P.current===Wy.BACK&&(e=1),null!==e&&Q(e),T.current.restartSession()}}),[Q,h,Z,U]),J=o(S(regeneratorRuntime.mark((function e(){var t,n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={stepNumber:h,cardSide:z,cardType:G,image:_.current,recordedVideos:null!=r&&r.enableRecording?A.current:[]},(U===Yy.QR_CODE||null!==(t=I.current)&&void 0!==t&&t.result)&&(n.qrScannedResult=I.current),E(!0),e.next=5,l(n);case 5:(a=e.sent)?(P.current=a,E(!1)):(E(!1),I.current=null,X());case 7:case"end":return e.stop()}}),e)}))),[r,h,l,X,U,E,z,G]),ee=o((function(e){var r;if(I.current=e,e&&e.recordedVideos){var t,n=e.recordedVideos;(t=A.current).push.apply(t,M(n))}w((function(e){return e+1}));var a=Boolean(null==e||null===(r=e.validateResult)||void 0===r?void 0:r.valid);W?D({popupType:Tg,props:{hasValidQR:a,imageTaken:_.current}}):J()}),[D,W,J]),re=o(function(){var e=S(regeneratorRuntime.mark((function e(n){var a,o,c,u,l,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.image,o=n.error,c=n.recordedVideos,_.current=a,A.current=c,w((function(e){return e+1})),z!==K.IDCardSide.FRONT){e.next=28;break}if(!r.enableScanQr||!qs.isMobile){e.next=28;break}if(l=null==a||null===(u=a.detectedCard)||void 0===u?void 0:u.label){e.next=20;break}return E(!0),e.prev=9,e.next=12,i({image:a,cardType:G,cardSide:z});case 12:d=e.sent,l=d.card_label,e.next=19;break;case 16:e.prev=16,e.t0=e.catch(9),t(Xy.detect_id_card_error);case 19:E(!1);case 20:if(!l||!"vn.cccd_new.front".includes(l)){e.next=28;break}return E(!0),e.next=24,iy(_.current.blob,s);case 24:return(f=e.sent)?ee(f):Y(),E(!1),e.abrupt("return");case 28:W?D({popupType:Tg,props:{imageTaken:_.current,error:o}}):J();case 29:case"end":return e.stop()}}),e,null,[[9,16]])})));return function(r){return e.apply(this,arguments)}}(),[W,D,z,r,G,i,J,Y,t,ee,s,E]),te=o((function(){Z(),J()}),[J,Z]);return{numberOfCaptures:C,stepNumber:h,titleIcon:j,title:V,description:H,frontSide:z===Wy.FRONT,scannerType:U,usePortraitMask:q,shouldShowSpinner:B,handleQRCaptureDone:ee,handleIDCardCaptureDone:re,handleRestartSession:$,refIDCardReader:T,handleClickConfirm:te,showPopup:D,popupType:L,popupShown:N,popupProps:F}};var rb=function(){this.__data__=new ff,this.size=0};var tb=function(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t};var nb=function(e){return this.__data__.get(e)};var ab=function(e){return this.__data__.has(e)};var ob=function(e,r){var t=this.__data__;if(t instanceof ff){var n=t.__data__;if(!pf||n.length<199)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new kf(n)}return t.set(e,r),this.size=t.size,this};function ib(e){var r=this.__data__=new ff(e);this.size=r.size}ib.prototype.clear=rb,ib.prototype.delete=tb,ib.prototype.get=nb,ib.prototype.has=ab,ib.prototype.set=ob;var sb=ib;var cb=function(e,r,t){(void 0!==t&&!gl(e[r],t)||void 0===t&&!(r in e))&&ml(e,r,t)};var ub=function(e){return function(r,t,n){for(var a=-1,o=Object(r),i=n(r),s=i.length;s--;){var c=i[e?s:++a];if(!1===t(o[c],c,o))break}return r}}(),lb=Hs((function(e,r){var t=r&&!r.nodeType&&r,n=t&&e&&!e.nodeType&&e,a=n&&n.exports===t?Su.Buffer:void 0,o=a?a.allocUnsafe:void 0;e.exports=function(e,r){if(r)return e.slice();var t=e.length,n=o?o(t):new e.constructor(t);return e.copy(n),n}})),db=Su.Uint8Array;var fb=function(e){var r=new e.constructor(e.byteLength);return new db(r).set(new db(e)),r};var pb=function(e,r){var t=r?fb(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)};var hb=function(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r},mb=Object.create,gb=function(){function e(){}return function(r){if(!ku(r))return{};if(mb)return mb(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}();var vb=function(e){return"function"!=typeof e.constructor||Jl(e)?{}:gb(id(e))};var yb=function(e){return ju(e)&&xl(e)};var bb=function(e,r){if(("constructor"!==r||"function"!=typeof e[r])&&"__proto__"!=r)return e[r]};var Cb=function(e){return bl(e,nd(e))};var wb=function(e,r,t,n,a,o,i){var s=bb(e,t),c=bb(r,t),u=i.get(c);if(u)cb(e,t,u);else{var l=o?o(s,c,t+"",e,r,i):void 0,d=void 0===l;if(d){var f=jl(c),p=!f&&Kl(c),h=!f&&!p&&Xl(c);l=c,f||p||h?jl(s)?l=s:yb(s)?l=hb(s):p?(d=!1,l=lb(c,!0)):h?(d=!1,l=pb(c,!0)):l=[]:fd(c)||Vl(c)?(l=s,Vl(s)?l=Cb(s):ku(s)&&!Ju(s)||(l=vb(c))):d=!1}d&&(i.set(c,l),a(l,c,n,o,i),i.delete(c)),cb(e,t,l)}};var kb=function e(r,t,n,a,o){r!==t&&ub(t,(function(i,s){if(o||(o=new sb),ku(i))wb(r,t,s,n,e,a,o);else{var c=a?a(bb(r,s),i,s+"",r,t,o):void 0;void 0===c&&(c=i),cb(r,s,c)}}),nd)},Bb=Nl((function(e,r,t){kb(e,r,t)})),Eb={data:{settings:{sdk_settings:{id_detection_settings:{auto_capture:{enable:!1,show_capture_button:!0,wait_for_best_image_time_ms_web:1e3},blur_check:{enable:!0,threshold_web:.82},disable_capture_button_if_alert:!1,exif_data_settings:{enable:!0},id_detection:{enable:!0},limit_time_settings:{enable:!0,limit_time_second:30,video_partial_length_seconds:15},save_frame_settings:{enable:!1,frames_interval_ms:190,quality_web:80},scan_qr_settings:{enable:!0,limit_time_second:20},virtual_cam_hashes:{web:!1,mobile:!1}}}}}};function Sb(e){var r=e.clientSettings,t=O(c(null),2),n=t[0],a=t[1];return i((function(){var e=Bb(Eb,r),t=Pf(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.enable"),n=Pf(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.frames_interval_ms"),o=Pf(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.quality_web"),i=Pf(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.enable"),s=Pf(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.limit_time_second"),c=Pf(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.video_partial_length_seconds"),u=Pf(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.enable"),l=Pf(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.wait_for_best_image_time_ms_web"),d=Pf(e,"data.settings.sdk_settings.id_detection_settings.blur_check.enable"),f=Pf(e,"data.settings.sdk_settings.id_detection_settings.blur_check.threshold_web"),p=Pf(e,"data.settings.sdk_settings.id_detection_settings.disable_capture_button_if_alert"),h=Pf(e,"data.settings.sdk_settings.id_detection_settings.id_detection.enable"),m=Pf(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.enable"),g=Pf(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.limit_time_second"),v=Pf(e,"data.settings.sdk_settings.id_detection_settings.exif_data_settings.enable"),y=Pf(e,"data.settings.sdk_settings.id_detection_settings.virtual_cam_hashes.".concat(qs.isMobile?"mobile":"web")),b=Pf(e,"data.card_types[0].has_back_side",!0),C=Pf(e,"data.country","vi");a({enableRecording:t,frameCaptureIntervalMs:n,idCardSessionTime:s,maxRecordingTimePerVideo:c,saveFrameQuality:o,enableTimers:i,enableAutoCapture:u,waitForBestImageTimeMs:l,enableBlurCheck:d,blurThreshold:f,disableCaptureButtonIfAlert:p,enableIdDetection:h,enableScanQr:m,scanQrLimitTimeSecond:g,enableExifData:v,enableVirtualCamHashes:y,hasBackCard:b,country:C})}),[r]),{settings:n}}function _b(e){var t=e.logCredentials,n=e.clientSettings,a=e.uiOnlyComponent,o=e.onError,i=e.detectIdCard,s=e.outputEncryptionSettings,c=e.steps,u=e.onStepDone,l=Sb({clientSettings:n}).settings,d=I({},eb({settings:l,onError:o,detectIdCard:i,outputEncryptionSettings:s,steps:c,onStepDone:u}));return r.createElement(mg,null,r.createElement(Pn.SDKTrackingProvider,{value:{tracking:x({},t)}},r.createElement(a,I({},e,{settings:l,scannerTypeCons:Yy},d))))}var Ab={logCredentials:h.shape({}),clientSettings:h.shape({}),uiOnlyComponent:h.func,onError:h.func,onStepDone:h.func,steps:h.arrayOf(h.shape({})),detectIdCard:h.func,outputEncryptionSettings:h.shape({})};_b.propTypes=Ab,_b.defaultProps={logCredentials:void 0,clientSettings:void 0,uiOnlyComponent:Hy,onError:function(){},onStepDone:function(){},steps:void 0,detectIdCard:void 0,outputEncryptionSettings:null};var Ib=function(e){var t=I({},e),n=t.clientSettings,a=t.onError,i=t.onStepDone,s=t.logCredentials,c=t.uiOnlyComponent,u=t.detectIdCard,l=t.outputEncryptionSettings,d=t.steps,f=Sb({clientSettings:n}).settings,p=o(function(){var e=S(regeneratorRuntime.mark((function e(r){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i(x(x({},r),{},{restartSession:null==h?void 0:h.handleRestartSession}));case 2:return t=e.sent,e.abrupt("return",t);case 4:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[i,null==h?void 0:h.handleRestartSession]),h=I({},eb({settings:f,onError:a,detectIdCard:u,outputEncryptionSettings:l,steps:d,onStepDone:p}));return r.createElement(mg,null,r.createElement(Pn.SDKTrackingProvider,{value:{tracking:x({},s)}},r.createElement(c,I({},t,{onStepDone:p,settings:f,scannerTypeCons:Yy},h))))};function Tb(e){var t=e.sdkAdapter;return t instanceof js?r.createElement(Ib,x({sdkAdapter:t},e)):r.createElement(_b,e)}Ib.propTypes={clientSettings:h.shape({}),onError:h.func,onStepDone:h.func,logCredentials:h.shape({}),readIDCardUIOnlyComponent:h.func,uiOnlyComponent:h.func,sdkAdapter:h.shape({}),steps:h.arrayOf(h.shape({})),detectIdCard:h.func,outputEncryptionSettings:h.shape({})},Ib.defaultProps={clientSettings:void 0,onError:function(){},onStepDone:function(){},logCredentials:{enable:!0},readIDCardUIOnlyComponent:_b,uiOnlyComponent:Hy,sdkAdapter:null,steps:void 0,detectIdCard:void 0,outputEncryptionSettings:null};var xb={sdkAdapter:h.shape({})};Tb.propTypes=xb,Tb.defaultProps={sdkAdapter:null};var Pb=K.IDCardSide,Rb=K.Errors;function Db(e){return Nb.apply(this,arguments)}function Nb(){return(Nb=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.image,n=r.cardType,a=r.cardSide,o=r.apiClient,i=r.outputEncryptionSettings,s={label:"id_card.".concat(n,".").concat(a)},!i||!i.key){e.next=4;break}return e.abrupt("return",o.httpClient.post("/v1/images",x({base64:t.encrypted.hex},s),{"X-TV-Key":i.key}));case 4:return e.abrupt("return",o.uploadImage(x({file:t.blob},s)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Lb(e){return Ob.apply(this,arguments)}function Ob(){return(Ob=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.image,n=r.apiClient,a=r.rawString,o=r.outputEncryptionSettings,i={label:"qr_code",metadata:JSON.stringify({raw:a})},!o||!o.key){e.next=4;break}return e.abrupt("return",n.httpClient.post("/v1/images",x({base64:t.encrypted.hex},i),{"X-TV-Key":o.key}));case 4:return e.abrupt("return",n.uploadImage(x({file:t.blob},i)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Mb(e){return Fb.apply(this,arguments)}function Fb(){return(Fb=S(regeneratorRuntime.mark((function e(r){var t,n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.imageId,n=r.cardType,a=r.apiClient,e.abrupt("return",a.requestVerifyIDCard({card_type:n,image1:{id:t}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ub(e){return Vb.apply(this,arguments)}function Vb(){return(Vb=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,u,l,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.apiClient,n=r.cardType,a=r.frontCardId,o=r.isCapturingFrontSide,i=r.backCardId,s=r.recordedVideos,c=r.qrImageId,u=s.filter((function(e){return null!==e.id})),l=s.filter((function(e){return null===e.id&&e.frames.length>0})),e.next=5,Promise.all(l.map((function(e){return t.fileService.request({frames:e.frames})})));case 5:return d=e.sent,f={card_type:n,image:{id:a},image2:o?void 0:{id:i},videos:[].concat(M(u.map((function(e){return{id:e.id}}))),M(d.map((function(e){return{id:e.data.file_id}}))))},c&&(f.qr1_images=[{id:c}]),e.abrupt("return",t.detectIDTampering(f));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jb(e){return zb.apply(this,arguments)}function zb(){return(zb=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.cardType,n=r.apiClient,a=r.frontCardId,o=r.backCardId,i=r.isCapturingFrontSide,s=r.qrImageId,c={card_type:t,image1:i?{id:a}:{id:o}},s&&(c.qr1_images=[{id:s}]),e.abrupt("return",n.readIDCard(c));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Kb(e){return Hb.apply(this,arguments)}function Hb(){return(Hb=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,B,E,S;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.image,a=r.frontCardId,o=r.qrImageId,i=r.onError,s=r.recordedVideos,c=r.apiClient,u=r.cardType,l=r.cardSide,d=r.qrScannedResult,f=r.outputEncryptionSettings,l!==Pb.BACK||a){e.next=4;break}return i(Rb.missing_front_id_card),e.abrupt("return");case 4:return p=[Db({image:n,cardType:u,cardSide:l,apiClient:c,outputEncryptionSettings:f})],d&&d.image&&d.result&&p.push(Lb({image:d.image,apiClient:c,rawString:d.result,outputEncryptionSettings:f})),e.next=8,Promise.all(p);case 8:if(h=e.sent,m=O(h,2),g=m[0],v=m[1],!g.errors){e.next=15;break}return i(x(x({},Rb.upload_error),{},{details:g.errors})),e.abrupt("return");case 15:return y=g.data.image_id,b=(null==v||null===(t=v.data)||void 0===t?void 0:t.image_id)||o,(k=l===Pb.FRONT)?C=y:(C=a,w=y),e.next=21,Mb({imageId:y,cardType:u,apiClient:c});case 21:if(!(B=e.sent).errors){e.next=25;break}return i(x(x({},Rb.sanity_check_error),{},{details:B.errors})),e.abrupt("return");case 25:return e.next=27,jb({cardType:u,apiClient:c,frontCardId:C,backCardId:w,isCapturingFrontSide:k,qrImageId:b});case 27:if(!(E=e.sent).errors){e.next=31;break}return i(x(x({},Rb.read_id_card_error),{},{details:E.errors})),e.abrupt("return");case 31:return e.next=33,Ub({apiClient:c,cardType:u,frontCardId:C,isCapturingFrontSide:k,backCardId:w,recordedVideos:s,qrImageId:b});case 33:if(!(S=e.sent).errors){e.next=37;break}return i(x(x({},Rb.detect_id_tampering_error),{},{details:S.errors})),e.abrupt("return");case 37:return e.abrupt("return",{sanityResult:B.data,tamperingInfo:S.data,cardInfo:E.data,qrImageId:b});case 38:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var qb=["readIDCardUIOnlyComponent"],Gb=["onError","onStepDone","apiCredentials","logCredentials","outputEncryptionSettings"],Wb=K.Errors,Qb=function(e){var t=e.readIDCardUIOnlyComponent,n=N(e,qb),s=n.onError,u=n.onStepDone,l=n.apiCredentials,d=n.logCredentials,f=n.outputEncryptionSettings,p=N(n,Gb),h=O(c(null),2),m=h[0],g=h[1],v=Fo.useApiClient({apiCredentials:l,logCredentials:d}).apiClient,y=a(""),b=a("");i((function(){function e(){return(e=S(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v.clientSettings();case 2:r=e.sent,g(r);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[v]);var C=o(function(){var e=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.cardType,n=r.cardSide,a=r.recordedVideos,o=r.qrScannedResult,i=r.image,c=null,e.prev=2,e.next=5,Kb({image:i,cardSide:n,frontCardId:y.current,qrImageId:b.current,onError:s,apiClient:v,cardType:t,recordedVideos:a,qrScannedResult:o,outputEncryptionSettings:f});case 5:c=e.sent,n===K.IDCardSide.FRONT&&(y.current=c.cardInfo.image1.id),b.current=c.qrImageId,e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),s(x(x({},Wb.api_call_error),{},{details:e.t0}));case 13:c&&u(x(x({},r),{},{apiResult:c}));case 14:case"end":return e.stop()}}),e,null,[[2,10]])})));return function(r){return e.apply(this,arguments)}}(),[v,s,u,f]);return m&&r.createElement(t,I({logCredentials:d,onError:s,onStepDone:C,outputEncryptionSettings:f},p,{clientSettings:m}))};function Xb(){return(Xb=S(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=c.length>0&&void 0!==c[0]?c[0]:{},t=r.opencvUrl,n=r.idCardModelUrl,a=r.tfScriptUrls,o=r.blazefaceModelUrl,i=r.closeEyesModelUrl,s=new ev,e.prev=2,di.loadTensorFlow(a).then((function(){di.loadBlazefaceModel({modelUrl:o})})),e.next=6,Promise.all([Uf({closeEyesModelUrl:i}),s.loadResource({modelUrl:n}),Xg({url:t})]);case 6:e.next=10;break;case 8:e.prev=8,e.t0=e.catch(2);case 10:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}Qb.propTypes={onError:h.func,onStepDone:h.func,apiCredentials:h.shape({accessKey:h.string,secretKey:h.string,apiUrl:h.string}),logCredentials:h.shape({}),outputEncryptionSettings:h.shape({}),readIDCardUIOnlyComponent:h.func},Qb.defaultProps={onError:function(){},onStepDone:function(){},apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},logCredentials:{enable:!0},outputEncryptionSettings:{key:""},readIDCardUIOnlyComponent:Tb};var Yb=Ff((function(){return Xb.apply(this,arguments)})),Zb=function(){var e=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.blob,n=r.resultWarmup,a=n.idCardModel,o=n.ableToUseModel){e.next=4;break}return e.abrupt("return",{ableToUseModel:o});case 4:return e.next=6,So.blobToCanvas({blob:t});case 6:return i=e.sent,e.abrupt("return",a.predict(i,{detectThreshold:.3}));case 8:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),$b={id_card_sanity:3,portrait_sanity:3,face_liveness_with_card_tampering_ocr:3,compare_faces:3},Jb={card_sanity:!0,card_tampering:!0,card_ocr:!0,face_sanity:!0,face_liveness:!0,compare_faces:!0,search_face:!0,index_face:!0},eC="ID_CARD",rC="FACE_LIVENESS",tC="IDLE",nC={},aC={REACH_RETRY_LIMIT:{en:"You have reached the retry limit. Please try again later.",vi:"Bạn đã vượt quá số lần thử. Vui lòng thử lại sau."},FAIL_STEP:{en:"Please try again at step: <%= step %>.",vi:"Vui lòng thử lại ở bước: <%= step %>."},FAIL_FRONT_CARD_SANITY:{en:"The front side of your ID card failed sanity check.",vi:"Hình ảnh Mặt trước của GTTT không đạt chất lượng yêu cầu."},FAIL_FRONT_CARD_TAMPERING:{en:"The front side of your ID card failed tampering check.",vi:"Hình ảnh Mặt trước của GTTT không hợp lệ."},FAIL_FRONT_CARD_OCR:{en:"Cannot read information on the front side of your ID card.",vi:"Không đọc được thông tin từ hình ảnh Mặt trước của GTTT."},FAIL_BACK_CARD_SANITY:{en:"The back side of your ID card failed sanity check.",vi:"Hình ảnh Mặt sau của GTTT không đạt chất lượng yêu cầu."},FAIL_BACK_CARD_TAMPERING:{en:"The back side of your ID card failed tampering check.",vi:"Hình ảnh Mặt sau của GTTT không hợp lệ."},FAIL_BACK_CARD_OCR:{en:"Cannot read information on the back side of your ID card.",vi:"Không đọc được thông tin từ hình ảnh Mặt sau của GTTT."},FAIL_FACE_SANITY:{en:"Selfie step failed sanity check.",vi:"Hình ảnh khuôn mặt không đạt chất lượng yêu cầu."},FAIL_FACE_LIVENESS:{en:"Selfie step failed liveness check.",vi:"Hình ảnh khuôn mặt không hợp lệ."},FAIL_COMPARE_FACE:{en:"Failed compare faces between ID photo and selfie.",vi:"Hình ảnh khuôn mặt trên GTTT không giống hình chụp chân dung"},RETRY_BUTTON:{en:"Retry",vi:"Thử lại"},STOP_BUTTON:{en:"Stop",vi:"Dừng"},FRONT_CARD:{en:"Front Card",vi:"Mặt trước"},BACK_CARD:{en:"Back Card",vi:"Mặt sau"},ID_CARD:{en:"ID Card",vi:"Thẻ ID"},FACE_LIVENESS:{en:"Face Liveness",vi:"Nhận diện khuôn mặt"}},oC=Nl((function(e,r,t,n){kb(e,r,t,n)})),iC=["restartSession"],sC=["detectIDTamperingBackground","readIDCardBackground"],cC=["restartSession"],uC=["detectIDTamperingBackground","readIDCardBackground"];function lC(e){if(!function(e){return"object"===B(e)&&"function"==typeof e.then}(e))return"pending";var r={};return Promise.race([e,r]).then((function(e){return e===r?"pending":"fulfilled"}),(function(){return"rejected"}))}var dC,fC,pC,hC=function(e,r){return null===r?e:r},mC=function(e,r){if(!Pf(r,"face_sanity"))return!1;var t=Pf(e,"verifyFacePortraitResult.status",""),n=Pf(e,"verifyFacePortraitResult.portrait_sanity.verdict","");return"success"!==t||"good"!==n},gC=function(){var e=S(regeneratorRuntime.mark((function e(r,t,n){var a,o,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,B,E,S,_,A,I,T,P,R,D,N,L,O,M,F,U,V,j,z,K,H,q;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=!1,!Pf(t,"card_tampering")){e.next=29;break}return o=Pf(r.current,"frontCard.apiResult.detectIDTamperingBackground"),e.next=5,lC(o);case 5:if("fulfilled"!==e.sent){e.next=15;break}return e.next=9,Pf(r.current,"frontCard.apiResult.detectIDTamperingBackground");case 9:d=e.sent,f=d.result,p=d.message,h=bC(f,t),r.current=x(x({},r.current),{},{frontCard:x(x({},null!==(i=null===(s=r.current)||void 0===s?void 0:s.frontCard)&&void 0!==i?i:{}),{},{apiResult:x(x({},null!==(c=null===(u=r.current)||void 0===u||null===(l=u.frontCard)||void 0===l?void 0:l.apiResult)&&void 0!==c?c:{}),{},{tamperingInfo:x(x({},null==f?void 0:f.data),{},{message:Pf(p,h?"error":"success")})})})}),a=a||h;case 15:if(!n){e.next=29;break}return m=Pf(r.current,"backCard.apiResult.detectIDTamperingBackground"),e.next=19,lC(m);case 19:if("fulfilled"!==e.sent){e.next=29;break}return e.next=23,Pf(r.current,"backCard.apiResult.detectIDTamperingBackground");case 23:w=e.sent,k=w.result,B=w.message,E=bC(k,t),r.current=x(x({},r.current),{},{backCard:x(x({},null!==(g=null===(v=r.current)||void 0===v?void 0:v.backCard)&&void 0!==g?g:{}),{},{apiResult:x(x({},null!==(y=null===(b=r.current)||void 0===b||null===(C=b.backCard)||void 0===C?void 0:C.apiResult)&&void 0!==y?y:{}),{},{tamperingInfo:x(x({},null==k?void 0:k.data),{},{message:Pf(B,E?"error":"success")})})})}),a=a||E;case 29:if(!Pf(t,"card_ocr")){e.next=57;break}return S=Pf(r.current,"frontCard.apiResult.readIDCardBackground"),e.next=33,lC(S);case 33:if("fulfilled"!==e.sent){e.next=43;break}return e.next=37,Pf(r.current,"frontCard.apiResult.readIDCardBackground");case 37:R=e.sent,D=R.result,N=R.message,L="success"===Pf(D,"data.status",""),r.current=x(x({},r.current),{},{frontCard:x(x({},null!==(_=null===(A=r.current)||void 0===A?void 0:A.frontCard)&&void 0!==_?_:{}),{},{apiResult:x(x({},null!==(I=null===(T=r.current)||void 0===T||null===(P=T.frontCard)||void 0===P?void 0:P.apiResult)&&void 0!==I?I:{}),{},{cardInfo:x(x({},null==D?void 0:D.data),{},{message:Pf(N,L?"success":"error")})})})}),a=a||bC(D,t);case 43:if(!n){e.next=57;break}return O=Pf(r.current,"backCard.apiResult.readIDCardBackground"),e.next=47,lC(O);case 47:if("fulfilled"!==e.sent){e.next=57;break}return e.next=51,Pf(r.current,"backCard.apiResult.readIDCardBackground");case 51:z=e.sent,K=z.result,H=z.message,q="success"===Pf(K,"data.status",""),r.current=x(x({},r.current),{},{backCard:x(x({},null!==(M=null===(F=r.current)||void 0===F?void 0:F.backCard)&&void 0!==M?M:{}),{},{apiResult:x(x({},null!==(U=null===(V=r.current)||void 0===V||null===(j=V.backCard)||void 0===j?void 0:j.apiResult)&&void 0!==U?U:{}),{},{cardInfo:x(x({},null==K?void 0:K.data),{},{message:Pf(H,q?"success":"error")})})})}),a=a||bC(K,t);case 57:return e.abrupt("return",a);case 58:case"end":return e.stop()}}),e)})));return function(r,t,n){return e.apply(this,arguments)}}(),vC=function(e){var r=Pf(e,"verifyFaceLivenessResult.is_live",!1),t=Pf(e,"verifyFaceLivenessResult.status","");return!r||"success"!==t},yC=function(e,r){if(!Pf(r,"card_sanity"))return!1;var t=Pf(e,"apiResult.sanityResult.status",""),n=Pf(e,"apiResult.sanityResult.card_sanity.verdict","");return"success"!==t||"good"!==n},bC=function(e,r){return!!Pf(e,"errors")||(Pf(r,"card_tampering")&&Object.prototype.hasOwnProperty.call(null==e?void 0:e.data,"card_tampering")?"success"!==Pf(e,"data.status","")||"good"!==Pf(e,"data.card_tampering.verdict",""):!(!Pf(r,"card_ocr")||!Object.prototype.hasOwnProperty.call(null==e?void 0:e.data,"card_information"))&&"success"!==Pf(e,"data.status",""))},CC=function(e){var r,t=Pf(e,"compare_faces",[]);return"matched"!==(null===(r=t[0])||void 0===r?void 0:r.result)||1!==t.filter((function(e){return"matched"===(null==e?void 0:e.result)})).length||e.errors},wC=function(){var e=S(regeneratorRuntime.mark((function e(r,t,n){var a,o,i,s,c,u,l,d,f,p,h,m,g,v,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=!1,!Pf(t,"card_tampering")){e.next=18;break}return e.next=4,Pf(r.current,"frontCard.apiResult.detectIDTamperingBackground");case 4:if(o=e.sent,i=o.result,s=o.message,c=bC(i,t),a=a||c,r.current=x(x({},r.current),{},{frontCard:x(x({},r.current.frontCard),{},{apiResult:x(x({},r.current.frontCard.apiResult),{},{tamperingInfo:x(x({},null==i?void 0:i.data),{},{message:Pf(s,c?"error":"success")})})})}),!n){e.next=18;break}return e.next=13,Pf(r.current,"backCard.apiResult.detectIDTamperingBackground");case 13:u=e.sent,l=u.result,d=bC(l,t),a=a||d,r.current=x(x({},r.current),{},{backCard:x(x({},r.current.backCard),{},{apiResult:x(x({},r.current.backCard.apiResult),{},{tamperingInfo:x(x({},null==l?void 0:l.data),{},{message:Pf(s,d?"error":"success")})})})});case 18:if(!Pf(t,"card_ocr")){e.next=35;break}return e.next=21,Pf(r.current,"frontCard.apiResult.readIDCardBackground");case 21:if(f=e.sent,p=f.result,h=f.message,m="success"===Pf(p,"data.status",""),a=a||!m,r.current=x(x({},r.current),{},{frontCard:x(x({},r.current.frontCard),{},{apiResult:x(x({},r.current.frontCard.apiResult),{},{cardInfo:x(x({},null==p?void 0:p.data),{},{message:Pf(h,m?"success":"error")})})})}),!n){e.next=35;break}return e.next=30,Pf(r.current,"backCard.apiResult.readIDCardBackground");case 30:g=e.sent,v=g.result,y="success"===Pf(v,"data.status",""),a=a||!y,r.current=x(x({},r.current),{},{backCard:x(x({},r.current.backCard),{},{apiResult:x(x({},r.current.backCard.apiResult),{},{cardInfo:x(x({},null==v?void 0:v.data),{},{message:Pf(h,y?"success":"error")})})})});case 35:return e.abrupt("return",a);case 36:case"end":return e.stop()}}),e)})));return function(r,t,n){return e.apply(this,arguments)}}(),kC=function e(r){for(var t in r)"message"===t||"step"===t?delete r[t]:"object"===B(r[t])&&e(r[t]);return r},BC=function(){var e=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=kC(r.current),n=Pf(t,"frontCard",{}),n.restartSession,a=N(n,iC),o=Pf(t,"frontCard.apiResult",{}),o.detectIDTamperingBackground,o.readIDCardBackground,i=N(o,sC),s=Pf(t,"backCard",{}),s.restartSession,c=N(s,cC),u=Pf(t,"backCard.apiResult",{}),u.detectIDTamperingBackground,u.readIDCardBackground,l=N(u,uC),e.abrupt("return",x(x(x({},t),Pf(t,"frontCard",null)?{frontCard:x(x({},a),{},{apiResult:i})}:{}),Pf(t,"backCard",null)?{backCard:x(x({},c),{},{apiResult:l})}:{}));case 10:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),EC=function(e,r,t){var n=[];if(Pf(e,"frontCard.apiResult.sanityResult")&&"good"!==Pf(e,"frontCard.apiResult.sanityResult.card_sanity.verdict","")){var a=Pf(e,"frontCard.apiResult.sanityResult.message",null);null!=a&&a[t]?n.push(a[t]):n.push(aC.FAIL_FRONT_CARD_SANITY[t])}if(Pf(e,"frontCard.apiResult.tamperingInfo")&&"good"!==Pf(e,"frontCard.apiResult.tamperingInfo.card_tampering.verdict","")){var o=Pf(e,"frontCard.apiResult.tamperingInfo.message",null);null!=o&&o[t]?n.push(o[t]):n.push(aC.FAIL_FRONT_CARD_TAMPERING[t])}if(Pf(e,"frontCard.apiResult.cardInfo")&&"success"!==Pf(e,"frontCard.apiResult.cardInfo.status","")){var i=Pf(e,"frontCard.apiResult.cardInfo.message",null);null!=i&&i[t]?n.push(i[t]):n.push(aC.FAIL_FRONT_CARD_OCR[t])}if(Pf(e,"backCard.apiResult.sanityResult")&&"good"!==Pf(e,"backCard.apiResult.sanityResult.card_sanity.verdict","")){var s=Pf(e,"backCard.apiResult.sanityResult.message",null);null!=s&&s[t]?n.push(s[t]):n.push(aC.FAIL_BACK_CARD_SANITY[t])}if(Pf(e,"backCard.apiResult.tamperingInfo")&&"good"!==Pf(e,"backCard.apiResult.tamperingInfo.card_tampering.verdict","")){var c=Pf(e,"backCard.apiResult.tamperingInfo.message",null);null!=c&&c[t]?n.push(c[t]):n.push(aC.FAIL_BACK_CARD_TAMPERING[t])}if(Pf(e,"backCard.apiResult.cardInfo")&&"success"!==Pf(e,"backCard.apiResult.cardInfo.status","")){var u=Pf(e,"backCard.apiResult.cardInfo.message",null);null!=u&&u[t]?n.push(u[t]):n.push(aC.FAIL_BACK_CARD_OCR[t])}if(Pf(e,"faceLiveness.verifyFacePortraitResult")&&"good"!==Pf(e,"faceLiveness.verifyFacePortraitResult.portrait_sanity.verdict","")){var l=Pf(e,"faceLiveness.verifyFacePortraitResult.message",null);null!=l&&l[t]?n.push(l[t]):n.push(aC.FAIL_FACE_SANITY[t])}if(Pf(e,"faceLiveness.verifyFaceLivenessResult")&&!Pf(e,"faceLiveness.verifyFaceLivenessResult.is_live",!1)){var d=Pf(e,"faceLiveness.verifyFaceLivenessResult.message",null);null!=d&&d[t]?n.push(d[t]):n.push(aC.FAIL_FACE_LIVENESS[t])}if(Pf(e,"compareFaces",null)&&CC(Pf(e,"compareFaces"))){var f=Pf(e,"compareFaces.message",null);null!=f&&f[t]?n.push(f[t]):n.push(aC.FAIL_COMPARE_FACE[t])}return{retryAt:r,results:n}},SC=function(e){var r=Pf(e,"frontCard.apiResult.cardInfo.card_information",[]).find((function(e){return"id"===e.field}));return Pf(r,"value","")},_C=["livenessMode","sdkAdapter","onError","services","hasBackCard"],AC=K.Errors,IC=K.IDCardSide,TC=K.FaceDirection,xC=K.Mode;function PC(e){return RC.apply(this,arguments)}function RC(){return(RC=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,B,E,S,_,A,I,T,P,R,D,N,L,F,U,V,j,z,K,H,q,G;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=r.hasBackCard,o=r.stepResult,i=r.frontCardId,s=r.qrImageId,c=r.sdkAdapter,u=r.onError,l=r.checkFinishAndFailCardTamperingOrOCR,d=r.refEkycResult,f=r.handleFailCardTamperingOCRBackground,p=r.services,c instanceof js){e.next=3;break}return e.abrupt("return",o);case 3:if(h=o.cardSide,m=o.cardType,g=o.recordedVideos,v=o.qrScannedResult,y=o.image,h!==IC.BACK||i){e.next=7;break}return u(AC.missing_front_id_card),e.abrupt("return",!1);case 7:return b=c.uploadImage,C=c.uploadFiles,w=c.requestVerifyIDCard,k=c.detectIDTampering,B=c.readIDCard,E=[b({file:null==y?void 0:y.blob,label:"id_card.".concat(m,".").concat(h)})],v&&v.image&&v.result&&E.push(b({file:v.image.blob,label:"qr_code",rawString:v.result})),e.next=12,Promise.all(E);case 12:if(S=e.sent,_=O(S,2),A=_[0],I=_[1],!A.errors){e.next=19;break}return u(x(x({},AC.upload_error),{},{details:A.reason})),e.abrupt("return",!1);case 19:if(T=null==A||null===(t=A.data)||void 0===t?void 0:t.image_id,P=(null==I||null===(n=I.data)||void 0===n?void 0:n.image_data)||s,h===IC.FRONT?R=T:(R=i,D=T),N={qrImageId:P,frontCardId:R,backCardId:D},!Pf(p,"card_sanity")){e.next=32;break}return e.next=26,w({card_type:m,image1:{id:h===IC.FRONT?R:D}});case 26:if(L=e.sent,F=L.result,U=L.message,"good"===Pf(F,"data.card_sanity.verdict","")&&!F.errors){e.next=31;break}return e.abrupt("return",x(x({},o),{},{apiResult:x(x({},N),{},{sanityResult:x(x({},null==F?void 0:F.data),{},{message:Pf(U,"error")}),failSanity:!0})}));case 31:N=x(x({},N),{},{sanityResult:x(x({},null==F?void 0:F.data),{},{message:Pf(U,"success")})});case 32:if(h!==IC.BACK){e.next=40;break}if("function"!=typeof l||"function"!=typeof f){e.next=40;break}return e.next=36,l(d,p,a);case 36:if(!e.sent){e.next=40;break}return f(),e.abrupt("return",x(x({},o),{},{apiResult:x(x({},N),{},{failSanity:!0})}));case 40:if(!Pf(p,"card_tampering")){e.next=51;break}if(j=x({card_type:m,image:{id:R}},h===IC.FRONT?{image2:void 0,level:"1"}:{image2:{id:D},level:"concurrent"}),P&&(j.qr1_images=[{id:P}]),!(g.length>0)){e.next=50;break}return z=g.filter((function(e){return null!==e.id})),K=g.filter((function(e){return null===e.id&&e.frames.length>0})),e.next=48,Promise.all(K.map((function(e){return C({frames:e.frames})})));case 48:H=e.sent,j.videos=[].concat(M(z.map((function(e){return{id:e.id}}))),M(H.map((function(e){return{id:e.data.file_id}}))));case 50:V=k(j);case 51:return Pf(p,"card_ocr")&&(G={card_type:m,image1:h===IC.FRONT?{id:R}:{id:D}},P&&(G.qr1_images={id:P}),q=B(G)),e.abrupt("return",x(x({},o),{},{apiResult:x(x({},N),{},{detectIDTamperingBackground:V,readIDCardBackground:q})}));case 53:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function DC(e){return NC.apply(this,arguments)}function NC(){return(NC=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,B;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.stepResult,n=r.sdkAdapter,a=r.services,o=t.faceVerificationFlowData,i=t.captureFrameSettings,s=t.capturedFrames,c=n.uploadImage,u=n.verifyFaceLiveness,l=n.requestVerifyPortrait,d=o.current.steps,f=[],d.forEach((function(e){var r=e.name,t=e.image,n=e.frontalFaceImage;r!==TC.FRONTAL?f.push(c({file:t.blob,label:"portrait",metadata:JSON.stringify({gesture_score:t.leftRightScore,gesture:r})})):f.push(Promise.resolve({data:{image_id:null}})),n.blob?f.push(c({file:n.blob,label:"portrait",metadata:JSON.stringify({gesture_score:n.leftRightScore,gesture:TC.FRONTAL})})):f.push(Promise.resolve({data:{image_id:null}}))})),e.next=8,Promise.all(f);case 8:if(p=e.sent,d.forEach((function(e,r){e.image.imageId=p[2*r].data.image_id,e.frontalFaceImage.imageId=p[2*r+1].data.image_id})),0!==(h=d.filter((function(e){return e.frontalFaceImage.imageId}))).length){e.next=13;break}return e.abrupt("return",{error:"wrong_face_movement"});case 13:return e.next=15,ep();case 15:if(m=rp(i)){e.next=18;break}return e.abrupt("return",{error:"network_error"});case 18:if(g={frontalFaces:h.map((function(e){return{id:e.frontalFaceImage.imageId,blob:e.frontalFaceImage.blob}})),steps:d.filter((function(e){return e.image.imageId&&e.name!==TC.FRONTAL})).map((function(e){var r=e.name,t=e.image;return{name:r,blob:t.blob,id:t.imageId}})),capturedFrames:s},!Pf(a,"face_sanity")){e.next=28;break}return e.next=22,l({image:{id:h[h.length-1].frontalFaceImage.imageId}});case 22:if(v=e.sent,y=v.result,b=v.message,"good"===Pf(y,"data.portrait_sanity.verdict","")&&!Pf(y,"errors")){e.next=27;break}return e.abrupt("return",x(x({},g),{},{verifyFacePortraitResult:x(x({},y.data),{},{message:Pf(b,"error")})}));case 27:g=x(x({},g),{},{verifyFacePortraitResult:x(x({},y.data),{},{message:Pf(b,"success")})});case 28:if(!Pf(a,"face_liveness")){e.next=36;break}return e.next=31,u({images:h.map((function(e){return{id:e.frontalFaceImage.imageId}})),gesture_images:d.filter((function(e){return e.image.imageId&&e.name!==TC.FRONTAL})).map((function(e){return{gesture:e.name,images:[{id:e.image.imageId}]}})),videos:m});case 31:C=e.sent,w=C.result,k=C.message,B=Pf(w,"data.is_live"),g=x(x({},g),{},{verifyFaceLivenessResult:x(x({},w.data),{},{message:Pf(k,B?"success":"error")})});case 36:return e.abrupt("return",g);case 37:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function LC(e){return OC.apply(this,arguments)}function OC(){return(OC=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,u,l,d,f,p,h,m,g,v,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.stepResult,n=r.sdkAdapter,a=r.services,o=t.imageAddedExif,i=t.frontalFaceImages,s=t.capturedFrames,c=n.uploadImage,u=n.verifyFaceLiveness,l=n.requestVerifyPortrait,d=i.map((function(e,r){return c({file:o[r],label:"portrait",metadata:{gesture_score:e.leftRightScore,gesture:TC.FRONTAL}})})),e.next=6,Promise.all(d);case 6:if(f=e.sent,p=f.map((function(e){var r;return{id:null==e||null===(r=e.data)||void 0===r?void 0:r.image_id}})),h={images:p,capturedFrames:s,frontalFaces:o.map((function(e,r){var t;return{blob:e,id:null===(t=p[r])||void 0===t?void 0:t.id}}))},!Pf(a,"face_sanity")){e.next=17;break}return e.next=12,l({image:{id:p[p.length-1].id}});case 12:if(m=e.sent,g=m.result,"good"===Pf(g,"data.portrait_sanity.verdict","")&&!Pf(g,"errors")){e.next=16;break}return e.abrupt("return",x(x({},t),{},{verifyFacePortraitResult:g.data}));case 16:h=x(x({},h),{},{verifyFacePortraitResult:g.data});case 17:return e.next=19,u({images:p.map((function(e){return{id:e.id}}))});case 19:return v=e.sent,y=v.result,e.abrupt("return",x(x({},h),{},{verifyFaceLivenessResult:y.data}));case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function MC(e){return FC.apply(this,arguments)}function FC(){return(FC=S(regeneratorRuntime.mark((function e(r){var t,n,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.stepResult,n=r.sdkAdapter,a=r.services,(o=t.mode)!==xC.ACTIVE){e.next=4;break}return e.abrupt("return",DC({stepResult:t,sdkAdapter:n,services:a}));case 4:if(o!==xC.PASSIVE){e.next=6;break}return e.abrupt("return",LC({stepResult:t,sdkAdapter:n,services:a}));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function UC(e){return VC.apply(this,arguments)}function VC(){return(VC=S(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,B;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.livenessMode,n=r.sdkAdapter,r.onError,a=r.services,o=r.hasBackCard,i=N(r,_C),n instanceof js){e.next=3;break}return e.abrupt("return",i);case 3:if(s=n.compareFaces,c=n.searchFaces,u=n.indexFaces,l=Pf(r,"frontCard.apiResult.frontCardId",null),d=Pf(r,"backCard.apiResult.backCardId",null),f=null,p=Pf(r,"faceLiveness.frontalFaces",[]),f=null===(t=p[p.length-1])||void 0===t?void 0:t.id,l&&(!o||d)&&f){e.next=11;break}return e.abrupt("return");case 11:if(h=x({},i),!Pf(a,"compare_faces")){e.next=21;break}return e.next=15,s({image1:{id:l},image2:{id:f}});case 15:if(m=e.sent,g=m.result,v=m.message,!CC(Pf(g,"data"))){e.next=20;break}return e.abrupt("return",x(x({},h),{},{step:eC,compareFaces:x(x({},null==g?void 0:g.data),{},{message:v})}));case 20:h=x(x({},h),{},{compareFaces:x(x({},null==g?void 0:g.data),{},{message:v})});case 21:if(!Pf(a,"search_face")){e.next=30;break}return e.next=24,c({image:{id:f}});case 24:if(y=e.sent,b=y.result,!((C=Pf(b,"data.faces",null))||Array.isArray(C)&&C.length)){e.next=29;break}return e.abrupt("return",x(x({},h),{},{searchFaces:null==b?void 0:b.data}));case 29:h=x(x({},h),{},{searchFaces:null==b?void 0:b.data});case 30:if(!Pf(a,"index_face")){e.next=37;break}return w=SC(r),e.next=34,u({image:x({id:f},w?{metadata:JSON.stringify({id:SC(r)})}:{})});case 34:k=e.sent,B=k.result,h=x(x({},h),{},{indexFaces:null==B?void 0:B.data});case 37:return e.abrupt("return",h);case 38:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var jC,zC,KC=m.div(dC||(dC=L(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),HC=m.button(fC||(fC=L(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n background-color: #0276f1;\n border: 0;\n outline: none;\n border-radius: 0.25rem;\n color: #fff;\n font-weight: 400;\n cursor: pointer;\n font-size: 1rem;\n"]))),qC=m.div(pC||(pC=L(["\n margin: 20px 0;\n width: 100%;\n display: flex;\n justify-content: space-evenly;\n gap: 10px;\n"]))),GC=function(e){var t=e.onRetry,n=e.onStop,a=e.children,o=$t.useSDKSettings().lang;return r.createElement(KC,null,a,r.createElement(qC,null,r.createElement(HC,{onClick:n},aC.STOP_BUTTON[o]),r.createElement(HC,{onClick:t},aC.RETRY_BUTTON[o])))};GC.propTypes={children:h.node,onRetry:h.func,onStop:h.func},GC.defaultProps={children:null,onRetry:function(){},onStop:function(){}};var WC=m.div(jC||(jC=L(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),QC=m.button(zC||(zC=L(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n background-color: #0276f1;\n border: 0;\n outline: none;\n border-radius: 0.25rem;\n color: #fff;\n font-weight: 400;\n cursor: pointer;\n font-size: 1rem;\n"]))),XC=function(e){var t=e.onStop,n=e.children,a=$t.useSDKSettings().lang;return r.createElement(WC,null,n,r.createElement(QC,{onClick:t},aC.STOP_BUTTON[a]))};XC.propTypes={children:h.node,onStop:h.func},XC.defaultProps={children:null,onStop:function(){}};var YC="FAIL_CARD_SANITY",ZC="FAIL_FACE_SANITY",$C="FAIL_LIVENESS_TAMPERING_OCR_RETRY_ID",JC="FAIL_LIVENESS_TAMPERING_OCR_RETRY_FACE",ew="FAIL_COMPARE_FACES",rw="RESET_ACTIONS",tw="SET_STEP",nw={currentStep:null,readIdCardKey:0,faceLivenessKey:0,cardSanityTrials:-1,compareFacesTrials:-1,portraitSanityTrials:-1,faceLivenessCardTamperingOCRTrials:-1};function aw(e,r){switch(r.type){case YC:return x(x({},e),{},{cardSanityTrials:e.cardSanityTrials+1});case ZC:return x(x({},e),{},{portraitSanityTrials:e.portraitSanityTrials+1,faceLivenessKey:e.faceLivenessKey+1});case $C:return x(x({},e),{},{readIdCardKey:e.readIdCardKey+1,faceLivenessCardTamperingOCRTrials:e.faceLivenessCardTamperingOCRTrials+1,currentStep:eC});case JC:return x(x({},e),{},{faceLivenessKey:e.faceLivenessKey+1,faceLivenessCardTamperingOCRTrials:e.faceLivenessCardTamperingOCRTrials+1,currentStep:rC});case ew:return x(x({},e),{},{compareFacesTrials:e.compareFacesTrials+1,readIdCardKey:e.readIdCardKey+1,faceLivenessKey:e.faceLivenessKey+1,currentStep:eC});case tw:return x(x({},e),{},{currentStep:r.payload});case rw:return nw;default:return e}}var ow=K.IDCardSide,iw=K.Errors,sw={padding:50,paddingBottom:20},cw=function(e){var t=e.content,n=e.lang,a=e.isStopPopup,o=void 0!==a&&a;return r.createElement(r.Fragment,null,r.createElement("div",{style:sw},t.results.map((function(e,t){return r.createElement("div",{key:t},e)}))),o?null:r.createElement("div",{style:{padding:50,paddingBottom:0,color:"red"}},function(e,r){var t=Array.isArray(r)?r.map((function(r){return aC[r][e]})).join(", "):aC[r][e];return Kd(aC.FAIL_STEP[e])({step:t})}(n,t.retryAt)))};function uw(e){var t=$t.useSDKSettings().lang,s=e.onDoneEkyc,l=e.readIDCardProps,d=e.livenessDetectionProps,f=e.onError,p=e.onClose,h=e.sdkAdapter,m=e.flow,g=void 0===m?K.EkycFlow.FULL_FLOW:m,v=h.clientSettings,y=O(c(!1),2),b=y[0],C=y[1],w=O(c(!1),2),k=w[0],B=w[1],E=O(c(null),2),_=E[0],A=E[1],T=O(c(!1),2),P=T[0],R=T[1],D=O(u(aw,nw),2),N=D[0],L=D[1],M=N.currentStep,F=N.readIdCardKey,U=N.faceLivenessKey,V=N.cardSanityTrials,j=N.compareFacesTrials,z=N.portraitSanityTrials,H=N.faceLivenessCardTamperingOCRTrials,q=a(nC),G=a(),W=a(),Q=a(),X=a(""),Y=a(""),Z=n((function(){return function(e){var r=Pf(e,"data.settings.sdk_settings.sdk_adapter.services",null),t=Pf(e,"data.settings.sdk_settings.sdk_adapter.retries",null),n=oC(Jb,r,hC),a=oC($b,t,hC);return{cardSanityRetries:a.id_card_sanity,portraitSanityRetries:a.portrait_sanity,faceLivenessCardTamperingOCRRetries:a.face_liveness_with_card_tampering_ocr,compareFacesRetries:a.compare_faces,services:n}}(_)}),[_]),$=Z.cardSanityRetries,J=Z.portraitSanityRetries,ee=Z.faceLivenessCardTamperingOCRRetries,re=Z.compareFacesRetries,te=Z.services,ne=n((function(){return g===K.EkycFlow.FULL_FLOW||g===K.EkycFlow.ID_CARD}),[g]),ae=n((function(){return g===K.EkycFlow.FULL_FLOW||g===K.EkycFlow.FACE}),[g]),oe=Pf(_,"data.card_types[0].has_back_side",!0),ie=2===Pf(l,"steps",[]).length||oe;i((function(){function e(){return(e=S(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v();case 2:r=e.sent,A(r);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[v,h]),i((function(){L(ne?{type:tw,payload:eC}:{type:tw,payload:rC})}),[ne]),i((function(){(V>=$||z>=J||j>=re||H>=ee)&&B(!0)}),[$,V,j,re,J,z,ee,H,s]);var se=o((function(){L({type:"RESET_ACTIONS"}),C(!1),B(!1),q.current=nC,G.current=null,W.current=null}),[]);i((function(){return function(){return se()}}),[se]);var ce=o((function(){V+1<$?(W.current=EC(q.current,eC,t),G.current=function(){L({type:YC}),R(!1),"function"==typeof Q.current&&Q.current()},C(!0)):B(!0)}),[$,V,t]),ue=o((function(){H+1<ee?(W.current=EC(q.current,eC,t),G.current=function(){L({type:$C}),R(!1)},C(!0)):B(!0)}),[ee,H,t]),le=o((function(){z+1<J?(W.current=EC(q.current,rC,t),G.current=function(){L({type:ZC}),R(!1)},C(!0)):B(!0)}),[J,z,t]),de=o((function(e,r){H+1<ee?(W.current=EC(q.current,e,t),G.current=e===eC?function(){L({type:$C}),r||(q.current=nC)}:function(){L({type:JC})},C(!0)):B(!0)}),[ee,H,t]),fe=o((function(){j+1<re?(W.current=EC(q.current,[eC,rC],t),G.current=function(){L({type:ew}),q.current=nC,R(!1)},C(!0)):B(!0)}),[re,j,t]),pe=o(function(){var e=S(regeneratorRuntime.mark((function e(r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!ne){e.next=6;break}return e.next=3,wC(q,te,ie);case 3:if(!e.sent){e.next=6;break}return e.abrupt("return",eC);case 6:if(!r){e.next=8;break}return e.abrupt("return",rC);case 8:return e.abrupt("return",!1);case 9:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[ne,te,ie]),he=o(S(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,UC(x(x({},q.current),{},{livenessMode:d.mode,sdkAdapter:h,onError:f,services:te,hasBackCard:ie}));case 3:if(!(r=e.sent)){e.next=12;break}if(q.current=x(x({},q.current),r),!Pf(r,"step",null)){e.next=10;break}fe(),e.next=12;break;case 10:return BC(q).then((function(e){s(e)})),e.abrupt("return");case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(0),f(x(x({},iw.api_call_error),{},{details:e.t0}));case 17:case"end":return e.stop()}}),e,null,[[0,14]])}))),[ie,d.mode,h,f,te,fe,s]),me=o(function(){var e=S(regeneratorRuntime.mark((function e(r){var t,n,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"==typeof Pf(r,"restartSession")&&(Q.current=r.restartSession),R(!0),M!==eC){e.next=62;break}if(Pf(r,"cardSide")!==ow.FRONT){e.next=33;break}return e.next=6,PC({stepResult:r,frontCardId:X.current,qrImageId:Y.current,onError:f,sdkAdapter:h,services:te});case 6:if(!(t=e.sent)){e.next=12;break}X.current=t.apiResult.frontCardId,Y.current=t.apiResult.qrImageId,e.next=14;break;case 12:return R(!1),e.abrupt("return",!0);case 14:if(q.current=x(x({},q.current),{},{frontCard:t}),!yC(t,te)){e.next=18;break}return ce(),e.abrupt("return",ow.FRONT);case 18:if(ie){e.next=31;break}if(!ae){e.next=23;break}L({type:tw,payload:rC}),e.next=31;break;case 23:return e.next=25,wC(q,te,ie);case 25:if(!e.sent){e.next=29;break}return ue(),e.abrupt("return");case 29:return BC(q).then((function(e){s(e)})),e.abrupt("return");case 31:e.next=60;break;case 33:if(Pf(r,"cardSide")!==ow.BACK){e.next=60;break}return e.next=36,gC(q,te,ie);case 36:if(!e.sent){e.next=41;break}ue(),e.next=60;break;case 41:return e.next=43,PC({hasBackCard:ie,stepResult:r,frontCardId:X.current,qrImageId:Y.current,sdkAdapter:h,onError:f,refEkycResult:q,services:te,checkFinishAndFailCardTamperingOrOCR:gC,handleFailCardTamperingOCRBackground:ue});case 43:if(n=e.sent,q.current=x(x({},q.current),{},{backCard:n}),!yC(n,te)){e.next=48;break}return ce(),e.abrupt("return",ow.BACK);case 48:if(!ae){e.next=52;break}L({type:tw,payload:rC}),e.next=60;break;case 52:return e.next=54,wC(q,te,ie);case 54:if(!e.sent){e.next=58;break}return ue(),e.abrupt("return");case 58:return BC(q).then((function(e){s(e)})),e.abrupt("return");case 60:e.next=89;break;case 62:if(M!==rC){e.next=89;break}if(!ne){e.next=77;break}return e.next=66,gC(q,te,ie);case 66:if(!e.sent){e.next=70;break}return ue(),R(!1),e.abrupt("return");case 70:return e.next=72,wC(q,te,ie);case 72:if(!e.sent){e.next=77;break}return L({type:$C}),R(!1),e.abrupt("return");case 77:return e.next=79,MC({stepResult:r,sdkAdapter:h,services:te});case 79:if(a=e.sent,q.current=x(x({},q.current),{},{faceLiveness:a}),!mC(a,te)){e.next=85;break}le(),e.next=89;break;case 85:return e.next=87,pe(vC(a));case 87:(o=e.sent)?de(o,!vC(a)):ne?he():BC(q).then((function(e){s(e)}));case 89:R(!1);case 90:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[ie,te,M,h,ne,ae,s,f,ce,ue,le,pe,he,de]),ge=o((function(){C(!1),G.current()}),[]),ve=o((function(){C(!1),B(!1),BC(q).then((function(e){s(e),L({type:tw,payload:tC})}))}),[s]);return r.createElement(r.Fragment,null,M===eC?r.createElement(Tb,I({},l,e,{onStepDone:me,sdkAdapter:h,onError:f,onClose:p,clientSettings:_,key:F,isLoading:P})):null,M===rC?r.createElement(vg,I({},d,e,{onLivenessDetectionDone:me,sdkAdapter:h,onError:f,onClose:p,clientSettings:_,key:U,isLoading:P})):null,r.createElement(zp,{open:b||k},b&&r.createElement(GC,{onRetry:ge,onStop:ve},r.createElement(cw,{content:W.current,lang:t})),k&&r.createElement(XC,{onStop:ve},r.createElement(cw,{content:W.current,lang:t,isStopPopup:!0}))))}function lw(e){var t=e.logCredentials,n=e.ekycFlowComponent;return r.createElement(mg,null,r.createElement(Pn.SDKTrackingProvider,{value:{tracking:x({},t)}},r.createElement(n,e)))}uw.propTypes={sdkAdapter:h.shape({}),onDoneEkyc:h.func,onError:h.func,onClose:h.func,readIDCardProps:h.shape({}),livenessDetectionProps:h.shape({})},uw.defaultProps={sdkAdapter:null,onDoneEkyc:function(){},onError:function(){},onClose:function(){},readIDCardProps:{},livenessDetectionProps:{}},lw.propTypes={logCredentials:h.shape({}),clientSettings:h.shape({}),ekycFlowComponent:h.func},lw.defaultProps={logCredentials:void 0,clientSettings:void 0,ekycFlowComponent:uw};var dw,fw=function(e){var t=e.className;return r.createElement("svg",{className:t,width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.createElement("circle",{cx:"48",cy:"48",r:"45",stroke:"#0276F1",strokeWidth:"6"}),r.createElement("path",{d:"M27.9314 34.8653C27.9314 32.9955 29.4472 31.4797 31.317 31.4797C33.1868 31.4797 34.7026 32.9955 34.7026 34.8653V41.6365C34.7026 43.5063 33.1868 45.0221 31.317 45.0221C29.4472 45.0221 27.9314 43.5063 27.9314 41.6365V34.8653Z",fill:"#0276F1"}),r.createElement("path",{d:"M61.7878 34.8653C61.7878 32.9955 63.3036 31.4797 65.1734 31.4797C67.0432 31.4797 68.559 32.9955 68.559 34.8653V41.6365C68.559 43.5063 67.0432 45.0221 65.1734 45.0221C63.3036 45.0221 61.7878 43.5063 61.7878 41.6365V34.8653Z",fill:"#0276F1"}),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M48.2455 31.2466C50.2428 31.2466 51.8619 32.8657 51.8619 34.863V50.0982C51.8619 53.9653 48.727 57.1003 44.8599 57.1003H43.1671C41.1698 57.1003 39.5506 55.4811 39.5506 53.4838C39.5506 51.4865 41.1698 49.8674 43.1671 49.8674H44.629V34.863C44.629 32.8657 46.2482 31.2466 48.2455 31.2466Z",fill:"#0276F1"}),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M64.642 59.7309C65.8682 61.3075 65.5842 63.5796 64.0076 64.8058C57.154 70.1364 50.3848 71.402 44.6352 70.566C39.029 69.7509 34.6106 66.9737 32.1453 64.5084C30.733 63.0961 30.733 60.8063 32.1453 59.3939C33.5576 57.9816 35.8474 57.9816 37.2597 59.3939C38.7443 60.8785 41.7742 62.8411 45.6759 63.4084C49.4342 63.9549 54.2325 63.2456 59.567 59.0965C61.1436 57.8703 63.4157 58.1543 64.642 59.7309Z",fill:"#0276F1"}))};fw.defaultProps={className:""},fw.propTypes={className:h.string};var pw=m.button(dw||(dw=L(["\n background-color: #0276f1;\n color: white;\n text-align: center;\n border-radius: 25px;\n outline: none;\n padding: 12px 93px;\n border: none;\n cursor: pointer;\n"]))),hw={en:{face_authentication:"Face authentication",hold_still:"Hold still",uploading:"Uploading",start:"Start",continue:"Continue",retry:"Retry","face_authentication.successful":"Successful face authetication","face_authentication.unsuccessful":"Unsuccessful face authetication",move_face_into_frame:"Fit your face into the oval",face_not_found:"No face detected",processing_result:"Processing result",please_move_face_into_center_frame:"Face is not in the center of the oval",please_move_face_closer:"Face is too small",please_move_face_farther:"Face is too big",please_open_your_eyes:"Please open your eyes",please_look_straight_at_the_camera:"Please look straight at the camera",please_only_one_face:"Multiple faces detected",please_move_face_down:"Please move your face down","timeout.remaining":"Remaining time: <%= remain %> seconds","timeout.expired":"You need to complete within <%= timeout %> seconds. Please try again."},vi:{face_authentication:"Xác thực khuôn mặt",hold_still:"Giữ yên",uploading:"Đang tải lên",start:"Bắt đầu",continue:"Tiếp tục",retry:"Thử lại","face_authentication.successful":"Xác thực khuôn mặt thành công","face_authentication.unsuccessful":"Xác thực khuôn mặt không thành công",move_face_into_frame:"Đưa mặt vào khung",face_not_found:"Không tìm thấy khuôn mặt",processing_result:"Đang xử lý kết quả",please_move_face_into_center_frame:"Đưa khuôn mặt vào giữa hình oval",please_move_face_closer:"Khuôn mặt quá nhỏ",please_move_face_farther:"Khuôn mặt quá to",please_open_your_eyes:"Vui lòng mở to mắt",please_look_straight_at_the_camera:"Nhìn thẳng vào camera",please_only_one_face:"Có nhiều mặt trong khung hình",please_move_face_down:"Vui lòng đưa khuôn mặt xuống một chút","timeout.remaining":"Thời gian còn lại: <%= remain %> giây","timeout.expired":"Bạn cần hoàn thành trong <%= timeout %> giây. Xin vui lòng thử lại."}},mw=p({}),gw=function(e){var t,n=e.lang,a=e.children;return r.createElement(mw.Provider,{value:null!==(t=hw[n])&&void 0!==t?t:hw.vi},a)};gw.propTypes={lang:h.oneOf(["en","vi"]).isRequired,children:h.node.isRequired};var vw,yw,bw,Cw,ww=function(){var e=t(mw);return o((function(r,t){var n,a;return t?Kd(null!==(n=e[r])&&void 0!==n?n:r)(t):null!==(a=e[r])&&void 0!==a?a:r}),[e])},kw=m.div(vw||(vw=L(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n\n background-color: white;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n"]))),Bw=v(["0%{box-shadow:0 0 0 0 rgba(231,241,255,0.8);}80%{box-shadow:0 0 0 30px rgba(231,241,255,0);}100%{box-shadow:0 0 0 0 rgba(231,241,255,0);}"]),Ew=m.div(yw||(yw=L(["\n width: 160px;\n height: 160px;\n\n border-radius: 50%;\n\n display: grid;\n place-items: center;\n\n box-shadow: 0 0 0 0 rgba(0, 0, 0, 1);\n\n background-color: #d9e8ff;\n\n animation: "," 1s infinite;\n\n margin-block-end: 48px;\n"])),Bw),Sw=m.h2(bw||(bw=L(["\n color: #1d1d1d;\n font-weight: 700;\n font-size: 24px;\n margin: 0;\n margin-block-end: 8px;\n"]))),_w=m.p(Cw||(Cw=L(["\n font-weight: 400;\n font-size: 16px;\n color: #5e5e5e;\n text-align: center;\n\n margin: 0;\n margin-block-end: 16px;\n"]))),Aw=function(e){var t=e.onStart,n=ww();return r.createElement(kw,null,r.createElement(Ew,null,r.createElement(fw,null)),r.createElement(Sw,null,n("face_authentication")),r.createElement(_w,null,n("please_move_face_into_center_frame")),r.createElement(pw,{onClick:t},n("start")))};Aw.propTypes={onStart:function(){}},Aw.defaultProps={onStart:function(){}};var Iw=0,Tw=1,xw=2,Pw=3,Rw=4,Dw=5,Nw="far_face",Lw="close_face",Ow="flashing";function Mw(){return(Mw=S(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c,u=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=u.length>0&&void 0!==u[0]?u[0]:{},t=r.tfScriptUrls,n=r.closeEyesModelUrl,a=new Ns(n),e.next=4,di.loadTensorFlow(t);case 4:return e.next=6,di.initTensorFlow({preferredBackends:["wasm","cpu"]});case 6:return o=[di.loadFaceDetectionModel({detectorConfig:{runtime:"mediapipe",solutionPath:"https://cdn.jsdelivr.net/npm/@mediapipe/face_detection"}}),a.load()],e.next=9,Promise.all(o);case 9:return i=e.sent,s=O(i,1),c=s[0].faceDetector,e.abrupt("return",{faceDetector:c,closeEyesModel:a});case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Fw=Ff((function(){return Mw.apply(this,arguments)})),Uw=function(e){var r=e.width,t=e.height,n=e.cameraScale,a=e.debug,o=O(c(null),2),s=o[0],u=o[1];return i((function(){var e=document.createElement("canvas");e.width=r,e.height=t;var o=e.getContext("2d");return o.translate(r,0),o.scale(-1*n,1*n),a&&(document.body.appendChild(e),e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.zIndex="9999"),u(e),function(){a&&document.body.removeChild(e)}}),[n,a,t,r]),s},Vw=function(e){switch(e){case"partial_face":case"no_face":case"face_out_of_box":return"face_not_found";case"face_too_small":return"please_move_face_closer";case"face_too_large":return"please_move_face_farther";case"eye_close":return"please_open_your_eyes";case"face_not_frontal":return"please_look_straight_at_the_camera";case"multiple_faces":return"please_only_one_face";case"face_too_high":return"please_move_face_down";default:return""}},jw=function(e,r){var t=e.getContext("2d");t.clearRect(0,0,e.width,e.height),t.beginPath(),t.lineWidth="1",t.strokeStyle="red",t.rect(0,0,e.width,e.height),t.stroke(),t.closePath(),Object.entries(r).forEach((function(e,r){var n=O(e,2),a=n[0],o=n[1];t.beginPath(),t.fillStyle="red",t.font="16px",t.fillText("".concat(a,": ").concat(o),10,20+20*r),t.closePath()}))},zw=p(!1),Kw=function(e){var t=e.children,n=e.debug;return r.createElement(zw.Provider,{value:n},t)};Kw.defaultProps={debug:!1,children:null},Kw.propTypes={debug:h.bool,children:h.node};var Hw=function(e,r,t){var n=e.getContext("2d");n.strokeStyle=t,n.lineWidth=2,n.beginPath(),n.rect(r.x,r.y,r.width,r.height),n.stroke(),n.closePath()},qw=function(e,r){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e.getContext("2d"),a=e.width;n.strokeStyle="blue",n.fillStyle="blue",n.lineWidth=2,r.forEach((function(e){e.landmarks.forEach((function(e){n.beginPath(),n.arc(t?a-e[0]:e[0],e[1],2,0,2*Math.PI),n.fill(),n.closePath()})),n.beginPath();var r={x:t?a-e.bottomRight[0]:e.bottomRight[0],y:e.topLeft[1],width:e.bottomRight[0]-e.topLeft[0],height:e.bottomRight[1]-e.topLeft[1]};n.rect(r.x,r.y,r.width,r.height),n.stroke(),n.closePath()}))};function Gw(e){var r=e.cameraScale,s=void 0===r?1:r,u=e.warmupUrls,l=e.isVideoPlaying,d=e.step,f=e.cropArea,p=e.videoRef,h=e.onCloseFaceDetected,m=e.onMovingCloseFace,g=e.onFarFaceDetected,v=e.onFarFullFaceDetected,y=e.onFlashingFramesCaptured,b=e.frameInterval,C=void 0===b?180:b,w=e.useFaceDetectorWhenFlashing,k=e.onFaceError,B=e.onError,E=e.faceSettings,_=e.ovalBoundingRect,A=e.ovalPadding,I=e.isOvalTransitioning,T=e.chinToMaskBottomPadding,x=e.closeEyesSettings,P=x.enable,R=x.timeout,D=t(zw),N=function(e){var r=e.cropArea;return n((function(){var e=r.width,t=r.height,n=e/400,a=t/400,o=Math.max(n,a);return{width:e/o,height:t/o}}),[r])}({cropArea:f}),L=function(e){var r=e.cropArea,t=e.ovalBoundingRect,a=e.ovalPadding;return n((function(){var e,n,o,i,s=r.width,c=r.height,u=r.x,l=r.y,d=s/400,f=c/400,p=Math.max(d,f),h=s/p,m=c/p,g=null!==(e=null==t?void 0:t.left)&&void 0!==e?e:0,v=null!==(n=null==t?void 0:t.top)&&void 0!==n?n:0,y=null!==(o=null==t?void 0:t.right)&&void 0!==o?o:s,b=null!==(i=null==t?void 0:t.bottom)&&void 0!==i?i:c;return{left:Math.max((g-u)/p-a.left,0),right:Math.min((y-u)/p+a.right,h-0),top:Math.max((v-l)/p-a.top,0),bottom:Math.min((b-l)/p+a.bottom,m-0)}}),[r,null==t?void 0:t.bottom,null==t?void 0:t.left,null==t?void 0:t.right,null==t?void 0:t.top,a.bottom,a.left,a.right,a.top])}({cropArea:f,ovalBoundingRect:_,ovalPadding:A}),M=E.minFarFaceRatio,F=E.maxFarFaceRatio,U=E.closeFaceRatio,V=Uw({width:N.width,height:N.height,cameraScale:s,debug:!1}),j=Uw({width:N.width,height:N.height,cameraScale:s,debug:D}),z=function(e){var r=e.width,t=e.height,o=a(null),s=n((function(){var e=document.createElement("canvas");return e.width=r,e.height=t,e.style.position="fixed",e.style.bottom="0",e.style.left="0",e.style.zIndex="99999",o.current=e,document.body.appendChild(e),e}),[t,r]);return i((function(){return function(){document.body.removeChild(o.current)}}),[]),s}({width:160,height:150,cameraScale:s}),K=function(e){var r=e.videoRef,t=e.cropArea;return n((function(){return r.current?0===Object.keys(t).length?{}:ca.analyzeVideoAndWindowSizes(r.current,t):{}}),[r,t])}({videoRef:p,cropArea:f}),H=function(e,r){var t=O(c({}),2),n=t[0],a=t[1],o=Object.keys(n).length>0;return i((function(){var t=!1;return function(){var n=S(regeneratorRuntime.mark((function n(){var o;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,Fw(e);case 3:if(o=n.sent,!t){n.next=6;break}return n.abrupt("return");case 6:a(o),n.next=13;break;case 9:n.prev=9,n.t0=n.catch(0),r({error:n.t0}),console.error(n.t0);case 13:case"end":return n.stop()}}),n,null,[[0,9]])})));return function(){return n.apply(this,arguments)}}()(),function(){t=!0}}),[o,e,r]),[n,o]}(u,B),q=O(H,2),G=q[0],W=q[1],Q=a(null),X=function(e){var r=e.timeout,t=a(null),n=o((function(){t.current=performance.now()}),[]),i=o((function(){return null===t.current?(n(),!1):performance.now()-t.current>r}),[n,r]);return{markTime:n,checkIfEllapsed:i}}({timeout:1e3*R}),Y=X.markTime,Z=X.checkIfEllapsed,$=W&&l,J=O(c(""),2),ee=J[0],re=J[1],te=G.closeEyesModel,ne=G.faceDetector,ae=n((function(){return Zu(re,500)}),[]),oe=o(function(){var e=S(regeneratorRuntime.mark((function e(r,t){var n,a,o,i,c,u,l,f,b,C,E,S,_,A,x,R,O,V,K,H,q,G,W,Q,X;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,0!==(null==t?void 0:t.width)&&0!==(null==t?void 0:t.height)){e.next=3;break}return e.abrupt("return");case 3:if(null!==p.current){e.next=5;break}return e.abrupt("return");case 5:if(!I){e.next=7;break}return e.abrupt("return");case 7:if(n=r.cropX,a=r.cropY,o=r.cropWidth,i=r.cropHeight,t.getContext("2d").drawImage(p.current,n,a,o,i,(o-o*s)/2/s,(i-i*s)/2/s,N.width,N.height),D&&j.getContext("2d").drawImage(p.current,n,a,o,i,(o-o*s)/2/s,(i-i*s)/2/s,N.width,N.height),w||d!==Pw){e.next=14;break}return"function"==typeof y&&y(null,t,null),e.abrupt("return");case 14:return e.next=16,ne.estimateFaces(t);case 16:return c=e.sent,u=Ea.faceDetectorToBlazefacePredictions(c),e.next=20,Ea.validatePredictions({predictions:u,width:N.width,height:N.height});case 20:return l=e.sent,f=l.fullFace,b=l.ratio,e.next=25,Ea.validatePredictions({predictions:u,cropAreaCoordinates:[[L.left,L.top],[L.right,L.bottom]]});case 25:if(C=e.sent,E=C.error,S=C.fullFace,_=C.faceRatio,D&&(Hw(j,{x:L.left,y:L.top,width:L.right-L.left,height:L.bottom-L.top},"red"),qw(j,u,!0)),A="frontal",!S){e.next=36;break}return e.next=34,Ea.calculateFaceDirection({landmarks:S.landmarks});case 34:R=e.sent,A=null!==(x=null==R?void 0:R.gesture)&&void 0!==x?x:"";case 36:if(f&&d===Tw&&"function"==typeof g&&g(u[0],t,f.landmarks),f&&d===xw&&"function"==typeof m&&m(u[0],t,f.landmarks),O=null==E?void 0:E.code,e.prev=39,"no_face"!==O){e.next=42;break}throw new Error("no_face");case 42:if(!("multiple_faces"===O||u.length>1)){e.next=47;break}if(V=Ea.calculateFaceArea(u[0]),K=Ea.calculateFaceArea(u[1]),!(V<=2*K)){e.next=47;break}throw new Error("multiple_faces");case 47:if("frontal"===A){e.next=49;break}throw new Error("face_not_frontal");case 49:if(d!==Tw){e.next=54;break}if(!(_>F)){e.next=52;break}throw new Error("face_too_large");case 52:if(!(_<M)){e.next=54;break}throw new Error("face_too_small");case 54:if(d!==xw){e.next=57;break}if(!(_<U)){e.next=57;break}throw new Error("face_too_small");case 57:if(!(Array.isArray(u)&&u.length>0&&L.bottom-u[0].bottomRight[1]>T)){e.next=59;break}throw new Error("face_too_high");case 59:if("face_out_of_box"!==O){e.next=66;break}if(d!==Tw){e.next=63;break}if(!(_>=M&&_<=F)){e.next=63;break}throw new Error("");case 63:if(d!==xw){e.next=66;break}if(!(_>=U)){e.next=66;break}throw new Error("");case 66:e.next=71;break;case 68:e.prev=68,e.t0=e.catch(39),O=e.t0.message;case 71:if(!P){e.next=81;break}if(O){e.next=80;break}return e.next=75,te.predict(t,f.landmarks);case 75:H=e.sent,q=Z(),H.isEyeClose&&!q&&(O="eye_close"),e.next=81;break;case 80:Y();case 81:if(D&&jw(z,{ratio:null!==(G=null==b?void 0:b.toFixed(3))&&void 0!==G?G:"undefined",error:O,ovalFaceRatio:null!==(W=null==_?void 0:_.toFixed(3))&&void 0!==W?W:"undefined",ovalError:null!==(Q=null==E?void 0:E.code)&&void 0!==Q?Q:"undefined",step:d===Tw?"far":"close"}),X=Vw(O),ae(X),!X){e.next=87;break}return"function"==typeof k&&k({error:O,currentStep:d}),e.abrupt("return");case 87:f&&d===Tw&&M<=_&&_<=F&&"function"==typeof g&&v(u[0],t,f.landmarks),f&&d===xw&&_>=U&&"function"==typeof h&&h(u[0],t,f.landmarks),f&&d===Pw&&_>=U&&"function"==typeof y&&y(u[0],t,f.landmarks),e.next=96;break;case 92:e.prev=92,e.t1=e.catch(0),console.error(e.t1),B({error:e.t1});case 96:case"end":return e.stop()}}),e,null,[[0,92],[39,68]])})));return function(r,t){return e.apply(this,arguments)}}(),[j,z,D,p,I,s,N.width,N.height,d,ne,L.left,L.top,L.right,L.bottom,ae,M,F,U,y,g,k,v,m,h,B,T,w,P,te,Z,Y]);return i((function(){var e=null,r=!1;return $&&function t(){e=requestAnimationFrame(function(){var e=S(regeneratorRuntime.mark((function e(n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r){e.next=2;break}return e.abrupt("return");case 2:if(null!==p.current){e.next=4;break}return e.abrupt("return");case 4:if(null===Q.current&&(Q.current=n),!(n-Q.current-C<1e-7)){e.next=9;break}return t(),e.abrupt("return");case 9:return Q.current=n,e.next=12,oe(K,V);case 12:t();case 13:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}())}(),function(){r=!0,cancelAnimationFrame(e)}}),[V,K,oe,$,p,C]),{warmupDone:W,faceError:ee}}var Ww,Qw,Xw={r:"#ff0000",g:"#00ff00",b:"#0000ff"," ":"#00000099",default:"#00000099"},Yw=function(e){var r=e.onVideoPlayed,t=e.surroundStyle,a=e.maskSize,o=O(c(!1),2),i=o[0],s=o[1],u=O(c({}),2),l=u[0],d=u[1];return{onVideoPlayed:function(e){d(e),s(!0),"function"==typeof r&&r(l)},cropArea:n((function(){if(0===Object.keys(l).length)return{};var e=function(e,r){var t,n,a=e.videoAreaWidth,o=e.videoAreaHeight,i=e.lostX,s=e.lostY,c=r.width,u=r.height;return qs.isMobile?(t=a,n=o):(t=c,n=u),{width:t,height:n,x:Math.max(Math.round((a-t)/2+i),0),y:Math.max(Math.round((o-n)/2+s),0)}}(l,a);return e.surroundStyle=t,e}),[l,t,a]),isPlaying:i}},Zw=Ea.faceTracker(),$w=function(e,r,t,n){var a=r.toDataURL("image/jpeg",.8);if(!e)return{label:"portrait",base64:a.split(",")[1],index:n};var o=e.topLeft,i=e.bottomRight,s=[].concat(M(o),M(i)),c=[o[0]/_a.SIZE*r.width,o[1]/_a.SIZE*r.height,i[0]/_a.SIZE*r.width,i[1]/_a.SIZE*r.height],u=Zw(e,0===n),l=u.score,d=u.time;return{label:"portrait",base64:a.split(",")[1],landmarks:t,original_landmarks:t.map((function(e){return[e[0]/_a.SIZE*r.width,e[1]/_a.SIZE*r.height]})),score:l,time:d,index:n,bbox:s,original_bbox:c}},Jw=function(){var e=S(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",30);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ek=function(e){var t=e.className;return r.createElement("svg",{className:t,width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.createElement("rect",{x:"0.5",y:"0.5",width:"47",height:"47",rx:"23.5",fill:"#0276F1"}),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24 36.1124C30.6895 36.1124 36.1124 30.6895 36.1124 24C36.1124 17.3105 30.6895 11.8876 24 11.8876C17.3105 11.8876 11.8876 17.3105 11.8876 24C11.8876 30.6895 17.3105 36.1124 24 36.1124ZM24 38C31.732 38 38 31.732 38 24C38 16.268 31.732 10 24 10C16.268 10 10 16.268 10 24C10 31.732 16.268 38 24 38Z",fill:"white"}),r.createElement("path",{d:"M18.1465 20.169C18.1465 19.6236 18.5886 19.1815 19.134 19.1815C19.6793 19.1815 20.1214 19.6236 20.1214 20.169V22.1439C20.1214 22.6893 19.6793 23.1314 19.134 23.1314C18.5886 23.1314 18.1465 22.6893 18.1465 22.1439V20.169Z",fill:"white"}),r.createElement("path",{d:"M28.0213 20.169C28.0213 19.6236 28.4634 19.1815 29.0087 19.1815C29.5541 19.1815 29.9962 19.6236 29.9962 20.169V22.1439C29.9962 22.6893 29.5541 23.1314 29.0087 23.1314C28.4634 23.1314 28.0213 22.6893 28.0213 22.1439V20.169Z",fill:"white"}),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24.0714 19.1135C24.654 19.1135 25.1262 19.5858 25.1262 20.1683V24.6119C25.1262 25.7398 24.2119 26.6542 23.084 26.6542H22.5902C22.0077 26.6542 21.5354 26.1819 21.5354 25.5994C21.5354 25.0168 22.0077 24.5446 22.5902 24.5446H23.0166V20.1683C23.0166 19.5858 23.4889 19.1135 24.0714 19.1135Z",fill:"white"}),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28.8537 27.4214C29.2114 27.8813 29.1285 28.544 28.6687 28.9016C26.6697 30.4564 24.6954 30.8255 23.0184 30.5817C21.3833 30.344 20.0946 29.5339 19.3755 28.8149C18.9636 28.403 18.9636 27.7351 19.3755 27.3232C19.7875 26.9113 20.4553 26.9113 20.8672 27.3232C21.3002 27.7562 22.184 28.3286 23.322 28.4941C24.4181 28.6534 25.8176 28.4466 27.3735 27.2364C27.8334 26.8788 28.4961 26.9616 28.8537 27.4214Z",fill:"white"}),r.createElement("rect",{x:"0.5",y:"0.5",width:"47",height:"47",rx:"23.5",stroke:"#DAEAFB"}))};ek.defaultProps={className:""},ek.propTypes={className:h.string};var rk,tk=m.div(Ww||(Ww=L(["\n --color: #0276f1;\n\n & .indicator {\n color: var(--color);\n }\n\n & .gauge {\n background-color: var(--color);\n }\n"]))),nk=m.div(Qw||(Qw=L(["\n height: 10px;\n position: relative;\n background: #daeafb;\n border-radius: 100px;\n margin-block-end: 8px;\n\n & > span {\n display: block;\n height: 100%;\n border-radius: 100px;\n width: 0;\n overflow: hidden;\n }\n"]))),ak=function(e){var t=e.value,n=e.className;return r.createElement(tk,{className:n},r.createElement(nk,null,r.createElement("span",{className:"gauge",style:{width:"".concat(t,"%")}})),r.createElement("div",null,r.createElement("span",{className:"indicator"},"•")," ",t,"%"))};ak.defaultProps={value:0,className:""},ak.propTypes={value:h.number,className:h.string};var ok,ik=m.b(rk||(rk=L(["\n color: #1d1d1d;\n padding: 18px 16px;\n background: #fafafa;\n border: 1px solid rgba(29, 29, 29, 0.04);\n border-radius: 100px;\n display: flex;\n align-items: center;\n flex-direction: row;\n font-size: 16px;\n"]))),sk=function(e){var t=e.children,n=e.className;return r.createElement(ik,{className:n},t)};sk.defaultProps={children:null,className:""},sk.propTypes={children:h.node,className:h.string};var ck,uk=m.span(ok||(ok=L(["\n color: #1d1d1d;\n font-weight: bold;\n background: rgba(255, 255, 255, 0.8);\n border-radius: 12px;\n padding: 12px 16px;\n max-width: 200px;\n text-align: center;\n display: inline-block;\n"]))),lk=function(e){var t=e.children,n=e.className;return r.createElement(uk,{className:n},t)};lk.defaultProps={children:null,className:""},lk.propTypes={children:h.node,className:h.string};var dk,fk,pk=m.div(ck||(ck=L(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 1001;\n\n background-color: ",";\n"])),(function(e){return e.$overlay?"white":"transparent"})),hk=function(e){var t=e.children,n=e.overlay;return r.createElement(pk,{$overlay:n},n&&r.createElement(qp,null),r.createElement("div",{style:{visibility:n?"hidden":"visible"}},t))};hk.defaultProps={children:null,overlay:!1},hk.propTypes={children:h.node,overlay:h.bool};var mk={width:210,height:300},gk={width:qs.isMobile?window.innerWidth:window.innerHeight,height:window.innerHeight},vk=m.ellipse(dk||(dk=L(["\n transition: all 0.3s ease-in-out;\n transform-origin: center;\n transform: scale(",");\n"])),(function(e){return e.$scale})),yk=m.rect(fk||(fk=L(["\n transition: all 0.3s ease-in-out;\n transform-origin: center;\n transform: scale(",");\n"])),(function(e){return e.$scale})),bk=l((function(e,t){var n=e.className,a=e.scale,o=e.debug,i=e.width,s=e.height,c=e.padding,u=e.verticalOffset,l={left:i/2-mk.width/2-c.left,top:s/2-mk.height/2-c.top+u,right:i/2+mk.width/2+c.right,bottom:s/2+mk.height/2+c.bottom+u};return r.createElement("svg",{className:n,viewBox:"0 0 ".concat(i," ").concat(s),width:i,height:s},r.createElement("mask",{id:"OVAL_MASK"},r.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white",mask:"url(#OVAL_MASK)"}),r.createElement(vk,{ref:t,cx:i/2,cy:s/2+u,rx:mk.width/2,ry:mk.height/2,$scale:a})),r.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white",mask:"url(#OVAL_MASK)"}),o&&r.createElement("rect",{x:"0",y:"0",width:i,height:s,stroke:"red",fill:"none"}),o&&r.createElement(yk,{x:l.left,y:l.top,width:l.right-l.left,height:l.bottom-l.top,$scale:a,fill:"none",stroke:"red",strokeWidth:.5}))}));bk.propTypes={className:h.string,scale:h.oneOfType([h.number,h.string]),debug:h.bool,width:h.number,height:h.number,padding:h.oneOfType([h.number,h.shape({top:h.number,right:h.number,bottom:h.number,left:h.number})]),verticalOffset:h.number},bk.defaultProps={className:"",scale:1,debug:!1,width:gk.width,height:gk.height,padding:0,verticalOffset:0};var Ck=function(e,r){var t,n,a=e.smallScale,o=e.largeScale,i=e.ovalPadding,s=e.ovalVerticalOffset,c=r.width/r.height,u=a/o,l=(t=window.innerWidth-30,n=c,Math.floor(t/n)),d=a*window.innerHeight,f=o*window.innerHeight,p=i.top+i.bottom+s,h=i.left+i.right,m=d-p,g=f-p;if((g*c).toFixed(2)+h>window.innerWidth){var v=((l-p)/r.height).toFixed(2);return{smallScale:(v*u).toFixed(2),largeScale:v}}return{smallScale:(m/r.height).toFixed(2),largeScale:(g/r.height).toFixed(2)}},wk=p({}),kk=function(e){var t=e.apiClient,n=e.children,a=O(c({}),2),o=a[0],s=a[1];return i((function(){function e(){return(e=S(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"==typeof t.clientSettings){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,t.clientSettings();case 4:r=e.sent,s(r);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[t]),r.createElement(wk.Provider,{value:o},n)};kk.propTypes={apiClient:h.shape({clientSettings:h.func.isRequired}).isRequired,children:h.node.isRequired};var Bk,Ek=function(e){var r=t(wk);return Array.isArray(e)?e.reduce((function(e,t){var n=Pf(r,t);return e.push(n),e}),[]):Pf(r,e)},Sk=function(){var e=a(),r=Pn.useSDKTracking().sendEvent;return o((function(t,n){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=performance.now();if("object"===B(a)){var i=x({},a);e.current&&(i.interval_vs_previous_in_ms=o-e.current),e.current=o,r({tag:t,event:n,log:i})}if("function"==typeof a){var s=a({lastTimeLog:e.current});e.current=o,r({tag:t,event:n,log:s})}}),[r])},_k=function(e,r){var t=a(e);i((function(){r&&"function"==typeof t.current&&t.current()}),[r])},Ak=Object.freeze({READY:"READY",RUNNING:"RUNNING",STOPPED:"STOPPED"}),Ik=m.span(Bk||(Bk=L(["\n margin-block-start: 10px;\n color: red;\n"]))),Tk=function(e){var t=e.onTimeout,n=e.timeout,s=e.shouldStart,u=e.shouldStop,l=ww(),d=function(e){var r=e.startTime,t=void 0===r?3:r,n=e.onCountDownDone,s=e.autoRestartAfter,u=void 0===s?-1:s,l=O(c(t),2),d=l[0],f=l[1],p=O(c(Ak.READY),2),h=p[0],m=p[1],g=a(),v=o((function(){m(Ak.RUNNING),g.current=setInterval((function(){f((function(e){return e-1}))}),1e3)}),[]),y=o((function(){m(Ak.READY),f(t),clearInterval(g.current)}),[t]);return i((function(){0===d&&(m(Ak.STOPPED),clearInterval(g.current),"function"==typeof n&&n(),-1!==u&&setTimeout((function(){y(),v()}),1e3*u))}),[d,n,u,y,v]),{state:h,countdown:d,startCountDown:v,stopCountDown:y}}({startTime:n,onCountDownDone:t,autoRestartAfter:3}),f=d.countdown,p=d.startCountDown,h=d.stopCountDown;return _k(p,s),_k(h,u),r.createElement(r.Fragment,null,f>0&&f<10&&r.createElement(Ik,null,l("timeout.remaining",{remain:f})),0===f&&r.createElement(Ik,null,l("timeout.expired",{timeout:n})))};Tk.propTypes={onTimeout:h.func.isRequired,timeout:h.number.isRequired,shouldStart:h.bool.isRequired,shouldStop:h.bool.isRequired};var xk,Pk,Rk,Dk,Nk,Lk,Ok,Mk,Fk={8:[" r rrr"," r rr"," r r rr "," r rrr "," r r r "," rr r rr"," rr r "," rr rrr"," rr r"," rrr r"," r rrr "," r r r "," r r rr"," r r r "," r rrr r"," r r "," rrr r "," r rr r"," rrr rrr"," r r "," rr r "," r rrr "," r rr "," r r rr"," r r r"," r r r"," r rr r"," r r r "," r rr r"," r rr rr"," rr rr "," rr rr"," r rrr"," r r"," r rrr"," r rr "," r rr r "," rr r "," rr r r "," r r "," rr r "," rr r "," r r r"," rr rr"," rr "," r rr "," rrr r r"," r r r"," rrr rr"," r rr"," rrr "," rr rrr"," r r "," rrr "," r r "," r r r"," r rr "," rr rr "," rrr r"," rr r r"," r r r r"," rr rrr "," rrr rr "," rrr r"," rrr rr"," r rr "," rrr r "," rr rr"," rr rr r"," r rr "," rr r"," r r rr"," r r r"," r r rrr"," rr r r"," rrr r "," rr r r"," r r "," rr r "," rr rr "," r r "],9:[" r r r "," r r r"," rrr r r "," r rrr "," r r rr"," rr r "," r r r "," r rrr "," rr rr "," rr r r "," r r rrr"," r r r r"," r rr r"," rr r r"," r rr "," rrr r "," r rr r"," rr rr "," rr r r"," rr r rr"," rr rrr "," r r r"," r r r "," rr rr r"," r rr r"," rrr rrr "," rr r r"," r r r "," rrr "," r r rr"," r r rrr"," r r r rr"," r r r "," rrr rr"," r rrr r "," rrr r "," rrr r "," rrr r "," r rr r r"," rr r r "," rr r r"," r r r"," rr rr r"," rr r r r"," r r r "," r r rr "," rr r r "," r rr r "," rr rr "," rr r "," rr r"," r r r"," rrr r"," r rr "," r r "," r r "," rrr r "," r rr "," r rr r "," r rr rr"," rr r "," r r rr "," rrr rr"," r rrr "," rrr rrr"," r rr "," r r rrr"," r rrr r"," r r rr r"," rr rr r "," r rrr "," r r rr"," rr r "," r r r "," r r r r "," r r "," r rr rr "," r rrr "," r rr "," rr rrr "," r r "," r r r r"," rr rr r"," r rr rr"," r r r "," rr rr"," r r rrr "," r r r "," rr rr rr"," r rr rrr"," rr rr "," rr r rr"," rrr rr "," rrr rr "," rr rrr "," r rrr"," rr r r"," rrr rr "," rrr rr"," rrr r r"," rr rr"," r rrr r"," r rr "," rr rrr"," rr r r"," r rr r"," r r rr "," r rr rr"," r rrr rr"," rrr r r"," r rr"," r r rr "," r r r"," rrr rrr"," rr r "," rr rr "," r r rr"," rr rrr r"," rrr r rr"," r rr r "," r r r"," r rr r"," rrr r r"," rr r rr"," rr r rrr"," r r "," r rrr"," rrr r "," r r r r"," rr rrr"," r r "," rr r "," rr r rr "," r rrr r"," rr r "," rrr r"," r rr r "," r rr r"," r rr "," r r rr"," r r r "," rr rrr"," rr rr "," r rrr "," rrr rr r"," r r rr"," rr r r "," r r r r"," r r r"],10:[" r rr r"," rrr rrr "," rr r rr "," r r rrr"," r rr r"," r r rr "," r rrr rr"," r r rr "," rr r r"," r r rr "," rr rrr "," r rr r r"," rr r rr "," r r r r "," r rrr "," r rr rr "," rr rr r"," rr r r "," r rrr r"," r r r "," r r r"," rrr r "," r r r"," rr r rrr"," r r r rr"," r rr rr"," r rr r "," rrr r r "," rr rr r"," r r rr"," r r r r"," rrr r rrr"," r r r r "," r r rrr "," r rrr rr "," rrr r"," r rrr "," r r r "," r rrr r "," r rr rrr"," r rrr rrr"," rr r r "," rr r r "," rrr r rr"," rr rrr "," rrr r "," rrr rr r"," rrr r "," r rrr r "," r r rrr r"," r r r r "," rrr r r "," rrr rrr "," rr r rr "," r r r rr"," rr r r r"," rr rr "," r rr rr "," rr rrr r"," rr rr "," r rr r "," r rrr r"," r r r r"," rr rrr "," r r "," rr r r "," rrr rr r"," rr r rr"," r rr r"," r r r"," rr r rr r"," r r rr r"," rrr rrr "," r r r r "," r r rrr "," rr r "," rrr r r "," r r rr "," r r r r "," r rrr r"," rr rrr "," r rrr rr"," rr r rr"," r r r "," r r rr r"," r r r r"," rr rr "," rrr rr "," r r r"," rr rr "," rr rrr"," r rr r"," r r rrr"," rr rr "," r rrr rr"," rr r "," r rr r "," rr r "," rr rr r "," rr rr r r"," r rrr r "," r rrr "," r rrr "," r rr rr"," rr rr rr"," rr rrr "," r r rr "," rr r r"," rr r "," rr r rr"," r rr rrr "," rr rrr r"," rr r r "," rr r rr "," r rrr "," r rr r r"," r r r "," rr rr r "," r r rr "," r rr r "," r rr r "," r rr r r"," rrr rrr"," rr r r rr"," rrr rr "," r rr rr r"," rr r r r"," r rr r"," r rr rr "," r r r "," r r rr r "," rrr r rr"," r r "," r rrr r "," r r rr r"," r r r r"," r rrr r r"," rr r rrr "," rrr rr "," r r rrr"," r r r "," rr r rr"," r rr r"," r r "," rrr r r "," rr rrr r"," rrr rr "," rr r r "," r r r r"," rrr r "," r rr rrr"," r rr r "," rrr r r"," rr r r"," r r r "," r r rrr"," rr r "," rr rr r"," r r r r"," r rr "," r rr rr "," rr r r "," rr r rrr"," rr rr r"," rrr rrr"," r r rrr"," r r r"," r r r "," rrr r r"," r rr r "," r rr rr"," rr rrr r "," r r r r"," rr r r r "," r rr r "," rr r r "," r rr "," r rr rr"," r rr rrr"," rrr r rr "," r r rrr "," r r r rr"," r r r "," r rrr r"," rr r "," rr rr"," r rr r "," rr r rr"," rr r rrr"," r rr r rr"," r r r "," r r r rr "," rr r r r"," r r r rr"," rr rr rr "," rrr r r"," r rr r r"," rr rr r "," rr r r"," r rr "," rrr rr r"," r r r "," r r rr "," rr rr r"," rrr rr rr"," r rrr "," rr rr rr"," rrr r r"," rrr r rr"," r r r "," rr rrr"," rrr rr "," rr rrr rr"," r r r"," r rrr "," r r rr"," r rr "," rr rr "," rrr r r r"," r rrr"," r r r rrr"," rrr rr"," r r rr "," r rrr r"," rr r r"," rrr r r"," rr rr rrr"," r r r r"," rrr r "," r r r r"," r r rr"," r rr rr"," rrr rr r "," r r r r r"," r r r "," r r r "," r rr r "," r r rr rr"," rrr r "," rr rr r "," r rr r r "," rr r r r"," rr rr r"," rr rrr "," rrr rrr r"," r r rrr "," r r rr"," rr r r"," rr r rr"," r r rr"," r r rr "," rrr r "," r rrr r"," r rr "," r r r "," r r r r"," rr r r "," rr rr "," rrr r r"," r rr "," rr r r"," rrr rr "," r r rr"," r r rr"," r r rr r"," r r r "," rrr rrr"," rrr rr"," r rr rr"," r r rr "," rr r r "," r rr r"," r r rrr"," rr rr rr"],11:[" rrr rrr "," r r r r r"," r r rrr"," r rr rr "," r rr rrr"," r r r r r"," rr r rrr"," rrr rrr r"," rr r r "," rr rrr rrr"," r rrr rrr"," r r r "," rr rrr r"," r rrr "," rr r rrr "," r rr rr"," rrr rr r"," rr r r "," r rrr rr"," r r rrr r"," rr r r r"," rrr r r"," r r rrr "," r rr rr r"," rr rrr r"," rrr r rrr"," rr rr r"," r rrr r "," r rr rrr "," r r rr"," rr r r "," r r r r "," r rr rr"," r rr r"," rrr rr "," rrr rr r "," rr r r r"," rr rrr rr"," rrr rr "," r rrr "," r rr r "," rrr rrr"," r rr rr rr"," r r r rr "," rr r rr rr"," r rr r "," r r r "," r rrr r "," rrr r r r"," rrr r rr "," r r r "," rr r rrr "," rrr r r"," rr rr r "," rr r r "," r rr r rrr"," r r r r"," rr r rrr "," r rr r"," r r rr"," rr r r "," rr r r"," r r r rr"," rrr r rr "," r r r r"," r rr r rr "," r r rr "," r r rr r"," r rrr rr "," r r r "," r rr r "," rr r r r"," rr r r r"," r rrr rr "," rr rrr "," rrr r r "," rrr r rr "," rr r rr"," rr rrr r"," r r rrr "," r r rr r "," r rr rr r "," rr r r r "," r r r "," rr r r "," r r r rrr "," rrr rr r"," r rr r "," rr rr r "," rr rr rr "," rrr r r "," rrr rr r r"," r r rrr "," r rr r rr"," rr rrr rr"," rr rr rr r"," r r r"," r rrr r"," rr r r r"," r r rrr "," r rr r rr"," rrr r r "," r rr r "," r rr rr "," r rr rr "," rr rrr rr "," rr rr rr "," rr r rr "," r r r r r"," rr rr rrr"," r r rr r "," r r r "," r r r r"," rr r rrr"," r rr r "," r r rr"," rrr r r"," rr rr r "," rrr r rr"," r r rr r"," rr rr r r"," r r r r "," r r rrr rr"," r rr "," r r r r "," rrr r rrr"," rrr r r r"," rr r rrr r"," rr rr r r"," rrr r r "," r rr r r "," rrr rr "," rr r rr"," r r rrr"," r r r r r "," r rrr r r"," r r rr r"," r r rrr "," r r rrr r "," r r r rr"," r rr rr "," rr rr rr "," r rrr r "," r rr rrr"," r r r r"," rrr r "," rr rr "," rr rrr "," rrr r r"," r rr r r "," r r rr "," r r rr "," r rr rr "," r r rr "," rr rr rr"," r rr "," rr r rr "," r rr r r "," r r r r"," r r r "," r rr rr "," rrr r r "," rr r r "," r r rr "," rr r rr r "," rr rrr"," rr rr rrr "," rr rr r"," r r r r "," rr r rrr"," rr rrr "," rr r r "," r rr r "," rr r r "," rr rrr r r"," rr r "," r r r rr "," rr rr rr "," rrr r "," r r rr r"," rr r r r "," rr r r r "," rrr r r"," rrr r rr"," r r r r "," rr rr r "," rrr rr "," r rr rrr"," r rr rr"," r rrr r r"," r rrr "," r rrr r"," rrr rrr r"," r r r "," r r rr "," r r rrr"," rr rr r"," r r rrr"," rrr rrr r "," rr r r r"," rrr rrr"," r r rrr r"," rr r r rr"," r r r "," rr rrr r "," rr rr r "," r r r "," r rrr "," r r r r "," r rrr r"," r r rr r "," r rr rrr "," rr r rrr"," rrr rr"," rrr r r r"," rrr rr r"," r rr r "," rr rr r r"," r r rrr "," r r r rr"," r r rrr "," rrr rr r "," rr rrr r"," rrr r rr"," r r rr rr"," rr rr "," r rr r"," r rr "," rrr r r "," r r rr "," r rrr r"," r rr r"," r r rr r"," r rr r r"," rr r rr"," rrr r rr"," r r rr"," r rrr rrr"," r rrr rr "," r r r r "," rrr r rr"," r r r r "," rrr rr rr"," r r rr rrr"," r r r r"," r rrr "," rr r r r"," rr rrr "," rr r r r"," rr r rrr "," rr r r"," r r r r"," rr rrr r"," rrr r r "," r r r "," r rr r r r"," r rr rrr r"," r r r r"," r r r rr r"," rrr r r r"," r r rrr"," rr rrr "," r r r r"," r r r"," r r rr rr"," rrr rr r"," r r rr "," r r r rr"," r rr r r "," r r r rr"," r rrr rr"," r r r"," r r rr"," r rrr r "," rr rr r "," rrr r "," rr rr r "," r r r r "," r r rr "," rrr r rr"," r rr r "," rr r r r r"," r r r r "," rr r r "," rrr rr "," rr rr rrr"," rr r rr"," r rrr rrr"," r rr r "," rr rr rr"," rr r r "," r rr rr "," r r r r "," r r r "," rr r rr "," r r rr "," r r r rr"," rr r r r "," r r rr "," r r r rr"," r r rrr"," rr rr r r"," r rrr rr r"," r rr rr"," r r rr "," r rr r r"," rr rr r "," r r rrr r"," r rrr rr "," rr rrr "," rrr r r "," rrr r r"," rrr rr "," rr r "," r rrr r rr"," r rrr r"," r rr r r "," rr r rr "," r r rr r r"," r rr r r"," rr r r "," r r r rr"," rrr rrr r"," rrr r r"," r rr r rr"," rr r r r "," rr r r "," rrr rrr "," r r rr"," r r rrr"," r r r r"," rr rr "," r r r r"," rrr rr rr"," rrr r "," r r r r r"," rrr r rrr"," rr rr "," rrr rrr "," r rrr r r "," rr r rr "," rr rr r"," rr r r"," rr r rr r"," r r r r "," r r rr r"," rrr rrr "," rr rrr r "," r rr rrr "," r rrr r"," rr r r"," r rrr "," r rr r "," rrr rrr "," rr r rr r"," rr rrr r "," rr rr rr"," rr r r"," r rr rr r"," r rrr rr"," rr r r "," r r r r "," rr r rr"," r r r r"," r rrr rr"," rr r rrr"," r r r rr "," rrr r rr r"," rrr r "," r rr r r"," r rr rrr"," rr rr rr"," r r rr rr"," r rr rr "," rr r rr"," r rr rr r"," r rrr r "," r rrr r "," rr r rrr"," r r rr "," r r r rr"," r r rrr "," r r r "," rr r r rr"," rr rr rr"," r rrr r "," rr rr "," r rr r r"," rr r r rrr"," rrr r "," r rr rr "," r rr r "," r r r rrr"," r r r rr"," rrr rr rr"," r rr rrr "," r rr rr r"," rrr r r rr"," r r r r"," r rr rrr"," r r rrr r"," r rr r r"," r rrr r r"," r r rr r"," rr rrr "," r rr r "," rr rrr r "," r r r r"," rr rr "," r rr rr"," r rr r "," r r rr r"," rr r rr"," rrr rr r "," rr rr rr"," r rr r "," r r r r rr"," rrr r r "," r r rrr "," rrr r rrr "," r r "," r r r "," r r r r"," r rr r"," r rrr r "," r r rr rr"," rrr rr r"," r rr r rr"," r rrr rr"," rr rrr r"," rr r r r"," rr rr r r "," r r rr r"," r rrr r "," r r r rr "," rrr rr r "," r rr r "," r r r r "," rrr rrr rr"," rrr r r "," r r r "," rr rr rrr"," r r r "," rr r rr "," rr r rr r"," rr rr r"," r rrr rrr "," r rr r r"," r rrr r r"," rrr r rr "," rr r r r"," r r r "," rrr rr rrr"," rr r rr "," rrr rr "," rr r rr "," rr r r rr"," rr r r "," r rr r r"," r rr r r"," r r rr r "," r r rr "," r r rr rr "," rr r r"," rrr rr r"," rr r r rr"," r rrr r"," rr r rr r"," r r r r r"," rr r r "," rr rr r"," r r r "," rr r "," r rr r"," r r r rrr"," rr r rr "," rr rr r "," r r rr "," r rr rrr"," r rrr rr"," r rr r r"," r r rrr "," r rr rr "," r rr rr"," rr rrr rr"," r r r "," rr rr r "," r r r r "," rrr r r r "," rr r rr "," rrr rr rr "," r r rr "," r r r rrr"," r r r rr "," rrr rrr "," rr rr r"," r r rr r"," r r r rrr"," r r rr r "," r r r r"," rr rr r rr"," rr r r rr "," r rrr r "," r rr rr"],12:[" rr rr rr r"," r r r rr"," r rr r r "," rr r r rr "," r rr r r"," rrr r r "," r r rr "," rrr rr r "," rr r rr "," rr rr r "," r r r r "," rr r rr r "," r r r rr"," rr rr r rr "," rr r rr "," rrr rr "," r rr r rr"," rrr rr rrr"," r rrr rr "," rr rr r "," r rr r r"," rrr rr rr "," rr r r r "," rrr r r "," r r rr "," r rr rr rr"," r rrr r "," rr rr r"," rr r r r "," rr rr r rr"," rr r r r"," r rr rr"," r r r r"," r rrr rr "," rr r rr "," rrr r r "," r rr rrr"," r rrr rrr "," r rrr rrr "," rr r r rrr"," r rr r r r"," r r r r rr"," r rrr "," r r rr rrr"," rrr r rr r"," r rrr r "," r rr r"," r rrr r "," rr rr r"," r rr r "," rrr r rr"," rr rr "," rrr r rr "," r rr rr r"," r rrr r r "," r r rr rr"," r rr rr r"," rr r r r "," rr r rrr r"," rr r r r"," r r rr rrr"," r rrr rr r"," rr rr r "," r rr r r "," r r r r"," rr rr r r"," rr r rrr"," rr r rr r"," r r r rr "," r rr r "," r rrr r r"," rrr r rr r"," r rrr rr rr"," r rr r r r"," r rr r rr"," rrr r r "," rr rrr rr "," rrr rr "," rrr rrr r"," rrr rr rr"," rrr rr rr"," r r rr rr"," rr r rr "," rr r r "," r rrr r r"," rr rr r "," rr rr rr "," rr r r "," rr r r "," rr rrr r "," rr rr rrr"," rrr r rr "," r r rr rr "," rr r r r "," rrr rr "," r rr r rr"," r r r r r"," r rr r r"," r r rr rr"," r rrr r r "," r rrr r r r"," r r rrr r"," rr r rr r"," r rr r rr "," rrr r r"," rrr r r "," rrr rrr r "," r r r rr "," rr r rr "," r rr rrr"," r rr r "," r r rr "," r r r r"," r r r r r "," r r rrr r"," rr r rr r"," r rr r rr "," r rr rr "," r r r r"," r r r r"," r r r r "," rr r r "," r r r r "," r rr rr "," rr rr r "," rr r rr rr "," rrr rr r "," r r rr r "," rr r rrr "," r rrr rrr"," rr rrr r "," r rr rrr rr"," rr r r"," rr r rr rr"," rr r r"," rrr r r "," r r rrr r "," r rr r rr r"," rrr rr r "," rr rrr r r"," r rrr r r"," rrr rrr rr "," rr rrr rr "," rr r r r"," r rrr r r"," rr r rr"," rr r r r rr"," rr rr r r"," rr rrr rr"," rr r r r"," rrr r rrr "," r r rrr r "," rrr rr r "," rr r r rrr"," r rr rr rrr"," rr r r "," r r rr r "," r rr rrr"," r r r rr rr"," r r rrr "," r r rrr "," rr rrr rrr"," r r rrr "," rr r rr r r"," rr rr rrr"," rrr r rr "," rr rr rr"," r r r r rr"," rr r rrr"," r rr r r r"," rr r r rr "," rrr rrr r"," rrr rr rr "," r r r r "," rr r rrr "," r rrr r r"," r rr r "," rr r r "," r r r rr"," r rrr rr "," r r r r r r"," r r rrr "," rr r rr"," rr r r r "," rr rrr r "," rr rrr r"," r r r "," rrr r rr"," rr rr r"," r rr r "," r rr r "," rr rr rr"," r rr rrr "," r rrr r r"," rr rr r r"," rrr rrr "," r rrr rrr"," rr r rrr r"," rr rr r r"," r rr r r"," r r rrr r"," r r r r"," rr rrr rrr "," r rr r r "," rr rr "," rr r rr "," r rr rrr r"," rr r r r "," rr r r r "," r rr r rr"," r rrr rr r"," rr r r r"," r rr r rrr"," rr r r r r"," rrr rrr r"," r rr rrr "," r r rrr r"," r r rr rr "," r r r r"," rr rr rr "," r rr r r "," r rr rr r"," rrr rrr rr"," rr rrr r r"," r rr r r"," r rr r rrr"," r r rr r"," r r r r r "," r r r r r "," r r r rr"," r r rr r "," r r rr rr"," r r r rrr r"," rr r rr rr"," r r rr r"," r r rr rr"," r r r r"," r r rrr r"," r rrr r rrr"," r r rr rr"," r r r rr"," r rr r "," r rr rrr "," r r r "," rrr r r rr"," r rrr r "," r r r r "," r rr r r"," r r rr r"," r r r rr "," rrr r r"," rr r r "," rrr r r r "," rr r r "," rr rr r "," r rr r r "," r r r rrr"," r rr rr r"," r r r r "," r r r "," r r rrr r r"," r rr r rr"," r rr r "," rrr r r "," r rr rr rr"," r rr r rr"," rr rrr "," rr rrr rr "," rrr r rr "," rrr r rr r"," r r rr rrr "," r r r r r"," rrr r rrr r"," rr r r rr "," rrr r r"," r rr r r"," rr rr r "," rr rr rrr "," r r r rrr"," rr rr rr "," rrr r rrr"," r rr rr r "," r rrr r "," r r rr "," rr r r r "," r r rr "," r r r r "," r rrr r"," rr rrr r "," rr rrr rr "," rr r r r"," rrr rr r"," r r r r rr"," r r rr r"," rrr rr r "," rr rrr rrr"," r rr rr "," rr rr "," r r rrr "," r r rr r"," r r rr r "," r r rr r r "," r r rr rrr"," r rrr rrr"," rrr r r "," r r r r r"," rr rr r rr"," rr r rrr "," rr r r r "," r r r rr"," rrr rr rrr"," r r r rrr"," r r rr r"," r r rr r "," r rrr rr"," r r rrr rr"," r r rr r r"," rr rr r r "," r rrr r"," rrr rr r r"," r rrr rr"," r rrr rr "," r rr r "," rrr r r r"," r r r r r"," r r r r"," r r r r r"," rr r r r"," r r r rr "," rrr rr r "," r rr rr r"," r rrr rr "," r rrr r rr "," rrr r r rr "," rrr rr "," rr r rr r"," r r r "," r rr r "," r rrr r"," rrr r rr r"," rr r rr"," r r rr r r"," r rrr r "," rr r r r"," rr r r "," r r rrr r"," rr rr r r r"," rrr rrr "," rr r r rrr"," rrr rr r"," r rr rrr "," rr r r "," rrr r r "," rr rrr r "," rr r r "," r rrr rrr"," r r rr "," rr rr rrr "," rrr rrr "," rrr r r r "," rrr r r r "," r r r rr"," r r rr r "," r rrr r "," r rr r r"," r r rr "," rr r rrr "," rr rr rr r "," r r r rrr"," r rr rr rr"," r rrr r rr"," rr r r rr"," r r r r"," rr rr rrr "," r rrr r r"," r rr r r r "," r r rr "," r rr r r "," rr rr r "," r rr r "," r rrr rr r"," r r rrr rr"," r r r "," r r r rr"," r r r rrr"," rr r r "," r r rrr "," r r r "," r r r r "," rr rr rr"," r rrr rr"," rr r rrr"," r rr rr r"," r r rr r"," rrr rr r"," r r r r rrr"," r rr rr "," r rr rrr "," rrr rrr r "," rr r r rr"," r r r r "," r r r "," rr rrr r"," r r r r "," rr r r "," r r rr r"," rrr r r r "," rr rr r r "," rrr r r r"," r r r r "," r rr r r"," rrr r "," rr r rr"," r rr rr "," rr rrr "," r r rr r"," rr rr rr"," rrr r rr"," rr r rr "," rrr rr rr"," rrr rr rrr "," r r rr r "," r r r rr "," r rrr r "," r r rrr "," rrr r rr "," rr r rr rr"," r r rr r"," r rr r r r"," r r rr r "," rr rr rrr"," rrr rr rr r"," r rr r "," r r r rr"," rrr rr r"," rr r rrr "," r rr rr r"," r r r rr r"," r rr r "," r r r r r "," rr r rr r "," r r rr r"," rr r r rr"," r r rrr"," r r r rr "," r r r rrr"," rr r rrr"," rrr r r "," r rrr r "," rr rrr rr"," r rr rr "," rr r rrr"," rr r rr "," r r r r r"," rr rr rr "," rr rrr rr"," rr r r "," r r r r "," rr r rr "," rrr r rr "," r rrr r r "," rr r r r r"," r rr r rr"," r rrr rr "," rr rr rr r"," r r r r"," rr rr r "," r r r r "," rr r rr r"," rr r rr r "," r r rr r "," rr rr rr "," rrr r r "," rr r r rr"," r r r "," rr r rrr"," rr r rrr "," r rrr r"," rrr r rrr"," rrr r r r"," rrr r r r"," r r r r"," r rr r rr "," rr r r r "," rr r r r"," r rrr rrr"," rr rr r rrr"," rr r r r "," rr rrr rr r"," rr r r r "," r r rrr r "," rr rrr rrr"," r r r r r "," r rrr rr"," rrr rr r "," r rr r r rr"," rrr r r r "," r rrr "," r rrr r "," r r rrr r"," r rrr r r"," rrr rr r"," rr r r rr r"," rr rr rrr"," r r r r r"," r r rrr "," rr r r r r"," r rr r r "," rr rr rrr r"," r rr rr "," rr rr r "," r r r r "," r rr r r "," rr rr r rr"," r r r "," rrr rrr r "," rr r rrr "," r rr r rr"," rrr rr rr "," rr rr rrr "," rr rr r r"," rr r r r "," r r r r"," rrr r "," r r r"," r rrr r"," r r r r"," r r rr r "," r r rr "," r r r "," rr r r "," r rr rrr"," r r r r "," r r rrr rr"," r r r r r"," r rrr rr"," rr r r r"," r rr rr "," r r rrr rr "," rrr r r r"," r rr r r "," r r rrr "," r rr r"," rr r r rr"," r r r rrr "," r r r r "," rrr r r r"," rr rrr r r"," rrr r rrr"," r rr rrr"," r rr r rrr"," rr rr r "," r rrr r r "," r rr rr"," r rr "," rrr r r rr"," rr rr r "," rr r rr "," r r r rr"," rrr r r "," rrr r r "," r r r r "," r r rrr r"," r r rr r"," r rr r r"," rr rrr r"," r r rr rrr"," r rr r r "," r rrr rrr "," rr rr r rr"," rrr rr r r "," r r r rr r"," rr rrr "," r rrr rrr"," rr rrr r "," rr r r r r"," rrr r rr rr"," r rrr rr"," r rrr r"," rr rr rrr"," r rr rrr "," r r rrr "," r rr rr "," rr rrr r"," r r r rr "," r r r rr "," rr rr rr "," rr r rr rr"," rrr rrr r r"," r rr rr"," r rr r rr "," rrr rr rr"," r r r rrr "," rr rr r r"," r r r rrr "," rrr rr rrr"," r r r r "," rr rr rr "," rr rrr r"," rr r r r "," rrr r rrr"," r rrr r "," rrr r r r"," rrr rr r r"," rrr rr r"," rr rrr r "," rr r r rr"," r r r "," rrr rrr r"," rr r r r"," r r rr "," r r r r rr"," r rrr rr r "," rr rr rr r"," r r rr "," r r r rr r"," r r rr r r"," r rr rr "," r rrr rr "," r r rr rr r"," r r rrr rrr"," rr rrr r "," r r r r r "," r r rr "," r rr r r"," r r rr r"," r r r r"," r rr r "," r r rrr rr"," rrr r rr r "," rrr r rrr"," r rrr rr "," r r rr r "," r rr rrr r"," r rr r r "," rr rr r r "," rr rr r "," r r r r r"," rr r rrr r "," r r rrr "," rr rrr rr"," r r r r"," rrr r r r"," r r r "," r rr rrr"," rr rrr rr"," rr rrr "," r r rr r rr"," r r r r r"," r r r rr "," r r rrr "," r rr rrr r"," rr rr r "," r r r "," r rr rr "," r r r "," r rr rr "," r r r r r"," r r r r "," r r rrr"," r r rr "," r r rr rr "," r rr rr rr "," r r r r"," r r r r"," r rr r "," rr r rr r "," rr rr r"," rr rrr r rr"," rrr rr rr"," r rrr r "," rrr rr r "," r r rrr"," r rr r "," rr rr r"," rrr r rr "," rr r rr r"," r r rrr r "," rr rr r r "," r rr r r"," r rr rr r"," r rr r rr "," rrr r rr"," r r r rrr"," rr r rr r"," rrr rr r"," rr r rrr r"," r rr r r"," rr r rr "," rr rr rr"," r r r r rr "," rr rr rr rr"," rr rrr r"," r rrr rr "," r r rr r"," r r r rrr"," r r rr r "," r r r rr "," r r r rr r "," r rrr r rr"," rrr rr rr "," rrr rrr rr"," r r rr rr"," r r rr "," r rr r r"," rr r r rr "," rr r r rr"," rr rr rr r"," rr r rr"," rr r r r "," r rrr rr "," rr r rr "," rr r rrr"," r rr r r"," rr r rr "," r rrr rrr "," rr r rr r"," rrr rrr "," r r rrr r"," rrr rr r r"," rr r r"," rr rrr rr"," rr r r r"," rr rrr "," rr r rrr rr"," rr r rr "," r rr rrr "," r r rr r r"," rr r r "," r r r "," r r rrr"," r r rr "," r r rrr"," rr r rr r "," rr rr r"," rr rrr r "," r r r "," r r r r"," rr rr r r"," r r r r "," r rr rr r "," rr rr rr "," rrr r rr"," r r rrr "," rrr rrr"," r r r r "," r r r r "," r rr rrr "," r rr rrr r"," rr r r rrr"," r r rrr "," rr r r r"," r r rr"," r rr rr r "," rrr r rr "," rrr r rrr "," rr r rrr "," rr r rrr "," r r r r r"," rrr rrr r"," r r rrr "," r rr r r "," rrr r r r r"," rr r r rrr "," rrr r "," rrr rr "," rrr rrr r "," rr r r r r"," r rr rr rr"," rr rrr r "," r r rr "," r r r r r"," rr rr r "," r r r r "," rr r r r"," rrr rrr "," r r rr r"," r rrr rr"," r r r r "," r r r r "," r r r r "," r rrr r "," r r r rrr"," r rrr r r"," r r rrr r "," r rrr "," r r r rr "," r rr rr "," r r r rr r"," r rr r rrr "," r rrr r r"," r rr rr "," r r r r "," r r rrr r"," rrr r r"," r r r rr"," r r r rrr "," r r r rr"," rr r r rr "," rr r r rr"," r rr rr"," rrr r r rr"," rrr r r "," rrr r rr "," rr rr rrr"," rr rrr r"," r r r rr"," rr r rr "," r r r rr"," r rr rr r r"," r rr r r "," r rr r rr"," r r rr rr"," r r rr rr "," rrr r rrr "," r r rrr "," rr r r r"," rr rrr r r "," rrr rr r rr"," r rr rrr "," r rr r rr"," r r r rrr "," rr r r "," rrr r rrr "," rrr r r r"," rrr r r r"," r r r rr "," r r r r rr"," r rr r r"," rrr r r rr"," rr rr r "," rrr rrr r"," rrr r rr"," r rr rr r"," r rr rr r "," r rr rrr r "," r rr rr"," rr rrr r r"," rr r rr rrr"," rr r r "," r rr r"," r rr r r "," rrr rr r "," r r rr rr "," r rr r "," rr r r rr"," rr r rrr "," rrr r r "," r rrr rrr r"," r r rr r"," r rr rrr "," rrr r rr"," r r r rr "," r rr rr"," rr r rr "," rrr rr r r"," rr r r "," r rrr r "," r r rr rr"," rrr r r"," rr r rr r"," rr r r rr"," r r r rr "," r r rr"," rrr rrr rr"," r r r r r"," rrr rrr "," r r r rr"," rrr r r "," rrr rrr "," rr rr rr"," rrr rr r "," r r r r "," r rrr r "," rrr r r rrr"," r rrr r "," rrr r rr "," r r r r "," rr r "," rr rr rr "," r rr r r "," r r r rr "," r r r r r"," rrr rrr rrr"," r r rr r r"," r r rr rr"," r r r r "," rr rr r r"," r rr rr r"," rrr rr "," rrr r r"," r rr rrr"," r r rr "," rr rr rr "," r r rr r "," r r rr r "," r rr r "," r r rrr"," r r r rr r"," r rrr r rr"," rr rr r r"," rr r rrr r"," rr r rr r"," r rr rr "," rrr r rrr"," r r r rr"," r r rr"," rr r r r"," rr rr r r "," rr rr r r"," rrr rr rr"," r rr rr "," r rrr rr r"," r r rr "," r rrr r r "," r rr r r r"," r r r rrr"," rr r r r r "," rr rr rr"," rr rrr "," r rrr r rr"," r r rr r "," r rr r rrr"," r r rr "," r rr r "," r rr rr r "," rr r rr"]},Uk={onFlashDone:h.func,onClose:h.func,onError:h.func,captureFrameSettings:h.shape({}),frontCamera:h.bool,customErrors:h.shape({}),livenessSettings:h.shape({timeout:h.number,enableFarStep:h.bool}),outputEncryptionSettings:h.shape({}),cameraScale:h.number,defaultCameraId:h.string,styledComponent:h.shape({CloseCameraButton:h.node}),frameInterval:h.number,flashSettings:h.shape({colorsLength:h.number,delayBetweenColors:h.number,framesPerColor:h.number,flashIntensity:h.number,useFaceDetectorWhenFlashing:h.bool}),themeSettings:h.shape({}),maskSettings:h.shape({smallScale:h.number,largeScale:h.number,ovalPadding:h.oneOfType([h.number,h.shape({top:h.number,right:h.number,bottom:h.number,left:h.number})]),ovalVerticalOffset:h.number,chinToMaskBottomPadding:h.number}),faceSettings:h.shape({minFarFaceRatio:h.number,maxFarFaceRatio:h.number,closeFaceRatio:h.number}),closeEyesSettings:h.shape({enable:h.bool,timeout:h.number})},Vk={onFlashDone:function(){},onClose:function(){},onError:function(){},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},frontCamera:!0,customErrors:null,livenessSettings:{timeout:30,enableFarStep:!0},outputEncryptionSettings:null,cameraScale:1,defaultCameraId:void 0,styledComponent:{CloseCameraButton:null},frameInterval:0,flashSettings:{colorsLength:10,delayBetweenColors:120,framesPerColor:4,flashIntensity:1,useFaceDetectorWhenFlashing:!1},themeSettings:{},maskSettings:{smallScale:qs.isMobile?.65:.6,largeScale:qs.isMobile?.9:.85,ovalPadding:{left:qs.isMobile?20:30,right:qs.isMobile?20:30,top:0,bottom:20},ovalVerticalOffset:qs.isMobile?60:0,chinToMaskBottomPadding:20},faceSettings:{minFarFaceRatio:qs.isMobile?.85:.8,maxFarFaceRatio:.9,closeFaceRatio:qs.isMobile?.95:.82},closeEyesSettings:{enable:!1,timeout:5}},jk="#ffffff",zk=(m.div(xk||(xk=L(["\n z-index: ",";\n color: #ffffff;\n"])),1020),m(bk)(Pk||(Pk=L(["\n z-index: 2010;\n color: #ffffff;\n width: 100%;\n height: 100%;\n opacity: 1;\n margin: 0;\n"])))),Kk=v(["from{transform:translateY(calc(50vh - 12px));}to{transform:translateY(0%);}"]),Hk=m(sk)(Rk||(Rk=L(["\n margin-block-start: 12px;\n animation: "," 1s ease-in-out;\n\n & svg {\n margin-inline-end: 8px;\n width: 24px;\n height: 24px;\n }\n\n color: ",";\n background: ",";\n"])),Kk,(function(e){var r=e.theme;return e.$flashing?r.instruction.flashing.color:"#1d1d1d"}),(function(e){var r=e.theme;return e.$flashing?r.instruction.flashing.backgroundColor:"#fafafa"})),qk=m.div(Dk||(Dk=L(["\n width: 100vw;\n height: 100vh;\n position: absolute;\n top: 0;\n left: 0;\n z-index: ",";\n background-color: ",";\n opacity: ",";\n"])),1001,(function(e){return e.$backgroundColor}),(function(e){return e.$intensity})),Gk=m.div(Nk||(Nk=L(["\n background: red;\n opacity: 0.2;\n width: 100vw;\n height: 100vh;\n position: absolute;\n top: 0;\n left: 0;\n z-index: ",";\n"])),1001),Wk=m(ak)(Lk||(Lk=L(["\n margin-block-start: 10px;\n color: #1d1d1d;\n mix-blend-mode: difference;\n width: 300px;\n"]))),Qk=m.div(Ok||(Ok=L(["\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n z-index: ",";\n"])),1002),Xk=m.div(Mk||(Mk=L(["\n position: absolute;\n left: 50%;\n transform: translateX(-50%);\n top: ","px;\n"])),(function(e){return e.$top})),Yk=qs.isMobile?{aspectRatio:window.innerHeight/window.innerWidth}:null,Zk={background:jk,opacity:.6};function $k(e){var s,u=e.onFlashDone,l=e.onClose,d=e.onError,f=e.frontCamera,p=e.cameraScale,h=e.defaultCameraId,m=e.styledComponent,g=e.frameInterval,v=e.flashSettings,y=e.maskSettings,b=e.faceSettings,C=e.closeEyesSettings,w=e.livenessSettings;if(y.smallScale>y.largeScale)throw new Error("smallScale must be smaller than largeScale");var E,_,I=a(),T=Sk(),x=ww(),P=t(zw),R=function(e){if("number"==typeof e)return{top:e,right:e,bottom:e,left:e};if("object"===B(e)){var r=e.top,t=e.right,n=e.bottom,a=e.left;return{top:null!=r?r:0,right:null!=t?t:0,bottom:null!=n?n:0,left:null!=a?a:0}}return{top:0,right:0,bottom:0,left:0}}(y.ovalPadding),D=v.colorsLength,N=v.framesPerColor,L=v.delayBetweenColors,M=v.useFaceDetectorWhenFlashing,F=v.flashIntensity,U=n((function(){var e=Fk[E];return e[Math.floor(Math.random()*e.length)]}),[E=D]),V=Ck(y,mk),j=V.smallScale,z=V.largeScale,K=function(e){var r=O(c(e),2),t=r[0],n=r[1];return{maskScale:t,handleMaskScale:o((function(e){n(e)}),[])}}(j),H=K.maskScale,q=K.handleMaskScale,G=function(e){var r=O(c(e),2),t=r[0],n=r[1];return i((function(){!function(){var r=S(regeneratorRuntime.mark((function r(){var t,a,o,i,s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,Promise.all([new Promise((function(e){requestAnimationFrame((function(r){requestAnimationFrame((function(t){e(Math.round(1e3/(t-r)))}))}))})),Jw()]);case 3:t=r.sent,a=O(t,2),o=a[0],i=a[1],s=Math.max(1e3/o,1e3/i,e),n(s),r.next=15;break;case 11:r.prev=11,r.t0=r.catch(0),console.error(r.t0),n(20);case 15:case"end":return r.stop()}}),r,null,[[0,11]])})));return function(){return r.apply(this,arguments)}}()()}),[e]),t}(g),W=a(null),Q=function(){var e,r=O(c(null),2),t=r[0],n=r[1],o=O(c(!1),2),s=o[0],u=o[1],l=a(null);return i((function(){if(!l.current)return function(){};var e=l.current,r=function(){n(e.getBoundingClientRect()),u(!1)},t=function(){u(!0)};return e.addEventListener("transitionrun",t),e.addEventListener("transitionend",r),function(){e.removeEventListener("transitionrun",t),e.removeEventListener("transitionend",r)}}),[]),[l,null!=t?t:null===(e=l.current)||void 0===e?void 0:e.getBoundingClientRect(),s]}(),X=O(Q,3),Y=X[0],Z=X[1],$=X[2],J=O(c(Iw),2),ee=J[0],re=J[1],te=O(c(""),2),ne=te[0],ae=te[1],oe=a({frames:(s={},A(s,Nw,[]),A(s,Lw,[]),A(s,Ow,[]),s),images:[]}),ie=function(e){var r,t=e.mode,n=a(Date.now()),s=null!==(r=Ek("data.settings.sdk_settings.id_detection_settings.exif_data_settings.enable"))&&void 0!==r&&r,c=o((function(){if(s){var e=Date.now();Rs.preWriteExif({mode:t,startTime:n.current,endTime:e})}}),[t,s]),u=o(function(){var e=S(regeneratorRuntime.mark((function e(r){var n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.imageData){e.next=3;break}return e.abrupt("return",null);case 3:if(s){e.next=5;break}return e.abrupt("return",n.blob);case 5:return e.next=7,Rs.writeExif({mode:t,imageData:n,enableExifData:!0});case 7:return a=e.sent,e.abrupt("return",a);case 9:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[t,s]);return i((function(){s&&Rs.initExifData()}),[s]),{prepareExifData:c,writeExifData:u}}({mode:Rs.MODE.SELFIE}),se=ie.prepareExifData,ce=ie.writeExifData,ue=o((function(){oe.current.frames[Nw]=[],oe.current.frames[Lw]=[],oe.current.images=[],w.enableFarStep&&(q(j),re(Tw)),ae(x("move_face_into_frame"))}),[q,j,x,w.enableFarStep]),le=o((function(){ae(x("move_face_into_frame"))}),[x]),de=Yw({surroundStyle:Zk,onVideoPlayed:le,maskSize:gk}),fe=de.onVideoPlayed,pe=de.cropArea,he=de.isPlaying,me=function(e){var r=e.offset,t=e.ovalPadding,n=e.largeScale,a=e.ovalHeight,o=e.maskHeight,i=a/2+t.bottom;return(i+r)*n>o/2?o/2/n-i:r}({offset:y.ovalVerticalOffset,ovalPadding:R,largeScale:z,maskHeight:pe.height,ovalHeight:mk.height}),ge=o(S(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return re(Rw),ae("".concat(x("uploading"),"...")),console.timeEnd("Flash duration"),T("selfie","user_activity.finish_flash"),T("selfie","user_activity",(function(e){return{flash_liveness_in_ms:e.lastTimeLog-I.current}})),se(),e.next=8,Promise.all([ce({imageData:oe.current.images[0]}),ce({imageData:oe.current.images[1]})]);case 8:if(oe.current.images=e.sent,oe.current.images=oe.current.images.filter((function(e){return null!==e})),e.prev=10,"function"!=typeof u){e.next=14;break}return e.next=14,u(oe.current,{colors:U});case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(10),d({error:e.t0});case 19:re(Dw),ae("");case 21:case"end":return e.stop()}}),e,null,[[10,16]])}))),[se,ce,u,d,x,T,U]),ve=function(e){var r,t=e.colors,a=e.onFlashDone,s=e.framesPerColor,u=O(c(-1),2),l=u[0],d=u[1],f=n((function(){return t.split("").reduce((function(e,r){return e+r.repeat(s)}),"")}),[t,s]),p=null!==(r=Xw[f[l]])&&void 0!==r?r:Xw.default,h=o((function(){d((function(e){return e+1}))}),[]),m=o((function(){d(0)}),[]);return i((function(){l>f.length-1&&(d(-1),"function"==typeof a&&a())}),[l,f.length,a]),{colorIndex:l,currentColor:p,goToNextColor:h,startFlashing:m}}({colors:U,onFlashDone:ge,framesPerColor:N}),ye=ve.currentColor,be=ve.colorIndex,Ce=ve.startFlashing,we=ve.goToNextColor,ke=o((function(e,r,t){var n=oe.current.frames[Nw],a=$w(e,r,t,n.length);a.color="",n.push(a)}),[]),Be=o((function(e,r){ca.takePicture({canvas:r}).then((function(e){oe.current.images[0]||(oe.current.images[0]={blob:e,gesture:"frontal",capture_time:Date.now(),frames:oe.current.frames[Nw].length})})),q(z),re(xw),ae(x("move_face_into_frame"))}),[q,z,x]),Ee=o((function(e,r,t){var n=oe.current.frames[Lw],a=$w(e,r,t,n.length);a.color="",n.push(a),ca.takePicture({canvas:r}).then((function(e){oe.current.images[1]||(oe.current.images[1]={blob:e,gesture:"frontal",capture_time:Date.now(),frames:oe.current.frames[Lw].length})})),k((function(){console.time("Flash duration"),re(Pw),ae(x("hold_still")),Ce()}))}),[Ce,x]),Se=-1!==be&&ee===Pw,_e=o((function(e,r,t){var n=oe.current.frames[Ow],a=$w(e,r,t,n.length);a.color=ye,n.push(a),Se&&we()}),[ye,we,Se]),Ae=o((function(e){var r=e.error;"no_face"!==r&&"multiple_faces"!==r||ue()}),[ue]),Ie=o((function(e,r,t){var n=oe.current.frames[Lw],a=$w(e,r,t,n.length);a.color=jk,n.push(a)}),[]),Te=n((function(){return be%N==0?Math.max(L,G):G}),[be,L,G,N]),xe=Gw({cameraScale:p,onError:d,isVideoPlaying:he,step:ee,cropArea:pe,videoRef:W,onCloseFaceDetected:Ee,onFarFullFaceDetected:Be,onFlashingFramesCaptured:_e,frameInterval:Te,useFaceDetectorWhenFlashing:M,onFaceError:Ae,onMovingCloseFace:Ie,onFarFaceDetected:ke,faceSettings:b,ovalPadding:R,ovalBoundingRect:Z,isOvalTransitioning:$,chinToMaskBottomPadding:y.chinToMaskBottomPadding,closeEyesSettings:C}),Pe=xe.faceError,Re=xe.warmupDone;_=W.current,i((function(){return function(){var e;_&&(null===(e=_.srcObject)||void 0===e||e.getTracks().forEach((function(e){e.stop()})))}}),[_]);_k((function(){w.enableFarStep?re(Tw):re(xw),I.current||(I.current=performance.now())}),Re&&he),_k((function(){return T("selfie","user_activity.start_far")}),ee===Tw),_k((function(){return T("selfie","user_activity.start_close")}),ee===xw),_k((function(){return T("selfie","user_activity.start_flash")}),ee===Pw),_k((function(){return q(z)}),!w.enableFarStep);var De,Ne=Math.min(Math.round((be+1)/(U.length*N)*100),100),Le=m.CloseCameraButton;return r.createElement(r.Fragment,null,r.createElement(hu,{frontCamera:f,onVideoPlayed:fe,onClose:l,flipHorizontal:f,ref:W,onError:d,scale:p,defaultCameraId:h,videoSettings:Yk,closeButton:Le||null}),""!==Pe&&r.createElement(Gk,null),r.createElement(hk,{overlay:!Re||!he},ee!==Dw&&r.createElement(Cu,{x:"".concat(Math.round(pe.x),"px"),y:"".concat(Math.round(pe.y),"px"),width:"".concat(pe.width,"px"),height:"".concat(pe.height,"px"),surroundStyle:{background:De||jk,opacity:1}},r.createElement(zk,{ref:Y,scale:H,debug:P,width:pe.width,height:pe.height,padding:R,verticalOffset:me})),r.createElement(Qk,null,ne&&r.createElement(Hk,{key:ee,$flashing:ee===Pw},ee===Pw?ne:r.createElement(r.Fragment,null,r.createElement(ek,null)," ",ne)),r.createElement(Tk,{onTimeout:ue,timeout:w.timeout,shouldStart:Re&&he,shouldStop:ee===Pw}),ee===Pw&&r.createElement(Wk,{value:Ne,max:100})),r.createElement(Xk,{$top:Math.round(pe.y+pe.height/3)},""!==Pe&&r.createElement(lk,null,x(Pe))),ee===Pw&&r.createElement(qk,{$backgroundColor:ye,$intensity:F})))}$k.propTypes=Uk,$k.defaultProps=Vk;var Jk,eB,rB,tB,nB=function(e){var t=e.className;return r.createElement("svg",{className:t,width:"89",height:"22",viewBox:"0 0 89 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{d:"M59.5591 14.4581C59.5591 14.911 59.494 15.3432 59.3636 15.7549C59.2333 16.1666 59.0343 16.5337 58.7668 16.8561C58.4992 17.1786 58.1631 17.4359 57.7584 17.628C57.3536 17.8202 56.87 17.9162 56.3075 17.9162C55.841 17.9162 55.4157 17.8407 55.0315 17.6898C54.6473 17.5388 54.3146 17.3261 54.0333 17.0517C53.7521 16.7772 53.536 16.4479 53.3851 16.0637C53.2342 15.6794 53.1587 15.254 53.1587 14.7875V13.923L54.9697 14.3141V14.7875C54.9697 15.1854 55.0932 15.5045 55.3402 15.7446C55.5872 15.9848 55.9096 16.1048 56.3075 16.1048C57.2404 16.1048 57.7069 15.6657 57.7069 14.7875C57.7069 14.4581 57.6657 14.1803 57.5834 13.9538C57.5011 13.7274 57.3845 13.5182 57.2336 13.326C57.014 13.079 56.7808 12.8526 56.5338 12.6468C56.2869 12.4409 56.0365 12.2351 55.7827 12.0293C55.5288 11.8234 55.2784 11.6107 55.0315 11.3912C54.7845 11.1716 54.5513 10.9315 54.3318 10.6707C54.0299 10.3139 53.7864 9.916 53.6012 9.47688C53.4159 9.03776 53.3233 8.53003 53.3233 7.95368C53.3233 7.50084 53.3988 7.08574 53.5497 6.70837C53.7006 6.331 53.9133 6.00852 54.1877 5.74093C54.4621 5.47334 54.788 5.26408 55.1653 5.11313C55.5426 4.96218 55.9576 4.88671 56.4104 4.88671C57.3571 4.88671 58.0842 5.16801 58.5919 5.73064C59.0995 6.29326 59.3533 7.02741 59.3533 7.9331V8.79762L57.5834 8.38594V7.9331C57.5834 7.52142 57.4702 7.19552 57.2439 6.95537C57.0175 6.71523 56.7191 6.59516 56.3486 6.59516C55.9645 6.59516 55.666 6.71866 55.4534 6.96566C55.2407 7.21267 55.1344 7.54887 55.1344 7.97427C55.1344 8.45456 55.2853 8.88681 55.5872 9.27104C55.889 9.65527 56.2526 10.0258 56.6779 10.3826C57.1032 10.7393 57.5388 11.1064 57.9847 11.4838C58.4306 11.8612 58.7977 12.2831 59.0858 12.7497C59.2367 12.9967 59.3533 13.2677 59.4356 13.5627C59.518 13.8578 59.5591 14.1562 59.5591 14.4581ZM66.9474 14.7875C66.9474 15.2678 66.8651 15.7035 66.7004 16.0945C66.5358 16.4856 66.3094 16.815 66.0213 17.0826C65.7332 17.3502 65.4005 17.556 65.0232 17.7001C64.6459 17.8442 64.2445 17.9162 63.8192 17.9162C63.3802 17.9162 62.9686 17.8442 62.5844 17.7001C62.2002 17.556 61.8675 17.3502 61.5863 17.0826C61.305 16.815 61.0855 16.4856 60.9277 16.0945C60.7699 15.7035 60.691 15.2678 60.691 14.7875V7.9331C60.691 7.46653 60.7699 7.04457 60.9277 6.6672C61.0855 6.28983 61.305 5.96735 61.5863 5.69976C61.8675 5.43217 62.2002 5.22977 62.5844 5.09254C62.9686 4.95532 63.3802 4.88671 63.8192 4.88671C64.2445 4.88671 64.6459 4.95532 65.0232 5.09254C65.4005 5.22977 65.7332 5.43217 66.0213 5.69976C66.3094 5.96735 66.5358 6.28983 66.7004 6.6672C66.8651 7.04457 66.9474 7.46653 66.9474 7.9331V14.7875ZM65.1364 7.9331C65.1364 7.49398 65.006 7.16121 64.7453 6.93479C64.4846 6.70836 64.1759 6.59516 63.8192 6.59516C63.4488 6.59516 63.1366 6.70836 62.8828 6.93479C62.629 7.16121 62.5021 7.49398 62.5021 7.9331V14.7875C62.5021 15.2129 62.629 15.5388 62.8828 15.7652C63.1366 15.9916 63.4488 16.1048 63.8192 16.1048C64.1759 16.1048 64.4846 15.9916 64.7453 15.7652C65.006 15.5388 65.1364 15.2129 65.1364 14.7875V7.9331ZM71.331 6.59516C70.9605 6.59516 70.6484 6.70836 70.3946 6.93479C70.1408 7.16121 70.0139 7.49398 70.0139 7.9331V14.7875C70.0139 15.2129 70.1408 15.5388 70.3946 15.7652C70.6484 15.9916 70.9605 16.1048 71.331 16.1048C71.6877 16.1048 71.9964 15.9951 72.2571 15.7755C72.5178 15.5559 72.6481 15.2266 72.6481 14.7875V14.5816L74.4592 13.9847V14.7875C74.4592 15.3227 74.3769 15.7858 74.2122 16.1769C74.0476 16.568 73.8212 16.8904 73.5331 17.1443C73.2449 17.3982 72.9122 17.5903 72.5349 17.7207C72.1576 17.851 71.7563 17.9162 71.331 17.9162C70.8919 17.9162 70.4803 17.8476 70.0962 17.7104C69.712 17.5731 69.3793 17.3707 69.098 17.1032C68.8168 16.8356 68.5973 16.5097 68.4395 16.1254C68.2817 15.7412 68.2028 15.2952 68.2028 14.7875V7.9331C68.2028 7.37047 68.2817 6.89705 68.4395 6.51282C68.5973 6.12859 68.8168 5.81641 69.098 5.57626C69.3793 5.33612 69.712 5.16116 70.0962 5.05138C70.4803 4.9416 70.8919 4.88671 71.331 4.88671C71.7563 4.88671 72.1576 4.9416 72.5349 5.05138C72.9122 5.16116 73.2449 5.33955 73.5331 5.58655C73.8212 5.83356 74.0476 6.14917 74.2122 6.5334C74.3769 6.91764 74.4592 7.3842 74.4592 7.9331V8.46828H72.6481V7.9331C72.6481 7.49398 72.5178 7.16121 72.2571 6.93479C71.9964 6.70836 71.6877 6.59516 71.331 6.59516ZM77.505 1.96382C77.4913 2.27944 77.4021 2.54702 77.2375 2.76658C77.0729 2.98614 76.8533 3.09592 76.5789 3.09592C76.3045 3.09592 76.0781 2.98614 75.8998 2.76658C75.7214 2.54702 75.6322 2.27944 75.6322 1.96382C75.6322 1.67564 75.7214 1.41835 75.8998 1.19193C76.0781 0.965504 76.3045 0.852295 76.5789 0.852295C76.8533 0.852295 77.0763 0.962074 77.2478 1.18163C77.4193 1.4012 77.505 1.66192 77.505 1.96382ZM77.4433 17.628H75.6322V5.05138H77.4433V17.628ZM84.8933 17.628H83.6997L83.2881 16.9076C83.1371 17.1821 82.9039 17.4188 82.5883 17.6177C82.2728 17.8167 81.8543 17.9162 81.333 17.9162C81.0037 17.9162 80.6744 17.8545 80.3451 17.731C80.0158 17.6075 79.7208 17.4119 79.4602 17.1443C79.1995 16.8767 78.9902 16.5371 78.8325 16.1254C78.6747 15.7137 78.5958 15.2129 78.5958 14.6228C78.5958 14.0053 78.6781 13.4598 78.8428 12.9864C79.0074 12.513 79.2201 12.091 79.4807 11.7205C79.7414 11.35 80.0364 11.0172 80.3657 10.7222C80.695 10.4272 81.0242 10.1596 81.3535 9.91943C81.6828 9.67928 81.9984 9.44943 82.3002 9.22987C82.6021 9.01031 82.8628 8.78389 83.0823 8.55061V7.9331C83.0823 7.53514 82.9965 7.21267 82.825 6.96566C82.6535 6.71866 82.3825 6.59516 82.0121 6.59516C81.3124 6.59516 80.8665 6.87646 80.6744 7.43909L79.1515 6.45107C79.2887 6.24523 79.4361 6.04626 79.5939 5.85414C79.7517 5.66203 79.9438 5.49393 80.1702 5.34984C80.3966 5.20575 80.6607 5.09254 80.9625 5.01021C81.2644 4.92787 81.6211 4.88671 82.0327 4.88671C82.897 4.88671 83.5899 5.15429 84.1113 5.68947C84.6326 6.22465 84.8933 6.97252 84.8933 7.9331V17.628ZM83.1234 10.8972C82.8902 11.0481 82.6158 11.2299 82.3002 11.4426C81.9847 11.6553 81.6828 11.9092 81.3947 12.2042C81.1066 12.4993 80.863 12.832 80.6641 13.2025C80.4652 13.573 80.3657 13.9916 80.3657 14.4581C80.3657 14.9796 80.4823 15.3844 80.7155 15.6726C80.9488 15.9608 81.2849 16.1048 81.724 16.1048C82.2042 16.1048 82.5575 15.9402 82.7839 15.6108C83.0102 15.2815 83.1234 14.8973 83.1234 14.4581V10.8972ZM88.0421 17.628H86.231V1.44922L88.0421 0.852295V17.628Z",fill:"#D1D1D1"}),r.createElement("path",{d:"M48.0547 4.88671C48.5349 4.88671 48.9328 4.91758 49.2484 4.97933C49.5639 5.04108 49.7972 5.11313 49.9481 5.19546H52.1913L51.3064 6.57457V11.5147C51.3064 12.3792 51.08 13.0653 50.6272 13.573C50.1745 14.0808 49.4267 14.3827 48.384 14.4787C47.9038 14.5199 47.5951 14.6297 47.4579 14.8081C47.3207 14.9865 47.2521 15.1717 47.2521 15.3638C47.2521 15.4873 47.2967 15.628 47.3859 15.7858C47.475 15.9436 47.6225 16.0362 47.8283 16.0637H51.7591L50.7507 17.875H47.0669C46.3397 17.875 45.9761 18.122 45.9761 18.6161C45.9761 18.8768 46.0687 19.0655 46.2539 19.1821C46.4392 19.2987 46.669 19.3571 46.9434 19.3571H50.2568L49.2689 21.1479H46.9022C46.0378 21.1479 45.3724 20.9214 44.9059 20.4686C44.4395 20.0157 44.2062 19.4051 44.2062 18.6366C44.2062 18.0191 44.388 17.4977 44.7516 17.0723C45.1152 16.6469 45.6262 16.3518 46.2848 16.1872C46.0653 16.1186 45.9075 16.0019 45.8115 15.8372C45.7154 15.6726 45.6674 15.4873 45.6674 15.2815C45.6674 15.0894 45.7463 14.8938 45.9041 14.6949C46.0619 14.4959 46.3191 14.3552 46.6758 14.2729C45.5782 13.7103 45.0294 12.7909 45.0294 11.5147V7.9331C45.0294 6.98624 45.3004 6.2418 45.8423 5.69976C46.3843 5.15772 47.1217 4.88671 48.0547 4.88671ZM2.96355 2.14907V5.05138H5.35085V6.65691H2.96355V14.8081C2.96355 15.6726 3.27224 16.1048 3.88965 16.1048C4.27382 16.1048 4.54822 15.9676 4.71286 15.6932L5.96825 17.0517C5.73501 17.3261 5.43317 17.5388 5.06272 17.6898C4.69228 17.8407 4.3287 17.9162 3.97197 17.9162C3.02528 17.9162 2.3187 17.6521 1.85222 17.1237C1.38573 16.5954 1.15249 15.8235 1.15249 14.8081V6.65691H0V5.05138H1.15249V2.76658L2.96355 2.14907ZM13.727 5.05138V14.7875C13.727 15.2129 13.847 15.5388 14.0871 15.7652C14.3272 15.9916 14.6325 16.1048 15.0029 16.1048C15.3597 16.1048 15.6615 15.9985 15.9085 15.7858C16.1554 15.5731 16.2789 15.2403 16.2789 14.7875V5.05138H18.09V17.628H16.8963L16.4847 17.0311C16.3612 17.2095 16.1589 17.4016 15.8776 17.6075C15.5963 17.8133 15.1607 17.9162 14.5708 17.9162C13.7476 17.9162 13.0993 17.628 12.6259 17.0517C12.1526 16.4753 11.9159 15.652 11.9159 14.5816V5.05138H13.727ZM22.597 4.88671C23.5437 4.88671 24.2709 5.16801 24.7785 5.73064C25.2862 6.29326 25.54 7.02741 25.54 7.9331V8.79762L23.7701 8.38594V7.9331C23.7701 7.52142 23.6569 7.19552 23.4305 6.95537C23.2041 6.71523 22.9057 6.59516 22.5353 6.59516C22.1511 6.59516 21.8527 6.71866 21.6401 6.96566C21.4274 7.21267 21.3211 7.54887 21.3211 7.97427C21.3211 8.45456 21.472 8.88681 21.7738 9.27104C22.0757 9.65527 22.4392 10.0258 22.8646 10.3826C23.2899 10.7393 23.7255 11.1064 24.1714 11.4838C24.6173 11.8612 24.9843 12.2831 25.2725 12.7497C25.4234 12.9967 25.54 13.2677 25.6223 13.5627C25.7046 13.8578 25.7458 14.1562 25.7458 14.4581C25.7458 14.911 25.6806 15.3432 25.5503 15.7549C25.4199 16.1666 25.221 16.5337 24.9535 16.8561C24.6859 17.1786 24.3498 17.4359 23.945 17.628C23.5403 17.8202 23.0567 17.9162 22.4941 17.9162C22.0276 17.9162 21.6023 17.8407 21.2182 17.6898C20.834 17.5388 20.5013 17.3261 20.22 17.0517C19.9388 16.7772 19.7227 16.4479 19.5717 16.0637C19.4208 15.6794 19.3454 15.254 19.3454 14.7875V13.923L21.1564 14.3141V14.7875C21.1564 15.1854 21.2799 15.5045 21.5269 15.7446C21.7738 15.9848 22.0962 16.1048 22.4941 16.1048C23.4271 16.1048 23.8936 15.6657 23.8936 14.7875C23.8936 14.4581 23.8524 14.1803 23.7701 13.9538C23.6878 13.7274 23.5712 13.5182 23.4202 13.326C23.2007 13.079 22.9675 12.8526 22.7205 12.6468C22.4736 12.4409 22.2232 12.2351 21.9693 12.0293C21.7155 11.8234 21.4651 11.6107 21.2182 11.3912C20.9712 11.1716 20.738 10.9315 20.5184 10.6707C20.2166 10.3139 19.9731 9.916 19.7878 9.47688C19.6026 9.03776 19.51 8.53003 19.51 7.95368C19.51 7.50084 19.5855 7.08574 19.7364 6.70837C19.8873 6.331 20.1 6.00852 20.3744 5.74093C20.6488 5.47334 20.9746 5.26408 21.3519 5.11313C21.7292 4.96218 22.1443 4.88671 22.597 4.88671ZM29.6355 2.14907V5.05138H32.0228V6.65691H29.6355V14.8081C29.6355 15.6726 29.9442 16.1048 30.5616 16.1048C30.9457 16.1048 31.2201 15.9676 31.3848 15.6932L32.6402 17.0517C32.4069 17.3261 32.1051 17.5388 31.7346 17.6898C31.3642 17.8407 31.0006 17.9162 30.6439 17.9162C29.6972 17.9162 28.9906 17.6521 28.5241 17.1237C28.0576 16.5954 27.8244 15.8235 27.8244 14.8081V6.65691H26.6719V5.05138H27.8244V2.76658L29.6355 2.14907ZM10.1049 4.88671C10.5851 4.88671 10.9418 5.00335 11.175 5.23663L10.5576 6.86274C10.4616 6.75296 10.2764 6.69807 10.002 6.69807C9.6864 6.69807 9.40514 6.83187 9.15818 7.09946C8.91121 7.36705 8.78773 7.70668 8.78773 8.11835V17.628H6.97668V5.05138H8.17033L8.58193 5.85414C8.6917 5.63458 8.87348 5.41845 9.12731 5.20575C9.38113 4.99305 9.70698 4.88671 10.1049 4.88671ZM35.3979 5.05138V17.628H33.5868V5.05138H35.3979ZM40.3166 4.88671C41.1809 4.88671 41.8772 5.15772 42.4054 5.69976C42.9337 6.2418 43.1978 6.96566 43.1978 7.87135V17.628H41.3867V7.9331C41.3867 7.49398 41.2427 7.16121 40.9545 6.93479C40.6664 6.70836 40.3371 6.59516 39.9667 6.59516C39.61 6.59516 39.2841 6.70836 38.9891 6.93479C38.6942 7.16121 38.5467 7.49398 38.5467 7.9331V17.628H36.7356V5.05138H37.9293L38.3409 5.6483C38.5467 5.41502 38.8005 5.22977 39.1023 5.09254C39.4042 4.95532 39.8089 4.88671 40.3166 4.88671ZM48.1576 6.55399C47.7872 6.55399 47.4682 6.66034 47.2006 6.87304C46.9331 7.08574 46.7993 7.42536 46.7993 7.89193V11.5558C46.7993 11.995 46.9331 12.3243 47.2006 12.5439C47.4682 12.7634 47.7872 12.8732 48.1576 12.8732C48.5143 12.8732 48.8299 12.7634 49.1043 12.5439C49.3787 12.3243 49.5159 11.995 49.5159 11.5558V7.89193C49.5159 7.42536 49.3787 7.08574 49.1043 6.87304C48.8299 6.66034 48.5143 6.55399 48.1576 6.55399ZM34.5335 0.852295C34.8079 0.852295 35.0309 0.962074 35.2024 1.18163C35.3739 1.4012 35.4596 1.66192 35.4596 1.96382C35.4459 2.27944 35.3567 2.54702 35.1921 2.76658C35.0275 2.98614 34.8079 3.09592 34.5335 3.09592C34.2591 3.09592 34.0327 2.98614 33.8544 2.76658C33.676 2.54702 33.5868 2.27944 33.5868 1.96382C33.5868 1.67564 33.676 1.41835 33.8544 1.19193C34.0327 0.965504 34.2591 0.852295 34.5335 0.852295Z",fill:"#D1D1D1"}))};nB.defaultProps={className:""},nB.propTypes={className:h.string};var aB,oB,iB,sB=m.div(Jk||(Jk=L(["\n display: flex;\n flex-direction: row;\n gap: 8px;\n width: fit-content;\n"]))),cB=m.div(eB||(eB=L(["\n border: 0;\n border-left: 1px solid #e5e5e5;\n width: 1px;\n"]))),uB=m(nB)(rB||(rB=L(["\n margin-block: auto;\n transform: scale(0.75);\n"]))),lB=m.span(tB||(tB=L(["\n color: #d1d1d1;\n width: max-content;\n font-size: 13px;\n"]))),dB=function(e){var t=e.className;return r.createElement(sB,{className:t},r.createElement(uB,null),r.createElement(cB,null),r.createElement(lB,null,"AI-powered vision",r.createElement("br",null),"by Trusting Social"))};dB.defaultProps={className:""},dB.propTypes={className:h.string};var fB,pB,hB=m.div(aB||(aB=L(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n\n background-color: white;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n"]))),mB=m.div(oB||(oB=L(["\n & > img {\n width: 100%;\n }\n\n ","\n"])),Dh),gB=m.p(iB||(iB=L(["\n color: #1d1d1d;\n font-size: 20px;\n"]))),vB=function(){var e=Nn.useAsset("loader.jpg"),t=ww();return r.createElement(hB,null,r.createElement(mB,null,r.createElement("img",{src:e,className:"spin",alt:"loading-icon"})),r.createElement(gB,null,t("processing_result")))},yB=m.div(fB||(fB=L(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n\n background-color: white;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n"]))),bB=m.p(pB||(pB=L(["\n color: #1d1d1d;\n font-size: 24px;\n text-align: center;\n"])));function CB(e){var t=e.error,n=e.onRetry,a=e.onDone,o=Nn.useAsset(t?"yellow-exclamation.jpg":"green-checked.jpg"),i=ww();return r.createElement(yB,null,t?r.createElement(r.Fragment,null,r.createElement("img",{src:o,alt:"result-icon",width:"130"}),r.createElement(bB,null,i("face_authentication.unsuccessful")),r.createElement(pw,{onClick:n},i("retry"))):r.createElement(r.Fragment,null,r.createElement("img",{src:o,alt:"result-icon",width:"130"}),r.createElement(bB,null,i("face_authentication.successful")),r.createElement(pw,{onClick:a},i("continue"))))}CB.defaultProps={error:null,onRetry:function(){},onDone:function(){}},CB.propTypes={error:h.shape({}),onRetry:h.func,onDone:h.func};var wB,kB={instruction:{flashing:{color:"white",backgroundColor:"#E54D2E"}}},BB=function(e){var r=Nn.useAsset(e);i((function(){!function(e){new Promise((function(r,t){var n=new Image;n.onload=r,n.onerror=t,n.src=e}))}(r)}),[r])},EB=["onDone","debug"],SB=m(dB)(wB||(wB=L(["\n position: fixed;\n bottom: 20px;\n left: 50%;\n transform: translateX(-50%);\n z-index: ",";\n\n // Hide trademark\n display: none;\n"])),1010),_B=0,AB=1,IB=2,TB=3;function xB(e){var t=e.onDone,n=e.debug,a=N(e,EB),o=O(c(_B),2),s=o[0],u=o[1],l=O(c(null),2),d=l[0],f=l[1],p=$t.useSDKSettings().lang,h=Sk(),m=function(){var r=S(regeneratorRuntime.mark((function r(){var t=arguments;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,u(IB),"function"!=typeof e.onFlashDone){r.next=5;break}return r.next=5,e.onFlashDone.apply(e,t);case 5:r.next=10;break;case 7:r.prev=7,r.t0=r.catch(0),f({error:r.t0});case 10:return r.prev=10,u(TB),r.finish(10);case 13:case"end":return r.stop()}}),r,null,[[0,7,10,13]])})));return function(){return r.apply(this,arguments)}}();return i((function(){h("selfie","user_activity.start")}),[h]),BB("loader.jpg"),BB("yellow-exclamation.jpg"),BB("green-checked.jpg"),r.createElement(C,{theme:kB},r.createElement(mg,null,r.createElement(gw,{lang:p},r.createElement(Kw,{debug:n},r.createElement("div",null,s===_B&&r.createElement(Aw,{onStart:function(){u(AB)}}),s===AB&&r.createElement($k,I({},a,{onFlashDone:m})),s===IB&&r.createElement(vB,null),s===TB&&r.createElement(CB,{onRetry:function(){u(_B)},error:d,onDone:t}),r.createElement(SB,null))))))}xB.defaultProps={onFlashDone:function(){},onDone:function(){},debug:!1},xB.propTypes={onFlashDone:h.func,onDone:h.func,debug:h.bool};var PB=function(e){var t=e.value,n=e.children,a=Ek("data.settings.sdk_settings.server_log_settings.enable"),o=null!=a?a:null==t?void 0:t.enable;return r.createElement(Pn.SDKTrackingProvider,{value:{tracking:x(x({},t),{},{enable:o})}},n)};PB.propTypes={value:h.shape({enable:h.bool,accessKey:h.string,secretKey:h.string,apiUrl:h.string}).isRequired,children:h.node.isRequired};var RB=function(e){var t=e.apiCredentials,n=e.onFlashDone,a=Fo.useApiClient({apiCredentials:t}).apiClient,i=function(e){var r=e.apiClient,t=O(c(!1),2),n=t[0],a=t[1],i=O(c(""),2),s=i[0],u=i[1];return{apiLoading:n,apiError:s,verifyFaceLiveness:o(function(){var e=S(regeneratorRuntime.mark((function e(t){var n,o,i,s,c,l,d,f,p,h,m,g;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.colors,o=t.motionData,i=t.orientationData,s=t.frames,c=t.images,l=t.flashSettings,d=t.frameInterval,e.prev=1,a(!0),u(""),e.next=6,Promise.all(c.map((function(e){return r.uploadImage({label:"portrait",file:e})})));case 6:return f=e.sent,p=s[Lw],h=s[Ow],m=[p[p.length-1]].concat(M(h)),e.next=12,r.verifyFaceLiveness({images:f.map((function(e){var r;return{id:null==e||null===(r=e.data)||void 0===r?void 0:r.image_id,label:"portrait"}})),videos:[{frames:p.map((function(e){var r=e.base64,t=e.label,n=e.index,a=e.color;return{base64:r,label:t,index:n,metadata:JSON.stringify({color:a})}}))},{frames:m.map((function(e){var r=e.base64,t=e.label,n=e.index,a=e.color;return{base64:r,label:t,index:n,metadata:JSON.stringify({color:a})}}))}],metadata:{face_infos:{motionData:o,ori:i},colors:n,frames_per_color:l.framesPerColor,frame_interval:d,delay_between_colors:l.delayBetweenColors,use_face_detector_when_flashing:l.useFaceDetectorWhenFlashing}});case 12:if(!(g=e.sent).errors){e.next=15;break}throw new Error(JSON.stringify(g.errors[0].message));case 15:return e.abrupt("return",g);case 18:return e.prev=18,e.t0=e.catch(1),console.error(e.t0),u(e.t0),e.abrupt("return",null);case 23:return e.prev=23,a(!1),e.finish(23);case 26:case"end":return e.stop()}}),e,null,[[1,18,23,26]])})));return function(r){return e.apply(this,arguments)}}(),[r])}}({apiClient:a}).verifyFaceLiveness,s=e.flashSettings,u=e.frameInterval,l=function(){var e=S(regeneratorRuntime.mark((function e(r,t){var a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i({frames:r.frames,images:r.images,flashSettings:s,frameInterval:u,colors:t.colors});case 3:return a=e.sent,e.next=6,n(r,a);case 6:e.next=12;break;case 8:throw e.prev=8,e.t0=e.catch(0),console.error(e.t0),e.t0;case 12:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(r,t){return e.apply(this,arguments)}}();return r.createElement(kk,{apiClient:a},r.createElement(PB,{value:x({enable:!0},t)},r.createElement(xB,I({},e,{onFlashDone:l}))))};RB.propTypes=Bb(Uk,{apiCredentials:h.shape({accessKey:h.string.isRequired,secretKey:h.string.isRequired,apiUrl:h.string.isRequired}).isRequired}),RB.defaultProps=Vk;var DB,NB,LB,OB,MB,FB,UB,VB=function(){return{checkCamera:og,LivenessDetection:vg,NativeCamera:sg,ReadIDCardUIOnly:Tb,ReadIDCardWithApiCall:Qb,EkycFlow:lw,warmUpReadIdCard:hv,preloadEKYCResources:Yb,getListCamera:Hc,FlashLiveness:RB}},jB=pp,zB=N(ag,["useLivenessDetection"]);function KB(e){var t=e.className;return r.createElement("svg",{className:t,width:"320",height:"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M320 0H0V320H320V0ZM160 296C235.111 296 296 235.111 296 160C296 84.8893 235.111 24 160 24C84.8893 24 24 84.8893 24 160C24 235.111 84.8893 296 160 296Z",fill:"currentColor"}))}KB.propTypes={className:h.string},KB.defaultProps={className:""};var HB,qB,GB,WB,QB,XB,YB,ZB,$B,JB,eE,rE,tE=(A(DB={},K.FaceDirection.LEFT,90),A(DB,K.FaceDirection.RIGHT,270),A(DB,K.FaceDirection.UP,180),A(DB,K.FaceDirection.DOWN,0),DB),nE=v(["0%{opacity:0.15;}50%{opacity:0.3;}100%{opacity:1;}"]),aE=m.div(NB||(NB=L(["\n width: 200px;\n height: 200px;\n position: relative;\n transform: scale(0.48);\n\n .top,\n .right,\n .bottom,\n .left {\n position: absolute;\n }\n\n .top {\n top: 0;\n left: 50%;\n transform: rotate(","deg) translateX(-50%);\n }\n\n .right {\n right: 0;\n top: 50%;\n transform: rotate(","deg) translateX(-50%);\n }\n\n .bottom {\n bottom: 0;\n left: 50%;\n transform: rotate(","deg) translateX(50%);\n }\n\n .left {\n left: 0;\n top: 50%;\n transform: rotate(","deg) translateX(50%);\n }\n"])),tE[K.FaceDirection.DOWN],tE[K.FaceDirection.LEFT],tE[K.FaceDirection.UP],tE[K.FaceDirection.RIGHT]),oE=m.div(LB||(LB=L(["\n width: 70px;\n transform: rotate(","deg);\n"])),(function(e){var r,t=e.direction;return null!==(r=tE[t])&&void 0!==r?r:0})),iE=m.span(OB||(OB=L(["\n display: flex;\n margin: 4px 0;\n width: 100%;\n height: 15px;\n animation: "," 1s infinite;\n animation-direction: alternate;\n\n &::before,\n &::after {\n content: '';\n height: 100%;\n width: 50%;\n background: rgba(255, 255, 255, 0.8);\n }\n\n &::before {\n transform: skewY(32deg);\n }\n\n &::after {\n width: 50%;\n transform: skewY(-32deg);\n }\n"])),nE),sE=m(iE)(MB||(MB=L(["\n animation-delay: 0s;\n"]))),cE=m(iE)(FB||(FB=L(["\n animation-delay: 0.5s;\n"]))),uE=m(iE)(UB||(UB=L(["\n animation-delay: 1s;\n"])));function lE(e){var t=e.type;return t!==K.FaceDirection.FRONTAL?r.createElement(oE,{direction:t},r.createElement(sE,null),r.createElement(cE,null),r.createElement(uE,null)):r.createElement(aE,null,r.createElement(oE,{className:"top"},r.createElement(sE,null),r.createElement(cE,null),r.createElement(uE,null)),r.createElement(oE,{className:"right"},r.createElement(sE,null),r.createElement(cE,null),r.createElement(uE,null)),r.createElement(oE,{className:"bottom"},r.createElement(sE,null),r.createElement(cE,null),r.createElement(uE,null)),r.createElement(oE,{className:"left"},r.createElement(sE,null),r.createElement(cE,null),r.createElement(uE,null)))}lE.propTypes={type:h.oneOf([K.FaceDirection.LEFT,K.FaceDirection.RIGHT,K.FaceDirection.UP,K.FaceDirection.FRONTAL])},lE.defaultProps={type:K.FaceDirection.LEFT};var dE=650,fE=750,pE=wu,hE=zB.Text,mE=zB.FaceDetectionError,gE=zB.FaceVerificationInstructions,vE=zB.FaceVerificationStepsWrapper,yE=zB.StepItem,bE=zB.BottomButtonsOverlay,CE=zB.Button,wE=zB.CountDownOverlay,kE=zB.InstructionsOverlay,BE=m(vE)(HB||(HB=L(["\n height: 50px;\n"]))),EE=m(hE)(qB||(qB=L(["\n position: absolute;\n font-style: normal;\n font-weight: bold;\n font-size: 1.5rem;\n text-align: center;\n padding: 0 1.75rem;\n color: ",";\n\n ","\n\n ",";\n"])),(function(e){return e.color}),(function(e){var r=e.top;return r&&b(["top:","px;"],r)}),(function(e){return e.isMobile&&b(["font-size:1.125rem;"])})),SE=m(mE)(GB||(GB=L(["\n position: absolute;\n font-size: 1.125rem;\n text-align: center;\n\n ",";\n"])),(function(e){return e.isMobile&&b(["font-size:0.875rem;"])})),_E=m(gE)(WB||(WB=L(["\n position: absolute;\n font-size: 1.125rem;\n text-align: center;\n padding: 0 1.75rem;\n color: ",";\n text-shadow: none;\n\n ",";\n"])),(function(e){return e.color}),(function(e){return e.isMobile&&b(["font-size:0.875rem;"])})),AE=m(KB)(QB||(QB=L(["\n width: 100%;\n height: 100%;\n vertical-align: middle;\n margin: 0;\n color: ",";\n"])),(function(e){var r=e.color;return null!=r?r:"#06243c"})),IE=m.img(XB||(XB=L(["\n && {\n width: 20px;\n border-radius: 50%;\n margin: 0;\n\n ","\n }\n"])),(function(e){return"preview"===e.mode&&b(["width:42px;"])})),TE=m(yE)(YB||(YB=L(["\n width: 50px;\n height: 50px;\n border: 1px solid #005993;\n border-radius: 50%;\n\n & + & {\n margin-left: 10px;\n }\n\n ","\n"])),(function(e){return!e.active&&b(["border-color:#f2f6f9;opacity:0.3;"])})),xE=m(Ip)(ZB||(ZB=L(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"]))),PE=m.div($B||($B=L(["\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n z-index: -1;\n"]))),RE=m(PE)(JB||(JB=L(["\n background: rgba(223, 0, 0, 0.2);\n"]))),DE=v(["from{opacity:1;}to{opacity:0;}"]),NE=m(PE)(eE||(eE=L(["\n background: rgba(255, 255, 255, 0.3);\n animation: "," 1s infinite;\n"])),DE),LE=qs.isMobile?{width:640}:null;function OE(e){var t=e.className,a=e.apiCheck,i=e.enableInstructionsOverlay,s=e.enableErrorOverlay,c=e.enableCapturingOverlay,u=e.frontalMinSize,l=e.mode,d=e.minPadding,f=e.backgroundColor,p=e.textColor,h=e.progressProps,m=e.title,g=e.description,v=e.customInstructions,y=e.customIcon,b=e.customDirectionIcon,C=e.onLivenessDetectionDone,w=e.onClose,k=e.onError,B=e.captureFrameSettings,E=e.onFramesCaptured,S=e.livenessSettings,_=e.initFirstGestureTimeout,A=o((function(e){var r=e.clientWidth,t=e.clientHeight,n=e.videoAreaWidth,a=e.videoAreaHeight,o=e.lostX,i=e.lostY,s=Math.max(80,i),c=Math.max(140,i);t>dE&&(s=Math.max(110,i),c=Math.max(170,i)),t>fE&&(s=Math.max(140,i),c=Math.max(200,i));var u=Math.max(d,o),l=Math.max(d,o),f=Math.min(n,a),p=Math.max(Math.floor(Math.min(r-(u+l),t-(s+c),f)),160);return{x:Math.min(Math.floor(u+(r-l-u)/2-p/2),r-p),y:Math.min(Math.floor(s+(t-c-s)/2-p/2),t-p),width:p,height:p}}),[d]),T=n((function(){return{background:f,opacity:1}}),[f]),x=jB({apiCheck:a,frontalMinSize:u,mode:l,bgCameraMask:null,bgCameraMaskRed:null,surroundStyle:T,cropAreaDimension:A,customInstructions:v,customIcon:y,customDirectionIcon:b,onLivenessDetectionDone:C,captureFrameSettings:B,onFramesCaptured:E,livenessSettings:S,initFirstGestureTimeout:_}),P=x.countdownToTakePicture,R=x.cropArea,D=x.curStepIndex,N=x.directionIcon,L=x.faceDetectionError,O=x.handleTriggerPassiveMode,M=x.handleVideoPlayed,F=x.instructions,U=x.isActiveMode,V=x.refVideo,j=x.showCountdown,z=x.steps,K=x.videoPlayed,H=x.activeCapturing,q=x.warmupDone,G=10,W=45,Q=2,X=50,Y=12,Z=14;window.innerHeight>dE&&(G=25,W=65,Q=3,X=50,Y=24,Z=34),window.innerHeight>fE&&(G=30,W=80,Q=5,X=50,Y=32,Z=54);var $=R.current?R.current.y+R.current.height+Q:0,J=Z+X+Y,ee=s&&L;return r.createElement(hu,{ref:V,className:t,frontCamera:!0,flipHorizontal:!0,videoSettings:LE,onVideoPlayed:M,onClose:w,onError:k},!q&&r.createElement(qp,null),K?r.createElement(r.Fragment,null,r.createElement(EE,{top:G,isMobile:qs.isMobile,color:p},m),R.current?r.createElement(Cu,{x:"".concat(R.current.x,"px"),y:"".concat(R.current.y,"px"),width:"".concat(R.current.width,"px"),height:"".concat(R.current.height,"px"),surroundStyle:R.current.surroundStyle},r.createElement(AE,{color:f}),r.createElement(xE,I({progress:D/z.length*100,hasError:ee},h)),j?r.createElement(wE,null,P):null,U&&i&&N?r.createElement(kE,null,N):null,U&&c&&H?r.createElement(NE,null):null,ee?r.createElement(RE,null):null):null,L?r.createElement(SE,{top:$,isMobile:qs.isMobile,error:L}):null,U?r.createElement(r.Fragment,null,r.createElement(_E,{top:W,isMobile:qs.isMobile,color:p},g),F?r.createElement(_E,{bottom:J,isMobile:qs.isMobile,color:p},F):null,r.createElement(BE,{bottom:Z},z.map((function(e,t){var n=e.name,a=e.icon,o=e.image.objUrl,i=D>=t;return r.createElement(TE,{key:n,active:i},o?r.createElement(IE,{src:o,alt:"",mode:"preview"}):function(e,t){return"string"==typeof e?r.createElement(IE,{src:e,alt:""}):r.cloneElement(e,t)}(a,{active:i}))})))):r.createElement(r.Fragment,null,L?null:r.createElement(bE,null,r.createElement(CE,{onClick:O},r.createElement(pE,null))))):null)}OE.propTypes={className:h.string,apiCheck:h.bool,enableInstructionsOverlay:h.bool,enableErrorOverlay:h.bool,enableCapturingOverlay:h.bool,frontalMinSize:h.number,mode:h.string,minPadding:h.number,backgroundColor:h.string,textColor:h.string,progressProps:h.shape({className:h.string,style:h.shape({}),radius:h.number,strokeWidth:h.number,progress:h.number,activeColor:h.string,innerPadding:h.number,outsideRingColor:h.string,insideRingColor:h.string,insideRingWidth:h.number,dashedRingColor:h.string,dashedRingWidth:h.number,dashedRingLineThick:h.number,dashedRingLineSpacing:h.number,showOutsideRing:h.bool,showDashedRing:h.bool,showInsideRing:h.bool}),title:h.string,description:h.string,customInstructions:h.shape({}),customIcon:h.shape({}),customDirectionIcon:h.shape({}),onLivenessDetectionDone:h.func,onClose:h.func,onError:h.func,captureFrameSettings:h.shape({}),onFramesCaptured:h.func,livenessSettings:h.shape({}),initFirstGestureTimeout:h.number},OE.defaultProps={className:"",apiCheck:!1,enableInstructionsOverlay:!1,enableErrorOverlay:!1,enableCapturingOverlay:!1,frontalMinSize:720,mode:null,minPadding:30,backgroundColor:"#06243c",textColor:"#ffffff",progressProps:null,title:"Chụp ảnh chân dung",description:"Xin đưa khuôn mặt vào khung hình. Hình ảnh sẽ tự động được ghi lại.",customInstructions:null,customIcon:null,customDirectionIcon:(rE={},A(rE,K.FaceDirection.LEFT,r.createElement(lE,{type:K.FaceDirection.LEFT})),A(rE,K.FaceDirection.RIGHT,r.createElement(lE,{type:K.FaceDirection.RIGHT})),A(rE,K.FaceDirection.UP,r.createElement(lE,{type:K.FaceDirection.UP})),A(rE,K.FaceDirection.FRONTAL,r.createElement(lE,{type:K.FaceDirection.FRONTAL})),rE),onLivenessDetectionDone:null,onClose:null,onError:function(){},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},onFramesCaptured:function(){},livenessSettings:null,initFirstGestureTimeout:2e3};export{Fo as APIUtils,Lh as Animations,fi as AntiDebugUtils,Nn as AssetUtils,On as AsyncUtils,ru as BASE_Z_INDEX,Us as BaseTVWebSDK,ia as BlurUtils,Lv as Button,Ov as ButtonLink,hu as Camera,ca as CameraUtils,ou as CloseButton,Ns as CloseEyesDetector,la as CommonUtils,K as Constants,ga as CoordinateUtils,Cu as CropAreaOverlayWrapper,mi as CryptoUtils,Ds as DEFAULT_CLOSE_EYE_MODEL,Rs as ExifUtils,Ea as FaceUtils,To as GlareUtils,Bn as HashUtils,Dy as HighlightResult,_y as HighlightResultType,ug as Icons,So as ImageUtils,OE as LivenessDetection,zB as LivenessDetectionComponents,Wo as LoadResourceUtils,bn as LocalStorageUtils,Ws as MobileDetect,di as ModelUtils,sg as NativeCamera,mg as OrientationDetection,bu as PlacementArea,zp as Popup,_a as PredictionUtils,Ip as ProgressCircle,Cy as QRCodeScanner,Zv as RatioWrapper,Tb as ReadIDCardUIOnly,Qb as ReadIDCardWithApiCall,Mh as RectangleMask,Oh as RectangleMaskType,js as SDKAdapter,gi as SDKTimer,Yy as ScannerType,$t as SettingsContext,Pv as Spacing,pi as ThemeUtils,gn as TimeUtils,Pn as TrackingContext,Gy as UIOnlyDefaultProps,qy as UIOnlyPropTypes,pn as UserAgentUtils,qp as WarmupPopup,og as checkCamera,Eb as defaultClientSettings,Zy as defaultReadIDCardSteps,VB as getBaseSDKComponent,Wt as getCustomUrlsBySettings,Ms as getQrScannerWorkerPath,dn as getSDKVersion,Kb as handleApiCheckReadIdCard,Yb as preloadEKYCResources,Zb as readIdCardFromImage,iy as readQRFromFrontImage,Ls as requestMotionPermission,Os as useDeviceMotion,jB as useLivenessDetection,by as useMainProcessQRCodeScanner,wv as useMainProcessReadIdCard,Sb as useSettingsReadIdCard,Ag as useShowPopup,cv as warmUpQRCodeScanner,hv as warmUpReadIdCard,Xf as warmupSelfieActive};
|