@tsocial/tvweb-sdk.tiki 5.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/assets/arrow_down.svg +17 -0
- package/assets/arrow_left.svg +17 -0
- package/assets/arrow_right.svg +17 -0
- package/assets/arrow_up.svg +17 -0
- package/assets/bg_camera_mask.png +0 -0
- package/assets/bg_camera_mask_red.png +0 -0
- package/assets/frontal.svg +17 -0
- package/assets/ic_camera.png +0 -0
- package/assets/ic_camera_disabled.png +0 -0
- package/assets/ic_close.png +0 -0
- package/assets/ic_close_black.png +0 -0
- package/assets/ic_close_desktop.png +0 -0
- package/assets/ic_face_frontal.svg +8 -0
- package/assets/ic_face_left.svg +4 -0
- package/assets/ic_face_right.svg +4 -0
- package/assets/ic_face_up.svg +4 -0
- package/assets/ic_id.png +0 -0
- package/assets/ic_loading.png +0 -0
- package/assets/id_card_back.svg +1 -0
- package/assets/id_card_blur_bottom.png +0 -0
- package/assets/id_card_front.svg +1 -0
- package/assets/qr_capture_cursor.png +0 -0
- package/build/tvweb-sdk.cjs.min.js +75 -0
- package/build/tvweb-sdk.tiki.standalone.min.js +75 -0
- package/examples/extract-id-info-and-liveness-detection/index.html +428 -0
- package/examples/extract-id-info-and-liveness-detection/style.css +58 -0
- package/examples/index.html +20 -0
- package/package.json +38 -0
@@ -0,0 +1,75 @@
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("crypto")):"function"==typeof define&&define.amd?define(["exports","crypto"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).TVWebSDK={},e.crypto)}(this,(function(t,r){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=n(r),a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function s(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return c(null==t&&r.path)}},r.exports),r.exports}function c(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var u=function(e){return e&&e.Math==Math&&e},l=u("object"==typeof globalThis&&globalThis)||u("object"==typeof window&&window)||u("object"==typeof self&&self)||u("object"==typeof a&&a)||function(){return this}()||Function("return this")(),d=function(e){try{return!!e()}catch(e){return!0}},f=!d((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),p={}.propertyIsEnumerable,h=Object.getOwnPropertyDescriptor,g=h&&!p.call({1:2},1),m=g?function(e){var t=h(this,e);return!!t&&t.enumerable}:p,y={f:m},v=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},b={}.toString,C=function(e){return b.call(e).slice(8,-1)},E="".split,w=d((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==C(e)?E.call(e,""):Object(e)}:Object,k=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},S=function(e){return w(k(e))},B=function(e){return"object"==typeof e?null!==e:"function"==typeof e},T=function(e,t){if(!B(e))return e;var r,n;if(t&&"function"==typeof(r=e.toString)&&!B(n=r.call(e)))return n;if("function"==typeof(r=e.valueOf)&&!B(n=r.call(e)))return n;if(!t&&"function"==typeof(r=e.toString)&&!B(n=r.call(e)))return n;throw TypeError("Can't convert object to primitive value")},A={}.hasOwnProperty,I=function(e,t){return A.call(e,t)},_=l.document,x=B(_)&&B(_.createElement),P=function(e){return x?_.createElement(e):{}},R=!f&&!d((function(){return 7!=Object.defineProperty(P("div"),"a",{get:function(){return 7}}).a})),N=Object.getOwnPropertyDescriptor,O=f?N:function(e,t){if(e=S(e),t=T(t,!0),R)try{return N(e,t)}catch(e){}if(I(e,t))return v(!y.f.call(e,t),e[t])},L={f:O},D=function(e){if(!B(e))throw TypeError(String(e)+" is not an object");return e},U=Object.defineProperty,M=f?U:function(e,t,r){if(D(e),t=T(t,!0),D(r),R)try{return U(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(e[t]=r.value),e},V={f:M},j=f?function(e,t,r){return V.f(e,t,v(1,r))}:function(e,t,r){return e[t]=r,e},F=function(e,t){try{j(l,e,t)}catch(r){l[e]=t}return t},z="__core-js_shared__",K=l[z]||F(z,{}),q=K,H=Function.toString;"function"!=typeof q.inspectSource&&(q.inspectSource=function(e){return H.call(e)});var Q,G,W,X=q.inspectSource,Y=l.WeakMap,$="function"==typeof Y&&/native code/.test(X(Y)),Z=!1,J=s((function(e){(e.exports=function(e,t){return q[e]||(q[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.8.1",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),ee=0,te=Math.random(),re=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++ee+te).toString(36)},ne=J("keys"),ie=function(e){return ne[e]||(ne[e]=re(e))},ae={},oe=l.WeakMap,se=function(e){return W(e)?G(e):Q(e,{})},ce=function(e){return function(t){var r;if(!B(t)||(r=G(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return r}};if($){var ue=q.state||(q.state=new oe),le=ue.get,de=ue.has,fe=ue.set;Q=function(e,t){return t.facade=e,fe.call(ue,e,t),t},G=function(e){return le.call(ue,e)||{}},W=function(e){return de.call(ue,e)}}else{var pe=ie("state");ae[pe]=!0,Q=function(e,t){return t.facade=e,j(e,pe,t),t},G=function(e){return I(e,pe)?e[pe]:{}},W=function(e){return I(e,pe)}}var he,ge={set:Q,get:G,has:W,enforce:se,getterFor:ce},me=s((function(e){var t=ge.get,r=ge.enforce,n=String(String).split("String");(e.exports=function(e,t,i,a){var o,s=!!a&&!!a.unsafe,c=!!a&&!!a.enumerable,u=!!a&&!!a.noTargetGet;"function"==typeof i&&("string"!=typeof t||I(i,"name")||j(i,"name",t),(o=r(i)).source||(o.source=n.join("string"==typeof t?t:""))),e!==l?(s?!u&&e[t]&&(c=!0):delete e[t],c?e[t]=i:j(e,t,i)):c?e[t]=i:F(t,i)})(Function.prototype,"toString",(function(){return"function"==typeof this&&t(this).source||X(this)}))})),ye=l,ve=function(e){return"function"==typeof e?e:void 0},be=function(e,t){return arguments.length<2?ve(ye[e])||ve(l[e]):ye[e]&&ye[e][t]||l[e]&&l[e][t]},Ce=Math.ceil,Ee=Math.floor,we=function(e){return isNaN(e=+e)?0:(e>0?Ee:Ce)(e)},ke=Math.min,Se=function(e){return e>0?ke(we(e),9007199254740991):0},Be=Math.max,Te=Math.min,Ae=function(e,t){var r=we(e);return r<0?Be(r+t,0):Te(r,t)},Ie=function(e){return function(t,r,n){var i,a=S(t),o=Se(a.length),s=Ae(n,o);if(e&&r!=r){for(;o>s;)if((i=a[s++])!=i)return!0}else for(;o>s;s++)if((e||s in a)&&a[s]===r)return e||s||0;return!e&&-1}},_e={includes:Ie(!0),indexOf:Ie(!1)},xe=_e.indexOf,Pe=function(e,t){var r,n=S(e),i=0,a=[];for(r in n)!I(ae,r)&&I(n,r)&&a.push(r);for(;t.length>i;)I(n,r=t[i++])&&(~xe(a,r)||a.push(r));return a},Re=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ne=Re.concat("length","prototype"),Oe=Object.getOwnPropertyNames||function(e){return Pe(e,Ne)},Le={f:Oe},De=Object.getOwnPropertySymbols,Ue={f:De},Me=be("Reflect","ownKeys")||function(e){var t=Le.f(D(e)),r=Ue.f;return r?t.concat(r(e)):t},Ve=function(e,t){for(var r=Me(t),n=V.f,i=L.f,a=0;a<r.length;a++){var o=r[a];I(e,o)||n(e,o,i(t,o))}},je=/#|\.prototype\./,Fe=function(e,t){var r=Ke[ze(e)];return r==He||r!=qe&&("function"==typeof t?d(t):!!t)},ze=Fe.normalize=function(e){return String(e).replace(je,".").toLowerCase()},Ke=Fe.data={},qe=Fe.NATIVE="N",He=Fe.POLYFILL="P",Qe=Fe,Ge=L.f,We=function(e,t){var r,n,i,a,o,s=e.target,c=e.global,u=e.stat;if(r=c?l:u?l[s]||F(s,{}):(l[s]||{}).prototype)for(n in t){if(a=t[n],i=e.noTargetGet?(o=Ge(r,n))&&o.value:r[n],!Qe(c?n:s+(u?".":"#")+n,e.forced)&&void 0!==i){if(typeof a==typeof i)continue;Ve(a,i)}(e.sham||i&&i.sham)&&j(a,"sham",!0),me(r,n,a,e)}},Xe=!!Object.getOwnPropertySymbols&&!d((function(){return!String(Symbol())})),Ye=Xe&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,$e=Array.isArray||function(e){return"Array"==C(e)},Ze=function(e){return Object(k(e))},Je=Object.keys||function(e){return Pe(e,Re)},et=f?Object.defineProperties:function(e,t){D(e);for(var r,n=Je(t),i=n.length,a=0;i>a;)V.f(e,r=n[a++],t[r]);return e},tt=be("document","documentElement"),rt=">",nt="<",it="prototype",at="script",ot=ie("IE_PROTO"),st=function(){},ct=function(e){return nt+at+rt+e+nt+"/"+at+rt},ut=function(e){e.write(ct("")),e.close();var t=e.parentWindow.Object;return e=null,t},lt=function(){var e,t=P("iframe"),r="java"+at+":";return t.style.display="none",tt.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(ct("document.F=Object")),e.close(),e.F},dt=function(){try{he=document.domain&&new ActiveXObject("htmlfile")}catch(e){}dt=he?ut(he):lt();for(var e=Re.length;e--;)delete dt[it][Re[e]];return dt()};ae[ot]=!0;var ft=Object.create||function(e,t){var r;return null!==e?(st[it]=D(e),r=new st,st[it]=null,r[ot]=e):r=dt(),void 0===t?r:et(r,t)},pt=Le.f,ht={}.toString,gt="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],mt=function(e){try{return pt(e)}catch(e){return gt.slice()}},yt=function(e){return gt&&"[object Window]"==ht.call(e)?mt(e):pt(S(e))},vt={f:yt},bt=J("wks"),Ct=l.Symbol,Et=Ye?Ct:Ct&&Ct.withoutSetter||re,wt=function(e){return I(bt,e)||(Xe&&I(Ct,e)?bt[e]=Ct[e]:bt[e]=Et("Symbol."+e)),bt[e]},kt=wt,St={f:kt},Bt=V.f,Tt=function(e){var t=ye.Symbol||(ye.Symbol={});I(t,e)||Bt(t,e,{value:St.f(e)})},At=V.f,It=wt("toStringTag"),_t=function(e,t,r){e&&!I(e=r?e:e.prototype,It)&&At(e,It,{configurable:!0,value:t})},xt=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},Pt=function(e,t,r){if(xt(e),void 0===t)return e;switch(r){case 0:return function(){return e.call(t)};case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}},Rt=wt("species"),Nt=function(e,t){var r;return $e(e)&&("function"!=typeof(r=e.constructor)||r!==Array&&!$e(r.prototype)?B(r)&&null===(r=r[Rt])&&(r=void 0):r=void 0),new(void 0===r?Array:r)(0===t?0:t)},Ot=[].push,Lt=function(e){var t=1==e,r=2==e,n=3==e,i=4==e,a=6==e,o=7==e,s=5==e||a;return function(c,u,l,d){for(var f,p,h=Ze(c),g=w(h),m=Pt(u,l,3),y=Se(g.length),v=0,b=d||Nt,C=t?b(c,y):r||o?b(c,0):void 0;y>v;v++)if((s||v in g)&&(p=m(f=g[v],v,h),e))if(t)C[v]=p;else if(p)switch(e){case 3:return!0;case 5:return f;case 6:return v;case 2:Ot.call(C,f)}else switch(e){case 4:return!1;case 7:Ot.call(C,f)}return a?-1:n||i?i:C}},Dt={forEach:Lt(0),map:Lt(1),filter:Lt(2),some:Lt(3),every:Lt(4),find:Lt(5),findIndex:Lt(6),filterOut:Lt(7)},Ut=Dt.forEach,Mt=ie("hidden"),Vt="Symbol",jt="prototype",Ft=wt("toPrimitive"),zt=ge.set,Kt=ge.getterFor(Vt),qt=Object[jt],Ht=l.Symbol,Qt=be("JSON","stringify"),Gt=L.f,Wt=V.f,Xt=vt.f,Yt=y.f,$t=J("symbols"),Zt=J("op-symbols"),Jt=J("string-to-symbol-registry"),er=J("symbol-to-string-registry"),tr=J("wks"),rr=l.QObject,nr=!rr||!rr[jt]||!rr[jt].findChild,ir=f&&d((function(){return 7!=ft(Wt({},"a",{get:function(){return Wt(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=Gt(qt,t);n&&delete qt[t],Wt(e,t,r),n&&e!==qt&&Wt(qt,t,n)}:Wt,ar=function(e,t){var r=$t[e]=ft(Ht[jt]);return zt(r,{type:Vt,tag:e,description:t}),f||(r.description=t),r},or=Ye?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof Ht},sr=function(e,t,r){e===qt&&sr(Zt,t,r),D(e);var n=T(t,!0);return D(r),I($t,n)?(r.enumerable?(I(e,Mt)&&e[Mt][n]&&(e[Mt][n]=!1),r=ft(r,{enumerable:v(0,!1)})):(I(e,Mt)||Wt(e,Mt,v(1,{})),e[Mt][n]=!0),ir(e,n,r)):Wt(e,n,r)},cr=function(e,t){D(e);var r=S(t),n=Je(r).concat(pr(r));return Ut(n,(function(t){f&&!lr.call(r,t)||sr(e,t,r[t])})),e},ur=function(e,t){return void 0===t?ft(e):cr(ft(e),t)},lr=function(e){var t=T(e,!0),r=Yt.call(this,t);return!(this===qt&&I($t,t)&&!I(Zt,t))&&(!(r||!I(this,t)||!I($t,t)||I(this,Mt)&&this[Mt][t])||r)},dr=function(e,t){var r=S(e),n=T(t,!0);if(r!==qt||!I($t,n)||I(Zt,n)){var i=Gt(r,n);return!i||!I($t,n)||I(r,Mt)&&r[Mt][n]||(i.enumerable=!0),i}},fr=function(e){var t=Xt(S(e)),r=[];return Ut(t,(function(e){I($t,e)||I(ae,e)||r.push(e)})),r},pr=function(e){var t=e===qt,r=Xt(t?Zt:S(e)),n=[];return Ut(r,(function(e){!I($t,e)||t&&!I(qt,e)||n.push($t[e])})),n};if(Xe||(me((Ht=function(){if(this instanceof Ht)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=re(e),r=function(e){this===qt&&r.call(Zt,e),I(this,Mt)&&I(this[Mt],t)&&(this[Mt][t]=!1),ir(this,t,v(1,e))};return f&&nr&&ir(qt,t,{configurable:!0,set:r}),ar(t,e)})[jt],"toString",(function(){return Kt(this).tag})),me(Ht,"withoutSetter",(function(e){return ar(re(e),e)})),y.f=lr,V.f=sr,L.f=dr,Le.f=vt.f=fr,Ue.f=pr,St.f=function(e){return ar(wt(e),e)},f&&(Wt(Ht[jt],"description",{configurable:!0,get:function(){return Kt(this).description}}),me(qt,"propertyIsEnumerable",lr,{unsafe:!0}))),We({global:!0,wrap:!0,forced:!Xe,sham:!Xe},{Symbol:Ht}),Ut(Je(tr),(function(e){Tt(e)})),We({target:Vt,stat:!0,forced:!Xe},{for:function(e){var t=String(e);if(I(Jt,t))return Jt[t];var r=Ht(t);return Jt[t]=r,er[r]=t,r},keyFor:function(e){if(!or(e))throw TypeError(e+" is not a symbol");if(I(er,e))return er[e]},useSetter:function(){nr=!0},useSimple:function(){nr=!1}}),We({target:"Object",stat:!0,forced:!Xe,sham:!f},{create:ur,defineProperty:sr,defineProperties:cr,getOwnPropertyDescriptor:dr}),We({target:"Object",stat:!0,forced:!Xe},{getOwnPropertyNames:fr,getOwnPropertySymbols:pr}),We({target:"Object",stat:!0,forced:d((function(){Ue.f(1)}))},{getOwnPropertySymbols:function(e){return Ue.f(Ze(e))}}),Qt){var hr=!Xe||d((function(){var e=Ht();return"[null]"!=Qt([e])||"{}"!=Qt({a:e})||"{}"!=Qt(Object(e))}));We({target:"JSON",stat:!0,forced:hr},{stringify:function(e,t,r){for(var n,i=[e],a=1;arguments.length>a;)i.push(arguments[a++]);if(n=t,(B(t)||void 0!==e)&&!or(e))return $e(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!or(t))return t}),i[1]=t,Qt.apply(null,i)}})}Ht[jt][Ft]||j(Ht[jt],Ft,Ht[jt].valueOf),_t(Ht,Vt),ae[Mt]=!0,Tt("asyncIterator");var gr=V.f,mr=l.Symbol;if(f&&"function"==typeof mr&&(!("description"in mr.prototype)||void 0!==mr().description)){var yr={},vr=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof vr?new mr(e):void 0===e?mr():mr(e);return""===e&&(yr[t]=!0),t};Ve(vr,mr);var br=vr.prototype=mr.prototype;br.constructor=vr;var Cr=br.toString,Er="Symbol(test)"==String(mr("test")),wr=/^Symbol\((.*)\)[^)]+$/;gr(br,"description",{configurable:!0,get:function(){var e=B(this)?this.valueOf():this,t=Cr.call(e);if(I(yr,e))return"";var r=Er?t.slice(7,-1):t.replace(wr,"$1");return""===r?void 0:r}}),We({global:!0,forced:!0},{Symbol:vr})}Tt("hasInstance"),Tt("isConcatSpreadable"),Tt("iterator"),Tt("match"),Tt("matchAll"),Tt("replace"),Tt("search"),Tt("species"),Tt("split"),Tt("toPrimitive"),Tt("toStringTag"),Tt("unscopables");var kr=!d((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Sr=ie("IE_PROTO"),Br=Object.prototype,Tr=kr?Object.getPrototypeOf:function(e){return e=Ze(e),I(e,Sr)?e[Sr]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?Br:null},Ar=function(e){if(!B(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e},Ir=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return D(r),Ar(n),t?e.call(r,n):r.__proto__=n,r}}():void 0),_r={},xr=wt("iterator"),Pr=Array.prototype,Rr=function(e){return void 0!==e&&(_r.Array===e||Pr[xr]===e)},Nr=wt("toStringTag"),Or={};Or[Nr]="z";var Lr="[object z]"===String(Or),Dr=wt("toStringTag"),Ur="Arguments"==C(function(){return arguments}()),Mr=function(e,t){try{return e[t]}catch(e){}},Vr=Lr?C:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=Mr(t=Object(e),Dr))?r:Ur?C(t):"Object"==(n=C(t))&&"function"==typeof t.callee?"Arguments":n},jr=wt("iterator"),Fr=function(e){if(null!=e)return e[jr]||e["@@iterator"]||_r[Vr(e)]},zr=function(e){var t=e.return;if(void 0!==t)return D(t.call(e)).value},Kr=function(e,t){this.stopped=e,this.result=t},qr=function(e,t,r){var n,i,a,o,s,c,u,l=r&&r.that,d=!(!r||!r.AS_ENTRIES),f=!(!r||!r.IS_ITERATOR),p=!(!r||!r.INTERRUPTED),h=Pt(t,l,1+d+p),g=function(e){return n&&zr(n),new Kr(!0,e)},m=function(e){return d?(D(e),p?h(e[0],e[1],g):h(e[0],e[1])):p?h(e,g):h(e)};if(f)n=e;else{if("function"!=typeof(i=Fr(e)))throw TypeError("Target is not iterable");if(Rr(i)){for(a=0,o=Se(e.length);o>a;a++)if((s=m(e[a]))&&s instanceof Kr)return s;return new Kr(!1)}n=i.call(e)}for(c=n.next;!(u=c.call(n)).done;){try{s=m(u.value)}catch(e){throw zr(n),e}if("object"==typeof s&&s&&s instanceof Kr)return s}return new Kr(!1)},Hr=function(e,t){var r=this;if(!(r instanceof Hr))return new Hr(e,t);Ir&&(r=Ir(new Error(void 0),Tr(r))),void 0!==t&&j(r,"message",String(t));var n=[];return qr(e,n.push,{that:n}),j(r,"errors",n),r};Hr.prototype=ft(Error.prototype,{constructor:v(5,Hr),message:v(5,""),name:v(5,"AggregateError")}),We({global:!0},{AggregateError:Hr});var Qr=function(e,t,r,n){try{return n?t(D(r)[0],r[1]):t(r)}catch(t){throw zr(e),t}},Gr=function(e,t,r){var n=T(t);n in e?V.f(e,n,v(0,r)):e[n]=r},Wr=function(e){var t,r,n,i,a,o,s=Ze(e),c="function"==typeof this?this:Array,u=arguments.length,l=u>1?arguments[1]:void 0,d=void 0!==l,f=Fr(s),p=0;if(d&&(l=Pt(l,u>2?arguments[2]:void 0,2)),null==f||c==Array&&Rr(f))for(r=new c(t=Se(s.length));t>p;p++)o=d?l(s[p],p):s[p],Gr(r,p,o);else for(a=(i=f.call(s)).next,r=new c;!(n=a.call(i)).done;p++)o=d?Qr(i,l,[n.value,p],!0):n.value,Gr(r,p,o);return r.length=p,r},Xr=wt("iterator"),Yr=!1;try{var $r=0,Zr={next:function(){return{done:!!$r++}},return:function(){Yr=!0}};Zr[Xr]=function(){return this},Array.from(Zr,(function(){throw 2}))}catch(e){}var Jr=function(e,t){if(!t&&!Yr)return!1;var r=!1;try{var n={};n[Xr]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r},en=!Jr((function(e){Array.from(e)}));We({target:"Array",stat:!0,forced:en},{from:Wr}),We({target:"Array",stat:!0},{isArray:$e});var tn=d((function(){function e(){}return!(Array.of.call(e)instanceof e)}));We({target:"Array",stat:!0,forced:tn},{of:function(){for(var e=0,t=arguments.length,r=new("function"==typeof this?this:Array)(t);t>e;)Gr(r,e,arguments[e++]);return r.length=t,r}});var rn,nn,an=be("navigator","userAgent")||"",on=l.process,sn=on&&on.versions,cn=sn&&sn.v8;cn?nn=(rn=cn.split("."))[0]+rn[1]:an&&(!(rn=an.match(/Edge\/(\d+)/))||rn[1]>=74)&&(rn=an.match(/Chrome\/(\d+)/))&&(nn=rn[1]);var un=nn&&+nn,ln=wt("species"),dn=function(e){return un>=51||!d((function(){var t=[];return(t.constructor={})[ln]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},fn=wt("isConcatSpreadable"),pn=9007199254740991,hn="Maximum allowed index exceeded",gn=un>=51||!d((function(){var e=[];return e[fn]=!1,e.concat()[0]!==e})),mn=dn("concat"),yn=function(e){if(!B(e))return!1;var t=e[fn];return void 0!==t?!!t:$e(e)},vn=!gn||!mn;We({target:"Array",proto:!0,forced:vn},{concat:function(e){var t,r,n,i,a,o=Ze(this),s=Nt(o,0),c=0;for(t=-1,n=arguments.length;t<n;t++)if(yn(a=-1===t?o:arguments[t])){if(c+(i=Se(a.length))>pn)throw TypeError(hn);for(r=0;r<i;r++,c++)r in a&&Gr(s,c,a[r])}else{if(c>=pn)throw TypeError(hn);Gr(s,c++,a)}return s.length=c,s}});var bn=Math.min,Cn=[].copyWithin||function(e,t){var r=Ze(this),n=Se(r.length),i=Ae(e,n),a=Ae(t,n),o=arguments.length>2?arguments[2]:void 0,s=bn((void 0===o?n:Ae(o,n))-a,n-i),c=1;for(a<i&&i<a+s&&(c=-1,a+=s-1,i+=s-1);s-- >0;)a in r?r[i]=r[a]:delete r[i],i+=c,a+=c;return r},En=wt("unscopables"),wn=Array.prototype;null==wn[En]&&V.f(wn,En,{configurable:!0,value:ft(null)});var kn=function(e){wn[En][e]=!0};We({target:"Array",proto:!0},{copyWithin:Cn}),kn("copyWithin");var Sn=function(e,t){var r=[][e];return!!r&&d((function(){r.call(null,t||function(){throw 1},1)}))},Bn=Object.defineProperty,Tn={},An=function(e){throw e},In=function(e,t){if(I(Tn,e))return Tn[e];t||(t={});var r=[][e],n=!!I(t,"ACCESSORS")&&t.ACCESSORS,i=I(t,0)?t[0]:An,a=I(t,1)?t[1]:void 0;return Tn[e]=!!r&&!d((function(){if(n&&!f)return!0;var e={length:-1};n?Bn(e,1,{enumerable:!0,get:An}):e[1]=1,r.call(e,i,a)}))},_n=Dt.every,xn=Sn("every"),Pn=In("every");We({target:"Array",proto:!0,forced:!xn||!Pn},{every:function(e){return _n(this,e,arguments.length>1?arguments[1]:void 0)}});var Rn=function(e){for(var t=Ze(this),r=Se(t.length),n=arguments.length,i=Ae(n>1?arguments[1]:void 0,r),a=n>2?arguments[2]:void 0,o=void 0===a?r:Ae(a,r);o>i;)t[i++]=e;return t};We({target:"Array",proto:!0},{fill:Rn}),kn("fill");var Nn=Dt.filter,On=dn("filter"),Ln=In("filter");We({target:"Array",proto:!0,forced:!On||!Ln},{filter:function(e){return Nn(this,e,arguments.length>1?arguments[1]:void 0)}});var Dn=Dt.find,Un="find",Mn=!0,Vn=In(Un);Un in[]&&Array(1)[Un]((function(){Mn=!1})),We({target:"Array",proto:!0,forced:Mn||!Vn},{find:function(e){return Dn(this,e,arguments.length>1?arguments[1]:void 0)}}),kn(Un);var jn=Dt.findIndex,Fn="findIndex",zn=!0,Kn=In(Fn);Fn in[]&&Array(1)[Fn]((function(){zn=!1})),We({target:"Array",proto:!0,forced:zn||!Kn},{findIndex:function(e){return jn(this,e,arguments.length>1?arguments[1]:void 0)}}),kn(Fn);var qn=function(e,t,r,n,i,a,o,s){for(var c,u=i,l=0,d=!!o&&Pt(o,s,3);l<n;){if(l in r){if(c=d?d(r[l],l,t):r[l],a>0&&$e(c))u=qn(e,t,c,Se(c.length),u,a-1)-1;else{if(u>=9007199254740991)throw TypeError("Exceed the acceptable array length");e[u]=c}u++}l++}return u},Hn=qn;We({target:"Array",proto:!0},{flat:function(){var e=arguments.length?arguments[0]:void 0,t=Ze(this),r=Se(t.length),n=Nt(t,0);return n.length=Hn(n,t,t,r,0,void 0===e?1:we(e)),n}}),We({target:"Array",proto:!0},{flatMap:function(e){var t,r=Ze(this),n=Se(r.length);return xt(e),(t=Nt(r,0)).length=Hn(t,r,r,n,0,1,e,arguments.length>1?arguments[1]:void 0),t}});var Qn=Dt.forEach,Gn=Sn("forEach"),Wn=In("forEach"),Xn=Gn&&Wn?[].forEach:function(e){return Qn(this,e,arguments.length>1?arguments[1]:void 0)};We({target:"Array",proto:!0,forced:[].forEach!=Xn},{forEach:Xn});var Yn=_e.includes,$n=In("indexOf",{ACCESSORS:!0,1:0});We({target:"Array",proto:!0,forced:!$n},{includes:function(e){return Yn(this,e,arguments.length>1?arguments[1]:void 0)}}),kn("includes");var Zn=_e.indexOf,Jn=[].indexOf,ei=!!Jn&&1/[1].indexOf(1,-0)<0,ti=Sn("indexOf"),ri=In("indexOf",{ACCESSORS:!0,1:0});We({target:"Array",proto:!0,forced:ei||!ti||!ri},{indexOf:function(e){return ei?Jn.apply(this,arguments)||0:Zn(this,e,arguments.length>1?arguments[1]:void 0)}});var ni=[].join,ii=w!=Object,ai=Sn("join",",");We({target:"Array",proto:!0,forced:ii||!ai},{join:function(e){return ni.call(S(this),void 0===e?",":e)}});var oi=Math.min,si=[].lastIndexOf,ci=!!si&&1/[1].lastIndexOf(1,-0)<0,ui=Sn("lastIndexOf"),li=In("indexOf",{ACCESSORS:!0,1:0}),di=ci||!ui||!li,fi=di?function(e){if(ci)return si.apply(this,arguments)||0;var t=S(this),r=Se(t.length),n=r-1;for(arguments.length>1&&(n=oi(n,we(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in t&&t[n]===e)return n||0;return-1}:si;We({target:"Array",proto:!0,forced:fi!==[].lastIndexOf},{lastIndexOf:fi});var pi=Dt.map,hi=dn("map"),gi=In("map");We({target:"Array",proto:!0,forced:!hi||!gi},{map:function(e){return pi(this,e,arguments.length>1?arguments[1]:void 0)}});var mi=function(e){return function(t,r,n,i){xt(r);var a=Ze(t),o=w(a),s=Se(a.length),c=e?s-1:0,u=e?-1:1;if(n<2)for(;;){if(c in o){i=o[c],c+=u;break}if(c+=u,e?c<0:s<=c)throw TypeError("Reduce of empty array with no initial value")}for(;e?c>=0:s>c;c+=u)c in o&&(i=r(i,o[c],c,a));return i}},yi={left:mi(!1),right:mi(!0)},vi="process"==C(l.process),bi=yi.left,Ci=Sn("reduce"),Ei=In("reduce",{1:0}),wi=!vi&&un>79&&un<83;We({target:"Array",proto:!0,forced:!Ci||!Ei||wi},{reduce:function(e){return bi(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}});var ki=yi.right,Si=Sn("reduceRight"),Bi=In("reduce",{1:0}),Ti=!vi&&un>79&&un<83;We({target:"Array",proto:!0,forced:!Si||!Bi||Ti},{reduceRight:function(e){return ki(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}});var Ai=[].reverse,Ii=[1,2];We({target:"Array",proto:!0,forced:String(Ii)===String(Ii.reverse())},{reverse:function(){return $e(this)&&(this.length=this.length),Ai.call(this)}});var _i=dn("slice"),xi=In("slice",{ACCESSORS:!0,0:0,1:2}),Pi=wt("species"),Ri=[].slice,Ni=Math.max;We({target:"Array",proto:!0,forced:!_i||!xi},{slice:function(e,t){var r,n,i,a=S(this),o=Se(a.length),s=Ae(e,o),c=Ae(void 0===t?o:t,o);if($e(a)&&("function"!=typeof(r=a.constructor)||r!==Array&&!$e(r.prototype)?B(r)&&null===(r=r[Pi])&&(r=void 0):r=void 0,r===Array||void 0===r))return Ri.call(a,s,c);for(n=new(void 0===r?Array:r)(Ni(c-s,0)),i=0;s<c;s++,i++)s in a&&Gr(n,i,a[s]);return n.length=i,n}});var Oi=Dt.some,Li=Sn("some"),Di=In("some");We({target:"Array",proto:!0,forced:!Li||!Di},{some:function(e){return Oi(this,e,arguments.length>1?arguments[1]:void 0)}});var Ui=[],Mi=Ui.sort,Vi=d((function(){Ui.sort(void 0)})),ji=d((function(){Ui.sort(null)})),Fi=Sn("sort"),zi=Vi||!ji||!Fi;We({target:"Array",proto:!0,forced:zi},{sort:function(e){return void 0===e?Mi.call(Ze(this)):Mi.call(Ze(this),xt(e))}});var Ki=dn("splice"),qi=In("splice",{ACCESSORS:!0,0:0,1:2}),Hi=Math.max,Qi=Math.min,Gi=9007199254740991,Wi="Maximum allowed length exceeded";We({target:"Array",proto:!0,forced:!Ki||!qi},{splice:function(e,t){var r,n,i,a,o,s,c=Ze(this),u=Se(c.length),l=Ae(e,u),d=arguments.length;if(0===d?r=n=0:1===d?(r=0,n=u-l):(r=d-2,n=Qi(Hi(we(t),0),u-l)),u+r-n>Gi)throw TypeError(Wi);for(i=Nt(c,n),a=0;a<n;a++)(o=l+a)in c&&Gr(i,a,c[o]);if(i.length=n,r<n){for(a=l;a<u-n;a++)s=a+r,(o=a+n)in c?c[s]=c[o]:delete c[s];for(a=u;a>u-n+r;a--)delete c[a-1]}else if(r>n)for(a=u-n;a>l;a--)s=a+r-1,(o=a+n-1)in c?c[s]=c[o]:delete c[s];for(a=0;a<r;a++)c[a+l]=arguments[a+2];return c.length=u-n+r,i}});var Xi=wt("species"),Yi=function(e){var t=be(e),r=V.f;f&&t&&!t[Xi]&&r(t,Xi,{configurable:!0,get:function(){return this}})};Yi("Array"),kn("flat"),kn("flatMap");var $i,Zi,Ji,ea=wt("iterator"),ta=!1,ra=function(){return this};[].keys&&("next"in(Ji=[].keys())?(Zi=Tr(Tr(Ji)))!==Object.prototype&&($i=Zi):ta=!0),null==$i&&($i={}),I($i,ea)||j($i,ea,ra);var na={IteratorPrototype:$i,BUGGY_SAFARI_ITERATORS:ta},ia=na.IteratorPrototype,aa=function(){return this},oa=function(e,t,r){var n=t+" Iterator";return e.prototype=ft(ia,{next:v(1,r)}),_t(e,n,!1),_r[n]=aa,e},sa=na.IteratorPrototype,ca=na.BUGGY_SAFARI_ITERATORS,ua=wt("iterator"),la="keys",da="values",fa="entries",pa=function(){return this},ha=function(e,t,r,n,i,a,o){oa(r,t,n);var s,c,u,l=function(e){if(e===i&&g)return g;if(!ca&&e in p)return p[e];switch(e){case la:case da:case fa:return function(){return new r(this,e)}}return function(){return new r(this)}},d=t+" Iterator",f=!1,p=e.prototype,h=p[ua]||p["@@iterator"]||i&&p[i],g=!ca&&h||l(i),m="Array"==t&&p.entries||h;if(m&&(s=Tr(m.call(new e)),sa!==Object.prototype&&s.next&&(Tr(s)!==sa&&(Ir?Ir(s,sa):"function"!=typeof s[ua]&&j(s,ua,pa)),_t(s,d,!0))),i==da&&h&&h.name!==da&&(f=!0,g=function(){return h.call(this)}),p[ua]!==g&&j(p,ua,g),_r[t]=g,i)if(c={values:l(da),keys:a?g:l(la),entries:l(fa)},o)for(u in c)(ca||f||!(u in p))&&me(p,u,c[u]);else We({target:t,proto:!0,forced:ca||f},c);return c},ga="Array Iterator",ma=ge.set,ya=ge.getterFor(ga),va=ha(Array,"Array",(function(e,t){ma(this,{type:ga,target:S(e),index:0,kind:t})}),(function(){var e=ya(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values");_r.Arguments=_r.Array,kn("keys"),kn("values"),kn("entries");var ba=[].slice,Ca={},Ea=function(e,t,r){if(!(t in Ca)){for(var n=[],i=0;i<t;i++)n[i]="a["+i+"]";Ca[t]=Function("C,a","return new C("+n.join(",")+")")}return Ca[t](e,r)},wa=Function.bind||function(e){var t=xt(this),r=ba.call(arguments,1),n=function(){var i=r.concat(ba.call(arguments));return this instanceof n?Ea(t,i.length,i):t.apply(e,i)};return B(t.prototype)&&(n.prototype=t.prototype),n};We({target:"Function",proto:!0},{bind:wa});var ka=V.f,Sa=Function.prototype,Ba=Sa.toString,Ta=/^\s*function ([^ (]*)/,Aa="name";f&&!(Aa in Sa)&&ka(Sa,Aa,{configurable:!0,get:function(){try{return Ba.call(this).match(Ta)[1]}catch(e){return""}}});var Ia=wt("hasInstance"),_a=Function.prototype;Ia in _a||V.f(_a,Ia,{value:function(e){if("function"!=typeof this||!B(e))return!1;if(!B(this.prototype))return e instanceof this;for(;e=Tr(e);)if(this.prototype===e)return!0;return!1}}),We({global:!0},{globalThis:l});var xa=Object.assign,Pa=Object.defineProperty,Ra=!xa||d((function(){if(f&&1!==xa({b:1},xa(Pa({},"a",{enumerable:!0,get:function(){Pa(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach((function(e){t[e]=e})),7!=xa({},e)[r]||Je(xa({},t)).join("")!=n}))?function(e,t){for(var r=Ze(e),n=arguments.length,i=1,a=Ue.f,o=y.f;n>i;)for(var s,c=w(arguments[i++]),u=a?Je(c).concat(a(c)):Je(c),l=u.length,d=0;l>d;)s=u[d++],f&&!o.call(c,s)||(r[s]=c[s]);return r}:xa;We({target:"Object",stat:!0,forced:Object.assign!==Ra},{assign:Ra}),We({target:"Object",stat:!0,sham:!f},{create:ft}),We({target:"Object",stat:!0,forced:!f,sham:!f},{defineProperty:V.f}),We({target:"Object",stat:!0,forced:!f,sham:!f},{defineProperties:et});var Na=y.f,Oa=function(e){return function(t){for(var r,n=S(t),i=Je(n),a=i.length,o=0,s=[];a>o;)r=i[o++],f&&!Na.call(n,r)||s.push(e?[r,n[r]]:n[r]);return s}},La={entries:Oa(!0),values:Oa(!1)},Da=La.entries;We({target:"Object",stat:!0},{entries:function(e){return Da(e)}});var Ua=!d((function(){return Object.isExtensible(Object.preventExtensions({}))})),Ma=s((function(e){var t=V.f,r=re("meta"),n=0,i=Object.isExtensible||function(){return!0},a=function(e){t(e,r,{value:{objectID:"O"+ ++n,weakData:{}}})},o=e.exports={REQUIRED:!1,fastKey:function(e,t){if(!B(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!I(e,r)){if(!i(e))return"F";if(!t)return"E";a(e)}return e[r].objectID},getWeakData:function(e,t){if(!I(e,r)){if(!i(e))return!0;if(!t)return!1;a(e)}return e[r].weakData},onFreeze:function(e){return Ua&&o.REQUIRED&&i(e)&&!I(e,r)&&a(e),e}};ae[r]=!0})),Va=Ma.onFreeze,ja=Object.freeze,Fa=d((function(){ja(1)}));We({target:"Object",stat:!0,forced:Fa,sham:!Ua},{freeze:function(e){return ja&&B(e)?ja(Va(e)):e}}),We({target:"Object",stat:!0},{fromEntries:function(e){var t={};return qr(e,(function(e,r){Gr(t,e,r)}),{AS_ENTRIES:!0}),t}});var za=L.f,Ka=d((function(){za(1)})),qa=!f||Ka;We({target:"Object",stat:!0,forced:qa,sham:!f},{getOwnPropertyDescriptor:function(e,t){return za(S(e),t)}}),We({target:"Object",stat:!0,sham:!f},{getOwnPropertyDescriptors:function(e){for(var t,r,n=S(e),i=L.f,a=Me(n),o={},s=0;a.length>s;)void 0!==(r=i(n,t=a[s++]))&&Gr(o,t,r);return o}});var Ha=vt.f,Qa=d((function(){return!Object.getOwnPropertyNames(1)}));We({target:"Object",stat:!0,forced:Qa},{getOwnPropertyNames:Ha});var Ga=d((function(){Tr(1)}));We({target:"Object",stat:!0,forced:Ga,sham:!kr},{getPrototypeOf:function(e){return Tr(Ze(e))}});var Wa=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};We({target:"Object",stat:!0},{is:Wa});var Xa=Object.isExtensible,Ya=d((function(){Xa(1)}));We({target:"Object",stat:!0,forced:Ya},{isExtensible:function(e){return!!B(e)&&(!Xa||Xa(e))}});var $a=Object.isFrozen,Za=d((function(){$a(1)}));We({target:"Object",stat:!0,forced:Za},{isFrozen:function(e){return!B(e)||!!$a&&$a(e)}});var Ja=Object.isSealed,eo=d((function(){Ja(1)}));We({target:"Object",stat:!0,forced:eo},{isSealed:function(e){return!B(e)||!!Ja&&Ja(e)}});var to=d((function(){Je(1)}));We({target:"Object",stat:!0,forced:to},{keys:function(e){return Je(Ze(e))}});var ro=Ma.onFreeze,no=Object.preventExtensions,io=d((function(){no(1)}));We({target:"Object",stat:!0,forced:io,sham:!Ua},{preventExtensions:function(e){return no&&B(e)?no(ro(e)):e}});var ao=Ma.onFreeze,oo=Object.seal,so=d((function(){oo(1)}));We({target:"Object",stat:!0,forced:so,sham:!Ua},{seal:function(e){return oo&&B(e)?oo(ao(e)):e}}),We({target:"Object",stat:!0},{setPrototypeOf:Ir});var co=La.values;We({target:"Object",stat:!0},{values:function(e){return co(e)}});var uo=Lr?{}.toString:function(){return"[object "+Vr(this)+"]"};Lr||me(Object.prototype,"toString",uo,{unsafe:!0});var lo=!d((function(){var e=Math.random();__defineSetter__.call(null,e,(function(){})),delete l[e]}));f&&We({target:"Object",proto:!0,forced:lo},{__defineGetter__:function(e,t){V.f(Ze(this),e,{get:xt(t),enumerable:!0,configurable:!0})}}),f&&We({target:"Object",proto:!0,forced:lo},{__defineSetter__:function(e,t){V.f(Ze(this),e,{set:xt(t),enumerable:!0,configurable:!0})}});var fo=L.f;f&&We({target:"Object",proto:!0,forced:lo},{__lookupGetter__:function(e){var t,r=Ze(this),n=T(e,!0);do{if(t=fo(r,n))return t.get}while(r=Tr(r))}});var po=L.f;f&&We({target:"Object",proto:!0,forced:lo},{__lookupSetter__:function(e){var t,r=Ze(this),n=T(e,!0);do{if(t=po(r,n))return t.set}while(r=Tr(r))}});var ho=String.fromCharCode,go=String.fromCodePoint,mo=!!go&&1!=go.length;We({target:"String",stat:!0,forced:mo},{fromCodePoint:function(e){for(var t,r=[],n=arguments.length,i=0;n>i;){if(t=+arguments[i++],Ae(t,1114111)!==t)throw RangeError(t+" is not a valid code point");r.push(t<65536?ho(t):ho(55296+((t-=65536)>>10),t%1024+56320))}return r.join("")}}),We({target:"String",stat:!0},{raw:function(e){for(var t=S(e.raw),r=Se(t.length),n=arguments.length,i=[],a=0;r>a;)i.push(String(t[a++])),a<n&&i.push(String(arguments[a]));return i.join("")}});var yo=function(e){return function(t,r){var n,i,a=String(k(t)),o=we(r),s=a.length;return o<0||o>=s?e?"":void 0:(n=a.charCodeAt(o))<55296||n>56319||o+1===s||(i=a.charCodeAt(o+1))<56320||i>57343?e?a.charAt(o):n:e?a.slice(o,o+2):i-56320+(n-55296<<10)+65536}},vo={codeAt:yo(!1),charAt:yo(!0)},bo=vo.codeAt;We({target:"String",proto:!0},{codePointAt:function(e){return bo(this,e)}});var Co,Eo=wt("match"),wo=function(e){var t;return B(e)&&(void 0!==(t=e[Eo])?!!t:"RegExp"==C(e))},ko=function(e){if(wo(e))throw TypeError("The method doesn't accept regular expressions");return e},So=wt("match"),Bo=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[So]=!1,"/./"[e](t)}catch(e){}}return!1},To=L.f,Ao="".endsWith,Io=Math.min,_o=Bo("endsWith"),xo=!(_o||(Co=To(String.prototype,"endsWith"),!Co||Co.writable));We({target:"String",proto:!0,forced:!xo&&!_o},{endsWith:function(e){var t=String(k(this));ko(e);var r=arguments.length>1?arguments[1]:void 0,n=Se(t.length),i=void 0===r?n:Io(Se(r),n),a=String(e);return Ao?Ao.call(t,a,i):t.slice(i-a.length,i)===a}}),We({target:"String",proto:!0,forced:!Bo("includes")},{includes:function(e){return!!~String(k(this)).indexOf(ko(e),arguments.length>1?arguments[1]:void 0)}});var Po=function(){var e=D(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t};function Ro(e,t){return RegExp(e,t)}var No=d((function(){var e=Ro("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),Oo=d((function(){var e=Ro("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),Lo={UNSUPPORTED_Y:No,BROKEN_CARET:Oo},Do=RegExp.prototype.exec,Uo=String.prototype.replace,Mo=Do,Vo=function(){var e=/a/,t=/b*/g;return Do.call(e,"a"),Do.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),jo=Lo.UNSUPPORTED_Y||Lo.BROKEN_CARET,Fo=void 0!==/()??/.exec("")[1],zo=Vo||Fo||jo;zo&&(Mo=function(e){var t,r,n,i,a=this,o=jo&&a.sticky,s=Po.call(a),c=a.source,u=0,l=e;return o&&(-1===(s=s.replace("y","")).indexOf("g")&&(s+="g"),l=String(e).slice(a.lastIndex),a.lastIndex>0&&(!a.multiline||a.multiline&&"\n"!==e[a.lastIndex-1])&&(c="(?: "+c+")",l=" "+l,u++),r=new RegExp("^(?:"+c+")",s)),Fo&&(r=new RegExp("^"+c+"$(?!\\s)",s)),Vo&&(t=a.lastIndex),n=Do.call(o?r:a,l),o?n?(n.input=n.input.slice(u),n[0]=n[0].slice(u),n.index=a.lastIndex,a.lastIndex+=n[0].length):a.lastIndex=0:Vo&&n&&(a.lastIndex=a.global?n.index+n[0].length:t),Fo&&n&&n.length>1&&Uo.call(n[0],r,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(n[i]=void 0)})),n});var Ko=Mo;We({target:"RegExp",proto:!0,forced:/./.exec!==Ko},{exec:Ko});var qo=wt("species"),Ho=!d((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),Qo="$0"==="a".replace(/./,"$0"),Go=wt("replace"),Wo=!!/./[Go]&&""===/./[Go]("a","$0"),Xo=!d((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2!==r.length||"a"!==r[0]||"b"!==r[1]})),Yo=function(e,t,r,n){var i=wt(e),a=!d((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),o=a&&!d((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[qo]=function(){return r},r.flags="",r[i]=/./[i]),r.exec=function(){return t=!0,null},r[i](""),!t}));if(!a||!o||"replace"===e&&(!Ho||!Qo||Wo)||"split"===e&&!Xo){var s=/./[i],c=r(i,""[e],(function(e,t,r,n,i){return t.exec===Ko?a&&!i?{done:!0,value:s.call(t,r,n)}:{done:!0,value:e.call(r,t,n)}:{done:!1}}),{REPLACE_KEEPS_$0:Qo,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:Wo}),u=c[0],l=c[1];me(String.prototype,e,u),me(RegExp.prototype,i,2==t?function(e,t){return l.call(e,this,t)}:function(e){return l.call(e,this)})}n&&j(RegExp.prototype[i],"sham",!0)},$o=vo.charAt,Zo=function(e,t,r){return t+(r?$o(e,t).length:1)},Jo=function(e,t){var r=e.exec;if("function"==typeof r){var n=r.call(e,t);if("object"!=typeof n)throw TypeError("RegExp exec method returned something other than an Object or null");return n}if("RegExp"!==C(e))throw TypeError("RegExp#exec called on incompatible receiver");return Ko.call(e,t)};Yo("match",1,(function(e,t,r){return[function(t){var r=k(this),n=null==t?void 0:t[e];return void 0!==n?n.call(t,r):new RegExp(t)[e](String(r))},function(e){var n=r(t,e,this);if(n.done)return n.value;var i=D(e),a=String(this);if(!i.global)return Jo(i,a);var o=i.unicode;i.lastIndex=0;for(var s,c=[],u=0;null!==(s=Jo(i,a));){var l=String(s[0]);c[u]=l,""===l&&(i.lastIndex=Zo(a,Se(i.lastIndex),o)),u++}return 0===u?null:c}]}));var es=wt("species"),ts=function(e,t){var r,n=D(e).constructor;return void 0===n||null==(r=D(n)[es])?t:xt(r)},rs=wt("matchAll"),ns="RegExp String",is=ns+" Iterator",as=ge.set,os=ge.getterFor(is),ss=RegExp.prototype,cs=ss.exec,us="".matchAll,ls=!!us&&!d((function(){"a".matchAll(/./)})),ds=function(e,t){var r,n=e.exec;if("function"==typeof n){if("object"!=typeof(r=n.call(e,t)))throw TypeError("Incorrect exec result");return r}return cs.call(e,t)},fs=oa((function(e,t,r,n){as(this,{type:is,regexp:e,string:t,global:r,unicode:n,done:!1})}),ns,(function(){var e=os(this);if(e.done)return{value:void 0,done:!0};var t=e.regexp,r=e.string,n=ds(t,r);return null===n?{value:void 0,done:e.done=!0}:e.global?(""==String(n[0])&&(t.lastIndex=Zo(r,Se(t.lastIndex),e.unicode)),{value:n,done:!1}):(e.done=!0,{value:n,done:!1})})),ps=function(e){var t,r,n,i,a,o,s=D(this),c=String(e);return t=ts(s,RegExp),void 0===(r=s.flags)&&s instanceof RegExp&&!("flags"in ss)&&(r=Po.call(s)),n=void 0===r?"":String(r),i=new t(t===RegExp?s.source:s,n),a=!!~n.indexOf("g"),o=!!~n.indexOf("u"),i.lastIndex=Se(s.lastIndex),new fs(i,c,a,o)};We({target:"String",proto:!0,forced:ls},{matchAll:function(e){var t,r,n=k(this);if(null!=e){if(wo(e)&&!~String(k("flags"in ss?e.flags:Po.call(e))).indexOf("g"))throw TypeError("`.matchAll` does not allow non-global regexes");if(ls)return us.apply(n,arguments);if(void 0===(r=e[rs])&&Z&&"RegExp"==C(e)&&(r=ps),null!=r)return xt(r).call(e,n)}else if(ls)return us.apply(n,arguments);return t=String(n),new RegExp(e,"g")[rs](t)}}),rs in ss||j(ss,rs,ps);var hs="".repeat||function(e){var t=String(k(this)),r="",n=we(e);if(n<0||n==1/0)throw RangeError("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(r+=t);return r},gs=Math.ceil,ms=function(e){return function(t,r,n){var i,a,o=String(k(t)),s=o.length,c=void 0===n?" ":String(n),u=Se(r);return u<=s||""==c?o:(i=u-s,(a=hs.call(c,gs(i/c.length))).length>i&&(a=a.slice(0,i)),e?o+a:a+o)}},ys={start:ms(!1),end:ms(!0)},vs=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(an),bs=ys.end;We({target:"String",proto:!0,forced:vs},{padEnd:function(e){return bs(this,e,arguments.length>1?arguments[1]:void 0)}});var Cs=ys.start;We({target:"String",proto:!0,forced:vs},{padStart:function(e){return Cs(this,e,arguments.length>1?arguments[1]:void 0)}}),We({target:"String",proto:!0},{repeat:hs});var Es=Math.max,ws=Math.min,ks=Math.floor,Ss=/\$([$&'`]|\d\d?|<[^>]*>)/g,Bs=/\$([$&'`]|\d\d?)/g,Ts=function(e){return void 0===e?e:String(e)};Yo("replace",2,(function(e,t,r,n){var i=n.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,a=n.REPLACE_KEEPS_$0,o=i?"$":"$0";return[function(r,n){var i=k(this),a=null==r?void 0:r[e];return void 0!==a?a.call(r,i,n):t.call(String(i),r,n)},function(e,n){if(!i&&a||"string"==typeof n&&-1===n.indexOf(o)){var c=r(t,e,this,n);if(c.done)return c.value}var u=D(e),l=String(this),d="function"==typeof n;d||(n=String(n));var f=u.global;if(f){var p=u.unicode;u.lastIndex=0}for(var h=[];;){var g=Jo(u,l);if(null===g)break;if(h.push(g),!f)break;""===String(g[0])&&(u.lastIndex=Zo(l,Se(u.lastIndex),p))}for(var m="",y=0,v=0;v<h.length;v++){g=h[v];for(var b=String(g[0]),C=Es(ws(we(g.index),l.length),0),E=[],w=1;w<g.length;w++)E.push(Ts(g[w]));var k=g.groups;if(d){var S=[b].concat(E,C,l);void 0!==k&&S.push(k);var B=String(n.apply(void 0,S))}else B=s(b,l,C,E,k,n);C>=y&&(m+=l.slice(y,C)+B,y=C+b.length)}return m+l.slice(y)}];function s(e,r,n,i,a,o){var s=n+e.length,c=i.length,u=Bs;return void 0!==a&&(a=Ze(a),u=Ss),t.call(o,u,(function(t,o){var u;switch(o.charAt(0)){case"$":return"$";case"&":return e;case"`":return r.slice(0,n);case"'":return r.slice(s);case"<":u=a[o.slice(1,-1)];break;default:var l=+o;if(0===l)return t;if(l>c){var d=ks(l/10);return 0===d?t:d<=c?void 0===i[d-1]?o.charAt(1):i[d-1]+o.charAt(1):t}u=i[l-1]}return void 0===u?"":u}))}})),Yo("search",1,(function(e,t,r){return[function(t){var r=k(this),n=null==t?void 0:t[e];return void 0!==n?n.call(t,r):new RegExp(t)[e](String(r))},function(e){var n=r(t,e,this);if(n.done)return n.value;var i=D(e),a=String(this),o=i.lastIndex;Wa(o,0)||(i.lastIndex=0);var s=Jo(i,a);return Wa(i.lastIndex,o)||(i.lastIndex=o),null===s?-1:s.index}]}));var As=[].push,Is=Math.min,_s=4294967295,xs=!d((function(){return!RegExp(_s,"y")}));Yo("split",2,(function(e,t,r){var n;return n="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,r){var n=String(k(this)),i=void 0===r?_s:r>>>0;if(0===i)return[];if(void 0===e)return[n];if(!wo(e))return t.call(n,e,i);for(var a,o,s,c=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,d=new RegExp(e.source,u+"g");(a=Ko.call(d,n))&&!((o=d.lastIndex)>l&&(c.push(n.slice(l,a.index)),a.length>1&&a.index<n.length&&As.apply(c,a.slice(1)),s=a[0].length,l=o,c.length>=i));)d.lastIndex===a.index&&d.lastIndex++;return l===n.length?!s&&d.test("")||c.push(""):c.push(n.slice(l)),c.length>i?c.slice(0,i):c}:"0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:t.call(this,e,r)}:t,[function(t,r){var i=k(this),a=null==t?void 0:t[e];return void 0!==a?a.call(t,i,r):n.call(String(i),t,r)},function(e,i){var a=r(n,e,this,i,n!==t);if(a.done)return a.value;var o=D(e),s=String(this),c=ts(o,RegExp),u=o.unicode,l=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(xs?"y":"g"),d=new c(xs?o:"^(?:"+o.source+")",l),f=void 0===i?_s:i>>>0;if(0===f)return[];if(0===s.length)return null===Jo(d,s)?[s]:[];for(var p=0,h=0,g=[];h<s.length;){d.lastIndex=xs?h:0;var m,y=Jo(d,xs?s:s.slice(h));if(null===y||(m=Is(Se(d.lastIndex+(xs?0:h)),s.length))===p)h=Zo(s,h,u);else{if(g.push(s.slice(p,h)),g.length===f)return g;for(var v=1;v<=y.length-1;v++)if(g.push(y[v]),g.length===f)return g;h=p=m}}return g.push(s.slice(p)),g}]}),!xs);var Ps=L.f,Rs="".startsWith,Ns=Math.min,Os=Bo("startsWith"),Ls=!Os&&!!function(){var e=Ps(String.prototype,"startsWith");return e&&!e.writable}();We({target:"String",proto:!0,forced:!Ls&&!Os},{startsWith:function(e){var t=String(k(this));ko(e);var r=Se(Ns(arguments.length>1?arguments[1]:void 0,t.length)),n=String(e);return Rs?Rs.call(t,n,r):t.slice(r,r+n.length)===n}});var Ds="\t\n\v\f\r \u2028\u2029\ufeff",Us="["+Ds+"]",Ms=RegExp("^"+Us+Us+"*"),Vs=RegExp(Us+Us+"*$"),js=function(e){return function(t){var r=String(k(t));return 1&e&&(r=r.replace(Ms,"")),2&e&&(r=r.replace(Vs,"")),r}},Fs={start:js(1),end:js(2),trim:js(3)},zs="
",Ks=function(e){return d((function(){return!!Ds[e]()||zs[e]()!=zs||Ds[e].name!==e}))},qs=Fs.trim;We({target:"String",proto:!0,forced:Ks("trim")},{trim:function(){return qs(this)}});var Hs=Fs.start,Qs=Ks("trimStart"),Gs=Qs?function(){return Hs(this)}:"".trimStart;We({target:"String",proto:!0,forced:Qs},{trimStart:Gs,trimLeft:Gs});var Ws=Fs.end,Xs=Ks("trimEnd"),Ys=Xs?function(){return Ws(this)}:"".trimEnd;We({target:"String",proto:!0,forced:Xs},{trimEnd:Ys,trimRight:Ys});var $s=vo.charAt,Zs="String Iterator",Js=ge.set,ec=ge.getterFor(Zs);ha(String,"String",(function(e){Js(this,{type:Zs,string:String(e),index:0})}),(function(){var e,t=ec(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=$s(r,n),t.index+=e.length,{value:e,done:!1})}));var tc=/"/g,rc=function(e,t,r,n){var i=String(k(e)),a="<"+t;return""!==r&&(a+=" "+r+'="'+String(n).replace(tc,""")+'"'),a+">"+i+"</"+t+">"},nc=function(e){return d((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))};We({target:"String",proto:!0,forced:nc("anchor")},{anchor:function(e){return rc(this,"a","name",e)}}),We({target:"String",proto:!0,forced:nc("big")},{big:function(){return rc(this,"big","","")}}),We({target:"String",proto:!0,forced:nc("blink")},{blink:function(){return rc(this,"blink","","")}}),We({target:"String",proto:!0,forced:nc("bold")},{bold:function(){return rc(this,"b","","")}}),We({target:"String",proto:!0,forced:nc("fixed")},{fixed:function(){return rc(this,"tt","","")}}),We({target:"String",proto:!0,forced:nc("fontcolor")},{fontcolor:function(e){return rc(this,"font","color",e)}}),We({target:"String",proto:!0,forced:nc("fontsize")},{fontsize:function(e){return rc(this,"font","size",e)}}),We({target:"String",proto:!0,forced:nc("italics")},{italics:function(){return rc(this,"i","","")}}),We({target:"String",proto:!0,forced:nc("link")},{link:function(e){return rc(this,"a","href",e)}}),We({target:"String",proto:!0,forced:nc("small")},{small:function(){return rc(this,"small","","")}}),We({target:"String",proto:!0,forced:nc("strike")},{strike:function(){return rc(this,"strike","","")}}),We({target:"String",proto:!0,forced:nc("sub")},{sub:function(){return rc(this,"sub","","")}}),We({target:"String",proto:!0,forced:nc("sup")},{sup:function(){return rc(this,"sup","","")}});var ic=wt("replace"),ac=RegExp.prototype;We({target:"String",proto:!0},{replaceAll:function e(t,r){var n,i,a,o,s,c,u,l=k(this);if(null!=t){if(wo(t)&&!~String(k("flags"in ac?t.flags:Po.call(t))).indexOf("g"))throw TypeError("`.replaceAll` does not allow non-global regexes");if(void 0!==(n=t[ic]))return n.call(t,l,r)}if(i=String(l),""===(a=String(t)))return e.call(i,/(?:)/g,r);if(o=i.split(a),"function"!=typeof r)return o.join(String(r));for(c=(s=o[0]).length,u=1;u<o.length;u++)s+=String(r(a,c,i)),c+=a.length+o[u].length,s+=o[u];return s}});var oc=function(e,t,r){var n,i;return Ir&&"function"==typeof(n=t.constructor)&&n!==r&&B(i=n.prototype)&&i!==r.prototype&&Ir(e,i),e},sc=V.f,cc=Le.f,uc=ge.set,lc=wt("match"),dc=l.RegExp,fc=dc.prototype,pc=/a/g,hc=/a/g,gc=new dc(pc)!==pc,mc=Lo.UNSUPPORTED_Y,yc=f&&Qe("RegExp",!gc||mc||d((function(){return hc[lc]=!1,dc(pc)!=pc||dc(hc)==hc||"/a/i"!=dc(pc,"i")})));if(yc){for(var vc=function(e,t){var r,n=this instanceof vc,i=wo(e),a=void 0===t;if(!n&&i&&e.constructor===vc&&a)return e;gc?i&&!a&&(e=e.source):e instanceof vc&&(a&&(t=Po.call(e)),e=e.source),mc&&(r=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,""));var o=oc(gc?new dc(e,t):dc(e,t),n?this:fc,vc);return mc&&r&&uc(o,{sticky:r}),o},bc=function(e){e in vc||sc(vc,e,{configurable:!0,get:function(){return dc[e]},set:function(t){dc[e]=t}})},Cc=cc(dc),Ec=0;Cc.length>Ec;)bc(Cc[Ec++]);fc.constructor=vc,vc.prototype=fc,me(l,"RegExp",vc)}Yi("RegExp");var wc=Lo.UNSUPPORTED_Y;f&&("g"!=/./g.flags||wc)&&V.f(RegExp.prototype,"flags",{configurable:!0,get:Po});var kc=Lo.UNSUPPORTED_Y,Sc=V.f,Bc=ge.get,Tc=RegExp.prototype;f&&kc&&Sc(RegExp.prototype,"sticky",{configurable:!0,get:function(){if(this!==Tc){if(this instanceof RegExp)return!!Bc(this).sticky;throw TypeError("Incompatible receiver, RegExp required")}}});var Ac=function(){var e=!1,t=/[ac]/;return t.exec=function(){return e=!0,/./.exec.apply(this,arguments)},!0===t.test("abc")&&e}(),Ic=/./.test;We({target:"RegExp",proto:!0,forced:!Ac},{test:function(e){if("function"!=typeof this.exec)return Ic.call(this,e);var t=this.exec(e);if(null!==t&&!B(t))throw new Error("RegExp exec method returned something other than an Object or null");return!!t}});var _c="toString",xc=RegExp.prototype,Pc=xc[_c],Rc=d((function(){return"/a/b"!=Pc.call({source:"a",flags:"b"})})),Nc=Pc.name!=_c;(Rc||Nc)&&me(RegExp.prototype,_c,(function(){var e=D(this),t=String(e.source),r=e.flags;return"/"+t+"/"+String(void 0===r&&e instanceof RegExp&&!("flags"in xc)?Po.call(e):r)}),{unsafe:!0});var Oc=Fs.trim,Lc=l.parseInt,Dc=/^[+-]?0[Xx]/,Uc=8!==Lc(Ds+"08")||22!==Lc(Ds+"0x16"),Mc=Uc?function(e,t){var r=Oc(String(e));return Lc(r,t>>>0||(Dc.test(r)?16:10))}:Lc;We({global:!0,forced:parseInt!=Mc},{parseInt:Mc});var Vc=Fs.trim,jc=l.parseFloat,Fc=1/jc(Ds+"-0")!=-1/0,zc=Fc?function(e){var t=Vc(String(e)),r=jc(t);return 0===r&&"-"==t.charAt(0)?-0:r}:jc;We({global:!0,forced:parseFloat!=zc},{parseFloat:zc});var Kc=Le.f,qc=L.f,Hc=V.f,Qc=Fs.trim,Gc="Number",Wc=l[Gc],Xc=Wc.prototype,Yc=C(ft(Xc))==Gc,$c=function(e){var t,r,n,i,a,o,s,c,u=T(e,!1);if("string"==typeof u&&u.length>2)if(43===(t=(u=Qc(u)).charCodeAt(0))||45===t){if(88===(r=u.charCodeAt(2))||120===r)return NaN}else if(48===t){switch(u.charCodeAt(1)){case 66:case 98:n=2,i=49;break;case 79:case 111:n=8,i=55;break;default:return+u}for(o=(a=u.slice(2)).length,s=0;s<o;s++)if((c=a.charCodeAt(s))<48||c>i)return NaN;return parseInt(a,n)}return+u};if(Qe(Gc,!Wc(" 0o1")||!Wc("0b1")||Wc("+0x1"))){for(var Zc,Jc=function(e){var t=arguments.length<1?0:e,r=this;return r instanceof Jc&&(Yc?d((function(){Xc.valueOf.call(r)})):C(r)!=Gc)?oc(new Wc($c(t)),r,Jc):$c(t)},eu=f?Kc(Wc):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,fromString,range".split(","),tu=0;eu.length>tu;tu++)I(Wc,Zc=eu[tu])&&!I(Jc,Zc)&&Hc(Jc,Zc,qc(Wc,Zc));Jc.prototype=Xc,Xc.constructor=Jc,me(l,Gc,Jc)}We({target:"Number",stat:!0},{EPSILON:Math.pow(2,-52)});var ru=l.isFinite,nu=Number.isFinite||function(e){return"number"==typeof e&&ru(e)};We({target:"Number",stat:!0},{isFinite:nu});var iu=Math.floor,au=function(e){return!B(e)&&isFinite(e)&&iu(e)===e};We({target:"Number",stat:!0},{isInteger:au}),We({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var ou=Math.abs;We({target:"Number",stat:!0},{isSafeInteger:function(e){return au(e)&&ou(e)<=9007199254740991}}),We({target:"Number",stat:!0},{MAX_SAFE_INTEGER:9007199254740991}),We({target:"Number",stat:!0},{MIN_SAFE_INTEGER:-9007199254740991}),We({target:"Number",stat:!0,forced:Number.parseFloat!=zc},{parseFloat:zc}),We({target:"Number",stat:!0,forced:Number.parseInt!=Mc},{parseInt:Mc});var su=function(e){if("number"!=typeof e&&"Number"!=C(e))throw TypeError("Incorrect invocation");return+e},cu=1..toFixed,uu=Math.floor,lu=function(e,t,r){return 0===t?r:t%2==1?lu(e,t-1,r*e):lu(e*e,t/2,r)},du=function(e){for(var t=0,r=e;r>=4096;)t+=12,r/=4096;for(;r>=2;)t+=1,r/=2;return t},fu=cu&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!d((function(){cu.call({})}));We({target:"Number",proto:!0,forced:fu},{toFixed:function(e){var t,r,n,i,a=su(this),o=we(e),s=[0,0,0,0,0,0],c="",u="0",l=function(e,t){for(var r=-1,n=t;++r<6;)n+=e*s[r],s[r]=n%1e7,n=uu(n/1e7)},d=function(e){for(var t=6,r=0;--t>=0;)r+=s[t],s[t]=uu(r/e),r=r%e*1e7},f=function(){for(var e=6,t="";--e>=0;)if(""!==t||0===e||0!==s[e]){var r=String(s[e]);t=""===t?r:t+hs.call("0",7-r.length)+r}return t};if(o<0||o>20)throw RangeError("Incorrect fraction digits");if(a!=a)return"NaN";if(a<=-1e21||a>=1e21)return String(a);if(a<0&&(c="-",a=-a),a>1e-21)if(r=(t=du(a*lu(2,69,1))-69)<0?a*lu(2,-t,1):a/lu(2,t,1),r*=4503599627370496,(t=52-t)>0){for(l(0,r),n=o;n>=7;)l(1e7,0),n-=7;for(l(lu(10,n,1),0),n=t-1;n>=23;)d(1<<23),n-=23;d(1<<n),l(1,1),d(2),u=f()}else l(0,r),l(1<<-t,0),u=f()+hs.call("0",o);return u=o>0?c+((i=u.length)<=o?"0."+hs.call("0",o-i)+u:u.slice(0,i-o)+"."+u.slice(i-o)):c+u}});var pu=1..toPrecision,hu=d((function(){return"1"!==pu.call(1,void 0)}))||!d((function(){pu.call({})}));We({target:"Number",proto:!0,forced:hu},{toPrecision:function(e){return void 0===e?pu.call(su(this)):pu.call(su(this),e)}});var gu=Math.log,mu=Math.log1p||function(e){return(e=+e)>-1e-8&&e<1e-8?e-e*e/2:gu(1+e)},yu=Math.acosh,vu=Math.log,bu=Math.sqrt,Cu=Math.LN2,Eu=!yu||710!=Math.floor(yu(Number.MAX_VALUE))||yu(1/0)!=1/0;We({target:"Math",stat:!0,forced:Eu},{acosh:function(e){return(e=+e)<1?NaN:e>94906265.62425156?vu(e)+Cu:mu(e-1+bu(e-1)*bu(e+1))}});var wu=Math.asinh,ku=Math.log,Su=Math.sqrt;function Bu(e){return isFinite(e=+e)&&0!=e?e<0?-Bu(-e):ku(e+Su(e*e+1)):e}We({target:"Math",stat:!0,forced:!(wu&&1/wu(0)>0)},{asinh:Bu});var Tu=Math.atanh,Au=Math.log;We({target:"Math",stat:!0,forced:!(Tu&&1/Tu(-0)<0)},{atanh:function(e){return 0==(e=+e)?e:Au((1+e)/(1-e))/2}});var Iu=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1},_u=Math.abs,xu=Math.pow;We({target:"Math",stat:!0},{cbrt:function(e){return Iu(e=+e)*xu(_u(e),1/3)}});var Pu=Math.floor,Ru=Math.log,Nu=Math.LOG2E;We({target:"Math",stat:!0},{clz32:function(e){return(e>>>=0)?31-Pu(Ru(e+.5)*Nu):32}});var Ou=Math.expm1,Lu=Math.exp,Du=!Ou||Ou(10)>22025.465794806718||Ou(10)<22025.465794806718||-2e-17!=Ou(-2e-17)?function(e){return 0==(e=+e)?e:e>-1e-6&&e<1e-6?e+e*e/2:Lu(e)-1}:Ou,Uu=Math.cosh,Mu=Math.abs,Vu=Math.E;We({target:"Math",stat:!0,forced:!Uu||Uu(710)===1/0},{cosh:function(e){var t=Du(Mu(e)-1)+1;return(t+1/(t*Vu*Vu))*(Vu/2)}}),We({target:"Math",stat:!0,forced:Du!=Math.expm1},{expm1:Du});var ju=Math.abs,Fu=Math.pow,zu=Fu(2,-52),Ku=Fu(2,-23),qu=Fu(2,127)*(2-Ku),Hu=Fu(2,-126),Qu=function(e){return e+1/zu-1/zu},Gu=Math.fround||function(e){var t,r,n=ju(e),i=Iu(e);return n<Hu?i*Qu(n/Hu/Ku)*Hu*Ku:(r=(t=(1+Ku/zu)*n)-(t-n))>qu||r!=r?i*(1/0):i*r};We({target:"Math",stat:!0},{fround:Gu});var Wu=Math.hypot,Xu=Math.abs,Yu=Math.sqrt,$u=!!Wu&&Wu(1/0,NaN)!==1/0;We({target:"Math",stat:!0,forced:$u},{hypot:function(e,t){for(var r,n,i=0,a=0,o=arguments.length,s=0;a<o;)s<(r=Xu(arguments[a++]))?(i=i*(n=s/r)*n+1,s=r):i+=r>0?(n=r/s)*n:r;return s===1/0?1/0:s*Yu(i)}});var Zu=Math.imul,Ju=d((function(){return-5!=Zu(4294967295,5)||2!=Zu.length}));We({target:"Math",stat:!0,forced:Ju},{imul:function(e,t){var r=65535,n=+e,i=+t,a=r&n,o=r&i;return 0|a*o+((r&n>>>16)*o+a*(r&i>>>16)<<16>>>0)}});var el=Math.log,tl=Math.LOG10E;We({target:"Math",stat:!0},{log10:function(e){return el(e)*tl}}),We({target:"Math",stat:!0},{log1p:mu});var rl=Math.log,nl=Math.LN2;We({target:"Math",stat:!0},{log2:function(e){return rl(e)/nl}}),We({target:"Math",stat:!0},{sign:Iu});var il=Math.abs,al=Math.exp,ol=Math.E,sl=d((function(){return-2e-17!=Math.sinh(-2e-17)}));We({target:"Math",stat:!0,forced:sl},{sinh:function(e){return il(e=+e)<1?(Du(e)-Du(-e))/2:(al(e-1)-al(-e-1))*(ol/2)}});var cl=Math.exp;We({target:"Math",stat:!0},{tanh:function(e){var t=Du(e=+e),r=Du(-e);return t==1/0?1:r==1/0?-1:(t-r)/(cl(e)+cl(-e))}}),_t(Math,"Math",!0);var ul=Math.ceil,ll=Math.floor;We({target:"Math",stat:!0},{trunc:function(e){return(e>0?ll:ul)(e)}}),We({target:"Date",stat:!0},{now:function(){return(new Date).getTime()}});var dl=d((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}));We({target:"Date",proto:!0,forced:dl},{toJSON:function(e){var t=Ze(this),r=T(t);return"number"!=typeof r||isFinite(r)?t.toISOString():null}});var fl=ys.start,pl=Math.abs,hl=Date.prototype,gl=hl.getTime,ml=hl.toISOString,yl=d((function(){return"0385-07-25T07:06:39.999Z"!=ml.call(new Date(-50000000000001))}))||!d((function(){ml.call(new Date(NaN))}))?function(){if(!isFinite(gl.call(this)))throw RangeError("Invalid time value");var e=this,t=e.getUTCFullYear(),r=e.getUTCMilliseconds(),n=t<0?"-":t>9999?"+":"";return n+fl(pl(t),n?6:4,0)+"-"+fl(e.getUTCMonth()+1,2,0)+"-"+fl(e.getUTCDate(),2,0)+"T"+fl(e.getUTCHours(),2,0)+":"+fl(e.getUTCMinutes(),2,0)+":"+fl(e.getUTCSeconds(),2,0)+"."+fl(r,3,0)+"Z"}:ml;We({target:"Date",proto:!0,forced:Date.prototype.toISOString!==yl},{toISOString:yl});var vl=Date.prototype,bl="Invalid Date",Cl="toString",El=vl[Cl],wl=vl.getTime;new Date(NaN)+""!=bl&&me(vl,Cl,(function(){var e=wl.call(this);return e==e?El.call(this):bl}));var kl=function(e){if("string"!==e&&"number"!==e&&"default"!==e)throw TypeError("Incorrect hint");return T(D(this),"number"!==e)},Sl=wt("toPrimitive"),Bl=Date.prototype;Sl in Bl||j(Bl,Sl,kl);var Tl=be("JSON","stringify"),Al=/[\uD800-\uDFFF]/g,Il=/^[\uD800-\uDBFF]$/,_l=/^[\uDC00-\uDFFF]$/,xl=function(e,t,r){var n=r.charAt(t-1),i=r.charAt(t+1);return Il.test(e)&&!_l.test(i)||_l.test(e)&&!Il.test(n)?"\\u"+e.charCodeAt(0).toString(16):e},Pl=d((function(){return'"\\udf06\\ud834"'!==Tl("\udf06\ud834")||'"\\udead"'!==Tl("\udead")}));Tl&&We({target:"JSON",stat:!0,forced:Pl},{stringify:function(e,t,r){var n=Tl.apply(null,arguments);return"string"==typeof n?n.replace(Al,xl):n}}),_t(l.JSON,"JSON",!0);var Rl,Nl,Ol,Ll=l.Promise,Dl=function(e,t,r){for(var n in t)me(e,n,t[n],r);return e},Ul=function(e,t,r){if(!(e instanceof t))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return e},Ml=/(iphone|ipod|ipad).*applewebkit/i.test(an),Vl=l.location,jl=l.setImmediate,Fl=l.clearImmediate,zl=l.process,Kl=l.MessageChannel,ql=l.Dispatch,Hl=0,Ql={},Gl="onreadystatechange",Wl=function(e){if(Ql.hasOwnProperty(e)){var t=Ql[e];delete Ql[e],t()}},Xl=function(e){return function(){Wl(e)}},Yl=function(e){Wl(e.data)},$l=function(e){l.postMessage(e+"",Vl.protocol+"//"+Vl.host)};jl&&Fl||(jl=function(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return Ql[++Hl]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},Rl(Hl),Hl},Fl=function(e){delete Ql[e]},vi?Rl=function(e){zl.nextTick(Xl(e))}:ql&&ql.now?Rl=function(e){ql.now(Xl(e))}:Kl&&!Ml?(Ol=(Nl=new Kl).port2,Nl.port1.onmessage=Yl,Rl=Pt(Ol.postMessage,Ol,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts&&Vl&&"file:"!==Vl.protocol&&!d($l)?(Rl=$l,l.addEventListener("message",Yl,!1)):Rl=Gl in P("script")?function(e){tt.appendChild(P("script"))[Gl]=function(){tt.removeChild(this),Wl(e)}}:function(e){setTimeout(Xl(e),0)});var Zl,Jl,ed,td,rd,nd,id,ad,od={set:jl,clear:Fl},sd=L.f,cd=od.set,ud=l.MutationObserver||l.WebKitMutationObserver,ld=l.document,dd=l.process,fd=l.Promise,pd=sd(l,"queueMicrotask"),hd=pd&&pd.value;hd||(Zl=function(){var e,t;for(vi&&(e=dd.domain)&&e.exit();Jl;){t=Jl.fn,Jl=Jl.next;try{t()}catch(e){throw Jl?td():ed=void 0,e}}ed=void 0,e&&e.enter()},!Ml&&!vi&&ud&&ld?(rd=!0,nd=ld.createTextNode(""),new ud(Zl).observe(nd,{characterData:!0}),td=function(){nd.data=rd=!rd}):fd&&fd.resolve?(id=fd.resolve(void 0),ad=id.then,td=function(){ad.call(id,Zl)}):td=vi?function(){dd.nextTick(Zl)}:function(){cd.call(l,Zl)});var gd,md,yd,vd,bd=hd||function(e){var t={fn:e,next:void 0};ed&&(ed.next=t),Jl||(Jl=t,td()),ed=t},Cd=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n})),this.resolve=xt(t),this.reject=xt(r)},Ed=function(e){return new Cd(e)},wd={f:Ed},kd=function(e,t){if(D(e),B(t)&&t.constructor===e)return t;var r=wd.f(e);return(0,r.resolve)(t),r.promise},Sd=function(e,t){var r=l.console;r&&r.error&&(1===arguments.length?r.error(e):r.error(e,t))},Bd=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Td=od.set,Ad=wt("species"),Id="Promise",_d=ge.get,xd=ge.set,Pd=ge.getterFor(Id),Rd=Ll,Nd=l.TypeError,Od=l.document,Ld=l.process,Dd=be("fetch"),Ud=wd.f,Md=Ud,Vd=!!(Od&&Od.createEvent&&l.dispatchEvent),jd="function"==typeof PromiseRejectionEvent,Fd="unhandledrejection",zd="rejectionhandled",Kd=0,qd=1,Hd=2,Qd=1,Gd=2,Wd=Qe(Id,(function(){if(!(X(Rd)!==String(Rd))){if(66===un)return!0;if(!vi&&!jd)return!0}if(un>=51&&/native code/.test(Rd))return!1;var e=Rd.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[Ad]=t,!(e.then((function(){}))instanceof t)})),Xd=Wd||!Jr((function(e){Rd.all(e).catch((function(){}))})),Yd=function(e){var t;return!(!B(e)||"function"!=typeof(t=e.then))&&t},$d=function(e,t){if(!e.notified){e.notified=!0;var r=e.reactions;bd((function(){for(var n=e.value,i=e.state==qd,a=0;r.length>a;){var o,s,c,u=r[a++],l=i?u.ok:u.fail,d=u.resolve,f=u.reject,p=u.domain;try{l?(i||(e.rejection===Gd&&tf(e),e.rejection=Qd),!0===l?o=n:(p&&p.enter(),o=l(n),p&&(p.exit(),c=!0)),o===u.promise?f(Nd("Promise-chain cycle")):(s=Yd(o))?s.call(o,d,f):d(o)):f(n)}catch(e){p&&!c&&p.exit(),f(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&Jd(e)}))}},Zd=function(e,t,r){var n,i;Vd?((n=Od.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),l.dispatchEvent(n)):n={promise:t,reason:r},!jd&&(i=l["on"+e])?i(n):e===Fd&&Sd("Unhandled promise rejection",r)},Jd=function(e){Td.call(l,(function(){var t,r=e.facade,n=e.value;if(ef(e)&&(t=Bd((function(){vi?Ld.emit("unhandledRejection",n,r):Zd(Fd,r,n)})),e.rejection=vi||ef(e)?Gd:Qd,t.error))throw t.value}))},ef=function(e){return e.rejection!==Qd&&!e.parent},tf=function(e){Td.call(l,(function(){var t=e.facade;vi?Ld.emit("rejectionHandled",t):Zd(zd,t,e.value)}))},rf=function(e,t,r){return function(n){e(t,n,r)}},nf=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=Hd,$d(e,!0))},af=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw Nd("Promise can't be resolved itself");var n=Yd(t);n?bd((function(){var r={done:!1};try{n.call(t,rf(af,r,e),rf(nf,r,e))}catch(t){nf(r,t,e)}})):(e.value=t,e.state=qd,$d(e,!1))}catch(t){nf({done:!1},t,e)}}};Wd&&(Rd=function(e){Ul(this,Rd,Id),xt(e),gd.call(this);var t=_d(this);try{e(rf(af,t),rf(nf,t))}catch(e){nf(t,e)}},(gd=function(e){xd(this,{type:Id,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:Kd,value:void 0})}).prototype=Dl(Rd.prototype,{then:function(e,t){var r=Pd(this),n=Ud(ts(this,Rd));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=vi?Ld.domain:void 0,r.parent=!0,r.reactions.push(n),r.state!=Kd&&$d(r,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),md=function(){var e=new gd,t=_d(e);this.promise=e,this.resolve=rf(af,t),this.reject=rf(nf,t)},wd.f=Ud=function(e){return e===Rd||e===yd?new md(e):Md(e)},"function"==typeof Ll&&(vd=Ll.prototype.then,me(Ll.prototype,"then",(function(e,t){var r=this;return new Rd((function(e,t){vd.call(r,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof Dd&&We({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return kd(Rd,Dd.apply(l,arguments))}}))),We({global:!0,wrap:!0,forced:Wd},{Promise:Rd}),_t(Rd,Id,!1),Yi(Id),yd=be(Id),We({target:Id,stat:!0,forced:Wd},{reject:function(e){var t=Ud(this);return t.reject.call(void 0,e),t.promise}}),We({target:Id,stat:!0,forced:Wd},{resolve:function(e){return kd(this,e)}}),We({target:Id,stat:!0,forced:Xd},{all:function(e){var t=this,r=Ud(t),n=r.resolve,i=r.reject,a=Bd((function(){var r=xt(t.resolve),a=[],o=0,s=1;qr(e,(function(e){var c=o++,u=!1;a.push(void 0),s++,r.call(t,e).then((function(e){u||(u=!0,a[c]=e,--s||n(a))}),i)})),--s||n(a)}));return a.error&&i(a.value),r.promise},race:function(e){var t=this,r=Ud(t),n=r.reject,i=Bd((function(){var i=xt(t.resolve);qr(e,(function(e){i.call(t,e).then(r.resolve,n)}))}));return i.error&&n(i.value),r.promise}}),We({target:"Promise",stat:!0},{allSettled:function(e){var t=this,r=wd.f(t),n=r.resolve,i=r.reject,a=Bd((function(){var r=xt(t.resolve),i=[],a=0,o=1;qr(e,(function(e){var s=a++,c=!1;i.push(void 0),o++,r.call(t,e).then((function(e){c||(c=!0,i[s]={status:"fulfilled",value:e},--o||n(i))}),(function(e){c||(c=!0,i[s]={status:"rejected",reason:e},--o||n(i))}))})),--o||n(i)}));return a.error&&i(a.value),r.promise}});var of="No one promise resolved";We({target:"Promise",stat:!0},{any:function(e){var t=this,r=wd.f(t),n=r.resolve,i=r.reject,a=Bd((function(){var r=xt(t.resolve),a=[],o=0,s=1,c=!1;qr(e,(function(e){var u=o++,l=!1;a.push(void 0),s++,r.call(t,e).then((function(e){l||c||(c=!0,n(e))}),(function(e){l||c||(l=!0,a[u]=e,--s||i(new(be("AggregateError"))(a,of)))}))})),--s||i(new(be("AggregateError"))(a,of))}));return a.error&&i(a.value),r.promise}});var sf=!!Ll&&d((function(){Ll.prototype.finally.call({then:function(){}},(function(){}))}));We({target:"Promise",proto:!0,real:!0,forced:sf},{finally:function(e){var t=ts(this,be("Promise")),r="function"==typeof e;return this.then(r?function(r){return kd(t,e()).then((function(){return r}))}:e,r?function(r){return kd(t,e()).then((function(){throw r}))}:e)}}),"function"!=typeof Ll||Ll.prototype.finally||me(Ll.prototype,"finally",be("Promise").prototype.finally);var cf=function(e,t,r){var n=-1!==e.indexOf("Map"),i=-1!==e.indexOf("Weak"),a=n?"set":"add",o=l[e],s=o&&o.prototype,c=o,u={},f=function(e){var t=s[e];me(s,e,"add"==e?function(e){return t.call(this,0===e?0:e),this}:"delete"==e?function(e){return!(i&&!B(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return i&&!B(e)?void 0:t.call(this,0===e?0:e)}:"has"==e?function(e){return!(i&&!B(e))&&t.call(this,0===e?0:e)}:function(e,r){return t.call(this,0===e?0:e,r),this})};if(Qe(e,"function"!=typeof o||!(i||s.forEach&&!d((function(){(new o).entries().next()})))))c=r.getConstructor(t,e,n,a),Ma.REQUIRED=!0;else if(Qe(e,!0)){var p=new c,h=p[a](i?{}:-0,1)!=p,g=d((function(){p.has(1)})),m=Jr((function(e){new o(e)})),y=!i&&d((function(){for(var e=new o,t=5;t--;)e[a](t,t);return!e.has(-0)}));m||((c=t((function(t,r){Ul(t,c,e);var i=oc(new o,t,c);return null!=r&&qr(r,i[a],{that:i,AS_ENTRIES:n}),i}))).prototype=s,s.constructor=c),(g||y)&&(f("delete"),f("has"),n&&f("get")),(y||h)&&f(a),i&&s.clear&&delete s.clear}return u[e]=c,We({global:!0,forced:c!=o},u),_t(c,e),i||r.setStrong(c,e,n),c},uf=V.f,lf=Ma.fastKey,df=ge.set,ff=ge.getterFor,pf={getConstructor:function(e,t,r,n){var i=e((function(e,a){Ul(e,i,t),df(e,{type:t,index:ft(null),first:void 0,last:void 0,size:0}),f||(e.size=0),null!=a&&qr(a,e[n],{that:e,AS_ENTRIES:r})})),a=ff(t),o=function(e,t,r){var n,i,o=a(e),c=s(e,t);return c?c.value=r:(o.last=c={index:i=lf(t,!0),key:t,value:r,previous:n=o.last,next:void 0,removed:!1},o.first||(o.first=c),n&&(n.next=c),f?o.size++:e.size++,"F"!==i&&(o.index[i]=c)),e},s=function(e,t){var r,n=a(e),i=lf(t);if("F"!==i)return n.index[i];for(r=n.first;r;r=r.next)if(r.key==t)return r};return Dl(i.prototype,{clear:function(){for(var e=a(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,f?e.size=0:this.size=0},delete:function(e){var t=this,r=a(t),n=s(t,e);if(n){var i=n.next,o=n.previous;delete r.index[n.index],n.removed=!0,o&&(o.next=i),i&&(i.previous=o),r.first==n&&(r.first=i),r.last==n&&(r.last=o),f?r.size--:t.size--}return!!n},forEach:function(e){for(var t,r=a(this),n=Pt(e,arguments.length>1?arguments[1]:void 0,3);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!s(this,e)}}),Dl(i.prototype,r?{get:function(e){var t=s(this,e);return t&&t.value},set:function(e,t){return o(this,0===e?0:e,t)}}:{add:function(e){return o(this,e=0===e?0:e,e)}}),f&&uf(i.prototype,"size",{get:function(){return a(this).size}}),i},setStrong:function(e,t,r){var n=t+" Iterator",i=ff(t),a=ff(n);ha(e,t,(function(e,t){df(this,{type:n,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=a(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?"keys"==t?{value:r.key,done:!1}:"values"==t?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})}),r?"entries":"values",!r,!0),Yi(t)}},hf=(cf("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),pf),cf("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),pf),Ma.getWeakData),gf=ge.set,mf=ge.getterFor,yf=Dt.find,vf=Dt.findIndex,bf=0,Cf=function(e){return e.frozen||(e.frozen=new Ef)},Ef=function(){this.entries=[]},wf=function(e,t){return yf(e.entries,(function(e){return e[0]===t}))};Ef.prototype={get:function(e){var t=wf(this,e);if(t)return t[1]},has:function(e){return!!wf(this,e)},set:function(e,t){var r=wf(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(e){var t=vf(this.entries,(function(t){return t[0]===e}));return~t&&this.entries.splice(t,1),!!~t}};var kf={getConstructor:function(e,t,r,n){var i=e((function(e,a){Ul(e,i,t),gf(e,{type:t,id:bf++,frozen:void 0}),null!=a&&qr(a,e[n],{that:e,AS_ENTRIES:r})})),a=mf(t),o=function(e,t,r){var n=a(e),i=hf(D(t),!0);return!0===i?Cf(n).set(t,r):i[n.id]=r,e};return Dl(i.prototype,{delete:function(e){var t=a(this);if(!B(e))return!1;var r=hf(e);return!0===r?Cf(t).delete(e):r&&I(r,t.id)&&delete r[t.id]},has:function(e){var t=a(this);if(!B(e))return!1;var r=hf(e);return!0===r?Cf(t).has(e):r&&I(r,t.id)}}),Dl(i.prototype,r?{get:function(e){var t=a(this);if(B(e)){var r=hf(e);return!0===r?Cf(t).get(e):r?r[t.id]:void 0}},set:function(e,t){return o(this,e,t)}}:{add:function(e){return o(this,e,!0)}}),i}};s((function(e){var t,r=ge.enforce,n=!l.ActiveXObject&&"ActiveXObject"in l,i=Object.isExtensible,a=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},o=e.exports=cf("WeakMap",a,kf);if($&&n){t=kf.getConstructor(a,"WeakMap",!0),Ma.REQUIRED=!0;var s=o.prototype,c=s.delete,u=s.has,d=s.get,f=s.set;Dl(s,{delete:function(e){if(B(e)&&!i(e)){var n=r(this);return n.frozen||(n.frozen=new t),c.call(this,e)||n.frozen.delete(e)}return c.call(this,e)},has:function(e){if(B(e)&&!i(e)){var n=r(this);return n.frozen||(n.frozen=new t),u.call(this,e)||n.frozen.has(e)}return u.call(this,e)},get:function(e){if(B(e)&&!i(e)){var n=r(this);return n.frozen||(n.frozen=new t),u.call(this,e)?d.call(this,e):n.frozen.get(e)}return d.call(this,e)},set:function(e,n){if(B(e)&&!i(e)){var a=r(this);a.frozen||(a.frozen=new t),u.call(this,e)?f.call(this,e,n):a.frozen.set(e,n)}else f.call(this,e,n);return this}})}}));cf("WeakSet",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),kf);var Sf="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,Bf=function(e){if(void 0===e)return 0;var t=we(e),r=Se(t);if(t!==r)throw RangeError("Wrong length or index");return r},Tf=1/0,Af=Math.abs,If=Math.pow,_f=Math.floor,xf=Math.log,Pf=Math.LN2,Rf=function(e,t,r){var n,i,a,o=new Array(r),s=8*r-t-1,c=(1<<s)-1,u=c>>1,l=23===t?If(2,-24)-If(2,-77):0,d=e<0||0===e&&1/e<0?1:0,f=0;for((e=Af(e))!=e||e===Tf?(i=e!=e?1:0,n=c):(n=_f(xf(e)/Pf),e*(a=If(2,-n))<1&&(n--,a*=2),(e+=n+u>=1?l/a:l*If(2,1-u))*a>=2&&(n++,a/=2),n+u>=c?(i=0,n=c):n+u>=1?(i=(e*a-1)*If(2,t),n+=u):(i=e*If(2,u-1)*If(2,t),n=0));t>=8;o[f++]=255&i,i/=256,t-=8);for(n=n<<t|i,s+=t;s>0;o[f++]=255&n,n/=256,s-=8);return o[--f]|=128*d,o},Nf=function(e,t){var r,n=e.length,i=8*n-t-1,a=(1<<i)-1,o=a>>1,s=i-7,c=n-1,u=e[c--],l=127&u;for(u>>=7;s>0;l=256*l+e[c],c--,s-=8);for(r=l&(1<<-s)-1,l>>=-s,s+=t;s>0;r=256*r+e[c],c--,s-=8);if(0===l)l=1-o;else{if(l===a)return r?NaN:u?-Tf:Tf;r+=If(2,t),l-=o}return(u?-1:1)*r*If(2,l-t)},Of={pack:Rf,unpack:Nf},Lf=Le.f,Df=V.f,Uf=ge.get,Mf=ge.set,Vf="ArrayBuffer",jf="DataView",Ff="prototype",zf="Wrong length",Kf="Wrong index",qf=l[Vf],Hf=qf,Qf=l[jf],Gf=Qf&&Qf[Ff],Wf=Object.prototype,Xf=l.RangeError,Yf=Of.pack,$f=Of.unpack,Zf=function(e){return[255&e]},Jf=function(e){return[255&e,e>>8&255]},ep=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},tp=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},rp=function(e){return Yf(e,23,4)},np=function(e){return Yf(e,52,8)},ip=function(e,t){Df(e[Ff],t,{get:function(){return Uf(this)[t]}})},ap=function(e,t,r,n){var i=Bf(r),a=Uf(e);if(i+t>a.byteLength)throw Xf(Kf);var o=Uf(a.buffer).bytes,s=i+a.byteOffset,c=o.slice(s,s+t);return n?c:c.reverse()},op=function(e,t,r,n,i,a){var o=Bf(r),s=Uf(e);if(o+t>s.byteLength)throw Xf(Kf);for(var c=Uf(s.buffer).bytes,u=o+s.byteOffset,l=n(+i),d=0;d<t;d++)c[u+d]=l[a?d:t-d-1]};if(Sf){if(!d((function(){qf(1)}))||!d((function(){new qf(-1)}))||d((function(){return new qf,new qf(1.5),new qf(NaN),qf.name!=Vf}))){for(var sp,cp=(Hf=function(e){return Ul(this,Hf),new qf(Bf(e))})[Ff]=qf[Ff],up=Lf(qf),lp=0;up.length>lp;)(sp=up[lp++])in Hf||j(Hf,sp,qf[sp]);cp.constructor=Hf}Ir&&Tr(Gf)!==Wf&&Ir(Gf,Wf);var dp=new Qf(new Hf(2)),fp=Gf.setInt8;dp.setInt8(0,2147483648),dp.setInt8(1,2147483649),!dp.getInt8(0)&&dp.getInt8(1)||Dl(Gf,{setInt8:function(e,t){fp.call(this,e,t<<24>>24)},setUint8:function(e,t){fp.call(this,e,t<<24>>24)}},{unsafe:!0})}else Hf=function(e){Ul(this,Hf,Vf);var t=Bf(e);Mf(this,{bytes:Rn.call(new Array(t),0),byteLength:t}),f||(this.byteLength=t)},Qf=function(e,t,r){Ul(this,Qf,jf),Ul(e,Hf,jf);var n=Uf(e).byteLength,i=we(t);if(i<0||i>n)throw Xf("Wrong offset");if(i+(r=void 0===r?n-i:Se(r))>n)throw Xf(zf);Mf(this,{buffer:e,byteLength:r,byteOffset:i}),f||(this.buffer=e,this.byteLength=r,this.byteOffset=i)},f&&(ip(Hf,"byteLength"),ip(Qf,"buffer"),ip(Qf,"byteLength"),ip(Qf,"byteOffset")),Dl(Qf[Ff],{getInt8:function(e){return ap(this,1,e)[0]<<24>>24},getUint8:function(e){return ap(this,1,e)[0]},getInt16:function(e){var t=ap(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=ap(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return tp(ap(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return tp(ap(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return $f(ap(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return $f(ap(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){op(this,1,e,Zf,t)},setUint8:function(e,t){op(this,1,e,Zf,t)},setInt16:function(e,t){op(this,2,e,Jf,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){op(this,2,e,Jf,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){op(this,4,e,ep,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){op(this,4,e,ep,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){op(this,4,e,rp,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){op(this,8,e,np,t,arguments.length>2?arguments[2]:void 0)}});_t(Hf,Vf),_t(Qf,jf);var pp={ArrayBuffer:Hf,DataView:Qf},hp="ArrayBuffer",gp=pp[hp],mp=l[hp];We({global:!0,forced:mp!==gp},{ArrayBuffer:gp}),Yi(hp);var yp,vp=V.f,bp=l.Int8Array,Cp=bp&&bp.prototype,Ep=l.Uint8ClampedArray,wp=Ep&&Ep.prototype,kp=bp&&Tr(bp),Sp=Cp&&Tr(Cp),Bp=Object.prototype,Tp=Bp.isPrototypeOf,Ap=wt("toStringTag"),Ip=re("TYPED_ARRAY_TAG"),_p=Sf&&!!Ir&&"Opera"!==Vr(l.opera),xp=!1,Pp={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Rp={BigInt64Array:8,BigUint64Array:8},Np=function(e){if(!B(e))return!1;var t=Vr(e);return"DataView"===t||I(Pp,t)||I(Rp,t)},Op=function(e){if(!B(e))return!1;var t=Vr(e);return I(Pp,t)||I(Rp,t)},Lp=function(e){if(Op(e))return e;throw TypeError("Target is not a typed array")},Dp=function(e){if(Ir){if(Tp.call(kp,e))return e}else for(var t in Pp)if(I(Pp,yp)){var r=l[t];if(r&&(e===r||Tp.call(r,e)))return e}throw TypeError("Target is not a typed array constructor")},Up=function(e,t,r){if(f){if(r)for(var n in Pp){var i=l[n];i&&I(i.prototype,e)&&delete i.prototype[e]}Sp[e]&&!r||me(Sp,e,r?t:_p&&Cp[e]||t)}},Mp=function(e,t,r){var n,i;if(f){if(Ir){if(r)for(n in Pp)(i=l[n])&&I(i,e)&&delete i[e];if(kp[e]&&!r)return;try{return me(kp,e,r?t:_p&&bp[e]||t)}catch(e){}}for(n in Pp)!(i=l[n])||i[e]&&!r||me(i,e,t)}};for(yp in Pp)l[yp]||(_p=!1);if((!_p||"function"!=typeof kp||kp===Function.prototype)&&(kp=function(){throw TypeError("Incorrect invocation")},_p))for(yp in Pp)l[yp]&&Ir(l[yp],kp);if((!_p||!Sp||Sp===Bp)&&(Sp=kp.prototype,_p))for(yp in Pp)l[yp]&&Ir(l[yp].prototype,Sp);if(_p&&Tr(wp)!==Sp&&Ir(wp,Sp),f&&!I(Sp,Ap))for(yp in xp=!0,vp(Sp,Ap,{get:function(){return B(this)?this[Ip]:void 0}}),Pp)l[yp]&&j(l[yp],Ip,yp);var Vp={NATIVE_ARRAY_BUFFER_VIEWS:_p,TYPED_ARRAY_TAG:xp&&Ip,aTypedArray:Lp,aTypedArrayConstructor:Dp,exportTypedArrayMethod:Up,exportTypedArrayStaticMethod:Mp,isView:Np,isTypedArray:Op,TypedArray:kp,TypedArrayPrototype:Sp},jp=Vp.NATIVE_ARRAY_BUFFER_VIEWS;We({target:"ArrayBuffer",stat:!0,forced:!jp},{isView:Vp.isView});var Fp=pp.ArrayBuffer,zp=pp.DataView,Kp=Fp.prototype.slice,qp=d((function(){return!new Fp(2).slice(1,void 0).byteLength}));We({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:qp},{slice:function(e,t){if(void 0!==Kp&&void 0===t)return Kp.call(D(this),e);for(var r=D(this).byteLength,n=Ae(e,r),i=Ae(void 0===t?r:t,r),a=new(ts(this,Fp))(Se(i-n)),o=new zp(this),s=new zp(a),c=0;n<i;)s.setUint8(c++,o.getUint8(n++));return a}}),We({global:!0,forced:!Sf},{DataView:pp.DataView});var Hp=Vp.NATIVE_ARRAY_BUFFER_VIEWS,Qp=l.ArrayBuffer,Gp=l.Int8Array,Wp=!Hp||!d((function(){Gp(1)}))||!d((function(){new Gp(-1)}))||!Jr((function(e){new Gp,new Gp(null),new Gp(1.5),new Gp(e)}),!0)||d((function(){return 1!==new Gp(new Qp(2),1,void 0).length})),Xp=function(e){var t=we(e);if(t<0)throw RangeError("The argument can't be less than 0");return t},Yp=function(e,t){var r=Xp(e);if(r%t)throw RangeError("Wrong offset");return r},$p=Vp.aTypedArrayConstructor,Zp=function(e){var t,r,n,i,a,o,s=Ze(e),c=arguments.length,u=c>1?arguments[1]:void 0,l=void 0!==u,d=Fr(s);if(null!=d&&!Rr(d))for(o=(a=d.call(s)).next,s=[];!(i=o.call(a)).done;)s.push(i.value);for(l&&c>2&&(u=Pt(u,arguments[2],2)),r=Se(s.length),n=new($p(this))(r),t=0;r>t;t++)n[t]=l?u(s[t],t):s[t];return n},Jp=s((function(e){var t=Le.f,r=Dt.forEach,n=ge.get,i=ge.set,a=V.f,o=L.f,s=Math.round,c=l.RangeError,u=pp.ArrayBuffer,d=pp.DataView,p=Vp.NATIVE_ARRAY_BUFFER_VIEWS,h=Vp.TYPED_ARRAY_TAG,g=Vp.TypedArray,m=Vp.TypedArrayPrototype,y=Vp.aTypedArrayConstructor,b=Vp.isTypedArray,C="BYTES_PER_ELEMENT",E="Wrong length",w=function(e,t){for(var r=0,n=t.length,i=new(y(e))(n);n>r;)i[r]=t[r++];return i},k=function(e,t){a(e,t,{get:function(){return n(this)[t]}})},S=function(e){var t;return e instanceof u||"ArrayBuffer"==(t=Vr(e))||"SharedArrayBuffer"==t},A=function(e,t){return b(e)&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)},_=function(e,t){return A(e,t=T(t,!0))?v(2,e[t]):o(e,t)},x=function(e,t,r){return!(A(e,t=T(t,!0))&&B(r)&&I(r,"value"))||I(r,"get")||I(r,"set")||r.configurable||I(r,"writable")&&!r.writable||I(r,"enumerable")&&!r.enumerable?a(e,t,r):(e[t]=r.value,e)};f?(p||(L.f=_,V.f=x,k(m,"buffer"),k(m,"byteOffset"),k(m,"byteLength"),k(m,"length")),We({target:"Object",stat:!0,forced:!p},{getOwnPropertyDescriptor:_,defineProperty:x}),e.exports=function(e,o,f){var y=e.match(/\d+$/)[0]/8,v=e+(f?"Clamped":"")+"Array",k="get"+e,T="set"+e,A=l[v],I=A,_=I&&I.prototype,x={},P=function(e,t){a(e,t,{get:function(){return function(e,t){var r=n(e);return r.view[k](t*y+r.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,r){var i=n(e);f&&(r=(r=s(r))<0?0:r>255?255:255&r),i.view[T](t*y+i.byteOffset,r,!0)}(this,t,e)},enumerable:!0})};p?Wp&&(I=o((function(e,t,r,n){return Ul(e,I,v),oc(B(t)?S(t)?void 0!==n?new A(t,Yp(r,y),n):void 0!==r?new A(t,Yp(r,y)):new A(t):b(t)?w(I,t):Zp.call(I,t):new A(Bf(t)),e,I)})),Ir&&Ir(I,g),r(t(A),(function(e){e in I||j(I,e,A[e])})),I.prototype=_):(I=o((function(e,t,r,n){Ul(e,I,v);var a,o,s,l=0,f=0;if(B(t)){if(!S(t))return b(t)?w(I,t):Zp.call(I,t);a=t,f=Yp(r,y);var p=t.byteLength;if(void 0===n){if(p%y)throw c(E);if((o=p-f)<0)throw c(E)}else if((o=Se(n)*y)+f>p)throw c(E);s=o/y}else s=Bf(t),a=new u(o=s*y);for(i(e,{buffer:a,byteOffset:f,byteLength:o,length:s,view:new d(a)});l<s;)P(e,l++)})),Ir&&Ir(I,g),_=I.prototype=ft(m)),_.constructor!==I&&j(_,"constructor",I),h&&j(_,h,v),x[v]=I,We({global:!0,forced:I!=A,sham:!p},x),C in I||j(I,C,y),C in _||j(_,C,y),Yi(v)}):e.exports=function(){}}));Jp("Int8",(function(e){return function(t,r,n){return e(this,t,r,n)}})),Jp("Uint8",(function(e){return function(t,r,n){return e(this,t,r,n)}})),Jp("Uint8",(function(e){return function(t,r,n){return e(this,t,r,n)}}),!0),Jp("Int16",(function(e){return function(t,r,n){return e(this,t,r,n)}})),Jp("Uint16",(function(e){return function(t,r,n){return e(this,t,r,n)}})),Jp("Int32",(function(e){return function(t,r,n){return e(this,t,r,n)}})),Jp("Uint32",(function(e){return function(t,r,n){return e(this,t,r,n)}})),Jp("Float32",(function(e){return function(t,r,n){return e(this,t,r,n)}})),Jp("Float64",(function(e){return function(t,r,n){return e(this,t,r,n)}}));var eh=Vp.exportTypedArrayStaticMethod;eh("from",Zp,Wp);var th=Vp.aTypedArrayConstructor,rh=Vp.exportTypedArrayStaticMethod;rh("of",(function(){for(var e=0,t=arguments.length,r=new(th(this))(t);t>e;)r[e]=arguments[e++];return r}),Wp);var nh=Vp.aTypedArray,ih=Vp.exportTypedArrayMethod;ih("copyWithin",(function(e,t){return Cn.call(nh(this),e,t,arguments.length>2?arguments[2]:void 0)}));var ah=Dt.every,oh=Vp.aTypedArray,sh=Vp.exportTypedArrayMethod;sh("every",(function(e){return ah(oh(this),e,arguments.length>1?arguments[1]:void 0)}));var ch=Vp.aTypedArray,uh=Vp.exportTypedArrayMethod;uh("fill",(function(e){return Rn.apply(ch(this),arguments)}));var lh=Dt.filter,dh=Vp.aTypedArray,fh=Vp.aTypedArrayConstructor,ph=Vp.exportTypedArrayMethod;ph("filter",(function(e){for(var t=lh(dh(this),e,arguments.length>1?arguments[1]:void 0),r=ts(this,this.constructor),n=0,i=t.length,a=new(fh(r))(i);i>n;)a[n]=t[n++];return a}));var hh=Dt.find,gh=Vp.aTypedArray,mh=Vp.exportTypedArrayMethod;mh("find",(function(e){return hh(gh(this),e,arguments.length>1?arguments[1]:void 0)}));var yh=Dt.findIndex,vh=Vp.aTypedArray,bh=Vp.exportTypedArrayMethod;bh("findIndex",(function(e){return yh(vh(this),e,arguments.length>1?arguments[1]:void 0)}));var Ch=Dt.forEach,Eh=Vp.aTypedArray,wh=Vp.exportTypedArrayMethod;wh("forEach",(function(e){Ch(Eh(this),e,arguments.length>1?arguments[1]:void 0)}));var kh=_e.includes,Sh=Vp.aTypedArray,Bh=Vp.exportTypedArrayMethod;Bh("includes",(function(e){return kh(Sh(this),e,arguments.length>1?arguments[1]:void 0)}));var Th=_e.indexOf,Ah=Vp.aTypedArray,Ih=Vp.exportTypedArrayMethod;Ih("indexOf",(function(e){return Th(Ah(this),e,arguments.length>1?arguments[1]:void 0)}));var _h=wt("iterator"),xh=l.Uint8Array,Ph=va.values,Rh=va.keys,Nh=va.entries,Oh=Vp.aTypedArray,Lh=Vp.exportTypedArrayMethod,Dh=xh&&xh.prototype[_h],Uh=!!Dh&&("values"==Dh.name||null==Dh.name),Mh=function(){return Ph.call(Oh(this))};Lh("entries",(function(){return Nh.call(Oh(this))})),Lh("keys",(function(){return Rh.call(Oh(this))})),Lh("values",Mh,!Uh),Lh(_h,Mh,!Uh);var Vh=Vp.aTypedArray,jh=Vp.exportTypedArrayMethod,Fh=[].join;jh("join",(function(e){return Fh.apply(Vh(this),arguments)}));var zh=Vp.aTypedArray,Kh=Vp.exportTypedArrayMethod;Kh("lastIndexOf",(function(e){return fi.apply(zh(this),arguments)}));var qh=Dt.map,Hh=Vp.aTypedArray,Qh=Vp.aTypedArrayConstructor,Gh=Vp.exportTypedArrayMethod;Gh("map",(function(e){return qh(Hh(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(Qh(ts(e,e.constructor)))(t)}))}));var Wh=yi.left,Xh=Vp.aTypedArray,Yh=Vp.exportTypedArrayMethod;Yh("reduce",(function(e){return Wh(Xh(this),e,arguments.length,arguments.length>1?arguments[1]:void 0)}));var $h=yi.right,Zh=Vp.aTypedArray,Jh=Vp.exportTypedArrayMethod;Jh("reduceRight",(function(e){return $h(Zh(this),e,arguments.length,arguments.length>1?arguments[1]:void 0)}));var eg=Vp.aTypedArray,tg=Vp.exportTypedArrayMethod,rg=Math.floor;tg("reverse",(function(){for(var e,t=this,r=eg(t).length,n=rg(r/2),i=0;i<n;)e=t[i],t[i++]=t[--r],t[r]=e;return t}));var ng=Vp.aTypedArray,ig=Vp.exportTypedArrayMethod,ag=d((function(){new Int8Array(1).set({})}));ig("set",(function(e){ng(this);var t=Yp(arguments.length>1?arguments[1]:void 0,1),r=this.length,n=Ze(e),i=Se(n.length),a=0;if(i+t>r)throw RangeError("Wrong length");for(;a<i;)this[t+a]=n[a++]}),ag);var og=Vp.aTypedArray,sg=Vp.aTypedArrayConstructor,cg=Vp.exportTypedArrayMethod,ug=[].slice,lg=d((function(){new Int8Array(1).slice()}));cg("slice",(function(e,t){for(var r=ug.call(og(this),e,t),n=ts(this,this.constructor),i=0,a=r.length,o=new(sg(n))(a);a>i;)o[i]=r[i++];return o}),lg);var dg=Dt.some,fg=Vp.aTypedArray,pg=Vp.exportTypedArrayMethod;pg("some",(function(e){return dg(fg(this),e,arguments.length>1?arguments[1]:void 0)}));var hg=Vp.aTypedArray,gg=Vp.exportTypedArrayMethod,mg=[].sort;gg("sort",(function(e){return mg.call(hg(this),e)}));var yg=Vp.aTypedArray,vg=Vp.exportTypedArrayMethod;vg("subarray",(function(e,t){var r=yg(this),n=r.length,i=Ae(e,n);return new(ts(r,r.constructor))(r.buffer,r.byteOffset+i*r.BYTES_PER_ELEMENT,Se((void 0===t?n:Ae(t,n))-i))}));var bg=l.Int8Array,Cg=Vp.aTypedArray,Eg=Vp.exportTypedArrayMethod,wg=[].toLocaleString,kg=[].slice,Sg=!!bg&&d((function(){wg.call(new bg(1))})),Bg=d((function(){return[1,2].toLocaleString()!=new bg([1,2]).toLocaleString()}))||!d((function(){bg.prototype.toLocaleString.call([1,2])}));Eg("toLocaleString",(function(){return wg.apply(Sg?kg.call(Cg(this)):Cg(this),arguments)}),Bg);var Tg=Vp.exportTypedArrayMethod,Ag=l.Uint8Array,Ig=Ag&&Ag.prototype||{},_g=[].toString,xg=[].join;d((function(){_g.call({})}))&&(_g=function(){return xg.call(this)});var Pg=Ig.toString!=_g;Tg("toString",_g,Pg);var Rg=be("Reflect","apply"),Ng=Function.apply,Og=!d((function(){Rg((function(){}))}));We({target:"Reflect",stat:!0,forced:Og},{apply:function(e,t,r){return xt(e),D(r),Rg?Rg(e,t,r):Ng.call(e,t,r)}});var Lg=be("Reflect","construct"),Dg=d((function(){function e(){}return!(Lg((function(){}),[],e)instanceof e)})),Ug=!d((function(){Lg((function(){}))})),Mg=Dg||Ug;We({target:"Reflect",stat:!0,forced:Mg,sham:Mg},{construct:function(e,t){xt(e),D(t);var r=arguments.length<3?e:xt(arguments[2]);if(Ug&&!Dg)return Lg(e,t,r);if(e==r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var n=[null];return n.push.apply(n,t),new(wa.apply(e,n))}var i=r.prototype,a=ft(B(i)?i:Object.prototype),o=Function.apply.call(e,a,t);return B(o)?o:a}});var Vg=d((function(){Reflect.defineProperty(V.f({},1,{value:1}),1,{value:2})}));We({target:"Reflect",stat:!0,forced:Vg,sham:!f},{defineProperty:function(e,t,r){D(e);var n=T(t,!0);D(r);try{return V.f(e,n,r),!0}catch(e){return!1}}});var jg=L.f;function Fg(e,t){var r,n,i=arguments.length<3?e:arguments[2];return D(e)===i?e[t]:(r=L.f(e,t))?I(r,"value")?r.value:void 0===r.get?void 0:r.get.call(i):B(n=Tr(e))?Fg(n,t,i):void 0}We({target:"Reflect",stat:!0},{deleteProperty:function(e,t){var r=jg(D(e),t);return!(r&&!r.configurable)&&delete e[t]}}),We({target:"Reflect",stat:!0},{get:Fg}),We({target:"Reflect",stat:!0,sham:!f},{getOwnPropertyDescriptor:function(e,t){return L.f(D(e),t)}}),We({target:"Reflect",stat:!0,sham:!kr},{getPrototypeOf:function(e){return Tr(D(e))}}),We({target:"Reflect",stat:!0},{has:function(e,t){return t in e}});var zg=Object.isExtensible;function Kg(e,t,r){var n,i,a=arguments.length<4?e:arguments[3],o=L.f(D(e),t);if(!o){if(B(i=Tr(e)))return Kg(i,t,r,a);o=v(0)}if(I(o,"value")){if(!1===o.writable||!B(a))return!1;if(n=L.f(a,t)){if(n.get||n.set||!1===n.writable)return!1;n.value=r,V.f(a,t,n)}else V.f(a,t,v(0,r));return!0}return void 0!==o.set&&(o.set.call(a,r),!0)}We({target:"Reflect",stat:!0},{isExtensible:function(e){return D(e),!zg||zg(e)}}),We({target:"Reflect",stat:!0},{ownKeys:Me}),We({target:"Reflect",stat:!0,sham:!Ua},{preventExtensions:function(e){D(e);try{var t=be("Object","preventExtensions");return t&&t(e),!0}catch(e){return!1}}});var qg=d((function(){var e=function(){},t=V.f(new e,"a",{configurable:!0});return!1!==Reflect.set(e.prototype,"a",1,t)}));We({target:"Reflect",stat:!0,forced:qg},{set:Kg}),Ir&&We({target:"Reflect",stat:!0},{setPrototypeOf:function(e,t){D(e),Ar(t);try{return Ir(e,t),!0}catch(e){return!1}}}),We({global:!0},{Reflect:{}}),_t(l.Reflect,"Reflect",!0);var Hg={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0};for(var Qg in Hg){var Gg=l[Qg],Wg=Gg&&Gg.prototype;if(Wg&&Wg.forEach!==Xn)try{j(Wg,"forEach",Xn)}catch(e){Wg.forEach=Xn}}var Xg=wt("iterator"),Yg=wt("toStringTag"),$g=va.values;for(var Zg in Hg){var Jg=l[Zg],em=Jg&&Jg.prototype;if(em){if(em[Xg]!==$g)try{j(em,Xg,$g)}catch(e){em[Xg]=$g}if(em[Yg]||j(em,Yg,Zg),Hg[Zg])for(var tm in va)if(em[tm]!==va[tm])try{j(em,tm,va[tm])}catch(e){em[tm]=va[tm]}}}var rm=!l.setImmediate||!l.clearImmediate;We({global:!0,bind:!0,enumerable:!0,forced:rm},{setImmediate:od.set,clearImmediate:od.clear});var nm=l.process;We({global:!0,enumerable:!0,noTargetGet:!0},{queueMicrotask:function(e){var t=vi&&nm.domain;bd(t?t.bind(e):e)}});var im=[].slice,am=/MSIE .\./.test(an),om=function(e){return function(t,r){var n=arguments.length>2,i=n?im.call(arguments,2):void 0;return e(n?function(){("function"==typeof t?t:Function(t)).apply(this,i)}:t,r)}};We({global:!0,bind:!0,forced:am},{setTimeout:om(l.setTimeout),setInterval:om(l.setInterval)});var sm=wt("iterator"),cm=!d((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,r="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),r+=n+e})),Z&&!e.toJSON||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[sm]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host})),um=2147483647,lm=36,dm=1,fm=26,pm=38,hm=700,gm=72,mm=128,ym="-",vm=/[^\0-\u007E]/,bm=/[.\u3002\uFF0E\uFF61]/g,Cm="Overflow: input needs wider integers to process",Em=lm-dm,wm=Math.floor,km=String.fromCharCode,Sm=function(e){for(var t=[],r=0,n=e.length;r<n;){var i=e.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){var a=e.charCodeAt(r++);56320==(64512&a)?t.push(((1023&i)<<10)+(1023&a)+65536):(t.push(i),r--)}else t.push(i)}return t},Bm=function(e){return e+22+75*(e<26)},Tm=function(e,t,r){var n=0;for(e=r?wm(e/hm):e>>1,e+=wm(e/t);e>Em*fm>>1;n+=lm)e=wm(e/Em);return wm(n+(Em+1)*e/(e+pm))},Am=function(e){var t,r,n=[],i=(e=Sm(e)).length,a=mm,o=0,s=gm;for(t=0;t<e.length;t++)(r=e[t])<128&&n.push(km(r));var c=n.length,u=c;for(c&&n.push(ym);u<i;){var l=um;for(t=0;t<e.length;t++)(r=e[t])>=a&&r<l&&(l=r);var d=u+1;if(l-a>wm((um-o)/d))throw RangeError(Cm);for(o+=(l-a)*d,a=l,t=0;t<e.length;t++){if((r=e[t])<a&&++o>um)throw RangeError(Cm);if(r==a){for(var f=o,p=lm;;p+=lm){var h=p<=s?dm:p>=s+fm?fm:p-s;if(f<h)break;var g=f-h,m=lm-h;n.push(km(Bm(h+g%m))),f=wm(g/m)}n.push(km(Bm(f))),s=Tm(o,d,u==c),o=0,++u}}++o,++a}return n.join("")},Im=function(e){var t,r,n=[],i=e.toLowerCase().replace(bm,".").split(".");for(t=0;t<i.length;t++)r=i[t],n.push(vm.test(r)?"xn--"+Am(r):r);return n.join(".")},_m=function(e){var t=Fr(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return D(t.call(e))},xm=be("fetch"),Pm=be("Headers"),Rm=wt("iterator"),Nm="URLSearchParams",Om=Nm+"Iterator",Lm=ge.set,Dm=ge.getterFor(Nm),Um=ge.getterFor(Om),Mm=/\+/g,Vm=Array(4),jm=function(e){return Vm[e-1]||(Vm[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},Fm=function(e){try{return decodeURIComponent(e)}catch(t){return e}},zm=function(e){var t=e.replace(Mm," "),r=4;try{return decodeURIComponent(t)}catch(e){for(;r;)t=t.replace(jm(r--),Fm);return t}},Km=/[!'()~]|%20/g,qm={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Hm=function(e){return qm[e]},Qm=function(e){return encodeURIComponent(e).replace(Km,Hm)},Gm=function(e,t){if(t)for(var r,n,i=t.split("&"),a=0;a<i.length;)(r=i[a++]).length&&(n=r.split("="),e.push({key:zm(n.shift()),value:zm(n.join("="))}))},Wm=function(e){this.entries.length=0,Gm(this.entries,e)},Xm=function(e,t){if(e<t)throw TypeError("Not enough arguments")},Ym=oa((function(e,t){Lm(this,{type:Om,iterator:_m(Dm(e).entries),kind:t})}),"Iterator",(function(){var e=Um(this),t=e.kind,r=e.iterator.next(),n=r.value;return r.done||(r.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]),r})),$m=function(){Ul(this,$m,Nm);var e,t,r,n,i,a,o,s,c,u=arguments.length>0?arguments[0]:void 0,l=this,d=[];if(Lm(l,{type:Nm,entries:d,updateURL:function(){},updateSearchParams:Wm}),void 0!==u)if(B(u))if("function"==typeof(e=Fr(u)))for(r=(t=e.call(u)).next;!(n=r.call(t)).done;){if((o=(a=(i=_m(D(n.value))).next).call(i)).done||(s=a.call(i)).done||!a.call(i).done)throw TypeError("Expected sequence with length 2");d.push({key:o.value+"",value:s.value+""})}else for(c in u)I(u,c)&&d.push({key:c,value:u[c]+""});else Gm(d,"string"==typeof u?"?"===u.charAt(0)?u.slice(1):u:u+"")},Zm=$m.prototype;Dl(Zm,{append:function(e,t){Xm(arguments.length,2);var r=Dm(this);r.entries.push({key:e+"",value:t+""}),r.updateURL()},delete:function(e){Xm(arguments.length,1);for(var t=Dm(this),r=t.entries,n=e+"",i=0;i<r.length;)r[i].key===n?r.splice(i,1):i++;t.updateURL()},get:function(e){Xm(arguments.length,1);for(var t=Dm(this).entries,r=e+"",n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){Xm(arguments.length,1);for(var t=Dm(this).entries,r=e+"",n=[],i=0;i<t.length;i++)t[i].key===r&&n.push(t[i].value);return n},has:function(e){Xm(arguments.length,1);for(var t=Dm(this).entries,r=e+"",n=0;n<t.length;)if(t[n++].key===r)return!0;return!1},set:function(e,t){Xm(arguments.length,1);for(var r,n=Dm(this),i=n.entries,a=!1,o=e+"",s=t+"",c=0;c<i.length;c++)(r=i[c]).key===o&&(a?i.splice(c--,1):(a=!0,r.value=s));a||i.push({key:o,value:s}),n.updateURL()},sort:function(){var e,t,r,n=Dm(this),i=n.entries,a=i.slice();for(i.length=0,r=0;r<a.length;r++){for(e=a[r],t=0;t<r;t++)if(i[t].key>e.key){i.splice(t,0,e);break}t===r&&i.push(e)}n.updateURL()},forEach:function(e){for(var t,r=Dm(this).entries,n=Pt(e,arguments.length>1?arguments[1]:void 0,3),i=0;i<r.length;)n((t=r[i++]).value,t.key,this)},keys:function(){return new Ym(this,"keys")},values:function(){return new Ym(this,"values")},entries:function(){return new Ym(this,"entries")}},{enumerable:!0}),me(Zm,Rm,Zm.entries),me(Zm,"toString",(function(){for(var e,t=Dm(this).entries,r=[],n=0;n<t.length;)e=t[n++],r.push(Qm(e.key)+"="+Qm(e.value));return r.join("&")}),{enumerable:!0}),_t($m,Nm),We({global:!0,forced:!cm},{URLSearchParams:$m}),cm||"function"!=typeof xm||"function"!=typeof Pm||We({global:!0,enumerable:!0,forced:!0},{fetch:function(e){var t,r,n,i=[e];return arguments.length>1&&(B(t=arguments[1])&&(r=t.body,Vr(r)===Nm&&((n=t.headers?new Pm(t.headers):new Pm).has("content-type")||n.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),t=ft(t,{body:v(0,String(r)),headers:v(0,n)}))),i.push(t)),xm.apply(this,i)}});var Jm,ey={URLSearchParams:$m,getState:Dm},ty=vo.codeAt,ry=l.URL,ny=ey.URLSearchParams,iy=ey.getState,ay=ge.set,oy=ge.getterFor("URL"),sy=Math.floor,cy=Math.pow,uy="Invalid authority",ly="Invalid scheme",dy="Invalid host",fy="Invalid port",py=/[A-Za-z]/,hy=/[\d+-.A-Za-z]/,gy=/\d/,my=/^(0x|0X)/,yy=/^[0-7]+$/,vy=/^\d+$/,by=/^[\dA-Fa-f]+$/,Cy=/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,Ey=/[\u0000\u0009\u000A\u000D #/:?@[\\]]/,wy=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,ky=/[\u0009\u000A\u000D]/g,Sy=function(e,t){var r,n,i;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return dy;if(!(r=Ty(t.slice(1,-1))))return dy;e.host=r}else if(Ly(e)){if(t=Im(t),Cy.test(t))return dy;if(null===(r=By(t)))return dy;e.host=r}else{if(Ey.test(t))return dy;for(r="",n=Wr(t),i=0;i<n.length;i++)r+=Ny(n[i],_y);e.host=r}},By=function(e){var t,r,n,i,a,o,s,c=e.split(".");if(c.length&&""==c[c.length-1]&&c.pop(),(t=c.length)>4)return e;for(r=[],n=0;n<t;n++){if(""==(i=c[n]))return e;if(a=10,i.length>1&&"0"==i.charAt(0)&&(a=my.test(i)?16:8,i=i.slice(8==a?1:2)),""===i)o=0;else{if(!(10==a?vy:8==a?yy:by).test(i))return e;o=parseInt(i,a)}r.push(o)}for(n=0;n<t;n++)if(o=r[n],n==t-1){if(o>=cy(256,5-t))return null}else if(o>255)return null;for(s=r.pop(),n=0;n<r.length;n++)s+=r[n]*cy(256,3-n);return s},Ty=function(e){var t,r,n,i,a,o,s,c=[0,0,0,0,0,0,0,0],u=0,l=null,d=0,f=function(){return e.charAt(d)};if(":"==f()){if(":"!=e.charAt(1))return;d+=2,l=++u}for(;f();){if(8==u)return;if(":"!=f()){for(t=r=0;r<4&&by.test(f());)t=16*t+parseInt(f(),16),d++,r++;if("."==f()){if(0==r)return;if(d-=r,u>6)return;for(n=0;f();){if(i=null,n>0){if(!("."==f()&&n<4))return;d++}if(!gy.test(f()))return;for(;gy.test(f());){if(a=parseInt(f(),10),null===i)i=a;else{if(0==i)return;i=10*i+a}if(i>255)return;d++}c[u]=256*c[u]+i,2!=++n&&4!=n||u++}if(4!=n)return;break}if(":"==f()){if(d++,!f())return}else if(f())return;c[u++]=t}else{if(null!==l)return;d++,l=++u}}if(null!==l)for(o=u-l,u=7;0!=u&&o>0;)s=c[u],c[u--]=c[l+o-1],c[l+--o]=s;else if(8!=u)return;return c},Ay=function(e){for(var t=null,r=1,n=null,i=0,a=0;a<8;a++)0!==e[a]?(i>r&&(t=n,r=i),n=null,i=0):(null===n&&(n=a),++i);return i>r&&(t=n,r=i),t},Iy=function(e){var t,r,n,i;if("number"==typeof e){for(t=[],r=0;r<4;r++)t.unshift(e%256),e=sy(e/256);return t.join(".")}if("object"==typeof e){for(t="",n=Ay(e),r=0;r<8;r++)i&&0===e[r]||(i&&(i=!1),n===r?(t+=r?":":"::",i=!0):(t+=e[r].toString(16),r<7&&(t+=":")));return"["+t+"]"}return e},_y={},xy=Ra({},_y,{" ":1,'"':1,"<":1,">":1,"`":1}),Py=Ra({},xy,{"#":1,"?":1,"{":1,"}":1}),Ry=Ra({},Py,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Ny=function(e,t){var r=ty(e,0);return r>32&&r<127&&!I(t,e)?e:encodeURIComponent(e)},Oy={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Ly=function(e){return I(Oy,e.scheme)},Dy=function(e){return""!=e.username||""!=e.password},Uy=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},My=function(e,t){var r;return 2==e.length&&py.test(e.charAt(0))&&(":"==(r=e.charAt(1))||!t&&"|"==r)},Vy=function(e){var t;return e.length>1&&My(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},jy=function(e){var t=e.path,r=t.length;!r||"file"==e.scheme&&1==r&&My(t[0],!0)||t.pop()},Fy=function(e){return"."===e||"%2e"===e.toLowerCase()},zy=function(e){return".."===(e=e.toLowerCase())||"%2e."===e||".%2e"===e||"%2e%2e"===e},Ky={},qy={},Hy={},Qy={},Gy={},Wy={},Xy={},Yy={},$y={},Zy={},Jy={},ev={},tv={},rv={},nv={},iv={},av={},ov={},sv={},cv={},uv={},lv=function(e,t,r,n){var i,a,o,s,c=r||Ky,u=0,l="",d=!1,f=!1,p=!1;for(r||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(wy,"")),t=t.replace(ky,""),i=Wr(t);u<=i.length;){switch(a=i[u],c){case Ky:if(!a||!py.test(a)){if(r)return ly;c=Hy;continue}l+=a.toLowerCase(),c=qy;break;case qy:if(a&&(hy.test(a)||"+"==a||"-"==a||"."==a))l+=a.toLowerCase();else{if(":"!=a){if(r)return ly;l="",c=Hy,u=0;continue}if(r&&(Ly(e)!=I(Oy,l)||"file"==l&&(Dy(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=l,r)return void(Ly(e)&&Oy[e.scheme]==e.port&&(e.port=null));l="","file"==e.scheme?c=rv:Ly(e)&&n&&n.scheme==e.scheme?c=Qy:Ly(e)?c=Yy:"/"==i[u+1]?(c=Gy,u++):(e.cannotBeABaseURL=!0,e.path.push(""),c=sv)}break;case Hy:if(!n||n.cannotBeABaseURL&&"#"!=a)return ly;if(n.cannotBeABaseURL&&"#"==a){e.scheme=n.scheme,e.path=n.path.slice(),e.query=n.query,e.fragment="",e.cannotBeABaseURL=!0,c=uv;break}c="file"==n.scheme?rv:Wy;continue;case Qy:if("/"!=a||"/"!=i[u+1]){c=Wy;continue}c=$y,u++;break;case Gy:if("/"==a){c=Zy;break}c=ov;continue;case Wy:if(e.scheme=n.scheme,a==Jm)e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.query=n.query;else if("/"==a||"\\"==a&&Ly(e))c=Xy;else if("?"==a)e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.query="",c=cv;else{if("#"!=a){e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.path.pop(),c=ov;continue}e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.query=n.query,e.fragment="",c=uv}break;case Xy:if(!Ly(e)||"/"!=a&&"\\"!=a){if("/"!=a){e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,c=ov;continue}c=Zy}else c=$y;break;case Yy:if(c=$y,"/"!=a||"/"!=l.charAt(u+1))continue;u++;break;case $y:if("/"!=a&&"\\"!=a){c=Zy;continue}break;case Zy:if("@"==a){d&&(l="%40"+l),d=!0,o=Wr(l);for(var h=0;h<o.length;h++){var g=o[h];if(":"!=g||p){var m=Ny(g,Ry);p?e.password+=m:e.username+=m}else p=!0}l=""}else if(a==Jm||"/"==a||"?"==a||"#"==a||"\\"==a&&Ly(e)){if(d&&""==l)return uy;u-=Wr(l).length+1,l="",c=Jy}else l+=a;break;case Jy:case ev:if(r&&"file"==e.scheme){c=iv;continue}if(":"!=a||f){if(a==Jm||"/"==a||"?"==a||"#"==a||"\\"==a&&Ly(e)){if(Ly(e)&&""==l)return dy;if(r&&""==l&&(Dy(e)||null!==e.port))return;if(s=Sy(e,l))return s;if(l="",c=av,r)return;continue}"["==a?f=!0:"]"==a&&(f=!1),l+=a}else{if(""==l)return dy;if(s=Sy(e,l))return s;if(l="",c=tv,r==ev)return}break;case tv:if(!gy.test(a)){if(a==Jm||"/"==a||"?"==a||"#"==a||"\\"==a&&Ly(e)||r){if(""!=l){var y=parseInt(l,10);if(y>65535)return fy;e.port=Ly(e)&&y===Oy[e.scheme]?null:y,l=""}if(r)return;c=av;continue}return fy}l+=a;break;case rv:if(e.scheme="file","/"==a||"\\"==a)c=nv;else{if(!n||"file"!=n.scheme){c=ov;continue}if(a==Jm)e.host=n.host,e.path=n.path.slice(),e.query=n.query;else if("?"==a)e.host=n.host,e.path=n.path.slice(),e.query="",c=cv;else{if("#"!=a){Vy(i.slice(u).join(""))||(e.host=n.host,e.path=n.path.slice(),jy(e)),c=ov;continue}e.host=n.host,e.path=n.path.slice(),e.query=n.query,e.fragment="",c=uv}}break;case nv:if("/"==a||"\\"==a){c=iv;break}n&&"file"==n.scheme&&!Vy(i.slice(u).join(""))&&(My(n.path[0],!0)?e.path.push(n.path[0]):e.host=n.host),c=ov;continue;case iv:if(a==Jm||"/"==a||"\\"==a||"?"==a||"#"==a){if(!r&&My(l))c=ov;else if(""==l){if(e.host="",r)return;c=av}else{if(s=Sy(e,l))return s;if("localhost"==e.host&&(e.host=""),r)return;l="",c=av}continue}l+=a;break;case av:if(Ly(e)){if(c=ov,"/"!=a&&"\\"!=a)continue}else if(r||"?"!=a)if(r||"#"!=a){if(a!=Jm&&(c=ov,"/"!=a))continue}else e.fragment="",c=uv;else e.query="",c=cv;break;case ov:if(a==Jm||"/"==a||"\\"==a&&Ly(e)||!r&&("?"==a||"#"==a)){if(zy(l)?(jy(e),"/"==a||"\\"==a&&Ly(e)||e.path.push("")):Fy(l)?"/"==a||"\\"==a&&Ly(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&My(l)&&(e.host&&(e.host=""),l=l.charAt(0)+":"),e.path.push(l)),l="","file"==e.scheme&&(a==Jm||"?"==a||"#"==a))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==a?(e.query="",c=cv):"#"==a&&(e.fragment="",c=uv)}else l+=Ny(a,Py);break;case sv:"?"==a?(e.query="",c=cv):"#"==a?(e.fragment="",c=uv):a!=Jm&&(e.path[0]+=Ny(a,_y));break;case cv:r||"#"!=a?a!=Jm&&("'"==a&&Ly(e)?e.query+="%27":e.query+="#"==a?"%23":Ny(a,_y)):(e.fragment="",c=uv);break;case uv:a!=Jm&&(e.fragment+=Ny(a,xy))}u++}},dv=function(e){var t,r,n=Ul(this,dv,"URL"),i=arguments.length>1?arguments[1]:void 0,a=String(e),o=ay(n,{type:"URL"});if(void 0!==i)if(i instanceof dv)t=oy(i);else if(r=lv(t={},String(i)))throw TypeError(r);if(r=lv(o,a,null,t))throw TypeError(r);var s=o.searchParams=new ny,c=iy(s);c.updateSearchParams(o.query),c.updateURL=function(){o.query=String(s)||null},f||(n.href=pv.call(n),n.origin=hv.call(n),n.protocol=gv.call(n),n.username=mv.call(n),n.password=yv.call(n),n.host=vv.call(n),n.hostname=bv.call(n),n.port=Cv.call(n),n.pathname=Ev.call(n),n.search=wv.call(n),n.searchParams=kv.call(n),n.hash=Sv.call(n))},fv=dv.prototype,pv=function(){var e=oy(this),t=e.scheme,r=e.username,n=e.password,i=e.host,a=e.port,o=e.path,s=e.query,c=e.fragment,u=t+":";return null!==i?(u+="//",Dy(e)&&(u+=r+(n?":"+n:"")+"@"),u+=Iy(i),null!==a&&(u+=":"+a)):"file"==t&&(u+="//"),u+=e.cannotBeABaseURL?o[0]:o.length?"/"+o.join("/"):"",null!==s&&(u+="?"+s),null!==c&&(u+="#"+c),u},hv=function(){var e=oy(this),t=e.scheme,r=e.port;if("blob"==t)try{return new URL(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&Ly(e)?t+"://"+Iy(e.host)+(null!==r?":"+r:""):"null"},gv=function(){return oy(this).scheme+":"},mv=function(){return oy(this).username},yv=function(){return oy(this).password},vv=function(){var e=oy(this),t=e.host,r=e.port;return null===t?"":null===r?Iy(t):Iy(t)+":"+r},bv=function(){var e=oy(this).host;return null===e?"":Iy(e)},Cv=function(){var e=oy(this).port;return null===e?"":String(e)},Ev=function(){var e=oy(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},wv=function(){var e=oy(this).query;return e?"?"+e:""},kv=function(){return oy(this).searchParams},Sv=function(){var e=oy(this).fragment;return e?"#"+e:""},Bv=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(f&&et(fv,{href:Bv(pv,(function(e){var t=oy(this),r=String(e),n=lv(t,r);if(n)throw TypeError(n);iy(t.searchParams).updateSearchParams(t.query)})),origin:Bv(hv),protocol:Bv(gv,(function(e){var t=oy(this);lv(t,String(e)+":",Ky)})),username:Bv(mv,(function(e){var t=oy(this),r=Wr(String(e));if(!Uy(t)){t.username="";for(var n=0;n<r.length;n++)t.username+=Ny(r[n],Ry)}})),password:Bv(yv,(function(e){var t=oy(this),r=Wr(String(e));if(!Uy(t)){t.password="";for(var n=0;n<r.length;n++)t.password+=Ny(r[n],Ry)}})),host:Bv(vv,(function(e){var t=oy(this);t.cannotBeABaseURL||lv(t,String(e),Jy)})),hostname:Bv(bv,(function(e){var t=oy(this);t.cannotBeABaseURL||lv(t,String(e),ev)})),port:Bv(Cv,(function(e){var t=oy(this);Uy(t)||(""==(e=String(e))?t.port=null:lv(t,e,tv))})),pathname:Bv(Ev,(function(e){var t=oy(this);t.cannotBeABaseURL||(t.path=[],lv(t,e+"",av))})),search:Bv(wv,(function(e){var t=oy(this);""==(e=String(e))?t.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),t.query="",lv(t,e,cv)),iy(t.searchParams).updateSearchParams(t.query)})),searchParams:Bv(kv),hash:Bv(Sv,(function(e){var t=oy(this);""!=(e=String(e))?("#"==e.charAt(0)&&(e=e.slice(1)),t.fragment="",lv(t,e,uv)):t.fragment=null}))}),me(fv,"toJSON",(function(){return pv.call(this)}),{enumerable:!0}),me(fv,"toString",(function(){return pv.call(this)}),{enumerable:!0}),ry){var Tv=ry.createObjectURL,Av=ry.revokeObjectURL;Tv&&me(dv,"createObjectURL",(function(e){return Tv.apply(ry,arguments)})),Av&&me(dv,"revokeObjectURL",(function(e){return Av.apply(ry,arguments)}))}_t(dv,"URL"),We({global:!0,forced:!cm,sham:!f},{URL:dv}),We({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return URL.prototype.toString.call(this)}});s((function(e){var t=function(e){var t,r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var i=t&&t.prototype instanceof m?t:m,a=Object.create(i.prototype),o=new I(n||[]);return a._invoke=function(e,t,r){var n=d;return function(i,a){if(n===p)throw new Error("Generator is already running");if(n===h){if("throw"===i)throw a;return x()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var s=B(o,r);if(s){if(s===g)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===d)throw n=h,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var c=l(e,t,r);if("normal"===c.type){if(n=r.done?h:f,c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=h,r.method="throw",r.arg=c.arg)}}}(e,r,o),a}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var d="suspendedStart",f="suspendedYield",p="executing",h="completed",g={};function m(){}function y(){}function v(){}var b={};b[a]=function(){return this};var C=Object.getPrototypeOf,E=C&&C(C(_([])));E&&E!==r&&n.call(E,a)&&(b=E);var w=v.prototype=m.prototype=Object.create(b);function k(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function r(i,a,o,s){var c=l(e[i],e,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,o,s)}),(function(e){r("throw",e,o,s)})):t.resolve(d).then((function(e){u.value=e,o(u)}),(function(e){return r("throw",e,o,s)}))}s(c.arg)}var i;this._invoke=function(e,n){function a(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(a,a):a()}}function B(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,B(e,r),"throw"===r.method))return g;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var i=l(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function _(e){if(e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}return{next:x}}function x(){return{value:t,done:!0}}return y.prototype=w.constructor=v,v.constructor=y,y.displayName=c(v,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,c(e,s,"GeneratorFunction")),e.prototype=Object.create(w),e},e.awrap=function(e){return{__await:e}},k(S.prototype),S.prototype[o]=function(){return this},e.AsyncIterator=S,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new S(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},k(w),c(w,s,"Generator"),w[a]=function(){return this},w.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=_,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(c&&u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:_(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}));function Iv(e){return(Iv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _v(e,t,r,n,i,a,o){try{var s=e[a](o),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}function xv(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var a=e.apply(t,r);function o(e){_v(a,n,i,o,s,"next",e)}function s(e){_v(a,n,i,o,s,"throw",e)}o(void 0)}))}}function Pv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rv(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Nv(e,t,r){return t&&Rv(e.prototype,t),r&&Rv(e,r),e}function Ov(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lv(){return(Lv=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function Dv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Uv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Dv(Object(r),!0).forEach((function(t){Ov(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dv(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Mv(e,t){return(Mv=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Vv(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function jv(e,t,r){return(jv=Vv()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&Mv(i,r.prototype),i}).apply(null,arguments)}function Fv(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}function zv(e,t){if(null==e)return{};var r,n,i=Fv(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Kv(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function qv(e,t){return Gv(e)||Xv(e,t)||Yv(e,t)||Jv()}function Hv(e){return Qv(e)||Wv(e)||Yv(e)||Zv()}function Qv(e){if(Array.isArray(e))return $v(e)}function Gv(e){if(Array.isArray(e))return e}function Wv(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function Xv(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}}function Yv(e,t){if(e){if("string"==typeof e)return $v(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$v(e,t):void 0}}function $v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Zv(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Jv(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function eb(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=Yv(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}
|
2
|
+
/*
|
3
|
+
object-assign
|
4
|
+
(c) Sindre Sorhus
|
5
|
+
@license MIT
|
6
|
+
*/var tb=Object.getOwnPropertySymbols,rb=Object.prototype.hasOwnProperty,nb=Object.prototype.propertyIsEnumerable;function ib(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function ab(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}var ob=ab()?Object.assign:function(e,t){for(var r,n,i=ib(e),a=1;a<arguments.length;a++){for(var o in r=Object(arguments[a]))rb.call(r,o)&&(i[o]=r[o]);if(tb){n=tb(r);for(var s=0;s<n.length;s++)nb.call(r,n[s])&&(i[n[s]]=r[n[s]])}}return i},sb="function"==typeof Symbol&&Symbol.for,cb=sb?Symbol.for("react.element"):60103,ub=sb?Symbol.for("react.portal"):60106,lb=sb?Symbol.for("react.fragment"):60107,db=sb?Symbol.for("react.strict_mode"):60108,fb=sb?Symbol.for("react.profiler"):60114,pb=sb?Symbol.for("react.provider"):60109,hb=sb?Symbol.for("react.context"):60110,gb=sb?Symbol.for("react.forward_ref"):60112,mb=sb?Symbol.for("react.suspense"):60113,yb=sb?Symbol.for("react.memo"):60115,vb=sb?Symbol.for("react.lazy"):60116,bb="function"==typeof Symbol&&Symbol.iterator;function Cb(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Eb={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},wb={};function kb(e,t,r){this.props=e,this.context=t,this.refs=wb,this.updater=r||Eb}function Sb(){}function Bb(e,t,r){this.props=e,this.context=t,this.refs=wb,this.updater=r||Eb}kb.prototype.isReactComponent={},kb.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(Cb(85));this.updater.enqueueSetState(this,e,t,"setState")},kb.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},Sb.prototype=kb.prototype;var Tb=Bb.prototype=new Sb;Tb.constructor=Bb,ob(Tb,kb.prototype),Tb.isPureReactComponent=!0;var Ab={current:null},Ib=Object.prototype.hasOwnProperty,_b={key:!0,ref:!0,__self:!0,__source:!0};function xb(e,t,r){var n,i={},a=null,o=null;if(null!=t)for(n in void 0!==t.ref&&(o=t.ref),void 0!==t.key&&(a=""+t.key),t)Ib.call(t,n)&&!_b.hasOwnProperty(n)&&(i[n]=t[n]);var s=arguments.length-2;if(1===s)i.children=r;else if(1<s){for(var c=Array(s),u=0;u<s;u++)c[u]=arguments[u+2];i.children=c}if(e&&e.defaultProps)for(n in s=e.defaultProps)void 0===i[n]&&(i[n]=s[n]);return{$$typeof:cb,type:e,key:a,ref:o,props:i,_owner:Ab.current}}function Pb(e,t){return{$$typeof:cb,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Rb(e){return"object"==typeof e&&null!==e&&e.$$typeof===cb}function Nb(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,(function(e){return t[e]}))}var Ob=/\/+/g,Lb=[];function Db(e,t,r,n){if(Lb.length){var i=Lb.pop();return i.result=e,i.keyPrefix=t,i.func=r,i.context=n,i.count=0,i}return{result:e,keyPrefix:t,func:r,context:n,count:0}}function Ub(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>Lb.length&&Lb.push(e)}function Mb(e,t,r,n){var i=typeof e;"undefined"!==i&&"boolean"!==i||(e=null);var a=!1;if(null===e)a=!0;else switch(i){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case cb:case ub:a=!0}}if(a)return r(n,e,""===t?"."+jb(e,0):t),1;if(a=0,t=""===t?".":t+":",Array.isArray(e))for(var o=0;o<e.length;o++){var s=t+jb(i=e[o],o);a+=Mb(i,s,r,n)}else if(null===e||"object"!=typeof e?s=null:s="function"==typeof(s=bb&&e[bb]||e["@@iterator"])?s:null,"function"==typeof s)for(e=s.call(e),o=0;!(i=e.next()).done;)a+=Mb(i=i.value,s=t+jb(i,o++),r,n);else if("object"===i)throw r=""+e,Error(Cb(31,"[object Object]"===r?"object with keys {"+Object.keys(e).join(", ")+"}":r,""));return a}function Vb(e,t,r){return null==e?0:Mb(e,"",t,r)}function jb(e,t){return"object"==typeof e&&null!==e&&null!=e.key?Nb(e.key):t.toString(36)}function Fb(e,t){e.func.call(e.context,t,e.count++)}function zb(e,t,r){var n=e.result,i=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?Kb(e,n,r,(function(e){return e})):null!=e&&(Rb(e)&&(e=Pb(e,i+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(Ob,"$&/")+"/")+r)),n.push(e))}function Kb(e,t,r,n,i){var a="";null!=r&&(a=(""+r).replace(Ob,"$&/")+"/"),Vb(e,zb,t=Db(t,a,n,i)),Ub(t)}var qb={current:null};function Hb(){var e=qb.current;if(null===e)throw Error(Cb(321));return e}var Qb={ReactCurrentDispatcher:qb,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:Ab,IsSomeRendererActing:{current:!1},assign:ob},Gb={map:function(e,t,r){if(null==e)return e;var n=[];return Kb(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;Vb(e,Fb,t=Db(null,null,t,r)),Ub(t)},count:function(e){return Vb(e,(function(){return null}),null)},toArray:function(e){var t=[];return Kb(e,t,null,(function(e){return e})),t},only:function(e){if(!Rb(e))throw Error(Cb(143));return e}},Wb=kb,Xb=lb,Yb=fb,$b=Bb,Zb=db,Jb=mb,eC=Qb,tC=function(e,t,r){if(null==e)throw Error(Cb(267,e));var n=ob({},e.props),i=e.key,a=e.ref,o=e._owner;if(null!=t){if(void 0!==t.ref&&(a=t.ref,o=Ab.current),void 0!==t.key&&(i=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(c in t)Ib.call(t,c)&&!_b.hasOwnProperty(c)&&(n[c]=void 0===t[c]&&void 0!==s?s[c]:t[c])}var c=arguments.length-2;if(1===c)n.children=r;else if(1<c){s=Array(c);for(var u=0;u<c;u++)s[u]=arguments[u+2];n.children=s}return{$$typeof:cb,type:e.type,key:i,ref:a,props:n,_owner:o}},rC=function(e,t){return void 0===t&&(t=null),(e={$$typeof:hb,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:pb,_context:e},e.Consumer=e},nC=xb,iC=function(e){var t=xb.bind(null,e);return t.type=e,t},aC=function(){return{current:null}},oC=function(e){return{$$typeof:gb,render:e}},sC=Rb,cC=function(e){return{$$typeof:vb,_ctor:e,_status:-1,_result:null}},uC=function(e,t){return{$$typeof:yb,type:e,compare:void 0===t?null:t}},lC=function(e,t){return Hb().useCallback(e,t)},dC=function(e,t){return Hb().useContext(e,t)},fC=function(){},pC=function(e,t){return Hb().useEffect(e,t)},hC=function(e,t,r){return Hb().useImperativeHandle(e,t,r)},gC=function(e,t){return Hb().useLayoutEffect(e,t)},mC=function(e,t){return Hb().useMemo(e,t)},yC=function(e,t,r){return Hb().useReducer(e,t,r)},vC=function(e){return Hb().useRef(e)},bC=function(e){return Hb().useState(e)},CC="16.14.0",EC={Children:Gb,Component:Wb,Fragment:Xb,Profiler:Yb,PureComponent:$b,StrictMode:Zb,Suspense:Jb,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:eC,cloneElement:tC,createContext:rC,createElement:nC,createFactory:iC,createRef:aC,forwardRef:oC,isValidElement:sC,lazy:cC,memo:uC,useCallback:lC,useContext:dC,useDebugValue:fC,useEffect:pC,useImperativeHandle:hC,useLayoutEffect:gC,useMemo:mC,useReducer:yC,useRef:vC,useState:bC,version:CC},wC="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",kC=wC,SC=(s((function(e,t){})),s((function(e){e.exports=EC}))),BC="function"==typeof Symbol&&Symbol.for,TC=BC?Symbol.for("react.element"):60103,AC=BC?Symbol.for("react.portal"):60106,IC=BC?Symbol.for("react.fragment"):60107,_C=BC?Symbol.for("react.strict_mode"):60108,xC=BC?Symbol.for("react.profiler"):60114,PC=BC?Symbol.for("react.provider"):60109,RC=BC?Symbol.for("react.context"):60110,NC=BC?Symbol.for("react.async_mode"):60111,OC=BC?Symbol.for("react.concurrent_mode"):60111,LC=BC?Symbol.for("react.forward_ref"):60112,DC=BC?Symbol.for("react.suspense"):60113,UC=BC?Symbol.for("react.suspense_list"):60120,MC=BC?Symbol.for("react.memo"):60115,VC=BC?Symbol.for("react.lazy"):60116,jC=BC?Symbol.for("react.block"):60121,FC=BC?Symbol.for("react.fundamental"):60117,zC=BC?Symbol.for("react.responder"):60118,KC=BC?Symbol.for("react.scope"):60119;function qC(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case TC:switch(e=e.type){case NC:case OC:case IC:case xC:case _C:case DC:return e;default:switch(e=e&&e.$$typeof){case RC:case LC:case VC:case MC:case PC:return e;default:return t}}case AC:return t}}}function HC(e){return qC(e)===OC}var QC=NC,GC=OC,WC=RC,XC=PC,YC=TC,$C=LC,ZC=IC,JC=VC,eE=MC,tE=AC,rE=xC,nE=_C,iE=DC,aE=function(e){return HC(e)||qC(e)===NC},oE=HC,sE=function(e){return qC(e)===RC},cE=function(e){return qC(e)===PC},uE=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===TC},lE=function(e){return qC(e)===LC},dE=function(e){return qC(e)===IC},fE=function(e){return qC(e)===VC},pE=function(e){return qC(e)===MC},hE=function(e){return qC(e)===AC},gE=function(e){return qC(e)===xC},mE=function(e){return qC(e)===_C},yE=function(e){return qC(e)===DC},vE=function(e){return"string"==typeof e||"function"==typeof e||e===IC||e===OC||e===xC||e===_C||e===DC||e===UC||"object"==typeof e&&null!==e&&(e.$$typeof===VC||e.$$typeof===MC||e.$$typeof===PC||e.$$typeof===RC||e.$$typeof===LC||e.$$typeof===FC||e.$$typeof===zC||e.$$typeof===KC||e.$$typeof===jC)},bE=qC,CE={AsyncMode:QC,ConcurrentMode:GC,ContextConsumer:WC,ContextProvider:XC,Element:YC,ForwardRef:$C,Fragment:ZC,Lazy:JC,Memo:eE,Portal:tE,Profiler:rE,StrictMode:nE,Suspense:iE,isAsyncMode:aE,isConcurrentMode:oE,isContextConsumer:sE,isContextProvider:cE,isElement:uE,isForwardRef:lE,isFragment:dE,isLazy:fE,isMemo:pE,isPortal:hE,isProfiler:gE,isStrictMode:mE,isSuspense:yE,isValidElementType:vE,typeOf:bE};s((function(e,t){})),s((function(e){e.exports=CE})),Function.call.bind(Object.prototype.hasOwnProperty);function EE(){}function wE(){}wE.resetWarningCache=EE;var kE=function(){function e(e,t,r,n,i,a){if(a!==kC){var o=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:wE,resetWarningCache:EE};return r.PropTypes=r,r},SE=s((function(e){e.exports=kE()})),BE=60103,TE=60106,AE=60107,IE=60108,_E=60114,xE=60109,PE=60110,RE=60112,NE=60113,OE=60120,LE=60115,DE=60116,UE=60121,ME=60122,VE=60117,jE=60129,FE=60131;if("function"==typeof Symbol&&Symbol.for){var zE=Symbol.for;BE=zE("react.element"),TE=zE("react.portal"),AE=zE("react.fragment"),IE=zE("react.strict_mode"),_E=zE("react.profiler"),xE=zE("react.provider"),PE=zE("react.context"),RE=zE("react.forward_ref"),NE=zE("react.suspense"),OE=zE("react.suspense_list"),LE=zE("react.memo"),DE=zE("react.lazy"),UE=zE("react.block"),ME=zE("react.server.block"),VE=zE("react.fundamental"),jE=zE("react.debug_trace_mode"),FE=zE("react.legacy_hidden")}function KE(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case BE:switch(e=e.type){case AE:case _E:case IE:case NE:case OE:return e;default:switch(e=e&&e.$$typeof){case PE:case RE:case DE:case LE:case xE:return e;default:return t}}case TE:return t}}}var qE=xE,HE=BE,QE=RE,GE=AE,WE=DE,XE=LE,YE=TE,$E=_E,ZE=IE,JE=NE,ew=PE,tw=qE,rw=HE,nw=QE,iw=GE,aw=WE,ow=XE,sw=YE,cw=$E,uw=ZE,lw=JE,dw=function(){return!1},fw=function(){return!1},pw=function(e){return KE(e)===PE},hw=function(e){return KE(e)===xE},gw=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===BE},mw=function(e){return KE(e)===RE},yw=function(e){return KE(e)===AE},vw=function(e){return KE(e)===DE},bw=function(e){return KE(e)===LE},Cw=function(e){return KE(e)===TE},Ew=function(e){return KE(e)===_E},ww=function(e){return KE(e)===IE},kw=function(e){return KE(e)===NE},Sw=function(e){return"string"==typeof e||"function"==typeof e||e===AE||e===_E||e===jE||e===IE||e===NE||e===OE||e===FE||"object"==typeof e&&null!==e&&(e.$$typeof===DE||e.$$typeof===LE||e.$$typeof===xE||e.$$typeof===PE||e.$$typeof===RE||e.$$typeof===VE||e.$$typeof===UE||e[0]===ME)},Bw=KE,Tw={ContextConsumer:ew,ContextProvider:tw,Element:rw,ForwardRef:nw,Fragment:iw,Lazy:aw,Memo:ow,Portal:sw,Profiler:cw,StrictMode:uw,Suspense:lw,isAsyncMode:dw,isConcurrentMode:fw,isContextConsumer:pw,isContextProvider:hw,isElement:gw,isForwardRef:mw,isFragment:yw,isLazy:vw,isMemo:bw,isPortal:Cw,isProfiler:Ew,isStrictMode:ww,isSuspense:kw,isValidElementType:Sw,typeOf:Bw},Aw=(s((function(e,t){})),s((function(e){e.exports=Tw})));function Iw(e){function t(e,n,c,u,f){for(var p,h,g,m,C,w=0,k=0,S=0,B=0,T=0,R=0,O=g=p=0,D=0,U=0,M=0,V=0,j=c.length,F=j-1,z="",K="",q="",H="";D<j;){if(h=c.charCodeAt(D),D===F&&0!==k+B+S+w&&(0!==k&&(h=47===k?10:47),B=S=w=0,j++,F++),0===k+B+S+w){if(D===F&&(0<U&&(z=z.replace(d,"")),0<z.trim().length)){switch(h){case 32:case 9:case 59:case 13:case 10:break;default:z+=c.charAt(D)}h=59}switch(h){case 123:for(p=(z=z.trim()).charCodeAt(0),g=1,V=++D;D<j;){switch(h=c.charCodeAt(D)){case 123:g++;break;case 125:g--;break;case 47:switch(h=c.charCodeAt(D+1)){case 42:case 47:e:{for(O=D+1;O<F;++O)switch(c.charCodeAt(O)){case 47:if(42===h&&42===c.charCodeAt(O-1)&&D+2!==O){D=O+1;break e}break;case 10:if(47===h){D=O+1;break e}}D=O}}break;case 91:h++;case 40:h++;case 34:case 39:for(;D++<F&&c.charCodeAt(D)!==h;);}if(0===g)break;D++}switch(g=c.substring(V,D),0===p&&(p=(z=z.replace(l,"").trim()).charCodeAt(0)),p){case 64:switch(0<U&&(z=z.replace(d,"")),h=z.charCodeAt(1)){case 100:case 109:case 115:case 45:U=n;break;default:U=P}if(V=(g=t(n,U,g,h,f+1)).length,0<N&&(C=s(3,g,U=r(P,z,M),n,I,A,V,h,f,u),z=U.join(""),void 0!==C&&0===(V=(g=C.trim()).length)&&(h=0,g="")),0<V)switch(h){case 115:z=z.replace(E,o);case 100:case 109:case 45:g=z+"{"+g+"}";break;case 107:g=(z=z.replace(y,"$1 $2"))+"{"+g+"}",g=1===x||2===x&&a("@"+g,3)?"@-webkit-"+g+"@"+g:"@"+g;break;default:g=z+g,112===u&&(K+=g,g="")}else g="";break;default:g=t(n,r(n,z,M),g,u,f+1)}q+=g,g=M=U=O=p=0,z="",h=c.charCodeAt(++D);break;case 125:case 59:if(1<(V=(z=(0<U?z.replace(d,""):z).trim()).length))switch(0===O&&(p=z.charCodeAt(0),45===p||96<p&&123>p)&&(V=(z=z.replace(" ",":")).length),0<N&&void 0!==(C=s(1,z,n,e,I,A,K.length,u,f,u))&&0===(V=(z=C.trim()).length)&&(z="\0\0"),p=z.charCodeAt(0),h=z.charCodeAt(1),p){case 0:break;case 64:if(105===h||99===h){H+=z+c.charAt(D);break}default:58!==z.charCodeAt(V-1)&&(K+=i(z,p,h,z.charCodeAt(2)))}M=U=O=p=0,z="",h=c.charCodeAt(++D)}}switch(h){case 13:case 10:47===k?k=0:0===1+p&&107!==u&&0<z.length&&(U=1,z+="\0"),0<N*L&&s(0,z,n,e,I,A,K.length,u,f,u),A=1,I++;break;case 59:case 125:if(0===k+B+S+w){A++;break}default:switch(A++,m=c.charAt(D),h){case 9:case 32:if(0===B+w+k)switch(T){case 44:case 58:case 9:case 32:m="";break;default:32!==h&&(m=" ")}break;case 0:m="\\0";break;case 12:m="\\f";break;case 11:m="\\v";break;case 38:0===B+k+w&&(U=M=1,m="\f"+m);break;case 108:if(0===B+k+w+_&&0<O)switch(D-O){case 2:112===T&&58===c.charCodeAt(D-3)&&(_=T);case 8:111===R&&(_=R)}break;case 58:0===B+k+w&&(O=D);break;case 44:0===k+S+B+w&&(U=1,m+="\r");break;case 34:case 39:0===k&&(B=B===h?0:0===B?h:B);break;case 91:0===B+k+S&&w++;break;case 93:0===B+k+S&&w--;break;case 41:0===B+k+w&&S--;break;case 40:if(0===B+k+w){if(0===p)switch(2*T+3*R){case 533:break;default:p=1}S++}break;case 64:0===k+S+B+w+O+g&&(g=1);break;case 42:case 47:if(!(0<B+w+S))switch(k){case 0:switch(2*h+3*c.charCodeAt(D+1)){case 235:k=47;break;case 220:V=D,k=42}break;case 42:47===h&&42===T&&V+2!==D&&(33===c.charCodeAt(V+2)&&(K+=c.substring(V,D+1)),m="",k=0)}}0===k&&(z+=m)}R=T,T=h,D++}if(0<(V=K.length)){if(U=n,0<N&&(void 0!==(C=s(2,K,U,e,I,A,V,u,f,u))&&0===(K=C).length))return H+K+q;if(K=U.join(",")+"{"+K+"}",0!=x*_){switch(2!==x||a(K,2)||(_=0),_){case 111:K=K.replace(b,":-moz-$1")+K;break;case 112:K=K.replace(v,"::-webkit-input-$1")+K.replace(v,"::-moz-$1")+K.replace(v,":-ms-input-$1")+K}_=0}}return H+K+q}function r(e,t,r){var i=t.trim().split(g);t=i;var a=i.length,o=e.length;switch(o){case 0:case 1:var s=0;for(e=0===o?"":e[0]+" ";s<a;++s)t[s]=n(e,t[s],r).trim();break;default:var c=s=0;for(t=[];s<a;++s)for(var u=0;u<o;++u)t[c++]=n(e[u]+" ",i[s],r).trim()}return t}function n(e,t,r){var n=t.charCodeAt(0);switch(33>n&&(n=(t=t.trim()).charCodeAt(0)),n){case 38:return t.replace(m,"$1"+e.trim());case 58:return e.trim()+t.replace(m,"$1"+e.trim());default:if(0<1*r&&0<t.indexOf("\f"))return t.replace(m,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function i(e,t,r,n){var o=e+";",s=2*t+3*r+4*n;if(944===s){e=o.indexOf(":",9)+1;var c=o.substring(e,o.length-1).trim();return c=o.substring(0,e).trim()+c+";",1===x||2===x&&a(c,1)?"-webkit-"+c+c:c}if(0===x||2===x&&!a(o,1))return o;switch(s){case 1015:return 97===o.charCodeAt(10)?"-webkit-"+o+o:o;case 951:return 116===o.charCodeAt(3)?"-webkit-"+o+o:o;case 963:return 110===o.charCodeAt(5)?"-webkit-"+o+o:o;case 1009:if(100!==o.charCodeAt(4))break;case 969:case 942:return"-webkit-"+o+o;case 978:return"-webkit-"+o+"-moz-"+o+o;case 1019:case 983:return"-webkit-"+o+"-moz-"+o+"-ms-"+o+o;case 883:if(45===o.charCodeAt(8))return"-webkit-"+o+o;if(0<o.indexOf("image-set(",11))return o.replace(T,"$1-webkit-$2")+o;break;case 932:if(45===o.charCodeAt(4))switch(o.charCodeAt(5)){case 103:return"-webkit-box-"+o.replace("-grow","")+"-webkit-"+o+"-ms-"+o.replace("grow","positive")+o;case 115:return"-webkit-"+o+"-ms-"+o.replace("shrink","negative")+o;case 98:return"-webkit-"+o+"-ms-"+o.replace("basis","preferred-size")+o}return"-webkit-"+o+"-ms-"+o+o;case 964:return"-webkit-"+o+"-ms-flex-"+o+o;case 1023:if(99!==o.charCodeAt(8))break;return"-webkit-box-pack"+(c=o.substring(o.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+o+"-ms-flex-pack"+c+o;case 1005:return p.test(o)?o.replace(f,":-webkit-")+o.replace(f,":-moz-")+o:o;case 1e3:switch(t=(c=o.substring(13).trim()).indexOf("-")+1,c.charCodeAt(0)+c.charCodeAt(t)){case 226:c=o.replace(C,"tb");break;case 232:c=o.replace(C,"tb-rl");break;case 220:c=o.replace(C,"lr");break;default:return o}return"-webkit-"+o+"-ms-"+c+o;case 1017:if(-1===o.indexOf("sticky",9))break;case 975:switch(t=(o=e).length-10,s=(c=(33===o.charCodeAt(t)?o.substring(0,t):o).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|c.charCodeAt(7))){case 203:if(111>c.charCodeAt(8))break;case 115:o=o.replace(c,"-webkit-"+c)+";"+o;break;case 207:case 102:o=o.replace(c,"-webkit-"+(102<s?"inline-":"")+"box")+";"+o.replace(c,"-webkit-"+c)+";"+o.replace(c,"-ms-"+c+"box")+";"+o}return o+";";case 938:if(45===o.charCodeAt(5))switch(o.charCodeAt(6)){case 105:return c=o.replace("-items",""),"-webkit-"+o+"-webkit-box-"+c+"-ms-flex-"+c+o;case 115:return"-webkit-"+o+"-ms-flex-item-"+o.replace(k,"")+o;default:return"-webkit-"+o+"-ms-flex-line-pack"+o.replace("align-content","").replace(k,"")+o}break;case 973:case 989:if(45!==o.charCodeAt(3)||122===o.charCodeAt(4))break;case 931:case 953:if(!0===B.test(e))return 115===(c=e.substring(e.indexOf(":")+1)).charCodeAt(0)?i(e.replace("stretch","fill-available"),t,r,n).replace(":fill-available",":stretch"):o.replace(c,"-webkit-"+c)+o.replace(c,"-moz-"+c.replace("fill-",""))+o;break;case 962:if(o="-webkit-"+o+(102===o.charCodeAt(5)?"-ms-"+o:"")+o,211===r+n&&105===o.charCodeAt(13)&&0<o.indexOf("transform",10))return o.substring(0,o.indexOf(";",27)+1).replace(h,"$1-webkit-$2")+o}return o}function a(e,t){var r=e.indexOf(1===t?":":"{"),n=e.substring(0,3!==t?r:10);return r=e.substring(r+1,e.length-1),O(2!==t?n:n.replace(S,"$1"),r,t)}function o(e,t){var r=i(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return r!==t+";"?r.replace(w," or ($1)").substring(4):"("+t+")"}function s(e,t,r,n,i,a,o,s,c,l){for(var d,f=0,p=t;f<N;++f)switch(d=R[f].call(u,e,p,r,n,i,a,o,s,c,l)){case void 0:case!1:case!0:case null:break;default:p=d}if(p!==t)return p}function c(e){return void 0!==(e=e.prefix)&&(O=null,e?"function"!=typeof e?x=1:(x=2,O=e):x=0),c}function u(e,r){var n=e;if(33>n.charCodeAt(0)&&(n=n.trim()),n=[n],0<N){var i=s(-1,r,n,n,I,A,0,0,0,0);void 0!==i&&"string"==typeof i&&(r=i)}var a=t(P,n,r,0,0);return 0<N&&(void 0!==(i=s(-2,a,n,n,I,A,a.length,0,0,0))&&(a=i)),"",_=0,A=I=1,a}var l=/^\0+/g,d=/[\0\r\f]/g,f=/: */g,p=/zoo|gra/,h=/([,: ])(transform)/g,g=/,\r+?/g,m=/([\t\r\n ])*\f?&/g,y=/@(k\w+)\s*(\S*)\s*/,v=/::(place)/g,b=/:(read-only)/g,C=/[svh]\w+-[tblr]{2}/,E=/\(\s*(.*)\s*\)/g,w=/([\s\S]*?);/g,k=/-self|flex-/g,S=/[^]*?(:[rp][el]a[\w-]+)[^]*/,B=/stretch|:\s*\w+\-(?:conte|avail)/,T=/([^-])(image-set\()/,A=1,I=1,_=0,x=1,P=[],R=[],N=0,O=null,L=0;return u.use=function e(t){switch(t){case void 0:case null:N=R.length=0;break;default:if("function"==typeof t)R[N++]=t;else if("object"==typeof t)for(var r=0,n=t.length;r<n;++r)e(t[r]);else L=0|!!t}return e},u.set=c,void 0!==e&&c(e),u}var _w={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function xw(e){var t={};return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}var Pw=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Rw=xw((function(e){return Pw.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),Nw="function"==typeof Symbol&&Symbol.for,Ow=Nw?Symbol.for("react.element"):60103,Lw=Nw?Symbol.for("react.portal"):60106,Dw=Nw?Symbol.for("react.fragment"):60107,Uw=Nw?Symbol.for("react.strict_mode"):60108,Mw=Nw?Symbol.for("react.profiler"):60114,Vw=Nw?Symbol.for("react.provider"):60109,jw=Nw?Symbol.for("react.context"):60110,Fw=Nw?Symbol.for("react.async_mode"):60111,zw=Nw?Symbol.for("react.concurrent_mode"):60111,Kw=Nw?Symbol.for("react.forward_ref"):60112,qw=Nw?Symbol.for("react.suspense"):60113,Hw=Nw?Symbol.for("react.suspense_list"):60120,Qw=Nw?Symbol.for("react.memo"):60115,Gw=Nw?Symbol.for("react.lazy"):60116,Ww=Nw?Symbol.for("react.block"):60121,Xw=Nw?Symbol.for("react.fundamental"):60117,Yw=Nw?Symbol.for("react.responder"):60118,$w=Nw?Symbol.for("react.scope"):60119;function Zw(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case Ow:switch(e=e.type){case Fw:case zw:case Dw:case Mw:case Uw:case qw:return e;default:switch(e=e&&e.$$typeof){case jw:case Kw:case Gw:case Qw:case Vw:return e;default:return t}}case Lw:return t}}}function Jw(e){return Zw(e)===zw}var ek=Fw,tk=zw,rk=jw,nk=Vw,ik=Ow,ak=Kw,ok=Dw,sk=Gw,ck=Qw,uk=Lw,lk=Mw,dk=Uw,fk=qw,pk=function(e){return Jw(e)||Zw(e)===Fw},hk=Jw,gk=function(e){return Zw(e)===jw},mk=function(e){return Zw(e)===Vw},yk=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Ow},vk=function(e){return Zw(e)===Kw},bk=function(e){return Zw(e)===Dw},Ck=function(e){return Zw(e)===Gw},Ek=function(e){return Zw(e)===Qw},wk=function(e){return Zw(e)===Lw},kk=function(e){return Zw(e)===Mw},Sk=function(e){return Zw(e)===Uw},Bk=function(e){return Zw(e)===qw},Tk=function(e){return"string"==typeof e||"function"==typeof e||e===Dw||e===zw||e===Mw||e===Uw||e===qw||e===Hw||"object"==typeof e&&null!==e&&(e.$$typeof===Gw||e.$$typeof===Qw||e.$$typeof===Vw||e.$$typeof===jw||e.$$typeof===Kw||e.$$typeof===Xw||e.$$typeof===Yw||e.$$typeof===$w||e.$$typeof===Ww)},Ak=Zw,Ik={AsyncMode:ek,ConcurrentMode:tk,ContextConsumer:rk,ContextProvider:nk,Element:ik,ForwardRef:ak,Fragment:ok,Lazy:sk,Memo:ck,Portal:uk,Profiler:lk,StrictMode:dk,Suspense:fk,isAsyncMode:pk,isConcurrentMode:hk,isContextConsumer:gk,isContextProvider:mk,isElement:yk,isForwardRef:vk,isFragment:bk,isLazy:Ck,isMemo:Ek,isPortal:wk,isProfiler:kk,isStrictMode:Sk,isSuspense:Bk,isValidElementType:Tk,typeOf:Ak},_k=(s((function(e,t){})),s((function(e){e.exports=Ik}))),xk={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Pk={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Rk={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Nk={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Ok={};function Lk(e){return _k.isMemo(e)?Nk:Ok[e.$$typeof]||xk}Ok[_k.ForwardRef]=Rk,Ok[_k.Memo]=Nk;var Dk=Object.defineProperty,Uk=Object.getOwnPropertyNames,Mk=Object.getOwnPropertySymbols,Vk=Object.getOwnPropertyDescriptor,jk=Object.getPrototypeOf,Fk=Object.prototype;function zk(e,t,r){if("string"!=typeof t){if(Fk){var n=jk(t);n&&n!==Fk&&zk(e,n,r)}var i=Uk(t);Mk&&(i=i.concat(Mk(t)));for(var a=Lk(e),o=Lk(t),s=0;s<i.length;++s){var c=i[s];if(!(Pk[c]||r&&r[c]||o&&o[c]||a&&a[c])){var u=Vk(t,c);try{Dk(e,c,u)}catch(e){}}}}return e}var Kk=zk;function qk(){return(qk=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var Hk=function(e,t){for(var r=[e[0]],n=0,i=t.length;n<i;n+=1)r.push(t[n],e[n+1]);return r},Qk=function(e){return null!==e&&"object"==typeof e&&"[object Object]"===(e.toString?e.toString():Object.prototype.toString.call(e))&&!Aw.typeOf(e)},Gk=Object.freeze([]),Wk=Object.freeze({});function Xk(e){return"function"==typeof e}function Yk(e){return e.displayName||e.name||"Component"}function $k(e){return e&&"string"==typeof e.styledComponentId}var Zk="undefined"!=typeof process&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",Jk="undefined"!=typeof window&&"HTMLElement"in window,eS=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY&&("false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY)),tS={};function rS(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];throw new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(r.length>0?" Args: "+r.join(", "):""))}var nS=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,r=0;r<e;r++)t+=this.groupSizes[r];return t},t.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var r=this.groupSizes,n=r.length,i=n;e>=i;)(i<<=1)<0&&rS(16,""+e);this.groupSizes=new Uint32Array(i),this.groupSizes.set(r),this.length=i;for(var a=n;a<i;a++)this.groupSizes[a]=0}for(var o=this.indexOfGroup(e+1),s=0,c=t.length;s<c;s++)this.tag.insertRule(o,t[s])&&(this.groupSizes[e]++,o++)},t.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],r=this.indexOfGroup(e),n=r+t;this.groupSizes[e]=0;for(var i=r;i<n;i++)this.tag.deleteRule(r)}},t.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var r=this.groupSizes[e],n=this.indexOfGroup(e),i=n+r,a=n;a<i;a++)t+=this.tag.getRule(a)+"/*!sc*/\n";return t},e}(),iS=new Map,aS=new Map,oS=1,sS=function(e){if(iS.has(e))return iS.get(e);for(;aS.has(oS);)oS++;var t=oS++;return iS.set(e,t),aS.set(t,e),t},cS=function(e){return aS.get(e)},uS=function(e,t){iS.set(e,t),aS.set(t,e)},lS="style["+Zk+'][data-styled-version="5.2.1"]',dS=new RegExp("^"+Zk+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),fS=function(e,t,r){for(var n,i=r.split(","),a=0,o=i.length;a<o;a++)(n=i[a])&&e.registerName(t,n)},pS=function(e,t){for(var r=t.innerHTML.split("/*!sc*/\n"),n=[],i=0,a=r.length;i<a;i++){var o=r[i].trim();if(o){var s=o.match(dS);if(s){var c=0|parseInt(s[1],10),u=s[2];0!==c&&(uS(u,c),fS(e,u,s[3]),e.getTag().insertRules(c,n)),n.length=0}else n.push(o)}}},hS=function(){return"undefined"!=typeof __webpack_nonce__?__webpack_nonce__:null},gS=function(e){var t=document.head,r=e||t,n=document.createElement("style"),i=function(e){for(var t=e.childNodes,r=t.length;r>=0;r--){var n=t[r];if(n&&1===n.nodeType&&n.hasAttribute(Zk))return n}}(r),a=void 0!==i?i.nextSibling:null;n.setAttribute(Zk,"active"),n.setAttribute("data-styled-version","5.2.1");var o=hS();return o&&n.setAttribute("nonce",o),r.insertBefore(n,a),n},mS=function(){function e(e){var t=this.element=gS(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,r=0,n=t.length;r<n;r++){var i=t[r];if(i.ownerNode===e)return i}rS(17)}(t),this.length=0}var t=e.prototype;return t.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},t.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},t.getRule=function(e){var t=this.sheet.cssRules[e];return void 0!==t&&"string"==typeof t.cssText?t.cssText:""},e}(),yS=function(){function e(e){var t=this.element=gS(e);this.nodes=t.childNodes,this.length=0}var t=e.prototype;return t.insertRule=function(e,t){if(e<=this.length&&e>=0){var r=document.createTextNode(t),n=this.nodes[e];return this.element.insertBefore(r,n||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),vS=function(){function e(e){this.rules=[],this.length=0}var t=e.prototype;return t.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},t.deleteRule=function(e){this.rules.splice(e,1),this.length--},t.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),bS=Jk,CS={isServer:!Jk,useCSSOMInjection:!eS},ES=function(){function e(e,t,r){void 0===e&&(e=Wk),void 0===t&&(t={}),this.options=qk({},CS,{},e),this.gs=t,this.names=new Map(r),!this.options.isServer&&Jk&&bS&&(bS=!1,function(e){for(var t=document.querySelectorAll(lS),r=0,n=t.length;r<n;r++){var i=t[r];i&&"active"!==i.getAttribute(Zk)&&(pS(e,i),i.parentNode&&i.parentNode.removeChild(i))}}(this))}e.registerId=function(e){return sS(e)};var t=e.prototype;return t.reconstructWithOptions=function(t,r){return void 0===r&&(r=!0),new e(qk({},this.options,{},t),this.gs,r&&this.names||void 0)},t.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},t.getTag=function(){return this.tag||(this.tag=(r=(t=this.options).isServer,n=t.useCSSOMInjection,i=t.target,e=r?new vS(i):n?new mS(i):new yS(i),new nS(e)));var e,t,r,n,i},t.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},t.registerName=function(e,t){if(sS(e),this.names.has(e))this.names.get(e).add(t);else{var r=new Set;r.add(t),this.names.set(e,r)}},t.insertRules=function(e,t,r){this.registerName(e,t),this.getTag().insertRules(sS(e),r)},t.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},t.clearRules=function(e){this.getTag().clearGroup(sS(e)),this.clearNames(e)},t.clearTag=function(){this.tag=void 0},t.toString=function(){return function(e){for(var t=e.getTag(),r=t.length,n="",i=0;i<r;i++){var a=cS(i);if(void 0!==a){var o=e.names.get(a),s=t.getGroup(i);if(void 0!==o&&0!==s.length){var c=Zk+".g"+i+'[id="'+a+'"]',u="";void 0!==o&&o.forEach((function(e){e.length>0&&(u+=e+",")})),n+=""+s+c+'{content:"'+u+'"}/*!sc*/\n'}}}return n}(this)},e}(),wS=/(a)(d)/gi,kS=function(e){return String.fromCharCode(e+(e>25?39:97))};function SS(e){var t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=kS(t%52)+r;return(kS(t%52)+r).replace(wS,"$1-$2")}var BS=function(e,t){for(var r=t.length;r;)e=33*e^t.charCodeAt(--r);return e},TS=function(e){return BS(5381,e)};function AS(e){for(var t=0;t<e.length;t+=1){var r=e[t];if(Xk(r)&&!$k(r))return!1}return!0}var IS=TS("5.2.1"),_S=function(){function e(e,t,r){this.rules=e,this.staticRulesId="",this.isStatic=(void 0===r||r.isStatic)&&AS(e),this.componentId=t,this.baseHash=BS(IS,t),this.baseStyle=r,ES.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,r){var n=this.componentId,i=[];if(this.baseStyle&&i.push(this.baseStyle.generateAndInjectStyles(e,t,r)),this.isStatic&&!r.hash)if(this.staticRulesId&&t.hasNameForId(n,this.staticRulesId))i.push(this.staticRulesId);else{var a=QS(this.rules,e,t,r).join(""),o=SS(BS(this.baseHash,a.length)>>>0);if(!t.hasNameForId(n,o)){var s=r(a,"."+o,void 0,n);t.insertRules(n,o,s)}i.push(o),this.staticRulesId=o}else{for(var c=this.rules.length,u=BS(this.baseHash,r.hash),l="",d=0;d<c;d++){var f=this.rules[d];if("string"==typeof f)l+=f;else if(f){var p=QS(f,e,t,r),h=Array.isArray(p)?p.join(""):p;u=BS(u,h+d),l+=h}}if(l){var g=SS(u>>>0);if(!t.hasNameForId(n,g)){var m=r(l,"."+g,void 0,n);t.insertRules(n,g,m)}i.push(g)}}return i.join(" ")},e}(),xS=/^\s*\/\/.*$/gm,PS=[":","[",".","#"];function RS(e){var t,r,n,i,a=void 0===e?Wk:e,o=a.options,s=void 0===o?Wk:o,c=a.plugins,u=void 0===c?Gk:c,l=new Iw(s),d=[],f=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(r,n,i,a,o,s,c,u,l,d){switch(r){case 1:if(0===l&&64===n.charCodeAt(0))return e(n+";"),"";break;case 2:if(0===u)return n+"/*|*/";break;case 3:switch(u){case 102:case 112:return e(i[0]+n),"";default:return n+(0===d?"/*|*/":"")}case-2:n.split("/*|*/}").forEach(t)}}}((function(e){d.push(e)})),p=function(e,n,a){return 0===n&&PS.includes(a[r.length])||a.match(i)?e:"."+t};function h(e,a,o,s){void 0===s&&(s="&");var c=e.replace(xS,""),u=a&&o?o+" "+a+" { "+c+" }":c;return t=s,r=a,n=new RegExp("\\"+r+"\\b","g"),i=new RegExp("(\\"+r+"\\b){2,}"),l(o||!a?"":a,u)}return l.use([].concat(u,[function(e,t,i){2===e&&i.length&&i[0].lastIndexOf(r)>0&&(i[0]=i[0].replace(n,p))},f,function(e){if(-2===e){var t=d;return d=[],t}}])),h.hash=u.length?u.reduce((function(e,t){return t.name||rS(15),BS(e,t.name)}),5381).toString():"",h}var NS=SC.createContext(),OS=(NS.Consumer,SC.createContext()),LS=(OS.Consumer,new ES),DS=RS();function US(){return SC.useContext(NS)||LS}function MS(){return SC.useContext(OS)||DS}var VS=function(){function e(e,t){var r=this;this.inject=function(e,t){void 0===t&&(t=DS);var n=r.name+t.hash;e.hasNameForId(r.id,n)||e.insertRules(r.id,n,t(r.rules,n,"@keyframes"))},this.toString=function(){return rS(12,String(r.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=DS),this.name+e.hash},e}(),jS=/([A-Z])/,FS=/([A-Z])/g,zS=/^ms-/,KS=function(e){return"-"+e.toLowerCase()};function qS(e){return jS.test(e)?e.replace(FS,KS).replace(zS,"-ms-"):e}var HS=function(e){return null==e||!1===e||""===e};function QS(e,t,r,n){if(Array.isArray(e)){for(var i,a=[],o=0,s=e.length;o<s;o+=1)""!==(i=QS(e[o],t,r,n))&&(Array.isArray(i)?a.push.apply(a,i):a.push(i));return a}return HS(e)?"":$k(e)?"."+e.styledComponentId:Xk(e)?"function"!=typeof(c=e)||c.prototype&&c.prototype.isReactComponent||!t?e:QS(e(t),t,r,n):e instanceof VS?r?(e.inject(r,n),e.getName(n)):e:Qk(e)?function e(t,r){var n,i,a=[];for(var o in t)t.hasOwnProperty(o)&&!HS(t[o])&&(Qk(t[o])?a.push.apply(a,e(t[o],o)):Xk(t[o])?a.push(qS(o)+":",t[o],";"):a.push(qS(o)+": "+(n=o,(null==(i=t[o])||"boolean"==typeof i||""===i?"":"number"!=typeof i||0===i||n in _w?String(i).trim():i+"px")+";")));return r?[r+" {"].concat(a,["}"]):a}(e):e.toString();var c}function GS(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return Xk(e)||Qk(e)?QS(Hk(Gk,[e].concat(r))):0===r.length&&1===e.length&&"string"==typeof e[0]?e:QS(Hk(e,r))}var WS=function(e,t,r){return void 0===r&&(r=Wk),e.theme!==r.theme&&e.theme||t||r.theme},XS=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,YS=/(^-|-$)/g;function $S(e){return e.replace(XS,"-").replace(YS,"")}var ZS=function(e){return SS(TS(e)>>>0)};function JS(e){return"string"==typeof e&&!0}var eB=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},tB=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function rB(e,t,r){var n=e[r];eB(t)&&eB(n)?nB(n,t):e[r]=t}function nB(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(var i=0,a=r;i<a.length;i++){var o=a[i];if(eB(o))for(var s in o)tB(s)&&rB(e,o[s],s)}return e}var iB=SC.createContext();iB.Consumer;function aB(e){var t=SC.useContext(iB),r=SC.useMemo((function(){return function(e,t){return e?Xk(e)?e(t):Array.isArray(e)||"object"!=typeof e?rS(8):t?qk({},t,{},e):e:rS(14)}(e.theme,t)}),[e.theme,t]);return e.children?SC.createElement(iB.Provider,{value:r},e.children):null}var oB={};function sB(e,t,r){var n=$k(e),i=!JS(e),a=t.attrs,o=void 0===a?Gk:a,s=t.componentId,c=void 0===s?function(e,t){var r="string"!=typeof e?"sc":$S(e);oB[r]=(oB[r]||0)+1;var n=r+"-"+ZS("5.2.1"+r+oB[r]);return t?t+"-"+n:n}(t.displayName,t.parentComponentId):s,u=t.displayName,l=void 0===u?function(e){return JS(e)?"styled."+e:"Styled("+Yk(e)+")"}(e):u,d=t.displayName&&t.componentId?$S(t.displayName)+"-"+t.componentId:t.componentId||c,f=n&&e.attrs?Array.prototype.concat(e.attrs,o).filter(Boolean):o,p=t.shouldForwardProp;n&&e.shouldForwardProp&&(p=t.shouldForwardProp?function(r,n){return e.shouldForwardProp(r,n)&&t.shouldForwardProp(r,n)}:e.shouldForwardProp);var h,g=new _S(r,d,n?e.componentStyle:void 0),m=g.isStatic&&0===o.length,y=function(e,t){return function(e,t,r,n){var i=e.attrs,a=e.componentStyle,o=e.defaultProps,s=e.foldedComponentIds,c=e.shouldForwardProp,u=e.styledComponentId,l=e.target,d=function(e,t,r){void 0===e&&(e=Wk);var n=qk({},t,{theme:e}),i={};return r.forEach((function(e){var t,r,a,o=e;for(t in Xk(o)&&(o=o(n)),o)n[t]=i[t]="className"===t?(r=i[t],a=o[t],r&&a?r+" "+a:r||a):o[t]})),[n,i]}(WS(t,SC.useContext(iB),o)||Wk,t,i),f=d[0],p=d[1],h=function(e,t,r,n){var i=US(),a=MS();return t?e.generateAndInjectStyles(Wk,i,a):e.generateAndInjectStyles(r,i,a)}(a,n,f),g=r,m=p.$as||t.$as||p.as||t.as||l,y=JS(m),v=p!==t?qk({},t,{},p):t,b={};for(var C in v)"$"!==C[0]&&"as"!==C&&("forwardedAs"===C?b.as=v[C]:(c?c(C,Rw):!y||Rw(C))&&(b[C]=v[C]));return t.style&&p.style!==t.style&&(b.style=qk({},t.style,{},p.style)),b.className=Array.prototype.concat(s,u,h!==u?h:null,t.className,p.className).filter(Boolean).join(" "),b.ref=g,SC.createElement(m,b)}(h,e,t,m)};return y.displayName=l,(h=SC.forwardRef(y)).attrs=f,h.componentStyle=g,h.displayName=l,h.shouldForwardProp=p,h.foldedComponentIds=n?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):Gk,h.styledComponentId=d,h.target=n?e.target:e,h.withComponent=function(e){var n=t.componentId,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(t,["componentId"]),a=n&&n+"-"+(JS(e)?e:$S(Yk(e)));return sB(e,qk({},i,{attrs:f,componentId:a}),r)},Object.defineProperty(h,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=n?nB({},e.defaultProps,t):t}}),h.toString=function(){return"."+h.styledComponentId},i&&Kk(h,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),h}var cB=function(e){return function e(t,r,n){if(void 0===n&&(n=Wk),!Aw.isValidElementType(r))return rS(1,String(r));var i=function(){return t(r,n,GS.apply(void 0,arguments))};return i.withConfig=function(i){return e(t,r,qk({},n,{},i))},i.attrs=function(i){return e(t,r,qk({},n,{attrs:Array.prototype.concat(n.attrs,i).filter(Boolean)}))},i}(sB,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){cB[e]=cB(e)}));var uB=function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=AS(e),ES.registerId(this.componentId+1)}var t=e.prototype;return t.createStyles=function(e,t,r,n){var i=n(QS(this.rules,t,r,n).join(""),""),a=this.componentId+e;r.insertRules(a,a,i)},t.removeStyles=function(e,t){t.clearRules(this.componentId+e)},t.renderStyles=function(e,t,r,n){e>2&&ES.registerId(this.componentId+e),this.removeStyles(e,r),this.createStyles(e,t,r,n)},e}();function lB(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var i=GS.apply(void 0,[e].concat(r)),a="sc-global-"+ZS(JSON.stringify(i)),o=new uB(i,a);function s(e){var t=US(),r=MS(),n=SC.useContext(iB),i=SC.useRef(t.allocateGSInstance(a)).current;return SC.useLayoutEffect((function(){return c(i,e,t,n,r),function(){return o.removeStyles(i,t)}}),[i,e,t,n,r]),null}function c(e,t,r,n,i){if(o.isStatic)o.renderStyles(e,tS,r,i);else{var a=qk({},t,{theme:WS(t,n,s.defaultProps)});o.renderStyles(e,a,r,i)}}return SC.memo(s)}function dB(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var i=GS.apply(void 0,[e].concat(r)).join(""),a=ZS(i);return new VS(a,i)}var fB={not_supported:{code:"not_supported",msg:{en:"Camera is not well-supported on this device/browser. Please try another one.",vi:"Camera không được hỗ trợ. Vui lòng thử trình duyệt hoặc thiết bị khác."}},camera_timeout:{code:"camera_timeout",msg:{en:"Can't access camera. Please check camera permission, try again or try another browser/device",vi:"Không thể truy cập camera trong thời gian cho phép. Vui lòng kiểm tra quyền truy cập camera, thử lại hoặc thử trên trình duyệt/thiết bị khác."}},wrong_orientation:{code:"wrong_orientation",msg:{en:"You are using landscape mode. Please rotate screen to portrait mode and retry.",vi:"Bạn đang sử dụng chế độ màn hình xoay ngang. Vui lòng quay màn hình theo chiều dọc và thực hiện lại."}},unable_to_load_model:{code:"unable_to_load_model",msg:{en:"Unable to load model on this device/browser. Please try another one.",vi:"Không thể load model. Vui lòng thử trình duyệt hoặc thiết bị khác."}},no_permission:{code:"no_permission",msg:{en:"Please grant the permission to access the camera.",vi:"Vui lòng cấp quyền để truy cập camera."}},no_face:{code:"no_face",msg:{en:"Face not found",vi:"Không tìm thấy khuôn mặt"}},partial_face:{code:"partial_face",msg:{en:"Face out of the box",vi:"Không tìm thấy toàn bộ khuôn mặt"}},multiple_faces:{code:"multiple_faces",msg:{en:"Too many faces",vi:"Quá nhiều khuôn mặt"}},face_too_small:{code:"face_too_small",msg:{en:"Face too small",vi:"Khuôn mặt quá nhỏ"}},face_too_large:{code:"face_too_large",msg:{en:"Face too large",vi:"Khuôn mặt quá to"}},face_out_of_box:{code:"face_out_of_box",msg:{en:"Face is out of box",vi:"Khuôn mặt không nằm trọn vẹn trong khung ảnh"}},liveness_too_fast:{code:"liveness_too_fast",msg:{en:"Please turn your face SLOWLY",vi:"Vui lòng quay CHẬM lại"}},liveness_terminated:{code:"liveness_terminated",msg:{en:"Please try again.",vi:"Vui lòng thực hiện lại."}},liveness_terminated_face_tracking:{code:"liveness_terminated_face_tracking",msg:{en:"You need to turn your face SLOWLY.\nPlease try again.",vi:"Bạn cần quay CHẬM lại.\nVui lòng thực hiện lại."}},liveness_terminated_no_face:{code:"liveness_terminated_no_face",msg:{en:"Your face was missing for too long.\nPlease try again.",vi:"Khuôn mặt không nằm trong khung hình.\nXin vui lòng thử lại."}},liveness_terminated_time_out:{code:"liveness_terminated_time_out",msg:{en:"You need to complete gestures as instructed within <%= x %> seconds.\nPlease try again.",vi:"Bạn cần hoàn thành động tác theo chỉ dẫn trong <%= x %> giây.\nXin vui lòng thử lại."}},card_sanity_not_good:{code:"card_sanity_not_good",msg:{en:"Card sanity not good",vi:"Card sanity chưa đạt"}},api_call_error:{code:"api_call_error",msg:{en:"Api call error",vi:"Lỗi call api"}},upload_error:{code:"upload_error",msg:{en:"Upload error",vi:"Lỗi upload"}},sanity_check_error:{code:"sanity_check_error",msg:{en:"Sanity check error",vi:"Lỗi check sanity"}},read_id_card_error:{code:"read_id_card_error",msg:{en:"Read id card error",vi:"Lỗi read id card"}},detect_id_tampering_error:{code:"detect_id_tampering_error",msg:{en:"Detect id tampering error",vi:"Lỗi detect id tampering"}},detect_id_card_error:{code:"detect_id_card_error",msg:{en:"Can't detect id card type",vi:"Không thể detect id card type"}},missing_front_id_card:{code:"missing_front_id_card",msg:{en:"Missing front id",vi:"Không tìm thấy front id"}},server_error:{code:"server_error",msg:"Server error"},client_web_setting_not_found:{code:"client_web_setting_not_found",msg:"Client Web Setting Not Found"},id_detector_validate_angle_error:{code:"id_detector_validate_angle_error",msg:{en:"Please place ID card straight, not tilted",vi:"Vui lòng đặt giấy tờ thẳng, không bị nghiêng khi chụp"}},id_detector_no_cards:{code:"id_detector_no_cards",msg:{en:"Please capture the <%= side %> side of ID card\n (occupy 50-95% of the frame)",vi:"Vui lòng chụp mặt <%= side %> của giấy tờ\n (chiếm 50-95% khung hình)"}},id_detector_card_too_small:{code:"id_detector_card_too_small",msg:{en:"Please move ID card CLOSER\n (occupy 50-95% of the frame)",vi:"Vui lòng đưa giấy tờ lại GẦN hơn\n (chiếm 50-95% khung hình)"}},id_detector_error_incomplete:{code:"id_detector_error_incomplete",msg:{en:"Please move ID card FARTHER\n (occupy 50-95% of the frame)",vi:"Vui lòng đưa giấy tờ ra XA hơn\n (chiếm 50-95% khung hình)"}},glare_detected:{code:"glare_detected",msg:{en:"Glare is detected. Please adjust the shooting angle",vi:"Ảnh bị chói / lóa. Vui lòng điều chỉnh góc chụp."}},id_detector_error_front_side_no_faces:{code:"id_detector_error_front_side_no_faces",msg:{en:"Please capture the front side of ID card",vi:"Vui lòng chụp mặt trước của giấy tờ"}},id_detector_error_front_side_multiple_faces:{code:"id_detector_error_front_side_multiple_faces",msg:{en:"Please capture the front side of one ID card only (remove other items out of the frame)",vi:"Vui lòng chụp mặt trước 1 giấy tờ duy nhất"}},id_detector_error_back_side_has_faces:{code:"id_detector_error_back_side_has_faces",msg:{en:"Please capture the back side of ID card",vi:"Vui lòng chụp mặt sau của giấy tờ"}},id_detector_error_blur:{code:"id_detector_error_blur",msg:{en:"Blurry photo detected. Please capture again for a clearer image",vi:"Ảnh bị mờ. Vui lòng chụp lại để có ảnh rõ nét hơn"}}},pB={FRONTAL:"frontal",LEFT:"left",RIGHT:"right",UP:"up",DOWN:"down"},hB=Object.freeze({__proto__:null,ErrorDuration:{SHORT:500,LONG:1500,TERMINATE:3e3},Errors:fB,FaceDirection:pB,Mode:{ACTIVE:"active",PASSIVE:"passive"},Messages:{REMAIN_TIME:{en:"Remaining time: <%= x %> seconds",vi:"Thời gian còn lại: <%= x %> giây"}},IDCardSide:{FRONT:"front",BACK:"back"},IDCardType:{VN:"vn.national_id"},IDCardMessage:{REMAINING_TIME:{en:"Remaining time: <%= x %> seconds",vi:"Thời gian còn lại: <%= x %> giây"},TIMEOUT_INSTRUCTION:{en:"You need to take the picture within <%= x %> seconds.\nPlease try again.",vi:"Bạn cần hoàn thành việc chụp giấy tờ trong <%= x %> giây.\nVui lòng thử lại."}}}),gB=SC.createContext();function mB(e){var t=e.value,r=e.children;return SC.createElement(gB.Provider,{value:t},r)}function yB(){var e=SC.useContext(gB);if(void 0===e)throw new Error("useSDKSettings must be used within a SDKSettingsProvider");return e}mB.propTypes={value:SE.shape({lang:SE.string,assetRoot:SE.string,apiClient:SE.shape({})}).isRequired,children:SE.node.isRequired};var vB=Object.freeze({__proto__:null,SDKSettingsProvider:mB,useSDKSettings:yB});function bB(e,t,r,n,i,a,o){try{var s=e[a](o),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}function CB(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var a=e.apply(t,r);function o(e){bB(a,n,i,o,s,"next",e)}function s(e){bB(a,n,i,o,s,"throw",e)}o(void 0)}))}}function EB(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function kB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?wB(Object(r),!0).forEach((function(t){EB(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function SB(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function BB(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}}(e,t)||AB(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function TB(e){return function(e){if(Array.isArray(e))return IB(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||AB(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function AB(e,t){if(e){if("string"==typeof e)return IB(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?IB(e,t):void 0}}function IB(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _B(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=AB(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}var xB="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function PB(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function RB(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return OB(null==t&&r.path)}},r.exports),r.exports}function NB(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})})),t}function OB(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var LB,DB=NB(Object.freeze({__proto__:null,default:{}})),UB=PB(RB((function(e,t){!function(e,t){t=t&&t.hasOwnProperty("default")?t.default:t;var r=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.post("/v1/read_id_card_info_sync",e,t)},e}(),n=function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};
|
7
|
+
/*! *****************************************************************************
|
8
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
9
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
10
|
+
this file except in compliance with the License. You may obtain a copy of the
|
11
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
|
13
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
15
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
16
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
17
|
+
|
18
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
19
|
+
and limitations under the License.
|
20
|
+
***************************************************************************** */function i(e,t,r,n){var i,a=arguments.length,o=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==("undefined"==typeof Reflect?"undefined":Iv(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,r,o):i(t,r))||o);return a>3&&o&&Object.defineProperty(t,r,o),o}function a(e,t){if("object"==("undefined"==typeof Reflect?"undefined":Iv(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function o(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))}function s(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}var c=function(){function e(e){this.httpClient=e}return e.prototype.uploadImage=function(e){return this.httpClient.postFormData("/v1/images",e)},e.prototype.request=function(e){var t="application/pdf"===e.file.type;return this.httpClient.postFormData(t?"/v1/files":"/v1/images",e)},e.prototype.requestWithHeaders=function(e,t){return this.httpClient.postFormData("/v1/images",e,t)},e.prototype.download=function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return[4,this.httpClient.downloadFile("/v1/images/"+e)];case 1:return t=r.sent(),[4,URL.createObjectURL(t)];case 2:return[2,r.sent()]}}))}))},e.prototype.updateMetadata=function(e,t){return this.httpClient.patch("/v1/images/"+e,t)},e}(),u=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.post("/v1/files",e,t)},e.prototype.uploadFile=function(e){return this.httpClient.postFormData("/v1/files",e)},e.prototype.requestWithHeaders=function(e,t){return this.httpClient.postFormData("/v1/files",e,t)},e}(),l=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.post("/v1/compare_faces_sync",e,t)},e}(),d=function(){function e(e){this.httpClient=e}return e.prototype.getClientSettings=function(){return this.httpClient.get("/v1/client_settings")},e.prototype.request=function(){return this.httpClient.get("/v1/client_settings")},e}(),f=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.post("/v1/verify_face_liveness_sync",e,t)},e}(),p=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.post("/v1/verify_id_card_sanity_sync",e,t)},e}(),h=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.post("/v1/verify_portrait_sanity_sync",e,t)},e}(),g=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.post("/v1/detect_id_card_tampering_sync",e,t)},e.prototype.requestWithAuthHeaders=function(e,t){return this.httpClient.post("/v1/detect_id_card_tampering_sync",e,t)},e}(),m=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.post("/v1/search_faces_sync",e,t)},e.prototype.indexFaces=function(e,t){return this.httpClient.post("/v1/index_faces_sync",e,t)},e.prototype.deleteFaces=function(e,t){return this.httpClient.post("/v1/delete_faces",e,t)},e.prototype.downloadFaceImage=function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return[4,this.httpClient.downloadFile("/v1/face_images/"+e)];case 1:return t=r.sent(),[2,URL.createObjectURL(t)]}}))}))},e}(),y=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.postFormData("/v1/convert_pdf_sync",e,t)},e}(),v=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.post("/v1/ekyc_pdf",e,t)},e}(),b="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==xB?xB:"undefined"!=typeof self?self:{};function C(e,t){return e(t={exports:{}},t.exports),t.exports}var E=C((function(e){var t,r;t=b,r=function(){function e(e){var t=[];if(0===e.length)return"";if("string"!=typeof e[0])throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var r=e.shift();e[0]=r+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var n=0;n<e.length;n++){var i=e[n];if("string"!=typeof i)throw new TypeError("Url must be a string. Received "+i);""!==i&&(n>0&&(i=i.replace(/^[\/]+/,"")),i=n<e.length-1?i.replace(/[\/]+$/,""):i.replace(/[\/]+$/,"/"),t.push(i))}var a=t.join("/"),o=(a=a.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return o.shift()+(o.length>0?"?":"")+o.join("&")}return function(){return e("object"==Iv(arguments[0])?arguments[0]:[].slice.call(arguments))}},e.exports?e.exports=r():t.urljoin=r()}));function w(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var k=function(e,t,r,n){t=t||"&",r=r||"=";var i={};if("string"!=typeof e||0===e.length)return i;var a=/\+/g;e=e.split(t);var o=1e3;n&&"number"==typeof n.maxKeys&&(o=n.maxKeys);var s=e.length;o>0&&s>o&&(s=o);for(var c=0;c<s;++c){var u,l,d,f,p=e[c].replace(a,"%20"),h=p.indexOf(r);h>=0?(u=p.substr(0,h),l=p.substr(h+1)):(u=p,l=""),d=decodeURIComponent(u),f=decodeURIComponent(l),w(i,d)?Array.isArray(i[d])?i[d].push(f):i[d]=[i[d],f]:i[d]=f}return i},S=function(e){switch(Iv(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},B=function(e,t,r,n){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==Iv(e)?Object.keys(e).map((function(n){var i=encodeURIComponent(S(n))+r;return Array.isArray(e[n])?e[n].map((function(e){return i+encodeURIComponent(S(e))})).join(t):i+encodeURIComponent(S(e[n]))})).join(t):n?encodeURIComponent(S(n))+r+encodeURIComponent(S(e)):""},T=C((function(e,t){t.decode=t.parse=k,t.encode=t.stringify=B})),A=(T.decode,T.parse,T.encode,T.stringify),I=function(){function e(e){this.authorizer=e.authorizer,this.domain=e.domain,this.onError=e.onError,this.configHeaders=e.headers}return e.prototype.get=function(e,t,r){var n=new URL(this.resolveUrl(e));return t&&(n.search=A(t)),this.request(n.toString(),{requestPath:e,method:"GET",headers:r})},e.prototype.post=function(e,t,r){var i=this.resolveUrl(e);return this.request(i,{requestPath:e,method:"POST",body:JSON.stringify(t),headers:n({"Content-Type":"application/json"},r)})},e.prototype.postFormData=function(e,t,r){var n,i=t instanceof FormData?t:(n=t,Object.entries(n).reduce((function(e,t){var r=t[0],n=t[1];return Array.isArray(n)?n.forEach((function(t,i){return e.append(r+"["+i+"]",n)})):!(n instanceof Object)||n instanceof File||n instanceof Date||n instanceof Blob?e.append(r,n):Object.entries(n).forEach((function(t,i){return e.append(r+"["+i+"]",n[i])})),e}),new FormData)),a=this.resolveUrl(e);return this.request(a,{requestPath:e,method:"POST",body:i,headers:r})},e.prototype.patch=function(e,t,r){var i=this.resolveUrl(e);return this.request(i,{requestPath:e,method:"PATCH",body:JSON.stringify(t),headers:n({"Content-Type":"application/json"},r)})},e.prototype.delete=function(e,t,r){var i=this.resolveUrl(e);return this.request(i,{requestPath:e,method:"DELETE",body:JSON.stringify(t),headers:n({"Content-Type":"application/json"},r)})},e.prototype.downloadFile=function(e){var t=this.resolveUrl(e);return this.request(t,{requestPath:e,method:"GET"},"blob")},e.prototype.request=function(e,t,r){return void 0===r&&(r="json"),o(this,void 0,void 0,(function(){var i,a,o,c;return s(this,(function(s){switch(s.label){case 0:return i={},a={},this.authorizer&&(i=this.authorizer.getHeaders(t)),this.configHeaders&&(a=this.configHeaders),t.headers=n(n(n({},t.headers),i),a),[4,fetch(e,t)];case 1:return o=s.sent(),[4,"blob"===r?o.blob():o.json()];case 2:if((c=s.sent()).errors&&this.onError)throw this.onError(c.errors),c;return[2,c]}}))}))},e.prototype.resolveUrl=function(e){return E(this.domain,e)},e}(),_=function(){function e(e){this.mocks=e}return e.prototype.get=function(e,t){return this.findInMocks(e,t)},e.prototype.post=function(e,t){return this.findInMocks(e)},e.prototype.postFormData=function(e,t){return this.findInMocks(e)},e.prototype.patch=function(e,t){return this.findInMocks(e)},e.prototype.delete=function(e,t){return this.findInMocks(e)},e.prototype.downloadFile=function(e){return this.findInMocks(e)},e.prototype.resolveUrl=function(e){return this.mocks.resolveUrl?this.mocks.resolveUrl(e):e},e.prototype.findInMocks=function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return this.mocks[e]?"function"==typeof this.mocks[e]?[2,Promise.resolve(this.mocks[e](t))]:[2,Promise.resolve(this.mocks[e])]:[2,Promise.reject(new Error(e+" is not presented in mocks"))]}))}))},e}(),x=C((function(e,t){var r;e.exports=r=r||function(e,t){var r=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),n={},i=n.lib={},a=i.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},o=i.WordArray=a.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||c).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var a=0;a<i;a++){var o=r[a>>>2]>>>24-a%4*8&255;t[n+a>>>2]|=o<<24-(n+a)%4*8}else for(a=0;a<i;a+=4)t[n+a>>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r,n=[],i=function(t){t=t;var r=987654321,n=4294967295;return function(){var i=((r=36969*(65535&r)+(r>>16)&n)<<16)+(t=18e3*(65535&t)+(t>>16)&n)&n;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}},a=0;a<t;a+=4){var s=i(4294967296*(r||e.random()));r=987654071*s(),n.push(4294967296*s()|0)}return new o.init(n,t)}}),s=n.enc={},c=s.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var a=t[i>>>2]>>>24-i%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new o.init(r,t/2)}},u=s.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var a=t[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new o.init(r,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},d=i.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,n=r.words,i=r.sigBytes,a=this.blockSize,s=i/(4*a),c=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,u=e.min(4*c,i);if(c){for(var l=0;l<c;l+=a)this._doProcessBlock(n,l);var d=n.splice(0,c);r.sigBytes-=u}return new o.init(d,u)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),f=(i.Hasher=d.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new f.HMAC.init(e,r).finalize(t)}}}),n.algo={});return n}(Math)})),P=C((function(e,t){var r,n,i;e.exports=(n=(r=i=x).lib.WordArray,r.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],a=0;a<r;a+=3)for(var o=(t[a>>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.75*s<r;s++)i.push(n.charAt(o>>>6*(3-s)&63));var c=n.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(e){var t=e.length,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a<r.length;a++)i[r.charCodeAt(a)]=a}var o=r.charAt(64);if(o){var s=e.indexOf(o);-1!==s&&(t=s)}return function(e,t,r){for(var i=[],a=0,o=0;o<t;o++)if(o%4){var s=r[e.charCodeAt(o-1)]<<o%4*2,c=r[e.charCodeAt(o)]>>>6-o%4*2;i[a>>>2]|=(s|c)<<24-a%4*8,a++}return n.create(i,a)}(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},i.enc.Base64)})),R=(C((function(e,t){var r;e.exports=(r=x,function(e){var t=r,n=t.lib,i=n.WordArray,a=n.Hasher,o=t.algo,s=[],c=[];!function(){function t(t){for(var r=e.sqrt(t),n=2;n<=r;n++)if(!(t%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)t(n)&&(i<8&&(s[i]=r(e.pow(n,.5))),c[i]=r(e.pow(n,1/3)),i++),n++}();var u=[],l=o.SHA256=a.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],l=r[5],d=r[6],f=r[7],p=0;p<64;p++){if(p<16)u[p]=0|e[t+p];else{var h=u[p-15],g=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,m=u[p-2],y=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;u[p]=g+u[p-7]+y+u[p-16]}var v=n&i^n&a^i&a,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),C=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&d)+c[p]+u[p];f=d,d=l,l=s,s=o+C|0,o=a,a=i,i=n,n=C+(b+v)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0,r[5]=r[5]+l|0,r[6]=r[6]+d|0,r[7]=r[7]+f|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=e.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=a._createHelper(l),t.HmacSHA256=a._createHmacHelper(l)}(Math),r.SHA256)})),C((function(e,t){var r,n,i;e.exports=(n=(r=x).lib.Base,i=r.enc.Utf8,void(r.algo.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=i.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var a=this._oKey=t.clone(),o=this._iKey=t.clone(),s=a.words,c=o.words,u=0;u<r;u++)s[u]^=1549556828,c[u]^=909522486;a.sigBytes=o.sigBytes=n,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,r=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(r))}})))})),C((function(e,t){e.exports=x.HmacSHA256}))),N=function(){function e(e,t){this.accessKey=e,this.keySecret=t}return e.prototype.getHeaders=function(e){var t=function(e){function t(e){return e<10?"0"+e:e}return e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())+"T"+t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds())+(0===(r=e.getTimezoneOffset())?"Z":(n=r>0?"-":"+",r=Math.abs(r),n+t(Math.floor(r/60))+":"+t(r%60)));var r,n}(new Date);return{Authorization:this.generateAuthorization(e.requestPath,e.method,t),"X-TV-Timestamp":t}},e.prototype.generateAuthorization=function(e,t,r){var n=this.computeStringToSign(e,t,r),i=P.stringify(this.computeSignature(n));return this.formatAuthToken("TV",i)},e.prototype.formatAuthToken=function(e,t){return e+" "+this.accessKey+":"+t},e.prototype.computeStringToSign=function(e,t,r){return t+"\n"+e+"\n"+r},e.prototype.computeSignature=function(e){return R(e,this.keySecret)},e}();function O(e){switch(e){case"testing":return"https://tv-testing.trustingsocial.com/api";case"staging":return"https://tv-staging.trustingsocial.com/api";case"production":return"https://vn-vision.trustingsocial.com/api";default:return e}}function L(e,t,r,n){void 0===r&&(r="production");var i=(void 0===n?{}:n).headers,a=new N(e,t),o=O(r);return new I({authorizer:a,domain:o,headers:i})}var D=function(){function e(e){void 0===e&&(e="production");var t=new I({domain:O(e)});this.imagesService=new c(t),this.detectIDTamperingService=new g(t)}return e.prototype.uploadImage=function(e,t){return this.imagesService.requestWithHeaders(e,t)},e.prototype.detectTampering=function(e,t){return this.detectIDTamperingService.requestWithAuthHeaders(e,t)},e}();function U(e){var t=e.headerIndex;return function(e,r,i){var a=i.value,c=n({},i);return c.value=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return o(this,void 0,void 0,(function(){var r,i,o,c;return s(this,(function(s){switch(s.label){case 0:return this.transactionEnabled?[4,this.transactionManager.begin()]:[3,4];case 1:return r=s.sent(),i=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)n[i]=a[o];return n}(e),(o=n({},i[t]))["X-TV-Transaction"]=r,i[t]=o,[4,a.apply(this,i)];case 2:return c=s.sent(),[4,this.transactionManager.end()];case 3:return s.sent(),[2,c];case 4:return[4,a.apply(this,e)];case 5:return[2,s.sent()]}}))}))},c}}function M(e){return void 0===e&&(e={encryptedField:"data"}),function(t,r,i){var a=i.value,c=n({},i);return c.value=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return[4,a.apply(this,t)];case 1:return r=i.sent(),this.encryptionEnabled&&"string"==typeof r[e.encryptedField]?(n=this.encryptionService.decrypt(r[e.encryptedField],{transactionID:this.transactionManager.currentTransactionID}),[2,JSON.parse(n)]):[2,r]}}))}))},c}}var V=function(){function e(e){this.httpClient=e,this.transactionID="",this.totalTransactions=0,this.currentTransaction=0}return Object.defineProperty(e.prototype,"currentTransactionID",{get:function(){return this.transactionID},enumerable:!0,configurable:!0}),e.prototype.begin=function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.totalTransactions++,[4,new Promise((function(t,n){var i=window.performance.now(),a=setInterval((function(){e===r.currentTransaction&&(clearInterval(a),t(!0)),window.performance.now()-i>=3e3&&(clearInterval(a),n(new Error("Transaction timeout")))}),100)}))];case 1:return n.sent(),[4,this.httpClient.post("/v1/transactions",{})];case 2:return t=n.sent().data,this.transactionID=t.id,[2,t.id]}}))}))},e.prototype.end=function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return[4,this.httpClient.post("/v1/transactions/"+this.transactionID+"/finish")];case 1:return e=t.sent(),this.transactionID="",this.currentTransaction++,[2,e]}}))}))},e}(),j={options:{usePureJavaScript:!1}},F={},z=F,K={};F.encode=function(e,t,r){if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!=typeof r)throw new TypeError('"maxline" must be a number.');var n="";if(e instanceof Uint8Array){var i=0,a=t.length,o=t.charAt(0),s=[0];for(i=0;i<e.length;++i){for(var c=0,u=e[i];c<s.length;++c)u+=s[c]<<8,s[c]=u%a,u=u/a|0;for(;u>0;)s.push(u%a),u=u/a|0}for(i=0;0===e[i]&&i<e.length-1;++i)n+=o;for(i=s.length-1;i>=0;--i)n+=t[s[i]]}else n=function(e,t){var r=0,n=t.length,i=t.charAt(0),a=[0];for(r=0;r<e.length();++r){for(var o=0,s=e.at(r);o<a.length;++o)s+=a[o]<<8,a[o]=s%n,s=s/n|0;for(;s>0;)a.push(s%n),s=s/n|0}var c="";for(r=0;0===e.at(r)&&r<e.length()-1;++r)c+=i;for(r=a.length-1;r>=0;--r)c+=t[a[r]];return c}(e,t);if(r){var l=new RegExp(".{1,"+r+"}","g");n=n.match(l).join("\r\n")}return n},F.decode=function(e,t){if("string"!=typeof e)throw new TypeError('"input" must be a string.');if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');var r=K[t];if(!r){r=K[t]=[];for(var n=0;n<t.length;++n)r[t.charCodeAt(n)]=n}e=e.replace(/\s/g,"");var i=t.length,a=t.charAt(0),o=[0];for(n=0;n<e.length;n++){var s=r[e.charCodeAt(n)];if(void 0===s)return;for(var c=0,u=s;c<o.length;++c)u+=o[c]*i,o[c]=255&u,u>>=8;for(;u>0;)o.push(255&u),u>>=8}for(var l=0;e[l]===a&&l<e.length-1;++l)o.push(0);return"undefined"!=typeof Buffer?Buffer.from(o.reverse()):new Uint8Array(o.reverse())},C((function(e){var t=e.exports=j.util=j.util||{};function r(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function n(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(t.isArrayBuffer(e)||t.isArrayBufferView(e))if("undefined"!=typeof Buffer&&e instanceof Buffer)this.data=e.toString("binary");else{var r=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,r)}catch(e){for(var i=0;i<r.length;++i)this.putByte(r[i])}}else(e instanceof n||"object"==Iv(e)&&"string"==typeof e.data&&"number"==typeof e.read)&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}!function(){if("undefined"!=typeof process&&process.nextTick&&!process.browser)return t.nextTick=process.nextTick,void("function"==typeof setImmediate?t.setImmediate=setImmediate:t.setImmediate=t.nextTick);if("function"==typeof setImmediate)return t.setImmediate=function(){return setImmediate.apply(void 0,arguments)},void(t.nextTick=function(e){return setImmediate(e)});if(t.setImmediate=function(e){setTimeout(e,0)},"undefined"!=typeof window&&"function"==typeof window.postMessage){var e="forge.setImmediate",r=[];t.setImmediate=function(t){r.push(t),1===r.length&&window.postMessage(e,"*")},window.addEventListener("message",(function(t){if(t.source===window&&t.data===e){t.stopPropagation();var n=r.slice();r.length=0,n.forEach((function(e){e()}))}}),!0)}if("undefined"!=typeof MutationObserver){var n=Date.now(),i=!0,a=document.createElement("div");r=[],new MutationObserver((function(){var e=r.slice();r.length=0,e.forEach((function(e){e()}))})).observe(a,{attributes:!0});var o=t.setImmediate;t.setImmediate=function(e){Date.now()-n>15?(n=Date.now(),o(e)):(r.push(e),1===r.length&&a.setAttribute("a",i=!i))}}t.nextTick=t.setImmediate}(),t.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,t.globalScope=t.isNodejs?b:"undefined"==typeof self?window:self,t.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},t.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},t.isArrayBufferView=function(e){return e&&t.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},t.ByteBuffer=n,t.ByteStringBuffer=n,t.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},t.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},t.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},t.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},t.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},t.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},t.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(t.encodeUtf8(e))},t.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},t.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},t.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},t.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},t.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},t.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},t.ByteStringBuffer.prototype.putInt=function(e,t){r(t);var n="";do{t-=8,n+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(n)},t.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},t.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())},t.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},t.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e},t.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e},t.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e},t.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e},t.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e},t.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e},t.ByteStringBuffer.prototype.getInt=function(e){r(e);var t=0;do{t=(t<<8)+this.data.charCodeAt(this.read++),e-=8}while(e>0);return t},t.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},t.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},t.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},t.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},t.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},t.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},t.ByteStringBuffer.prototype.copy=function(){var e=t.createBuffer(this.data);return e.read=this.read,e},t.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},t.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},t.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},t.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var r=this.data.charCodeAt(t);r<16&&(e+="0"),e+=r.toString(16)}return e},t.ByteStringBuffer.prototype.toString=function(){return t.decodeUtf8(this.bytes())},t.DataBuffer=function(e,r){r=r||{},this.read=r.readOffset||0,this.growSize=r.growSize||1024;var n=t.isArrayBuffer(e),i=t.isArrayBufferView(e);if(n||i)return this.data=n?new DataView(e):new DataView(e.buffer,e.byteOffset,e.byteLength),void(this.write="writeOffset"in r?r.writeOffset:this.data.byteLength);this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!=e&&this.putBytes(e),"writeOffset"in r&&(this.write=r.writeOffset)},t.DataBuffer.prototype.length=function(){return this.write-this.read},t.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},t.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this},t.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},t.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r<t;++r)this.data.setUint8(e);return this},t.DataBuffer.prototype.putBytes=function(e,r){if(t.isArrayBufferView(e)){var n=(i=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)).byteLength-i.byteOffset;return this.accommodate(n),new Uint8Array(this.data.buffer,this.write).set(i),this.write+=n,this}if(t.isArrayBuffer(e)){var i=new Uint8Array(e);return this.accommodate(i.byteLength),new Uint8Array(this.data.buffer).set(i,this.write),this.write+=i.byteLength,this}if(e instanceof t.DataBuffer||"object"==Iv(e)&&"number"==typeof e.read&&"number"==typeof e.write&&t.isArrayBufferView(e.data))return i=new Uint8Array(e.data.byteLength,e.read,e.length()),this.accommodate(i.byteLength),new Uint8Array(e.data.byteLength,this.write).set(i),this.write+=i.byteLength,this;if(e instanceof t.ByteStringBuffer&&(e=e.data,r="binary"),r=r||"binary","string"==typeof e){var a;if("hex"===r)return this.accommodate(Math.ceil(e.length/2)),a=new Uint8Array(this.data.buffer,this.write),this.write+=t.binary.hex.decode(e,a,this.write),this;if("base64"===r)return this.accommodate(3*Math.ceil(e.length/4)),a=new Uint8Array(this.data.buffer,this.write),this.write+=t.binary.base64.decode(e,a,this.write),this;if("utf8"===r&&(e=t.encodeUtf8(e),r="binary"),"binary"===r||"raw"===r)return this.accommodate(e.length),a=new Uint8Array(this.data.buffer,this.write),this.write+=t.binary.raw.decode(a),this;if("utf16"===r)return this.accommodate(2*e.length),a=new Uint16Array(this.data.buffer,this.write),this.write+=t.text.utf16.encode(a),this;throw new Error("Invalid encoding: "+r)}throw Error("Invalid parameter: "+e)},t.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this},t.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")},t.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this},t.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},t.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},t.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},t.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},t.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},t.DataBuffer.prototype.putInt=function(e,t){r(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},t.DataBuffer.prototype.putSignedInt=function(e,t){return r(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)},t.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},t.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e},t.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e},t.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e},t.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e},t.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e},t.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e},t.DataBuffer.prototype.getInt=function(e){r(e);var t=0;do{t=(t<<8)+this.data.getInt8(this.read++),e-=8}while(e>0);return t},t.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},t.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},t.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},t.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},t.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},t.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},t.DataBuffer.prototype.copy=function(){return new t.DataBuffer(this)},t.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},t.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},t.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},t.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var r=this.data.getUint8(t);r<16&&(e+="0"),e+=r.toString(16)}return e},t.DataBuffer.prototype.toString=function(e){var r=new Uint8Array(this.data,this.read,this.length());if("binary"===(e=e||"utf8")||"raw"===e)return t.binary.raw.encode(r);if("hex"===e)return t.binary.hex.encode(r);if("base64"===e)return t.binary.base64.encode(r);if("utf8"===e)return t.text.utf8.decode(r);if("utf16"===e)return t.text.utf16.decode(r);throw new Error("Invalid encoding: "+e)},t.createBuffer=function(e,r){return r=r||"raw",void 0!==e&&"utf8"===r&&(e=t.encodeUtf8(e)),new t.ByteBuffer(e)},t.fillString=function(e,t){for(var r="";t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},t.xorBytes=function(e,t,r){for(var n="",i="",a="",o=0,s=0;r>0;--r,++o)i=e.charCodeAt(o)^t.charCodeAt(o),s>=10&&(n+=a,a="",s=0),a+=String.fromCharCode(i),++s;return n+a},t.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r<e.length;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t},t.bytesToHex=function(e){return t.createBuffer(e).toHex()},t.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],o="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";t.encode64=function(e,t){for(var r,n,a,o="",s="",c=0;c<e.length;)r=e.charCodeAt(c++),n=e.charCodeAt(c++),a=e.charCodeAt(c++),o+=i.charAt(r>>2),o+=i.charAt((3&r)<<4|n>>4),isNaN(n)?o+="==":(o+=i.charAt((15&n)<<2|a>>6),o+=isNaN(a)?"=":i.charAt(63&a)),t&&o.length>t&&(s+=o.substr(0,t)+"\r\n",o=o.substr(t));return s+o},t.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,n,i,o="",s=0;s<e.length;)t=a[e.charCodeAt(s++)-43],r=a[e.charCodeAt(s++)-43],n=a[e.charCodeAt(s++)-43],i=a[e.charCodeAt(s++)-43],o+=String.fromCharCode(t<<2|r>>4),64!==n&&(o+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(o+=String.fromCharCode((3&n)<<6|i)));return o},t.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},t.decodeUtf8=function(e){return decodeURIComponent(escape(e))},t.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:z.encode,decode:z.decode}},t.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},t.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,a=0;a<e.length;++a)n[i++]=e.charCodeAt(a);return t?i-r:n},t.binary.hex.encode=t.bytesToHex,t.binary.hex.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(Math.ceil(e.length/2)));var i=0,a=r=r||0;for(1&e.length&&(i=1,n[a++]=parseInt(e[0],16));i<e.length;i+=2)n[a++]=parseInt(e.substr(i,2),16);return t?a-r:n},t.binary.base64.encode=function(e,t){for(var r,n,a,o="",s="",c=0;c<e.byteLength;)r=e[c++],n=e[c++],a=e[c++],o+=i.charAt(r>>2),o+=i.charAt((3&r)<<4|n>>4),isNaN(n)?o+="==":(o+=i.charAt((15&n)<<2|a>>6),o+=isNaN(a)?"=":i.charAt(63&a)),t&&o.length>t&&(s+=o.substr(0,t)+"\r\n",o=o.substr(t));return s+o},t.binary.base64.decode=function(e,t,r){var n,i,o,s,c=t;c||(c=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,l=r=r||0;u<e.length;)n=a[e.charCodeAt(u++)-43],i=a[e.charCodeAt(u++)-43],o=a[e.charCodeAt(u++)-43],s=a[e.charCodeAt(u++)-43],c[l++]=n<<2|i>>4,64!==o&&(c[l++]=(15&i)<<4|o>>2,64!==s&&(c[l++]=(3&o)<<6|s));return t?l-r:c.subarray(0,l)},t.binary.base58.encode=function(e,r){return t.binary.baseN.encode(e,o,r)},t.binary.base58.decode=function(e,r){return t.binary.baseN.decode(e,o,r)},t.text={utf8:{},utf16:{}},t.text.utf8.encode=function(e,r,n){e=t.encodeUtf8(e);var i=r;i||(i=new Uint8Array(e.length));for(var a=n=n||0,o=0;o<e.length;++o)i[a++]=e.charCodeAt(o);return r?a-n:i},t.text.utf8.decode=function(e){return t.decodeUtf8(String.fromCharCode.apply(null,e))},t.text.utf16.encode=function(e,t,r){var n=t;n||(n=new Uint8Array(2*e.length));for(var i=new Uint16Array(n.buffer),a=r=r||0,o=r,s=0;s<e.length;++s)i[o++]=e.charCodeAt(s),a+=2;return t?a-r:n},t.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))},t.deflate=function(e,r,n){if(r=t.decode64(e.deflate(t.encode64(r)).rval),n){var i=2;32&r.charCodeAt(1)&&(i=6),r=r.substring(i,r.length-4)}return r},t.inflate=function(e,r,n){var i=e.inflate(t.encode64(r)).rval;return null===i?null:t.decode64(i)};var s=function(e,r,n){if(!e)throw new Error("WebStorage not available.");var i;if(null===n?i=e.removeItem(r):(n=t.encode64(JSON.stringify(n)),i=e.setItem(r,n)),void 0!==i&&!0!==i.rval){var a=new Error(i.error.message);throw a.id=i.error.id,a.name=i.error.name,a}},c=function(e,r){if(!e)throw new Error("WebStorage not available.");var n=e.getItem(r);if(e.init)if(null===n.rval){if(n.error){var i=new Error(n.error.message);throw i.id=n.error.id,i.name=n.error.name,i}n=null}else n=n.rval;return null!==n&&(n=JSON.parse(t.decode64(n))),n},u=function(e,t,r,n){var i=c(e,t);null===i&&(i={}),i[r]=n,s(e,t,i)},l=function(e,t,r){var n=c(e,t);return null!==n&&(n=r in n?n[r]:null),n},d=function(e,t,r){var n=c(e,t);if(null!==n&&r in n){delete n[r];var i=!0;for(var a in n){i=!1;break}i&&(n=null),s(e,t,n)}},f=function(e,t){s(e,t,null)},p=function(e,t,r){var n,i=null;void 0===r&&(r=["web","flash"]);var a=!1,o=null;for(var s in r){n=r[s];try{if("flash"===n||"both"===n){if(null===t[0])throw new Error("Flash local storage not available.");i=e.apply(this,t),a="flash"===n}"web"!==n&&"both"!==n||(t[0]=localStorage,i=e.apply(this,t),a=!0)}catch(e){o=e}if(a)break}if(!a)throw o;return i};t.setItem=function(e,t,r,n,i){p(u,arguments,i)},t.getItem=function(e,t,r,n){return p(l,arguments,n)},t.removeItem=function(e,t,r,n){p(d,arguments,n)},t.clearItems=function(e,t,r){p(f,arguments,r)},t.parseUrl=function(e){var t=/^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g;t.lastIndex=0;var r=t.exec(e),n=null===r?null:{full:e,scheme:r[1],host:r[2],port:r[3],path:r[4]};return n&&(n.fullHost=n.host,n.port?(80!==n.port&&"http"===n.scheme||443!==n.port&&"https"===n.scheme)&&(n.fullHost+=":"+n.port):"http"===n.scheme?n.port=80:"https"===n.scheme&&(n.port=443),n.full=n.scheme+"://"+n.fullHost),n};var h=null;t.getQueryVariables=function(e){var t,r=function(e){for(var t={},r=e.split("&"),n=0;n<r.length;n++){var i,a,o=r[n].indexOf("=");o>0?(i=r[n].substring(0,o),a=r[n].substring(o+1)):(i=r[n],a=null),i in t||(t[i]=[]),i in Object.prototype||null===a||t[i].push(unescape(a))}return t};return void 0===e?(null===h&&(h="undefined"!=typeof window&&window.location&&window.location.search?r(window.location.search.substring(1)):{}),t=h):t=r(e),t},t.parseFragment=function(e){var r=e,n="",i=e.indexOf("?");i>0&&(r=e.substring(0,i),n=e.substring(i+1));var a=r.split("/");return a.length>0&&""===a[0]&&a.shift(),{pathString:r,queryString:n,path:a,query:""===n?{}:t.getQueryVariables(n)}},t.makeRequest=function(e){var r=t.parseFragment(e),n={path:r.pathString,query:r.queryString,getPath:function(e){return void 0===e?r.path:r.path[e]},getQuery:function(e,t){var n;return void 0===e?n=r.query:(n=r.query[e])&&void 0!==t&&(n=n[t]),n},getQueryLast:function(e,t){var r=n.getQuery(e);return r?r[r.length-1]:t}};return n},t.makeLink=function(e,t,r){e=jQuery.isArray(e)?e.join("/"):e;var n=jQuery.param(t||{});return r=r||"",e+(n.length>0?"?"+n:"")+(r.length>0?"#"+r:"")},t.setPath=function(e,t,r){if("object"==Iv(e)&&null!==e)for(var n=0,i=t.length;n<i;){var a=t[n++];if(n==i)e[a]=r;else{var o=a in e;(!o||o&&"object"!=Iv(e[a])||o&&null===e[a])&&(e[a]={}),e=e[a]}}},t.getPath=function(e,t,r){for(var n=0,i=t.length,a=!0;a&&n<i&&"object"==Iv(e)&&null!==e;){var o=t[n++];(a=o in e)&&(e=e[o])}return a?e:r},t.deletePath=function(e,t){if("object"==Iv(e)&&null!==e)for(var r=0,n=t.length;r<n;){var i=t[r++];if(r==n)delete e[i];else{if(!(i in e)||"object"!=Iv(e[i])||null===e[i])break;e=e[i]}}},t.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},t.format=function(e){for(var t,r,n=/%./g,i=0,a=[],o=0;t=n.exec(e);){(r=e.substring(o,n.lastIndex-2)).length>0&&a.push(r),o=n.lastIndex;var s=t[0][1];switch(s){case"s":case"o":i<arguments.length?a.push(arguments[1+i++]):a.push("<?>");break;case"%":a.push("%");break;default:a.push("<%"+s+"?>")}}return a.push(e.substring(o)),a.join("")},t.formatNumber=function(e,t,r,n){var i=e,a=isNaN(t=Math.abs(t))?2:t,o=void 0===r?",":r,s=void 0===n?".":n,c=i<0?"-":"",u=parseInt(i=Math.abs(+i||0).toFixed(a),10)+"",l=u.length>3?u.length%3:0;return c+(l?u.substr(0,l)+s:"")+u.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+s)+(a?o+Math.abs(i-u).toFixed(a).slice(2):"")},t.formatSize=function(e){return e>=1073741824?t.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?t.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?t.formatNumber(e/1024,0)+" KiB":t.formatNumber(e,0)+" bytes"},t.bytesFromIP=function(e){return-1!==e.indexOf(".")?t.bytesFromIPv4(e):-1!==e.indexOf(":")?t.bytesFromIPv6(e):null},t.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var r=t.createBuffer(),n=0;n<e.length;++n){var i=parseInt(e[n],10);if(isNaN(i))return null;r.putByte(i)}return r.getBytes()},t.bytesFromIPv6=function(e){for(var r=0,n=2*(8-(e=e.split(":").filter((function(e){return 0===e.length&&++r,!0}))).length+r),i=t.createBuffer(),a=0;a<8;++a)if(e[a]&&0!==e[a].length){var o=t.hexToBytes(e[a]);o.length<2&&i.putByte(0),i.putBytes(o)}else i.fillWithByte(0,n),n=0;return i.getBytes()},t.bytesToIP=function(e){return 4===e.length?t.bytesToIPv4(e):16===e.length?t.bytesToIPv6(e):null},t.bytesToIPv4=function(e){if(4!==e.length)return null;for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t.join(".")},t.bytesToIPv6=function(e){if(16!==e.length)return null;for(var r=[],n=[],i=0,a=0;a<e.length;a+=2){for(var o=t.bytesToHex(e[a]+e[a+1]);"0"===o[0]&&"0"!==o;)o=o.substr(1);if("0"===o){var s=n[n.length-1],c=r.length;s&&c===s.end+1?(s.end=c,s.end-s.start>n[i].end-n[i].start&&(i=n.length-1)):n.push({start:c,end:c})}r.push(o)}if(n.length>0){var u=n[i];u.end-u.start>0&&(r.splice(u.start,u.end-u.start+1,""),0===u.start&&r.unshift(""),7===u.end&&r.push(""))}return r.join(":")},t.estimateCores=function(e,r){if("function"==typeof e&&(r=e,e={}),e=e||{},"cores"in t&&!e.update)return r(null,t.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return t.cores=navigator.hardwareConcurrency,r(null,t.cores);if("undefined"==typeof Worker)return t.cores=1,r(null,t.cores);if("undefined"==typeof Blob)return t.cores=2,r(null,t.cores);var n=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(e){var t=Date.now(),r=t+4;self.postMessage({st:t,et:r})}))}.toString(),")()"],{type:"application/javascript"}));!function e(i,a,o){if(0===a){var s=Math.floor(i.reduce((function(e,t){return e+t}),0)/i.length);return t.cores=Math.max(1,s),URL.revokeObjectURL(n),r(null,t.cores)}!function(e,t){for(var r=[],i=[],a=0;a<e;++a){var o=new Worker(n);o.addEventListener("message",(function(n){if(i.push(n.data),i.length===e){for(var a=0;a<e;++a)r[a].terminate();t(null,i)}})),r.push(o)}for(a=0;a<e;++a)r[a].postMessage(a)}(o,(function(t,r){i.push(function(e,t){for(var r=[],n=0;n<e;++n)for(var i=t[n],a=r[n]=[],o=0;o<e;++o)if(n!==o){var s=t[o];(i.st>s.st&&i.st<s.et||s.st>i.st&&s.st<i.et)&&a.push(o)}return r.reduce((function(e,t){return Math.max(e,t.length)}),0)}(o,r)),e(i,a-1,o)}))}([],5,16)}})),j.cipher=j.cipher||{},j.cipher.algorithms=j.cipher.algorithms||{},j.cipher.createCipher=function(e,t){var r=e;if("string"==typeof r&&(r=j.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new j.cipher.BlockCipher({algorithm:r,key:t,decrypt:!1})},j.cipher.createDecipher=function(e,t){var r=e;if("string"==typeof r&&(r=j.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new j.cipher.BlockCipher({algorithm:r,key:t,decrypt:!0})},j.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),j.cipher.algorithms[e]=t},j.cipher.getAlgorithm=function(e){return(e=e.toUpperCase())in j.cipher.algorithms?j.cipher.algorithms[e]:null};var q=j.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};function H(e,t){j.cipher.registerAlgorithm(e,(function(){return new j.aes.Algorithm(e,t)}))}q.prototype.start=function(e){e=e||{};var t={};for(var r in e)t[r]=e[r];t.decrypt=this._decrypt,this._finish=!1,this._input=j.util.createBuffer(),this.output=e.output||j.util.createBuffer(),this.mode.start(t)},q.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},q.prototype.finish=function(e){!e||"ECB"!==this.mode.name&&"CBC"!==this.mode.name||(this.mode.pad=function(t){return e(this.blockSize,t,!1)},this.mode.unpad=function(t){return e(this.blockSize,t,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t)||this.mode.afterFinish&&!this.mode.afterFinish(this.output,t)))},C((function(e){j.cipher=j.cipher||{};var t=e.exports=j.cipher.modes=j.cipher.modes||{};function r(e,t){if("string"==typeof e&&(e=j.util.createBuffer(e)),j.util.isArray(e)&&e.length>4){var r=e;e=j.util.createBuffer();for(var n=0;n<r.length;++n)e.putByte(r[n])}if(e.length()<t)throw new Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!j.util.isArray(e)){var i=[],a=t/4;for(n=0;n<a;++n)i.push(e.getInt32());e=i}return e}function n(e){e[e.length-1]=e[e.length-1]+1&4294967295}function i(e){return[e/4294967296|0,4294967295&e]}t.ecb=function(e){e=e||{},this.name="ECB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},t.ecb.prototype.start=function(e){},t.ecb.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();for(this.cipher.encrypt(this._inBlock,this._outBlock),n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},t.ecb.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();for(this.cipher.decrypt(this._inBlock,this._outBlock),n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},t.ecb.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},t.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2||(e.truncate(n),0))},t.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},t.cbc.prototype.start=function(e){if(null===e.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=r(e.iv,this.blockSize),this._prev=this._iv.slice(0)}},t.cbc.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=this._prev[n]^e.getInt32();for(this.cipher.encrypt(this._inBlock,this._outBlock),n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]);this._prev=this._outBlock},t.cbc.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();for(this.cipher.decrypt(this._inBlock,this._outBlock),n=0;n<this._ints;++n)t.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)},t.cbc.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},t.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2||(e.truncate(n),0))},t.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=j.util.createBuffer(),this._partialBytes=0},t.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=r(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},t.cfb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32()^this._outBlock[i],t.putInt32(this._inBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;for(a>0&&(a=this.blockSize-a),this._partialOutput.clear(),i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(a>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},t.cfb.prototype.decrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32(),t.putInt32(this._inBlock[i]^this._outBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;for(a>0&&(a=this.blockSize-a),this._partialOutput.clear(),i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(a>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},t.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=j.util.createBuffer(),this._partialBytes=0},t.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=r(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},t.ofb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===e.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];else{var a=(this.blockSize-n)%this.blockSize;for(a>0&&(a=this.blockSize-a),this._partialOutput.clear(),i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},t.ofb.prototype.decrypt=t.ofb.prototype.encrypt,t.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=j.util.createBuffer(),this._partialBytes=0},t.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=r(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},t.ctr.prototype.encrypt=function(e,t,r){var i=e.length();if(0===i)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&i>=this.blockSize)for(var a=0;a<this._ints;++a)t.putInt32(e.getInt32()^this._outBlock[a]);else{var o=(this.blockSize-i)%this.blockSize;for(o>0&&(o=this.blockSize-o),this._partialOutput.clear(),a=0;a<this._ints;++a)this._partialOutput.putInt32(e.getInt32()^this._outBlock[a]);if(o>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=0}n(this._inBlock)},t.ctr.prototype.decrypt=t.ctr.prototype.encrypt,t.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=j.util.createBuffer(),this._partialBytes=0,this._R=3774873600},t.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t,r=j.util.createBuffer(e.iv);if(this._cipherLength=0,t="additionalData"in e?j.util.createBuffer(e.additionalData):j.util.createBuffer(),this._tagLength="tagLength"in e?e.tagLength:128,this._tag=null,e.decrypt&&(this._tag=j.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var a=r.length();if(12===a)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(i(8*a)))}this._inBlock=this._j0.slice(0),n(this._inBlock),this._partialBytes=0,t=j.util.createBuffer(t),this._aDataLength=i(8*t.length());var o=t.length()%this.blockSize;for(o&&t.fillWithByte(0,this.blockSize-o),this._s=[0,0,0,0];t.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()])},t.gcm.prototype.encrypt=function(e,t,r){var i=e.length();if(0===i)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&i>=this.blockSize){for(var a=0;a<this._ints;++a)t.putInt32(this._outBlock[a]^=e.getInt32());this._cipherLength+=this.blockSize}else{var o=(this.blockSize-i)%this.blockSize;for(o>0&&(o=this.blockSize-o),this._partialOutput.clear(),a=0;a<this._ints;++a)this._partialOutput.putInt32(e.getInt32()^this._outBlock[a]);if(o<=0||r){if(r){var s=i%this.blockSize;this._cipherLength+=s,this._partialOutput.truncate(this.blockSize-s)}else this._cipherLength+=this.blockSize;for(a=0;a<this._ints;++a)this._outBlock[a]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),n(this._inBlock)},t.gcm.prototype.decrypt=function(e,t,r){var i=e.length();if(i<this.blockSize&&!(r&&i>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),n(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var a=0;a<this._ints;++a)t.putInt32(this._outBlock[a]^this._hashBlock[a]);i<this.blockSize?this._cipherLength+=i%this.blockSize:this._cipherLength+=this.blockSize},t.gcm.prototype.afterFinish=function(e,t){var r=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=j.util.createBuffer();var n=this._aDataLength.concat(i(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,n);var a=[];this.cipher.encrypt(this._j0,a);for(var o=0;o<this._ints;++o)this.tag.putInt32(this._s[o]^a[o]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r},t.gcm.prototype.multiply=function(e,t){for(var r=[0,0,0,0],n=t.slice(0),i=0;i<128;++i)e[i/32|0]&1<<31-i%32&&(r[0]^=n[0],r[1]^=n[1],r[2]^=n[2],r[3]^=n[3]),this.pow(n,n);return r},t.gcm.prototype.pow=function(e,t){for(var r=1&e[3],n=3;n>0;--n)t[n]=e[n]>>>1|(1&e[n-1])<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)},t.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var n=e[r/8|0]>>>4*(7-r%8)&15,i=this._m[r][n];t[0]^=i[0],t[1]^=i[1],t[2]^=i[2],t[3]^=i[3]}return t},t.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)},t.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,n=4*r,i=16*r,a=new Array(i),o=0;o<i;++o){var s=[0,0,0,0],c=(n-1-o%n)*t;s[o/n|0]=1<<t-1<<c,a[o]=this.generateSubHashTable(this.multiply(s,e),t)}return a},t.gcm.prototype.generateSubHashTable=function(e,t){var r=1<<t,n=r>>>1,i=new Array(r);i[n]=e.slice(0);for(var a=n>>>1;a>0;)this.pow(i[2*a],i[a]=[]),a>>=1;for(a=2;a<n;){for(var o=1;o<a;++o){var s=i[a],c=i[o];i[a+o]=[s[0]^c[0],s[1]^c[1],s[2]^c[2],s[3]^c[3]]}a*=2}for(i[0]=[0,0,0,0],a=n+1;a<r;++a){var u=i[a^n];i[a]=[e[0]^u[0],e[1]^u[1],e[2]^u[2],e[3]^u[3]]}return i}})),j.aes=j.aes||{},j.aes.startEncrypting=function(e,t,r,n){var i=te({key:e,output:r,decrypt:!1,mode:n});return i.start(t),i},j.aes.createEncryptionCipher=function(e,t){return te({key:e,output:null,decrypt:!1,mode:t})},j.aes.startDecrypting=function(e,t,r,n){var i=te({key:e,output:r,decrypt:!0,mode:n});return i.start(t),i},j.aes.createDecryptionCipher=function(e,t){return te({key:e,output:null,decrypt:!0,mode:t})},j.aes.Algorithm=function(e,t){$||Z();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return ee(r._w,e,t,!1)},decrypt:function(e,t){return ee(r._w,e,t,!0)}}}),r._init=!1},j.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t,r=e.key;if("string"!=typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(j.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){t=r,r=j.util.createBuffer();for(var n=0;n<t.length;++n)r.putByte(t[n])}}else r=j.util.createBuffer(r);if(!j.util.isArray(r)){t=r,r=[];var i=t.length();if(16===i||24===i||32===i)for(i>>>=2,n=0;n<i;++n)r.push(t.getInt32())}if(!j.util.isArray(r)||4!==r.length&&6!==r.length&&8!==r.length)throw new Error("Invalid key parameter.");var a=this.mode.name,o=-1!==["CFB","OFB","CTR","GCM"].indexOf(a);this._w=J(r,e.decrypt&&!o),this._init=!0}},j.aes._expandKey=function(e,t){return $||Z(),J(e,t)},j.aes._updateBlock=ee,H("AES-ECB",j.cipher.modes.ecb),H("AES-CBC",j.cipher.modes.cbc),H("AES-CFB",j.cipher.modes.cfb),H("AES-OFB",j.cipher.modes.ofb),H("AES-CTR",j.cipher.modes.ctr),H("AES-GCM",j.cipher.modes.gcm);var Q,G,W,X,Y,$=!1;function Z(){$=!0,W=[0,1,2,4,8,16,32,64,128,27,54];for(var e=new Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;for(Q=new Array(256),G=new Array(256),X=new Array(4),Y=new Array(4),t=0;t<4;++t)X[t]=new Array(256),Y[t]=new Array(256);var r,n,i,a,o,s,c,u=0,l=0;for(t=0;t<256;++t){a=(a=l^l<<1^l<<2^l<<3^l<<4)>>8^255&a^99,Q[u]=a,G[a]=u,s=(o=e[a])<<24^a<<16^a<<8^a^o,c=((r=e[u])^(n=e[r])^(i=e[n]))<<24^(u^i)<<16^(u^n^i)<<8^u^r^i;for(var d=0;d<4;++d)X[d][u]=s,Y[d][a]=c,s=s<<24|s>>>8,c=c<<24|c>>>8;0===u?u=l=1:(u=r^e[e[e[r^i]]],l^=e[e[l]])}}function J(e,t){for(var r,n=e.slice(0),i=1,a=n.length,o=4*(a+6+1),s=a;s<o;++s)r=n[s-1],s%a==0?(r=Q[r>>>16&255]<<24^Q[r>>>8&255]<<16^Q[255&r]<<8^Q[r>>>24]^W[i]<<24,i++):a>6&&s%a==4&&(r=Q[r>>>24]<<24^Q[r>>>16&255]<<16^Q[r>>>8&255]<<8^Q[255&r]),n[s]=n[s-a]^r;if(t){for(var c,u=Y[0],l=Y[1],d=Y[2],f=Y[3],p=n.slice(0),h=(s=0,(o=n.length)-4);s<o;s+=4,h-=4)if(0===s||s===o-4)p[s]=n[h],p[s+1]=n[h+3],p[s+2]=n[h+2],p[s+3]=n[h+1];else for(var g=0;g<4;++g)c=n[h+g],p[s+(3&-g)]=u[Q[c>>>24]]^l[Q[c>>>16&255]]^d[Q[c>>>8&255]]^f[Q[255&c]];n=p}return n}function ee(e,t,r,n){var i,a,o,s,c,u,l,d,f,p,h,g,m=e.length/4-1;n?(i=Y[0],a=Y[1],o=Y[2],s=Y[3],c=G):(i=X[0],a=X[1],o=X[2],s=X[3],c=Q),u=t[0]^e[0],l=t[n?3:1]^e[1],d=t[2]^e[2],f=t[n?1:3]^e[3];for(var y=3,v=1;v<m;++v)p=i[u>>>24]^a[l>>>16&255]^o[d>>>8&255]^s[255&f]^e[++y],h=i[l>>>24]^a[d>>>16&255]^o[f>>>8&255]^s[255&u]^e[++y],g=i[d>>>24]^a[f>>>16&255]^o[u>>>8&255]^s[255&l]^e[++y],f=i[f>>>24]^a[u>>>16&255]^o[l>>>8&255]^s[255&d]^e[++y],u=p,l=h,d=g;r[0]=c[u>>>24]<<24^c[l>>>16&255]<<16^c[d>>>8&255]<<8^c[255&f]^e[++y],r[n?3:1]=c[l>>>24]<<24^c[d>>>16&255]<<16^c[f>>>8&255]<<8^c[255&u]^e[++y],r[2]=c[d>>>24]<<24^c[f>>>16&255]<<16^c[u>>>8&255]<<8^c[255&l]^e[++y],r[n?1:3]=c[f>>>24]<<24^c[u>>>16&255]<<16^c[l>>>8&255]<<8^c[255&d]^e[++y]}function te(e){var t,r="AES-"+((e=e||{}).mode||"CBC").toUpperCase(),n=(t=e.decrypt?j.cipher.createDecipher(r,e.key):j.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var i=null;r instanceof j.util.ByteBuffer&&(i=r,r={}),(r=r||{}).output=i,r.iv=e,n.call(t,r)},t}function re(e,t){j.cipher.registerAlgorithm(e,(function(){return new j.des.Algorithm(e,t)}))}C((function(e){j.pki=j.pki||{};var t=e.exports=j.pki.oids=j.oids=j.oids||{};function r(e,r){t[e]=r,t[r]=e}function n(e,r){t[e]=r}r("1.2.840.113549.1.1.1","rsaEncryption"),r("1.2.840.113549.1.1.4","md5WithRSAEncryption"),r("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),r("1.2.840.113549.1.1.7","RSAES-OAEP"),r("1.2.840.113549.1.1.8","mgf1"),r("1.2.840.113549.1.1.9","pSpecified"),r("1.2.840.113549.1.1.10","RSASSA-PSS"),r("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),r("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),r("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),r("1.3.101.112","EdDSA25519"),r("1.2.840.10040.4.3","dsa-with-sha1"),r("1.3.14.3.2.7","desCBC"),r("1.3.14.3.2.26","sha1"),r("2.16.840.1.101.3.4.2.1","sha256"),r("2.16.840.1.101.3.4.2.2","sha384"),r("2.16.840.1.101.3.4.2.3","sha512"),r("1.2.840.113549.2.5","md5"),r("1.2.840.113549.1.7.1","data"),r("1.2.840.113549.1.7.2","signedData"),r("1.2.840.113549.1.7.3","envelopedData"),r("1.2.840.113549.1.7.4","signedAndEnvelopedData"),r("1.2.840.113549.1.7.5","digestedData"),r("1.2.840.113549.1.7.6","encryptedData"),r("1.2.840.113549.1.9.1","emailAddress"),r("1.2.840.113549.1.9.2","unstructuredName"),r("1.2.840.113549.1.9.3","contentType"),r("1.2.840.113549.1.9.4","messageDigest"),r("1.2.840.113549.1.9.5","signingTime"),r("1.2.840.113549.1.9.6","counterSignature"),r("1.2.840.113549.1.9.7","challengePassword"),r("1.2.840.113549.1.9.8","unstructuredAddress"),r("1.2.840.113549.1.9.14","extensionRequest"),r("1.2.840.113549.1.9.20","friendlyName"),r("1.2.840.113549.1.9.21","localKeyId"),r("1.2.840.113549.1.9.22.1","x509Certificate"),r("1.2.840.113549.1.12.10.1.1","keyBag"),r("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),r("1.2.840.113549.1.12.10.1.3","certBag"),r("1.2.840.113549.1.12.10.1.4","crlBag"),r("1.2.840.113549.1.12.10.1.5","secretBag"),r("1.2.840.113549.1.12.10.1.6","safeContentsBag"),r("1.2.840.113549.1.5.13","pkcs5PBES2"),r("1.2.840.113549.1.5.12","pkcs5PBKDF2"),r("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),r("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),r("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),r("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),r("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),r("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),r("1.2.840.113549.2.7","hmacWithSHA1"),r("1.2.840.113549.2.8","hmacWithSHA224"),r("1.2.840.113549.2.9","hmacWithSHA256"),r("1.2.840.113549.2.10","hmacWithSHA384"),r("1.2.840.113549.2.11","hmacWithSHA512"),r("1.2.840.113549.3.7","des-EDE3-CBC"),r("2.16.840.1.101.3.4.1.2","aes128-CBC"),r("2.16.840.1.101.3.4.1.22","aes192-CBC"),r("2.16.840.1.101.3.4.1.42","aes256-CBC"),r("2.5.4.3","commonName"),r("2.5.4.5","serialName"),r("2.5.4.6","countryName"),r("2.5.4.7","localityName"),r("2.5.4.8","stateOrProvinceName"),r("2.5.4.9","streetAddress"),r("2.5.4.10","organizationName"),r("2.5.4.11","organizationalUnitName"),r("2.5.4.13","description"),r("2.5.4.15","businessCategory"),r("2.5.4.17","postalCode"),r("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),r("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),r("2.16.840.1.113730.1.1","nsCertType"),r("2.16.840.1.113730.1.13","nsComment"),n("2.5.29.1","authorityKeyIdentifier"),n("2.5.29.2","keyAttributes"),n("2.5.29.3","certificatePolicies"),n("2.5.29.4","keyUsageRestriction"),n("2.5.29.5","policyMapping"),n("2.5.29.6","subtreesConstraint"),n("2.5.29.7","subjectAltName"),n("2.5.29.8","issuerAltName"),n("2.5.29.9","subjectDirectoryAttributes"),n("2.5.29.10","basicConstraints"),n("2.5.29.11","nameConstraints"),n("2.5.29.12","policyConstraints"),n("2.5.29.13","basicConstraints"),r("2.5.29.14","subjectKeyIdentifier"),r("2.5.29.15","keyUsage"),n("2.5.29.16","privateKeyUsagePeriod"),r("2.5.29.17","subjectAltName"),r("2.5.29.18","issuerAltName"),r("2.5.29.19","basicConstraints"),n("2.5.29.20","cRLNumber"),n("2.5.29.21","cRLReason"),n("2.5.29.22","expirationDate"),n("2.5.29.23","instructionCode"),n("2.5.29.24","invalidityDate"),n("2.5.29.25","cRLDistributionPoints"),n("2.5.29.26","issuingDistributionPoint"),n("2.5.29.27","deltaCRLIndicator"),n("2.5.29.28","issuingDistributionPoint"),n("2.5.29.29","certificateIssuer"),n("2.5.29.30","nameConstraints"),r("2.5.29.31","cRLDistributionPoints"),r("2.5.29.32","certificatePolicies"),n("2.5.29.33","policyMappings"),n("2.5.29.34","policyConstraints"),r("2.5.29.35","authorityKeyIdentifier"),n("2.5.29.36","policyConstraints"),r("2.5.29.37","extKeyUsage"),n("2.5.29.46","freshestCRL"),n("2.5.29.54","inhibitAnyPolicy"),r("1.3.6.1.4.1.11129.2.4.2","timestampList"),r("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),r("1.3.6.1.5.5.7.3.1","serverAuth"),r("1.3.6.1.5.5.7.3.2","clientAuth"),r("1.3.6.1.5.5.7.3.3","codeSigning"),r("1.3.6.1.5.5.7.3.4","emailProtection"),r("1.3.6.1.5.5.7.3.8","timeStamping")})),C((function(e){var t=e.exports=j.asn1=j.asn1||{};function r(e,t,r){if(r>t){var n=new Error("Too few bytes to parse DER.");throw n.available=e.length(),n.remaining=t,n.requested=r,n}}t.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},t.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},t.create=function(e,r,n,i,a){if(j.util.isArray(i)){for(var o=[],s=0;s<i.length;++s)void 0!==i[s]&&o.push(i[s]);i=o}var c={tagClass:e,type:r,constructed:n,composed:n||j.util.isArray(i),value:i};return a&&"bitStringContents"in a&&(c.bitStringContents=a.bitStringContents,c.original=t.copy(c)),c},t.copy=function(e,r){var n;if(j.util.isArray(e)){n=[];for(var i=0;i<e.length;++i)n.push(t.copy(e[i],r));return n}return"string"==typeof e?e:(n={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:t.copy(e.value,r)},r&&!r.excludeBitStringContents&&(n.bitStringContents=e.bitStringContents),n)},t.equals=function(e,r,n){if(j.util.isArray(e)){if(!j.util.isArray(r))return!1;if(e.length!==r.length)return!1;for(var i=0;i<e.length;++i)if(!t.equals(e[i],r[i]))return!1;return!0}if(Iv(e)!=Iv(r))return!1;if("string"==typeof e)return e===r;var a=e.tagClass===r.tagClass&&e.type===r.type&&e.constructed===r.constructed&&e.composed===r.composed&&t.equals(e.value,r.value);return n&&n.includeBitStringContents&&(a=a&&e.bitStringContents===r.bitStringContents),a},t.getBerValueLength=function(e){var t=e.getByte();if(128!==t)return 128&t?e.getInt((127&t)<<3):t};t.fromDer=function(e,n){return void 0===n&&(n={strict:!0,decodeBitStrings:!0}),"boolean"==typeof n&&(n={strict:n,decodeBitStrings:!0}),"strict"in n||(n.strict=!0),"decodeBitStrings"in n||(n.decodeBitStrings=!0),"string"==typeof e&&(e=j.util.createBuffer(e)),function e(n,i,a,o){var s;r(n,i,2);var c=n.getByte();i--;var u=192&c,l=31&c;s=n.length();var d,f,p=function(e,t){var n=e.getByte();if(t--,128!==n){var i;if(128&n){var a=127&n;r(e,t,a),i=e.getInt(a<<3)}else i=n;if(i<0)throw new Error("Negative length: "+i);return i}}(n,i);if(i-=s-n.length(),void 0!==p&&p>i){if(o.strict){var h=new Error("Too few bytes to read ASN.1 value.");throw h.available=n.length(),h.remaining=i,h.requested=p,h}p=i}var g=32==(32&c);if(g)if(d=[],void 0===p)for(;;){if(r(n,i,2),n.bytes(2)===String.fromCharCode(0,0)){n.getBytes(2),i-=2;break}s=n.length(),d.push(e(n,i,a+1,o)),i-=s-n.length()}else for(;p>0;)s=n.length(),d.push(e(n,p,a+1,o)),i-=s-n.length(),p-=s-n.length();if(void 0===d&&u===t.Class.UNIVERSAL&&l===t.Type.BITSTRING&&(f=n.bytes(p)),void 0===d&&o.decodeBitStrings&&u===t.Class.UNIVERSAL&&l===t.Type.BITSTRING&&p>1){var m=n.read,y=i,v=0;if(l===t.Type.BITSTRING&&(r(n,i,1),v=n.getByte(),i--),0===v)try{s=n.length();var b=e(n,i,a+1,{verbose:o.verbose,strict:!0,decodeBitStrings:!0}),C=s-n.length();i-=C,l==t.Type.BITSTRING&&C++;var E=b.tagClass;C!==p||E!==t.Class.UNIVERSAL&&E!==t.Class.CONTEXT_SPECIFIC||(d=[b])}catch(e){}void 0===d&&(n.read=m,i=y)}if(void 0===d){if(void 0===p){if(o.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");p=i}if(l===t.Type.BMPSTRING)for(d="";p>0;p-=2)r(n,i,2),d+=String.fromCharCode(n.getInt16()),i-=2;else d=n.getBytes(p)}var w=void 0===f?null:{bitStringContents:f};return t.create(u,l,g,d,w)}(e,e.length(),0,n)},t.toDer=function(e){var r=j.util.createBuffer(),n=e.tagClass|e.type,i=j.util.createBuffer(),a=!1;if("bitStringContents"in e&&(a=!0,e.original&&(a=t.equals(e,e.original))),a)i.putBytes(e.bitStringContents);else if(e.composed){e.constructed?n|=32:i.putByte(0);for(var o=0;o<e.value.length;++o)void 0!==e.value[o]&&i.putBuffer(t.toDer(e.value[o]))}else if(e.type===t.Type.BMPSTRING)for(o=0;o<e.value.length;++o)i.putInt16(e.value.charCodeAt(o));else e.type===t.Type.INTEGER&&e.value.length>1&&(0===e.value.charCodeAt(0)&&0==(128&e.value.charCodeAt(1))||255===e.value.charCodeAt(0)&&128==(128&e.value.charCodeAt(1)))?i.putBytes(e.value.substr(1)):i.putBytes(e.value);if(r.putByte(n),i.length()<=127)r.putByte(127&i.length());else{var s=i.length(),c="";do{c+=String.fromCharCode(255&s),s>>>=8}while(s>0);for(r.putByte(128|c.length),o=c.length-1;o>=0;--o)r.putByte(c.charCodeAt(o))}return r.putBuffer(i),r},t.oidToDer=function(e){var t,r,n,i,a=e.split("."),o=j.util.createBuffer();o.putByte(40*parseInt(a[0],10)+parseInt(a[1],10));for(var s=2;s<a.length;++s){t=!0,r=[],n=parseInt(a[s],10);do{i=127&n,n>>>=7,t||(i|=128),r.push(i),t=!1}while(n>0);for(var c=r.length-1;c>=0;--c)o.putByte(r[c])}return o},t.derToOid=function(e){var t;"string"==typeof e&&(e=j.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var n=0;e.length()>0;)n<<=7,128&(r=e.getByte())?n+=127&r:(t+="."+(n+r),n=0);return t},t.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(e.substr(2,2),10)-1,i=parseInt(e.substr(4,2),10),a=parseInt(e.substr(6,2),10),o=parseInt(e.substr(8,2),10),s=0;if(e.length>11){var c=e.charAt(10),u=10;"+"!==c&&"-"!==c&&(s=parseInt(e.substr(10,2),10),u+=2)}if(t.setUTCFullYear(r,n,i),t.setUTCHours(a,o,s,0),u&&("+"===(c=e.charAt(u))||"-"===c)){var l=60*parseInt(e.substr(u+1,2),10)+parseInt(e.substr(u+4,2),10);l*=6e4,"+"===c?t.setTime(+t-l):t.setTime(+t+l)}return t},t.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),n=parseInt(e.substr(4,2),10)-1,i=parseInt(e.substr(6,2),10),a=parseInt(e.substr(8,2),10),o=parseInt(e.substr(10,2),10),s=parseInt(e.substr(12,2),10),c=0,u=0,l=!1;"Z"===e.charAt(e.length-1)&&(l=!0);var d=e.length-5,f=e.charAt(d);return"+"!==f&&"-"!==f||(u=60*parseInt(e.substr(d+1,2),10)+parseInt(e.substr(d+4,2),10),u*=6e4,"+"===f&&(u*=-1),l=!0),"."===e.charAt(14)&&(c=1e3*parseFloat(e.substr(14),10)),l?(t.setUTCFullYear(r,n,i),t.setUTCHours(a,o,s,c),t.setTime(+t+u)):(t.setFullYear(r,n,i),t.setHours(a,o,s,c)),t},t.dateToUtcTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push((""+e.getUTCFullYear()).substr(2)),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+"Z"},t.dateToGeneralizedTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push(""+e.getUTCFullYear()),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+"Z"},t.integerToDer=function(e){var t=j.util.createBuffer();if(e>=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=e,r},t.derToInteger=function(e){"string"==typeof e&&(e=j.util.createBuffer(e));var t=8*e.length();if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},t.validate=function(e,r,n,i){var a=!1;if(e.tagClass!==r.tagClass&&void 0!==r.tagClass||e.type!==r.type&&void 0!==r.type)i&&(e.tagClass!==r.tagClass&&i.push("["+r.name+'] Expected tag class "'+r.tagClass+'", got "'+e.tagClass+'"'),e.type!==r.type&&i.push("["+r.name+'] Expected type "'+r.type+'", got "'+e.type+'"'));else if(e.constructed===r.constructed||void 0===r.constructed){if(a=!0,r.value&&j.util.isArray(r.value))for(var o=0,s=0;a&&s<r.value.length;++s)a=r.value[s].optional||!1,e.value[o]&&((a=t.validate(e.value[o],r.value[s],n,i))?++o:r.value[s].optional&&(a=!0)),!a&&i&&i.push("["+r.name+'] Tag class "'+r.tagClass+'", type "'+r.type+'" expected value length "'+r.value.length+'", got "'+e.value.length+'"');if(a&&n&&(r.capture&&(n[r.capture]=e.value),r.captureAsn1&&(n[r.captureAsn1]=e),r.captureBitStringContents&&"bitStringContents"in e&&(n[r.captureBitStringContents]=e.bitStringContents),r.captureBitStringValue&&"bitStringContents"in e))if(e.bitStringContents.length<2)n[r.captureBitStringValue]="";else{if(0!==e.bitStringContents.charCodeAt(0))throw new Error("captureBitStringValue only supported for zero unused bits");n[r.captureBitStringValue]=e.bitStringContents.slice(1)}}else i&&i.push("["+r.name+'] Expected constructed "'+r.constructed+'", got "'+e.constructed+'"');return a};var n=/[^\\u0000-\\u00ff]/;t.prettyPrint=function(e,r,i){var a="";i=i||2,(r=r||0)>0&&(a+="\n");for(var o="",s=0;s<r*i;++s)o+=" ";switch(a+=o+"Tag: ",e.tagClass){case t.Class.UNIVERSAL:a+="Universal:";break;case t.Class.APPLICATION:a+="Application:";break;case t.Class.CONTEXT_SPECIFIC:a+="Context-Specific:";break;case t.Class.PRIVATE:a+="Private:"}if(e.tagClass===t.Class.UNIVERSAL)switch(a+=e.type,e.type){case t.Type.NONE:a+=" (None)";break;case t.Type.BOOLEAN:a+=" (Boolean)";break;case t.Type.INTEGER:a+=" (Integer)";break;case t.Type.BITSTRING:a+=" (Bit string)";break;case t.Type.OCTETSTRING:a+=" (Octet string)";break;case t.Type.NULL:a+=" (Null)";break;case t.Type.OID:a+=" (Object Identifier)";break;case t.Type.ODESC:a+=" (Object Descriptor)";break;case t.Type.EXTERNAL:a+=" (External or Instance of)";break;case t.Type.REAL:a+=" (Real)";break;case t.Type.ENUMERATED:a+=" (Enumerated)";break;case t.Type.EMBEDDED:a+=" (Embedded PDV)";break;case t.Type.UTF8:a+=" (UTF8)";break;case t.Type.ROID:a+=" (Relative Object Identifier)";break;case t.Type.SEQUENCE:a+=" (Sequence)";break;case t.Type.SET:a+=" (Set)";break;case t.Type.PRINTABLESTRING:a+=" (Printable String)";break;case t.Type.IA5String:a+=" (IA5String (ASCII))";break;case t.Type.UTCTIME:a+=" (UTC time)";break;case t.Type.GENERALIZEDTIME:a+=" (Generalized time)";break;case t.Type.BMPSTRING:a+=" (BMP String)"}else a+=e.type;if(a+="\n",a+=o+"Constructed: "+e.constructed+"\n",e.composed){var c=0,u="";for(s=0;s<e.value.length;++s)void 0!==e.value[s]&&(c+=1,u+=t.prettyPrint(e.value[s],r+1,i),s+1<e.value.length&&(u+=","));a+=o+"Sub values: "+c+u}else{if(a+=o+"Value: ",e.type===t.Type.OID){var l=t.derToOid(e.value);a+=l,j.pki&&j.pki.oids&&l in j.pki.oids&&(a+=" ("+j.pki.oids[l]+") ")}if(e.type===t.Type.INTEGER)try{a+=t.derToInteger(e.value)}catch(t){a+="0x"+j.util.bytesToHex(e.value)}else if(e.type===t.Type.BITSTRING){if(e.value.length>1?a+="0x"+j.util.bytesToHex(e.value.slice(1)):a+="(none)",e.value.length>0){var d=e.value.charCodeAt(0);1==d?a+=" (1 unused bit shown)":d>1&&(a+=" ("+d+" unused bits shown)")}}else e.type===t.Type.OCTETSTRING?(n.test(e.value)||(a+="("+e.value+") "),a+="0x"+j.util.bytesToHex(e.value)):e.type===t.Type.UTF8?a+=j.util.decodeUtf8(e.value):e.type===t.Type.PRINTABLESTRING||e.type===t.Type.IA5String?a+=e.value:n.test(e.value)?a+="0x"+j.util.bytesToHex(e.value):0===e.value.length?a+="[null]":a+=e.value}return a}})),j.md=j.md||{},j.md.algorithms=j.md.algorithms||{},C((function(e){(e.exports=j.hmac=j.hmac||{}).create=function(){var e=null,t=null,r=null,n=null,i={start:function(i,a){if(null!==i)if("string"==typeof i){if(!((i=i.toLowerCase())in j.md.algorithms))throw new Error('Unknown hash algorithm "'+i+'"');t=j.md.algorithms[i].create()}else t=i;if(null===a)a=e;else{if("string"==typeof a)a=j.util.createBuffer(a);else if(j.util.isArray(a)){var o=a;a=j.util.createBuffer();for(var s=0;s<o.length;++s)a.putByte(o[s])}var c=a.length();for(c>t.blockLength&&(t.start(),t.update(a.bytes()),a=t.digest()),r=j.util.createBuffer(),n=j.util.createBuffer(),c=a.length(),s=0;s<c;++s)o=a.at(s),r.putByte(54^o),n.putByte(92^o);if(c<t.blockLength)for(o=t.blockLength-c,s=0;s<o;++s)r.putByte(54),n.putByte(92);e=a,r=r.bytes(),n=n.bytes()}t.start(),t.update(r)},update:function(e){t.update(e)},getMac:function(){var e=t.digest().bytes();return t.start(),t.update(n),t.update(e),t.digest()}};return i.digest=i.getMac,i}})),C((function(e){var t=e.exports=j.md5=j.md5||{};j.md.md5=j.md.algorithms.md5=t,t.create=function(){o||function(){r=String.fromCharCode(128),r+=j.util.fillString(String.fromCharCode(0),64),n=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],i=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],a=new Array(64);for(var e=0;e<64;++e)a[e]=Math.floor(4294967296*Math.abs(Math.sin(e+1)));o=!0}();var e=null,t=j.util.createBuffer(),c=new Array(16),u={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){u.messageLength=0,u.fullMessageLength=u.messageLength64=[];for(var r=u.messageLengthSize/4,n=0;n<r;++n)u.fullMessageLength.push(0);return t=j.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},u}};return u.start(),u.update=function(r,n){"utf8"===n&&(r=j.util.encodeUtf8(r));var i=r.length;u.messageLength+=i,i=[i/4294967296>>>0,i>>>0];for(var a=u.fullMessageLength.length-1;a>=0;--a)u.fullMessageLength[a]+=i[1],i[1]=i[0]+(u.fullMessageLength[a]/4294967296>>>0),u.fullMessageLength[a]=u.fullMessageLength[a]>>>0,i[0]=i[1]/4294967296>>>0;return t.putBytes(r),s(e,c,t),(t.read>2048||0===t.length())&&t.compact(),u},u.digest=function(){var n=j.util.createBuffer();n.putBytes(t.bytes());var i=u.fullMessageLength[u.fullMessageLength.length-1]+u.messageLengthSize&u.blockLength-1;n.putBytes(r.substr(0,u.blockLength-i));for(var a,o=0,l=u.fullMessageLength.length-1;l>=0;--l)o=(a=8*u.fullMessageLength[l]+o)/4294967296>>>0,n.putInt32Le(a>>>0);var d={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};s(d,c,n);var f=j.util.createBuffer();return f.putInt32Le(d.h0),f.putInt32Le(d.h1),f.putInt32Le(d.h2),f.putInt32Le(d.h3),f},u};var r=null,n=null,i=null,a=null,o=!1;function s(e,t,r){for(var o,s,c,u,l,d,f,p=r.length();p>=64;){for(s=e.h0,c=e.h1,u=e.h2,l=e.h3,f=0;f<16;++f)t[f]=r.getInt32Le(),o=s+(l^c&(u^l))+a[f]+t[f],s=l,l=u,u=c,c+=o<<(d=i[f])|o>>>32-d;for(;f<32;++f)o=s+(u^l&(c^u))+a[f]+t[n[f]],s=l,l=u,u=c,c+=o<<(d=i[f])|o>>>32-d;for(;f<48;++f)o=s+(c^u^l)+a[f]+t[n[f]],s=l,l=u,u=c,c+=o<<(d=i[f])|o>>>32-d;for(;f<64;++f)o=s+(u^(c|~l))+a[f]+t[n[f]],s=l,l=u,u=c,c+=o<<(d=i[f])|o>>>32-d;e.h0=e.h0+s|0,e.h1=e.h1+c|0,e.h2=e.h2+u|0,e.h3=e.h3+l|0,p-=64}}})),C((function(e){var t=e.exports=j.pem=j.pem||{};function r(e){for(var t=e.name+": ",r=[],n=function(e,t){return" "+t},i=0;i<e.values.length;++i)r.push(e.values[i].replace(/^(\S+\r\n)/,n));t+=r.join(",")+"\r\n";var a=0,o=-1;for(i=0;i<t.length;++i,++a)if(a>65&&-1!==o){var s=t[o];","===s?(++o,t=t.substr(0,o)+"\r\n "+t.substr(o)):t=t.substr(0,o)+"\r\n"+s+t.substr(o+1),a=i-o-1,o=-1,++i}else" "!==t[i]&&"\t"!==t[i]&&","!==t[i]||(o=i);return t}function n(e){return e.replace(/^\s+/,"")}t.encode=function(e,t){t=t||{};var n,i="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(i+=r(n={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(i+=r(n={name:"Content-Domain",values:[e.contentDomain]})),e.dekInfo&&(n={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&n.values.push(e.dekInfo.parameters),i+=r(n)),e.headers)for(var a=0;a<e.headers.length;++a)i+=r(e.headers[a]);return e.procType&&(i+="\r\n"),(i+=j.util.encode64(e.body,t.maxline||64)+"\r\n")+"-----END "+e.type+"-----\r\n"},t.decode=function(e){for(var t,r=[],i=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,a=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,o=/\r?\n/;t=i.exec(e);){var s={type:t[1],procType:null,contentDomain:null,dekInfo:null,headers:[],body:j.util.decode64(t[3])};if(r.push(s),t[2]){for(var c=t[2].split(o),u=0;t&&u<c.length;){for(var l=c[u].replace(/\s+$/,""),d=u+1;d<c.length;++d){var f=c[d];if(!/\s/.test(f[0]))break;l+=f,u=d}if(t=l.match(a)){for(var p={name:t[1],values:[]},h=t[2].split(","),g=0;g<h.length;++g)p.values.push(n(h[g]));if(s.procType)if(s.contentDomain||"Content-Domain"!==p.name)if(s.dekInfo||"DEK-Info"!==p.name)s.headers.push(p);else{if(0===p.values.length)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');s.dekInfo={algorithm:h[0],parameters:h[1]||null}}else s.contentDomain=h[0]||"";else{if("Proc-Type"!==p.name)throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==p.values.length)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');s.procType={version:h[0],type:h[1]}}}++u}if("ENCRYPTED"===s.procType&&!s.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(0===r.length)throw new Error("Invalid PEM formatted message.");return r}})),j.des=j.des||{},j.des.startEncrypting=function(e,t,r,n){var i=fe({key:e,output:r,decrypt:!1,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},j.des.createEncryptionCipher=function(e,t){return fe({key:e,output:null,decrypt:!1,mode:t})},j.des.startDecrypting=function(e,t,r,n){var i=fe({key:e,output:r,decrypt:!0,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},j.des.createDecryptionCipher=function(e,t){return fe({key:e,output:null,decrypt:!0,mode:t})},j.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(e,t){return de(r._keys,e,t,!1)},decrypt:function(e,t){return de(r._keys,e,t,!0)}}}),r._init=!1},j.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=j.util.createBuffer(e.key);if(0===this.name.indexOf("3DES")&&24!==t.length())throw new Error("Invalid Triple-DES key size: "+8*t.length());this._keys=function(e){for(var t,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],i=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],a=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],o=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],c=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],u=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],l=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],d=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],f=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],p=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],h=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],g=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],m=e.length()>8?3:1,y=[],v=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],b=0,C=0;C<m;C++){var E=e.getInt32(),w=e.getInt32();E^=(t=252645135&(E>>>4^w))<<4,E^=t=65535&((w^=t)>>>-16^E),E^=(t=858993459&(E>>>2^(w^=t<<-16)))<<2,E^=t=65535&((w^=t)>>>-16^E),E^=(t=1431655765&(E>>>1^(w^=t<<-16)))<<1,E^=t=16711935&((w^=t)>>>8^E),t=(E^=(t=1431655765&(E>>>1^(w^=t<<8)))<<1)<<8|(w^=t)>>>20&240,E=w<<24|w<<8&16711680|w>>>8&65280|w>>>24&240,w=t;for(var k=0;k<v.length;++k){v[k]?(E=E<<2|E>>>26,w=w<<2|w>>>26):(E=E<<1|E>>>27,w=w<<1|w>>>27);var S=r[(E&=-15)>>>28]|n[E>>>24&15]|i[E>>>20&15]|a[E>>>16&15]|o[E>>>12&15]|s[E>>>8&15]|c[E>>>4&15],B=u[(w&=-15)>>>28]|l[w>>>24&15]|d[w>>>20&15]|f[w>>>16&15]|p[w>>>12&15]|h[w>>>8&15]|g[w>>>4&15];t=65535&(B>>>16^S),y[b++]=S^t,y[b++]=B^t<<16}}return y}(t),this._init=!0}},re("DES-ECB",j.cipher.modes.ecb),re("DES-CBC",j.cipher.modes.cbc),re("DES-CFB",j.cipher.modes.cfb),re("DES-OFB",j.cipher.modes.ofb),re("DES-CTR",j.cipher.modes.ctr),re("3DES-ECB",j.cipher.modes.ecb),re("3DES-CBC",j.cipher.modes.cbc),re("3DES-CFB",j.cipher.modes.cfb),re("3DES-OFB",j.cipher.modes.ofb),re("3DES-CTR",j.cipher.modes.ctr);var ne=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],ie=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],ae=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],oe=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],se=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],ce=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],ue=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],le=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function de(e,t,r,n){var i,a,o=32===e.length?3:9;i=3===o?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var s=t[0],c=t[1];s^=(a=252645135&(s>>>4^c))<<4,s^=(a=65535&(s>>>16^(c^=a)))<<16,s^=a=858993459&((c^=a)>>>2^s),s^=a=16711935&((c^=a<<2)>>>8^s),s=(s^=(a=1431655765&(s>>>1^(c^=a<<8)))<<1)<<1|s>>>31,c=(c^=a)<<1|c>>>31;for(var u=0;u<o;u+=3){for(var l=i[u+1],d=i[u+2],f=i[u];f!=l;f+=d){var p=c^e[f],h=(c>>>4|c<<28)^e[f+1];a=s,s=c,c=a^(ie[p>>>24&63]|oe[p>>>16&63]|ce[p>>>8&63]|le[63&p]|ne[h>>>24&63]|ae[h>>>16&63]|se[h>>>8&63]|ue[63&h])}a=s,s=c,c=a}c=c>>>1|c<<31,c^=a=1431655765&((s=s>>>1|s<<31)>>>1^c),c^=(a=16711935&(c>>>8^(s^=a<<1)))<<8,c^=(a=858993459&(c>>>2^(s^=a)))<<2,c^=a=65535&((s^=a)>>>16^c),c^=a=252645135&((s^=a<<16)>>>4^c),s^=a<<4,r[0]=s,r[1]=c}function fe(e){var t,r="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),n=(t=e.decrypt?j.cipher.createDecipher(r,e.key):j.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var i=null;r instanceof j.util.ByteBuffer&&(i=r,r={}),(r=r||{}).output=i,r.iv=e,n.call(t,r)},t}var pe,he=j.pkcs5=j.pkcs5||{};j.util.isNodejs&&!j.options.usePureJavaScript&&(pe=t),j.pbkdf2=he.pbkdf2=function(e,t,r,n,i,a){if("function"==typeof i&&(a=i,i=null),j.util.isNodejs&&!j.options.usePureJavaScript&&pe.pbkdf2&&(null===i||"object"!=Iv(i))&&(pe.pbkdf2Sync.length>4||!i||"sha1"===i))return"string"!=typeof i&&(i="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),a?4===pe.pbkdf2Sync.length?pe.pbkdf2(e,t,r,n,(function(e,t){if(e)return a(e);a(null,t.toString("binary"))})):pe.pbkdf2(e,t,r,n,i,(function(e,t){if(e)return a(e);a(null,t.toString("binary"))})):4===pe.pbkdf2Sync.length?pe.pbkdf2Sync(e,t,r,n).toString("binary"):pe.pbkdf2Sync(e,t,r,n,i).toString("binary");if(null==i&&(i="sha1"),"string"==typeof i){if(!(i in j.md.algorithms))throw new Error("Unknown hash algorithm: "+i);i=j.md[i].create()}var o=i.digestLength;if(n>4294967295*o){var s=new Error("Derived key is too long.");if(a)return a(s);throw s}var c=Math.ceil(n/o),u=n-(c-1)*o,l=j.hmac.create();l.start(i,e);var d,f,p,h="";if(!a){for(var g=1;g<=c;++g){l.start(null,null),l.update(t),l.update(j.util.int32ToBytes(g)),d=p=l.digest().getBytes();for(var m=2;m<=r;++m)l.start(null,null),l.update(p),f=l.digest().getBytes(),d=j.util.xorBytes(d,f,o),p=f;h+=g<c?d:d.substr(0,u)}return h}function y(){if(g>c)return a(null,h);l.start(null,null),l.update(t),l.update(j.util.int32ToBytes(g)),d=p=l.digest().getBytes(),m=2,v()}function v(){if(m<=r)return l.start(null,null),l.update(p),f=l.digest().getBytes(),d=j.util.xorBytes(d,f,o),p=f,++m,j.util.setImmediate(v);h+=g<c?d:d.substr(0,u),++g,y()}g=1,y()},C((function(e){var t=e.exports=j.sha256=j.sha256||{};j.md.sha256=j.md.algorithms.sha256=t,t.create=function(){n||(r=String.fromCharCode(128),r+=j.util.fillString(String.fromCharCode(0),64),i=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],n=!0);var e=null,t=j.util.createBuffer(),o=new Array(64),s={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){s.messageLength=0,s.fullMessageLength=s.messageLength64=[];for(var r=s.messageLengthSize/4,n=0;n<r;++n)s.fullMessageLength.push(0);return t=j.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},s}};return s.start(),s.update=function(r,n){"utf8"===n&&(r=j.util.encodeUtf8(r));var i=r.length;s.messageLength+=i,i=[i/4294967296>>>0,i>>>0];for(var c=s.fullMessageLength.length-1;c>=0;--c)s.fullMessageLength[c]+=i[1],i[1]=i[0]+(s.fullMessageLength[c]/4294967296>>>0),s.fullMessageLength[c]=s.fullMessageLength[c]>>>0,i[0]=i[1]/4294967296>>>0;return t.putBytes(r),a(e,o,t),(t.read>2048||0===t.length())&&t.compact(),s},s.digest=function(){var n=j.util.createBuffer();n.putBytes(t.bytes());var i,c=s.fullMessageLength[s.fullMessageLength.length-1]+s.messageLengthSize&s.blockLength-1;n.putBytes(r.substr(0,s.blockLength-c));for(var u=8*s.fullMessageLength[0],l=0;l<s.fullMessageLength.length-1;++l)u+=(i=8*s.fullMessageLength[l+1])/4294967296>>>0,n.putInt32(u>>>0),u=i>>>0;n.putInt32(u);var d={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};a(d,o,n);var f=j.util.createBuffer();return f.putInt32(d.h0),f.putInt32(d.h1),f.putInt32(d.h2),f.putInt32(d.h3),f.putInt32(d.h4),f.putInt32(d.h5),f.putInt32(d.h6),f.putInt32(d.h7),f},s};var r=null,n=!1,i=null;function a(e,t,r){for(var n,a,o,s,c,u,l,d,f,p,h,g,m,y=r.length();y>=64;){for(c=0;c<16;++c)t[c]=r.getInt32();for(;c<64;++c)n=((n=t[c-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,a=((a=t[c-15])>>>7|a<<25)^(a>>>18|a<<14)^a>>>3,t[c]=n+t[c-7]+a+t[c-16]|0;for(u=e.h0,l=e.h1,d=e.h2,f=e.h3,p=e.h4,h=e.h5,g=e.h6,m=e.h7,c=0;c<64;++c)o=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),s=u&l|d&(u^l),n=m+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(g^p&(h^g))+i[c]+t[c],m=g,g=h,h=p,p=f+n>>>0,f=d,d=l,l=u,u=n+(a=o+s)>>>0;e.h0=e.h0+u|0,e.h1=e.h1+l|0,e.h2=e.h2+d|0,e.h3=e.h3+f|0,e.h4=e.h4+p|0,e.h5=e.h5+h|0,e.h6=e.h6+g|0,e.h7=e.h7+m|0,y-=64}}})),C((function(e){var r=null;!j.util.isNodejs||j.options.usePureJavaScript||process.versions["node-webkit"]||(r=t),(e.exports=j.prng=j.prng||{}).create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},n=e.md,i=new Array(32),a=0;a<32;++a)i[a]=n.create();function o(){if(t.pools[0].messageLength>=32)return s();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),s()}function s(){t.reseeds=4294967295===t.reseeds?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var r=1,n=0;n<32;++n)t.reseeds%r==0&&(e.update(t.pools[n].digest().getBytes()),t.pools[n].start()),r<<=1;t.keyBytes=e.digest().getBytes(),e.start(),e.update(t.keyBytes);var i=e.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(i),t.generated=0}function c(e){var t=null,r=j.util.globalScope,n=r.crypto||r.msCrypto;n&&n.getRandomValues&&(t=function(e){return n.getRandomValues(e)});var i=j.util.createBuffer();if(t)for(;i.length()<e;){var a=Math.max(1,Math.min(e-i.length(),65536)/4),o=new Uint32Array(Math.floor(a));try{t(o);for(var s=0;s<o.length;++s)i.putInt32(o[s])}catch(e){if(!("undefined"!=typeof QuotaExceededError&&e instanceof QuotaExceededError))throw e}}if(i.length()<e)for(var c,u,l,d=Math.floor(65536*Math.random());i.length()<e;)for(u=16807*(65535&d),u+=(32767&(c=16807*(d>>16)))<<16,d=4294967295&(u=(2147483647&(u+=c>>15))+(u>>31)),s=0;s<3;++s)l=d>>>(s<<3),l^=Math.floor(256*Math.random()),i.putByte(String.fromCharCode(255&l));return i.getBytes(e)}return t.pools=i,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var n=t.plugin.cipher,i=t.plugin.increment,a=t.plugin.formatKey,o=t.plugin.formatSeed,c=j.util.createBuffer();t.key=null,function u(l){if(l)return r(l);if(c.length()>=e)return r(null,c.getBytes(e));if(t.generated>1048575&&(t.key=null),null===t.key)return j.util.nextTick((function(){!function(e){if(t.pools[0].messageLength>=32)return s(),e();var r=32-t.pools[0].messageLength<<5;t.seedFile(r,(function(r,n){if(r)return e(r);t.collect(n),s(),e()}))}(u)}));var d=n(t.key,t.seed);t.generated+=d.length,c.putBytes(d),t.key=a(n(t.key,i(t.seed))),t.seed=o(n(t.key,t.seed)),j.util.setImmediate(u)}()},t.generateSync=function(e){var r=t.plugin.cipher,n=t.plugin.increment,i=t.plugin.formatKey,a=t.plugin.formatSeed;t.key=null;for(var s=j.util.createBuffer();s.length()<e;){t.generated>1048575&&(t.key=null),null===t.key&&o();var c=r(t.key,t.seed);t.generated+=c.length,s.putBytes(c),t.key=i(r(t.key,n(t.seed))),t.seed=a(r(t.key,t.seed))}return s.getBytes(e)},r?(t.seedFile=function(e,t){r.randomBytes(e,(function(e,r){if(e)return t(e);t(null,r.toString())}))},t.seedFileSync=function(e){return r.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,c(e))}catch(e){t(e)}},t.seedFileSync=c),t.collect=function(e){for(var r=e.length,n=0;n<r;++n)t.pools[t.pool].update(e.substr(n,1)),t.pool=31===t.pool?0:t.pool+1},t.collectInt=function(e,r){for(var n="",i=0;i<r;i+=8)n+=String.fromCharCode(e>>i&255);t.collect(n)},t.registerWorker=function(e){e===self?t.seedFile=function(e,t){self.addEventListener("message",(function e(r){var n=r.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",e),t(n.forge.prng.err,n.forge.prng.bytes))})),self.postMessage({forge:{prng:{needed:e}}})}:e.addEventListener("message",(function(r){var n=r.data;n.forge&&n.forge.prng&&t.seedFile(n.forge.prng.needed,(function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})}))}))},t}})),C((function(e){j.random&&j.random.getBytes?e.exports=j.random:function(t){var r={},n=new Array(4),i=j.util.createBuffer();function a(){var e=j.prng.create(r);return e.getBytes=function(t,r){return e.generate(t,r)},e.getBytesSync=function(t){return e.generate(t)},e}r.formatKey=function(e){var t=j.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),j.aes._expandKey(e,!1)},r.formatSeed=function(e){var t=j.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),e},r.cipher=function(e,t){return j.aes._updateBlock(e,t,n,!1),i.putInt32(n[0]),i.putInt32(n[1]),i.putInt32(n[2]),i.putInt32(n[3]),i.getBytes()},r.increment=function(e){return++e[3],e},r.md=j.md.sha256;var o=a(),s=null,c=j.util.globalScope,u=c.crypto||c.msCrypto;if(u&&u.getRandomValues&&(s=function(e){return u.getRandomValues(e)}),!j.util.isNodejs&&!s){if(o.collectInt(+new Date,32),"undefined"!=typeof navigator){var l="";for(var d in navigator)try{"string"==typeof navigator[d]&&(l+=navigator[d])}catch(e){}o.collect(l),l=null}t&&(t().mousemove((function(e){o.collectInt(e.clientX,16),o.collectInt(e.clientY,16)})),t().keypress((function(e){o.collectInt(e.charCode,8)})))}if(j.random)for(var d in o)j.random[d]=o[d];else j.random=o;j.random.createInstance=a,e.exports=j.random}("undefined"!=typeof jQuery?jQuery:null)}));var ge=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],me=[1,2,3,5],ye=function(e,t){return e<<t&65535|(65535&e)>>16-t},ve=function(e,t){return(65535&e)>>t|e<<16-t&65535};j.rc2=j.rc2||{},j.rc2.expandKey=function(e,t){"string"==typeof e&&(e=j.util.createBuffer(e)),t=t||128;var r,n=e,i=e.length(),a=t,o=Math.ceil(a/8),s=255>>(7&a);for(r=i;r<128;r++)n.putByte(ge[n.at(r-1)+n.at(r-i)&255]);for(n.setAt(128-o,ge[n.at(128-o)&s]),r=127-o;r>=0;r--)n.setAt(r,ge[n.at(r+1)^n.at(r+o)]);return n};var be,Ce=function(e,t,r){var n,i,a,o,s=!1,c=null,u=null,l=null,d=[];for(e=j.rc2.expandKey(e,t),a=0;a<64;a++)d.push(e.getInt16Le());r?(n=function(e){for(a=0;a<4;a++)e[a]+=d[o]+(e[(a+3)%4]&e[(a+2)%4])+(~e[(a+3)%4]&e[(a+1)%4]),e[a]=ye(e[a],me[a]),o++},i=function(e){for(a=0;a<4;a++)e[a]+=d[63&e[(a+3)%4]]}):(n=function(e){for(a=3;a>=0;a--)e[a]=ve(e[a],me[a]),e[a]-=d[o]+(e[(a+3)%4]&e[(a+2)%4])+(~e[(a+3)%4]&e[(a+1)%4]),o--},i=function(e){for(a=3;a>=0;a--)e[a]-=d[63&e[(a+3)%4]]});var f=function(e){var t=[];for(a=0;a<4;a++){var n=c.getInt16Le();null!==l&&(r?n^=l.getInt16Le():l.putInt16Le(n)),t.push(65535&n)}o=r?0:63;for(var i=0;i<e.length;i++)for(var s=0;s<e[i][0];s++)e[i][1](t);for(a=0;a<4;a++)null!==l&&(r?l.putInt16Le(t[a]):t[a]^=l.getInt16Le()),u.putInt16Le(t[a])},p=null;return p={start:function(e,t){e&&"string"==typeof e&&(e=j.util.createBuffer(e)),s=!1,c=j.util.createBuffer(),u=t||new j.util.createBuffer,l=e,p.output=u},update:function(e){for(s||c.putBuffer(e);c.length()>=8;)f([[5,n],[1,i],[6,n],[1,i],[5,n]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,c,!r);else{var n=8===c.length()?8:8-c.length();c.fillWithByte(n,n)}if(t&&(s=!0,p.update()),!r&&(t=0===c.length()))if(e)t=e(8,u,!r);else{var i=u.length(),a=u.at(i-1);a>i?t=!1:u.truncate(a)}return t}}};function Ee(e,t,r){this.data=[],null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function we(){return new Ee(null)}function ke(e,t,r,n,i,a){for(var o=16383&t,s=t>>14;--a>=0;){var c=16383&this.data[e],u=this.data[e++]>>14,l=s*c+u*o;i=((c=o*c+((16383&l)<<14)+r.data[n]+i)>>28)+(l>>14)+s*u,r.data[n++]=268435455&c}return i}j.rc2.startEncrypting=function(e,t,r){var n=j.rc2.createEncryptionCipher(e,128);return n.start(t,r),n},j.rc2.createEncryptionCipher=function(e,t){return Ce(e,t,!0)},j.rc2.startDecrypting=function(e,t,r){var n=j.rc2.createDecryptionCipher(e,128);return n.start(t,r),n},j.rc2.createDecryptionCipher=function(e,t){return Ce(e,t,!1)},j.jsbn=j.jsbn||{},j.jsbn.BigInteger=Ee,"undefined"==typeof navigator?(Ee.prototype.am=ke,be=28):"Microsoft Internet Explorer"==navigator.appName?(Ee.prototype.am=function(e,t,r,n,i,a){for(var o=32767&t,s=t>>15;--a>=0;){var c=32767&this.data[e],u=this.data[e++]>>15,l=s*c+u*o;i=((c=o*c+((32767&l)<<15)+r.data[n]+(1073741823&i))>>>30)+(l>>>15)+s*u+(i>>>30),r.data[n++]=1073741823&c}return i},be=30):"Netscape"!=navigator.appName?(Ee.prototype.am=function(e,t,r,n,i,a){for(;--a>=0;){var o=t*this.data[e++]+r.data[n]+i;i=Math.floor(o/67108864),r.data[n++]=67108863&o}return i},be=26):(Ee.prototype.am=ke,be=28),Ee.prototype.DB=be,Ee.prototype.DM=(1<<be)-1,Ee.prototype.DV=1<<be,Ee.prototype.FV=Math.pow(2,52),Ee.prototype.F1=52-be,Ee.prototype.F2=2*be-52;var Se,Be,Te=new Array;for(Se="0".charCodeAt(0),Be=0;Be<=9;++Be)Te[Se++]=Be;for(Se="a".charCodeAt(0),Be=10;Be<36;++Be)Te[Se++]=Be;for(Se="A".charCodeAt(0),Be=10;Be<36;++Be)Te[Se++]=Be;function Ae(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function Ie(e,t){var r=Te[e.charCodeAt(t)];return null==r?-1:r}function _e(e){var t=we();return t.fromInt(e),t}function xe(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function Pe(e){this.m=e}function Re(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function Ne(e,t){return e&t}function Oe(e,t){return e|t}function Le(e,t){return e^t}function De(e,t){return e&~t}function Ue(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function Me(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function Ve(){}function je(e){return e}function Fe(e){this.r2=we(),this.q3=we(),Ee.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}Pe.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},Pe.prototype.revert=function(e){return e},Pe.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},Pe.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},Pe.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},Re.prototype.convert=function(e){var t=we();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(Ee.ZERO)>0&&this.m.subTo(t,t),t},Re.prototype.revert=function(e){var t=we();return e.copyTo(t),this.reduce(t),t},Re.prototype.reduce=function(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e.data[t],n=r*this.mpl+((r*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,n,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},Re.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},Re.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},Ee.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s},Ee.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0},Ee.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var n=e.length,i=!1,a=0;--n>=0;){var o=8==r?255&e[n]:Ie(e,n);o<0?"-"==e.charAt(n)&&(i=!0):(i=!1,0==a?this.data[this.t++]=o:a+r>this.DB?(this.data[this.t-1]|=(o&(1<<this.DB-a)-1)<<a,this.data[this.t++]=o>>this.DB-a):this.data[this.t-1]|=o<<a,(a+=r)>=this.DB&&(a-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,a>0&&(this.data[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&Ee.ZERO.subTo(this,this)},Ee.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t},Ee.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s},Ee.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t.data[r-e]=this.data[r];t.t=Math.max(this.t-e,0),t.s=this.s},Ee.prototype.lShiftTo=function(e,t){var r,n=e%this.DB,i=this.DB-n,a=(1<<i)-1,o=Math.floor(e/this.DB),s=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)t.data[r+o+1]=this.data[r]>>i|s,s=(this.data[r]&a)<<n;for(r=o-1;r>=0;--r)t.data[r]=0;t.data[o]=s,t.t=this.t+o+1,t.s=this.s,t.clamp()},Ee.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,a=(1<<n)-1;t.data[0]=this.data[r]>>n;for(var o=r+1;o<this.t;++o)t.data[o-r-1]|=(this.data[o]&a)<<i,t.data[o-r]=this.data[o]>>n;n>0&&(t.data[this.t-r-1]|=(this.s&a)<<i),t.t=this.t-r,t.clamp()}},Ee.prototype.subTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]-e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t.data[r++]=this.DV+n:n>0&&(t.data[r++]=n),t.t=r,t.clamp()},Ee.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t.data[i]=0;for(i=0;i<n.t;++i)t.data[i+r.t]=r.am(0,n.data[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&Ee.ZERO.subTo(t,t)},Ee.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e.data[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t.data[r],e,2*r,0,1);(e.data[r+t.t]+=t.am(r+1,2*t.data[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp()},Ee.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t)return null!=t&&t.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=we());var a=we(),o=this.s,s=e.s,c=this.DB-xe(n.data[n.t-1]);c>0?(n.lShiftTo(c,a),i.lShiftTo(c,r)):(n.copyTo(a),i.copyTo(r));var u=a.t,l=a.data[u-1];if(0!=l){var d=l*(1<<this.F1)+(u>1?a.data[u-2]>>this.F2:0),f=this.FV/d,p=(1<<this.F1)/d,h=1<<this.F2,g=r.t,m=g-u,y=null==t?we():t;for(a.dlShiftTo(m,y),r.compareTo(y)>=0&&(r.data[r.t++]=1,r.subTo(y,r)),Ee.ONE.dlShiftTo(u,y),y.subTo(a,a);a.t<u;)a.data[a.t++]=0;for(;--m>=0;){var v=r.data[--g]==l?this.DM:Math.floor(r.data[g]*f+(r.data[g-1]+h)*p);if((r.data[g]+=a.am(0,v,r,m,0,u))<v)for(a.dlShiftTo(m,y),r.subTo(y,r);r.data[g]<--v;)r.subTo(y,r)}null!=t&&(r.drShiftTo(u,t),o!=s&&Ee.ZERO.subTo(t,t)),r.t=u,r.clamp(),c>0&&r.rShiftTo(c,r),o<0&&Ee.ZERO.subTo(r,r)}}},Ee.prototype.invDigit=function(){if(this.t<1)return 0;var e=this.data[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},Ee.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},Ee.prototype.exp=function(e,t){if(e>4294967295||e<1)return Ee.ONE;var r=we(),n=we(),i=t.convert(this),a=xe(e)-1;for(i.copyTo(r);--a>=0;)if(t.sqrTo(r,n),(e&1<<a)>0)t.mulTo(n,i,r);else{var o=r;r=n,n=o}return t.revert(r)},Ee.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<<t)-1,i=!1,a="",o=this.t,s=this.DB-o*this.DB%t;if(o-- >0)for(s<this.DB&&(r=this.data[o]>>s)>0&&(i=!0,a=Ae(r));o>=0;)s<t?(r=(this.data[o]&(1<<s)-1)<<t-s,r|=this.data[--o]>>(s+=this.DB-t)):(r=this.data[o]>>(s-=t)&n,s<=0&&(s+=this.DB,--o)),r>0&&(i=!0),i&&(a+=Ae(r));return i?a:"0"},Ee.prototype.negate=function(){var e=we();return Ee.ZERO.subTo(this,e),e},Ee.prototype.abs=function(){return this.s<0?this.negate():this},Ee.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this.data[r]-e.data[r]))return t;return 0},Ee.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+xe(this.data[this.t-1]^this.s&this.DM)},Ee.prototype.mod=function(e){var t=we();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(Ee.ZERO)>0&&e.subTo(t,t),t},Ee.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new Pe(t):new Re(t),this.exp(e,r)},Ee.ZERO=_e(0),Ee.ONE=_e(1),Ve.prototype.convert=je,Ve.prototype.revert=je,Ve.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},Ve.prototype.sqrTo=function(e,t){e.squareTo(t)},Fe.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=we();return e.copyTo(t),this.reduce(t),t},Fe.prototype.revert=function(e){return e},Fe.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},Fe.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},Fe.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var ze=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],Ke=(1<<26)/ze[ze.length-1];if(Ee.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},Ee.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=_e(r),i=we(),a=we(),o="";for(this.divRemTo(n,i,a);i.signum()>0;)o=(r+a.intValue()).toString(e).substr(1)+o,i.divRemTo(n,i,a);return a.intValue().toString(e)+o},Ee.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,a=0,o=0,s=0;s<e.length;++s){var c=Ie(e,s);c<0?"-"==e.charAt(s)&&0==this.signum()&&(i=!0):(o=t*o+c,++a>=r&&(this.dMultiply(n),this.dAddOffset(o,0),a=0,o=0))}a>0&&(this.dMultiply(Math.pow(t,a)),this.dAddOffset(o,0)),i&&Ee.ZERO.subTo(this,this)},Ee.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(Ee.ONE.shiftLeft(e-1),Oe,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(Ee.ONE.shiftLeft(e-1),this);else{var n=new Array,i=7&e;n.length=1+(e>>3),t.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}},Ee.prototype.bitwiseTo=function(e,t,r){var n,i,a=Math.min(e.t,this.t);for(n=0;n<a;++n)r.data[n]=t(this.data[n],e.data[n]);if(e.t<this.t){for(i=e.s&this.DM,n=a;n<this.t;++n)r.data[n]=t(this.data[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=a;n<e.t;++n)r.data[n]=t(i,e.data[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},Ee.prototype.changeBit=function(e,t){var r=Ee.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r},Ee.prototype.addTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]+e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t.data[r++]=n:n<-1&&(t.data[r++]=this.DV+n),t.t=r,t.clamp()},Ee.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},Ee.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}},Ee.prototype.multiplyLowerTo=function(e,t,r){var n,i=Math.min(this.t+e.t,t);for(r.s=0,r.t=i;i>0;)r.data[--i]=0;for(n=r.t-this.t;i<n;++i)r.data[i+this.t]=this.am(0,e.data[i],r,i,0,this.t);for(n=Math.min(e.t,t);i<n;++i)this.am(0,e.data[i],r,i,0,t-i);r.clamp()},Ee.prototype.multiplyUpperTo=function(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r.data[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r.data[this.t+n-t]=this.am(t-n,e.data[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)},Ee.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this.data[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this.data[n])%e;return r},Ee.prototype.millerRabin=function(e){var t=this.subtract(Ee.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var n,i=t.shiftRight(r),a={nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(256*Math.random())}},o=0;o<e;++o){do{n=new Ee(this.bitLength(),a)}while(n.compareTo(Ee.ONE)<=0||n.compareTo(t)>=0);var s=n.modPow(i,this);if(0!=s.compareTo(Ee.ONE)&&0!=s.compareTo(t)){for(var c=1;c++<r&&0!=s.compareTo(t);)if(0==(s=s.modPowInt(2,this)).compareTo(Ee.ONE))return!1;if(0!=s.compareTo(t))return!1}}return!0},Ee.prototype.clone=function(){var e=we();return this.copyTo(e),e},Ee.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this.data[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this.data[0];if(0==this.t)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]},Ee.prototype.byteValue=function(){return 0==this.t?this.s:this.data[0]<<24>>24},Ee.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},Ee.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},Ee.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,i=0;if(e-- >0)for(n<this.DB&&(r=this.data[e]>>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this.data[e]&(1<<n)-1)<<8-n,r|=this.data[--e]>>(n+=this.DB-8)):(r=this.data[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},Ee.prototype.equals=function(e){return 0==this.compareTo(e)},Ee.prototype.min=function(e){return this.compareTo(e)<0?this:e},Ee.prototype.max=function(e){return this.compareTo(e)>0?this:e},Ee.prototype.and=function(e){var t=we();return this.bitwiseTo(e,Ne,t),t},Ee.prototype.or=function(e){var t=we();return this.bitwiseTo(e,Oe,t),t},Ee.prototype.xor=function(e){var t=we();return this.bitwiseTo(e,Le,t),t},Ee.prototype.andNot=function(e){var t=we();return this.bitwiseTo(e,De,t),t},Ee.prototype.not=function(){for(var e=we(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e},Ee.prototype.shiftLeft=function(e){var t=we();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},Ee.prototype.shiftRight=function(e){var t=we();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},Ee.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this.data[e])return e*this.DB+Ue(this.data[e]);return this.s<0?this.t*this.DB:-1},Ee.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=Me(this.data[r]^t);return e},Ee.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this.data[t]&1<<e%this.DB)},Ee.prototype.setBit=function(e){return this.changeBit(e,Oe)},Ee.prototype.clearBit=function(e){return this.changeBit(e,De)},Ee.prototype.flipBit=function(e){return this.changeBit(e,Le)},Ee.prototype.add=function(e){var t=we();return this.addTo(e,t),t},Ee.prototype.subtract=function(e){var t=we();return this.subTo(e,t),t},Ee.prototype.multiply=function(e){var t=we();return this.multiplyTo(e,t),t},Ee.prototype.divide=function(e){var t=we();return this.divRemTo(e,t,null),t},Ee.prototype.remainder=function(e){var t=we();return this.divRemTo(e,null,t),t},Ee.prototype.divideAndRemainder=function(e){var t=we(),r=we();return this.divRemTo(e,t,r),new Array(t,r)},Ee.prototype.modPow=function(e,t){var r,n,i=e.bitLength(),a=_e(1);if(i<=0)return a;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new Pe(t):t.isEven()?new Fe(t):new Re(t);var o=new Array,s=3,c=r-1,u=(1<<r)-1;if(o[1]=n.convert(this),r>1){var l=we();for(n.sqrTo(o[1],l);s<=u;)o[s]=we(),n.mulTo(l,o[s-2],o[s]),s+=2}var d,f,p=e.t-1,h=!0,g=we();for(i=xe(e.data[p])-1;p>=0;){for(i>=c?d=e.data[p]>>i-c&u:(d=(e.data[p]&(1<<i+1)-1)<<c-i,p>0&&(d|=e.data[p-1]>>this.DB+i-c)),s=r;0==(1&d);)d>>=1,--s;if((i-=s)<0&&(i+=this.DB,--p),h)o[d].copyTo(a),h=!1;else{for(;s>1;)n.sqrTo(a,g),n.sqrTo(g,a),s-=2;s>0?n.sqrTo(a,g):(f=a,a=g,g=f),n.mulTo(g,o[d],a)}for(;p>=0&&0==(e.data[p]&1<<i);)n.sqrTo(a,g),f=a,a=g,g=f,--i<0&&(i=this.DB-1,--p)}return n.revert(a)},Ee.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return Ee.ZERO;for(var r=e.clone(),n=this.clone(),i=_e(1),a=_e(0),o=_e(0),s=_e(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?(i.isEven()&&a.isEven()||(i.addTo(this,i),a.subTo(e,a)),i.rShiftTo(1,i)):a.isEven()||a.subTo(e,a),a.rShiftTo(1,a);for(;n.isEven();)n.rShiftTo(1,n),t?(o.isEven()&&s.isEven()||(o.addTo(this,o),s.subTo(e,s)),o.rShiftTo(1,o)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);r.compareTo(n)>=0?(r.subTo(n,r),t&&i.subTo(o,i),a.subTo(s,a)):(n.subTo(r,n),t&&o.subTo(i,o),s.subTo(a,s))}return 0!=n.compareTo(Ee.ONE)?Ee.ZERO:s.compareTo(e)>=0?s.subtract(e):s.signum()<0?(s.addTo(e,s),s.signum()<0?s.add(e):s):s},Ee.prototype.pow=function(e){return this.exp(e,new Ve)},Ee.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return t;for(i<a&&(a=i),a>0&&(t.rShiftTo(a,t),r.rShiftTo(a,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r},Ee.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=ze[ze.length-1]){for(t=0;t<ze.length;++t)if(r.data[0]==ze[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<ze.length;){for(var n=ze[t],i=t+1;i<ze.length&&n<Ke;)n*=ze[i++];for(n=r.modInt(n);t<i;)if(n%ze[t++]==0)return!1}return r.millerRabin(e)},C((function(e){var t=e.exports=j.sha1=j.sha1||{};j.md.sha1=j.md.algorithms.sha1=t,t.create=function(){n||(r=String.fromCharCode(128),r+=j.util.fillString(String.fromCharCode(0),64),n=!0);var e=null,t=j.util.createBuffer(),a=new Array(80),o={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){o.messageLength=0,o.fullMessageLength=o.messageLength64=[];for(var r=o.messageLengthSize/4,n=0;n<r;++n)o.fullMessageLength.push(0);return t=j.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},o}};return o.start(),o.update=function(r,n){"utf8"===n&&(r=j.util.encodeUtf8(r));var s=r.length;o.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var c=o.fullMessageLength.length-1;c>=0;--c)o.fullMessageLength[c]+=s[1],s[1]=s[0]+(o.fullMessageLength[c]/4294967296>>>0),o.fullMessageLength[c]=o.fullMessageLength[c]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(r),i(e,a,t),(t.read>2048||0===t.length())&&t.compact(),o},o.digest=function(){var n=j.util.createBuffer();n.putBytes(t.bytes());var s,c=o.fullMessageLength[o.fullMessageLength.length-1]+o.messageLengthSize&o.blockLength-1;n.putBytes(r.substr(0,o.blockLength-c));for(var u=8*o.fullMessageLength[0],l=0;l<o.fullMessageLength.length-1;++l)u+=(s=8*o.fullMessageLength[l+1])/4294967296>>>0,n.putInt32(u>>>0),u=s>>>0;n.putInt32(u);var d={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};i(d,a,n);var f=j.util.createBuffer();return f.putInt32(d.h0),f.putInt32(d.h1),f.putInt32(d.h2),f.putInt32(d.h3),f.putInt32(d.h4),f},o};var r=null,n=!1;function i(e,t,r){for(var n,i,a,o,s,c,u,l=r.length();l>=64;){for(i=e.h0,a=e.h1,o=e.h2,s=e.h3,c=e.h4,u=0;u<16;++u)n=r.getInt32(),t[u]=n,n=(i<<5|i>>>27)+(s^a&(o^s))+c+1518500249+n,c=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<20;++u)n=(n=t[u-3]^t[u-8]^t[u-14]^t[u-16])<<1|n>>>31,t[u]=n,n=(i<<5|i>>>27)+(s^a&(o^s))+c+1518500249+n,c=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<32;++u)n=(n=t[u-3]^t[u-8]^t[u-14]^t[u-16])<<1|n>>>31,t[u]=n,n=(i<<5|i>>>27)+(a^o^s)+c+1859775393+n,c=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<40;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(i<<5|i>>>27)+(a^o^s)+c+1859775393+n,c=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<60;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(i<<5|i>>>27)+(a&o|s&(a^o))+c+2400959708+n,c=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<80;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(i<<5|i>>>27)+(a^o^s)+c+3395469782+n,c=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+o|0,e.h3=e.h3+s|0,e.h4=e.h4+c|0,l-=64}}})),C((function(e){var t=e.exports=j.pkcs1=j.pkcs1||{};function r(e,t,r){r||(r=j.md.sha1.create());for(var n="",i=Math.ceil(t/r.digestLength),a=0;a<i;++a){var o=String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,255&a);r.start(),r.update(e+o),n+=r.digest().getBytes()}return n.substring(0,t)}t.encode_rsa_oaep=function(e,t,n){var i,a,o,s;"string"==typeof n?(i=n,a=arguments[3]||void 0,o=arguments[4]||void 0):n&&(i=n.label||void 0,a=n.seed||void 0,o=n.md||void 0,n.mgf1&&n.mgf1.md&&(s=n.mgf1.md)),o?o.start():o=j.md.sha1.create(),s||(s=o);var c=Math.ceil(e.n.bitLength()/8),u=c-2*o.digestLength-2;if(t.length>u)throw(h=new Error("RSAES-OAEP input message length is too long.")).length=t.length,h.maxLength=u,h;i||(i=""),o.update(i,"raw");for(var l=o.digest(),d="",f=u-t.length,p=0;p<f;p++)d+="\0";var h,g=l.getBytes()+d+""+t;if(a){if(a.length!==o.digestLength)throw(h=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.")).seedLength=a.length,h.digestLength=o.digestLength,h}else a=j.random.getBytes(o.digestLength);var m=r(a,c-o.digestLength-1,s),y=j.util.xorBytes(g,m,g.length),v=r(y,o.digestLength,s);return"\0"+j.util.xorBytes(a,v,a.length)+y},t.decode_rsa_oaep=function(e,t,n){var i,a,o;"string"==typeof n?(i=n,a=arguments[3]||void 0):n&&(i=n.label||void 0,a=n.md||void 0,n.mgf1&&n.mgf1.md&&(o=n.mgf1.md));var s=Math.ceil(e.n.bitLength()/8);if(t.length!==s)throw(m=new Error("RSAES-OAEP encoded message length is invalid.")).length=t.length,m.expectedLength=s,m;if(void 0===a?a=j.md.sha1.create():a.start(),o||(o=a),s<2*a.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");i||(i=""),a.update(i,"raw");for(var c=a.digest().getBytes(),u=t.charAt(0),l=t.substring(1,a.digestLength+1),d=t.substring(1+a.digestLength),f=r(d,a.digestLength,o),p=r(j.util.xorBytes(l,f,l.length),s-a.digestLength-1,o),h=j.util.xorBytes(d,p,d.length),g=h.substring(0,a.digestLength),m="\0"!==u,y=0;y<a.digestLength;++y)m|=c.charAt(y)!==g.charAt(y);for(var v=1,b=a.digestLength,C=a.digestLength;C<h.length;C++){var E=h.charCodeAt(C);m|=E&(v?65534:0),b+=v&=1&E^1}if(m||1!==h.charCodeAt(b))throw new Error("Invalid RSAES-OAEP padding.");return h.substring(b+1)}})),C((function(e){!function(){if(j.prime)e.exports=j.prime;else{var t=e.exports=j.prime=j.prime||{},r=j.jsbn.BigInteger,n=[6,4,2,4,2,4,6,2],i=new r(null);i.fromInt(30);var a=function(e,t){return e|t};t.generateProbablePrime=function(e,t,n){"function"==typeof t&&(n=t,t={});var i=(t=t||{}).algorithm||"PRIMEINC";"string"==typeof i&&(i={name:i}),i.options=i.options||{};var a=t.prng||j.random,c={nextBytes:function(e){for(var t=a.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}};if("PRIMEINC"===i.name)return function(e,t,n,i){return"workers"in n?function(e,t,n,i){if("undefined"==typeof Worker)return o(e,t,n,i);var a=s(e,t),c=n.workers,u=n.workLoad||100,l=30*u/8,d=n.workerScript||"forge/prime.worker.js";if(-1===c)return j.util.estimateCores((function(e,t){e&&(t=2),c=t-1,f()}));function f(){c=Math.max(1,c);for(var n=[],o=0;o<c;++o)n[o]=new Worker(d);for(o=0;o<c;++o)n[o].addEventListener("message",p);var f=!1;function p(o){if(!f){var c=o.data;if(c.found){for(var d=0;d<n.length;++d)n[d].terminate();return f=!0,i(null,new r(c.prime,16))}a.bitLength()>e&&(a=s(e,t));var p=a.toString(16);o.target.postMessage({hex:p,workLoad:u}),a.dAddOffset(l,0)}}}f()}(e,t,n,i):o(e,t,n,i)}(e,c,i.options,n);throw new Error("Invalid prime generation algorithm: "+i.name)}}function o(e,t,r,i){var a=s(e,t),o=function(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}(a.bitLength());"millerRabinTests"in r&&(o=r.millerRabinTests);var c=10;"maxBlockTime"in r&&(c=r.maxBlockTime),function e(t,r,i,a,o,c,u){var l=+new Date;do{if(t.bitLength()>r&&(t=s(r,i)),t.isProbablePrime(o))return u(null,t);t.dAddOffset(n[a++%8],0)}while(c<0||+new Date-l<c);j.util.setImmediate((function(){e(t,r,i,a,o,c,u)}))}(a,e,t,0,o,c,i)}function s(e,t){var n=new r(e,t),o=e-1;return n.testBit(o)||n.bitwiseTo(r.ONE.shiftLeft(o),a,n),n.dAddOffset(31-n.mod(i).byteValue(),0),n}}()})),void 0===qe)var qe=j.jsbn.BigInteger;var He=j.util.isNodejs?t:null,Qe=j.asn1,Ge=j.util;j.pki=j.pki||{},j.pki.rsa=j.rsa=j.rsa||{};var We=j.pki,Xe=[6,4,2,4,2,4,6,2],Ye={name:"PrivateKeyInfo",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},$e={name:"RSAPrivateKey",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},Ze={name:"RSAPublicKey",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},Je=j.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:Qe.Class.UNIVERSAL,type:Qe.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},et=function(e){var t;if(!(e.algorithm in We.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}t=We.oids[e.algorithm];var n=Qe.oidToDer(t).getBytes(),i=Qe.create(Qe.Class.UNIVERSAL,Qe.Type.SEQUENCE,!0,[]),a=Qe.create(Qe.Class.UNIVERSAL,Qe.Type.SEQUENCE,!0,[]);a.value.push(Qe.create(Qe.Class.UNIVERSAL,Qe.Type.OID,!1,n)),a.value.push(Qe.create(Qe.Class.UNIVERSAL,Qe.Type.NULL,!1,""));var o=Qe.create(Qe.Class.UNIVERSAL,Qe.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(a),i.value.push(o),Qe.toDer(i).getBytes()},tt=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);var n;t.dP||(t.dP=t.d.mod(t.p.subtract(qe.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(qe.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do{n=new qe(j.util.bytesToHex(j.random.getBytes(t.n.bitLength()/8)),16)}while(n.compareTo(t.n)>=0||!n.gcd(t.n).equals(qe.ONE));for(var i=(e=e.multiply(n.modPow(t.e,t.n)).mod(t.n)).mod(t.p).modPow(t.dP,t.p),a=e.mod(t.q).modPow(t.dQ,t.q);i.compareTo(a)<0;)i=i.add(t.p);return i.subtract(a).multiply(t.qInv).mod(t.p).multiply(t.q).add(a).multiply(n.modInverse(t.n)).mod(t.n)};function rt(e,t,r){var n=j.util.createBuffer(),i=Math.ceil(t.n.bitLength()/8);if(e.length>i-11){var a=new Error("Message is too long for PKCS#1 v1.5 padding.");throw a.length=e.length,a.max=i-11,a}n.putByte(0),n.putByte(r);var o,s=i-3-e.length;if(0===r||1===r){o=0===r?0:255;for(var c=0;c<s;++c)n.putByte(o)}else for(;s>0;){var u=0,l=j.random.getBytes(s);for(c=0;c<s;++c)0===(o=l.charCodeAt(c))?++u:n.putByte(o);s=u}return n.putByte(0),n.putBytes(e),n}function nt(e,t,r,n){var i=Math.ceil(t.n.bitLength()/8),a=j.util.createBuffer(e),o=a.getByte(),s=a.getByte();if(0!==o||r&&0!==s&&1!==s||!r&&2!=s||r&&0===s&&void 0===n)throw new Error("Encryption block is invalid.");var c=0;if(0===s){c=i-3-n;for(var u=0;u<c;++u)if(0!==a.getByte())throw new Error("Encryption block is invalid.")}else if(1===s)for(c=0;a.length()>1;){if(255!==a.getByte()){--a.read;break}++c}else if(2===s)for(c=0;a.length()>1;){if(0===a.getByte()){--a.read;break}++c}if(0!==a.getByte()||c!==i-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}function it(e,t,r){"function"==typeof t&&(r=t,t={});var n={algorithm:{name:(t=t||{}).algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};function i(){a(e.pBits,(function(t,n){return t?r(t):(e.p=n,null!==e.q?o(t,e.q):void a(e.qBits,o))}))}function a(e,t){j.prime.generateProbablePrime(e,n,t)}function o(t,n){if(t)return r(t);if(e.q=n,e.p.compareTo(e.q)<0){var s=e.p;e.p=e.q,e.q=s}if(0!==e.p.subtract(qe.ONE).gcd(e.e).compareTo(qe.ONE))return e.p=null,void i();if(0!==e.q.subtract(qe.ONE).gcd(e.e).compareTo(qe.ONE))return e.q=null,void a(e.qBits,o);if(e.p1=e.p.subtract(qe.ONE),e.q1=e.q.subtract(qe.ONE),e.phi=e.p1.multiply(e.q1),0!==e.phi.gcd(e.e).compareTo(qe.ONE))return e.p=e.q=null,void i();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void a(e.qBits,o);var c=e.e.modInverse(e.phi);e.keys={privateKey:We.rsa.setPrivateKey(e.n,e.e,c,e.p,e.q,c.mod(e.p1),c.mod(e.q1),e.q.modInverse(e.p)),publicKey:We.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}"prng"in t&&(n.prng=t.prng),i()}function at(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=j.util.hexToBytes(t);return r.length>1&&(0===r.charCodeAt(0)&&0==(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128==(128&r.charCodeAt(1)))?r.substr(1):r}function ot(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function st(e){return j.util.isNodejs&&"function"==typeof He[e]}function ct(e){return void 0!==Ge.globalScope&&"object"==Iv(Ge.globalScope.crypto)&&"object"==Iv(Ge.globalScope.crypto.subtle)&&"function"==typeof Ge.globalScope.crypto.subtle[e]}function ut(e){return void 0!==Ge.globalScope&&"object"==Iv(Ge.globalScope.msCrypto)&&"object"==Iv(Ge.globalScope.msCrypto.subtle)&&"function"==typeof Ge.globalScope.msCrypto.subtle[e]}function lt(e){for(var t=j.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),n=0;n<t.length;++n)r[n]=t.charCodeAt(n);return r}if(We.rsa.encrypt=function(e,t,r){var n,i=r,a=Math.ceil(t.n.bitLength()/8);!1!==r&&!0!==r?(i=2===r,n=rt(e,t,r)):(n=j.util.createBuffer()).putBytes(e);for(var o=new qe(n.toHex(),16),s=tt(o,t,i).toString(16),c=j.util.createBuffer(),u=a-Math.ceil(s.length/2);u>0;)c.putByte(0),--u;return c.putBytes(j.util.hexToBytes(s)),c.getBytes()},We.rsa.decrypt=function(e,t,r,n){var i=Math.ceil(t.n.bitLength()/8);if(e.length!==i){var a=new Error("Encrypted message length is invalid.");throw a.length=e.length,a.expected=i,a}var o=new qe(j.util.createBuffer(e).toHex(),16);if(o.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var s=tt(o,t,r).toString(16),c=j.util.createBuffer(),u=i-Math.ceil(s.length/2);u>0;)c.putByte(0),--u;return c.putBytes(j.util.hexToBytes(s)),!1!==n?nt(c.getBytes(),t,r):c.getBytes()},We.rsa.createKeyPairGenerationState=function(e,t,r){"string"==typeof e&&(e=parseInt(e,10)),e=e||2048;var n,i=(r=r||{}).prng||j.random,a={nextBytes:function(e){for(var t=i.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}},o=r.algorithm||"PRIMEINC";if("PRIMEINC"!==o)throw new Error("Invalid key generation algorithm: "+o);return(n={algorithm:o,state:0,bits:e,rng:a,eInt:t||65537,e:new qe(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(n.eInt),n},We.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new qe(null);r.fromInt(30);for(var n,i=0,a=function(e,t){return e|t},o=+new Date,s=0;null===e.keys&&(t<=0||s<t);){if(0===e.state){var c=null===e.p?e.pBits:e.qBits,u=c-1;0===e.pqState?(e.num=new qe(c,e.rng),e.num.testBit(u)||e.num.bitwiseTo(qe.ONE.shiftLeft(u),a,e.num),e.num.dAddOffset(31-e.num.mod(r).byteValue(),0),i=0,++e.pqState):1===e.pqState?e.num.bitLength()>c?e.pqState=0:e.num.isProbablePrime(ot(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(Xe[i++%8],0):2===e.pqState?e.pqState=0===e.num.subtract(qe.ONE).gcd(e.e).compareTo(qe.ONE)?3:0:3===e.pqState&&(e.pqState=0,null===e.p?e.p=e.num:e.q=e.num,null!==e.p&&null!==e.q&&++e.state,e.num=null)}else if(1===e.state)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(2===e.state)e.p1=e.p.subtract(qe.ONE),e.q1=e.q.subtract(qe.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(qe.ONE)?++e.state:(e.p=null,e.q=null,e.state=0);else if(4===e.state)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(5===e.state){var l=e.e.modInverse(e.phi);e.keys={privateKey:We.rsa.setPrivateKey(e.n,e.e,l,e.p,e.q,l.mod(e.p1),l.mod(e.q1),e.q.modInverse(e.p)),publicKey:We.rsa.setPublicKey(e.n,e.e)}}s+=(n=+new Date)-o,o=n}return null!==e.keys},We.rsa.generateKeyPair=function(e,t,r,n){if(1===arguments.length?"object"==Iv(e)?(r=e,e=void 0):"function"==typeof e&&(n=e,e=void 0):2===arguments.length?"number"==typeof e?"function"==typeof t?(n=t,t=void 0):"number"!=typeof t&&(r=t,t=void 0):(r=e,n=t,e=void 0,t=void 0):3===arguments.length&&("number"==typeof t?"function"==typeof r&&(n=r,r=void 0):(n=r,r=t,t=void 0)),r=r||{},void 0===e&&(e=r.bits||2048),void 0===t&&(t=r.e||65537),!r.prng&&e>=256&&e<=16384&&(65537===t||3===t))if(n){if(st("generateKeyPair"))return He.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},(function(e,t,r){if(e)return n(e);n(null,{privateKey:We.privateKeyFromPem(r),publicKey:We.publicKeyFromPem(t)})}));if(ct("generateKey")&&ct("exportKey"))return Ge.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:lt(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then((function(e){return Ge.globalScope.crypto.subtle.exportKey("pkcs8",e.privateKey)})).then(void 0,(function(e){n(e)})).then((function(e){if(e){var t=We.privateKeyFromAsn1(Qe.fromDer(j.util.createBuffer(e)));n(null,{privateKey:t,publicKey:We.setRsaPublicKey(t.n,t.e)})}}));if(ut("generateKey")&&ut("exportKey")){var i=Ge.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:lt(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);return i.oncomplete=function(e){var t=e.target.result,r=Ge.globalScope.msCrypto.subtle.exportKey("pkcs8",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=We.privateKeyFromAsn1(Qe.fromDer(j.util.createBuffer(t)));n(null,{privateKey:r,publicKey:We.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){n(e)}},void(i.onerror=function(e){n(e)})}}else if(st("generateKeyPairSync")){var a=He.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:We.privateKeyFromPem(a.privateKey),publicKey:We.publicKeyFromPem(a.publicKey)}}var o=We.rsa.createKeyPairGenerationState(e,t,r);if(!n)return We.rsa.stepKeyPairGenerationState(o,0),o.keys;it(o,r,n)},We.setRsaPublicKey=We.rsa.setPublicKey=function(e,t){var r={n:e,e:t,encrypt:function(e,t,n){if("string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===t)t={encode:function(e,t,r){return rt(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return j.pkcs1.encode_rsa_oaep(t,e,n)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(t))t={encode:function(e){return e}};else if("string"==typeof t)throw new Error('Unsupported encryption scheme: "'+t+'".');var i=t.encode(e,r,!0);return We.rsa.encrypt(i,r,!0)},verify:function(e,t,n){"string"==typeof n?n=n.toUpperCase():void 0===n&&(n="RSASSA-PKCS1-V1_5"),"RSASSA-PKCS1-V1_5"===n?n={verify:function(e,t){return t=nt(t,r,!0),e===Qe.fromDer(t).value[1].value}}:"NONE"!==n&&"NULL"!==n&&null!==n||(n={verify:function(e,t){return e===nt(t,r,!0)}});var i=We.rsa.decrypt(t,r,!0,!1);return n.verify(e,i,r.n.bitLength())}};return r},We.setRsaPrivateKey=We.rsa.setPrivateKey=function(e,t,r,n,i,a,o,s){var c={n:e,e:t,d:r,p:n,q:i,dP:a,dQ:o,qInv:s,decrypt:function(e,t,r){"string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var n=We.rsa.decrypt(e,c,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:nt};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return j.pkcs1.decode_rsa_oaep(t,e,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(t))throw new Error('Unsupported encryption scheme: "'+t+'".');t={decode:function(e){return e}}}return t.decode(n,c,!1)},sign:function(e,t){var r=!1;"string"==typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:et},r=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},r=1);var n=t.encode(e,c.n.bitLength());return We.rsa.encrypt(n,c,r)}};return c},We.wrapRsaPrivateKey=function(e){return Qe.create(Qe.Class.UNIVERSAL,Qe.Type.SEQUENCE,!0,[Qe.create(Qe.Class.UNIVERSAL,Qe.Type.INTEGER,!1,Qe.integerToDer(0).getBytes()),Qe.create(Qe.Class.UNIVERSAL,Qe.Type.SEQUENCE,!0,[Qe.create(Qe.Class.UNIVERSAL,Qe.Type.OID,!1,Qe.oidToDer(We.oids.rsaEncryption).getBytes()),Qe.create(Qe.Class.UNIVERSAL,Qe.Type.NULL,!1,"")]),Qe.create(Qe.Class.UNIVERSAL,Qe.Type.OCTETSTRING,!1,Qe.toDer(e).getBytes())])},We.privateKeyFromAsn1=function(e){var t,r,n,i,a,o,s,c,u={},l=[];if(Qe.validate(e,Ye,u,l)&&(e=Qe.fromDer(j.util.createBuffer(u.privateKey))),u={},l=[],!Qe.validate(e,$e,u,l)){var d=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw d.errors=l,d}return t=j.util.createBuffer(u.privateKeyModulus).toHex(),r=j.util.createBuffer(u.privateKeyPublicExponent).toHex(),n=j.util.createBuffer(u.privateKeyPrivateExponent).toHex(),i=j.util.createBuffer(u.privateKeyPrime1).toHex(),a=j.util.createBuffer(u.privateKeyPrime2).toHex(),o=j.util.createBuffer(u.privateKeyExponent1).toHex(),s=j.util.createBuffer(u.privateKeyExponent2).toHex(),c=j.util.createBuffer(u.privateKeyCoefficient).toHex(),We.setRsaPrivateKey(new qe(t,16),new qe(r,16),new qe(n,16),new qe(i,16),new qe(a,16),new qe(o,16),new qe(s,16),new qe(c,16))},We.privateKeyToAsn1=We.privateKeyToRSAPrivateKey=function(e){return Qe.create(Qe.Class.UNIVERSAL,Qe.Type.SEQUENCE,!0,[Qe.create(Qe.Class.UNIVERSAL,Qe.Type.INTEGER,!1,Qe.integerToDer(0).getBytes()),Qe.create(Qe.Class.UNIVERSAL,Qe.Type.INTEGER,!1,at(e.n)),Qe.create(Qe.Class.UNIVERSAL,Qe.Type.INTEGER,!1,at(e.e)),Qe.create(Qe.Class.UNIVERSAL,Qe.Type.INTEGER,!1,at(e.d)),Qe.create(Qe.Class.UNIVERSAL,Qe.Type.INTEGER,!1,at(e.p)),Qe.create(Qe.Class.UNIVERSAL,Qe.Type.INTEGER,!1,at(e.q)),Qe.create(Qe.Class.UNIVERSAL,Qe.Type.INTEGER,!1,at(e.dP)),Qe.create(Qe.Class.UNIVERSAL,Qe.Type.INTEGER,!1,at(e.dQ)),Qe.create(Qe.Class.UNIVERSAL,Qe.Type.INTEGER,!1,at(e.qInv))])},We.publicKeyFromAsn1=function(e){var t={},r=[];if(Qe.validate(e,Je,t,r)){var n,i=Qe.derToOid(t.publicKeyOid);if(i!==We.oids.rsaEncryption)throw(n=new Error("Cannot read public key. Unknown OID.")).oid=i,n;e=t.rsaPublicKey}if(r=[],!Qe.validate(e,Ze,t,r))throw(n=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,n;var a=j.util.createBuffer(t.publicKeyModulus).toHex(),o=j.util.createBuffer(t.publicKeyExponent).toHex();return We.setRsaPublicKey(new qe(a,16),new qe(o,16))},We.publicKeyToAsn1=We.publicKeyToSubjectPublicKeyInfo=function(e){return Qe.create(Qe.Class.UNIVERSAL,Qe.Type.SEQUENCE,!0,[Qe.create(Qe.Class.UNIVERSAL,Qe.Type.SEQUENCE,!0,[Qe.create(Qe.Class.UNIVERSAL,Qe.Type.OID,!1,Qe.oidToDer(We.oids.rsaEncryption).getBytes()),Qe.create(Qe.Class.UNIVERSAL,Qe.Type.NULL,!1,"")]),Qe.create(Qe.Class.UNIVERSAL,Qe.Type.BITSTRING,!1,[We.publicKeyToRSAPublicKey(e)])])},We.publicKeyToRSAPublicKey=function(e){return Qe.create(Qe.Class.UNIVERSAL,Qe.Type.SEQUENCE,!0,[Qe.create(Qe.Class.UNIVERSAL,Qe.Type.INTEGER,!1,at(e.n)),Qe.create(Qe.Class.UNIVERSAL,Qe.Type.INTEGER,!1,at(e.e))])},void 0===dt)var dt=j.jsbn.BigInteger;var ft=j.asn1,pt=j.pki=j.pki||{},ht=(pt.pbe=j.pbe=j.pbe||{},pt.oids),gt={name:"EncryptedPrivateKeyInfo",tagClass:ft.Class.UNIVERSAL,type:ft.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:ft.Class.UNIVERSAL,type:ft.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:ft.Class.UNIVERSAL,type:ft.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:ft.Class.UNIVERSAL,type:ft.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:ft.Class.UNIVERSAL,type:ft.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},mt={name:"PBES2Algorithms",tagClass:ft.Class.UNIVERSAL,type:ft.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:ft.Class.UNIVERSAL,type:ft.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:ft.Class.UNIVERSAL,type:ft.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:ft.Class.UNIVERSAL,type:ft.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:ft.Class.UNIVERSAL,type:ft.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:ft.Class.UNIVERSAL,type:ft.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:ft.Class.UNIVERSAL,type:ft.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:ft.Class.UNIVERSAL,type:ft.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:ft.Class.UNIVERSAL,type:ft.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:ft.Class.UNIVERSAL,type:ft.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:ft.Class.UNIVERSAL,type:ft.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:ft.Class.UNIVERSAL,type:ft.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},yt={name:"pkcs-12PbeParams",tagClass:ft.Class.UNIVERSAL,type:ft.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:ft.Class.UNIVERSAL,type:ft.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:ft.Class.UNIVERSAL,type:ft.Type.INTEGER,constructed:!1,capture:"iterations"}]};function vt(e,t){return e.start().update(t).digest().getBytes()}function bt(e){var t;if(e){if(!(t=pt.oids[ft.derToOid(e)])){var r=new Error("Unsupported PRF OID.");throw r.oid=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}}else t="hmacWithSHA1";return Ct(t)}function Ct(e){var t=j.md;switch(e){case"hmacWithSHA224":t=j.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var r=new Error("Unsupported PRF algorithm.");throw r.algorithm=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}pt.encryptPrivateKeyInfo=function(e,t,r){(r=r||{}).saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var n,i,a,o=j.random.getBytesSync(r.saltSize),s=r.count,c=ft.integerToDer(s);if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){var u,l,d;switch(r.algorithm){case"aes128":n=16,u=16,l=ht["aes128-CBC"],d=j.aes.createEncryptionCipher;break;case"aes192":n=24,u=16,l=ht["aes192-CBC"],d=j.aes.createEncryptionCipher;break;case"aes256":n=32,u=16,l=ht["aes256-CBC"],d=j.aes.createEncryptionCipher;break;case"des":n=8,u=8,l=ht.desCBC,d=j.des.createEncryptionCipher;break;default:throw(y=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,y}var f="hmacWith"+r.prfAlgorithm.toUpperCase(),p=Ct(f),h=j.pkcs5.pbkdf2(t,o,s,n,p),g=j.random.getBytesSync(u);(v=d(h)).start(g),v.update(ft.toDer(e)),v.finish(),a=v.output.getBytes();var m=function(e,t,r,n){var i=ft.create(ft.Class.UNIVERSAL,ft.Type.SEQUENCE,!0,[ft.create(ft.Class.UNIVERSAL,ft.Type.OCTETSTRING,!1,e),ft.create(ft.Class.UNIVERSAL,ft.Type.INTEGER,!1,t.getBytes())]);return"hmacWithSHA1"!==n&&i.value.push(ft.create(ft.Class.UNIVERSAL,ft.Type.INTEGER,!1,j.util.hexToBytes(r.toString(16))),ft.create(ft.Class.UNIVERSAL,ft.Type.SEQUENCE,!0,[ft.create(ft.Class.UNIVERSAL,ft.Type.OID,!1,ft.oidToDer(pt.oids[n]).getBytes()),ft.create(ft.Class.UNIVERSAL,ft.Type.NULL,!1,"")])),i}(o,c,n,f);i=ft.create(ft.Class.UNIVERSAL,ft.Type.SEQUENCE,!0,[ft.create(ft.Class.UNIVERSAL,ft.Type.OID,!1,ft.oidToDer(ht.pkcs5PBES2).getBytes()),ft.create(ft.Class.UNIVERSAL,ft.Type.SEQUENCE,!0,[ft.create(ft.Class.UNIVERSAL,ft.Type.SEQUENCE,!0,[ft.create(ft.Class.UNIVERSAL,ft.Type.OID,!1,ft.oidToDer(ht.pkcs5PBKDF2).getBytes()),m]),ft.create(ft.Class.UNIVERSAL,ft.Type.SEQUENCE,!0,[ft.create(ft.Class.UNIVERSAL,ft.Type.OID,!1,ft.oidToDer(l).getBytes()),ft.create(ft.Class.UNIVERSAL,ft.Type.OCTETSTRING,!1,g)])])])}else{var y;if("3des"!==r.algorithm)throw(y=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,y;n=24;var v,b=new j.util.ByteBuffer(o);h=pt.pbe.generatePkcs12Key(t,b,1,s,n),g=pt.pbe.generatePkcs12Key(t,b,2,s,n),(v=j.des.createEncryptionCipher(h)).start(g),v.update(ft.toDer(e)),v.finish(),a=v.output.getBytes(),i=ft.create(ft.Class.UNIVERSAL,ft.Type.SEQUENCE,!0,[ft.create(ft.Class.UNIVERSAL,ft.Type.OID,!1,ft.oidToDer(ht["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),ft.create(ft.Class.UNIVERSAL,ft.Type.SEQUENCE,!0,[ft.create(ft.Class.UNIVERSAL,ft.Type.OCTETSTRING,!1,o),ft.create(ft.Class.UNIVERSAL,ft.Type.INTEGER,!1,c.getBytes())])])}return ft.create(ft.Class.UNIVERSAL,ft.Type.SEQUENCE,!0,[i,ft.create(ft.Class.UNIVERSAL,ft.Type.OCTETSTRING,!1,a)])},pt.decryptPrivateKeyInfo=function(e,t){var r=null,n={},i=[];if(!ft.validate(e,gt,n,i)){var a=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}var o=ft.derToOid(n.encryptionOid),s=pt.pbe.getCipher(o,n.encryptionParams,t),c=j.util.createBuffer(n.encryptedData);return s.update(c),s.finish()&&(r=ft.fromDer(s.output)),r},pt.encryptedPrivateKeyToPem=function(e,t){var r={type:"ENCRYPTED PRIVATE KEY",body:ft.toDer(e).getBytes()};return j.pem.encode(r,{maxline:t})},pt.encryptedPrivateKeyFromPem=function(e){var t=j.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==t.type){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return ft.fromDer(t.body)},pt.encryptRsaPrivateKey=function(e,t,r){if(!(r=r||{}).legacy){var n=pt.wrapRsaPrivateKey(pt.privateKeyToAsn1(e));return n=pt.encryptPrivateKeyInfo(n,t,r),pt.encryptedPrivateKeyToPem(n)}var i,a,o,s;switch(r.algorithm){case"aes128":i="AES-128-CBC",o=16,a=j.random.getBytesSync(16),s=j.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",o=24,a=j.random.getBytesSync(16),s=j.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",o=32,a=j.random.getBytesSync(16),s=j.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",o=24,a=j.random.getBytesSync(8),s=j.des.createEncryptionCipher;break;case"des":i="DES-CBC",o=8,a=j.random.getBytesSync(8),s=j.des.createEncryptionCipher;break;default:var c=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw c.algorithm=r.algorithm,c}var u=s(j.pbe.opensslDeriveBytes(t,a.substr(0,8),o));u.start(a),u.update(ft.toDer(pt.privateKeyToAsn1(e))),u.finish();var l={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:j.util.bytesToHex(a).toUpperCase()},body:u.output.getBytes()};return j.pem.encode(l)},pt.decryptRsaPrivateKey=function(e,t){var r=null,n=j.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==n.type&&"PRIVATE KEY"!==n.type&&"RSA PRIVATE KEY"!==n.type)throw(o=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".')).headerType=o,o;if(n.procType&&"ENCRYPTED"===n.procType.type){var i,a;switch(n.dekInfo.algorithm){case"DES-CBC":i=8,a=j.des.createDecryptionCipher;break;case"DES-EDE3-CBC":i=24,a=j.des.createDecryptionCipher;break;case"AES-128-CBC":i=16,a=j.aes.createDecryptionCipher;break;case"AES-192-CBC":i=24,a=j.aes.createDecryptionCipher;break;case"AES-256-CBC":i=32,a=j.aes.createDecryptionCipher;break;case"RC2-40-CBC":i=5,a=function(e){return j.rc2.createDecryptionCipher(e,40)};break;case"RC2-64-CBC":i=8,a=function(e){return j.rc2.createDecryptionCipher(e,64)};break;case"RC2-128-CBC":i=16,a=function(e){return j.rc2.createDecryptionCipher(e,128)};break;default:var o;throw(o=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".')).algorithm=n.dekInfo.algorithm,o}var s=j.util.hexToBytes(n.dekInfo.parameters),c=a(j.pbe.opensslDeriveBytes(t,s.substr(0,8),i));if(c.start(s),c.update(j.util.createBuffer(n.body)),!c.finish())return r;r=c.output.getBytes()}else r=n.body;return null!==(r="ENCRYPTED PRIVATE KEY"===n.type?pt.decryptPrivateKeyInfo(ft.fromDer(r),t):ft.fromDer(r))&&(r=pt.privateKeyFromAsn1(r)),r},pt.pbe.generatePkcs12Key=function(e,t,r,n,i,a){var o,s;if(null==a){if(!("sha1"in j.md))throw new Error('"sha1" hash algorithm unavailable.');a=j.md.sha1.create()}var c=a.digestLength,u=a.blockLength,l=new j.util.ByteBuffer,d=new j.util.ByteBuffer;if(null!=e){for(s=0;s<e.length;s++)d.putInt16(e.charCodeAt(s));d.putInt16(0)}var f=d.length(),p=t.length(),h=new j.util.ByteBuffer;h.fillWithByte(r,u);var g=u*Math.ceil(p/u),m=new j.util.ByteBuffer;for(s=0;s<g;s++)m.putByte(t.at(s%p));var y=u*Math.ceil(f/u),v=new j.util.ByteBuffer;for(s=0;s<y;s++)v.putByte(d.at(s%f));var b=m;b.putBuffer(v);for(var C=Math.ceil(i/c),E=1;E<=C;E++){var w=new j.util.ByteBuffer;w.putBytes(h.bytes()),w.putBytes(b.bytes());for(var k=0;k<n;k++)a.start(),a.update(w.getBytes()),w=a.digest();var S=new j.util.ByteBuffer;for(s=0;s<u;s++)S.putByte(w.at(s%c));var B=Math.ceil(p/u)+Math.ceil(f/u),T=new j.util.ByteBuffer;for(o=0;o<B;o++){var A=new j.util.ByteBuffer(b.getBytes(u)),I=511;for(s=S.length()-1;s>=0;s--)I>>=8,I+=S.at(s)+A.at(s),A.setAt(s,255&I);T.putBuffer(A)}b=T,l.putBuffer(w)}return l.truncate(l.length()-i),l},pt.pbe.getCipher=function(e,t,r){switch(e){case pt.oids.pkcs5PBES2:return pt.pbe.getCipherForPBES2(e,t,r);case pt.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case pt.oids["pbewithSHAAnd40BitRC2-CBC"]:return pt.pbe.getCipherForPKCS12PBE(e,t,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=e,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}},pt.pbe.getCipherForPBES2=function(e,t,r){var n,i={},a=[];if(!ft.validate(t,mt,i,a))throw(n=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=a,n;if((e=ft.derToOid(i.kdfOid))!==pt.oids.pkcs5PBKDF2)throw(n=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=e,n.supportedOids=["pkcs5PBKDF2"],n;if((e=ft.derToOid(i.encOid))!==pt.oids["aes128-CBC"]&&e!==pt.oids["aes192-CBC"]&&e!==pt.oids["aes256-CBC"]&&e!==pt.oids["des-EDE3-CBC"]&&e!==pt.oids.desCBC)throw(n=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=e,n.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],n;var o,s,c=i.kdfSalt,u=j.util.createBuffer(i.kdfIterationCount);switch(u=u.getInt(u.length()<<3),pt.oids[e]){case"aes128-CBC":o=16,s=j.aes.createDecryptionCipher;break;case"aes192-CBC":o=24,s=j.aes.createDecryptionCipher;break;case"aes256-CBC":o=32,s=j.aes.createDecryptionCipher;break;case"des-EDE3-CBC":o=24,s=j.des.createDecryptionCipher;break;case"desCBC":o=8,s=j.des.createDecryptionCipher}var l=bt(i.prfOid),d=j.pkcs5.pbkdf2(r,c,u,o,l),f=i.encIv,p=s(d);return p.start(f),p},pt.pbe.getCipherForPKCS12PBE=function(e,t,r){var n={},i=[];if(!ft.validate(t,yt,n,i))throw(l=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=i,l;var a,o,s,c=j.util.createBuffer(n.salt),u=j.util.createBuffer(n.iterations);switch(u=u.getInt(u.length()<<3),e){case pt.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:a=24,o=8,s=j.des.startDecrypting;break;case pt.oids["pbewithSHAAnd40BitRC2-CBC"]:a=5,o=8,s=function(e,t){var r=j.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var l;throw(l=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=e,l}var d=bt(n.prfOid),f=pt.pbe.generatePkcs12Key(r,c,1,u,a,d);return d.start(),s(f,pt.pbe.generatePkcs12Key(r,c,2,u,o,d))},pt.pbe.opensslDeriveBytes=function(e,t,r,n){if(null==n){if(!("md5"in j.md))throw new Error('"md5" hash algorithm unavailable.');n=j.md.md5.create()}null===t&&(t="");for(var i=[vt(n,e+t)],a=16,o=1;a<r;++o,a+=16)i.push(vt(n,i[o-1]+e+t));return i.join("").substr(0,r)},C((function(e){var t=j.asn1,r=e.exports=j.pkcs7asn1=j.pkcs7asn1||{};j.pkcs7=j.pkcs7||{},j.pkcs7.asn1=r;var n={name:"ContentInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};r.contentInfoValidator=n;var i={name:"EncryptedContentInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:t.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};r.envelopedDataValidator={name:"EnvelopedData",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(i)},r.encryptedDataValidator={name:"EncryptedData",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"}].concat(i)};var a={name:"SignerInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:t.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:t.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};r.signedDataValidator={name:"SignedData",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},n,{name:"SignedData.Certificates",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:t.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,capture:"signerInfos",optional:!0,value:[a]}]},r.recipientInfoValidator={name:"RecipientInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:t.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter"}]},{name:"RecipientInfo.encryptedKey",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}})),C((function(e){j.mgf=j.mgf||{},(e.exports=j.mgf.mgf1=j.mgf1=j.mgf1||{}).create=function(e){return{generate:function(t,r){for(var n=new j.util.ByteBuffer,i=Math.ceil(r/e.digestLength),a=0;a<i;a++){var o=new j.util.ByteBuffer;o.putInt32(a),e.start(),e.update(t+o.getBytes()),n.putBuffer(e.digest())}return n.truncate(n.length()-r),n.getBytes()}}}})),j.mgf=j.mgf||{},j.mgf.mgf1=j.mgf1,C((function(e){(e.exports=j.pss=j.pss||{}).create=function(e){3===arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t,r=e.md,n=e.mgf,i=r.digestLength,a=e.salt||null;if("string"==typeof a&&(a=j.util.createBuffer(a)),"saltLength"in e)t=e.saltLength;else{if(null===a)throw new Error("Salt length not specified or specific salt not given.");t=a.length()}if(null!==a&&a.length()!==t)throw new Error("Given salt length does not match length of given salt.");var o=e.prng||j.random;return{encode:function(e,s){var c,u,l=s-1,d=Math.ceil(l/8),f=e.digest().getBytes();if(d<i+t+2)throw new Error("Message is too long to encrypt.");u=null===a?o.getBytesSync(t):a.bytes();var p=new j.util.ByteBuffer;p.fillWithByte(0,8),p.putBytes(f),p.putBytes(u),r.start(),r.update(p.getBytes());var h=r.digest().getBytes(),g=new j.util.ByteBuffer;g.fillWithByte(0,d-t-i-2),g.putByte(1),g.putBytes(u);var m=g.getBytes(),y=d-i-1,v=n.generate(h,y),b="";for(c=0;c<y;c++)b+=String.fromCharCode(m.charCodeAt(c)^v.charCodeAt(c));var C=65280>>8*d-l&255;return(b=String.fromCharCode(b.charCodeAt(0)&~C)+b.substr(1))+h+String.fromCharCode(188)},verify:function(e,a,o){var s,c=o-1,u=Math.ceil(c/8);if(a=a.substr(-u),u<i+t+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(188!==a.charCodeAt(u-1))throw new Error("Encoded message does not end in 0xBC.");var l=u-i-1,d=a.substr(0,l),f=a.substr(l,i),p=65280>>8*u-c&255;if(0!=(d.charCodeAt(0)&p))throw new Error("Bits beyond keysize not zero as expected.");var h=n.generate(f,l),g="";for(s=0;s<l;s++)g+=String.fromCharCode(d.charCodeAt(s)^h.charCodeAt(s));g=String.fromCharCode(g.charCodeAt(0)&~p)+g.substr(1);var m=u-i-t-2;for(s=0;s<m;s++)if(0!==g.charCodeAt(s))throw new Error("Leftmost octets not zero as expected");if(1!==g.charCodeAt(m))throw new Error("Inconsistent PSS signature, 0x01 marker not found");var y=g.substr(-t),v=new j.util.ByteBuffer;return v.fillWithByte(0,8),v.putBytes(e),v.putBytes(y),r.start(),r.update(v.getBytes()),f===r.digest().getBytes()}}}})),C((function(e){var t=j.asn1,r=e.exports=j.pki=j.pki||{},n=r.oids,i={};i.CN=n.commonName,i.commonName="CN",i.C=n.countryName,i.countryName="C",i.L=n.localityName,i.localityName="L",i.ST=n.stateOrProvinceName,i.stateOrProvinceName="ST",i.O=n.organizationName,i.organizationName="O",i.OU=n.organizationalUnitName,i.organizationalUnitName="OU",i.E=n.emailAddress,i.emailAddress="E";var a=j.pki.rsa.publicKeyValidator,o={name:"Certificate",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:t.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:t.Class.UNIVERSAL,type:t.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:t.Class.UNIVERSAL,type:t.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:t.Class.UNIVERSAL,type:t.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:t.Class.UNIVERSAL,type:t.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},a,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:t.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:t.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:t.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:t.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},s={name:"rsapss",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:t.Class.UNIVERSAL,type:t.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:t.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:t.Class.UNIVERSAL,type:t.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:t.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:t.Class.UNIVERSAL,type:t.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:t.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:t.Class.UNIVERSAL,type:t.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},c={name:"CertificationRequestInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},a,{name:"CertificationRequestInfo.attributes",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0}]}]}]},u={name:"CertificationRequest",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[c,{name:"CertificationRequest.signatureAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:t.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};function l(e,t){"string"==typeof t&&(t={shortName:t});for(var r,n=null,i=0;null===n&&i<e.attributes.length;++i)r=e.attributes[i],(t.type&&t.type===r.type||t.name&&t.name===r.name||t.shortName&&t.shortName===r.shortName)&&(n=r);return n}r.RDNAttributesAsArray=function(e,r){for(var a,o,s,c=[],u=0;u<e.value.length;++u){a=e.value[u];for(var l=0;l<a.value.length;++l)s={},o=a.value[l],s.type=t.derToOid(o.value[0].value),s.value=o.value[1].value,s.valueTagClass=o.value[1].type,s.type in n&&(s.name=n[s.type],s.name in i&&(s.shortName=i[s.name])),r&&(r.update(s.type),r.update(s.value)),c.push(s)}return c},r.CRIAttributesAsArray=function(e){for(var a=[],o=0;o<e.length;++o)for(var s=e[o],c=t.derToOid(s.value[0].value),u=s.value[1].value,l=0;l<u.length;++l){var d={};if(d.type=c,d.value=u[l].value,d.valueTagClass=u[l].type,d.type in n&&(d.name=n[d.type],d.name in i&&(d.shortName=i[d.name])),d.type===n.extensionRequest){d.extensions=[];for(var f=0;f<d.value.length;++f)d.extensions.push(r.certificateExtensionFromAsn1(d.value[f]))}a.push(d)}return a};var d=function(e,r,i){var a={};if(e!==n["RSASSA-PSS"])return a;i&&(a={hash:{algorithmOid:n.sha1},mgf:{algorithmOid:n.mgf1,hash:{algorithmOid:n.sha1}},saltLength:20});var o={},c=[];if(!t.validate(r,s,o,c)){var u=new Error("Cannot read RSASSA-PSS parameter block.");throw u.errors=c,u}return void 0!==o.hashOid&&(a.hash=a.hash||{},a.hash.algorithmOid=t.derToOid(o.hashOid)),void 0!==o.maskGenOid&&(a.mgf=a.mgf||{},a.mgf.algorithmOid=t.derToOid(o.maskGenOid),a.mgf.hash=a.mgf.hash||{},a.mgf.hash.algorithmOid=t.derToOid(o.maskGenHashOid)),void 0!==o.saltLength&&(a.saltLength=o.saltLength.charCodeAt(0)),a};function f(e){for(var r,n,i=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]),a=e.attributes,o=0;o<a.length;++o){var s=(r=a[o]).value,c=t.Type.PRINTABLESTRING;"valueTagClass"in r&&(c=r.valueTagClass)===t.Type.UTF8&&(s=j.util.encodeUtf8(s)),n=t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.type).getBytes()),t.create(t.Class.UNIVERSAL,c,!1,s)])]),i.value.push(n)}return i}function p(e){for(var a,o=0;o<e.length;++o){if(void 0===(a=e[o]).name&&(a.type&&a.type in r.oids?a.name=r.oids[a.type]:a.shortName&&a.shortName in i&&(a.name=r.oids[i[a.shortName]])),void 0===a.type){if(!a.name||!(a.name in r.oids))throw(c=new Error("Attribute type not specified.")).attribute=a,c;a.type=r.oids[a.name]}if(void 0===a.shortName&&a.name&&a.name in i&&(a.shortName=i[a.name]),a.type===n.extensionRequest&&(a.valueConstructed=!0,a.valueTagClass=t.Type.SEQUENCE,!a.value&&a.extensions)){a.value=[];for(var s=0;s<a.extensions.length;++s)a.value.push(r.certificateExtensionToAsn1(h(a.extensions[s])))}var c;if(void 0===a.value)throw(c=new Error("Attribute value not specified.")).attribute=a,c}}function h(e,i){if(i=i||{},void 0===e.name&&e.id&&e.id in r.oids&&(e.name=r.oids[e.id]),void 0===e.id){if(!e.name||!(e.name in r.oids))throw(C=new Error("Extension ID not specified.")).extension=e,C;e.id=r.oids[e.name]}if(void 0!==e.value)return e;if("keyUsage"===e.name){var a=0,o=0,s=0;e.digitalSignature&&(o|=128,a=7),e.nonRepudiation&&(o|=64,a=6),e.keyEncipherment&&(o|=32,a=5),e.dataEncipherment&&(o|=16,a=4),e.keyAgreement&&(o|=8,a=3),e.keyCertSign&&(o|=4,a=2),e.cRLSign&&(o|=2,a=1),e.encipherOnly&&(o|=1,a=0),e.decipherOnly&&(s|=128,a=7);var c=String.fromCharCode(a);0!==s?c+=String.fromCharCode(o)+String.fromCharCode(s):0!==o&&(c+=String.fromCharCode(o)),e.value=t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,c)}else if("basicConstraints"===e.name)e.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(t.create(t.Class.UNIVERSAL,t.Type.BOOLEAN,!1,String.fromCharCode(255))),"pathLenConstraint"in e&&e.value.value.push(t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(e.pathLenConstraint).getBytes()));else if("extKeyUsage"===e.name){e.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);var u=e.value.value;for(var l in e)!0===e[l]&&(l in n?u.push(t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(n[l]).getBytes())):-1!==l.indexOf(".")&&u.push(t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(l).getBytes())))}else if("nsCertType"===e.name)a=0,o=0,e.client&&(o|=128,a=7),e.server&&(o|=64,a=6),e.email&&(o|=32,a=5),e.objsign&&(o|=16,a=4),e.reserved&&(o|=8,a=3),e.sslCA&&(o|=4,a=2),e.emailCA&&(o|=2,a=1),e.objCA&&(o|=1,a=0),c=String.fromCharCode(a),0!==o&&(c+=String.fromCharCode(o)),e.value=t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,c);else if("subjectAltName"===e.name||"issuerAltName"===e.name){e.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);for(var d=0;d<e.altNames.length;++d){if(c=(y=e.altNames[d]).value,7===y.type&&y.ip){if(null===(c=j.util.bytesFromIP(y.ip)))throw(C=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,C}else 8===y.type&&(c=y.oid?t.oidToDer(t.oidToDer(y.oid)):t.oidToDer(c));e.value.value.push(t.create(t.Class.CONTEXT_SPECIFIC,y.type,!1,c))}}else if("nsComment"===e.name&&i.cert){if(!/^[\x00-\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw new Error('Invalid "nsComment" content.');e.value=t.create(t.Class.UNIVERSAL,t.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&i.cert){var p=i.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=p.toHex(),e.value=t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,p.getBytes())}else if("authorityKeyIdentifier"===e.name&&i.cert){if(e.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]),u=e.value.value,e.keyIdentifier){var h=!0===e.keyIdentifier?i.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;u.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!1,h))}if(e.authorityCertIssuer){var g=[t.create(t.Class.CONTEXT_SPECIFIC,4,!0,[f(!0===e.authorityCertIssuer?i.cert.issuer:e.authorityCertIssuer)])];u.push(t.create(t.Class.CONTEXT_SPECIFIC,1,!0,g))}if(e.serialNumber){var m=j.util.hexToBytes(!0===e.serialNumber?i.cert.serialNumber:e.serialNumber);u.push(t.create(t.Class.CONTEXT_SPECIFIC,2,!1,m))}}else if("cRLDistributionPoints"===e.name){e.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]),u=e.value.value;var y,v=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]),b=t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[]);for(d=0;d<e.altNames.length;++d){if(c=(y=e.altNames[d]).value,7===y.type&&y.ip){if(null===(c=j.util.bytesFromIP(y.ip)))throw(C=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,C}else 8===y.type&&(c=y.oid?t.oidToDer(t.oidToDer(y.oid)):t.oidToDer(c));b.value.push(t.create(t.Class.CONTEXT_SPECIFIC,y.type,!1,c))}v.value.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[b])),u.push(v)}var C;if(void 0===e.value)throw(C=new Error("Extension value not specified.")).extension=e,C;return e}function g(e,r){switch(e){case n["RSASSA-PSS"]:var i=[];return void 0!==r.hash.algorithmOid&&i.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.hash.algorithmOid).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")])])),void 0!==r.mgf.algorithmOid&&i.push(t.create(t.Class.CONTEXT_SPECIFIC,1,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.mgf.algorithmOid).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.mgf.hash.algorithmOid).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")])])])),void 0!==r.saltLength&&i.push(t.create(t.Class.CONTEXT_SPECIFIC,2,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(r.saltLength).getBytes())])),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,i);default:return t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")}}function m(e){var r=t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===e.attributes.length)return r;for(var n=e.attributes,i=0;i<n.length;++i){var a=n[i],o=a.value,s=t.Type.UTF8;"valueTagClass"in a&&(s=a.valueTagClass),s===t.Type.UTF8&&(o=j.util.encodeUtf8(o));var c=!1;"valueConstructed"in a&&(c=a.valueConstructed);var u=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(a.type).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[t.create(t.Class.UNIVERSAL,s,c,o)])]);r.value.push(u)}return r}r.certificateFromPem=function(e,n,i){var a=j.pem.decode(e)[0];if("CERTIFICATE"!==a.type&&"X509 CERTIFICATE"!==a.type&&"TRUSTED CERTIFICATE"!==a.type){var o=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw o.headerType=a.type,o}if(a.procType&&"ENCRYPTED"===a.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var s=t.fromDer(a.body,i);return r.certificateFromAsn1(s,n)},r.certificateToPem=function(e,n){var i={type:"CERTIFICATE",body:t.toDer(r.certificateToAsn1(e)).getBytes()};return j.pem.encode(i,{maxline:n})},r.publicKeyFromPem=function(e){var n=j.pem.decode(e)[0];if("PUBLIC KEY"!==n.type&&"RSA PUBLIC KEY"!==n.type){var i=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw i.headerType=n.type,i}if(n.procType&&"ENCRYPTED"===n.procType.type)throw new Error("Could not convert public key from PEM; PEM is encrypted.");var a=t.fromDer(n.body);return r.publicKeyFromAsn1(a)},r.publicKeyToPem=function(e,n){var i={type:"PUBLIC KEY",body:t.toDer(r.publicKeyToAsn1(e)).getBytes()};return j.pem.encode(i,{maxline:n})},r.publicKeyToRSAPublicKeyPem=function(e,n){var i={type:"RSA PUBLIC KEY",body:t.toDer(r.publicKeyToRSAPublicKey(e)).getBytes()};return j.pem.encode(i,{maxline:n})},r.getPublicKeyFingerprint=function(e,n){var i,a=(n=n||{}).md||j.md.sha1.create();switch(n.type||"RSAPublicKey"){case"RSAPublicKey":i=t.toDer(r.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":i=t.toDer(r.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+n.type+'".')}a.start(),a.update(i);var o=a.digest();if("hex"===n.encoding){var s=o.toHex();return n.delimiter?s.match(/.{2}/g).join(n.delimiter):s}if("binary"===n.encoding)return o.getBytes();if(n.encoding)throw new Error('Unknown encoding "'+n.encoding+'".');return o},r.certificationRequestFromPem=function(e,n,i){var a=j.pem.decode(e)[0];if("CERTIFICATE REQUEST"!==a.type){var o=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw o.headerType=a.type,o}if(a.procType&&"ENCRYPTED"===a.procType.type)throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var s=t.fromDer(a.body,i);return r.certificationRequestFromAsn1(s,n)},r.certificationRequestToPem=function(e,n){var i={type:"CERTIFICATE REQUEST",body:t.toDer(r.certificationRequestToAsn1(e)).getBytes()};return j.pem.encode(i,{maxline:n})},r.createCertificate=function(){var e={version:2,serialNumber:"00",signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.validity={},e.validity.notBefore=new Date,e.validity.notAfter=new Date,e.issuer={},e.issuer.getField=function(t){return l(e.issuer,t)},e.issuer.addField=function(t){p([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return l(e.subject,t)},e.subject.addField=function(t){p([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.extensions=[],e.publicKey=null,e.md=null,e.setSubject=function(t,r){p(t),e.subject.attributes=t,delete e.subject.uniqueId,r&&(e.subject.uniqueId=r),e.subject.hash=null},e.setIssuer=function(t,r){p(t),e.issuer.attributes=t,delete e.issuer.uniqueId,r&&(e.issuer.uniqueId=r),e.issuer.hash=null},e.setExtensions=function(t){for(var r=0;r<t.length;++r)h(t[r],{cert:e});e.extensions=t},e.getExtension=function(t){"string"==typeof t&&(t={name:t});for(var r,n=null,i=0;null===n&&i<e.extensions.length;++i)r=e.extensions[i],(t.id&&r.id===t.id||t.name&&r.name===t.name)&&(n=r);return n},e.sign=function(i,a){e.md=a||j.md.sha1.create();var o=n[e.md.algorithm+"WithRSAEncryption"];if(!o){var s=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw s.algorithm=e.md.algorithm,s}e.signatureOid=e.siginfo.algorithmOid=o,e.tbsCertificate=r.getTBSCertificate(e);var c=t.toDer(e.tbsCertificate);e.md.update(c.getBytes()),e.signature=i.sign(e.md)},e.verify=function(i){var a=!1;if(!e.issued(i)){var o=i.issuer,s=e.subject;throw(h=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.")).expectedIssuer=o.attributes,h.actualIssuer=s.attributes,h}var c=i.md;if(null===c){if(i.signatureOid in n)switch(n[i.signatureOid]){case"sha1WithRSAEncryption":c=j.md.sha1.create();break;case"md5WithRSAEncryption":c=j.md.md5.create();break;case"sha256WithRSAEncryption":c=j.md.sha256.create();break;case"sha384WithRSAEncryption":c=j.md.sha384.create();break;case"sha512WithRSAEncryption":c=j.md.sha512.create();break;case"RSASSA-PSS":c=j.md.sha256.create()}if(null===c)throw(h=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=i.signatureOid,h;var u=i.tbsCertificate||r.getTBSCertificate(i),l=t.toDer(u);c.update(l.getBytes())}if(null!==c){var d;switch(i.signatureOid){case n.sha1WithRSAEncryption:d=void 0;break;case n["RSASSA-PSS"]:var f,p,h;if(void 0===(f=n[i.signatureParameters.mgf.hash.algorithmOid])||void 0===j.md[f])throw(h=new Error("Unsupported MGF hash function.")).oid=i.signatureParameters.mgf.hash.algorithmOid,h.name=f,h;if(void 0===(p=n[i.signatureParameters.mgf.algorithmOid])||void 0===j.mgf[p])throw(h=new Error("Unsupported MGF function.")).oid=i.signatureParameters.mgf.algorithmOid,h.name=p,h;if(p=j.mgf[p].create(j.md[f].create()),void 0===(f=n[i.signatureParameters.hash.algorithmOid])||void 0===j.md[f])throw{message:"Unsupported RSASSA-PSS hash function.",oid:i.signatureParameters.hash.algorithmOid,name:f};d=j.pss.create(j.md[f].create(),p,i.signatureParameters.saltLength)}a=e.publicKey.verify(c.digest().getBytes(),i.signature,d)}return a},e.isIssuer=function(t){var r=!1,n=e.issuer,i=t.subject;if(n.hash&&i.hash)r=n.hash===i.hash;else if(n.attributes.length===i.attributes.length){var a,o;r=!0;for(var s=0;r&&s<n.attributes.length;++s)a=n.attributes[s],o=i.attributes[s],a.type===o.type&&a.value===o.value||(r=!1)}return r},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return r.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=n.subjectKeyIdentifier,r=0;r<e.extensions.length;++r){var i=e.extensions[r];if(i.id===t){var a=e.generateSubjectKeyIdentifier().getBytes();return j.util.hexToBytes(i.subjectKeyIdentifier)===a}}return!1},e},r.certificateFromAsn1=function(e,i){var a={},s=[];if(!t.validate(e,o,a,s))throw(h=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.")).errors=s,h;if(t.derToOid(a.publicKeyOid)!==r.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var c=r.createCertificate();c.version=a.certVersion?a.certVersion.charCodeAt(0):0;var u=j.util.createBuffer(a.certSerialNumber);c.serialNumber=u.toHex(),c.signatureOid=j.asn1.derToOid(a.certSignatureOid),c.signatureParameters=d(c.signatureOid,a.certSignatureParams,!0),c.siginfo.algorithmOid=j.asn1.derToOid(a.certinfoSignatureOid),c.siginfo.parameters=d(c.siginfo.algorithmOid,a.certinfoSignatureParams,!1),c.signature=a.certSignature;var f=[];if(void 0!==a.certValidity1UTCTime&&f.push(t.utcTimeToDate(a.certValidity1UTCTime)),void 0!==a.certValidity2GeneralizedTime&&f.push(t.generalizedTimeToDate(a.certValidity2GeneralizedTime)),void 0!==a.certValidity3UTCTime&&f.push(t.utcTimeToDate(a.certValidity3UTCTime)),void 0!==a.certValidity4GeneralizedTime&&f.push(t.generalizedTimeToDate(a.certValidity4GeneralizedTime)),f.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(f.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(c.validity.notBefore=f[0],c.validity.notAfter=f[1],c.tbsCertificate=a.tbsCertificate,i){var h;if(c.md=null,c.signatureOid in n)switch(n[c.signatureOid]){case"sha1WithRSAEncryption":c.md=j.md.sha1.create();break;case"md5WithRSAEncryption":c.md=j.md.md5.create();break;case"sha256WithRSAEncryption":c.md=j.md.sha256.create();break;case"sha384WithRSAEncryption":c.md=j.md.sha384.create();break;case"sha512WithRSAEncryption":c.md=j.md.sha512.create();break;case"RSASSA-PSS":c.md=j.md.sha256.create()}if(null===c.md)throw(h=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=c.signatureOid,h;var g=t.toDer(c.tbsCertificate);c.md.update(g.getBytes())}var m=j.md.sha1.create();c.issuer.getField=function(e){return l(c.issuer,e)},c.issuer.addField=function(e){p([e]),c.issuer.attributes.push(e)},c.issuer.attributes=r.RDNAttributesAsArray(a.certIssuer,m),a.certIssuerUniqueId&&(c.issuer.uniqueId=a.certIssuerUniqueId),c.issuer.hash=m.digest().toHex();var y=j.md.sha1.create();return c.subject.getField=function(e){return l(c.subject,e)},c.subject.addField=function(e){p([e]),c.subject.attributes.push(e)},c.subject.attributes=r.RDNAttributesAsArray(a.certSubject,y),a.certSubjectUniqueId&&(c.subject.uniqueId=a.certSubjectUniqueId),c.subject.hash=y.digest().toHex(),a.certExtensions?c.extensions=r.certificateExtensionsFromAsn1(a.certExtensions):c.extensions=[],c.publicKey=r.publicKeyFromAsn1(a.subjectPublicKeyInfo),c},r.certificateExtensionsFromAsn1=function(e){for(var t=[],n=0;n<e.value.length;++n)for(var i=e.value[n],a=0;a<i.value.length;++a)t.push(r.certificateExtensionFromAsn1(i.value[a]));return t},r.certificateExtensionFromAsn1=function(e){var r={};if(r.id=t.derToOid(e.value[0].value),r.critical=!1,e.value[1].type===t.Type.BOOLEAN?(r.critical=0!==e.value[1].value.charCodeAt(0),r.value=e.value[2].value):r.value=e.value[1].value,r.id in n)if(r.name=n[r.id],"keyUsage"===r.name){var i=0,a=0;(s=t.fromDer(r.value)).value.length>1&&(i=s.value.charCodeAt(1),a=s.value.length>2?s.value.charCodeAt(2):0),r.digitalSignature=128==(128&i),r.nonRepudiation=64==(64&i),r.keyEncipherment=32==(32&i),r.dataEncipherment=16==(16&i),r.keyAgreement=8==(8&i),r.keyCertSign=4==(4&i),r.cRLSign=2==(2&i),r.encipherOnly=1==(1&i),r.decipherOnly=128==(128&a)}else if("basicConstraints"===r.name){(s=t.fromDer(r.value)).value.length>0&&s.value[0].type===t.Type.BOOLEAN?r.cA=0!==s.value[0].value.charCodeAt(0):r.cA=!1;var o=null;s.value.length>0&&s.value[0].type===t.Type.INTEGER?o=s.value[0].value:s.value.length>1&&(o=s.value[1].value),null!==o&&(r.pathLenConstraint=t.derToInteger(o))}else if("extKeyUsage"===r.name)for(var s=t.fromDer(r.value),c=0;c<s.value.length;++c){var u=t.derToOid(s.value[c].value);u in n?r[n[u]]=!0:r[u]=!0}else if("nsCertType"===r.name)i=0,(s=t.fromDer(r.value)).value.length>1&&(i=s.value.charCodeAt(1)),r.client=128==(128&i),r.server=64==(64&i),r.email=32==(32&i),r.objsign=16==(16&i),r.reserved=8==(8&i),r.sslCA=4==(4&i),r.emailCA=2==(2&i),r.objCA=1==(1&i);else if("subjectAltName"===r.name||"issuerAltName"===r.name){var l;r.altNames=[],s=t.fromDer(r.value);for(var d=0;d<s.value.length;++d){var f={type:(l=s.value[d]).type,value:l.value};switch(r.altNames.push(f),l.type){case 1:case 2:case 6:break;case 7:f.ip=j.util.bytesToIP(l.value);break;case 8:f.oid=t.derToOid(l.value)}}}else"subjectKeyIdentifier"===r.name&&(s=t.fromDer(r.value),r.subjectKeyIdentifier=j.util.bytesToHex(s.value));return r},r.certificationRequestFromAsn1=function(e,i){var a={},o=[];if(!t.validate(e,u,a,o))throw(c=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.")).errors=o,c;if(t.derToOid(a.publicKeyOid)!==r.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var s=r.createCertificationRequest();if(s.version=a.csrVersion?a.csrVersion.charCodeAt(0):0,s.signatureOid=j.asn1.derToOid(a.csrSignatureOid),s.signatureParameters=d(s.signatureOid,a.csrSignatureParams,!0),s.siginfo.algorithmOid=j.asn1.derToOid(a.csrSignatureOid),s.siginfo.parameters=d(s.siginfo.algorithmOid,a.csrSignatureParams,!1),s.signature=a.csrSignature,s.certificationRequestInfo=a.certificationRequestInfo,i){var c;if(s.md=null,s.signatureOid in n)switch(n[s.signatureOid]){case"sha1WithRSAEncryption":s.md=j.md.sha1.create();break;case"md5WithRSAEncryption":s.md=j.md.md5.create();break;case"sha256WithRSAEncryption":s.md=j.md.sha256.create();break;case"sha384WithRSAEncryption":s.md=j.md.sha384.create();break;case"sha512WithRSAEncryption":s.md=j.md.sha512.create();break;case"RSASSA-PSS":s.md=j.md.sha256.create()}if(null===s.md)throw(c=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=s.signatureOid,c;var f=t.toDer(s.certificationRequestInfo);s.md.update(f.getBytes())}var h=j.md.sha1.create();return s.subject.getField=function(e){return l(s.subject,e)},s.subject.addField=function(e){p([e]),s.subject.attributes.push(e)},s.subject.attributes=r.RDNAttributesAsArray(a.certificationRequestInfoSubject,h),s.subject.hash=h.digest().toHex(),s.publicKey=r.publicKeyFromAsn1(a.subjectPublicKeyInfo),s.getAttribute=function(e){return l(s,e)},s.addAttribute=function(e){p([e]),s.attributes.push(e)},s.attributes=r.CRIAttributesAsArray(a.certificationRequestInfoAttributes||[]),s},r.createCertificationRequest=function(){var e={version:0,signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return l(e.subject,t)},e.subject.addField=function(t){p([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return l(e,t)},e.addAttribute=function(t){p([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){p(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){p(t),e.attributes=t},e.sign=function(i,a){e.md=a||j.md.sha1.create();var o=n[e.md.algorithm+"WithRSAEncryption"];if(!o){var s=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw s.algorithm=e.md.algorithm,s}e.signatureOid=e.siginfo.algorithmOid=o,e.certificationRequestInfo=r.getCertificationRequestInfo(e);var c=t.toDer(e.certificationRequestInfo);e.md.update(c.getBytes()),e.signature=i.sign(e.md)},e.verify=function(){var i=!1,a=e.md;if(null===a){if(e.signatureOid in n)switch(n[e.signatureOid]){case"sha1WithRSAEncryption":a=j.md.sha1.create();break;case"md5WithRSAEncryption":a=j.md.md5.create();break;case"sha256WithRSAEncryption":a=j.md.sha256.create();break;case"sha384WithRSAEncryption":a=j.md.sha384.create();break;case"sha512WithRSAEncryption":a=j.md.sha512.create();break;case"RSASSA-PSS":a=j.md.sha256.create()}if(null===a)throw(d=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=e.signatureOid,d;var o=e.certificationRequestInfo||r.getCertificationRequestInfo(e),s=t.toDer(o);a.update(s.getBytes())}if(null!==a){var c;switch(e.signatureOid){case n.sha1WithRSAEncryption:break;case n["RSASSA-PSS"]:var u,l,d;if(void 0===(u=n[e.signatureParameters.mgf.hash.algorithmOid])||void 0===j.md[u])throw(d=new Error("Unsupported MGF hash function.")).oid=e.signatureParameters.mgf.hash.algorithmOid,d.name=u,d;if(void 0===(l=n[e.signatureParameters.mgf.algorithmOid])||void 0===j.mgf[l])throw(d=new Error("Unsupported MGF function.")).oid=e.signatureParameters.mgf.algorithmOid,d.name=l,d;if(l=j.mgf[l].create(j.md[u].create()),void 0===(u=n[e.signatureParameters.hash.algorithmOid])||void 0===j.md[u])throw(d=new Error("Unsupported RSASSA-PSS hash function.")).oid=e.signatureParameters.hash.algorithmOid,d.name=u,d;c=j.pss.create(j.md[u].create(),l,e.signatureParameters.saltLength)}i=e.publicKey.verify(a.digest().getBytes(),e.signature,c)}return i},e};var y=new Date("1950-01-01T00:00:00Z"),v=new Date("2050-01-01T00:00:00Z");function b(e){return e>=y&&e<v?t.create(t.Class.UNIVERSAL,t.Type.UTCTIME,!1,t.dateToUtcTime(e)):t.create(t.Class.UNIVERSAL,t.Type.GENERALIZEDTIME,!1,t.dateToGeneralizedTime(e))}r.getTBSCertificate=function(e){var n=b(e.validity.notBefore),i=b(e.validity.notAfter),a=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(e.version).getBytes())]),t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,j.util.hexToBytes(e.serialNumber)),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.siginfo.algorithmOid).getBytes()),g(e.siginfo.algorithmOid,e.siginfo.parameters)]),f(e.issuer),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[n,i]),f(e.subject),r.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&a.value.push(t.create(t.Class.CONTEXT_SPECIFIC,1,!0,[t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,String.fromCharCode(0)+e.issuer.uniqueId)])),e.subject.uniqueId&&a.value.push(t.create(t.Class.CONTEXT_SPECIFIC,2,!0,[t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,String.fromCharCode(0)+e.subject.uniqueId)])),e.extensions.length>0&&a.value.push(r.certificateExtensionsToAsn1(e.extensions)),a},r.getCertificationRequestInfo=function(e){return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(e.version).getBytes()),f(e.subject),r.publicKeyToAsn1(e.publicKey),m(e)])},r.distinguishedNameToAsn1=function(e){return f(e)},r.certificateToAsn1=function(e){var n=e.tbsCertificate||r.getTBSCertificate(e);return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[n,t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.signatureOid).getBytes()),g(e.signatureOid,e.signatureParameters)]),t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},r.certificateExtensionsToAsn1=function(e){var n=t.create(t.Class.CONTEXT_SPECIFIC,3,!0,[]),i=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);n.value.push(i);for(var a=0;a<e.length;++a)i.value.push(r.certificateExtensionToAsn1(e[a]));return n},r.certificateExtensionToAsn1=function(e){var r=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);r.value.push(t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.id).getBytes())),e.critical&&r.value.push(t.create(t.Class.UNIVERSAL,t.Type.BOOLEAN,!1,String.fromCharCode(255)));var n=e.value;return"string"!=typeof e.value&&(n=t.toDer(n).getBytes()),r.value.push(t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,n)),r},r.certificationRequestToAsn1=function(e){var n=e.certificationRequestInfo||r.getCertificationRequestInfo(e);return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[n,t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.signatureOid).getBytes()),g(e.signatureOid,e.signatureParameters)]),t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},r.createCaStore=function(e){var n={certs:{}};function i(e){return a(e),n.certs[e.hash]||null}function a(e){if(!e.hash){var t=j.md.sha1.create();e.attributes=r.RDNAttributesAsArray(f(e),t),e.hash=t.digest().toHex()}}if(n.getIssuer=function(e){return i(e.issuer)},n.addCertificate=function(e){if("string"==typeof e&&(e=j.pki.certificateFromPem(e)),a(e.subject),!n.hasCertificate(e))if(e.subject.hash in n.certs){var t=n.certs[e.subject.hash];j.util.isArray(t)||(t=[t]),t.push(e),n.certs[e.subject.hash]=t}else n.certs[e.subject.hash]=e},n.hasCertificate=function(e){"string"==typeof e&&(e=j.pki.certificateFromPem(e));var n=i(e.subject);if(!n)return!1;j.util.isArray(n)||(n=[n]);for(var a=t.toDer(r.certificateToAsn1(e)).getBytes(),o=0;o<n.length;++o)if(a===t.toDer(r.certificateToAsn1(n[o])).getBytes())return!0;return!1},n.listAllCertificates=function(){var e=[];for(var t in n.certs)if(n.certs.hasOwnProperty(t)){var r=n.certs[t];if(j.util.isArray(r))for(var i=0;i<r.length;++i)e.push(r[i]);else e.push(r)}return e},n.removeCertificate=function(e){var o;if("string"==typeof e&&(e=j.pki.certificateFromPem(e)),a(e.subject),!n.hasCertificate(e))return null;var s=i(e.subject);if(!j.util.isArray(s))return o=n.certs[e.subject.hash],delete n.certs[e.subject.hash],o;for(var c=t.toDer(r.certificateToAsn1(e)).getBytes(),u=0;u<s.length;++u)c===t.toDer(r.certificateToAsn1(s[u])).getBytes()&&(o=s[u],s.splice(u,1));return 0===s.length&&delete n.certs[e.subject.hash],o},e)for(var o=0;o<e.length;++o){var s=e[o];n.addCertificate(s)}return n},r.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"},r.verifyCertificateChain=function(e,t,n){"function"==typeof n&&(n={verify:n}),n=n||{};var i=(t=t.slice(0)).slice(0),a=n.validityCheckDate;void 0===a&&(a=new Date);var o=!0,s=null,c=0;do{var u=t.shift(),l=null,d=!1;if(a&&(a<u.validity.notBefore||a>u.validity.notAfter)&&(s={message:"Certificate is not valid yet or has expired.",error:r.certificateError.certificate_expired,notBefore:u.validity.notBefore,notAfter:u.validity.notAfter,now:a}),null===s){if(null===(l=t[0]||e.getIssuer(u))&&u.isIssuer(u)&&(d=!0,l=u),l){var f=l;j.util.isArray(f)||(f=[f]);for(var p=!1;!p&&f.length>0;){l=f.shift();try{p=l.verify(u)}catch(e){}}p||(s={message:"Certificate signature is invalid.",error:r.certificateError.bad_certificate})}null!==s||l&&!d||e.hasCertificate(u)||(s={message:"Certificate is not trusted.",error:r.certificateError.unknown_ca})}if(null===s&&l&&!u.isIssuer(l)&&(s={message:"Certificate issuer is invalid.",error:r.certificateError.bad_certificate}),null===s)for(var h={keyUsage:!0,basicConstraints:!0},g=0;null===s&&g<u.extensions.length;++g){var m=u.extensions[g];!m.critical||m.name in h||(s={message:"Certificate has an unsupported critical extension.",error:r.certificateError.unsupported_certificate})}if(null===s&&(!o||0===t.length&&(!l||d))){var y=u.getExtension("basicConstraints"),v=u.getExtension("keyUsage");null!==v&&(v.keyCertSign&&null!==y||(s={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:r.certificateError.bad_certificate})),null!==s||null===y||y.cA||(s={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:r.certificateError.bad_certificate}),null===s&&null!==v&&"pathLenConstraint"in y&&c-1>y.pathLenConstraint&&(s={message:"Certificate basicConstraints pathLenConstraint violated.",error:r.certificateError.bad_certificate})}var b=null===s||s.error,C=n.verify?n.verify(b,c,i):b;if(!0!==C)throw!0===b&&(s={message:"The application rejected the certificate.",error:r.certificateError.bad_certificate}),(C||0===C)&&("object"!=Iv(C)||j.util.isArray(C)?"string"==typeof C&&(s.error=C):(C.message&&(s.message=C.message),C.error&&(s.error=C.error))),s;s=null,o=!1,++c}while(t.length>0);return!0}})),C((function(e){var t=j.asn1,r=j.pki,n=e.exports=j.pkcs12=j.pkcs12||{},i={name:"ContentInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:t.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},a={name:"PFX",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"},i,{name:"PFX.macData",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:t.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},o={name:"SafeBag",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:t.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},s={name:"Attribute",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0,capture:"values"}]},c={name:"CertBag",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:t.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:t.Class.UNIVERSAL,type:t.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function u(e,t,r,n){for(var i=[],a=0;a<e.length;a++)for(var o=0;o<e[a].safeBags.length;o++){var s=e[a].safeBags[o];void 0!==n&&s.type!==n||(null!==t?void 0!==s.attributes[t]&&s.attributes[t].indexOf(r)>=0&&i.push(s):i.push(s))}return i}function l(e){if(e.composed||e.constructed){for(var t=j.util.createBuffer(),r=0;r<e.value.length;++r)t.putBytes(e.value[r].value);e.composed=e.constructed=!1,e.value=t.getBytes()}return e}function d(e,n){var i={},a=[];if(!t.validate(e,j.pkcs7.asn1.encryptedDataValidator,i,a))throw(o=new Error("Cannot read EncryptedContentInfo.")).errors=a,o;var o,s=t.derToOid(i.contentType);if(s!==r.oids.data)throw(o=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.")).oid=s,o;s=t.derToOid(i.encAlgorithm);var c=r.pbe.getCipher(s,i.encParameter,n),u=l(i.encryptedContentAsn1),d=j.util.createBuffer(u.value);if(c.update(d),!c.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return c.output.getBytes()}function f(e,n,i){if(!n&&0===e.length)return[];if((e=t.fromDer(e,n)).tagClass!==t.Class.UNIVERSAL||e.type!==t.Type.SEQUENCE||!0!==e.constructed)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var a=[],s=0;s<e.value.length;s++){var u=e.value[s],l={},d=[];if(!t.validate(u,o,l,d))throw(y=new Error("Cannot read SafeBag.")).errors=d,y;var f,h,g={type:t.derToOid(l.bagId),attributes:p(l.bagAttributes)};a.push(g);var m=l.bagValue.value[0];switch(g.type){case r.oids.pkcs8ShroudedKeyBag:if(null===(m=r.decryptPrivateKeyInfo(m,i)))throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case r.oids.keyBag:try{g.key=r.privateKeyFromAsn1(m)}catch(e){g.key=null,g.asn1=m}continue;case r.oids.certBag:f=c,h=function(){if(t.derToOid(l.certId)!==r.oids.x509Certificate){var e=new Error("Unsupported certificate type, only X.509 supported.");throw e.oid=t.derToOid(l.certId),e}var i=t.fromDer(l.cert,n);try{g.cert=r.certificateFromAsn1(i,!0)}catch(e){g.cert=null,g.asn1=i}};break;default:var y;throw(y=new Error("Unsupported PKCS#12 SafeBag type.")).oid=g.type,y}if(void 0!==f&&!t.validate(m,f,l,d))throw(y=new Error("Cannot read PKCS#12 "+f.name)).errors=d,y;h()}return a}function p(e){var n={};if(void 0!==e)for(var i=0;i<e.length;++i){var a={},o=[];if(!t.validate(e[i],s,a,o)){var c=new Error("Cannot read PKCS#12 BagAttribute.");throw c.errors=o,c}var u=t.derToOid(a.oid);if(void 0!==r.oids[u]){n[r.oids[u]]=[];for(var l=0;l<a.values.length;++l)n[r.oids[u]].push(a.values[l].value)}}return n}n.pkcs12FromAsn1=function(e,o,s){"string"==typeof o?(s=o,o=!0):void 0===o&&(o=!0);var c={};if(!t.validate(e,a,c,[]))throw(p=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.")).errors=p,p;var p,h={version:c.version.charCodeAt(0),safeContents:[],getBags:function(e){var t,r={};return"localKeyId"in e?t=e.localKeyId:"localKeyIdHex"in e&&(t=j.util.hexToBytes(e.localKeyIdHex)),void 0===t&&!("friendlyName"in e)&&"bagType"in e&&(r[e.bagType]=u(h.safeContents,null,null,e.bagType)),void 0!==t&&(r.localKeyId=u(h.safeContents,"localKeyId",t,e.bagType)),"friendlyName"in e&&(r.friendlyName=u(h.safeContents,"friendlyName",e.friendlyName,e.bagType)),r},getBagsByFriendlyName:function(e,t){return u(h.safeContents,"friendlyName",e,t)},getBagsByLocalKeyId:function(e,t){return u(h.safeContents,"localKeyId",e,t)}};if(3!==c.version.charCodeAt(0))throw(p=new Error("PKCS#12 PFX of version other than 3 not supported.")).version=c.version.charCodeAt(0),p;if(t.derToOid(c.contentType)!==r.oids.data)throw(p=new Error("Only PKCS#12 PFX in password integrity mode supported.")).oid=t.derToOid(c.contentType),p;var g=c.content.value[0];if(g.tagClass!==t.Class.UNIVERSAL||g.type!==t.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(g=l(g),c.mac){var m=null,y=0,v=t.derToOid(c.macAlgorithm);switch(v){case r.oids.sha1:m=j.md.sha1.create(),y=20;break;case r.oids.sha256:m=j.md.sha256.create(),y=32;break;case r.oids.sha384:m=j.md.sha384.create(),y=48;break;case r.oids.sha512:m=j.md.sha512.create(),y=64;break;case r.oids.md5:m=j.md.md5.create(),y=16}if(null===m)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+v);var b=new j.util.ByteBuffer(c.macSalt),C="macIterations"in c?parseInt(j.util.bytesToHex(c.macIterations),16):1,E=n.generateKey(s,b,3,C,y,m),w=j.hmac.create();if(w.start(m,E),w.update(g.value),w.getMac().getBytes()!==c.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return function(e,n,a,o){if((n=t.fromDer(n,a)).tagClass!==t.Class.UNIVERSAL||n.type!==t.Type.SEQUENCE||!0!==n.constructed)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var s=0;s<n.value.length;s++){var c=n.value[s],u={},p=[];if(!t.validate(c,i,u,p))throw(y=new Error("Cannot read ContentInfo.")).errors=p,y;var h={encrypted:!1},g=null,m=u.content.value[0];switch(t.derToOid(u.contentType)){case r.oids.data:if(m.tagClass!==t.Class.UNIVERSAL||m.type!==t.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");g=l(m).value;break;case r.oids.encryptedData:g=d(m,o),h.encrypted=!0;break;default:var y;throw(y=new Error("Unsupported PKCS#12 contentType.")).contentType=t.derToOid(u.contentType),y}h.safeBags=f(g,a,o),e.safeContents.push(h)}}(h,g.value,o,s),h},n.toPkcs12Asn1=function(e,i,a,o){(o=o||{}).saltSize=o.saltSize||8,o.count=o.count||2048,o.algorithm=o.algorithm||o.encAlgorithm||"aes128","useMac"in o||(o.useMac=!0),"localKeyId"in o||(o.localKeyId=null),"generateLocalKeyId"in o||(o.generateLocalKeyId=!0);var s,c=o.localKeyId;if(null!==c)c=j.util.hexToBytes(c);else if(o.generateLocalKeyId)if(i){var u=j.util.isArray(i)?i[0]:i;"string"==typeof u&&(u=r.certificateFromPem(u)),(T=j.md.sha1.create()).update(t.toDer(r.certificateToAsn1(u)).getBytes()),c=T.digest().getBytes()}else c=j.random.getBytes(20);var l=[];null!==c&&l.push(t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.localKeyId).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,c)])])),"friendlyName"in o&&l.push(t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.friendlyName).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[t.create(t.Class.UNIVERSAL,t.Type.BMPSTRING,!1,o.friendlyName)])])),l.length>0&&(s=t.create(t.Class.UNIVERSAL,t.Type.SET,!0,l));var d=[],f=[];null!==i&&(f=j.util.isArray(i)?i:[i]);for(var p=[],h=0;h<f.length;++h){"string"==typeof(i=f[h])&&(i=r.certificateFromPem(i));var g=0===h?s:void 0,m=r.certificateToAsn1(i),y=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.certBag).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.x509Certificate).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,t.toDer(m).getBytes())])])]),g]);p.push(y)}if(p.length>0){var v=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,p),b=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.data).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,t.toDer(v).getBytes())])]);d.push(b)}var C=null;if(null!==e){var E=r.wrapRsaPrivateKey(r.privateKeyToAsn1(e));C=null===a?t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.keyBag).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[E]),s]):t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.pkcs8ShroudedKeyBag).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[r.encryptPrivateKeyInfo(E,a,o)]),s]);var w=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[C]),k=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.data).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,t.toDer(w).getBytes())])]);d.push(k)}var S,B=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,d);if(o.useMac){var T=j.md.sha1.create(),A=new j.util.ByteBuffer(j.random.getBytes(o.saltSize)),I=o.count,_=(e=n.generateKey(a,A,3,I,20),j.hmac.create());_.start(T,e),_.update(t.toDer(B).getBytes());var x=_.getMac();S=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.sha1).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")]),t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,x.getBytes())]),t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,A.getBytes()),t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(I).getBytes())])}return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(3).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.data).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,t.toDer(B).getBytes())])]),S])},n.generateKey=j.pbe.generatePkcs12Key})),C((function(e){var t=j.asn1,r=e.exports=j.pki=j.pki||{};r.pemToDer=function(e){var t=j.pem.decode(e)[0];if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert PEM to DER; PEM is encrypted.");return j.util.createBuffer(t.body)},r.privateKeyFromPem=function(e){var n=j.pem.decode(e)[0];if("PRIVATE KEY"!==n.type&&"RSA PRIVATE KEY"!==n.type){var i=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw i.headerType=n.type,i}if(n.procType&&"ENCRYPTED"===n.procType.type)throw new Error("Could not convert private key from PEM; PEM is encrypted.");var a=t.fromDer(n.body);return r.privateKeyFromAsn1(a)},r.privateKeyToPem=function(e,n){var i={type:"RSA PRIVATE KEY",body:t.toDer(r.privateKeyToAsn1(e)).getBytes()};return j.pem.encode(i,{maxline:n})},r.privateKeyInfoToPem=function(e,r){var n={type:"PRIVATE KEY",body:t.toDer(e).getBytes()};return j.pem.encode(n,{maxline:r})}}));var Et=function(e,t,r,n){var i=j.util.createBuffer(),a=e.length>>1,o=a+(1&e.length),s=e.substr(0,o),c=e.substr(a,o),u=j.util.createBuffer(),l=j.hmac.create();r=t+r;var d=Math.ceil(n/16),f=Math.ceil(n/20);l.start("MD5",s);var p=j.util.createBuffer();u.putBytes(r);for(var h=0;h<d;++h)l.start(null,null),l.update(u.getBytes()),u.putBuffer(l.digest()),l.start(null,null),l.update(u.bytes()+r),p.putBuffer(l.digest());l.start("SHA1",c);var g=j.util.createBuffer();for(u.clear(),u.putBytes(r),h=0;h<f;++h)l.start(null,null),l.update(u.getBytes()),u.putBuffer(l.digest()),l.start(null,null),l.update(u.bytes()+r),g.putBuffer(l.digest());return i.putBytes(j.util.xorBytes(p.getBytes(),g.getBytes(),n)),i},wt=function(e,t,r){var n=!1;try{var i=e.deflate(t.fragment.getBytes());t.fragment=j.util.createBuffer(i),t.length=i.length,n=!0}catch(e){}return n},kt=function(e,t,r){var n=!1;try{var i=e.inflate(t.fragment.getBytes());t.fragment=j.util.createBuffer(i),t.length=i.length,n=!0}catch(e){}return n},St=function(e,t){var r=0;switch(t){case 1:r=e.getByte();break;case 2:r=e.getInt16();break;case 3:r=e.getInt24();break;case 4:r=e.getInt32()}return j.util.createBuffer(e.getBytes(r))},Bt=function(e,t,r){e.putInt(r.length(),t<<3),e.putBuffer(r)},Tt={Versions:{TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}}};Tt.SupportedVersions=[Tt.Versions.TLS_1_1,Tt.Versions.TLS_1_0],Tt.Version=Tt.SupportedVersions[0],Tt.MaxFragment=15360,Tt.ConnectionEnd={server:0,client:1},Tt.PRFAlgorithm={tls_prf_sha256:0},Tt.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2},Tt.CipherType={stream:0,block:1,aead:2},Tt.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4},Tt.CompressionMethod={none:0,deflate:1},Tt.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24},Tt.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20},Tt.Alert={},Tt.Alert.Level={warning:1,fatal:2},Tt.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100},Tt.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2},Tt.CipherSuites={},Tt.getCipherSuite=function(e){var t=null;for(var r in Tt.CipherSuites){var n=Tt.CipherSuites[r];if(n.id[0]===e.charCodeAt(0)&&n.id[1]===e.charCodeAt(1)){t=n;break}}return t},Tt.handleUnexpected=function(e,t){!e.open&&e.entity===Tt.ConnectionEnd.client||e.error(e,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:Tt.Alert.Level.fatal,description:Tt.Alert.Description.unexpected_message}})},Tt.handleHelloRequest=function(e,t,r){!e.handshaking&&e.handshakes>0&&(Tt.queue(e,Tt.createAlert(e,{level:Tt.Alert.Level.warning,description:Tt.Alert.Description.no_renegotiation})),Tt.flush(e)),e.process()},Tt.parseHelloMessage=function(e,t,r){var n=null,i=e.entity===Tt.ConnectionEnd.client;if(r<38)e.error(e,{message:i?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:Tt.Alert.Level.fatal,description:Tt.Alert.Description.illegal_parameter}});else{var a=t.fragment,o=a.length();if(n={version:{major:a.getByte(),minor:a.getByte()},random:j.util.createBuffer(a.getBytes(32)),session_id:St(a,1),extensions:[]},i?(n.cipher_suite=a.getBytes(2),n.compression_method=a.getByte()):(n.cipher_suites=St(a,2),n.compression_methods=St(a,1)),(o=r-(o-a.length()))>0){for(var s=St(a,2);s.length()>0;)n.extensions.push({type:[s.getByte(),s.getByte()],data:St(s,2)});if(!i)for(var c=0;c<n.extensions.length;++c){var u=n.extensions[c];if(0===u.type[0]&&0===u.type[1])for(var l=St(u.data,2);l.length()>0&&0===l.getByte();)e.session.extensions.server_name.serverNameList.push(St(l,2).getBytes())}}if(e.session.version&&(n.version.major!==e.session.version.major||n.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:Tt.Alert.Level.fatal,description:Tt.Alert.Description.protocol_version}});if(i)e.session.cipherSuite=Tt.getCipherSuite(n.cipher_suite);else for(var d=j.util.createBuffer(n.cipher_suites.bytes());d.length()>0&&(e.session.cipherSuite=Tt.getCipherSuite(d.getBytes(2)),null===e.session.cipherSuite););if(null===e.session.cipherSuite)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:Tt.Alert.Level.fatal,description:Tt.Alert.Description.handshake_failure},cipherSuite:j.util.bytesToHex(n.cipher_suite)});e.session.compressionMethod=i?n.compression_method:Tt.CompressionMethod.none}return n},Tt.createSecurityParameters=function(e,t){var r=e.entity===Tt.ConnectionEnd.client,n=t.random.bytes(),i=r?e.session.sp.client_random:n,a=r?n:Tt.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:Tt.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:i,server_random:a}},Tt.handleServerHello=function(e,t,r){var n=Tt.parseHelloMessage(e,t,r);if(!e.fail){if(!(n.version.minor<=e.version.minor))return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:Tt.Alert.Level.fatal,description:Tt.Alert.Description.protocol_version}});e.version.minor=n.version.minor,e.session.version=e.version;var i=n.session_id.bytes();i.length>0&&i===e.session.id?(e.expect=Pt,e.session.resuming=!0,e.session.sp.server_random=n.random.bytes()):(e.expect=At,e.session.resuming=!1,Tt.createSecurityParameters(e,n)),e.session.id=i,e.process()}},Tt.handleClientHello=function(e,t,r){var n=Tt.parseHelloMessage(e,t,r);if(!e.fail){var i=n.session_id.bytes(),a=null;if(e.sessionCache&&(null===(a=e.sessionCache.getSession(i))?i="":(a.version.major!==n.version.major||a.version.minor>n.version.minor)&&(a=null,i="")),0===i.length&&(i=j.random.getBytes(32)),e.session.id=i,e.session.clientHelloVersion=n.version,e.session.sp={},a)e.version=e.session.version=a.version,e.session.sp=a.sp;else{for(var o,s=1;s<Tt.SupportedVersions.length&&!((o=Tt.SupportedVersions[s]).minor<=n.version.minor);++s);e.version={major:o.major,minor:o.minor},e.session.version=e.version}null!==a?(e.expect=Mt,e.session.resuming=!0,e.session.sp.client_random=n.random.bytes()):(e.expect=!1!==e.verifyClient?Lt:Dt,e.session.resuming=!1,Tt.createSecurityParameters(e,n)),e.open=!0,Tt.queue(e,Tt.createRecord(e,{type:Tt.ContentType.handshake,data:Tt.createServerHello(e)})),e.session.resuming?(Tt.queue(e,Tt.createRecord(e,{type:Tt.ContentType.change_cipher_spec,data:Tt.createChangeCipherSpec()})),e.state.pending=Tt.createConnectionState(e),e.state.current.write=e.state.pending.write,Tt.queue(e,Tt.createRecord(e,{type:Tt.ContentType.handshake,data:Tt.createFinished(e)}))):(Tt.queue(e,Tt.createRecord(e,{type:Tt.ContentType.handshake,data:Tt.createCertificate(e)})),e.fail||(Tt.queue(e,Tt.createRecord(e,{type:Tt.ContentType.handshake,data:Tt.createServerKeyExchange(e)})),!1!==e.verifyClient&&Tt.queue(e,Tt.createRecord(e,{type:Tt.ContentType.handshake,data:Tt.createCertificateRequest(e)})),Tt.queue(e,Tt.createRecord(e,{type:Tt.ContentType.handshake,data:Tt.createServerHelloDone(e)})))),Tt.flush(e),e.process()}},Tt.handleCertificate=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:Tt.Alert.Level.fatal,description:Tt.Alert.Description.illegal_parameter}});var n,i,a=t.fragment,o={certificate_list:St(a,3)},s=[];try{for(;o.certificate_list.length()>0;)n=St(o.certificate_list,3),i=j.asn1.fromDer(n),n=j.pki.certificateFromAsn1(i,!0),s.push(n)}catch(t){return e.error(e,{message:"Could not parse certificate list.",cause:t,send:!0,alert:{level:Tt.Alert.Level.fatal,description:Tt.Alert.Description.bad_certificate}})}var c=e.entity===Tt.ConnectionEnd.client;!c&&!0!==e.verifyClient||0!==s.length?0===s.length?e.expect=c?It:Dt:(c?e.session.serverCertificate=s[0]:e.session.clientCertificate=s[0],Tt.verifyCertificateChain(e,s)&&(e.expect=c?It:Dt)):e.error(e,{message:c?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:Tt.Alert.Level.fatal,description:Tt.Alert.Description.illegal_parameter}}),e.process()},Tt.handleServerKeyExchange=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:Tt.Alert.Level.fatal,description:Tt.Alert.Description.unsupported_certificate}});e.expect=_t,e.process()},Tt.handleClientKeyExchange=function(e,t,r){if(r<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:Tt.Alert.Level.fatal,description:Tt.Alert.Description.unsupported_certificate}});var n=t.fragment,i={enc_pre_master_secret:St(n,2).getBytes()},a=null;if(e.getPrivateKey)try{a=e.getPrivateKey(e,e.session.serverCertificate),a=j.pki.privateKeyFromPem(a)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:Tt.Alert.Level.fatal,description:Tt.Alert.Description.internal_error}})}if(null===a)return e.error(e,{message:"No private key set.",send:!0,alert:{level:Tt.Alert.Level.fatal,description:Tt.Alert.Description.internal_error}});try{var o=e.session.sp;o.pre_master_secret=a.decrypt(i.enc_pre_master_secret);var s=e.session.clientHelloVersion;if(s.major!==o.pre_master_secret.charCodeAt(0)||s.minor!==o.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch(e){o.pre_master_secret=j.random.getBytes(48)}e.expect=Mt,null!==e.session.clientCertificate&&(e.expect=Ut),e.process()},Tt.handleCertificateRequest=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:Tt.Alert.Level.fatal,description:Tt.Alert.Description.illegal_parameter}});var n=t.fragment,i={certificate_types:St(n,1),certificate_authorities:St(n,2)};e.session.certificateRequest=i,e.expect=xt,e.process()},Tt.handleCertificateVerify=function(e,t,r){if(r<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:Tt.Alert.Level.fatal,description:Tt.Alert.Description.illegal_parameter}});var n=t.fragment;n.read-=4;var i=n.bytes();n.read+=4;var a={signature:St(n,2).getBytes()},o=j.util.createBuffer();o.putBuffer(e.session.md5.digest()),o.putBuffer(e.session.sha1.digest()),o=o.getBytes();try{if(!e.session.clientCertificate.publicKey.verify(o,a.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(i),e.session.sha1.update(i)}catch(t){return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:Tt.Alert.Level.fatal,description:Tt.Alert.Description.handshake_failure}})}e.expect=Mt,e.process()},Tt.handleServerHelloDone=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:Tt.Alert.Level.fatal,description:Tt.Alert.Description.record_overflow}});if(null===e.serverCertificate){var n={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:Tt.Alert.Level.fatal,description:Tt.Alert.Description.insufficient_security}},i=e.verify(e,n.alert.description,0,[]);if(!0!==i)return(i||0===i)&&("object"!=Iv(i)||j.util.isArray(i)?"number"==typeof i&&(n.alert.description=i):(i.message&&(n.message=i.message),i.alert&&(n.alert.description=i.alert))),e.error(e,n)}null!==e.session.certificateRequest&&(t=Tt.createRecord(e,{type:Tt.ContentType.handshake,data:Tt.createCertificate(e)}),Tt.queue(e,t)),t=Tt.createRecord(e,{type:Tt.ContentType.handshake,data:Tt.createClientKeyExchange(e)}),Tt.queue(e,t),e.expect=Ot;var a=function(e,t){null!==e.session.certificateRequest&&null!==e.session.clientCertificate&&Tt.queue(e,Tt.createRecord(e,{type:Tt.ContentType.handshake,data:Tt.createCertificateVerify(e,t)})),Tt.queue(e,Tt.createRecord(e,{type:Tt.ContentType.change_cipher_spec,data:Tt.createChangeCipherSpec()})),e.state.pending=Tt.createConnectionState(e),e.state.current.write=e.state.pending.write,Tt.queue(e,Tt.createRecord(e,{type:Tt.ContentType.handshake,data:Tt.createFinished(e)})),e.expect=Pt,Tt.flush(e),e.process()};if(null===e.session.certificateRequest||null===e.session.clientCertificate)return a(e,null);Tt.getClientSignature(e,a)},Tt.handleChangeCipherSpec=function(e,t){if(1!==t.fragment.getByte())return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:Tt.Alert.Level.fatal,description:Tt.Alert.Description.illegal_parameter}});var r=e.entity===Tt.ConnectionEnd.client;(e.session.resuming&&r||!e.session.resuming&&!r)&&(e.state.pending=Tt.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&r||e.session.resuming&&!r)&&(e.state.pending=null),e.expect=r?Rt:Vt,e.process()},Tt.handleFinished=function(e,t,r){var n=t.fragment;n.read-=4;var i=n.bytes();n.read+=4;var a=t.fragment.getBytes();(n=j.util.createBuffer()).putBuffer(e.session.md5.digest()),n.putBuffer(e.session.sha1.digest());var o=e.entity===Tt.ConnectionEnd.client,s=o?"server finished":"client finished",c=e.session.sp;if((n=Et(c.master_secret,s,n.getBytes(),12)).getBytes()!==a)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:Tt.Alert.Level.fatal,description:Tt.Alert.Description.decrypt_error}});e.session.md5.update(i),e.session.sha1.update(i),(e.session.resuming&&o||!e.session.resuming&&!o)&&(Tt.queue(e,Tt.createRecord(e,{type:Tt.ContentType.change_cipher_spec,data:Tt.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,Tt.queue(e,Tt.createRecord(e,{type:Tt.ContentType.handshake,data:Tt.createFinished(e)}))),e.expect=o?Nt:jt,e.handshaking=!1,++e.handshakes,e.peerCertificate=o?e.session.serverCertificate:e.session.clientCertificate,Tt.flush(e),e.isConnected=!0,e.connected(e),e.process()},Tt.handleAlert=function(e,t){var r,n=t.fragment,i={level:n.getByte(),description:n.getByte()};switch(i.description){case Tt.Alert.Description.close_notify:r="Connection closed.";break;case Tt.Alert.Description.unexpected_message:r="Unexpected message.";break;case Tt.Alert.Description.bad_record_mac:r="Bad record MAC.";break;case Tt.Alert.Description.decryption_failed:r="Decryption failed.";break;case Tt.Alert.Description.record_overflow:r="Record overflow.";break;case Tt.Alert.Description.decompression_failure:r="Decompression failed.";break;case Tt.Alert.Description.handshake_failure:r="Handshake failure.";break;case Tt.Alert.Description.bad_certificate:r="Bad certificate.";break;case Tt.Alert.Description.unsupported_certificate:r="Unsupported certificate.";break;case Tt.Alert.Description.certificate_revoked:r="Certificate revoked.";break;case Tt.Alert.Description.certificate_expired:r="Certificate expired.";break;case Tt.Alert.Description.certificate_unknown:r="Certificate unknown.";break;case Tt.Alert.Description.illegal_parameter:r="Illegal parameter.";break;case Tt.Alert.Description.unknown_ca:r="Unknown certificate authority.";break;case Tt.Alert.Description.access_denied:r="Access denied.";break;case Tt.Alert.Description.decode_error:r="Decode error.";break;case Tt.Alert.Description.decrypt_error:r="Decrypt error.";break;case Tt.Alert.Description.export_restriction:r="Export restriction.";break;case Tt.Alert.Description.protocol_version:r="Unsupported protocol version.";break;case Tt.Alert.Description.insufficient_security:r="Insufficient security.";break;case Tt.Alert.Description.internal_error:r="Internal error.";break;case Tt.Alert.Description.user_canceled:r="User canceled.";break;case Tt.Alert.Description.no_renegotiation:r="Renegotiation not supported.";break;default:r="Unknown error."}if(i.description===Tt.Alert.Description.close_notify)return e.close();e.error(e,{message:r,send:!1,origin:e.entity===Tt.ConnectionEnd.client?"server":"client",alert:i}),e.process()},Tt.handleHandshake=function(e,t){var r=t.fragment,n=r.getByte(),i=r.getInt24();if(i>r.length())return e.fragmented=t,t.fragment=j.util.createBuffer(),r.read-=4,e.process();e.fragmented=null,r.read-=4;var a=r.bytes(i+4);r.read+=4,n in tr[e.entity][e.expect]?(e.entity!==Tt.ConnectionEnd.server||e.open||e.fail||(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:j.md.md5.create(),sha1:j.md.sha1.create()}),n!==Tt.HandshakeType.hello_request&&n!==Tt.HandshakeType.certificate_verify&&n!==Tt.HandshakeType.finished&&(e.session.md5.update(a),e.session.sha1.update(a)),tr[e.entity][e.expect][n](e,t,i)):Tt.handleUnexpected(e,t)},Tt.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()},Tt.handleHeartbeat=function(e,t){var r=t.fragment,n=r.getByte(),i=r.getInt16(),a=r.getBytes(i);if(n===Tt.HeartbeatMessageType.heartbeat_request){if(e.handshaking||i>a.length)return e.process();Tt.queue(e,Tt.createRecord(e,{type:Tt.ContentType.heartbeat,data:Tt.createHeartbeat(Tt.HeartbeatMessageType.heartbeat_response,a)})),Tt.flush(e)}else if(n===Tt.HeartbeatMessageType.heartbeat_response){if(a!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,j.util.createBuffer(a))}e.process()};var At=1,It=2,_t=3,xt=4,Pt=5,Rt=6,Nt=7,Ot=8,Lt=1,Dt=2,Ut=3,Mt=4,Vt=5,jt=6,Ft=Tt.handleUnexpected,zt=Tt.handleChangeCipherSpec,Kt=Tt.handleAlert,qt=Tt.handleHandshake,Ht=Tt.handleApplicationData,Qt=Tt.handleHeartbeat,Gt=[];Gt[Tt.ConnectionEnd.client]=[[Ft,Kt,qt,Ft,Qt],[Ft,Kt,qt,Ft,Qt],[Ft,Kt,qt,Ft,Qt],[Ft,Kt,qt,Ft,Qt],[Ft,Kt,qt,Ft,Qt],[zt,Kt,Ft,Ft,Qt],[Ft,Kt,qt,Ft,Qt],[Ft,Kt,qt,Ht,Qt],[Ft,Kt,qt,Ft,Qt]],Gt[Tt.ConnectionEnd.server]=[[Ft,Kt,qt,Ft,Qt],[Ft,Kt,qt,Ft,Qt],[Ft,Kt,qt,Ft,Qt],[Ft,Kt,qt,Ft,Qt],[zt,Kt,Ft,Ft,Qt],[Ft,Kt,qt,Ft,Qt],[Ft,Kt,qt,Ht,Qt],[Ft,Kt,qt,Ft,Qt]];var Wt=Tt.handleHelloRequest,Xt=Tt.handleServerHello,Yt=Tt.handleCertificate,$t=Tt.handleServerKeyExchange,Zt=Tt.handleCertificateRequest,Jt=Tt.handleServerHelloDone,er=Tt.handleFinished,tr=[];tr[Tt.ConnectionEnd.client]=[[Ft,Ft,Xt,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft],[Wt,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Yt,$t,Zt,Jt,Ft,Ft,Ft,Ft,Ft,Ft],[Wt,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,$t,Zt,Jt,Ft,Ft,Ft,Ft,Ft,Ft],[Wt,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Zt,Jt,Ft,Ft,Ft,Ft,Ft,Ft],[Wt,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Jt,Ft,Ft,Ft,Ft,Ft,Ft],[Wt,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft],[Wt,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,er],[Wt,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft],[Wt,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft]];var rr=Tt.handleClientHello,nr=Tt.handleClientKeyExchange,ir=Tt.handleCertificateVerify;tr[Tt.ConnectionEnd.server]=[[Ft,rr,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft],[Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Yt,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft],[Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,nr,Ft,Ft,Ft,Ft],[Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,ir,Ft,Ft,Ft,Ft,Ft],[Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft],[Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,er],[Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft],[Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft,Ft]],Tt.generateKeys=function(e,t){var r=Et,n=t.client_random+t.server_random;e.session.resuming||(t.master_secret=r(t.pre_master_secret,"master secret",n,48).bytes(),t.pre_master_secret=null),n=t.server_random+t.client_random;var i=2*t.mac_key_length+2*t.enc_key_length,a=e.version.major===Tt.Versions.TLS_1_0.major&&e.version.minor===Tt.Versions.TLS_1_0.minor;a&&(i+=2*t.fixed_iv_length);var o=r(t.master_secret,"key expansion",n,i),s={client_write_MAC_key:o.getBytes(t.mac_key_length),server_write_MAC_key:o.getBytes(t.mac_key_length),client_write_key:o.getBytes(t.enc_key_length),server_write_key:o.getBytes(t.enc_key_length)};return a&&(s.client_write_IV=o.getBytes(t.fixed_iv_length),s.server_write_IV=o.getBytes(t.fixed_iv_length)),s},Tt.createConnectionState=function(e){var t=e.entity===Tt.ConnectionEnd.client,r=function(){var e={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(e){return!0},compressionState:null,compressFunction:function(e){return!0},updateSequenceNumber:function(){4294967295===e.sequenceNumber[1]?(e.sequenceNumber[1]=0,++e.sequenceNumber[0]):++e.sequenceNumber[1]}};return e},n={read:r(),write:r()};if(n.read.update=function(e,t){return n.read.cipherFunction(t,n.read)?n.read.compressFunction(e,t,n.read)||e.error(e,{message:"Could not decompress record.",send:!0,alert:{level:Tt.Alert.Level.fatal,description:Tt.Alert.Description.decompression_failure}}):e.error(e,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:Tt.Alert.Level.fatal,description:Tt.Alert.Description.bad_record_mac}}),!e.fail},n.write.update=function(e,t){return n.write.compressFunction(e,t,n.write)?n.write.cipherFunction(t,n.write)||e.error(e,{message:"Could not encrypt record.",send:!1,alert:{level:Tt.Alert.Level.fatal,description:Tt.Alert.Description.internal_error}}):e.error(e,{message:"Could not compress record.",send:!1,alert:{level:Tt.Alert.Level.fatal,description:Tt.Alert.Description.internal_error}}),!e.fail},e.session){var i=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(i),i.keys=Tt.generateKeys(e,i),n.read.macKey=t?i.keys.server_write_MAC_key:i.keys.client_write_MAC_key,n.write.macKey=t?i.keys.client_write_MAC_key:i.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(n,e,i),i.compression_algorithm){case Tt.CompressionMethod.none:break;case Tt.CompressionMethod.deflate:n.read.compressFunction=kt,n.write.compressFunction=wt;break;default:throw new Error("Unsupported compression algorithm.")}}return n},Tt.createRandom=function(){var e=new Date,t=+e+6e4*e.getTimezoneOffset(),r=j.util.createBuffer();return r.putInt32(t),r.putBytes(j.random.getBytes(28)),r},Tt.createRecord=function(e,t){return t.data?{type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data}:null},Tt.createAlert=function(e,t){var r=j.util.createBuffer();return r.putByte(t.level),r.putByte(t.description),Tt.createRecord(e,{type:Tt.ContentType.alert,data:r})},Tt.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=j.util.createBuffer(),r=0;r<e.cipherSuites.length;++r){var n=e.cipherSuites[r];t.putByte(n.id[0]),t.putByte(n.id[1])}var i=t.length(),a=j.util.createBuffer();a.putByte(Tt.CompressionMethod.none);var o=a.length(),s=j.util.createBuffer();if(e.virtualHost){var c=j.util.createBuffer();c.putByte(0),c.putByte(0);var u=j.util.createBuffer();u.putByte(0),Bt(u,2,j.util.createBuffer(e.virtualHost));var l=j.util.createBuffer();Bt(l,2,u),Bt(c,2,l),s.putBuffer(c)}var d=s.length();d>0&&(d+=2);var f=e.session.id,p=f.length+1+2+4+28+2+i+1+o+d,h=j.util.createBuffer();return h.putByte(Tt.HandshakeType.client_hello),h.putInt24(p),h.putByte(e.version.major),h.putByte(e.version.minor),h.putBytes(e.session.sp.client_random),Bt(h,1,j.util.createBuffer(f)),Bt(h,2,t),Bt(h,1,a),d>0&&Bt(h,2,s),h},Tt.createServerHello=function(e){var t=e.session.id,r=t.length+1+2+4+28+2+1,n=j.util.createBuffer();return n.putByte(Tt.HandshakeType.server_hello),n.putInt24(r),n.putByte(e.version.major),n.putByte(e.version.minor),n.putBytes(e.session.sp.server_random),Bt(n,1,j.util.createBuffer(t)),n.putByte(e.session.cipherSuite.id[0]),n.putByte(e.session.cipherSuite.id[1]),n.putByte(e.session.compressionMethod),n},Tt.createCertificate=function(e){var t,r=e.entity===Tt.ConnectionEnd.client,n=null;e.getCertificate&&(t=r?e.session.certificateRequest:e.session.extensions.server_name.serverNameList,n=e.getCertificate(e,t));var i=j.util.createBuffer();if(null!==n)try{j.util.isArray(n)||(n=[n]);for(var a=null,o=0;o<n.length;++o){var s=j.pem.decode(n[o])[0];if("CERTIFICATE"!==s.type&&"X509 CERTIFICATE"!==s.type&&"TRUSTED CERTIFICATE"!==s.type){var c=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw c.headerType=s.type,c}if(s.procType&&"ENCRYPTED"===s.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var u=j.util.createBuffer(s.body);null===a&&(a=j.asn1.fromDer(u.bytes(),!1));var l=j.util.createBuffer();Bt(l,3,u),i.putBuffer(l)}n=j.pki.certificateFromAsn1(a),r?e.session.clientCertificate=n:e.session.serverCertificate=n}catch(t){return e.error(e,{message:"Could not send certificate list.",cause:t,send:!0,alert:{level:Tt.Alert.Level.fatal,description:Tt.Alert.Description.bad_certificate}})}var d=3+i.length(),f=j.util.createBuffer();return f.putByte(Tt.HandshakeType.certificate),f.putInt24(d),Bt(f,3,i),f},Tt.createClientKeyExchange=function(e){var t=j.util.createBuffer();t.putByte(e.session.clientHelloVersion.major),t.putByte(e.session.clientHelloVersion.minor),t.putBytes(j.random.getBytes(46));var r=e.session.sp;r.pre_master_secret=t.getBytes();var n=(t=e.session.serverCertificate.publicKey.encrypt(r.pre_master_secret)).length+2,i=j.util.createBuffer();return i.putByte(Tt.HandshakeType.client_key_exchange),i.putInt24(n),i.putInt16(t.length),i.putBytes(t),i},Tt.createServerKeyExchange=function(e){return j.util.createBuffer()},Tt.getClientSignature=function(e,t){var r=j.util.createBuffer();r.putBuffer(e.session.md5.digest()),r.putBuffer(e.session.sha1.digest()),r=r.getBytes(),e.getSignature=e.getSignature||function(e,t,r){var n=null;if(e.getPrivateKey)try{n=e.getPrivateKey(e,e.session.clientCertificate),n=j.pki.privateKeyFromPem(n)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:Tt.Alert.Level.fatal,description:Tt.Alert.Description.internal_error}})}null===n?e.error(e,{message:"No private key set.",send:!0,alert:{level:Tt.Alert.Level.fatal,description:Tt.Alert.Description.internal_error}}):t=n.sign(t,null),r(e,t)},e.getSignature(e,r,t)},Tt.createCertificateVerify=function(e,t){var r=t.length+2,n=j.util.createBuffer();return n.putByte(Tt.HandshakeType.certificate_verify),n.putInt24(r),n.putInt16(t.length),n.putBytes(t),n},Tt.createCertificateRequest=function(e){var t=j.util.createBuffer();t.putByte(1);var r=j.util.createBuffer();for(var n in e.caStore.certs){var i=e.caStore.certs[n],a=j.pki.distinguishedNameToAsn1(i.subject),o=j.asn1.toDer(a);r.putInt16(o.length()),r.putBuffer(o)}var s=1+t.length()+2+r.length(),c=j.util.createBuffer();return c.putByte(Tt.HandshakeType.certificate_request),c.putInt24(s),Bt(c,1,t),Bt(c,2,r),c},Tt.createServerHelloDone=function(e){var t=j.util.createBuffer();return t.putByte(Tt.HandshakeType.server_hello_done),t.putInt24(0),t},Tt.createChangeCipherSpec=function(){var e=j.util.createBuffer();return e.putByte(1),e},Tt.createFinished=function(e){var t=j.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var r=e.entity===Tt.ConnectionEnd.client,n=e.session.sp,i=r?"client finished":"server finished";t=Et(n.master_secret,i,t.getBytes(),12);var a=j.util.createBuffer();return a.putByte(Tt.HandshakeType.finished),a.putInt24(t.length()),a.putBuffer(t),a},Tt.createHeartbeat=function(e,t,r){void 0===r&&(r=t.length);var n=j.util.createBuffer();n.putByte(e),n.putInt16(r),n.putBytes(t);var i=n.length(),a=Math.max(16,i-r-3);return n.putBytes(j.random.getBytes(a)),n},Tt.queue=function(e,t){if(t&&(0!==t.fragment.length()||t.type!==Tt.ContentType.handshake&&t.type!==Tt.ContentType.alert&&t.type!==Tt.ContentType.change_cipher_spec)){if(t.type===Tt.ContentType.handshake){var r=t.fragment.bytes();e.session.md5.update(r),e.session.sha1.update(r),r=null}var n;if(t.fragment.length()<=Tt.MaxFragment)n=[t];else{n=[];for(var i=t.fragment.bytes();i.length>Tt.MaxFragment;)n.push(Tt.createRecord(e,{type:t.type,data:j.util.createBuffer(i.slice(0,Tt.MaxFragment))})),i=i.slice(Tt.MaxFragment);i.length>0&&n.push(Tt.createRecord(e,{type:t.type,data:j.util.createBuffer(i)}))}for(var a=0;a<n.length&&!e.fail;++a){var o=n[a];e.state.current.write.update(e,o)&&e.records.push(o)}}},Tt.flush=function(e){for(var t=0;t<e.records.length;++t){var r=e.records[t];e.tlsData.putByte(r.type),e.tlsData.putByte(r.version.major),e.tlsData.putByte(r.version.minor),e.tlsData.putInt16(r.fragment.length()),e.tlsData.putBuffer(e.records[t].fragment)}return e.records=[],e.tlsDataReady(e)};var ar=function(e){switch(e){case!0:return!0;case j.pki.certificateError.bad_certificate:return Tt.Alert.Description.bad_certificate;case j.pki.certificateError.unsupported_certificate:return Tt.Alert.Description.unsupported_certificate;case j.pki.certificateError.certificate_revoked:return Tt.Alert.Description.certificate_revoked;case j.pki.certificateError.certificate_expired:return Tt.Alert.Description.certificate_expired;case j.pki.certificateError.certificate_unknown:return Tt.Alert.Description.certificate_unknown;case j.pki.certificateError.unknown_ca:return Tt.Alert.Description.unknown_ca;default:return Tt.Alert.Description.bad_certificate}};for(var or in Tt.verifyCertificateChain=function(e,t){try{var r={};for(var n in e.verifyOptions)r[n]=e.verifyOptions[n];r.verify=function(t,r,n){ar(t);var i=e.verify(e,t,r,n);if(!0!==i){if("object"==Iv(i)&&!j.util.isArray(i)){var a=new Error("The application rejected the certificate.");throw a.send=!0,a.alert={level:Tt.Alert.Level.fatal,description:Tt.Alert.Description.bad_certificate},i.message&&(a.message=i.message),i.alert&&(a.alert.description=i.alert),a}i!==t&&(i=function(e){switch(e){case!0:return!0;case Tt.Alert.Description.bad_certificate:return j.pki.certificateError.bad_certificate;case Tt.Alert.Description.unsupported_certificate:return j.pki.certificateError.unsupported_certificate;case Tt.Alert.Description.certificate_revoked:return j.pki.certificateError.certificate_revoked;case Tt.Alert.Description.certificate_expired:return j.pki.certificateError.certificate_expired;case Tt.Alert.Description.certificate_unknown:return j.pki.certificateError.certificate_unknown;case Tt.Alert.Description.unknown_ca:return j.pki.certificateError.unknown_ca;default:return j.pki.certificateError.bad_certificate}}(i))}return i},j.pki.verifyCertificateChain(e.caStore,t,r)}catch(t){var i=t;("object"!=Iv(i)||j.util.isArray(i))&&(i={send:!0,alert:{level:Tt.Alert.Level.fatal,description:ar(t)}}),"send"in i||(i.send=!0),"alert"in i||(i.alert={level:Tt.Alert.Level.fatal,description:ar(i.error)}),e.error(e,i)}return!e.fail},Tt.createSessionCache=function(e,t){var r=null;if(e&&e.getSession&&e.setSession&&e.order)r=e;else{for(var n in(r={}).cache=e||{},r.capacity=Math.max(t||100,1),r.order=[],e)r.order.length<=t?r.order.push(n):delete e[n];r.getSession=function(e){var t=null,n=null;if(e?n=j.util.bytesToHex(e):r.order.length>0&&(n=r.order[0]),null!==n&&n in r.cache)for(var i in t=r.cache[n],delete r.cache[n],r.order)if(r.order[i]===n){r.order.splice(i,1);break}return t},r.setSession=function(e,t){if(r.order.length===r.capacity){var n=r.order.shift();delete r.cache[n]}n=j.util.bytesToHex(e),r.order.push(n),r.cache[n]=t}}return r},Tt.createConnection=function(e){var t;t=e.caStore?j.util.isArray(e.caStore)?j.pki.createCaStore(e.caStore):e.caStore:j.pki.createCaStore();var r=e.cipherSuites||null;if(null===r)for(var n in r=[],Tt.CipherSuites)r.push(Tt.CipherSuites[n]);var i=e.server?Tt.ConnectionEnd.server:Tt.ConnectionEnd.client,a=e.sessionCache?Tt.createSessionCache(e.sessionCache):null,o={version:{major:Tt.Version.major,minor:Tt.Version.minor},entity:i,sessionId:e.sessionId,caStore:t,sessionCache:a,cipherSuites:r,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(e,t,r,n){return t},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:j.util.createBuffer(),tlsData:j.util.createBuffer(),data:j.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(t,r){r.origin=r.origin||(t.entity===Tt.ConnectionEnd.client?"client":"server"),r.send&&(Tt.queue(t,Tt.createAlert(t,r.alert)),Tt.flush(t));var n=!1!==r.fatal;n&&(t.fail=!0),e.error(t,r),n&&t.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null,reset:function(e){o.version={major:Tt.Version.major,minor:Tt.Version.minor},o.record=null,o.session=null,o.peerCertificate=null,o.state={pending:null,current:null},o.expect=(Tt.ConnectionEnd.client,0),o.fragmented=null,o.records=[],o.open=!1,o.handshakes=0,o.handshaking=!1,o.isConnected=!1,o.fail=!(e||void 0===e),o.input.clear(),o.tlsData.clear(),o.data.clear(),o.state.current=Tt.createConnectionState(o)}};return o.reset(),o.handshake=function(e){if(o.entity!==Tt.ConnectionEnd.client)o.error(o,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(o.handshaking)o.error(o,{message:"Handshake already in progress.",fatal:!1});else{o.fail&&!o.open&&0===o.handshakes&&(o.fail=!1),o.handshaking=!0;var t=null;(e=e||"").length>0&&(o.sessionCache&&(t=o.sessionCache.getSession(e)),null===t&&(e="")),0===e.length&&o.sessionCache&&null!==(t=o.sessionCache.getSession())&&(e=t.id),o.session={id:e,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:j.md.md5.create(),sha1:j.md.sha1.create()},t&&(o.version=t.version,o.session.sp=t.sp),o.session.sp.client_random=Tt.createRandom().getBytes(),o.open=!0,Tt.queue(o,Tt.createRecord(o,{type:Tt.ContentType.handshake,data:Tt.createClientHello(o)})),Tt.flush(o)}},o.process=function(e){var t=0;return e&&o.input.putBytes(e),o.fail||(null!==o.record&&o.record.ready&&o.record.fragment.isEmpty()&&(o.record=null),null===o.record&&(t=function(e){var t=0,r=e.input,n=r.length();if(n<5)t=5-n;else{e.record={type:r.getByte(),version:{major:r.getByte(),minor:r.getByte()},length:r.getInt16(),fragment:j.util.createBuffer(),ready:!1};var i=e.record.version.major===e.version.major;i&&e.session&&e.session.version&&(i=e.record.version.minor===e.version.minor),i||e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:Tt.Alert.Level.fatal,description:Tt.Alert.Description.protocol_version}})}return t}(o)),o.fail||null===o.record||o.record.ready||(t=function(e){var t=0,r=e.input,n=r.length();return n<e.record.length?t=e.record.length-n:(e.record.fragment.putBytes(r.getBytes(e.record.length)),r.compact(),e.state.current.read.update(e,e.record)&&(null!==e.fragmented&&(e.fragmented.type===e.record.type?(e.fragmented.fragment.putBuffer(e.record.fragment),e.record=e.fragmented):e.error(e,{message:"Invalid fragmented record.",send:!0,alert:{level:Tt.Alert.Level.fatal,description:Tt.Alert.Description.unexpected_message}})),e.record.ready=!0)),t}(o)),!o.fail&&null!==o.record&&o.record.ready&&function(e,t){var r=t.type-Tt.ContentType.change_cipher_spec,n=Gt[e.entity][e.expect];r in n?n[r](e,t):Tt.handleUnexpected(e,t)}(o,o.record)),t},o.prepare=function(e){return Tt.queue(o,Tt.createRecord(o,{type:Tt.ContentType.application_data,data:j.util.createBuffer(e)})),Tt.flush(o)},o.prepareHeartbeatRequest=function(e,t){return e instanceof j.util.ByteBuffer&&(e=e.bytes()),void 0===t&&(t=e.length),o.expectedHeartbeatPayload=e,Tt.queue(o,Tt.createRecord(o,{type:Tt.ContentType.heartbeat,data:Tt.createHeartbeat(Tt.HeartbeatMessageType.heartbeat_request,e,t)})),Tt.flush(o)},o.close=function(e){if(!o.fail&&o.sessionCache&&o.session){var t={id:o.session.id,version:o.session.version,sp:o.session.sp};t.sp.keys=null,o.sessionCache.setSession(t.id,t)}o.open&&(o.open=!1,o.input.clear(),(o.isConnected||o.handshaking)&&(o.isConnected=o.handshaking=!1,Tt.queue(o,Tt.createAlert(o,{level:Tt.Alert.Level.warning,description:Tt.Alert.Description.close_notify})),Tt.flush(o)),o.closed(o)),o.reset(e)},o},j.tls=j.tls||{},Tt)"function"!=typeof Tt[or]&&(j.tls[or]=Tt[or]);j.tls.prf_tls1=Et,j.tls.hmac_sha1=function(e,t,r){var n=j.hmac.create();n.start("SHA1",e);var i=j.util.createBuffer();return i.putInt32(t[0]),i.putInt32(t[1]),i.putByte(r.type),i.putByte(r.version.major),i.putByte(r.version.minor),i.putInt16(r.length),i.putBytes(r.fragment.bytes()),n.update(i.getBytes()),n.digest().getBytes()},j.tls.createSessionCache=Tt.createSessionCache,j.tls.createConnection=Tt.createConnection,C((function(e){var t=e.exports=j.tls;function r(e,r,i){var a=r.entity===j.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:j.cipher.createDecipher("AES-CBC",a?i.keys.server_write_key:i.keys.client_write_key),iv:a?i.keys.server_write_IV:i.keys.client_write_IV},e.write.cipherState={init:!1,cipher:j.cipher.createCipher("AES-CBC",a?i.keys.client_write_key:i.keys.server_write_key),iv:a?i.keys.client_write_IV:i.keys.server_write_IV},e.read.cipherFunction=o,e.write.cipherFunction=n,e.read.macLength=e.write.macLength=i.mac_length,e.read.macFunction=e.write.macFunction=t.hmac_sha1}function n(e,r){var n,a=!1,o=r.macFunction(r.macKey,r.sequenceNumber,e);e.fragment.putBytes(o),r.updateSequenceNumber(),n=e.version.minor===t.Versions.TLS_1_0.minor?r.cipherState.init?null:r.cipherState.iv:j.random.getBytesSync(16),r.cipherState.init=!0;var s=r.cipherState.cipher;return s.start({iv:n}),e.version.minor>=t.Versions.TLS_1_1.minor&&s.output.putBytes(n),s.update(e.fragment),s.finish(i)&&(e.fragment=s.output,e.length=e.fragment.length(),a=!0),a}function i(e,t,r){if(!r){var n=e-t.length()%e;t.fillWithByte(n-1,n)}return!0}function a(e,t,r){var n=!0;if(r){for(var i=t.length(),a=t.last(),o=i-1-a;o<i-1;++o)n=n&&t.at(o)==a;n&&t.truncate(a+1)}return n}function o(e,r){var n,i;n=e.version.minor===t.Versions.TLS_1_0.minor?r.cipherState.init?null:r.cipherState.iv:e.fragment.getBytes(16),r.cipherState.init=!0;var o=r.cipherState.cipher;o.start({iv:n}),o.update(e.fragment),i=o.finish(a);var s=r.macLength,c=j.random.getBytesSync(s),u=o.output.length();u>=s?(e.fragment=o.output.getBytes(u-s),c=o.output.getBytes(s)):e.fragment=o.output.getBytes(),e.fragment=j.util.createBuffer(e.fragment),e.length=e.fragment.length();var l=r.macFunction(r.macKey,r.sequenceNumber,e);return r.updateSequenceNumber(),function(e,t,r){var n=j.hmac.create();return n.start("SHA1",e),n.update(t),t=n.digest().getBytes(),n.start(null,null),n.update(r),t===n.digest().getBytes()}(r.macKey,c,l)&&i}t.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=t.BulkCipherAlgorithm.aes,e.cipher_type=t.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=t.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:r},t.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=t.BulkCipherAlgorithm.aes,e.cipher_type=t.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=t.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:r}})),j.debug=j.debug||{},j.debug.storage={},j.debug.get=function(e,t){var r;return void 0===e?r=j.debug.storage:e in j.debug.storage&&(r=void 0===t?j.debug.storage[e]:j.debug.storage[e][t]),r},j.debug.set=function(e,t,r){e in j.debug.storage||(j.debug.storage[e]={}),j.debug.storage[e][t]=r},j.debug.clear=function(e,t){void 0===e?j.debug.storage={}:e in j.debug.storage&&(void 0===t?delete j.debug.storage[e]:delete j.debug.storage[e][t])},C((function(e){var t=e.exports=j.sha512=j.sha512||{};j.md.sha512=j.md.algorithms.sha512=t;var r=j.sha384=j.sha512.sha384=j.sha512.sha384||{};r.create=function(){return t.create("SHA-384")},j.md.sha384=j.md.algorithms.sha384=r,j.sha512.sha256=j.sha512.sha256||{create:function(){return t.create("SHA-512/256")}},j.md["sha512/256"]=j.md.algorithms["sha512/256"]=j.sha512.sha256,j.sha512.sha224=j.sha512.sha224||{create:function(){return t.create("SHA-512/224")}},j.md["sha512/224"]=j.md.algorithms["sha512/224"]=j.sha512.sha224,t.create=function(e){if(i||(n=String.fromCharCode(128),n+=j.util.fillString(String.fromCharCode(0),128),a=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],(o={})["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],o["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],o["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],o["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],i=!0),void 0===e&&(e="SHA-512"),!(e in o))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=o[e],r=null,c=j.util.createBuffer(),u=new Array(80),l=0;l<80;++l)u[l]=new Array(2);var d=64;switch(e){case"SHA-384":d=48;break;case"SHA-512/256":d=32;break;case"SHA-512/224":d=28}var f={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:d,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){f.messageLength=0,f.fullMessageLength=f.messageLength128=[];for(var e=f.messageLengthSize/4,n=0;n<e;++n)f.fullMessageLength.push(0);for(c=j.util.createBuffer(),r=new Array(t.length),n=0;n<t.length;++n)r[n]=t[n].slice(0);return f}};return f.start(),f.update=function(e,t){"utf8"===t&&(e=j.util.encodeUtf8(e));var n=e.length;f.messageLength+=n,n=[n/4294967296>>>0,n>>>0];for(var i=f.fullMessageLength.length-1;i>=0;--i)f.fullMessageLength[i]+=n[1],n[1]=n[0]+(f.fullMessageLength[i]/4294967296>>>0),f.fullMessageLength[i]=f.fullMessageLength[i]>>>0,n[0]=n[1]/4294967296>>>0;return c.putBytes(e),s(r,u,c),(c.read>2048||0===c.length())&&c.compact(),f},f.digest=function(){var t=j.util.createBuffer();t.putBytes(c.bytes());var i,a=f.fullMessageLength[f.fullMessageLength.length-1]+f.messageLengthSize&f.blockLength-1;t.putBytes(n.substr(0,f.blockLength-a));for(var o=8*f.fullMessageLength[0],l=0;l<f.fullMessageLength.length-1;++l)o+=(i=8*f.fullMessageLength[l+1])/4294967296>>>0,t.putInt32(o>>>0),o=i>>>0;t.putInt32(o);var d=new Array(r.length);for(l=0;l<r.length;++l)d[l]=r[l].slice(0);s(d,u,t);var p,h=j.util.createBuffer();for(p="SHA-512"===e?d.length:"SHA-384"===e?d.length-2:d.length-4,l=0;l<p;++l)h.putInt32(d[l][0]),l===p-1&&"SHA-512/224"===e||h.putInt32(d[l][1]);return h},f};var n=null,i=!1,a=null,o=null;function s(e,t,r){for(var n,i,o,s,c,u,l,d,f,p,h,g,m,y,v,b,C,E,w,k,S,B,T,A,I,_,x,P,R,N,O,L,D,U=r.length();U>=128;){for(x=0;x<16;++x)t[x][0]=r.getInt32()>>>0,t[x][1]=r.getInt32()>>>0;for(;x<80;++x)n=(((P=(N=t[x-2])[0])>>>19|(R=N[1])<<13)^(R>>>29|P<<3)^P>>>6)>>>0,i=((P<<13|R>>>19)^(R<<3|P>>>29)^(P<<26|R>>>6))>>>0,o=(((P=(L=t[x-15])[0])>>>1|(R=L[1])<<31)^(P>>>8|R<<24)^P>>>7)>>>0,s=((P<<31|R>>>1)^(P<<24|R>>>8)^(P<<25|R>>>7))>>>0,O=t[x-7],D=t[x-16],R=i+O[1]+s+D[1],t[x][0]=n+O[0]+o+D[0]+(R/4294967296>>>0)>>>0,t[x][1]=R>>>0;for(h=e[0][0],g=e[0][1],m=e[1][0],y=e[1][1],v=e[2][0],b=e[2][1],C=e[3][0],E=e[3][1],w=e[4][0],k=e[4][1],S=e[5][0],B=e[5][1],T=e[6][0],A=e[6][1],I=e[7][0],_=e[7][1],x=0;x<80;++x)l=((w>>>14|k<<18)^(w>>>18|k<<14)^(k>>>9|w<<23))>>>0,d=(T^w&(S^T))>>>0,c=((h>>>28|g<<4)^(g>>>2|h<<30)^(g>>>7|h<<25))>>>0,u=((h<<4|g>>>28)^(g<<30|h>>>2)^(g<<25|h>>>7))>>>0,f=(h&m|v&(h^m))>>>0,p=(g&y|b&(g^y))>>>0,R=_+(((w<<18|k>>>14)^(w<<14|k>>>18)^(k<<23|w>>>9))>>>0)+((A^k&(B^A))>>>0)+a[x][1]+t[x][1],n=I+l+d+a[x][0]+t[x][0]+(R/4294967296>>>0)>>>0,i=R>>>0,o=c+f+((R=u+p)/4294967296>>>0)>>>0,s=R>>>0,I=T,_=A,T=S,A=B,S=w,B=k,w=C+n+((R=E+i)/4294967296>>>0)>>>0,k=R>>>0,C=v,E=b,v=m,b=y,m=h,y=g,h=n+o+((R=i+s)/4294967296>>>0)>>>0,g=R>>>0;R=e[0][1]+g,e[0][0]=e[0][0]+h+(R/4294967296>>>0)>>>0,e[0][1]=R>>>0,R=e[1][1]+y,e[1][0]=e[1][0]+m+(R/4294967296>>>0)>>>0,e[1][1]=R>>>0,R=e[2][1]+b,e[2][0]=e[2][0]+v+(R/4294967296>>>0)>>>0,e[2][1]=R>>>0,R=e[3][1]+E,e[3][0]=e[3][0]+C+(R/4294967296>>>0)>>>0,e[3][1]=R>>>0,R=e[4][1]+k,e[4][0]=e[4][0]+w+(R/4294967296>>>0)>>>0,e[4][1]=R>>>0,R=e[5][1]+B,e[5][0]=e[5][0]+S+(R/4294967296>>>0)>>>0,e[5][1]=R>>>0,R=e[6][1]+A,e[6][0]=e[6][0]+T+(R/4294967296>>>0)>>>0,e[6][1]=R>>>0,R=e[7][1]+_,e[7][0]=e[7][0]+I+(R/4294967296>>>0)>>>0,e[7][1]=R>>>0,U-=128}}}));var sr=j.asn1,cr={privateKeyValidator:{name:"PrivateKeyInfo",tagClass:sr.Class.UNIVERSAL,type:sr.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:sr.Class.UNIVERSAL,type:sr.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:sr.Class.UNIVERSAL,type:sr.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:sr.Class.UNIVERSAL,type:sr.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:sr.Class.UNIVERSAL,type:sr.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},publicKeyValidator:{name:"SubjectPublicKeyInfo",tagClass:sr.Class.UNIVERSAL,type:sr.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:sr.Class.UNIVERSAL,type:sr.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:sr.Class.UNIVERSAL,type:sr.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:sr.Class.UNIVERSAL,type:sr.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}},ur=cr.publicKeyValidator,lr=cr.privateKeyValidator;if(void 0===dr)var dr=j.jsbn.BigInteger;var fr=j.util.ByteBuffer,pr="undefined"==typeof Buffer?Uint8Array:Buffer;j.pki=j.pki||{},j.pki.ed25519=j.ed25519=j.ed25519||{};var hr=j.ed25519;function gr(e){var t=e.message;if(t instanceof Uint8Array||t instanceof pr)return t;var r=e.encoding;if(void 0===t){if(!e.md)throw new TypeError('"options.message" or "options.md" not specified.');t=e.md.digest().getBytes(),r="binary"}if("string"==typeof t&&!r)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if("string"==typeof t){if("undefined"!=typeof Buffer)return Buffer.from(t,r);t=new fr(t,r)}else if(!(t instanceof fr))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var n=new pr(t.length()),i=0;i<n.length;++i)n[i]=t.at(i);return n}hr.constants={},hr.constants.PUBLIC_KEY_BYTE_LENGTH=32,hr.constants.PRIVATE_KEY_BYTE_LENGTH=64,hr.constants.SEED_BYTE_LENGTH=32,hr.constants.SIGN_BYTE_LENGTH=64,hr.constants.HASH_BYTE_LENGTH=64,hr.generateKeyPair=function(e){var t=(e=e||{}).seed;if(void 0===t)t=j.random.getBytesSync(hr.constants.SEED_BYTE_LENGTH);else if("string"==typeof t){if(t.length!==hr.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+hr.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');t=gr({message:t,encoding:"binary"});for(var r=new pr(hr.constants.PUBLIC_KEY_BYTE_LENGTH),n=new pr(hr.constants.PRIVATE_KEY_BYTE_LENGTH),i=0;i<32;++i)n[i]=t[i];return function(e,t){var r,n=[Vr(),Vr(),Vr(),Vr()],i=Sr(t,32);for(i[0]&=248,i[31]&=127,i[31]|=64,Lr(n,i),_r(e,n),r=0;r<32;++r)t[r+32]=e[r]}(r,n),{publicKey:r,privateKey:n}},hr.privateKeyFromAsn1=function(e){var t={},r=[];if(!j.asn1.validate(e,lr,t,r)){var n=new Error("Invalid Key.");throw n.errors=r,n}var i=j.asn1.derToOid(t.privateKeyOid),a=j.oids.EdDSA25519;if(i!==a)throw new Error('Invalid OID "'+i+'"; OID must be "'+a+'".');var o=t.privateKey;return{privateKeyBytes:gr({message:j.asn1.fromDer(o).value,encoding:"binary"})}},hr.publicKeyFromAsn1=function(e){var t={},r=[];if(!j.asn1.validate(e,ur,t,r)){var n=new Error("Invalid Key.");throw n.errors=r,n}var i=j.asn1.derToOid(t.publicKeyOid),a=j.oids.EdDSA25519;if(i!==a)throw new Error('Invalid OID "'+i+'"; OID must be "'+a+'".');var o=t.ed25519PublicKey;if(o.length!==hr.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return gr({message:o,encoding:"binary"})},hr.publicKeyFromPrivateKey=function(e){var t=gr({message:(e=e||{}).privateKey,encoding:"binary"});if(t.length!==hr.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+hr.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new pr(hr.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n<r.length;++n)r[n]=t[32+n];return r},hr.sign=function(e){var t=gr(e=e||{}),r=gr({message:e.privateKey,encoding:"binary"});if(r.length===hr.constants.SEED_BYTE_LENGTH)r=hr.generateKeyPair({seed:r}).privateKey;else if(r.length!==hr.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+hr.constants.SEED_BYTE_LENGTH+" or "+hr.constants.PRIVATE_KEY_BYTE_LENGTH);var n=new pr(hr.constants.SIGN_BYTE_LENGTH+t.length);!function(e,t,r,n){var i,a,o=new Float64Array(64),s=[Vr(),Vr(),Vr(),Vr()],c=Sr(n,32);for(c[0]&=248,c[31]&=127,c[31]|=64,i=0;i<r;++i)e[64+i]=t[i];for(i=0;i<32;++i)e[32+i]=c[32+i];var u=Sr(e.subarray(32),r+32);for(Tr(u),Lr(s,u),_r(e,s),i=32;i<64;++i)e[i]=n[i];var l=Sr(e,r+64);for(Tr(l),i=32;i<64;++i)o[i]=0;for(i=0;i<32;++i)o[i]=u[i];for(i=0;i<32;++i)for(a=0;a<32;a++)o[i+a]+=l[i]*c[a];Br(e.subarray(32),o)}(n,t,t.length,r);for(var i=new pr(hr.constants.SIGN_BYTE_LENGTH),a=0;a<i.length;++a)i[a]=n[a];return i},hr.verify=function(e){var t=gr(e=e||{});if(void 0===e.signature)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var r=gr({message:e.signature,encoding:"binary"});if(r.length!==hr.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+hr.constants.SIGN_BYTE_LENGTH);var n=gr({message:e.publicKey,encoding:"binary"});if(n.length!==hr.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+hr.constants.PUBLIC_KEY_BYTE_LENGTH);var i,a=new pr(hr.constants.SIGN_BYTE_LENGTH+t.length),o=new pr(hr.constants.SIGN_BYTE_LENGTH+t.length);for(i=0;i<hr.constants.SIGN_BYTE_LENGTH;++i)a[i]=r[i];for(i=0;i<t.length;++i)a[i+hr.constants.SIGN_BYTE_LENGTH]=t[i];return function(e,t,r,n){var i,a=new pr(32),o=[Vr(),Vr(),Vr(),Vr()],s=[Vr(),Vr(),Vr(),Vr()];if(r<64)return-1;if(function(e,t){var r=Vr(),n=Vr(),i=Vr(),a=Vr(),o=Vr(),s=Vr(),c=Vr();return Dr(e[2],yr),function(e,t){var r;for(r=0;r<16;++r)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}(e[1],t),zr(i,e[1]),Kr(a,i,vr),Fr(i,i,e[2]),jr(a,e[2],a),zr(o,a),zr(s,o),Kr(c,s,o),Kr(r,c,i),Kr(r,r,a),function(e,t){var r,n=Vr();for(r=0;r<16;++r)n[r]=t[r];for(r=250;r>=0;--r)zr(n,n),1!==r&&Kr(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}(r,r),Kr(r,r,i),Kr(r,r,a),Kr(r,r,a),Kr(e[0],r,a),zr(n,e[0]),Kr(n,n,a),Pr(n,i)&&Kr(e[0],e[0],kr),zr(n,e[0]),Kr(n,n,a),Pr(n,i)?-1:(Nr(e[0])===t[31]>>7&&Fr(e[0],mr,e[0]),Kr(e[3],e[0],e[1]),0)}(s,n))return-1;for(i=0;i<r;++i)e[i]=t[i];for(i=0;i<32;++i)e[i+32]=n[i];var c=Sr(e,r);if(Tr(c),Or(o,s,c),Lr(s,t.subarray(32)),Ar(o,s),_r(a,o),r-=64,Rr(t,0,a,0)){for(i=0;i<r;++i)e[i]=0;return-1}for(i=0;i<r;++i)e[i]=t[i+64];return r}(o,a,a.length,n)>=0};var mr=Vr(),yr=Vr([1]),vr=Vr([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),br=Vr([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),Cr=Vr([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),Er=Vr([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),wr=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),kr=Vr([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Sr(e,t){var r=j.md.sha512.create(),n=new fr(e);r.update(n.getBytes(t),"binary");var i=r.digest().getBytes();if("undefined"!=typeof Buffer)return Buffer.from(i,"binary");for(var a=new pr(hr.constants.HASH_BYTE_LENGTH),o=0;o<64;++o)a[o]=i.charCodeAt(o);return a}function Br(e,t){var r,n,i,a;for(n=63;n>=32;--n){for(r=0,i=n-32,a=n-12;i<a;++i)t[i]+=r-16*t[n]*wr[i-(n-32)],r=t[i]+128>>8,t[i]-=256*r;t[i]+=r,t[n]=0}for(r=0,i=0;i<32;++i)t[i]+=r-(t[31]>>4)*wr[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;++i)t[i]-=r*wr[i];for(n=0;n<32;++n)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function Tr(e){for(var t=new Float64Array(64),r=0;r<64;++r)t[r]=e[r],e[r]=0;Br(e,t)}function Ar(e,t){var r=Vr(),n=Vr(),i=Vr(),a=Vr(),o=Vr(),s=Vr(),c=Vr(),u=Vr(),l=Vr();Fr(r,e[1],e[0]),Fr(l,t[1],t[0]),Kr(r,r,l),jr(n,e[0],e[1]),jr(l,t[0],t[1]),Kr(n,n,l),Kr(i,e[3],t[3]),Kr(i,i,br),Kr(a,e[2],t[2]),jr(a,a,a),Fr(o,n,r),Fr(s,a,i),jr(c,a,i),jr(u,n,r),Kr(e[0],o,s),Kr(e[1],u,c),Kr(e[2],c,s),Kr(e[3],o,u)}function Ir(e,t,r){for(var n=0;n<4;++n)Mr(e[n],t[n],r)}function _r(e,t){var r=Vr(),n=Vr(),i=Vr();!function(e,t){var r,n=Vr();for(r=0;r<16;++r)n[r]=t[r];for(r=253;r>=0;--r)zr(n,n),2!==r&&4!==r&&Kr(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}(i,t[2]),Kr(r,t[0],i),Kr(n,t[1],i),xr(e,n),e[31]^=Nr(r)<<7}function xr(e,t){var r,n,i,a=Vr(),o=Vr();for(r=0;r<16;++r)o[r]=t[r];for(Ur(o),Ur(o),Ur(o),n=0;n<2;++n){for(a[0]=o[0]-65517,r=1;r<15;++r)a[r]=o[r]-65535-(a[r-1]>>16&1),a[r-1]&=65535;a[15]=o[15]-32767-(a[14]>>16&1),i=a[15]>>16&1,a[14]&=65535,Mr(o,a,1-i)}for(r=0;r<16;r++)e[2*r]=255&o[r],e[2*r+1]=o[r]>>8}function Pr(e,t){var r=new pr(32),n=new pr(32);return xr(r,e),xr(n,t),Rr(r,0,n,0)}function Rr(e,t,r,n){return function(e,t,r,n,i){var a,o=0;for(a=0;a<32;++a)o|=e[t+a]^r[n+a];return(1&o-1>>>8)-1}(e,t,r,n)}function Nr(e){var t=new pr(32);return xr(t,e),1&t[0]}function Or(e,t,r){var n,i;for(Dr(e[0],mr),Dr(e[1],yr),Dr(e[2],yr),Dr(e[3],mr),i=255;i>=0;--i)Ir(e,t,n=r[i/8|0]>>(7&i)&1),Ar(t,e),Ar(e,e),Ir(e,t,n)}function Lr(e,t){var r=[Vr(),Vr(),Vr(),Vr()];Dr(r[0],Cr),Dr(r[1],Er),Dr(r[2],yr),Kr(r[3],Cr,Er),Or(e,r,t)}function Dr(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function Ur(e){var t,r,n=1;for(t=0;t<16;++t)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function Mr(e,t,r){for(var n,i=~(r-1),a=0;a<16;++a)n=i&(e[a]^t[a]),e[a]^=n,t[a]^=n}function Vr(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;++t)r[t]=e[t];return r}function jr(e,t,r){for(var n=0;n<16;++n)e[n]=t[n]+r[n]}function Fr(e,t,r){for(var n=0;n<16;++n)e[n]=t[n]-r[n]}function zr(e,t){Kr(e,t,t)}function Kr(e,t,r){var n,i,a=0,o=0,s=0,c=0,u=0,l=0,d=0,f=0,p=0,h=0,g=0,m=0,y=0,v=0,b=0,C=0,E=0,w=0,k=0,S=0,B=0,T=0,A=0,I=0,_=0,x=0,P=0,R=0,N=0,O=0,L=0,D=r[0],U=r[1],M=r[2],V=r[3],j=r[4],F=r[5],z=r[6],K=r[7],q=r[8],H=r[9],Q=r[10],G=r[11],W=r[12],X=r[13],Y=r[14],$=r[15];a+=(n=t[0])*D,o+=n*U,s+=n*M,c+=n*V,u+=n*j,l+=n*F,d+=n*z,f+=n*K,p+=n*q,h+=n*H,g+=n*Q,m+=n*G,y+=n*W,v+=n*X,b+=n*Y,C+=n*$,o+=(n=t[1])*D,s+=n*U,c+=n*M,u+=n*V,l+=n*j,d+=n*F,f+=n*z,p+=n*K,h+=n*q,g+=n*H,m+=n*Q,y+=n*G,v+=n*W,b+=n*X,C+=n*Y,E+=n*$,s+=(n=t[2])*D,c+=n*U,u+=n*M,l+=n*V,d+=n*j,f+=n*F,p+=n*z,h+=n*K,g+=n*q,m+=n*H,y+=n*Q,v+=n*G,b+=n*W,C+=n*X,E+=n*Y,w+=n*$,c+=(n=t[3])*D,u+=n*U,l+=n*M,d+=n*V,f+=n*j,p+=n*F,h+=n*z,g+=n*K,m+=n*q,y+=n*H,v+=n*Q,b+=n*G,C+=n*W,E+=n*X,w+=n*Y,k+=n*$,u+=(n=t[4])*D,l+=n*U,d+=n*M,f+=n*V,p+=n*j,h+=n*F,g+=n*z,m+=n*K,y+=n*q,v+=n*H,b+=n*Q,C+=n*G,E+=n*W,w+=n*X,k+=n*Y,S+=n*$,l+=(n=t[5])*D,d+=n*U,f+=n*M,p+=n*V,h+=n*j,g+=n*F,m+=n*z,y+=n*K,v+=n*q,b+=n*H,C+=n*Q,E+=n*G,w+=n*W,k+=n*X,S+=n*Y,B+=n*$,d+=(n=t[6])*D,f+=n*U,p+=n*M,h+=n*V,g+=n*j,m+=n*F,y+=n*z,v+=n*K,b+=n*q,C+=n*H,E+=n*Q,w+=n*G,k+=n*W,S+=n*X,B+=n*Y,T+=n*$,f+=(n=t[7])*D,p+=n*U,h+=n*M,g+=n*V,m+=n*j,y+=n*F,v+=n*z,b+=n*K,C+=n*q,E+=n*H,w+=n*Q,k+=n*G,S+=n*W,B+=n*X,T+=n*Y,A+=n*$,p+=(n=t[8])*D,h+=n*U,g+=n*M,m+=n*V,y+=n*j,v+=n*F,b+=n*z,C+=n*K,E+=n*q,w+=n*H,k+=n*Q,S+=n*G,B+=n*W,T+=n*X,A+=n*Y,I+=n*$,h+=(n=t[9])*D,g+=n*U,m+=n*M,y+=n*V,v+=n*j,b+=n*F,C+=n*z,E+=n*K,w+=n*q,k+=n*H,S+=n*Q,B+=n*G,T+=n*W,A+=n*X,I+=n*Y,_+=n*$,g+=(n=t[10])*D,m+=n*U,y+=n*M,v+=n*V,b+=n*j,C+=n*F,E+=n*z,w+=n*K,k+=n*q,S+=n*H,B+=n*Q,T+=n*G,A+=n*W,I+=n*X,_+=n*Y,x+=n*$,m+=(n=t[11])*D,y+=n*U,v+=n*M,b+=n*V,C+=n*j,E+=n*F,w+=n*z,k+=n*K,S+=n*q,B+=n*H,T+=n*Q,A+=n*G,I+=n*W,_+=n*X,x+=n*Y,P+=n*$,y+=(n=t[12])*D,v+=n*U,b+=n*M,C+=n*V,E+=n*j,w+=n*F,k+=n*z,S+=n*K,B+=n*q,T+=n*H,A+=n*Q,I+=n*G,_+=n*W,x+=n*X,P+=n*Y,R+=n*$,v+=(n=t[13])*D,b+=n*U,C+=n*M,E+=n*V,w+=n*j,k+=n*F,S+=n*z,B+=n*K,T+=n*q,A+=n*H,I+=n*Q,_+=n*G,x+=n*W,P+=n*X,R+=n*Y,N+=n*$,b+=(n=t[14])*D,C+=n*U,E+=n*M,w+=n*V,k+=n*j,S+=n*F,B+=n*z,T+=n*K,A+=n*q,I+=n*H,_+=n*Q,x+=n*G,P+=n*W,R+=n*X,N+=n*Y,O+=n*$,C+=(n=t[15])*D,o+=38*(w+=n*M),s+=38*(k+=n*V),c+=38*(S+=n*j),u+=38*(B+=n*F),l+=38*(T+=n*z),d+=38*(A+=n*K),f+=38*(I+=n*q),p+=38*(_+=n*H),h+=38*(x+=n*Q),g+=38*(P+=n*G),m+=38*(R+=n*W),y+=38*(N+=n*X),v+=38*(O+=n*Y),b+=38*(L+=n*$),a=(n=(a+=38*(E+=n*U))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),C=(n=C+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=(a+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),C=(n=C+i+65535)-65536*(i=Math.floor(n/65536)),a+=i-1+37*(i-1),e[0]=a,e[1]=o,e[2]=s,e[3]=c,e[4]=u,e[5]=l,e[6]=d,e[7]=f,e[8]=p,e[9]=h,e[10]=g,e[11]=m,e[12]=y,e[13]=v,e[14]=b,e[15]=C}j.kem=j.kem||{};var qr=j.jsbn.BigInteger;function Hr(e,t,r,n){e.generate=function(e,i){for(var a=new j.util.ByteBuffer,o=Math.ceil(i/n)+r,s=new j.util.ByteBuffer,c=r;c<o;++c){s.putInt32(c),t.start(),t.update(e+s.getBytes());var u=t.digest();a.putBytes(u.getBytes(n))}return a.truncate(a.length()-i),a.getBytes()}}j.kem.rsa={},j.kem.rsa.create=function(e,t){var r=(t=t||{}).prng||j.random;return{encrypt:function(t,n){var i,a=Math.ceil(t.n.bitLength()/8);do{i=new qr(j.util.bytesToHex(r.getBytesSync(a)),16).mod(t.n)}while(i.compareTo(qr.ONE)<=0);var o=a-(i=j.util.hexToBytes(i.toString(16))).length;return o>0&&(i=j.util.fillString(String.fromCharCode(0),o)+i),{encapsulation:t.encrypt(i,"NONE"),key:e.generate(i,n)}},decrypt:function(t,r,n){var i=t.decrypt(r,"NONE");return e.generate(i,n)}}},j.kem.kdf1=function(e,t){Hr(this,e,0,t||e.digestLength)},j.kem.kdf2=function(e,t){Hr(this,e,1,t||e.digestLength)},j.log=j.log||{},j.log.levels=["none","error","warning","info","debug","verbose","max"];var Qr={},Gr=[],Wr=null;j.log.LEVEL_LOCKED=2,j.log.NO_LEVEL_CHECK=4,j.log.INTERPOLATE=8;for(var Xr=0;Xr<j.log.levels.length;++Xr){var Yr=j.log.levels[Xr];Qr[Yr]={index:Xr,name:Yr.toUpperCase()}}j.log.logMessage=function(e){for(var t=Qr[e.level].index,r=0;r<Gr.length;++r){var n=Gr[r];n.flags&j.log.NO_LEVEL_CHECK?n.f(e):t<=Qr[n.level].index&&n.f(n,e)}},j.log.prepareStandard=function(e){"standard"in e||(e.standard=Qr[e.level].name+" ["+e.category+"] "+e.message)},j.log.prepareFull=function(e){if(!("full"in e)){var t=[e.message];t=t.concat([]||e.arguments),e.full=j.util.format.apply(this,t)}},j.log.prepareStandardFull=function(e){"standardFull"in e||(j.log.prepareStandard(e),e.standardFull=e.standard)};var $r=["error","warning","info","debug","verbose"];for(Xr=0;Xr<$r.length;++Xr)!function(e){j.log[e]=function(t,r){var n=Array.prototype.slice.call(arguments).slice(2),i={timestamp:new Date,level:e,category:t,message:r,arguments:n};j.log.logMessage(i)}}($r[Xr]);if(j.log.makeLogger=function(e){var t={flags:0,f:e};return j.log.setLevel(t,"none"),t},j.log.setLevel=function(e,t){var r=!1;if(e&&!(e.flags&j.log.LEVEL_LOCKED))for(var n=0;n<j.log.levels.length;++n)if(t==j.log.levels[n]){e.level=t,r=!0;break}return r},j.log.lock=function(e,t){void 0===t||t?e.flags|=j.log.LEVEL_LOCKED:e.flags&=~j.log.LEVEL_LOCKED},j.log.addLogger=function(e){Gr.push(e)},"undefined"!=typeof console&&"log"in console){var Zr;if(console.error&&console.warn&&console.info&&console.debug){var Jr={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},en=function(e,t){j.log.prepareStandard(t);var r=Jr[t.level],n=[t.standard];n=n.concat(t.arguments.slice()),r.apply(console,n)};Zr=j.log.makeLogger(en)}else en=function(e,t){j.log.prepareStandardFull(t),console.log(t.standardFull)},Zr=j.log.makeLogger(en);j.log.setLevel(Zr,"debug"),j.log.addLogger(Zr),Wr=Zr}else console={log:function(){}};if(null!==Wr){var tn=j.util.getQueryVariables();"console.level"in tn&&j.log.setLevel(Wr,tn["console.level"].slice(-1)[0]),"console.lock"in tn&&"true"==tn["console.lock"].slice(-1)[0]&&j.log.lock(Wr)}j.log.consoleLogger=Wr,C((function(e){var t=j.asn1,r=e.exports=j.pkcs7=j.pkcs7||{};function n(e){var n={},i=[];if(!t.validate(e,r.asn1.recipientInfoValidator,n,i)){var a=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw a.errors=i,a}return{version:n.version.charCodeAt(0),issuer:j.pki.RDNAttributesAsArray(n.issuer),serialNumber:j.util.createBuffer(n.serial).toHex(),encryptedContent:{algorithm:t.derToOid(n.encAlgorithm),parameter:n.encParameter.value,content:n.encKey}}}function i(e){for(var r,n=[],i=0;i<e.length;++i)n.push((r=e[i],t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(r.version).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[j.pki.distinguishedNameToAsn1({attributes:r.issuer}),t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,j.util.hexToBytes(r.serialNumber))]),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.encryptedContent.algorithm).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")]),t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,r.encryptedContent.content)])));return n}function a(e){var r=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(e.version).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[j.pki.distinguishedNameToAsn1({attributes:e.issuer}),t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,j.util.hexToBytes(e.serialNumber))]),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.digestAlgorithm).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&r.value.push(e.authenticatedAttributesAsn1),r.value.push(t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.signatureAlgorithm).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")])),r.value.push(t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var n=t.create(t.Class.CONTEXT_SPECIFIC,1,!0,[]),i=0;i<e.unauthenticatedAttributes.length;++i){var a=e.unauthenticatedAttributes[i];n.values.push(o(a))}r.value.push(n)}return r}function o(e){var r;if(e.type===j.pki.oids.contentType)r=t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.value).getBytes());else if(e.type===j.pki.oids.messageDigest)r=t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===j.pki.oids.signingTime){var n=new Date("1950-01-01T00:00:00Z"),i=new Date("2050-01-01T00:00:00Z"),a=e.value;if("string"==typeof a){var o=Date.parse(a);a=isNaN(o)?13===a.length?t.utcTimeToDate(a):t.generalizedTimeToDate(a):new Date(o)}r=a>=n&&a<i?t.create(t.Class.UNIVERSAL,t.Type.UTCTIME,!1,t.dateToUtcTime(a)):t.create(t.Class.UNIVERSAL,t.Type.GENERALIZEDTIME,!1,t.dateToGeneralizedTime(a))}return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.type).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[r])])}function s(e,r,n){var i={};if(!t.validate(r,n,i,[])){var a=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw a.errors=a,a}if(t.derToOid(i.contentType)!==j.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(i.encryptedContent){var o="";if(j.util.isArray(i.encryptedContent))for(var s=0;s<i.encryptedContent.length;++s){if(i.encryptedContent[s].type!==t.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");o+=i.encryptedContent[s].value}else o=i.encryptedContent;e.encryptedContent={algorithm:t.derToOid(i.encAlgorithm),parameter:j.util.createBuffer(i.encParameter.value),content:j.util.createBuffer(o)}}if(i.content){if(o="",j.util.isArray(i.content))for(s=0;s<i.content.length;++s){if(i.content[s].type!==t.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");o+=i.content[s].value}else o=i.content;e.content=j.util.createBuffer(o)}return e.version=i.version.charCodeAt(0),e.rawCapture=i,i}function c(e){if(void 0===e.encryptedContent.key)throw new Error("Symmetric key not available.");if(void 0===e.content){var t;switch(e.encryptedContent.algorithm){case j.pki.oids["aes128-CBC"]:case j.pki.oids["aes192-CBC"]:case j.pki.oids["aes256-CBC"]:t=j.aes.createDecryptionCipher(e.encryptedContent.key);break;case j.pki.oids.desCBC:case j.pki.oids["des-EDE3-CBC"]:t=j.des.createDecryptionCipher(e.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+e.encryptedContent.algorithm)}if(t.start(e.encryptedContent.parameter),t.update(e.encryptedContent.content),!t.finish())throw new Error("Symmetric decryption failed.");e.content=t.output}}r.messageFromPem=function(e){var n=j.pem.decode(e)[0];if("PKCS7"!==n.type){var i=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw i.headerType=n.type,i}if(n.procType&&"ENCRYPTED"===n.procType.type)throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var a=t.fromDer(n.body);return r.messageFromAsn1(a)},r.messageToPem=function(e,r){var n={type:"PKCS7",body:t.toDer(e.toAsn1()).getBytes()};return j.pem.encode(n,{maxline:r})},r.messageFromAsn1=function(e){var n={},i=[];if(!t.validate(e,r.asn1.contentInfoValidator,n,i)){var a=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw a.errors=i,a}var o,s=t.derToOid(n.contentType);switch(s){case j.pki.oids.envelopedData:o=r.createEnvelopedData();break;case j.pki.oids.encryptedData:o=r.createEncryptedData();break;case j.pki.oids.signedData:o=r.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+s+" is not (yet) supported.")}return o.fromAsn1(n.content.value[0]),o},r.createSignedData=function(){var e=null;return e={type:j.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(t){if(s(e,t,r.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var n=e.rawCapture.certificates.value,i=0;i<n.length;++i)e.certificates.push(j.pki.certificateFromAsn1(n[i]))},toAsn1:function(){e.contentInfo||e.sign();for(var r=[],n=0;n<e.certificates.length;++n)r.push(j.pki.certificateToAsn1(e.certificates[n]));var i=[],a=t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(e.version).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return r.length>0&&a.value[0].value.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!0,r)),i.length>0&&a.value[0].value.push(t.create(t.Class.CONTEXT_SPECIFIC,1,!0,i)),a.value[0].value.push(t.create(t.Class.UNIVERSAL,t.Type.SET,!0,e.signerInfos)),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.type).getBytes()),a])},addSigner:function(t){var r=t.issuer,n=t.serialNumber;if(t.certificate){var i=t.certificate;"string"==typeof i&&(i=j.pki.certificateFromPem(i)),r=i.issuer.attributes,n=i.serialNumber}var a=t.key;if(!a)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof a&&(a=j.pki.privateKeyFromPem(a));var o=t.digestAlgorithm||j.pki.oids.sha1;switch(o){case j.pki.oids.sha1:case j.pki.oids.sha256:case j.pki.oids.sha384:case j.pki.oids.sha512:case j.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+o)}var s=t.authenticatedAttributes||[];if(s.length>0){for(var c=!1,u=!1,l=0;l<s.length;++l){var d=s[l];if(c||d.type!==j.pki.oids.contentType){if(u||d.type!==j.pki.oids.messageDigest);else if(u=!0,c)break}else if(c=!0,u)break}if(!c||!u)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}e.signers.push({key:a,version:1,issuer:r,serialNumber:n,digestAlgorithm:o,signatureAlgorithm:j.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:s,unauthenticatedAttributes:[]})},sign:function(r){var n;r=r||{},("object"!=Iv(e.content)||null===e.contentInfo)&&(e.contentInfo=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(j.pki.oids.data).getBytes())]),"content"in e&&(e.content instanceof j.util.ByteBuffer?n=e.content.bytes():"string"==typeof e.content&&(n=j.util.encodeUtf8(e.content)),r.detached?e.detachedContent=t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,n):e.contentInfo.value.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,n)])))),0!==e.signers.length&&function(r){var n;if(!(n=e.detachedContent?e.detachedContent:(n=e.contentInfo.value[1]).value[0]))throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var i=t.derToOid(e.contentInfo.value[0].value),s=t.toDer(n);for(var c in s.getByte(),t.getBerValueLength(s),s=s.getBytes(),r)r[c].start().update(s);for(var u=new Date,l=0;l<e.signers.length;++l){var d=e.signers[l];if(0===d.authenticatedAttributes.length){if(i!==j.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{d.authenticatedAttributesAsn1=t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var f=t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[]),p=0;p<d.authenticatedAttributes.length;++p){var h=d.authenticatedAttributes[p];h.type===j.pki.oids.messageDigest?h.value=r[d.digestAlgorithm].digest():h.type===j.pki.oids.signingTime&&(h.value||(h.value=u)),f.value.push(o(h)),d.authenticatedAttributesAsn1.value.push(o(h))}s=t.toDer(f).getBytes(),d.md.start().update(s)}d.signature=d.key.sign(d.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=function(e){for(var t=[],r=0;r<e.length;++r)t.push(a(e[r]));return t}(e.signers)}(function(){for(var r={},n=0;n<e.signers.length;++n){var i=e.signers[n];(a=i.digestAlgorithm)in r||(r[a]=j.md[j.pki.oids[a]].create()),0===i.authenticatedAttributes.length?i.md=r[a]:i.md=j.md[j.pki.oids[a]].create()}for(var a in e.digestAlgorithmIdentifiers=[],r)e.digestAlgorithmIdentifiers.push(t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(a).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")]));return r}())},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(t){"string"==typeof t&&(t=j.pki.certificateFromPem(t)),e.certificates.push(t)},addCertificateRevokationList:function(e){throw new Error("PKCS#7 CRL support not yet implemented.")}}},r.createEncryptedData=function(){var e=null;return e={type:j.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:j.pki.oids["aes256-CBC"]},fromAsn1:function(t){s(e,t,r.asn1.encryptedDataValidator)},decrypt:function(t){void 0!==t&&(e.encryptedContent.key=t),c(e)}}},r.createEnvelopedData=function(){var e=null;return e={type:j.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:j.pki.oids["aes256-CBC"]},fromAsn1:function(t){var i=s(e,t,r.asn1.envelopedDataValidator);e.recipients=function(e){for(var t=[],r=0;r<e.length;++r)t.push(n(e[r]));return t}(i.recipientInfos.value)},toAsn1:function(){return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.type).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(e.version).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,i(e.recipients)),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,(r=e.encryptedContent,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(j.pki.oids.data).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.algorithm).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,r.parameter.getBytes())]),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,r.content.getBytes())])]))])])]);var r},findRecipient:function(t){for(var r=t.issuer.attributes,n=0;n<e.recipients.length;++n){var i=e.recipients[n],a=i.issuer;if(i.serialNumber===t.serialNumber&&a.length===r.length){for(var o=!0,s=0;s<r.length;++s)if(a[s].type!==r[s].type||a[s].value!==r[s].value){o=!1;break}if(o)return i}}return null},decrypt:function(t,r){if(void 0===e.encryptedContent.key&&void 0!==t&&void 0!==r)switch(t.encryptedContent.algorithm){case j.pki.oids.rsaEncryption:case j.pki.oids.desCBC:var n=r.decrypt(t.encryptedContent.content);e.encryptedContent.key=j.util.createBuffer(n);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}c(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:j.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,r){if(void 0===e.encryptedContent.content){var n,i,a;switch(r=r||e.encryptedContent.algorithm,t=t||e.encryptedContent.key,r){case j.pki.oids["aes128-CBC"]:n=16,i=16,a=j.aes.createEncryptionCipher;break;case j.pki.oids["aes192-CBC"]:n=24,i=16,a=j.aes.createEncryptionCipher;break;case j.pki.oids["aes256-CBC"]:n=32,i=16,a=j.aes.createEncryptionCipher;break;case j.pki.oids["des-EDE3-CBC"]:n=24,i=8,a=j.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+r)}if(void 0===t)t=j.util.createBuffer(j.random.getBytes(n));else if(t.length()!=n)throw new Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+n+".");e.encryptedContent.algorithm=r,e.encryptedContent.key=t,e.encryptedContent.parameter=j.util.createBuffer(j.random.getBytes(i));var o=a(t);if(o.start(e.encryptedContent.parameter.copy()),o.update(e.content),!o.finish())throw new Error("Symmetric encryption failed.");e.encryptedContent.content=o.output}for(var s=0;s<e.recipients.length;++s){var c=e.recipients[s];if(void 0===c.encryptedContent.content)switch(c.encryptedContent.algorithm){case j.pki.oids.rsaEncryption:c.encryptedContent.content=c.encryptedContent.key.encrypt(e.encryptedContent.key.data);break;default:throw new Error("Unsupported asymmetric cipher, OID "+c.encryptedContent.algorithm)}}}}}})),C((function(e){var t=e.exports=j.ssh=j.ssh||{};function r(e,t){var r=t.toString(16);r[0]>="8"&&(r="00"+r);var n=j.util.hexToBytes(r);e.putInt32(n.length),e.putBytes(n)}function n(e,t){e.putInt32(t.length),e.putString(t)}function i(){for(var e=j.md.sha1.create(),t=arguments.length,r=0;r<t;++r)e.update(arguments[r]);return e.digest()}t.privateKeyToPutty=function(e,t,a){var o=""===(t=t||"")?"none":"aes256-cbc",s="PuTTY-User-Key-File-2: ssh-rsa\r\n";s+="Encryption: "+o+"\r\n",s+="Comment: "+(a=a||"")+"\r\n";var c=j.util.createBuffer();n(c,"ssh-rsa"),r(c,e.e),r(c,e.n);var u=j.util.encode64(c.bytes(),64),l=Math.floor(u.length/66)+1;s+="Public-Lines: "+l+"\r\n",s+=u;var d,f=j.util.createBuffer();if(r(f,e.d),r(f,e.p),r(f,e.q),r(f,e.qInv),t){var p=f.length()+16-1;p-=p%16;var h=i(f.bytes());h.truncate(h.length()-p+f.length()),f.putBuffer(h);var g=j.util.createBuffer();g.putBuffer(i("\0\0\0\0",t)),g.putBuffer(i("\0\0\0",t));var m=j.aes.createEncryptionCipher(g.truncate(8),"CBC");m.start(j.util.createBuffer().fillWithByte(0,16)),m.update(f.copy()),m.finish();var y=m.output;y.truncate(16),d=j.util.encode64(y.bytes(),64)}else d=j.util.encode64(f.bytes(),64);s+="\r\nPrivate-Lines: "+(l=Math.floor(d.length/66)+1)+"\r\n",s+=d;var v=i("putty-private-key-file-mac-key",t),b=j.util.createBuffer();n(b,"ssh-rsa"),n(b,o),n(b,a),b.putInt32(c.length()),b.putBuffer(c),b.putInt32(f.length()),b.putBuffer(f);var C=j.hmac.create();return C.start("sha1",v),C.update(b.bytes()),s+"\r\nPrivate-MAC: "+C.digest().toHex()+"\r\n"},t.publicKeyToOpenSSH=function(e,t){t=t||"";var i=j.util.createBuffer();return n(i,"ssh-rsa"),r(i,e.e),r(i,e.n),"ssh-rsa "+j.util.encode64(i.bytes())+" "+t},t.privateKeyToOpenSSH=function(e,t){return t?j.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):j.pki.privateKeyToPem(e)},t.getPublicKeyFingerprint=function(e,t){var i=(t=t||{}).md||j.md.md5.create(),a=j.util.createBuffer();n(a,"ssh-rsa"),r(a,e.e),r(a,e.n),i.start(),i.update(a.getBytes());var o=i.digest();if("hex"===t.encoding){var s=o.toHex();return t.delimiter?s.match(/.{2}/g).join(t.delimiter):s}if("binary"===t.encoding)return o.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".');return o}}));var rn="forge.task",nn={},an=0;j.debug.set(rn,"tasks",nn);var on={};j.debug.set(rn,"queues",on);var sn="ready",cn="running",un="blocked",ln="sleeping",dn="done",fn="error",pn={ready:{}};pn.ready.stop=sn,pn.ready.start=cn,pn.ready.cancel=dn,pn.ready.fail=fn,pn.running={},pn.running.stop=sn,pn.running.start=cn,pn.running.block=un,pn.running.unblock=cn,pn.running.sleep=ln,pn.running.wakeup=cn,pn.running.cancel=dn,pn.running.fail=fn,pn.blocked={},pn.blocked.stop=un,pn.blocked.start=un,pn.blocked.block=un,pn.blocked.unblock=un,pn.blocked.sleep=un,pn.blocked.wakeup=un,pn.blocked.cancel=dn,pn.blocked.fail=fn,pn.sleeping={},pn.sleeping.stop=ln,pn.sleeping.start=ln,pn.sleeping.block=ln,pn.sleeping.unblock=ln,pn.sleeping.sleep=ln,pn.sleeping.wakeup=ln,pn.sleeping.cancel=dn,pn.sleeping.fail=fn,pn.done={},pn.done.stop=dn,pn.done.start=dn,pn.done.block=dn,pn.done.unblock=dn,pn.done.sleep=dn,pn.done.wakeup=dn,pn.done.cancel=dn,pn.done.fail=fn,pn.error={},pn.error.stop=fn,pn.error.start=fn,pn.error.block=fn,pn.error.unblock=fn,pn.error.sleep=fn,pn.error.wakeup=fn,pn.error.cancel=fn,pn.error.fail=fn;var hn=function(e){this.id=-1,this.name=e.name||"?",this.parent=e.parent||null,this.run=e.run,this.subtasks=[],this.error=!1,this.state=sn,this.blocks=0,this.timeoutId=null,this.swapTime=null,this.userData=null,this.id=an++,nn[this.id]=this};hn.prototype.debug=function(e){e=e||"",j.log.debug(rn,e,"[%s][%s] task:",this.id,this.name,this,"subtasks:",this.subtasks.length,"queue:",on)},hn.prototype.next=function(e,t){"function"==typeof e&&(t=e,e=this.name);var r=new hn({run:t,name:e,parent:this});return r.state=cn,r.type=this.type,r.successCallback=this.successCallback||null,r.failureCallback=this.failureCallback||null,this.subtasks.push(r),this},hn.prototype.parallel=function(e,t){return j.util.isArray(e)&&(t=e,e=this.name),this.next(e,(function(r){var n=r;n.block(t.length);for(var i=function(e,r){j.task.start({type:e,run:function(e){t[r](e)},success:function(e){n.unblock()},failure:function(e){n.unblock()}})},a=0;a<t.length;a++)i(e+"__parallel-"+r.id+"-"+a,a)}))},hn.prototype.stop=function(){this.state=pn[this.state].stop},hn.prototype.start=function(){this.error=!1,this.state=pn[this.state].start,this.state===cn&&(this.start=new Date,this.run(this),gn(this,0))},hn.prototype.block=function(e){e=void 0===e?1:e,this.blocks+=e,this.blocks>0&&(this.state=pn[this.state].block)},hn.prototype.unblock=function(e){return e=void 0===e?1:e,this.blocks-=e,0===this.blocks&&this.state!==dn&&(this.state=cn,gn(this,0)),this.blocks},hn.prototype.sleep=function(e){e=void 0===e?0:e,this.state=pn[this.state].sleep;var t=this;this.timeoutId=setTimeout((function(){t.timeoutId=null,t.state=cn,gn(t,0)}),e)},hn.prototype.wait=function(e){e.wait(this)},hn.prototype.wakeup=function(){this.state===ln&&(cancelTimeout(this.timeoutId),this.timeoutId=null,this.state=cn,gn(this,0))},hn.prototype.cancel=function(){this.state=pn[this.state].cancel,this.permitsNeeded=0,null!==this.timeoutId&&(cancelTimeout(this.timeoutId),this.timeoutId=null),this.subtasks=[]},hn.prototype.fail=function(e){if(this.error=!0,mn(this,!0),e)e.error=this.error,e.swapTime=this.swapTime,e.userData=this.userData,gn(e,0);else{if(null!==this.parent){for(var t=this.parent;null!==t.parent;)t.error=this.error,t.swapTime=this.swapTime,t.userData=this.userData,t=t.parent;mn(t,!0)}this.failureCallback&&this.failureCallback(this)}};var gn=function e(t,r){var n=r>30||+new Date-t.swapTime>20,i=function(r){if(r++,t.state===cn)if(n&&(t.swapTime=+new Date),t.subtasks.length>0){var i=t.subtasks.shift();i.error=t.error,i.swapTime=t.swapTime,i.userData=t.userData,i.run(i),i.error||e(i,r)}else mn(t),t.error||null!==t.parent&&(t.parent.error=t.error,t.parent.swapTime=t.swapTime,t.parent.userData=t.userData,e(t.parent,r))};n?setTimeout(i,0):i(r)},mn=function(e,t){e.state=dn,delete nn[e.id],null===e.parent&&(e.type in on?0===on[e.type].length?j.log.error(rn,"[%s][%s] task queue empty [%s]",e.id,e.name,e.type):on[e.type][0]!==e?j.log.error(rn,"[%s][%s] task not first in queue [%s]",e.id,e.name,e.type):(on[e.type].shift(),0===on[e.type].length?delete on[e.type]:on[e.type][0].start()):j.log.error(rn,"[%s][%s] task queue missing [%s]",e.id,e.name,e.type),t||(e.error&&e.failureCallback?e.failureCallback(e):!e.error&&e.successCallback&&e.successCallback(e)))};j.task=j.task||{},j.task.start=function(e){var t=new hn({run:e.run,name:e.name||"?"});t.type=e.type,t.successCallback=e.success||null,t.failureCallback=e.failure||null,t.type in on?on[e.type].push(t):(on[t.type]=[t],function(e){e.error=!1,e.state=pn[e.state].start,setTimeout((function(){e.state===cn&&(e.swapTime=+new Date,e.run(e),gn(e,0))}),0)}(t))},j.task.cancel=function(e){e in on&&(on[e]=[on[e][0]])},j.task.createCondition=function(){var e={tasks:{},wait:function(t){t.id in e.tasks||(t.block(),e.tasks[t.id]=t)},notify:function(){var t=e.tasks;for(var r in e.tasks={},t)t[r].unblock()}};return e};var yn=j,vn=function(){function e(e){this.secretKey=e}return e.prototype.encrypt=function(e,t){throw new Error("Method not implemented.")},e.prototype.decrypt=function(e,t){return function(e,t,r){void 0===r&&(r=yn.util.createBuffer(Uint8Array.from([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]).buffer));var n,i,a=yn.cipher.createDecipher("AES-CBC",t);return a.start({iv:r}),a.update(yn.util.createBuffer(yn.util.hexToBytes(e))),i=(n=a.output.data).charCodeAt(n.length-1),n.slice(0,-i)}(e,(r=this.secretKey,n=t.transactionID,""+r.slice(0,16)+n.slice(0,16)));var r,n},e}(),bn=function(){function e(e,t,n,i){void 0===n&&(n="production"),void 0===i&&(i={supportTransaction:!1,enableEncryption:!1}),this.transactionEnabled=i.supportTransaction||!1,this.encryptionEnabled=i.enableEncryption||!1;var a=L(e,t,n,{headers:i.httpHeaders});this.transactionManager=new V(a),this.encryptionService=new vn(t),this.compareFaceService=new l(a),this.clientSettingsService=new d(a),this.convertPDFService=new y(a),this.ekycPDFService=new v(a),this.readIDCardService=new r(a),this.requestVerifyIDCardService=new p(a),this.requestVerifyPortraitSerivce=new h(a),this.imagesService=new c(a),this.fileService=new u(a),this.verifyFaceLivenessService=new f(a),this.searchFaceService=new m(a),this.detectIDTamperingService=new g(a),this.httpClient=a}return e.prototype.enableTransaction=function(){this.transactionEnabled=!0},e.prototype.disableTransaction=function(){this.transactionEnabled=!1},e.prototype.enableEncryption=function(){this.encryptionEnabled=!0},e.prototype.disableEncryption=function(){this.encryptionEnabled=!1},e.prototype.compareFaces=function(e,t){return this.compareFaceService.request(e,t)},e.prototype.clientSettings=function(){return this.clientSettingsService.request()},e.prototype.uploadImage=function(e){return this.imagesService.request(e)},e.prototype.uploadFile=function(e){return this.fileService.uploadFile(e)},e.prototype.convertPDF=function(e,t){return this.convertPDFService.request(e,t)},e.prototype.ekycPDF=function(e,t){return this.ekycPDFService.request(e,t)},e.prototype.readIDCard=function(e,t){return this.readIDCardService.request(e,t)},e.prototype.requestVerifyIDCard=function(e,t){return this.requestVerifyIDCardService.request(e,t)},e.prototype.requestVerifyPortrait=function(e,t){return this.requestVerifyPortraitSerivce.request(e,t)},e.prototype.verifyFaceLiveness=function(e,t){return this.verifyFaceLivenessService.request(e,t)},e.prototype.searchFaces=function(e,t){return this.searchFaceService.request(e,t)},e.prototype.deleteFaces=function(e,t){return this.searchFaceService.deleteFaces(e,t)},e.prototype.indexFaces=function(e,t){return this.searchFaceService.indexFaces(e,t)},e.prototype.downloadFaceImage=function(e){return this.searchFaceService.downloadFaceImage(e)},e.prototype.downloadImage=function(e){return this.imagesService.download(e)},e.prototype.updateMetadata=function(e,t){return this.imagesService.updateMetadata(e,t)},e.prototype.detectIDTampering=function(e,t){return this.detectIDTamperingService.request(e,t)},i([U({headerIndex:1}),M(),a("design:type",Function),a("design:paramtypes",[Object,Object]),a("design:returntype",Promise)],e.prototype,"compareFaces",null),i([U({headerIndex:1}),M(),a("design:type",Function),a("design:paramtypes",[Object,Object]),a("design:returntype",Promise)],e.prototype,"convertPDF",null),i([U({headerIndex:1}),M(),a("design:type",Function),a("design:paramtypes",[Object,Object]),a("design:returntype",Promise)],e.prototype,"readIDCard",null),i([U({headerIndex:1}),M(),a("design:type",Function),a("design:paramtypes",[Object,Object]),a("design:returntype",Promise)],e.prototype,"requestVerifyIDCard",null),i([U({headerIndex:1}),M(),a("design:type",Function),a("design:paramtypes",[Object,Object]),a("design:returntype",Promise)],e.prototype,"requestVerifyPortrait",null),i([U({headerIndex:1}),M(),a("design:type",Function),a("design:paramtypes",[Object,Object]),a("design:returntype",Promise)],e.prototype,"verifyFaceLiveness",null),i([U({headerIndex:1}),M(),a("design:type",Function),a("design:paramtypes",[Object,Object]),a("design:returntype",Promise)],e.prototype,"searchFaces",null),i([U({headerIndex:1}),M(),a("design:type",Function),a("design:paramtypes",[Object,Object]),a("design:returntype",Promise)],e.prototype,"deleteFaces",null),i([U({headerIndex:1}),M(),a("design:type",Function),a("design:paramtypes",[Object,Object]),a("design:returntype",Promise)],e.prototype,"indexFaces",null),i([U({headerIndex:1}),M(),a("design:type",Function),a("design:paramtypes",[Object,Object]),a("design:returntype",Promise)],e.prototype,"detectIDTampering",null),e}();e.ReadIDCard=r,e.UploadImage=c,e.UploadFile=u,e.CompareFaces=l,e.ClientSettings=d,e.VerifyFaceLiveness=f,e.RequestVerifyIDCard=p,e.RequestVerifyPortrait=h,e.DetectIDTampering=g,e.SearchFaces=m,e.ConvertPDF=y,e.EkycPDF=v,e.HttpClient=I,e.MockClient=_,e.TVAuthorizer=N,e.createHelpers=function(e,t,r){void 0===r&&(r="production");var n=new N(e,t),i=function(e){switch(e){case"testing":return"https://tv-testing.trustingsocial.com/api";case"staging":return"https://tv-staging.trustingsocial.com/api";case"production":default:return"https://vn-vision.trustingsocial.com/api"}}(r);return new I({authorizer:n,domain:i})},e.createHttpClient=L,e.SimpleTrustVisionAPI=D,e.default=bn,Object.defineProperty(e,"__esModule",{value:!0})}(t,DB)}))),MB=new Uint8Array(16);function VB(){if(!LB&&!(LB="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return LB(MB)}var jB=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function FB(e){return"string"==typeof e&&jB.test(e)}for(var zB=[],KB=0;KB<256;++KB)zB.push((KB+256).toString(16).substr(1));function qB(e,t,r){var n=(e=e||{}).random||(e.rng||VB)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(zB[e[t+0]]+zB[e[t+1]]+zB[e[t+2]]+zB[e[t+3]]+"-"+zB[e[t+4]]+zB[e[t+5]]+"-"+zB[e[t+6]]+zB[e[t+7]]+"-"+zB[e[t+8]]+zB[e[t+9]]+"-"+zB[e[t+10]]+zB[e[t+11]]+zB[e[t+12]]+zB[e[t+13]]+zB[e[t+14]]+zB[e[t+15]]).toLowerCase();if(!FB(r))throw TypeError("Stringified UUID is invalid");return r}(n)}var HB=function(){this.__data__=[],this.size=0},QB=function(e,t){return e===t||e!=e&&t!=t},GB=function(e,t){for(var r=e.length;r--;)if(QB(e[r][0],t))return r;return-1},WB=Array.prototype.splice,XB=function(e){var t=this.__data__,r=GB(t,e);return!(r<0||(r==t.length-1?t.pop():WB.call(t,r,1),--this.size,0))},YB=function(e){var t=this.__data__,r=GB(t,e);return r<0?void 0:t[r][1]},$B=function(e){return GB(this.__data__,e)>-1},ZB=function(e,t){var r=this.__data__,n=GB(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function JB(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}JB.prototype.clear=HB,JB.prototype.delete=XB,JB.prototype.get=YB,JB.prototype.has=$B,JB.prototype.set=ZB;var eT,tT=JB,rT=function(){this.__data__=new tT,this.size=0},nT=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},iT=function(e){return this.__data__.get(e)},aT=function(e){return this.__data__.has(e)},oT="object"==Iv(xB)&&xB&&xB.Object===Object&&xB,sT="object"==("undefined"==typeof self?"undefined":Iv(self))&&self&&self.Object===Object&&self,cT=oT||sT||Function("return this")(),uT=cT.Symbol,lT=Object.prototype,dT=lT.hasOwnProperty,fT=lT.toString,pT=uT?uT.toStringTag:void 0,hT=function(e){var t=dT.call(e,pT),r=e[pT];try{e[pT]=void 0;var n=!0}catch(e){}var i=fT.call(e);return n&&(t?e[pT]=r:delete e[pT]),i},gT=Object.prototype.toString,mT=function(e){return gT.call(e)},yT=uT?uT.toStringTag:void 0,vT=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":yT&&yT in Object(e)?hT(e):mT(e)},bT=function(e){var t=Iv(e);return null!=e&&("object"==t||"function"==t)},CT=function(e){if(!bT(e))return!1;var t=vT(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},ET=cT["__core-js_shared__"],wT=(eT=/[^.]+$/.exec(ET&&ET.keys&&ET.keys.IE_PROTO||""))?"Symbol(src)_1."+eT:"",kT=function(e){return!!wT&&wT in e},ST=Function.prototype.toString,BT=function(e){if(null!=e){try{return ST.call(e)}catch(e){}try{return e+""}catch(e){}}return""},TT=/^\[object .+?Constructor\]$/,AT=Function.prototype,IT=Object.prototype,_T=AT.toString,xT=IT.hasOwnProperty,PT=RegExp("^"+_T.call(xT).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),RT=function(e){return!(!bT(e)||kT(e))&&(CT(e)?PT:TT).test(BT(e))},NT=function(e,t){return null==e?void 0:e[t]},OT=function(e,t){var r=NT(e,t);return RT(r)?r:void 0},LT=OT(cT,"Map"),DT=OT(Object,"create"),UT=function(){this.__data__=DT?DT(null):{},this.size=0},MT=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},VT=Object.prototype.hasOwnProperty,jT=function(e){var t=this.__data__;if(DT){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return VT.call(t,e)?t[e]:void 0},FT=Object.prototype.hasOwnProperty,zT=function(e){var t=this.__data__;return DT?void 0!==t[e]:FT.call(t,e)},KT=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=DT&&void 0===t?"__lodash_hash_undefined__":t,this};function qT(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}qT.prototype.clear=UT,qT.prototype.delete=MT,qT.prototype.get=jT,qT.prototype.has=zT,qT.prototype.set=KT;var HT=qT,QT=function(){this.size=0,this.__data__={hash:new HT,map:new(LT||tT),string:new HT}},GT=function(e){var t=Iv(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e},WT=function(e,t){var r=e.__data__;return GT(t)?r["string"==typeof t?"string":"hash"]:r.map},XT=function(e){var t=WT(this,e).delete(e);return this.size-=t?1:0,t},YT=function(e){return WT(this,e).get(e)},$T=function(e){return WT(this,e).has(e)},ZT=function(e,t){var r=WT(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function JT(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}JT.prototype.clear=QT,JT.prototype.delete=XT,JT.prototype.get=YT,JT.prototype.has=$T,JT.prototype.set=ZT;var eA=JT,tA=function(e,t){var r=this.__data__;if(r instanceof tT){var n=r.__data__;if(!LT||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new eA(n)}return r.set(e,t),this.size=r.size,this};function rA(e){var t=this.__data__=new tT(e);this.size=t.size}rA.prototype.clear=rT,rA.prototype.delete=nT,rA.prototype.get=iT,rA.prototype.has=aT,rA.prototype.set=tA;var nA=rA,iA=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e},aA=function(){try{var e=OT(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),oA=function(e,t,r){"__proto__"==t&&aA?aA(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r},sA=Object.prototype.hasOwnProperty,cA=function(e,t,r){var n=e[t];sA.call(e,t)&&QB(n,r)&&(void 0!==r||t in e)||oA(e,t,r)},uA=function(e,t,r,n){var i=!r;r||(r={});for(var a=-1,o=t.length;++a<o;){var s=t[a],c=n?n(r[s],e[s],s,r,e):void 0;void 0===c&&(c=e[s]),i?oA(r,s,c):cA(r,s,c)}return r},lA=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n},dA=function(e){return null!=e&&"object"==Iv(e)},fA=function(e){return dA(e)&&"[object Arguments]"==vT(e)},pA=Object.prototype,hA=pA.hasOwnProperty,gA=pA.propertyIsEnumerable,mA=fA(function(){return arguments}())?fA:function(e){return dA(e)&&hA.call(e,"callee")&&!gA.call(e,"callee")},yA=Array.isArray,vA=function(){return!1},bA=RB((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,i=n&&n.exports===r?cT.Buffer:void 0,a=(i?i.isBuffer:void 0)||vA;e.exports=a})),CA=/^(?:0|[1-9]\d*)$/,EA=function(e,t){var r=Iv(e);return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&CA.test(e))&&e>-1&&e%1==0&&e<t},wA=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},kA={};kA["[object Float32Array]"]=kA["[object Float64Array]"]=kA["[object Int8Array]"]=kA["[object Int16Array]"]=kA["[object Int32Array]"]=kA["[object Uint8Array]"]=kA["[object Uint8ClampedArray]"]=kA["[object Uint16Array]"]=kA["[object Uint32Array]"]=!0,kA["[object Arguments]"]=kA["[object Array]"]=kA["[object ArrayBuffer]"]=kA["[object Boolean]"]=kA["[object DataView]"]=kA["[object Date]"]=kA["[object Error]"]=kA["[object Function]"]=kA["[object Map]"]=kA["[object Number]"]=kA["[object Object]"]=kA["[object RegExp]"]=kA["[object Set]"]=kA["[object String]"]=kA["[object WeakMap]"]=!1;var SA=function(e){return dA(e)&&wA(e.length)&&!!kA[vT(e)]},BA=function(e){return function(t){return e(t)}},TA=RB((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,i=n&&n.exports===r&&oT.process,a=function(){try{return n&&n.require&&n.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=a})),AA=TA&&TA.isTypedArray,IA=AA?BA(AA):SA,_A=Object.prototype.hasOwnProperty,xA=function(e,t){var r=yA(e),n=!r&&mA(e),i=!r&&!n&&bA(e),a=!r&&!n&&!i&&IA(e),o=r||n||i||a,s=o?lA(e.length,String):[],c=s.length;for(var u in e)!t&&!_A.call(e,u)||o&&("length"==u||i&&("offset"==u||"parent"==u)||a&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||EA(u,c))||s.push(u);return s},PA=Object.prototype,RA=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||PA)},NA=function(e,t){return function(r){return e(t(r))}},OA=NA(Object.keys,Object),LA=Object.prototype.hasOwnProperty,DA=function(e){if(!RA(e))return OA(e);var t=[];for(var r in Object(e))LA.call(e,r)&&"constructor"!=r&&t.push(r);return t},UA=function(e){return null!=e&&wA(e.length)&&!CT(e)},MA=function(e){return UA(e)?xA(e):DA(e)},VA=function(e,t){return e&&uA(t,MA(t),e)},jA=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t},FA=Object.prototype.hasOwnProperty,zA=function(e){if(!bT(e))return jA(e);var t=RA(e),r=[];for(var n in e)("constructor"!=n||!t&&FA.call(e,n))&&r.push(n);return r},KA=function(e){return UA(e)?xA(e,!0):zA(e)},qA=function(e,t){return e&&uA(t,KA(t),e)},HA=RB((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,i=n&&n.exports===r?cT.Buffer:void 0,a=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=a?a(r):new e.constructor(r);return e.copy(n),n}})),QA=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t},GA=function(e,t){for(var r=-1,n=null==e?0:e.length,i=0,a=[];++r<n;){var o=e[r];t(o,r,e)&&(a[i++]=o)}return a},WA=function(){return[]},XA=Object.prototype.propertyIsEnumerable,YA=Object.getOwnPropertySymbols,$A=YA?function(e){return null==e?[]:(e=Object(e),GA(YA(e),(function(t){return XA.call(e,t)})))}:WA,ZA=function(e,t){return uA(e,$A(e),t)},JA=function(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e},eI=NA(Object.getPrototypeOf,Object),tI=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)JA(t,$A(e)),e=eI(e);return t}:WA,rI=function(e,t){return uA(e,tI(e),t)},nI=function(e,t,r){var n=t(e);return yA(e)?n:JA(n,r(e))},iI=function(e){return nI(e,MA,$A)},aI=function(e){return nI(e,KA,tI)},oI=OT(cT,"DataView"),sI=OT(cT,"Promise"),cI=OT(cT,"Set"),uI=OT(cT,"WeakMap"),lI=BT(oI),dI=BT(LT),fI=BT(sI),pI=BT(cI),hI=BT(uI),gI=vT;(oI&&"[object DataView]"!=gI(new oI(new ArrayBuffer(1)))||LT&&"[object Map]"!=gI(new LT)||sI&&"[object Promise]"!=gI(sI.resolve())||cI&&"[object Set]"!=gI(new cI)||uI&&"[object WeakMap]"!=gI(new uI))&&(gI=function(e){var t=vT(e),r="[object Object]"==t?e.constructor:void 0,n=r?BT(r):"";if(n)switch(n){case lI:return"[object DataView]";case dI:return"[object Map]";case fI:return"[object Promise]";case pI:return"[object Set]";case hI:return"[object WeakMap]"}return t});var mI=gI,yI=Object.prototype.hasOwnProperty,vI=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&yI.call(e,"index")&&(r.index=e.index,r.input=e.input),r},bI=cT.Uint8Array,CI=function(e){var t=new e.constructor(e.byteLength);return new bI(t).set(new bI(e)),t},EI=function(e,t){var r=t?CI(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)},wI=/\w*$/,kI=function(e){var t=new e.constructor(e.source,wI.exec(e));return t.lastIndex=e.lastIndex,t},SI=uT?uT.prototype:void 0,BI=SI?SI.valueOf:void 0,TI=function(e){return BI?Object(BI.call(e)):{}},AI=function(e,t){var r=t?CI(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)},II=function(e,t,r){var n=e.constructor;switch(t){case"[object ArrayBuffer]":return CI(e);case"[object Boolean]":case"[object Date]":return new n(+e);case"[object DataView]":return EI(e,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return AI(e,r);case"[object Map]":return new n;case"[object Number]":case"[object String]":return new n(e);case"[object RegExp]":return kI(e);case"[object Set]":return new n;case"[object Symbol]":return TI(e)}},_I=Object.create,xI=function(){function e(){}return function(t){if(!bT(t))return{};if(_I)return _I(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),PI=function(e){return"function"!=typeof e.constructor||RA(e)?{}:xI(eI(e))},RI=function(e){return dA(e)&&"[object Map]"==mI(e)},NI=TA&&TA.isMap,OI=NI?BA(NI):RI,LI=function(e){return dA(e)&&"[object Set]"==mI(e)},DI=TA&&TA.isSet,UI=DI?BA(DI):LI,MI={};MI["[object Arguments]"]=MI["[object Array]"]=MI["[object ArrayBuffer]"]=MI["[object DataView]"]=MI["[object Boolean]"]=MI["[object Date]"]=MI["[object Float32Array]"]=MI["[object Float64Array]"]=MI["[object Int8Array]"]=MI["[object Int16Array]"]=MI["[object Int32Array]"]=MI["[object Map]"]=MI["[object Number]"]=MI["[object Object]"]=MI["[object RegExp]"]=MI["[object Set]"]=MI["[object String]"]=MI["[object Symbol]"]=MI["[object Uint8Array]"]=MI["[object Uint8ClampedArray]"]=MI["[object Uint16Array]"]=MI["[object Uint32Array]"]=!0,MI["[object Error]"]=MI["[object Function]"]=MI["[object WeakMap]"]=!1;var VI=function e(t,r,n,i,a,o){var s,c=1&r,u=2&r,l=4&r;if(n&&(s=a?n(t,i,a,o):n(t)),void 0!==s)return s;if(!bT(t))return t;var d=yA(t);if(d){if(s=vI(t),!c)return QA(t,s)}else{var f=mI(t),p="[object Function]"==f||"[object GeneratorFunction]"==f;if(bA(t))return HA(t,c);if("[object Object]"==f||"[object Arguments]"==f||p&&!a){if(s=u||p?{}:PI(t),!c)return u?rI(t,qA(s,t)):ZA(t,VA(s,t))}else{if(!MI[f])return a?t:{};s=II(t,f,c)}}o||(o=new nA);var h=o.get(t);if(h)return h;o.set(t,s),UI(t)?t.forEach((function(i){s.add(e(i,r,n,i,t,o))})):OI(t)&&t.forEach((function(i,a){s.set(a,e(i,r,n,a,t,o))}));var g=d?void 0:(l?u?aI:iI:u?KA:MA)(t);return iA(g||t,(function(i,a){g&&(i=t[a=i]),cA(s,a,e(i,r,n,a,t,o))})),s},jI=function(e){return VI(e,5)},FI=RB((function(e){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(e,t,r){e.exports={BROWSER_TYPES:{CHROME:"Chrome",FIREFOX:"Firefox",OPERA:"Opera",YANDEX:"Yandex",SAFARI:"Safari",INTERNET_EXPLORER:"Internet Explorer",EDGE:"Edge",CHROMIUM:"Chromium",IE:"IE",MOBILE_SAFARI:"Mobile Safari",EDGE_CHROMIUM:"Edge Chromium"},DEVICE_TYPES:{MOBILE:"mobile",TABLET:"tablet",SMART_TV:"smarttv",CONSOLE:"console",WEARABLE:"wearable",BROWSER:void 0},OS_TYPES:{IOS:"iOS",ANDROID:"Android",WINDOWS_PHONE:"Windows Phone",WINDOWS:"Windows",MAC_OS:"Mac OS"},defaultData:{isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1}}},function(e,t,r){var n,i=r(2),a=r(0),o=a.BROWSER_TYPES,s=a.OS_TYPES,c=a.DEVICE_TYPES,u=r(4),l=u.checkType,d=u.broPayload,f=u.mobilePayload,p=u.wearPayload,h=u.consolePayload,g=u.stvPayload,m=u.getNavigatorInstance,y=u.isIOS13Check,v=new i,b=v.getBrowser(),C=v.getDevice(),E=v.getEngine(),w=v.getOS(),k=v.getUA(),S=o.CHROME,B=o.CHROMIUM,T=o.IE,A=o.INTERNET_EXPLORER,I=o.OPERA,_=o.FIREFOX,x=o.SAFARI,P=o.EDGE,R=o.YANDEX,N=o.MOBILE_SAFARI,O=c.MOBILE,L=c.TABLET,D=c.SMART_TV,U=c.BROWSER,M=c.WEARABLE,V=c.CONSOLE,j=s.ANDROID,F=s.WINDOWS_PHONE,z=s.IOS,K=s.WINDOWS,q=s.MAC_OS,H=function(){return w.name===s.WINDOWS&&"10"===w.version&&"string"==typeof k&&-1!==k.indexOf("Edg/")},Q=function(){return b.name===P},G=function(){return y("iPad")},W=C.type===D,X=C.type===V,Y=C.type===M,$=b.name===N||G(),Z=b.name===B,J=function(){switch(C.type){case O:case L:return!0;default:return!1}}()||G(),ee=C.type===O,te=C.type===L||G(),re=C.type===U,ne=w.name===j,ie=w.name===F,ae=w.name===z||G(),oe=b.name===S,se=b.name===_,ce=b.name===x||b.name===N,ue=b.name===I,le=b.name===A||b.name===T,de=w.version?w.version:"none",fe=w.name?w.name:"none",pe=b.major,he=b.version,ge=b.name,me=C.vendor?C.vendor:"none",ye=C.model?C.model:"none",ve=E.name,be=E.version,Ce=k,Ee=Q()||H(),we=b.name===R,ke=C.type,Se=(n=m())&&(/iPad|iPhone|iPod/.test(n.platform)||"MacIntel"===n.platform&&n.maxTouchPoints>1)&&!window.MSStream,Be=G(),Te=y("iPhone"),Ae=y("iPod"),Ie=function(){var e=m(),t=e&&e.userAgent.toLowerCase();return"string"==typeof t&&/electron/.test(t)}(),_e=H(),xe=Q(),Pe=w.name===K,Re=w.name===q,Ne=l(C.type);e.exports={deviceDetect:function(){var e=Ne.isBrowser,t=Ne.isMobile,r=Ne.isTablet,n=Ne.isSmartTV,i=Ne.isConsole,a=Ne.isWearable;return e?d(e,b,E,w,k):n?g(n,E,w,k):i?h(i,E,w,k):t||r?f(Ne,C,w,k):a?p(a,E,w,k):void 0},isSmartTV:W,isConsole:X,isWearable:Y,isMobileSafari:$,isChromium:Z,isMobile:J,isMobileOnly:ee,isTablet:te,isBrowser:re,isAndroid:ne,isWinPhone:ie,isIOS:ae,isChrome:oe,isFirefox:se,isSafari:ce,isOpera:ue,isIE:le,osVersion:de,osName:fe,fullBrowserVersion:pe,browserVersion:he,browserName:ge,mobileVendor:me,mobileModel:ye,engineName:ve,engineVersion:be,getUA:Ce,isEdge:Ee,isYandex:we,deviceType:ke,isIOS13:Se,isIPad13:Be,isIPhone13:Te,isIPod13:Ae,isElectron:Ie,isEdgeChromium:_e,isLegacyEdge:xe,isWindows:Pe,isMacOs:Re}},function(e,t,r){var n;
|
21
|
+
/*!
|
22
|
+
* UAParser.js v0.7.18
|
23
|
+
* Lightweight JavaScript-based User-Agent string parser
|
24
|
+
* https://github.com/faisalman/ua-parser-js
|
25
|
+
*
|
26
|
+
* Copyright © 2012-2016 Faisal Salman <fyzlman@gmail.com>
|
27
|
+
* Dual licensed under GPLv2 or MIT
|
28
|
+
*/!function(i,a){var o="function",s="undefined",c="object",u="model",l="name",d="type",f="vendor",p="version",h="architecture",g="console",m="mobile",y="tablet",v="smarttv",b="wearable",C={extend:function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:a},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},E={rgx:function(e,t){for(var r,n,i,s,u,l,d=0;d<t.length&&!u;){var f=t[d],p=t[d+1];for(r=n=0;r<f.length&&!u;)if(u=f[r++].exec(e))for(i=0;i<p.length;i++)l=u[++n],Iv(s=p[i])===c&&s.length>0?2==s.length?Iv(s[1])==o?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:3==s.length?Iv(s[1])!==o||s[1].exec&&s[1].test?this[s[0]]=l?l.replace(s[1],s[2]):a:this[s[0]]=l?s[1].call(this,l,s[2]):a:4==s.length&&(this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):a):this[s]=l||a;d+=2}},str:function(e,t){for(var r in t)if(Iv(t[r])===c&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(C.has(t[r][n],e))return"?"===r?a:r}else if(C.has(t[r],e))return"?"===r?a:r;return e}},w={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},k={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[l,p],[/(opios)[\/\s]+([\w\.]+)/i],[[l,"Opera Mini"],p],[/\s(opr)\/([\w\.]+)/i],[[l,"Opera"],p],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]*)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark)\/([\w\.-]+)/i],[l,p],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[l,"IE"],p],[/(edge|edgios|edgea)\/((\d+)?[\w\.]+)/i],[[l,"Edge"],p],[/(yabrowser)\/([\w\.]+)/i],[[l,"Yandex"],p],[/(puffin)\/([\w\.]+)/i],[[l,"Puffin"],p],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[l,"UCBrowser"],p],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],p],[/(micromessenger)\/([\w\.]+)/i],[[l,"WeChat"],p],[/(qqbrowserlite)\/([\w\.]+)/i],[l,p],[/(QQ)\/([\d\.]+)/i],[l,p],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[l,p],[/(BIDUBrowser)[\/\s]?([\w\.]+)/i],[l,p],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[l,p],[/(MetaSr)[\/\s]?([\w\.]+)/i],[l],[/(LBBROWSER)/i],[l],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[p,[l,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[p,[l,"Facebook"]],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[p,[l,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[l,/(.+)/,"$1 WebView"],p],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[l,/(.+(?:g|us))(.+)/,"$1 $2"],p],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[p,[l,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[l,p],[/(dolfin)\/([\w\.]+)/i],[[l,"Dolphin"],p],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[l,"Chrome"],p],[/(coast)\/([\w\.]+)/i],[[l,"Opera Coast"],p],[/fxios\/([\w\.-]+)/i],[p,[l,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[p,[l,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[p,l],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[l,"GSA"],p],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[l,[p,E.str,w.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[l,p],[/(navigator|netscape)\/([\w\.-]+)/i],[[l,"Netscape"],p],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[l,p]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[h,"amd64"]],[/(ia32(?=;))/i],[[h,C.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[h,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[h,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[h,/ower/,"",C.lowerize]],[/(sun4\w)[;\)]/i],[[h,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[h,C.lowerize]]],device:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],[u,f,[d,y]],[/applecoremedia\/[\w\.]+ \((ipad)/],[u,[f,"Apple"],[d,y]],[/(apple\s{0,1}tv)/i],[[u,"Apple TV"],[f,"Apple"]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[f,u,[d,y]],[/(kf[A-z]+)\sbuild\/.+silk\//i],[u,[f,"Amazon"],[d,y]],[/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i],[[u,E.str,w.device.amazon.model],[f,"Amazon"],[d,m]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[u,f,[d,m]],[/\((ip[honed|\s\w*]+);/i],[u,[f,"Apple"],[d,m]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[f,u,[d,m]],[/\(bb10;\s(\w+)/i],[u,[f,"BlackBerry"],[d,m]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone)/i],[u,[f,"Asus"],[d,y]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[f,"Sony"],[u,"Xperia Tablet"],[d,y]],[/android.+\s([c-g]\d{4}|so[-l]\w+)\sbuild\//i],[u,[f,"Sony"],[d,m]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[f,u,[d,g]],[/android.+;\s(shield)\sbuild/i],[u,[f,"Nvidia"],[d,g]],[/(playstation\s[34portablevi]+)/i],[u,[f,"Sony"],[d,g]],[/(sprint\s(\w+))/i],[[f,E.str,w.device.sprint.vendor],[u,E.str,w.device.sprint.model],[d,m]],[/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i],[f,u,[d,y]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[f,[u,/_/g," "],[d,m]],[/(nexus\s9)/i],[u,[f,"HTC"],[d,y]],[/d\/huawei([\w\s-]+)[;\)]/i,/(nexus\s6p)/i],[u,[f,"Huawei"],[d,m]],[/(microsoft);\s(lumia[\s\w]+)/i],[f,u,[d,m]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[u,[f,"Microsoft"],[d,g]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[f,"Microsoft"],[d,m]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w*)/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[u,[f,"Motorola"],[d,m]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[u,[f,"Motorola"],[d,y]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[f,C.trim],[u,C.trim],[d,v]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[f,"Samsung"],[d,v]],[/\(dtv[\);].+(aquos)/i],[u,[f,"Sharp"],[d,v]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[f,"Samsung"],u,[d,y]],[/smart-tv.+(samsung)/i],[f,[d,v],u],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[f,"Samsung"],u,[d,m]],[/sie-(\w*)/i],[u,[f,"Siemens"],[d,m]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[f,"Nokia"],u,[d,m]],[/android\s3\.[\s\w;-]{10}(a\d{3})/i],[u,[f,"Acer"],[d,y]],[/android.+([vl]k\-?\d{3})\s+build/i],[u,[f,"LG"],[d,y]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[f,"LG"],u,[d,y]],[/(lg) netcast\.tv/i],[f,u,[d,v]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[u,[f,"LG"],[d,m]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[u,[f,"Lenovo"],[d,y]],[/linux;.+((jolla));/i],[f,u,[d,m]],[/((pebble))app\/[\d\.]+\s/i],[f,u,[d,b]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[f,u,[d,m]],[/crkey/i],[[u,"Chromecast"],[f,"Google"]],[/android.+;\s(glass)\s\d/i],[u,[f,"Google"],[d,b]],[/android.+;\s(pixel c)\s/i],[u,[f,"Google"],[d,y]],[/android.+;\s(pixel xl|pixel)\s/i],[u,[f,"Google"],[d,m]],[/android.+;\s(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:one|one[\s_]plus|note lte)?[\s_]*(?:\d?\w?)[\s_]*(?:plus)?)\s+build/i,/android.+(redmi[\s\-_]*(?:note)?(?:[\s_]*[\w\s]+))\s+build/i],[[u,/_/g," "],[f,"Xiaomi"],[d,m]],[/android.+(mi[\s\-_]*(?:pad)(?:[\s_]*[\w\s]+))\s+build/i],[[u,/_/g," "],[f,"Xiaomi"],[d,y]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[u,[f,"Meizu"],[d,y]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})\s+build/i],[u,[f,"OnePlus"],[d,m]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[u,[f,"RCA"],[d,y]],[/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i],[u,[f,"Dell"],[d,y]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[u,[f,"Verizon"],[d,y]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[f,"Barnes & Noble"],u,[d,y]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[u,[f,"NuVision"],[d,y]],[/android.+;\s(k88)\sbuild/i],[u,[f,"ZTE"],[d,y]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[u,[f,"Swiss"],[d,m]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[u,[f,"Swiss"],[d,y]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[u,[f,"Zeki"],[d,y]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[f,"Dragon Touch"],u,[d,y]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[u,[f,"Insignia"],[d,y]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[u,[f,"NextBook"],[d,y]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[f,"Voice"],u,[d,m]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[f,"LvTel"],u,[d,m]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[u,[f,"Envizen"],[d,y]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[f,u,[d,y]],[/android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i],[u,[f,"MachSpeed"],[d,y]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[f,u,[d,y]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[u,[f,"Rotor"],[d,y]],[/android.+(KS(.+))\s+build/i],[u,[f,"Amazon"],[d,y]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[f,u,[d,y]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[d,C.lowerize],f,u],[/(android[\w\.\s\-]{0,9});.+build/i],[u,[f,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[p,[l,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[l,p],[/rv\:([\w\.]{1,9}).+(gecko)/i],[p,l]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[l,p],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[l,[p,E.str,w.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[l,"Windows"],[p,E.str,w.os.windows.version]],[/\((bb)(10);/i],[[l,"BlackBerry"],p],[/(blackberry)\w*\/?([\w\.]*)/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]*)/i,/linux;.+(sailfish);/i],[l,p],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[l,"Symbian"],p],[/\((series40);/i],[l],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[l,"Firefox OS"],p],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i],[l,p],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[l,"Chromium OS"],p],[/(sunos)\s?([\w\.\d]*)/i],[[l,"Solaris"],p],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[l,p],[/(haiku)\s(\w+)/i],[l,p],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[p,/_/g,"."],[l,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[l,"Mac OS"],[p,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]*)/i],[l,p]]},S=function e(t,r){if("object"==Iv(t)&&(r=t,t=a),!(this instanceof e))return new e(t,r).getResult();var n=t||(i&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),o=r?C.extend(k,r):k;return this.getBrowser=function(){var e={name:a,version:a};return E.rgx.call(e,n,o.browser),e.major=C.major(e.version),e},this.getCPU=function(){var e={architecture:a};return E.rgx.call(e,n,o.cpu),e},this.getDevice=function(){var e={vendor:a,model:a,type:a};return E.rgx.call(e,n,o.device),e},this.getEngine=function(){var e={name:a,version:a};return E.rgx.call(e,n,o.engine),e},this.getOS=function(){var e={name:a,version:a};return E.rgx.call(e,n,o.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=e,this},this};S.VERSION="0.7.18",S.BROWSER={NAME:l,MAJOR:"major",VERSION:p},S.CPU={ARCHITECTURE:h},S.DEVICE={MODEL:u,VENDOR:f,TYPE:d,CONSOLE:g,MOBILE:m,SMARTTV:v,TABLET:y,WEARABLE:b,EMBEDDED:"embedded"},S.ENGINE={NAME:l,VERSION:p},S.OS={NAME:l,VERSION:p},Iv(t)!==s?(Iv(e)!==s&&e.exports&&(t=e.exports=S),t.UAParser=S):r(3)?(n=function(){return S}.call(t,r,t,e))===a||(e.exports=n):i&&(i.UAParser=S);var B=i&&(i.jQuery||i.Zepto);if(Iv(B)!==s){var T=new S;B.ua=T.getResult(),B.ua.get=function(){return T.getUA()},B.ua.set=function(e){T.setUA(e);var t=T.getResult();for(var r in t)B.ua[r]=t[r]}}}("object"==("undefined"==typeof window?"undefined":Iv(window))?window:this)},function(e,t){(function(t){e.exports=t}).call(t,{})},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i=r(0),a=i.DEVICE_TYPES,o=i.defaultData,s=t.getNavigatorInstance=function(){return!("undefined"==typeof window||!window.navigator&&!navigator)&&(window.navigator||navigator)},c=t.isIOS13Check=function(e){var t=s();return t&&t.platform&&(-1!==t.platform.indexOf(e)||"MacIntel"===t.platform&&t.maxTouchPoints>1&&!window.MSStream)};e.exports={checkType:function(e){switch(e){case a.MOBILE:return{isMobile:!0};case a.TABLET:return{isTablet:!0};case a.SMART_TV:return{isSmartTV:!0};case a.CONSOLE:return{isConsole:!0};case a.WEARABLE:return{isWearable:!0};case a.BROWSER:return{isBrowser:!0};default:return o}},broPayload:function(e,t,r,n,i){return{isBrowser:e,browserMajorVersion:t.major,browserFullVersion:t.version,browserName:t.name,engineName:r.name||!1,engineVersion:r.version,osName:n.name,osVersion:n.version,userAgent:i}},mobilePayload:function(e,t,r,i){return n({},e,{vendor:t.vendor,model:t.model,os:r.name,osVersion:r.version,ua:i})},stvPayload:function(e,t,r,n){return{isSmartTV:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},consolePayload:function(e,t,r,n){return{isConsole:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},wearPayload:function(e,t,r,n){return{isWearable:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},getNavigatorInstance:s,isIOS13Check:c}}])}));function zI(){return{"X-TV-Device-Model":"".concat(FI.browserName," ").concat(FI.browserVersion),"X-TV-OS-Version":"".concat(FI.osName," ").concat(FI.osVersion),"X-TV-OS-Platform":FI.isMobile?"".concat(FI.osName.toLowerCase(),"_web"):"web"}}var KI=Object.freeze({__proto__:null,getUAMetadata:zI});function qI(e){return e<10?"0".concat(e):e}function HI(e){return"".concat(e.getFullYear(),"-").concat(qI(e.getMonth()+1),"-").concat(qI(e.getDate()),"T").concat(qI(e.getHours()),":").concat(qI(e.getMinutes()),":").concat(qI(e.getSeconds())).concat(function(e){if(0===e)return"Z";var t=e>0?"-":"+";return e=Math.abs(e),"".concat(t+qI(Math.floor(e/60)),":").concat(qI(e%60))}(e.getTimezoneOffset()))}var QI=Object.freeze({__proto__:null,rfc3339:HI});function GI(e,t){window.localStorage&&window.JSON&&t&&localStorage.setItem(t,JSON.stringify(e))}function WI(e){if(window.localStorage&&window.JSON&&e){var t=localStorage.getItem(e);if(t)return JSON.parse(t)}}var XI=Object.freeze({__proto__:null,storeData:GI,getData:WI,removeData:function(e){window.localStorage&&window.JSON&&e&&localStorage.removeItem(e)}}),YI=RB((function(e,t){var r;e.exports=r=r||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==xB&&xB.crypto&&(r=xB.crypto),!r)try{r=DB}catch(e){}var n=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),a={},o=a.lib={},s=o.Base={extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=o.WordArray=s.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var a=0;a<i;a++){var o=r[a>>>2]>>>24-a%4*8&255;t[n+a>>>2]|=o<<24-(n+a)%4*8}else for(var s=0;s<i;s+=4)t[n+s>>>2]=r[s>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(n());return new c.init(t,e)}}),u=a.enc={},l=u.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var a=t[i>>>2]>>>24-i%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new c.init(r,t/2)}},d=u.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var a=t[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new c.init(r,t)}},f=u.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},p=o.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r,n=this._data,i=n.words,a=n.sigBytes,o=this.blockSize,s=a/(4*o),u=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*o,l=e.min(4*u,a);if(u){for(var d=0;d<u;d+=o)this._doProcessBlock(i,d);r=i.splice(0,u),n.sigBytes-=l}return new c.init(r,l)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),h=(o.Hasher=p.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new h.HMAC.init(e,r).finalize(t)}}}),a.algo={});return a}(Math)})),$I=(RB((function(e,t){var r,n,i,a,o,s;e.exports=(n=(r=s=YI).lib,i=n.Base,a=n.WordArray,(o=r.x64={}).Word=i.extend({init:function(e,t){this.high=e,this.low=t}}),o.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,r=[],n=0;n<t;n++){var i=e[n];r.push(i.high),r.push(i.low)}return a.create(r,this.sigBytes)},clone:function(){for(var e=i.clone.call(this),t=e.words=this.words.slice(0),r=t.length,n=0;n<r;n++)t[n]=t[n].clone();return e}}),s)})),RB((function(e,t){var r;e.exports=(r=YI,function(){if("function"==typeof ArrayBuffer){var e=r.lib.WordArray,t=e.init;(e.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var r=e.byteLength,n=[],i=0;i<r;i++)n[i>>>2]|=e[i]<<24-i%4*8;t.call(this,n,r)}else t.apply(this,arguments)}).prototype=e}}(),r.lib.WordArray)})),RB((function(e,t){var r;e.exports=(r=YI,function(){var e=r,t=e.lib.WordArray,n=e.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i+=2){var a=t[i>>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var r=e.length,n=[],i=0;i<r;i++)n[i>>>1]|=e.charCodeAt(i)<<16-i%2*16;return t.create(n,2*r)}},n.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],a=0;a<r;a+=2){var o=i(t[a>>>2]>>>16-a%4*8&65535);n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var r=e.length,n=[],a=0;a<r;a++)n[a>>>1]|=i(e.charCodeAt(a)<<16-a%2*16);return t.create(n,2*r)}}}(),r.enc.Utf16)})),RB((function(e,t){var r;e.exports=(r=YI,function(){var e=r,t=e.lib.WordArray;function n(e,r,n){for(var i=[],a=0,o=0;o<r;o++)if(o%4){var s=n[e.charCodeAt(o-1)]<<o%4*2|n[e.charCodeAt(o)]>>>6-o%4*2;i[a>>>2]|=s<<24-a%4*8,a++}return t.create(i,a)}e.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],a=0;a<r;a+=3)for(var o=(t[a>>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.75*s<r;s++)i.push(n.charAt(o>>>6*(3-s)&63));var c=n.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(e){var t=e.length,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a<r.length;a++)i[r.charCodeAt(a)]=a}var o=r.charAt(64);if(o){var s=e.indexOf(o);-1!==s&&(t=s)}return n(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),r.enc.Base64)})),RB((function(e,t){var r;e.exports=(r=YI,function(){var e=r,t=e.lib.WordArray;function n(e,r,n){for(var i=[],a=0,o=0;o<r;o++)if(o%4){var s=n[e.charCodeAt(o-1)]<<o%4*2|n[e.charCodeAt(o)]>>>6-o%4*2;i[a>>>2]|=s<<24-a%4*8,a++}return t.create(i,a)}e.enc.Base64url={stringify:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=e.words,n=e.sigBytes,i=t?this._safe_map:this._map;e.clamp();for(var a=[],o=0;o<n;o+=3)for(var s=(r[o>>>2]>>>24-o%4*8&255)<<16|(r[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|r[o+2>>>2]>>>24-(o+2)%4*8&255,c=0;c<4&&o+.75*c<n;c++)a.push(i.charAt(s>>>6*(3-c)&63));var u=i.charAt(64);if(u)for(;a.length%4;)a.push(u);return a.join("")},parse:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=e.length,i=t?this._safe_map:this._map,a=this._reverseMap;if(!a){a=this._reverseMap=[];for(var o=0;o<i.length;o++)a[i.charCodeAt(o)]=o}var s=i.charAt(64);if(s){var c=e.indexOf(s);-1!==c&&(r=c)}return n(e,r,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"}}(),r.enc.Base64url)})),RB((function(e,t){var r;e.exports=(r=YI,function(e){var t=r,n=t.lib,i=n.WordArray,a=n.Hasher,o=t.algo,s=[];!function(){for(var t=0;t<64;t++)s[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=o.MD5=a.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var a=this._hash.words,o=e[t+0],c=e[t+1],p=e[t+2],h=e[t+3],g=e[t+4],m=e[t+5],y=e[t+6],v=e[t+7],b=e[t+8],C=e[t+9],E=e[t+10],w=e[t+11],k=e[t+12],S=e[t+13],B=e[t+14],T=e[t+15],A=a[0],I=a[1],_=a[2],x=a[3];A=u(A,I,_,x,o,7,s[0]),x=u(x,A,I,_,c,12,s[1]),_=u(_,x,A,I,p,17,s[2]),I=u(I,_,x,A,h,22,s[3]),A=u(A,I,_,x,g,7,s[4]),x=u(x,A,I,_,m,12,s[5]),_=u(_,x,A,I,y,17,s[6]),I=u(I,_,x,A,v,22,s[7]),A=u(A,I,_,x,b,7,s[8]),x=u(x,A,I,_,C,12,s[9]),_=u(_,x,A,I,E,17,s[10]),I=u(I,_,x,A,w,22,s[11]),A=u(A,I,_,x,k,7,s[12]),x=u(x,A,I,_,S,12,s[13]),_=u(_,x,A,I,B,17,s[14]),A=l(A,I=u(I,_,x,A,T,22,s[15]),_,x,c,5,s[16]),x=l(x,A,I,_,y,9,s[17]),_=l(_,x,A,I,w,14,s[18]),I=l(I,_,x,A,o,20,s[19]),A=l(A,I,_,x,m,5,s[20]),x=l(x,A,I,_,E,9,s[21]),_=l(_,x,A,I,T,14,s[22]),I=l(I,_,x,A,g,20,s[23]),A=l(A,I,_,x,C,5,s[24]),x=l(x,A,I,_,B,9,s[25]),_=l(_,x,A,I,h,14,s[26]),I=l(I,_,x,A,b,20,s[27]),A=l(A,I,_,x,S,5,s[28]),x=l(x,A,I,_,p,9,s[29]),_=l(_,x,A,I,v,14,s[30]),A=d(A,I=l(I,_,x,A,k,20,s[31]),_,x,m,4,s[32]),x=d(x,A,I,_,b,11,s[33]),_=d(_,x,A,I,w,16,s[34]),I=d(I,_,x,A,B,23,s[35]),A=d(A,I,_,x,c,4,s[36]),x=d(x,A,I,_,g,11,s[37]),_=d(_,x,A,I,v,16,s[38]),I=d(I,_,x,A,E,23,s[39]),A=d(A,I,_,x,S,4,s[40]),x=d(x,A,I,_,o,11,s[41]),_=d(_,x,A,I,h,16,s[42]),I=d(I,_,x,A,y,23,s[43]),A=d(A,I,_,x,C,4,s[44]),x=d(x,A,I,_,k,11,s[45]),_=d(_,x,A,I,T,16,s[46]),A=f(A,I=d(I,_,x,A,p,23,s[47]),_,x,o,6,s[48]),x=f(x,A,I,_,v,10,s[49]),_=f(_,x,A,I,B,15,s[50]),I=f(I,_,x,A,m,21,s[51]),A=f(A,I,_,x,k,6,s[52]),x=f(x,A,I,_,h,10,s[53]),_=f(_,x,A,I,E,15,s[54]),I=f(I,_,x,A,c,21,s[55]),A=f(A,I,_,x,b,6,s[56]),x=f(x,A,I,_,T,10,s[57]),_=f(_,x,A,I,y,15,s[58]),I=f(I,_,x,A,S,21,s[59]),A=f(A,I,_,x,g,6,s[60]),x=f(x,A,I,_,w,10,s[61]),_=f(_,x,A,I,p,15,s[62]),I=f(I,_,x,A,C,21,s[63]),a[0]=a[0]+A|0,a[1]=a[1]+I|0,a[2]=a[2]+_|0,a[3]=a[3]+x|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;r[i>>>5]|=128<<24-i%32;var a=e.floor(n/4294967296),o=n;r[15+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),r[14+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),t.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,c=s.words,u=0;u<4;u++){var l=c[u];c[u]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return s},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,r,n,i,a,o){var s=e+(t&r|~t&n)+i+o;return(s<<a|s>>>32-a)+t}function l(e,t,r,n,i,a,o){var s=e+(t&n|r&~n)+i+o;return(s<<a|s>>>32-a)+t}function d(e,t,r,n,i,a,o){var s=e+(t^r^n)+i+o;return(s<<a|s>>>32-a)+t}function f(e,t,r,n,i,a,o){var s=e+(r^(t|~n))+i+o;return(s<<a|s>>>32-a)+t}t.MD5=a._createHelper(c),t.HmacMD5=a._createHmacHelper(c)}(Math),r.MD5)})),RB((function(e,t){var r,n,i,a,o,s,c,u;e.exports=(n=(r=u=YI).lib,i=n.WordArray,a=n.Hasher,o=r.algo,s=[],c=o.SHA1=a.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],o=r[3],c=r[4],u=0;u<80;u++){if(u<16)s[u]=0|e[t+u];else{var l=s[u-3]^s[u-8]^s[u-14]^s[u-16];s[u]=l<<1|l>>>31}var d=(n<<5|n>>>27)+c+s[u];d+=u<20?1518500249+(i&a|~i&o):u<40?1859775393+(i^a^o):u<60?(i&a|i&o|a&o)-1894007588:(i^a^o)-899497514,c=o,o=a,a=i<<30|i>>>2,i=n,n=d}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}}),r.SHA1=a._createHelper(c),r.HmacSHA1=a._createHmacHelper(c),u.SHA1)})),RB((function(e,t){var r;e.exports=(r=YI,function(e){var t=r,n=t.lib,i=n.WordArray,a=n.Hasher,o=t.algo,s=[],c=[];!function(){function t(t){for(var r=e.sqrt(t),n=2;n<=r;n++)if(!(t%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)t(n)&&(i<8&&(s[i]=r(e.pow(n,.5))),c[i]=r(e.pow(n,1/3)),i++),n++}();var u=[],l=o.SHA256=a.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],l=r[5],d=r[6],f=r[7],p=0;p<64;p++){if(p<16)u[p]=0|e[t+p];else{var h=u[p-15],g=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,m=u[p-2],y=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;u[p]=g+u[p-7]+y+u[p-16]}var v=n&i^n&a^i&a,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),C=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&d)+c[p]+u[p];f=d,d=l,l=s,s=o+C|0,o=a,a=i,i=n,n=C+(b+v)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0,r[5]=r[5]+l|0,r[6]=r[6]+d|0,r[7]=r[7]+f|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=e.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=a._createHelper(l),t.HmacSHA256=a._createHmacHelper(l)}(Math),r.SHA256)})),RB((function(e,t){var r,n,i,a,o,s;e.exports=(n=(r=s=YI).lib.WordArray,i=r.algo,a=i.SHA256,o=i.SHA224=a.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=a._doFinalize.call(this);return e.sigBytes-=4,e}}),r.SHA224=a._createHelper(o),r.HmacSHA224=a._createHmacHelper(o),s.SHA224)})),RB((function(e,t){var r;e.exports=(r=YI,function(){var e=r,t=e.lib.Hasher,n=e.x64,i=n.Word,a=n.WordArray,o=e.algo;function s(){return i.create.apply(i,arguments)}var c=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],u=[];!function(){for(var e=0;e<80;e++)u[e]=s()}();var l=o.SHA512=t.extend({_doReset:function(){this._hash=new a.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],l=r[5],d=r[6],f=r[7],p=n.high,h=n.low,g=i.high,m=i.low,y=a.high,v=a.low,b=o.high,C=o.low,E=s.high,w=s.low,k=l.high,S=l.low,B=d.high,T=d.low,A=f.high,I=f.low,_=p,x=h,P=g,R=m,N=y,O=v,L=b,D=C,U=E,M=w,V=k,j=S,F=B,z=T,K=A,q=I,H=0;H<80;H++){var Q,G,W=u[H];if(H<16)G=W.high=0|e[t+2*H],Q=W.low=0|e[t+2*H+1];else{var X=u[H-15],Y=X.high,$=X.low,Z=(Y>>>1|$<<31)^(Y>>>8|$<<24)^Y>>>7,J=($>>>1|Y<<31)^($>>>8|Y<<24)^($>>>7|Y<<25),ee=u[H-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),ae=u[H-7],oe=ae.high,se=ae.low,ce=u[H-16],ue=ce.high,le=ce.low;G=(G=(G=Z+oe+((Q=J+se)>>>0<J>>>0?1:0))+ne+((Q+=ie)>>>0<ie>>>0?1:0))+ue+((Q+=le)>>>0<le>>>0?1:0),W.high=G,W.low=Q}var de,fe=U&V^~U&F,pe=M&j^~M&z,he=_&P^_&N^P&N,ge=x&R^x&O^R&O,me=(_>>>28|x<<4)^(_<<30|x>>>2)^(_<<25|x>>>7),ye=(x>>>28|_<<4)^(x<<30|_>>>2)^(x<<25|_>>>7),ve=(U>>>14|M<<18)^(U>>>18|M<<14)^(U<<23|M>>>9),be=(M>>>14|U<<18)^(M>>>18|U<<14)^(M<<23|U>>>9),Ce=c[H],Ee=Ce.high,we=Ce.low,ke=K+ve+((de=q+be)>>>0<q>>>0?1:0),Se=ye+ge;K=F,q=z,F=V,z=j,V=U,j=M,U=L+(ke=(ke=(ke=ke+fe+((de+=pe)>>>0<pe>>>0?1:0))+Ee+((de+=we)>>>0<we>>>0?1:0))+G+((de+=Q)>>>0<Q>>>0?1:0))+((M=D+de|0)>>>0<D>>>0?1:0)|0,L=N,D=O,N=P,O=R,P=_,R=x,_=ke+(me+he+(Se>>>0<ye>>>0?1:0))+((x=de+Se|0)>>>0<de>>>0?1:0)|0}h=n.low=h+x,n.high=p+_+(h>>>0<x>>>0?1:0),m=i.low=m+R,i.high=g+P+(m>>>0<R>>>0?1:0),v=a.low=v+O,a.high=y+N+(v>>>0<O>>>0?1:0),C=o.low=C+D,o.high=b+L+(C>>>0<D>>>0?1:0),w=s.low=w+M,s.high=E+U+(w>>>0<M>>>0?1:0),S=l.low=S+j,l.high=k+V+(S>>>0<j>>>0?1:0),T=d.low=T+z,d.high=B+F+(T>>>0<z>>>0?1:0),I=f.low=I+q,f.high=A+K+(I>>>0<q>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(l),e.HmacSHA512=t._createHmacHelper(l)}(),r.SHA512)})),RB((function(e,t){var r,n,i,a,o,s,c,u;e.exports=(n=(r=u=YI).x64,i=n.Word,a=n.WordArray,o=r.algo,s=o.SHA512,c=o.SHA384=s.extend({_doReset:function(){this._hash=new a.init([new i.init(3418070365,3238371032),new i.init(1654270250,914150663),new i.init(2438529370,812702999),new i.init(355462360,4144912697),new i.init(1731405415,4290775857),new i.init(2394180231,1750603025),new i.init(3675008525,1694076839),new i.init(1203062813,3204075428)])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=16,e}}),r.SHA384=s._createHelper(c),r.HmacSHA384=s._createHmacHelper(c),u.SHA384)})),RB((function(e,t){var r;e.exports=(r=YI,function(e){var t=r,n=t.lib,i=n.WordArray,a=n.Hasher,o=t.x64.Word,s=t.algo,c=[],u=[],l=[];!function(){for(var e=1,t=0,r=0;r<24;r++){c[e+5*t]=(r+1)*(r+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)u[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,a=0;a<24;a++){for(var s=0,d=0,f=0;f<7;f++){if(1&i){var p=(1<<f)-1;p<32?d^=1<<p:s^=1<<p-32}128&i?i=i<<1^113:i<<=1}l[a]=o.create(s,d)}}();var d=[];!function(){for(var e=0;e<25;e++)d[e]=o.create()}();var f=s.SHA3=a.extend({cfg:a.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new o.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var r=this._state,n=this.blockSize/2,i=0;i<n;i++){var a=e[t+2*i],o=e[t+2*i+1];a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),(I=r[i]).high^=o,I.low^=a}for(var s=0;s<24;s++){for(var f=0;f<5;f++){for(var p=0,h=0,g=0;g<5;g++)p^=(I=r[f+5*g]).high,h^=I.low;var m=d[f];m.high=p,m.low=h}for(f=0;f<5;f++){var y=d[(f+4)%5],v=d[(f+1)%5],b=v.high,C=v.low;for(p=y.high^(b<<1|C>>>31),h=y.low^(C<<1|b>>>31),g=0;g<5;g++)(I=r[f+5*g]).high^=p,I.low^=h}for(var E=1;E<25;E++){var w=(I=r[E]).high,k=I.low,S=c[E];S<32?(p=w<<S|k>>>32-S,h=k<<S|w>>>32-S):(p=k<<S-32|w>>>64-S,h=w<<S-32|k>>>64-S);var B=d[u[E]];B.high=p,B.low=h}var T=d[0],A=r[0];for(T.high=A.high,T.low=A.low,f=0;f<5;f++)for(g=0;g<5;g++){var I=r[E=f+5*g],_=d[E],x=d[(f+1)%5+5*g],P=d[(f+2)%5+5*g];I.high=_.high^~x.high&P.high,I.low=_.low^~x.low&P.low}I=r[0];var R=l[s];I.high^=R.high,I.low^=R.low}},_doFinalize:function(){var t=this._data,r=t.words,n=(this._nDataBytes,8*t.sigBytes),a=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(e.ceil((n+1)/a)*a>>>5)-1]|=128,t.sigBytes=4*r.length,this._process();for(var o=this._state,s=this.cfg.outputLength/8,c=s/8,u=[],l=0;l<c;l++){var d=o[l],f=d.high,p=d.low;f=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),u.push(p),u.push(f)}return new i.init(u,s)},clone:function(){for(var e=a.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});t.SHA3=a._createHelper(f),t.HmacSHA3=a._createHmacHelper(f)}(Math),r.SHA3)})),RB((function(e,t){var r;e.exports=(r=YI,
|
29
|
+
/** @preserve
|
30
|
+
(c) 2012 by Cédric Mesnil. All rights reserved.
|
31
|
+
|
32
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
33
|
+
|
34
|
+
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
35
|
+
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
36
|
+
|
37
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
38
|
+
*/
|
39
|
+
function(e){var t=r,n=t.lib,i=n.WordArray,a=n.Hasher,o=t.algo,s=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),u=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),l=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),d=i.create([0,1518500249,1859775393,2400959708,2840853838]),f=i.create([1352829926,1548603684,1836072691,2053994217,0]),p=o.RIPEMD160=a.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var a,o,p,C,E,w,k,S,B,T,A,I=this._hash.words,_=d.words,x=f.words,P=s.words,R=c.words,N=u.words,O=l.words;for(w=a=I[0],k=o=I[1],S=p=I[2],B=C=I[3],T=E=I[4],r=0;r<80;r+=1)A=a+e[t+P[r]]|0,A+=r<16?h(o,p,C)+_[0]:r<32?g(o,p,C)+_[1]:r<48?m(o,p,C)+_[2]:r<64?y(o,p,C)+_[3]:v(o,p,C)+_[4],A=(A=b(A|=0,N[r]))+E|0,a=E,E=C,C=b(p,10),p=o,o=A,A=w+e[t+R[r]]|0,A+=r<16?v(k,S,B)+x[0]:r<32?y(k,S,B)+x[1]:r<48?m(k,S,B)+x[2]:r<64?g(k,S,B)+x[3]:h(k,S,B)+x[4],A=(A=b(A|=0,O[r]))+T|0,w=T,T=B,B=b(S,10),S=k,k=A;A=I[1]+p+B|0,I[1]=I[2]+C+T|0,I[2]=I[3]+E+w|0,I[3]=I[4]+a+k|0,I[4]=I[0]+o+S|0,I[0]=A},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,a=i.words,o=0;o<5;o++){var s=a[o];a[o]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return i},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});function h(e,t,r){return e^t^r}function g(e,t,r){return e&t|~e&r}function m(e,t,r){return(e|~t)^r}function y(e,t,r){return e&r|t&~r}function v(e,t,r){return e^(t|~r)}function b(e,t){return e<<t|e>>>32-t}t.RIPEMD160=a._createHelper(p),t.HmacRIPEMD160=a._createHmacHelper(p)}(),r.RIPEMD160)})),RB((function(e,t){var r,n,i;e.exports=(n=(r=YI).lib.Base,i=r.enc.Utf8,void(r.algo.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=i.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var a=this._oKey=t.clone(),o=this._iKey=t.clone(),s=a.words,c=o.words,u=0;u<r;u++)s[u]^=1549556828,c[u]^=909522486;a.sigBytes=o.sigBytes=n,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,r=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(r))}})))})),RB((function(e,t){var r,n,i,a,o,s,c,u,l;e.exports=(i=(n=(r=l=YI).lib).Base,a=n.WordArray,s=(o=r.algo).SHA1,c=o.HMAC,u=o.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:s,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=c.create(r.hasher,e),i=a.create(),o=a.create([1]),s=i.words,u=o.words,l=r.keySize,d=r.iterations;s.length<l;){var f=n.update(t).finalize(o);n.reset();for(var p=f.words,h=p.length,g=f,m=1;m<d;m++){g=n.finalize(g),n.reset();for(var y=g.words,v=0;v<h;v++)p[v]^=y[v]}i.concat(f),u[0]++}return i.sigBytes=4*l,i}}),r.PBKDF2=function(e,t,r){return u.create(r).compute(e,t)},l.PBKDF2)})),RB((function(e,t){var r;e.exports=(r=YI,function(){var e=r,t=e.lib,n=t.Base,i=t.WordArray,a=e.algo,o=a.MD5,s=a.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r,n=this.cfg,a=n.hasher.create(),o=i.create(),s=o.words,c=n.keySize,u=n.iterations;s.length<c;){r&&a.update(r),r=a.update(e).finalize(t),a.reset();for(var l=1;l<u;l++)r=a.finalize(r),a.reset();o.concat(r)}return o.sigBytes=4*c,o}});e.EvpKDF=function(e,t,r){return s.create(r).compute(e,t)}}(),r.EvpKDF)})),RB((function(e,t){var r,n,i,a,o,s,c,u,l,d,f,p,h,g,m,y,v,b,C;e.exports=void((r=YI).lib.Cipher||(n=r,i=n.lib,a=i.Base,o=i.WordArray,s=i.BufferedBlockAlgorithm,c=n.enc,c.Utf8,u=c.Base64,l=n.algo.EvpKDF,d=i.Cipher=s.extend({cfg:a.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){s.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?C:v}return function(t){return{encrypt:function(r,n,i){return e(n).encrypt(t,r,n,i)},decrypt:function(r,n,i){return e(n).decrypt(t,r,n,i)}}}}()}),i.StreamCipher=d.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),f=n.mode={},p=i.BlockCipherMode=a.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),h=f.CBC=function(){var e=p.extend();function t(e,t,r){var n,i=this._iv;i?(n=i,this._iv=undefined):n=this._prevBlock;for(var a=0;a<r;a++)e[t+a]^=n[a]}return e.Encryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize;t.call(this,e,r,i),n.encryptBlock(e,r),this._prevBlock=e.slice(r,r+i)}}),e.Decryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize,a=e.slice(r,r+i);n.decryptBlock(e,r),t.call(this,e,r,i),this._prevBlock=a}}),e}(),g=(n.pad={}).Pkcs7={pad:function(e,t){for(var r=4*t,n=r-e.sigBytes%r,i=n<<24|n<<16|n<<8|n,a=[],s=0;s<n;s+=4)a.push(i);var c=o.create(a,n);e.concat(c)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},i.BlockCipher=d.extend({cfg:d.cfg.extend({mode:h,padding:g}),reset:function(){var e;d.reset.call(this);var t=this.cfg,r=t.iv,n=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=n.createEncryptor:(e=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,r&&r.words):(this._mode=e.call(n,this,r&&r.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),m=i.CipherParams=a.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),y=(n.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;return(r?o.create([1398893684,1701076831]).concat(r).concat(t):t).toString(u)},parse:function(e){var t,r=u.parse(e),n=r.words;return 1398893684==n[0]&&1701076831==n[1]&&(t=o.create(n.slice(2,4)),n.splice(0,4),r.sigBytes-=16),m.create({ciphertext:r,salt:t})}},v=i.SerializableCipher=a.extend({cfg:a.extend({format:y}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),a=i.finalize(t),o=i.cfg;return m.create({ciphertext:a,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),b=(n.kdf={}).OpenSSL={execute:function(e,t,r,n){n||(n=o.random(8));var i=l.create({keySize:t+r}).compute(e,n),a=o.create(i.words.slice(t),4*r);return i.sigBytes=4*t,m.create({key:i,iv:a,salt:n})}},C=i.PasswordBasedCipher=v.extend({cfg:v.cfg.extend({kdf:b}),encrypt:function(e,t,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize);n.iv=i.iv;var a=v.encrypt.call(this,e,t,i.key,n);return a.mixIn(i),a},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt);return n.iv=i.iv,v.decrypt.call(this,e,t,i.key,n)}})))})),RB((function(e,t){var r;e.exports=((r=YI).mode.CFB=function(){var e=r.lib.BlockCipherMode.extend();function t(e,t,r,n){var i,a=this._iv;a?(i=a.slice(0),this._iv=void 0):i=this._prevBlock,n.encryptBlock(i,0);for(var o=0;o<r;o++)e[t+o]^=i[o]}return e.Encryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize;t.call(this,e,r,i,n),this._prevBlock=e.slice(r,r+i)}}),e.Decryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize,a=e.slice(r,r+i);t.call(this,e,r,i,n),this._prevBlock=a}}),e}(),r.mode.CFB)})),RB((function(e,t){var r,n,i;e.exports=((i=YI).mode.CTR=(n=(r=i.lib.BlockCipherMode.extend()).Encryptor=r.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,i=this._iv,a=this._counter;i&&(a=this._counter=i.slice(0),this._iv=void 0);var o=a.slice(0);r.encryptBlock(o,0),a[n-1]=a[n-1]+1|0;for(var s=0;s<n;s++)e[t+s]^=o[s]}}),r.Decryptor=n,r),i.mode.CTR)})),RB((function(e,t){var r;e.exports=(
|
40
|
+
/** @preserve
|
41
|
+
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
42
|
+
* derived from CryptoJS.mode.CTR
|
43
|
+
* Jan Hruby jhruby.web@gmail.com
|
44
|
+
*/
|
45
|
+
(r=YI).mode.CTRGladman=function(){var e=r.lib.BlockCipherMode.extend();function t(e){if(255==(e>>24&255)){var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0,e+=t<<16,e+=r<<8,e+=n}else e+=1<<24;return e}function n(e){return 0===(e[0]=t(e[0]))&&(e[1]=t(e[1])),e}var i=e.Encryptor=e.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,a=this._iv,o=this._counter;a&&(o=this._counter=a.slice(0),this._iv=void 0),n(o);var s=o.slice(0);r.encryptBlock(s,0);for(var c=0;c<i;c++)e[t+c]^=s[c]}});return e.Decryptor=i,e}(),r.mode.CTRGladman)})),RB((function(e,t){var r,n,i;e.exports=((i=YI).mode.OFB=(n=(r=i.lib.BlockCipherMode.extend()).Encryptor=r.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,i=this._iv,a=this._keystream;i&&(a=this._keystream=i.slice(0),this._iv=void 0),r.encryptBlock(a,0);for(var o=0;o<n;o++)e[t+o]^=a[o]}}),r.Decryptor=n,r),i.mode.OFB)})),RB((function(e,t){var r,n;e.exports=((n=YI).mode.ECB=((r=n.lib.BlockCipherMode.extend()).Encryptor=r.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),r.Decryptor=r.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),r),n.mode.ECB)})),RB((function(e,t){var r;e.exports=((r=YI).pad.AnsiX923={pad:function(e,t){var r=e.sigBytes,n=4*t,i=n-r%n,a=r+i-1;e.clamp(),e.words[a>>>2]|=i<<24-a%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Ansix923)})),RB((function(e,t){var r;e.exports=((r=YI).pad.Iso10126={pad:function(e,t){var n=4*t,i=n-e.sigBytes%n;e.concat(r.lib.WordArray.random(i-1)).concat(r.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Iso10126)})),RB((function(e,t){var r;e.exports=((r=YI).pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971)})),RB((function(e,t){var r;e.exports=((r=YI).pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){var t=e.words,r=e.sigBytes-1;for(r=e.sigBytes-1;r>=0;r--)if(t[r>>>2]>>>24-r%4*8&255){e.sigBytes=r+1;break}}},r.pad.ZeroPadding)})),RB((function(e,t){var r;e.exports=((r=YI).pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding)})),RB((function(e,t){var r,n,i,a;e.exports=(n=(r=a=YI).lib.CipherParams,i=r.enc.Hex,r.format.Hex={stringify:function(e){return e.ciphertext.toString(i)},parse:function(e){var t=i.parse(e);return n.create({ciphertext:t})}},a.format.Hex)})),RB((function(e,t){var r;e.exports=(r=YI,function(){var e=r,t=e.lib.BlockCipher,n=e.algo,i=[],a=[],o=[],s=[],c=[],u=[],l=[],d=[],f=[],p=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var r=0,n=0;for(t=0;t<256;t++){var h=n^n<<1^n<<2^n<<3^n<<4;h=h>>>8^255&h^99,i[r]=h,a[h]=r;var g=e[r],m=e[g],y=e[m],v=257*e[h]^16843008*h;o[r]=v<<24|v>>>8,s[r]=v<<16|v>>>16,c[r]=v<<8|v>>>24,u[r]=v,v=16843009*y^65537*m^257*g^16843008*r,l[h]=v<<24|v>>>8,d[h]=v<<16|v>>>16,f[h]=v<<8|v>>>24,p[h]=v,r?(r=g^e[e[e[y^g]]],n^=e[e[n]]):r=n=1}}();var h=[0,1,2,4,8,16,32,64,128,27,54],g=n.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,n=4*((this._nRounds=r+6)+1),a=this._keySchedule=[],o=0;o<n;o++)o<r?a[o]=t[o]:(u=a[o-1],o%r?r>6&&o%r==4&&(u=i[u>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u]):(u=i[(u=u<<8|u>>>24)>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u],u^=h[o/r|0]<<24),a[o]=a[o-r]^u);for(var s=this._invKeySchedule=[],c=0;c<n;c++){if(o=n-c,c%4)var u=a[o];else u=a[o-4];s[c]=c<4||o<=4?u:l[i[u>>>24]]^d[i[u>>>16&255]]^f[i[u>>>8&255]]^p[i[255&u]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,s,c,u,i)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,l,d,f,p,a),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,a,o,s){for(var c=this._nRounds,u=e[t]^r[0],l=e[t+1]^r[1],d=e[t+2]^r[2],f=e[t+3]^r[3],p=4,h=1;h<c;h++){var g=n[u>>>24]^i[l>>>16&255]^a[d>>>8&255]^o[255&f]^r[p++],m=n[l>>>24]^i[d>>>16&255]^a[f>>>8&255]^o[255&u]^r[p++],y=n[d>>>24]^i[f>>>16&255]^a[u>>>8&255]^o[255&l]^r[p++],v=n[f>>>24]^i[u>>>16&255]^a[l>>>8&255]^o[255&d]^r[p++];u=g,l=m,d=y,f=v}g=(s[u>>>24]<<24|s[l>>>16&255]<<16|s[d>>>8&255]<<8|s[255&f])^r[p++],m=(s[l>>>24]<<24|s[d>>>16&255]<<16|s[f>>>8&255]<<8|s[255&u])^r[p++],y=(s[d>>>24]<<24|s[f>>>16&255]<<16|s[u>>>8&255]<<8|s[255&l])^r[p++],v=(s[f>>>24]<<24|s[u>>>16&255]<<16|s[l>>>8&255]<<8|s[255&d])^r[p++],e[t]=g,e[t+1]=m,e[t+2]=y,e[t+3]=v},keySize:8});e.AES=t._createHelper(g)}(),r.AES)})),RB((function(e,t){var r;e.exports=(r=YI,function(){var e=r,t=e.lib,n=t.WordArray,i=t.BlockCipher,a=e.algo,o=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],d=a.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var n=o[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(var i=this._subKeys=[],a=0;a<16;a++){var u=i[a]=[],l=c[a];for(r=0;r<24;r++)u[r/6|0]|=t[(s[r]-1+l)%28]<<31-r%6,u[4+(r/6|0)]|=t[28+(s[r+24]-1+l)%28]<<31-r%6;for(u[0]=u[0]<<1|u[0]>>>31,r=1;r<7;r++)u[r]=u[r]>>>4*(r-1)+3;u[7]=u[7]<<5|u[7]>>>27}var d=this._invSubKeys=[];for(r=0;r<16;r++)d[r]=i[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,r){this._lBlock=e[t],this._rBlock=e[t+1],f.call(this,4,252645135),f.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),f.call(this,1,1431655765);for(var n=0;n<16;n++){for(var i=r[n],a=this._lBlock,o=this._rBlock,s=0,c=0;c<8;c++)s|=u[c][((o^i[c])&l[c])>>>0];this._lBlock=o,this._rBlock=a^s}var d=this._lBlock;this._lBlock=this._rBlock,this._rBlock=d,f.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),f.call(this,16,65535),f.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function f(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<<e}function p(e,t){var r=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<<e}e.DES=i._createHelper(d);var h=a.TripleDES=i.extend({_doReset:function(){var e=this._key.words;if(2!==e.length&&4!==e.length&&e.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var t=e.slice(0,2),r=e.length<4?e.slice(0,2):e.slice(2,4),i=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=d.createEncryptor(n.create(t)),this._des2=d.createEncryptor(n.create(r)),this._des3=d.createEncryptor(n.create(i))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=i._createHelper(h)}(),r.TripleDES)})),RB((function(e,t){var r;e.exports=(r=YI,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,i=n.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,r=e.sigBytes,n=this._S=[],i=0;i<256;i++)n[i]=i;i=0;for(var a=0;i<256;i++){var o=i%r,s=t[o>>>2]>>>24-o%4*8&255;a=(a+n[i]+s)%256;var c=n[i];n[i]=n[a],n[a]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=a.call(this)},keySize:8,ivSize:0});function a(){for(var e=this._S,t=this._i,r=this._j,n=0,i=0;i<4;i++){r=(r+e[t=(t+1)%256])%256;var a=e[t];e[t]=e[r],e[r]=a,n|=e[(e[t]+e[r])%256]<<24-8*i}return this._i=t,this._j=r,n}e.RC4=t._createHelper(i);var o=n.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)a.call(this)}});e.RC4Drop=t._createHelper(o)}(),r.RC4)})),RB((function(e,t){var r;e.exports=(r=YI,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,i=[],a=[],o=[],s=n.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=16711935&(e[r]<<8|e[r]>>>24)|4278255360&(e[r]<<24|e[r]>>>8);var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,r=0;r<4;r++)c.call(this);for(r=0;r<8;r++)i[r]^=n[r+4&7];if(t){var a=t.words,o=a[0],s=a[1],u=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),d=u>>>16|4294901760&l,f=l<<16|65535&u;for(i[0]^=u,i[1]^=d,i[2]^=l,i[3]^=f,i[4]^=u,i[5]^=d,i[6]^=l,i[7]^=f,r=0;r<4;r++)c.call(this)}},_doProcessBlock:function(e,t){var r=this._X;c.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,r=0;r<8;r++)a[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<a[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<a[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<a[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<a[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<a[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<a[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<a[6]>>>0?1:0)|0,this._b=t[7]>>>0<a[7]>>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,s=n>>>16,c=((i*i>>>17)+i*s>>>15)+s*s,u=((4294901760&n)*n|0)+((65535&n)*n|0);o[r]=c^u}e[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,e[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,e[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,e[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,e[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,e[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,e[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,e[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}e.Rabbit=t._createHelper(s)}(),r.Rabbit)})),RB((function(e,t){var r;e.exports=(r=YI,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,i=[],a=[],o=[],s=n.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)c.call(this);for(i=0;i<8;i++)n[i]^=r[i+4&7];if(t){var a=t.words,o=a[0],s=a[1],u=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),d=u>>>16|4294901760&l,f=l<<16|65535&u;for(n[0]^=u,n[1]^=d,n[2]^=l,n[3]^=f,n[4]^=u,n[5]^=d,n[6]^=l,n[7]^=f,i=0;i<4;i++)c.call(this)}},_doProcessBlock:function(e,t){var r=this._X;c.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,r=0;r<8;r++)a[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<a[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<a[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<a[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<a[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<a[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<a[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<a[6]>>>0?1:0)|0,this._b=t[7]>>>0<a[7]>>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,s=n>>>16,c=((i*i>>>17)+i*s>>>15)+s*s,u=((4294901760&n)*n|0)+((65535&n)*n|0);o[r]=c^u}e[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,e[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,e[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,e[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,e[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,e[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,e[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,e[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}e.RabbitLegacy=t._createHelper(s)}(),r.RabbitLegacy)})),RB((function(e,t){e.exports=YI}))),ZI=function(e){var t=e.blob;return new Promise((function(e){var r=new FileReader;r.onload=function(t){var r=t.target.result,n=$I.MD5($I.lib.WordArray.create(r)).toString();e(n)},r.readAsArrayBuffer(t)}))},JI=Object.freeze({__proto__:null,MD5:ZI}),e_=["tracking"],t_=zI(),r_=SC.createContext(),n_={enable:!1,accessKey:"",secretKey:"",apiUrl:"",userId:""},i_=function(){var e=CB(regeneratorRuntime.mark((function e(t){var r,n,i,a,o,s,c,u,l,d,f,p,h,g;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.tag,n=t.event,i=t.log,a=HI(new Date),o=i,e.t0=n,e.next="sdk_mode.read_id_card_one_side"===e.t0?6:"sdk_mode.liveness"===e.t0?19:36;break;case 6:return o=jI(i),s=i.result_object,e.next=10,ZI({blob:s.image.blob});case 10:if(e.t1=e.sent,o.result_object.image={blob:e.t1},delete o.result_object.recordedVideos,!s.qrScannedResult){e.next=18;break}return e.next=16,ZI({blob:s.qrScannedResult.image.blob});case 16:o.result_object.qrScannedResult.image.blob=e.sent,delete o.result_object.qrScannedResult.recordedVideos;case 18:return e.abrupt("break",36);case 19:return o=jI(i),c=i.result_object,u=c.steps,l=c.frontalFaces,d=c.frontalScaledImage,f=u.map((function(e){return ZI({blob:e.image.blob})})),e.next=24,Promise.all(f);case 24:return p=e.sent,u.forEach((function(e,t){o.result_object.steps[t].image.blob=p[t]})),h=l.map((function(e){return ZI({blob:e})})),e.next=29,Promise.all(h);case 29:if(g=e.sent,l.forEach((function(e,t){o.result_object.frontalFaces[t]=g[t]})),!d){e.next=35;break}return e.next=34,ZI({blob:d});case 34:o.result_object.frontalScaledImage=e.sent;case 35:return e.abrupt("break",36);case 36:return e.abrupt("return",{tag:r,event:n,log:kB({device_time:a},o)});case 37:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function a_(e){var t,r=e.userId;if(r)t=r;else{var n=WI("user-id");if(n)t=n;else{var i=qB();t=i,GI(i,"user-id")}}return t}function o_(e){var t=e.value,r=e.children,n=t.tracking,i=void 0===n?n_:n,a=SB(t,e_),o=i.enable,s=i.accessKey,c=i.secretKey,u=i.apiUrl,l=i.userId,d=SC.useMemo((function(){return o?u&&s&&c?new UB(s,c,u):(console.error("apiUrl, accessKey and secretKey are required when tracking is enabled"),null):null}),[o,s,c,u]),f=SC.useMemo((function(){var e=a_({userId:l});return kB(kB({},t_),{},{"x-request-id":e})}),[l]),p=SC.useCallback(CB(regeneratorRuntime.mark((function e(){var t,r,n,i,a,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]?c[0]:{},r=t.tag,n=t.event,i=t.log,a=void 0===i?{}:i,!o){e.next=11;break}return e.prev=2,e.next=5,i_({tag:r,event:n,log:a});case 5:s=e.sent,d.httpClient.post("/v1/log_events",s,f),e.next=11;break;case 9:e.prev=9,e.t0=e.catch(2);case 11:case"end":return e.stop()}}),e,null,[[2,9]])}))),[d,f,o]);return SC.createElement(r_.Provider,{value:kB(kB({},a),{},{sendEvent:p})},r)}function s_(){var e=SC.useContext(r_);return void 0===e?(console.warn("useSDKTracking must be used within a SDKTrackingProvider"),{sendEvent:function(){}}):e}o_.propTypes={value:SE.shape({tracking:SE.shape({enable:SE.bool,accessKey:SE.string,secretKey:SE.string,apiUrl:SE.string,userId:SE.string})}).isRequired,children:SE.node.isRequired};var c_=Object.freeze({__proto__:null,defaultTrackingConfig:n_,getXRequestId:a_,SDKTrackingProvider:o_,useSDKTracking:s_});function u_(e,t){return e&&!e.endsWith("/")?[e,"/",t].join(""):[e,t].join("")}function l_(){var e=yB();return null==e?void 0:e.assetRoot}var d_=Object.freeze({__proto__:null,getAsset:u_,useAssetRoot:l_,useAsset:function(e){return u_(l_(),e)}});function f_(e){return new Promise((function(t){return setTimeout(t,e)}))}var p_=Object.freeze({__proto__:null,sleep:f_}),h_=Symbol("Comlink.proxy"),g_=Symbol("Comlink.endpoint"),m_=Symbol("Comlink.releaseProxy"),y_=Symbol("Comlink.thrown"),v_=function(e){return"object"==Iv(e)&&null!==e||"function"==typeof e},b_=new Map([["proxy",{canHandle:function(e){return v_(e)&&e[h_]},serialize:function(e){var t=new MessageChannel,r=t.port1,n=t.port2;return C_(e,r),[n,[n]]},deserialize:function(e){return e.start(),w_(e)}}],["throw",{canHandle:function(e){return v_(e)&&y_ in e},serialize:function(e){var t=e.value;return[t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[]]},deserialize:function(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function C_(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:self;t.addEventListener("message",(function r(n){if(n&&n.data){var i,a=Object.assign({path:[]},n.data),o=a.id,s=a.type,c=a.path,u=(n.data.argumentList||[]).map(I_);try{var l=c.slice(0,-1).reduce((function(e,t){return e[t]}),e),d=c.reduce((function(e,t){return e[t]}),e);switch(s){case"GET":i=d;break;case"SET":l[c.slice(-1)[0]]=I_(n.data.value),i=!0;break;case"APPLY":i=d.apply(l,u);break;case"CONSTRUCT":i=function(e){return Object.assign(e,Ov({},h_,!0))}(jv(d,Hv(u)));break;case"ENDPOINT":var f=new MessageChannel,p=f.port1,h=f.port2;C_(e,h),i=function(e,t){return T_.set(e,t),e}(p,[p]);break;case"RELEASE":i=void 0;break;default:return}}catch(e){i=Ov({value:e},y_,0)}Promise.resolve(i).catch((function(e){return Ov({value:e},y_,0)})).then((function(e){var n=qv(A_(e),2),i=n[0],a=n[1];t.postMessage(Object.assign(Object.assign({},i),{id:o}),a),"RELEASE"===s&&(t.removeEventListener("message",r),E_(t))}))}})),t.start&&t.start()}function E_(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function w_(e,t){return S_(e,[],t)}function k_(e){if(e)throw new Error("Proxy has been released and is not useable")}function S_(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},n=!1,i=new Proxy(r,{get:function(r,a){if(k_(n),a===m_)return function(){return __(e,{type:"RELEASE",path:t.map((function(e){return e.toString()}))}).then((function(){E_(e),n=!0}))};if("then"===a){if(0===t.length)return{then:function(){return i}};var o=__(e,{type:"GET",path:t.map((function(e){return e.toString()}))}).then(I_);return o.then.bind(o)}return S_(e,[].concat(Hv(t),[a]))},set:function(r,i,a){k_(n);var o=qv(A_(a),2),s=o[0],c=o[1];return __(e,{type:"SET",path:[].concat(Hv(t),[i]).map((function(e){return e.toString()})),value:s},c).then(I_)},apply:function(r,i,a){k_(n);var o=t[t.length-1];if(o===g_)return __(e,{type:"ENDPOINT"}).then(I_);if("bind"===o)return S_(e,t.slice(0,-1));var s=qv(B_(a),2),c=s[0],u=s[1];return __(e,{type:"APPLY",path:t.map((function(e){return e.toString()})),argumentList:c},u).then(I_)},construct:function(r,i){k_(n);var a=qv(B_(i),2),o=a[0],s=a[1];return __(e,{type:"CONSTRUCT",path:t.map((function(e){return e.toString()})),argumentList:o},s).then(I_)}});return i}function B_(e){var t,r=e.map(A_);return[r.map((function(e){return e[0]})),(t=r.map((function(e){return e[1]})),Array.prototype.concat.apply([],t))]}var T_=new WeakMap;function A_(e){var t,r=eb(b_);try{for(r.s();!(t=r.n()).done;){var n=qv(t.value,2),i=n[0],a=n[1];if(a.canHandle(e)){var o=qv(a.serialize(e),2);return[{type:"HANDLER",name:i,value:o[0]},o[1]]}}}catch(e){r.e(e)}finally{r.f()}return[{type:"RAW",value:e},T_.get(e)||[]]}function I_(e){switch(e.type){case"HANDLER":return b_.get(e.name).deserialize(e.value);case"RAW":return e.value}}function __(e,t,r){return new Promise((function(n){var i=new Array(4).fill(0).map((function(){return Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)})).join("-");e.addEventListener("message",(function t(r){r.data&&r.data.id&&r.data.id===i&&(e.removeEventListener("message",t),n(r.data))})),e.start&&e.start(),e.postMessage(Object.assign({id:i},t),r)}))}var x_=function(){if(!window.Worker)return null;var e=new Blob(['const t=Symbol("Comlink.proxy"),e=Symbol("Comlink.endpoint"),r=Symbol("Comlink.releaseProxy"),n=Symbol("Comlink.thrown"),a=t=>"object"==typeof t&&null!==t||"function"==typeof t,o=new Map([["proxy",{canHandle:e=>a(e)&&e[t],serialize(t){const{port1:e,port2:r}=new MessageChannel;return i(t,e),[r,[r]]},deserialize(t){return t.start(),s(t,[],e);var e}}],["throw",{canHandle:t=>a(t)&&n in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function i(e,r=self){r.addEventListener("message",(function a(o){if(!o||!o.data)return;const{id:c,type:s,path:l}=Object.assign({path:[]},o.data),g=(o.data.argumentList||[]).map(m);let p;try{const r=l.slice(0,-1).reduce(((t,e)=>t[e]),e),n=l.reduce(((t,e)=>t[e]),e);switch(s){case"GET":p=n;break;case"SET":r[l.slice(-1)[0]]=m(o.data.value),p=!0;break;case"APPLY":p=n.apply(r,g);break;case"CONSTRUCT":p=function(e){return Object.assign(e,{[t]:!0})}(new n(...g));break;case"ENDPOINT":{const{port1:t,port2:r}=new MessageChannel;i(e,r),p=function(t,e){return f.set(t,e),t}(t,[t])}break;case"RELEASE":p=void 0;break;default:return}}catch(t){p={value:t,[n]:0}}Promise.resolve(p).catch((t=>({value:t,[n]:0}))).then((t=>{const[e,n]=h(t);r.postMessage(Object.assign(Object.assign({},e),{id:c}),n),"RELEASE"===s&&(r.removeEventListener("message",a),u(r))}))})),r.start&&r.start()}function u(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function c(t){if(t)throw new Error("Proxy has been released and is not useable")}function s(t,n=[],a=function(){}){let o=!1;const i=new Proxy(a,{get(e,a){if(c(o),a===r)return()=>g(t,{type:"RELEASE",path:n.map((t=>t.toString()))}).then((()=>{u(t),o=!0}));if("then"===a){if(0===n.length)return{then:()=>i};const e=g(t,{type:"GET",path:n.map((t=>t.toString()))}).then(m);return e.then.bind(e)}return s(t,[...n,a])},set(e,r,a){c(o);const[i,u]=h(a);return g(t,{type:"SET",path:[...n,r].map((t=>t.toString())),value:i},u).then(m)},apply(r,a,i){c(o);const u=n[n.length-1];if(u===e)return g(t,{type:"ENDPOINT"}).then(m);if("bind"===u)return s(t,n.slice(0,-1));const[f,h]=l(i);return g(t,{type:"APPLY",path:n.map((t=>t.toString())),argumentList:f},h).then(m)},construct(e,r){c(o);const[a,i]=l(r);return g(t,{type:"CONSTRUCT",path:n.map((t=>t.toString())),argumentList:a},i).then(m)}});return i}function l(t){const e=t.map(h);return[e.map((t=>t[0])),(r=e.map((t=>t[1])),Array.prototype.concat.apply([],r))];var r}const f=new WeakMap;function h(t){for(const[e,r]of o)if(r.canHandle(t)){const[n,a]=r.serialize(t);return[{type:"HANDLER",name:e,value:n},a]}return[{type:"RAW",value:t},f.get(t)||[]]}function m(t){switch(t.type){case"HANDLER":return o.get(t.name).deserialize(t.value);case"RAW":return t.value}}function g(t,e,r){return new Promise((n=>{const a=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");t.addEventListener("message",(function e(r){r.data&&r.data.id&&r.data.id===a&&(t.removeEventListener("message",e),n(r.data))})),t.start&&t.start(),t.postMessage(Object.assign({id:a},e),r)}))}var p=[[0,1,0],[1,-4,1],[0,1,0]];function d(t,e,r,n){return t[4*(r*e+n)]}function v(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function y(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,a=!1,o=void 0;try{for(var i,u=t[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!e||r.length!==e);n=!0);}catch(t){a=!0,o=t}finally{try{n||null==u.return||u.return()}finally{if(a)throw o}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return b(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var E="frontal",S="left",w="right",M="up",k="down",_=0,A=1,R=2;function L(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=y(t,2),a=n[0],o=n[1],i=y(e,2),u=i[0],c=i[1],s=[a[0],o[0]],l=[a[1],o[1]];return s[0]+r<=u[0]&&c[0]<=s[1]-r&&l[0]+r<=u[1]&&c[1]<=l[1]-.8*r?R:s[0]<=u[0]||c[0]<=s[1]||l[0]<=u[1]||c[1]<=l[1]?A:_}var P={code:"no_face",msg:{en:"Face not found",vi:"Không tìm thấy khuôn mặt"}},O={code:"partial_face",msg:{en:"Face out of the box",vi:"Không tìm thấy toàn bộ khuôn mặt"}},j={code:"multiple_faces",msg:{en:"Too many faces",vi:"Quá nhiều khuôn mặt"}},T={code:"face_too_small",msg:{en:"Face too small",vi:"Khuôn mặt quá nhỏ"}},F={code:"face_too_large",msg:{en:"Face too large",vi:"Khuôn mặt quá to"}},x={code:"face_out_of_box",msg:{en:"Face is out of box",vi:"Khuôn mặt không nằm trọn vẹn trong khung ảnh"}};function C(t){return Math.pow(Math.pow(t[0],2)+Math.pow(t[1],2),.5)}function N(t,e){return[t[0]-e[0],t[1]-e[1]]}function z(t,e,r,n){var a=r*(4*e)+4*n;return{r:t[a],g:t[a+1],b:t[a+2]}}i({calculateBlurScoreFunc:function(t){for(var e=t.data,r=t.reducedWidth,n=t.reducedHeight,a=0;a<e.length;a+=4){var o=(e[a]+e[a+1]+e[a+2])/3;e[a]=o}for(var i=0,u=0,c=n-1,s=r-1,l=1;l<c;l++)for(var f=1;f<s;f++){var h=p[0][0]*d(e,r,f-1,l-1)+p[0][1]*d(e,r,f,l-1)+p[0][2]*d(e,r,f+1,l-1)+p[1][0]*d(e,r,f-1,l)+p[1][1]*d(e,r,f,l)+p[1][2]*d(e,r,f+1,l)+p[2][0]*d(e,r,f-1,l+1)+p[2][1]*d(e,r,f,l+1)+p[2][2]*d(e,r,f+1,l+1);(h=Math.abs(h))>25&&i++,h>15&&h<25&&u++}var m=0;return i+u!==0&&(m=i/(i+u)),m},calculateFaceDirectionFunc:function(t){var e=t.landmarks,r=t.getPerfectFrontal,n=function(t){var e,r,n,a,o,i,u,c=y(t,4),s=c[0],l=c[1],f=c[2],h=c[3],m=N(l,s),g=C(m),p=(a=l,e=[(n=s)[0]+a[0],n[1]+a[1]],r=2,[e[0]/r,e[1]/r]),d=N(f,p),v=C(N(h,f)),b=N(h,p),E=C(b),S=(d[0]*b[0]+d[1]*b[1])/E,w=v/E;if(g>.5*E)o=(d[0]*m[0]+d[1]*m[1])/g/g;else{var M=C(N(d,function(t,e){return[t[0]*e,t[1]*e]}(b,S/E)));u=b,o=((i=d)[0]*u[1]-u[0]*i[1]>=0?1:-1)*M/g}return{left_right_score:o,up_down_score:w}}(e),a=n.left_right_score,o=n.up_down_score,i=y(e,3),u=i[0],c=i[1],s=i[2],l=c[0]-s[0],f=u[0]-s[0],h=r?.1:.3,m=o>.7,g=o<.42,p=a>=.35&&a<=.6,d=a<=-.35&&a>=-.6;return o>=.42&&o<=.7&&a>-h&&a<h&&l*f<0?{gesture:E,leftRightScore:a}:m&&!d&&!p?{gesture:M,leftRightScore:a}:g&&!d&&!p?{gesture:k,leftRightScore:a}:p&&!m&&!g?{gesture:w,leftRightScore:a}:d&&!m&&!g?{gesture:S,leftRightScore:a}:null},validatePredictionsFunc:function(t){var e,r,n,a,o,i,u,c,s,l,f,h,m,g,p,d,b,E,S,w,M,k,C,N,z,H,I,D,K,G,W,U,q=t.predictions,Y=t.width,B=[[0,0],[Y,t.height]],Q=q.reduce((function(t,e){var r=e.topLeft,n=e.bottomRight,a=e.probability,o=e.landmarks;a<.9||o.length<6||function(t){var e=t.small,r=e.coords,n=e.area,a=t.big,o=a.coords,i=a.area,u=n;if(!u){var c=y(r,2),s=c[0],l=c[1];u=(l[0]-s[0])*(l[1]-s[1])}var f=i;if(!f){var h=y(o,2),m=h[0],g=h[1];f=(g[0]-m[0])*(g[1]-m[1])}return u/f}({small:{coords:[r,n]},big:{coords:B}})<=.025?t[_].push(e):t[L(B,[r,n])].push(e);return t}),(v(e={},A,[]),v(e,R,[]),v(e,_,[]),e)),X=Q[R].length,$=Q[A].length;if(0===X)r=$>0?O:P;else if(X+$>1)r=j;else{var J=n=Q[R][0],V=J.topLeft,Z=J.bottomRight,tt=(C=B,N=y([V,Z],2),z=N[0],H=N[1],I=y(C,2),D=I[0],K=I[1],G=H[0]-z[0],W=H[1]-z[1],U=K[0]-D[0],G/U<W/U?G/U:W/U);tt<.4&&(r=T),tt>.61&&(r=F),L(B,(a=n.landmarks,u=a[0],c=a[1],s=a[2],l=a[3],f=a[4],h=a[5],m=.5*(u[1]+c[1]),g=m+1.5*(m-l[1]),p=l[1]-1.2*(s[1]-l[1]),d=[u[0],c[0],s[0],l[0],f[0],h[0]],b=Math.min.apply(Math,d),E=Math.min(g,p),S=Math.max.apply(Math,d),w=Math.max(g,p),M=Math.abs(l[0]-f[0])/Math.abs(l[0]-h[0]),k=l[0]-f[0]<0&&h[0]-l[0]>.05*(S-b),l[0]-f[0]>0&&h[0]-l[0]<-.05*(S-b)?(o=.2,i=.1):k?(o=.1,i=.2):M>2||M<.5?(o=.15,i=.15):(o=.05,i=.05),[[b-o*(S-b),E],[S+i*(S-b),w]]),.05*Y)!==R&&(r=x)}return{error:r,fullFace:n}},detectGlare:function(t,e,r){return function(t,e,r){for(var n=0,a=r[1],o=r[3],i=r[0],u=r[2],c=a;c<o;c++)for(var s=i;s<u;s++){var l=z(t,e,c,s),f=l.r,h=l.g,m=l.b;f>=245&&m>=245&&h>245&&(n+=1)}return n}(t,e,function(t,e){var r=Math.floor(.025*t),n=t-r,a=Math.floor(.025*e);return[r,a,n,e-a]}(e,r))/(e*r)>=.001}});']),t=URL.createObjectURL(e);return w_(new Worker(t))}(),P_=[[0,1,0],[1,-4,1],[0,1,0]];function R_(e,t,r,n){return e[4*(r*t+n)]}function N_(e){for(var t=e.data,r=e.reducedWidth,n=e.reducedHeight,i=0;i<t.length;i+=4){var a=(t[i]+t[i+1]+t[i+2])/3;t[i]=a}for(var o=0,s=0,c=n-1,u=r-1,l=1;l<c;l++)for(var d=1;d<u;d++){var f=P_[0][0]*R_(t,r,d-1,l-1)+P_[0][1]*R_(t,r,d,l-1)+P_[0][2]*R_(t,r,d+1,l-1)+P_[1][0]*R_(t,r,d-1,l)+P_[1][1]*R_(t,r,d,l)+P_[1][2]*R_(t,r,d+1,l)+P_[2][0]*R_(t,r,d-1,l+1)+P_[2][1]*R_(t,r,d,l+1)+P_[2][2]*R_(t,r,d+1,l+1);(f=Math.abs(f))>25&&o++,f>15&&f<25&&s++}var p=0;return o+s!==0&&(p=o/(o+s)),p}function O_(e){var t=e.width,r=e.height,n=e.getContext("2d"),i=Math.floor(t/2.8),a=Math.floor(r/2.8),o=t-i,s=r-a;return{data:n.getImageData(Math.floor(i/2),Math.floor(a/2),o,s).data,reducedWidth:o,reducedHeight:s}}function L_(){return(L_=CB(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=O_(t),x_){e.next=3;break}return e.abrupt("return",N_(r));case 3:return e.abrupt("return",x_.calculateBlurScoreFunc(r));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function D_(e,t,r,n){return e[4*(n*t+r)]}var U_=Object.freeze({__proto__:null,calculateBlurScore:function(e){return L_.apply(this,arguments)},hasBetterBlurScore:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;return null===t||e-t>r},hasBetterCardBlurScore:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;return null===t||t-e>r},calculateIdCardBlurScore:function(e){var t=e.canvas,r=document.createElement("canvas"),n=r.getContext("2d");r.width=430,r.height=270,n.drawImage(t,0,0,r.width,r.height);var i=Math.floor(129),a=Math.floor(13.5),o=Math.floor(408.5),s=Math.floor(256.5),c=document.createElement("canvas"),u=c.getContext("2d"),l=o-i,d=s-a;c.width=l,c.height=d,u.drawImage(r,i,a,l,d,0,0,l,d);for(var f=u.getImageData(0,0,l,d).data,p=0;p<f.length;p+=4){var h=Math.round(.299*f[p]+.587*f[p+1]+.114*f[p+2]);f[p]=h}for(var g=d-1,m=l-1,y=0,v=[],b=1;b<g;b++)for(var C=1;C<m;C++){var E=4*-D_(f,l,C,b)+D_(f,l,C,b-1)+D_(f,l,C,b+1)+D_(f,l,C-1,b)+D_(f,l,C+1,b);y+=E,v.push(E)}y/=(l-2)*(d-2);for(var w=0,k=0;k<v.length;k++){var S=v[k]-y;w+=Math.pow(S,2)}var B=Math.sqrt(w/v.length);return 1/(1+Math.pow(2,B/2-10))}});function M_(e){var t,r,n,i,a,o,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,u=s.x,l=s.y,d=s.width,f=s.height,p=e.videoWidth,h=e.videoHeight,g=window.innerWidth,m=window.innerHeight,y=g/m,v=p/h;y<v?(a=u*(n=p/g),o=(l-(t=(m-g/v)/2))*(i=h/(m-2*t))):(a=(u-(r=(g-m*v)/2))*(n=p/(g-2*r)),o=l*(i=h/m));var b=d*n,C=f*i,E=b,w=C,k=Math.max(b,C)*c;return{lostX:r,lostY:t,cropWidth:b=Math.floor(Math.min(p,b+2*k)),cropHeight:C=Math.floor(Math.min(h,C+2*k)),cropX:a=Math.floor(Math.max(0,a-k)),cropY:o=Math.floor(Math.max(0,o-k)),cropWidthWithoutPadding:E,cropHeightWithoutPadding:w}}var V_=Object.freeze({__proto__:null,analyzeVideoAndWindowSizes:M_,takePicture:function(e){var t,r=e.canvas,n=e.video,i=e.cropArea;if(r)t=r;else{var a=M_(n,i),o=a.cropWidth,s=a.cropHeight,c=a.cropX,u=a.cropY,l=(t=document.createElement("canvas")).getContext("2d");t.width=o,t.height=s,l.drawImage(n,c,u,o,s,0,0,o,s)}return new Promise((function(e){t.toBlob(e,"image/jpeg",1)}))}}),j_=function(e){for(var t=e.length-1;t>0;t--){var r=Math.floor(Math.random()*(t+1)),n=[e[r],e[t]];e[t]=n[0],e[r]=n[1]}return e},F_=Object.freeze({__proto__:null,shuffleArray:j_}),z_={NONE:0,PARTIAL:1,FULL:2};function K_(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=BB(e,2),i=n[0],a=n[1],o=BB(t,2),s=o[0],c=o[1],u=[i[0],a[0]],l=[i[1],a[1]];return u[0]+r<=s[0]&&c[0]<=u[1]-r&&l[0]+r<=s[1]&&c[1]<=l[1]-.8*r?z_.FULL:u[0]<=s[0]||c[0]<=u[1]||l[0]<=s[1]||c[1]<=l[1]?z_.PARTIAL:z_.NONE}function q_(e){var t=e.small,r=t.coords,n=t.area,i=e.big,a=i.coords,o=i.area,s=n;if(!s){var c=BB(r,2),u=c[0],l=c[1];s=(l[0]-u[0])*(l[1]-u[1])}var d=o;if(!d){var f=BB(a,2),p=f[0],h=f[1];d=(h[0]-p[0])*(h[1]-p[1])}return s/d}function H_(e,t){var r=BB(e,2),n=r[0],i=r[1],a=BB(t,2),o=a[0],s=a[1],c=i[0]-n[0],u=i[1]-n[1],l=s[0]-o[0];return c/l<u/l?c/l:u/l}var Q_=Object.freeze({__proto__:null,ContainMode:z_,rectContains:K_,rectAreaRatio:q_,rectEdgeRatio:H_,isFaceCenter:function(e,t){var r=BB(e,2),n=r[0],i=r[1],a=BB(t,2),o=a[0],s=a[1],c=i[0]-n[0],u=i[1]-n[1],l=s[0]-o[0],d=Math.abs(n[0]-(l-c)/2)/l<.2,f=Math.abs(n[1]-(l-u)/2)/l<.2;return!(!d||!f)}});function G_(e){return Math.pow(Math.pow(e[0],2)+Math.pow(e[1],2),.5)}function W_(e,t){return[e[0]-t[0],e[1]-t[1]]}function X_(e){var t=e.landmarks,r=e.getPerfectFrontal,n=function(e){var t,r,n,i,a,o,s=BB(e,4),c=s[0],u=s[1],l=s[2],d=s[3],f=W_(u,c),p=G_(f),h=(n=u,2,[(t=[(r=c)[0]+n[0],r[1]+n[1]])[0]/2,t[1]/2]),g=W_(l,h),m=G_(W_(d,l)),y=W_(d,h),v=G_(y),b=(g[0]*y[0]+g[1]*y[1])/v,C=m/v;if(p>.5*v)i=(g[0]*f[0]+g[1]*f[1])/p/p;else{var E=G_(W_(g,function(e,t){return[e[0]*t,e[1]*t]}(y,b/v)));o=y,i=((a=g)[0]*o[1]-o[0]*a[1]>=0?1:-1)*E/p}return{left_right_score:i,up_down_score:C}}(t),i=n.left_right_score,a=n.up_down_score,o=BB(t,3),s=o[0],c=o[1],u=o[2],l=c[0]-u[0],d=s[0]-u[0],f=r?.1:.3,p=a>.7,h=a<.42,g=i>=.35&&i<=.6,m=i<=-.35&&i>=-.6;return a>=.42&&a<=.7&&i>-f&&i<f&&l*d<0?{gesture:pB.FRONTAL,leftRightScore:i}:!p||m||g?!h||m||g?!g||p||h?!m||p||h?null:{gesture:pB.LEFT,leftRightScore:i}:{gesture:pB.RIGHT,leftRightScore:i}:{gesture:pB.DOWN,leftRightScore:i}:{gesture:pB.UP,leftRightScore:i}}function Y_(e){var t,r,n,i,a,o,s,c,u,l,d,f,p,h,g,m,y,v,b,C,E,w,k=e.predictions,S=e.width,B=[[0,0],[S,e.height]],T=k.reduce((function(e,t){var r=t.topLeft,n=t.bottomRight,i=t.probability,a=t.landmarks;return i<.9||a.length<6||q_({small:{coords:[r,n]},big:{coords:B}})<=.025?e[z_.NONE].push(t):e[K_(B,[r,n])].push(t),e}),(EB(t={},z_.PARTIAL,[]),EB(t,z_.FULL,[]),EB(t,z_.NONE,[]),t)),A=T[z_.FULL].length,I=T[z_.PARTIAL].length;if(0===A)r=I>0?fB.partial_face:fB.no_face;else if(A+I>1)r=fB.multiple_faces;else{var _=n=T[z_.FULL][0],x=H_([_.topLeft,_.bottomRight],B);x<.4&&(r=fB.face_too_small),x>.61&&(r=fB.face_too_large),K_(B,(s=(i=n.landmarks)[0],c=i[1],u=i[2],l=i[3],d=i[4],f=i[5],h=(p=.5*(s[1]+c[1]))+1.5*(p-l[1]),g=l[1]-1.2*(u[1]-l[1]),m=[s[0],c[0],u[0],l[0],d[0],f[0]],y=Math.min.apply(Math,m),v=Math.min(h,g),b=Math.max.apply(Math,m),C=Math.max(h,g),E=Math.abs(l[0]-d[0])/Math.abs(l[0]-f[0]),w=l[0]-d[0]<0&&f[0]-l[0]>.05*(b-y),l[0]-d[0]>0&&f[0]-l[0]<-.05*(b-y)?(a=.2,o=.1):w?(a=.1,o=.2):E>2||E<.5?(a=.15,o=.15):(a=.05,o=.05),[[y-a*(b-y),v],[b+o*(b-y),C]]),.05*S)!==z_.FULL&&(r=fB.face_out_of_box)}return{error:r,fullFace:n}}function $_(e,t){var r=t.customInstructions,n=t.customIcon,i=t.customDirectionIcon,a=t.customStepTimeConstraints,o={};return null!=r&&r[e]&&(o.instructions=r[e]),null!=n&&n[e]&&(o.icon=n[e]),null!=i&&i[e]&&(o.directionIcon=i[e]),null!=a&&a[e]&&(o.stepTimeConstraints=a[e]),o}function Z_(){return(Z_=CB(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(x_){e.next=2;break}return e.abrupt("return",Y_(t));case 2:return e.abrupt("return",x_.validatePredictionsFunc(t));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function J_(){return(J_=CB(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(x_){e.next=2;break}return e.abrupt("return",X_(t));case 2:return e.abrupt("return",x_.calculateFaceDirectionFunc(t));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ex=Object.freeze({__proto__:null,initFaceVerificationData:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.assetRoot,r=void 0===t?"/":t,n=e.customInstructions,i=e.customIcon,a=e.customDirectionIcon,o=e.customStepTimeConstraints;return{curStepIndex:0,steps:[].concat(TB(j_([kB({name:pB.LEFT,instructions:{en:"Turn your face to the left",vi:"Quay mặt chậm qua trái"},image:{blob:null,imageId:null,objUrl:null,blurScore:null,leftRightScore:null},frontalFaceImage:{blob:null,imageId:null,blurScore:null,leftRightScore:null},icon:u_(r,"ic_face_left.svg"),directionIcon:u_(r,"arrow_left.svg"),directionIconAnimation:"slide-horizontal",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},$_(pB.LEFT,{customInstructions:n,customIcon:i,customDirectionIcon:a,customStepTimeConstraints:o})),kB({name:pB.RIGHT,instructions:{en:"Turn your face to the right",vi:"Quay mặt chậm qua phải"},image:{blob:null,imageId:null,objUrl:null,blurScore:null,leftRightScore:null},frontalFaceImage:{blob:null,imageId:null,blurScore:null,leftRightScore:null},icon:u_(r,"ic_face_right.svg"),directionIcon:u_(r,"arrow_right.svg"),directionIconAnimation:"slide-horizontal",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},$_(pB.RIGHT,{customInstructions:n,customIcon:i,customDirectionIcon:a,customStepTimeConstraints:o})),kB({name:pB.UP,instructions:{en:"Turn your face up",vi:"Ngước mặt chậm lên trên"},image:{blob:null,imageId:null,objUrl:null,blurScore:null,leftRightScore:null},frontalFaceImage:{blob:null,imageId:null,blurScore:null,leftRightScore:null},icon:u_(r,"ic_face_up.svg"),directionIcon:u_(r,"arrow_up.svg"),directionIconAnimation:"slide-vertical",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},$_(pB.UP,{customInstructions:n,customIcon:i,customDirectionIcon:a,customStepTimeConstraints:o}))])),[kB({name:pB.FRONTAL,instructions:{en:"Look straight into the camera",vi:"Nhìn thẳng camera"},image:{blob:null,imageId:null,objUrl:null,blurScore:null,leftRightScore:null},frontalFaceImage:{blob:null,imageId:null,blurScore:null,leftRightScore:null},icon:u_(r,"ic_face_frontal.svg"),directionIcon:u_(r,"frontal.svg"),directionIconAnimation:"blink",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},$_(pB.FRONTAL,{customInstructions:n,customIcon:i,customDirectionIcon:a,customStepTimeConstraints:o}))])}},validatePredictions:function(e){return Z_.apply(this,arguments)},calculateFaceDirection:function(e){return J_.apply(this,arguments)},faceTracker:function(){var e=[],t=[],r=[],n=[],i=[],a=0,o=0;function s(){o=a,r=TB(e),n=TB(t)}return function(c,u){var l=c.topLeft,d=c.bottomRight,f=c.landmarks,p=[],h=BB(l,2);p[0]=h[0],p[1]=h[1];var g=BB(d,2);p[2]=g[0],p[3]=g[1];var m=[],y=[];f.forEach((function(e,t){var r=BB(e,2);m[t]=r[0],y[t]=r[1]})),a=Date.now();var v=p[2]-p[0];if(e=[].concat(m),t=[].concat(y),!r.length&&!n.length||u)return s(),{score:0,time:a};for(var b=0;b<6;b++)i[b]=Math.sqrt((e[b]-r[b])*(e[b]-r[b])+(t[b]-n[b])*(t[b]-n[b]));for(var C=0;C<6;C++)i[C]/=(a-o)*v;for(var E=0,w=0;w<6;w++)E+=i[w];return E/=6,s(),{score:E,time:a}}}}),tx=document.createElement("canvas"),rx=tx.getContext("2d");tx.width=128,tx.height=128;var nx=function(){var e=CB(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.model,n=t.sCanvas,rx.drawImage(n,0,0,tx.width,tx.height),e.abrupt("return",r.estimateFaces(tx,!1,!1,!0));case 3:case"end":return e.stop()}var n}),e)})));return function(t){return e.apply(this,arguments)}}(),ix=Object.freeze({__proto__:null,SIZE:128,getModelPredictions:nx}),ax=Object.getOwnPropertySymbols,ox=Object.prototype.hasOwnProperty,sx=Object.prototype.propertyIsEnumerable;function cx(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var ux,lx=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,n,i=cx(e),a=1;a<arguments.length;a++){for(var o in r=Object(arguments[a]))ox.call(r,o)&&(i[o]=r[o]);if(ax){n=ax(r);for(var s=0;s<n.length;s++)sx.call(r,n[s])&&(i[n[s]]=r[n[s]])}}return i},dx=arguments[3],fx=arguments[4],px=arguments[5],hx=JSON.stringify,gx=function(e,t){for(var r,n=Object.keys(px),i=0,a=n.length;i<a;i++){var o=n[i],s=px[o].exports;if(s===e||s&&s.default===e){r=o;break}}if(!r){r=Math.floor(Math.pow(16,8)*Math.random()).toString(16);var c={};for(i=0,a=n.length;i<a;i++)c[o=n[i]]=o;fx[r]=["function(require,module,exports){"+e+"(self); }",c]}var u=Math.floor(Math.pow(16,8)*Math.random()).toString(16),l={};l[r]=r,fx[u]=["function(require,module,exports){var f = require("+hx(r)+");(f.default ? f.default : f)(self);}",l];var d={};!function e(t){for(var r in d[t]=!0,fx[t][1]){var n=fx[t][1][r];d[n]||e(n)}}(u);var f="("+dx+")({"+Object.keys(d).map((function(e){return hx(e)+":["+fx[e][0]+","+hx(fx[e][1])+"]"})).join(",")+"},{},["+hx(u)+"])",p=window.URL||window.webkitURL||window.mozURL||window.msURL,h=new Blob([f],{type:"text/javascript"});if(t&&t.bare)return h;var g=p.createObjectURL(h),m=new Worker(g);return m.objectURL=g,m},mx=RB((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}})),yx={js:!0,wasm:!0};function vx(e){if(!(this instanceof vx))return new vx(e);var t=lx({},yx,e||{});if(this.options=t,this.__cache={},this.__init_promise=null,this.__modules=t.modules||{},this.__memory=null,this.__wasm={},this.__isLE=1===new Uint32Array(new Uint8Array([1,0,0,0]).buffer)[0],!this.options.js&&!this.options.wasm)throw new Error('mathlib: at least "js" or "wasm" should be enabled')}vx.prototype.has_wasm=function(){if(void 0!==ux)return ux;if(ux=!1,"undefined"==typeof WebAssembly)return ux;try{var e=new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,127,1,127,3,2,1,0,5,3,1,0,1,7,8,1,4,116,101,115,116,0,0,10,16,1,14,0,32,0,65,1,54,2,0,32,0,40,2,0,11]),t=new WebAssembly.Module(e);return 0!==new WebAssembly.Instance(t,{}).exports.test(4)&&(ux=!0),ux}catch(e){}return ux},vx.prototype.use=function(e){return this.__modules[e.name]=e,this.options.wasm&&this.has_wasm()&&e.wasm_fn?this[e.name]=e.wasm_fn:this[e.name]=e.fn,this},vx.prototype.init=function(){if(this.__init_promise)return this.__init_promise;if(!this.options.js&&this.options.wasm&&!this.has_wasm())return Promise.reject(new Error('mathlib: only "wasm" was enabled, but it\'s not supported'));var e=this;return this.__init_promise=Promise.all(Object.keys(e.__modules).map((function(t){var r=e.__modules[t];return e.options.wasm&&e.has_wasm()&&r.wasm_fn?e.__wasm[t]?null:WebAssembly.compile(e.__base64decode(r.wasm_src)).then((function(r){e.__wasm[t]=r})):null}))).then((function(){return e})),this.__init_promise},vx.prototype.__base64decode=function(e){for(var t=e.replace(/[\r\n=]/g,""),r=t.length,n=new Uint8Array(3*r>>2),i=0,a=0,o=0;o<r;o++)o%4==0&&o&&(n[a++]=i>>16&255,n[a++]=i>>8&255,n[a++]=255&i),i=i<<6|"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(t.charAt(o));var s=r%4*6;return 0===s?(n[a++]=i>>16&255,n[a++]=i>>8&255,n[a++]=255&i):18===s?(n[a++]=i>>10&255,n[a++]=i>>2&255):12===s&&(n[a++]=i>>4&255),n},vx.prototype.__reallocate=function(e){if(!this.__memory)return this.__memory=new WebAssembly.Memory({initial:Math.ceil(e/65536)}),this.__memory;var t=this.__memory.buffer.byteLength;return t<e&&this.__memory.grow(Math.ceil((e-t)/65536)),this.__memory},vx.prototype.__instance=function(e,t,r){if(t&&this.__reallocate(t),!this.__wasm[e]){var n=this.__modules[e];this.__wasm[e]=new WebAssembly.Module(this.__base64decode(n.wasm_src))}if(!this.__cache[e]){var i={memoryBase:0,memory:this.__memory,tableBase:0,table:new WebAssembly.Table({initial:0,element:"anyfunc"})};this.__cache[e]=new WebAssembly.Instance(this.__wasm[e],{env:lx(i,r||{})})}return this.__cache[e]},vx.prototype.__align=function(e,t){var r=e%(t=t||8);return e+(r?t-r:0)};var bx,Cx,Ex,wx,kx,Sx,Bx=vx;function Tx(e,t,r,n,i,a){var o,s,c,u,l,d,f,p,h,g,m,y,v,b;for(h=0;h<a;h++){for(f=h,p=0,u=l=(o=e[d=h*i])*n[6],m=n[0],y=n[1],v=n[4],b=n[5],g=0;g<i;g++)c=(s=e[d])*m+o*y+u*v+l*b,l=u,u=c,o=s,r[p]=u,p++,d++;for(p--,f+=a*(i-1),u=l=(o=e[--d])*n[7],s=o,m=n[2],y=n[3],g=i-1;g>=0;g--)c=s*m+o*y+u*v+l*b,l=u,u=c,o=s,s=e[d],t[f]=r[p]+u,d--,p--,f-=a}}var Ax=function(e,t,r,n){if(n){var i=new Uint16Array(e.length),a=new Float32Array(Math.max(t,r)),o=function(e){e<.5&&(e=.5);var t=Math.exp(.527076)/e,r=Math.exp(-t),n=Math.exp(-2*t),i=(1-r)*(1-r)/(1+2*t*r-n);return bx=i,Cx=i*(t-1)*r,Ex=i*(t+1)*r,wx=-i*n,kx=2*r,Sx=-n,new Float32Array([bx,Cx,Ex,wx,kx,Sx,(bx+Cx)/(1-kx-Sx),(Ex+wx)/(1-kx-Sx)])}(n);Tx(e,i,a,o,t,r),Tx(i,e,a,o,r,t)}},Ix={name:"unsharp_mask",fn:function(e,t,r,n,i,a){var o,s,c,u,l,d,f,p,h,g,m,y,v;if(!(0===n||i<.5)){i>2&&(i=2);var b=function(e,t,r){for(var n,i,a,o,s,c=t*r,u=new Uint16Array(c),l=0;l<c;l++)n=e[4*l],i=e[4*l+1],a=e[4*l+2],s=n>=i&&n>=a?n:i>=a&&i>=n?i:a,o=n<=i&&n<=a?n:i<=a&&i<=n?i:a,u[l]=257*(s+o)>>1;return u}(e,t,r),C=new Uint16Array(b);Ax(C,t,r,i);for(var E=n/100*4096+.5|0,w=257*a|0,k=t*r,S=0;S<k;S++)y=2*(b[S]-C[S]),Math.abs(y)>=w&&(o=e[v=4*S],s=e[v+1],c=e[v+2],d=257*((p=o>=s&&o>=c?o:s>=o&&s>=c?s:c)+(f=o<=s&&o<=c?o:s<=o&&s<=c?s:c))>>1,f===p?u=l=0:(l=d<=32767?4095*(p-f)/(p+f)|0:4095*(p-f)/(510-p-f)|0,u=o===p?65535*(s-c)/(6*(p-f))|0:s===p?21845+(65535*(c-o)/(6*(p-f))|0):43690+(65535*(o-s)/(6*(p-f))|0)),(d+=E*y+2048>>12)>65535?d=65535:d<0&&(d=0),0===l?o=s=c=d>>8:(h=2*d-(g=d<=32767?d*(4096+l)+2048>>12:d+((65535-d)*l+2048>>12))>>8,g>>=8,o=(m=u+21845&65535)>=43690?h:m>=32767?h+(6*(g-h)*(43690-m)+32768>>16):m>=10922?g:h+(6*(g-h)*m+32768>>16),s=(m=65535&u)>=43690?h:m>=32767?h+(6*(g-h)*(43690-m)+32768>>16):m>=10922?g:h+(6*(g-h)*m+32768>>16),c=(m=u-21845&65535)>=43690?h:m>=32767?h+(6*(g-h)*(43690-m)+32768>>16):m>=10922?g:h+(6*(g-h)*m+32768>>16)),e[v]=o,e[v+1]=s,e[v+2]=c)}},wasm_fn:function(e,t,r,n,i,a){if(!(0===n||i<.5)){i>2&&(i=2);var o=t*r,s=4*o,c=2*o,u=2*o,l=4*Math.max(t,r),d=s,f=d+c,p=f+u,h=p+u,g=h+l,m=this.__instance("unsharp_mask",s+c+2*u+l+32,{exp:Math.exp}),y=new Uint32Array(e.buffer);new Uint32Array(this.__memory.buffer).set(y);var v=m.exports.hsl_l16||m.exports._hsl_l16;v(0,d,t,r),(v=m.exports.blurMono16||m.exports._blurMono16)(d,f,p,h,g,t,r,i),(v=m.exports.unsharp||m.exports._unsharp)(0,0,d,f,t,r,n,a),y.set(new Uint32Array(this.__memory.buffer,0,o))}},wasm_src:"AGFzbQEAAAABMQZgAXwBfGACfX8AYAZ/f39/f38AYAh/f39/f39/fQBgBH9/f38AYAh/f39/f39/fwACGQIDZW52A2V4cAAAA2VudgZtZW1vcnkCAAEDBgUBAgMEBQQEAXAAAAdMBRZfX2J1aWxkX2dhdXNzaWFuX2NvZWZzAAEOX19nYXVzczE2X2xpbmUAAgpibHVyTW9ubzE2AAMHaHNsX2wxNgAEB3Vuc2hhcnAABQkBAAqJEAXZAQEGfAJAIAFE24a6Q4Ia+z8gALujIgOaEAAiBCAEoCIGtjgCECABIANEAAAAAAAAAMCiEAAiBbaMOAIUIAFEAAAAAAAA8D8gBKEiAiACoiAEIAMgA6CiRAAAAAAAAPA/oCAFoaMiArY4AgAgASAEIANEAAAAAAAA8L+gIAKioiIHtjgCBCABIAQgA0QAAAAAAADwP6AgAqKiIgO2OAIIIAEgBSACoiIEtow4AgwgASACIAegIAVEAAAAAAAA8D8gBqGgIgKjtjgCGCABIAMgBKEgAqO2OAIcCwu3AwMDfwR9CHwCQCADKgIUIQkgAyoCECEKIAMqAgwhCyADKgIIIQwCQCAEQX9qIgdBAEgiCA0AIAIgAC8BALgiDSADKgIYu6IiDiAJuyIQoiAOIAq7IhGiIA0gAyoCBLsiEqIgAyoCALsiEyANoqCgoCIPtjgCACACQQRqIQIgAEECaiEAIAdFDQAgBCEGA0AgAiAOIBCiIA8iDiARoiANIBKiIBMgAC8BALgiDaKgoKAiD7Y4AgAgAkEEaiECIABBAmohACAGQX9qIgZBAUoNAAsLAkAgCA0AIAEgByAFbEEBdGogAEF+ai8BACIIuCINIAu7IhGiIA0gDLsiEqKgIA0gAyoCHLuiIg4gCrsiE6KgIA4gCbsiFKKgIg8gAkF8aioCALugqzsBACAHRQ0AIAJBeGohAiAAQXxqIQBBACAFQQF0ayEHIAEgBSAEQQF0QXxqbGohBgNAIAghAyAALwEAIQggBiANIBGiIAO4Ig0gEqKgIA8iECAToqAgDiAUoqAiDyACKgIAu6CrOwEAIAYgB2ohBiAAQX5qIQAgAkF8aiECIBAhDiAEQX9qIgRBAUoNAAsLCwvfAgIDfwZ8AkAgB0MAAAAAWw0AIARE24a6Q4Ia+z8gB0MAAAA/l7ujIgyaEAAiDSANoCIPtjgCECAEIAxEAAAAAAAAAMCiEAAiDraMOAIUIAREAAAAAAAA8D8gDaEiCyALoiANIAwgDKCiRAAAAAAAAPA/oCAOoaMiC7Y4AgAgBCANIAxEAAAAAAAA8L+gIAuioiIQtjgCBCAEIA0gDEQAAAAAAADwP6AgC6KiIgy2OAIIIAQgDiALoiINtow4AgwgBCALIBCgIA5EAAAAAAAA8D8gD6GgIgujtjgCGCAEIAwgDaEgC6O2OAIcIAYEQCAFQQF0IQogBiEJIAIhCANAIAAgCCADIAQgBSAGEAIgACAKaiEAIAhBAmohCCAJQX9qIgkNAAsLIAVFDQAgBkEBdCEIIAUhAANAIAIgASADIAQgBiAFEAIgAiAIaiECIAFBAmohASAAQX9qIgANAAsLC7wBAQV/IAMgAmwiAwRAQQAgA2shBgNAIAAoAgAiBEEIdiIHQf8BcSECAn8gBEH/AXEiAyAEQRB2IgRB/wFxIgVPBEAgAyIIIAMgAk8NARoLIAQgBCAHIAIgA0kbIAIgBUkbQf8BcQshCAJAIAMgAk0EQCADIAVNDQELIAQgByAEIAMgAk8bIAIgBUsbQf8BcSEDCyAAQQRqIQAgASADIAhqQYECbEEBdjsBACABQQJqIQEgBkEBaiIGDQALCwvTBgEKfwJAIAazQwAAgEWUQwAAyEKVu0QAAAAAAADgP6CqIQ0gBSAEbCILBEAgB0GBAmwhDgNAQQAgAi8BACADLwEAayIGQQF0IgdrIAcgBkEASBsgDk8EQCAAQQJqLQAAIQUCfyAALQAAIgYgAEEBai0AACIESSIJRQRAIAYiCCAGIAVPDQEaCyAFIAUgBCAEIAVJGyAGIARLGwshCAJ/IAYgBE0EQCAGIgogBiAFTQ0BGgsgBSAFIAQgBCAFSxsgCRsLIgogCGoiD0GBAmwiEEEBdiERQQAhDAJ/QQAiCSAIIApGDQAaIAggCmsiCUH/H2wgD0H+AyAIayAKayAQQYCABEkbbSEMIAYgCEYEQCAEIAVrQf//A2wgCUEGbG0MAQsgBSAGayAGIARrIAQgCEYiBhtB//8DbCAJQQZsbUHVqgFBqtUCIAYbagshCSARIAcgDWxBgBBqQQx1aiIGQQAgBkEAShsiBkH//wMgBkH//wNIGyEGAkACfwJAIAxB//8DcSIFBEAgBkH//wFKDQEgBUGAIGogBmxBgBBqQQx2DAILIAZBCHYiBiEFIAYhBAwCCyAFIAZB//8Dc2xBgBBqQQx2IAZqCyIFQQh2IQcgBkEBdCAFa0EIdiIGIQQCQCAJQdWqAWpB//8DcSIFQanVAksNACAFQf//AU8EQEGq1QIgBWsgByAGa2xBBmxBgIACakEQdiAGaiEEDAELIAchBCAFQanVAEsNACAFIAcgBmtsQQZsQYCAAmpBEHYgBmohBAsCfyAGIgUgCUH//wNxIghBqdUCSw0AGkGq1QIgCGsgByAGa2xBBmxBgIACakEQdiAGaiAIQf//AU8NABogByIFIAhBqdUASw0AGiAIIAcgBmtsQQZsQYCAAmpBEHYgBmoLIQUgCUGr1QJqQf//A3EiCEGp1QJLDQAgCEH//wFPBEBBqtUCIAhrIAcgBmtsQQZsQYCAAmpBEHYgBmohBgwBCyAIQanVAEsEQCAHIQYMAQsgCCAHIAZrbEEGbEGAgAJqQRB2IAZqIQYLIAEgBDoAACABQQFqIAU6AAAgAUECaiAGOgAACyADQQJqIQMgAkECaiECIABBBGohACABQQRqIQEgC0F/aiILDQALCwsL"},_x=[{win:.5,filter:function(e){return e>=-.5&&e<.5?1:0}},{win:1,filter:function(e){if(e<=-1||e>=1)return 0;if(e>-1.1920929e-7&&e<1.1920929e-7)return 1;var t=e*Math.PI;return Math.sin(t)/t*(.54+.46*Math.cos(t/1))}},{win:2,filter:function(e){if(e<=-2||e>=2)return 0;if(e>-1.1920929e-7&&e<1.1920929e-7)return 1;var t=e*Math.PI;return Math.sin(t)/t*Math.sin(t/2)/(t/2)}},{win:3,filter:function(e){if(e<=-3||e>=3)return 0;if(e>-1.1920929e-7&&e<1.1920929e-7)return 1;var t=e*Math.PI;return Math.sin(t)/t*Math.sin(t/3)/(t/3)}}];function xx(e){return Math.round(16383*e)}var Px=function(e,t,r,n,i){var a,o,s,c,u,l,d,f,p,h,g,m,y,v,b,C,E,w=_x[e].filter,k=1/n,S=Math.min(1,n),B=_x[e].win/S,T=Math.floor(2*(B+1)),A=new Int16Array((T+2)*r),I=0,_=!A.subarray||!A.set;for(a=0;a<r;a++){for(o=(a+.5)*k+i,s=Math.max(0,Math.floor(o-B)),u=(c=Math.min(t-1,Math.ceil(o+B)))-s+1,l=new Float32Array(u),d=new Int16Array(u),f=0,p=s,h=0;p<=c;p++,h++)f+=g=w((p+.5-o)*S),l[h]=g;for(m=0,h=0;h<l.length;h++)m+=y=l[h]/f,d[h]=xx(y);for(d[r>>1]+=xx(1-m),v=0;v<d.length&&0===d[v];)v++;if(v<d.length){for(b=d.length-1;b>0&&0===d[b];)b--;if(C=s+v,E=b-v+1,A[I++]=C,A[I++]=E,_)for(h=v;h<=b;h++)A[I++]=d[h];else A.set(d.subarray(v,b+1),I),I+=E}else A[I++]=0,A[I++]=0}return A};function Rx(e){return e<0?0:e>255?255:e}var Nx=function(e,t,r,n,i,a){var o,s,c,u,l,d,f,p,h,g,m,y=0,v=0;for(h=0;h<n;h++){for(l=0,g=0;g<i;g++){for(d=a[l++],f=a[l++],p=y+4*d|0,o=s=c=u=0;f>0;f--)u=u+(m=a[l++])*e[p+3]|0,c=c+m*e[p+2]|0,s=s+m*e[p+1]|0,o=o+m*e[p]|0,p=p+4|0;t[v+3]=Rx(u+8192>>14),t[v+2]=Rx(c+8192>>14),t[v+1]=Rx(s+8192>>14),t[v]=Rx(o+8192>>14),v=v+4*n|0}v=4*(h+1)|0,y=(h+1)*r*4|0}},Ox=function(e,t,r,n,i,a){var o,s,c,u,l,d,f,p,h,g,m,y=0,v=0;for(h=0;h<n;h++){for(l=0,g=0;g<i;g++){for(d=a[l++],f=a[l++],p=y+4*d|0,o=s=c=u=0;f>0;f--)u=u+(m=a[l++])*e[p+3]|0,c=c+m*e[p+2]|0,s=s+m*e[p+1]|0,o=o+m*e[p]|0,p=p+4|0;t[v+3]=Rx(u+8192>>14),t[v+2]=Rx(c+8192>>14),t[v+1]=Rx(s+8192>>14),t[v]=Rx(o+8192>>14),v=v+4*n|0}v=4*(h+1)|0,y=(h+1)*r*4|0}},Lx=!0;try{Lx=1===new Uint32Array(new Uint8Array([1,0,0,0]).buffer)[0]}catch(e){}function Dx(e,t,r){if(Lx)t.set(function(e){return new Uint8Array(e.buffer,0,e.byteLength)}(e),r);else for(var n=r,i=0;i<e.length;i++){var a=e[i];t[n++]=255&a,t[n++]=a>>8&255}}var Ux={name:"resize",fn:function(e){var t=e.src,r=e.width,n=e.height,i=e.toWidth,a=e.toHeight,o=e.scaleX||e.toWidth/e.width,s=e.scaleY||e.toHeight/e.height,c=e.offsetX||0,u=e.offsetY||0,l=e.dest||new Uint8Array(i*a*4),d=void 0===e.quality?3:e.quality,f=e.alpha||!1,p=Px(d,r,i,o,c),h=Px(d,n,a,s,u),g=new Uint8Array(i*n*4);return Nx(t,g,r,n,i,p),Ox(g,l,n,i,a,h),f||function(e,t,r){for(var n=3,i=t*r*4|0;n<i;)e[n]=255,n=n+4|0}(l,i,a),l},wasm_fn:function(e){var t=e.src,r=e.width,n=e.height,i=e.toWidth,a=e.toHeight,o=e.scaleX||e.toWidth/e.width,s=e.scaleY||e.toHeight/e.height,c=e.offsetX||0,u=e.offsetY||0,l=e.dest||new Uint8Array(i*a*4),d=void 0===e.quality?3:e.quality,f=e.alpha||!1,p=Px(d,r,i,o,c),h=Px(d,n,a,s,u),g=this.__align(0+Math.max(t.byteLength,l.byteLength)),m=this.__align(g+n*i*4),y=this.__align(m+p.byteLength),v=y+h.byteLength,b=this.__instance("resize",v),C=new Uint8Array(this.__memory.buffer),E=new Uint32Array(this.__memory.buffer),w=new Uint32Array(t.buffer);return E.set(w),Dx(p,C,m),Dx(h,C,y),(b.exports.convolveHV||b.exports._convolveHV)(m,y,g,r,n,i,a),new Uint32Array(l.buffer).set(new Uint32Array(this.__memory.buffer,0,a*i)),f||function(e,t,r){for(var n=3,i=t*r*4|0;n<i;)e[n]=255,n=n+4|0}(l,i,a),l},wasm_src:"AGFzbQEAAAABFAJgBn9/f39/fwBgB39/f39/f38AAg8BA2VudgZtZW1vcnkCAAEDAwIAAQQEAXAAAAcZAghjb252b2x2ZQAACmNvbnZvbHZlSFYAAQkBAArmAwLBAwEQfwJAIANFDQAgBEUNACAFQQRqIRVBACEMQQAhDQNAIA0hDkEAIRFBACEHA0AgB0ECaiESAn8gBSAHQQF0IgdqIgZBAmouAQAiEwRAQQAhCEEAIBNrIRQgFSAHaiEPIAAgDCAGLgEAakECdGohEEEAIQlBACEKQQAhCwNAIBAoAgAiB0EYdiAPLgEAIgZsIAtqIQsgB0H/AXEgBmwgCGohCCAHQRB2Qf8BcSAGbCAKaiEKIAdBCHZB/wFxIAZsIAlqIQkgD0ECaiEPIBBBBGohECAUQQFqIhQNAAsgEiATagwBC0EAIQtBACEKQQAhCUEAIQggEgshByABIA5BAnRqIApBgMAAakEOdSIGQf8BIAZB/wFIG0EQdEGAgPwHcUEAIAZBAEobIAtBgMAAakEOdSIGQf8BIAZB/wFIG0EYdEEAIAZBAEobciAJQYDAAGpBDnUiBkH/ASAGQf8BSBtBCHRBgP4DcUEAIAZBAEobciAIQYDAAGpBDnUiBkH/ASAGQf8BSBtB/wFxQQAgBkEAShtyNgIAIA4gA2ohDiARQQFqIhEgBEcNAAsgDCACaiEMIA1BAWoiDSADRw0ACwsLIQACQEEAIAIgAyAEIAUgABAAIAJBACAEIAUgBiABEAALCw=="};function Mx(e){var t=e||[],r={js:t.indexOf("js")>=0,wasm:t.indexOf("wasm")>=0};Bx.call(this,r),this.features={js:r.js,wasm:r.wasm&&this.has_wasm()},this.use(Ix),this.use(Ux)}mx(Mx,Bx),Mx.prototype.resizeAndUnsharp=function(e,t){var r=this.resize(e,t);return e.unsharpAmount&&this.unsharp_mask(r,e.toWidth,e.toHeight,e.unsharpAmount,e.unsharpRadius,e.unsharpThreshold),r};var Vx=Mx;function jx(e,t){this.create=e,this.available=[],this.acquired={},this.lastId=1,this.timeoutId=0,this.idle=t||2e3}jx.prototype.acquire=function(){var e,t=this;return 0!==this.available.length?e=this.available.pop():((e=this.create()).id=this.lastId++,e.release=function(){return t.release(e)}),this.acquired[e.id]=e,e},jx.prototype.release=function(e){var t=this;delete this.acquired[e.id],e.lastUsed=Date.now(),this.available.push(e),0===this.timeoutId&&(this.timeoutId=setTimeout((function(){return t.gc()}),100))},jx.prototype.gc=function(){var e=this,t=Date.now();this.available=this.available.filter((function(r){return!(t-r.lastUsed>e.idle&&(r.destroy(),1))})),0!==this.available.length?this.timeoutId=setTimeout((function(){return e.gc()}),100):this.timeoutId=0};var Fx=jx;function zx(e){return Object.prototype.toString.call(e)}var Kx=function(e){var t=zx(e);return"[object HTMLCanvasElement]"===t||"[object OffscreenCanvas]"===t||"[object Canvas]"===t},qx=function(e){return"[object HTMLImageElement]"===zx(e)},Hx=function(e){return"[object ImageBitmap]"===zx(e)},Qx=function(e){var t=0,r=[];function n(){t<e&&r.length&&(t++,r.shift()())}return function(e){return new Promise((function(i,a){r.push((function(){e().then((function(e){i(e),t--,n()}),(function(e){a(e),t--,n()}))})),n()}))}},Gx=function(e){switch(e){case 0:return"pixelated";case 1:return"low";case 2:return"medium"}return"high"},Wx=function(e){return Promise.resolve().then((function(){if("undefined"==typeof createImageBitmap)return!1;var t=e(100,100);return createImageBitmap(t,0,0,100,100,{resizeWidth:10,resizeHeight:10,resizeQuality:"high"}).then((function(e){var r=10===e.width;return e.close(),t=null,r}))})).catch((function(){return!1}))},Xx=function(){var e,t=Vx;onmessage=function(r){var n=r.data.opts;e||(e=new t(r.data.features));var i=e.resizeAndUnsharp(n);postMessage({result:i},[i.buffer])}};function Yx(e){var t=Math.round(e);return Math.abs(e-t)<1e-5?t:Math.floor(e)}function $x(e){var t=Math.round(e);return Math.abs(e-t)<1e-5?t:Math.ceil(e)}var Zx={},Jx=!1;try{"undefined"!=typeof navigator&&navigator.userAgent&&(Jx=navigator.userAgent.indexOf("Safari")>=0)}catch(e){}var eP=1;"undefined"!=typeof navigator&&(eP=Math.min(navigator.hardwareConcurrency||1,4));var tP,rP,nP={tile:1024,concurrency:eP,features:["js","wasm","ww"],idle:2e3,createCanvas:function(e,t){var r=document.createElement("canvas");return r.width=e,r.height=t,r}},iP={quality:3,alpha:!1,unsharpAmount:0,unsharpRadius:0,unsharpThreshold:0};function aP(){return{value:gx(Xx),destroy:function(){if(this.value.terminate(),"undefined"!=typeof window){var e=window.URL||window.webkitURL||window.mozURL||window.msURL;e&&e.revokeObjectURL&&this.value.objectURL&&e.revokeObjectURL(this.value.objectURL)}}}}function oP(e){if(!(this instanceof oP))return new oP(e);this.options=lx({},nP,e||{});var t="lk_".concat(this.options.concurrency);this.__limit=Zx[t]||Qx(this.options.concurrency),Zx[t]||(Zx[t]=this.__limit),this.features={js:!1,wasm:!1,cib:!1,ww:!1},this.__workersPool=null,this.__requested_features=[],this.__mathlib=null}oP.prototype.init=function(){var e=this;if(this.__initPromise)return this.__initPromise;if(!1!==tP&&!0!==tP&&(tP=!1,"undefined"!=typeof ImageData&&"undefined"!=typeof Uint8ClampedArray))try{new ImageData(new Uint8ClampedArray(400),10,10),tP=!0}catch(t){}!1!==rP&&!0!==rP&&(rP=!1,"undefined"!=typeof ImageBitmap&&(ImageBitmap.prototype&&ImageBitmap.prototype.close?rP=!0:this.debug("ImageBitmap does not support .close(), disabled")));var t=this.options.features.slice();if(t.indexOf("all")>=0&&(t=["cib","wasm","js","ww"]),this.__requested_features=t,this.__mathlib=new Vx(t),t.indexOf("ww")>=0&&"undefined"!=typeof window&&"Worker"in window)try{gx((function(){})).terminate(),this.features.ww=!0;var r="wp_".concat(JSON.stringify(this.options));Zx[r]?this.__workersPool=Zx[r]:(this.__workersPool=new Fx(aP,this.options.idle),Zx[r]=this.__workersPool)}catch(t){}var n,i=this.__mathlib.init().then((function(t){lx(e.features,t.features)}));return n=rP?Wx(this.options.createCanvas).then((function(r){e.features.cib&&t.indexOf("cib")<0?e.debug("createImageBitmap() resize supported, but disabled by config"):t.indexOf("cib")>=0&&(e.features.cib=r)})):Promise.resolve(!1),this.__initPromise=Promise.all([i,n]).then((function(){return e})),this.__initPromise},oP.prototype.resize=function(e,t,r){var n=this;this.debug("Start resize...");var i=lx({},iP);if(isNaN(r)?r&&(i=lx(i,r)):i=lx(i,{quality:r}),i.toWidth=t.width,i.toHeight=t.height,i.width=e.naturalWidth||e.width,i.height=e.naturalHeight||e.height,0===t.width||0===t.height)return Promise.reject(new Error("Invalid output size: ".concat(t.width,"x").concat(t.height)));i.unsharpRadius>2&&(i.unsharpRadius=2);var a=!1,o=null;i.cancelToken&&(o=i.cancelToken.then((function(e){throw a=!0,e}),(function(e){throw a=!0,e})));var s=Math.ceil(Math.max(3,2.5*i.unsharpRadius|0));return this.init().then((function(){if(a)return o;if(n.features.cib){var r=t.getContext("2d",{alpha:Boolean(i.alpha)});return n.debug("Resize via createImageBitmap()"),createImageBitmap(e,{resizeWidth:i.toWidth,resizeHeight:i.toHeight,resizeQuality:Gx(i.quality)}).then((function(e){if(a)return o;if(!i.unsharpAmount)return r.drawImage(e,0,0),e.close(),r=null,n.debug("Finished!"),t;n.debug("Unsharp result");var s=n.options.createCanvas(i.toWidth,i.toHeight),c=s.getContext("2d",{alpha:Boolean(i.alpha)});c.drawImage(e,0,0),e.close();var u=c.getImageData(0,0,i.toWidth,i.toHeight);return n.__mathlib.unsharp_mask(u.data,i.toWidth,i.toHeight,i.unsharpAmount,i.unsharpRadius,i.unsharpThreshold),r.putImageData(u,0,0),s.width=s.height=0,u=c=s=r=null,n.debug("Finished!"),t}))}var c={},u=function(e){return Promise.resolve().then((function(){return n.features.ww?new Promise((function(t,r){var i=n.__workersPool.acquire();o&&o.catch((function(e){return r(e)})),i.value.onmessage=function(e){i.release(),e.data.err?r(e.data.err):t(e.data.result)},i.value.postMessage({opts:e,features:n.__requested_features,preload:{wasm_nodule:n.__mathlib.__}},[e.src.buffer])})):n.__mathlib.resizeAndUnsharp(e,c)}))},l=function(e,t,r){var i,c,l,d=!1,f=function(t){return n.__limit((function(){if(a)return o;var s;if(Kx(e))n.debug("Get tile pixel data"),s=i.getImageData(t.x,t.y,t.width,t.height);else{n.debug("Draw tile imageBitmap/image to temporary canvas");var d=n.options.createCanvas(t.width,t.height),f=d.getContext("2d",{alpha:Boolean(r.alpha)});f.globalCompositeOperation="copy",f.drawImage(c||e,t.x,t.y,t.width,t.height,0,0,t.width,t.height),n.debug("Get tile pixel data"),s=f.getImageData(0,0,t.width,t.height),d.width=d.height=0,f=d=null}var p={src:s.data,width:t.width,height:t.height,toWidth:t.toWidth,toHeight:t.toHeight,scaleX:t.scaleX,scaleY:t.scaleY,offsetX:t.offsetX,offsetY:t.offsetY,quality:r.quality,alpha:r.alpha,unsharpAmount:r.unsharpAmount,unsharpRadius:r.unsharpRadius,unsharpThreshold:r.unsharpThreshold};return n.debug("Invoke resize math"),Promise.resolve().then((function(){return u(p)})).then((function(e){if(a)return o;var r;if(s=null,n.debug("Convert raw rgba tile result to ImageData"),tP)r=new ImageData(new Uint8ClampedArray(e),t.toWidth,t.toHeight);else if((r=l.createImageData(t.toWidth,t.toHeight)).data.set)r.data.set(e);else for(var i=r.data.length-1;i>=0;i--)r.data[i]=e[i];return n.debug("Draw tile"),Jx?l.putImageData(r,t.toX,t.toY,t.toInnerX-t.toX,t.toInnerY-t.toY,t.toInnerWidth+1e-5,t.toInnerHeight+1e-5):l.putImageData(r,t.toX,t.toY,t.toInnerX-t.toX,t.toInnerY-t.toY,t.toInnerWidth,t.toInnerHeight),null}))}))};return Promise.resolve().then((function(){if(l=t.getContext("2d",{alpha:Boolean(r.alpha)}),Kx(e))return i=e.getContext("2d",{alpha:Boolean(r.alpha)}),null;if(Hx(e))return c=e,d=!0,null;if(qx(e))return rP?(n.debug("Decode image via createImageBitmap"),createImageBitmap(e).then((function(e){c=e})).catch((function(e){return null}))):null;throw new Error('Pica: ".from" should be Image, Canvas or ImageBitmap')})).then((function(){if(a)return o;n.debug("Calculate tiles");var e=function(e){var t,r,n,i,a,o,s=e.toWidth/e.width,c=e.toHeight/e.height,u=Yx(e.srcTileSize*s)-2*e.destTileBorder,l=Yx(e.srcTileSize*c)-2*e.destTileBorder;if(u<1||l<1)throw new Error("Internal error in pica: target tile width/height is too small.");var d,f=[];for(i=0;i<e.toHeight;i+=l)for(n=0;n<e.toWidth;n+=u)(t=n-e.destTileBorder)<0&&(t=0),t+(a=n+u+e.destTileBorder-t)>=e.toWidth&&(a=e.toWidth-t),(r=i-e.destTileBorder)<0&&(r=0),r+(o=i+l+e.destTileBorder-r)>=e.toHeight&&(o=e.toHeight-r),d={toX:t,toY:r,toWidth:a,toHeight:o,toInnerX:n,toInnerY:i,toInnerWidth:u,toInnerHeight:l,offsetX:t/s-Yx(t/s),offsetY:r/c-Yx(r/c),scaleX:s,scaleY:c,x:Yx(t/s),y:Yx(r/c),width:$x(a/s),height:$x(o/c)},f.push(d);return f}({width:r.width,height:r.height,srcTileSize:n.options.tile,toWidth:r.toWidth,toHeight:r.toHeight,destTileBorder:s}).map((function(e){return f(e)}));function i(){c&&(d||c.close(),c=null)}return n.debug("Process tiles"),Promise.all(e).then((function(){return n.debug("Finished!"),i(),t}),(function(e){throw i(),e}))}))};return function e(t,r,i,s){if(a)return o;var c,u=qv(t.shift(),2),d=u[0],f=u[1],p=0===t.length;return s=lx({},s,{toWidth:d,toHeight:f,quality:p?s.quality:Math.min(1,s.quality)}),p||(c=n.options.createCanvas(d,f)),l(r,p?i:c,s).then((function(){return p?i:(s.width=d,s.height=f,e(t,c,i,s))})).then((function(e){return c&&(c.width=c.height=0),e}))}(function(e,t,r,n,i,a){var o=r/e,s=n/t,c=(2*a+2+1)/i;if(c>.5)return[[r,n]];var u=Math.ceil(Math.log(Math.min(o,s))/Math.log(c));if(u<=1)return[[r,n]];for(var l=[],d=0;d<u;d++){var f=Math.round(Math.pow(Math.pow(e,u-d-1)*Math.pow(r,d+1),1/u)),p=Math.round(Math.pow(Math.pow(t,u-d-1)*Math.pow(n,d+1),1/u));l.push([f,p])}return l}(i.width,i.height,i.toWidth,i.toHeight,n.options.tile,s),e,t,i)}))},oP.prototype.resizeBuffer=function(e){var t=this,r=lx({},iP,e);return this.init().then((function(){return t.__mathlib.resizeAndUnsharp(r)}))},oP.prototype.toBlob=function(e,t,r){return t=t||"image/png",new Promise((function(n){if(e.toBlob)e.toBlob((function(e){return n(e)}),t,r);else if(e.convertToBlob)n(e.convertToBlob({type:t,quality:r}));else{for(var i=atob(e.toDataURL(t,r).split(",")[1]),a=i.length,o=new Uint8Array(a),s=0;s<a;s++)o[s]=i.charCodeAt(s);n(new Blob([o],{type:t}))}}))},oP.prototype.debug=function(){};var sP=new oP,cP=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.minSize,i=void 0===n?720:n,a=e/t;return e>t?{desW:Math.floor(i*a),desH:i}:{desW:i,desH:Math.floor(i/a)}},uP=Object.freeze({__proto__:null,scaleImage:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.minSize,n=void 0===r?720:r;return new Promise((function(t){var r=URL.createObjectURL(e),i=new Image;i.src=r;var a=document.createElement("canvas");i.onload=function(){if(i.width&&i.height&&(i.width<n||i.height<n)){var e=cP(i.width,i.height,{minSize:n}),r=e.desW,o=e.desH;a.width=r,a.height=o,sP.resize(i,a).then((function(e){return sP.toBlob(e,"image/jpeg",1)})).then((function(e){return t(e)}))}else t(null)}}))},createResizer:function(e){var t=e.width,r=e.height,n=document.createElement("canvas"),i=n.getContext("2d");return n.width=t,n.height=r,{resize:function(e){var t=e.srcCanvas;return i.drawImage(t,0,0,n.width,n.height),n}}},resizeBlobImg:function(e,t,r){var n=document.createElement("canvas"),i=n.getContext("2d");return n.width=t,n.height=r,new Promise((function(t){var r=URL.createObjectURL(e),a=new Image;a.onload=function(){URL.revokeObjectURL(r),i.drawImage(a,0,0,n.width,n.height),n.toBlob(t,"image/jpeg",1)},a.src=r}))},blobToCanvas:function(e){var t=e.blob;return new Promise((function(e){var r=document.createElement("canvas"),n=r.getContext("2d"),i=new Image;i.onload=function(t){var a=i.width,o=i.height;r.width=a,r.height=o,URL.revokeObjectURL(t.target.src),n.drawImage(t.target,0,0),e(r)},i.src=URL.createObjectURL(t)}))}});function lP(e,t,r,n){var i=r*(4*t)+4*n;return{r:e[i],g:e[i+1],b:e[i+2]}}function dP(e,t,r){return function(e,t,r){for(var n=0,i=r[1],a=r[3],o=r[0],s=r[2],c=i;c<a;c++)for(var u=o;u<s;u++){var l=lP(e,t,c,u),d=l.r,f=l.g,p=l.b;d>=245&&p>=245&&f>245&&(n+=1)}return n}(e,t,function(e,t){var r=Math.floor(.025*e),n=e-r,i=Math.floor(.025*t);return[r,i,n,t-i]}(t,r))/(t*r)>=.001}function fP(){return(fP=CB(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.getContext("2d"),n=r.getImageData(0,0,t.width,t.height),i=n.data,x_){e.next=5;break}return e.abrupt("return",dP(i,n.width,n.height));case 5:return e.abrupt("return",x_.detectGlare(i,n.width,n.height));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var pP=Object.freeze({__proto__:null,isCardGlare:function(e){return fP.apply(this,arguments)}}),hP="internal_server_error",gP="network_error",mP=zI();function yP(e){return 500*Math.pow(1.5,e)}function vP(e){return Array.isArray(null==e?void 0:e.errors)&&e.errors.find((function(e){return e.code===hP}))}function bP(e){return"Failed to fetch"===e.message||!e.response}function CP(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.maxNetworkErrorRetryTimes,n=void 0===r?5:r,i=t.maxInternalServerErrorRetryTimes,a=void 0===i?1:i,o=t.propertyKey,s=t.onDone;return function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var c=this;function u(e,t){return l.apply(this,arguments)}function l(){return(l=CB(regeneratorRuntime.mark((function t(i,l){var d,f,p,h,g,m,y,v,b=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return m=function(){return(m=CB(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=h(t),n=p(t)-r,e.next=4,f_(yP(n));case 4:return e.abrupt("return",u(r,t,n));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)},g=function(e){return m.apply(this,arguments)},h=function(e){return e===l?Math.max(i-1,0):p(e)-1},p=function(e){return e===gP?n:e===hP?a:0},f=function(e){return i>0||(e===gP?void 0===i&&n>0:e===hP&&void 0===i&&a>0)},d=b.length>2&&void 0!==b[2]?b[2]:0,y=performance.now(),t.prev=7,t.next=10,e.apply(c,r);case 10:if(v=t.sent,s({response:v,retryCount:d,propertyKey:o,timeInMs:performance.now()-y,args:r}),!vP(v)||!f(hP)){t.next=16;break}return t.next=15,g(hP);case 15:return t.abrupt("return",t.sent);case 16:return t.abrupt("return",v);case 19:if(t.prev=19,t.t0=t.catch(7),s({error:t.t0,retryCount:d,propertyKey:o,timeInMs:performance.now()-y,args:r}),!bP(t.t0)||!f(gP)){t.next=24;break}return t.abrupt("return",g(gP));case 24:throw t.t0;case 25:case"end":return t.stop()}}),t,null,[[7,19]])})))).apply(this,arguments)}return u()}}function EP(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.maxNetworkErrorRetryTimes,n=void 0===r?5:r,i=t.maxInternalServerErrorRetryTimes,a=void 0===i?1:i,o=t.onDone,s=void 0===o?function(){}:o,c={get:function(e,t){var r=e[t];return"function"==typeof r&&"constructor"!==t?CP(r,{maxNetworkErrorRetryTimes:n,maxInternalServerErrorRetryTimes:a,propertyKey:t,onDone:s}):r}};return new Proxy(e,c)}var wP=function(e){var t=e.response,r=(e.error,e.retryCount,e.propertyKey,e.timeInMs);return e.args,{event:"test-event",log:{request_status:t?"success":"fail",time_in_ms:r}}},kP=Object.freeze({__proto__:null,createRetryAPIClient:EP,useApiClient:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.apiCredentials,r=void 0===t?{}:t,n=e.tracking,i=void 0===n?{}:n,a=SC.useRef(null),o=s_(),s=o.sendEvent,c=SC.useCallback((function(e){try{var t=wP(e),r=t.event,n=t.log;s({tag:"sdk_api",event:r,log:n})}catch(e){}}),[s]);if(null===a.current){var u=r.accessKey,l=r.secretKey,d=r.apiUrl,f=i.userId,p=a_({userId:f});a.current=EP(new UB(u,l,d,{httpHeaders:kB(kB({},mP),{},{"x-request-id":p})}),{onDone:c})}return{apiClient:a.current}}}),SP="BFnYsWrH",BP="KbKcY2nb",TP=function(e){return e.split("").reverse().join("")},AP=function(e){var t=e.url;return new Promise((function(e){var r=document.createElement("script");r.onload=e,r.src=t,document.head.appendChild(r)}))},IP=window.fetch.bind(window);function _P(e){var t=e.split(","),r=t[0].match(/:(.*?);/)[1];return{u8arr:Uint8Array.from(atob(t[1]),(function(e){return e.charCodeAt(0)})),mime:r}}var xP=function(){var e=CB(regeneratorRuntime.mark((function e(){var t,r,n,i,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="".concat(TP(SP)).concat(TP(BP)),e.next=3,IP.apply(void 0,a);case 3:return r=e.sent,e.next=6,r.text();case 6:return n=e.sent,i=$I.AES.decrypt(n,t).toString($I.enc.Utf8),e.abrupt("return",_P(i));case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),PP=Object.freeze({__proto__:null,reverseString:TP,loadExternalScript:AP,fetchWithDecryption:xP}),RP=function(e){return"symbol"==Iv(e)||dA(e)&&"[object Symbol]"==vT(e)},NP=/^\s+|\s+$/g,OP=/^[-+]0x[0-9a-f]+$/i,LP=/^0b[01]+$/i,DP=/^0o[0-7]+$/i,UP=parseInt,MP=function(e){if("number"==typeof e)return e;if(RP(e))return NaN;if(bT(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=bT(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(NP,"");var r=LP.test(e);return r||DP.test(e)?UP(e.slice(2),r?2:8):OP.test(e)?NaN:+e},VP=function(e){return e?1/0===(e=MP(e))||-1/0===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0},jP=function(e){var t=VP(e),r=t%1;return t==t?r?t-r:t:0},FP=function(e,t){var r;if("function"!=typeof t)throw new TypeError("Expected a function");return e=jP(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}},zP=function(e){return FP(2,e)}(function(){var e=CB(regeneratorRuntime.mark((function e(){var t,r,n,i,a,o,s,c,u,l,d,f,p,h=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=h.length>0&&void 0!==h[0]?h[0]:{},r=t.tfUrl,n=void 0===r?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@3.11.0":r,i=t.tfBackendWasmUrl,a=void 0===i?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@3.11.0/dist/tf-backend-wasm.js":i,o=t.tfBackendCpuUrl,s=void 0===o?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-cpu@3.11.0":o,c=t.tfBackendWebGlUrl,u=void 0===c?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-webgl@3.11.0":c,l=t.tfLiteUrl,d=void 0===l?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-tflite@0.0.1-alpha.7/dist/tf-tflite.min.js":l,f=t.blazefaceScriptUrl,p=void 0===f?"https://cdn.jsdelivr.net/npm/@tensorflow-models/blazeface@0.0.7":f,e.next=3,AP({url:n});case 3:return e.next=5,Promise.all([AP({url:a}),AP({url:s}),AP({url:u}),AP({url:p}),AP({url:d})]);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}());function KP(){return(KP=CB(regeneratorRuntime.mark((function e(){var t,r,n,i,a,o,s,c,u=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=u.length>0&&void 0!==u[0]?u[0]:{},r=t.preferredBackends,n=void 0===r?["webgl","wasm","cpu"]:r,i=window,a=i.tf,e.next=4,a.enableProdMode();case 4:o=_B(n),e.prev=5,o.s();case 7:if((s=o.n()).done){e.next=21;break}return c=s.value,e.prev=9,e.next=12,a.setBackend(c);case 12:return e.abrupt("break",21);case 15:if(e.prev=15,e.t0=e.catch(9),c!==n[n.length-1]){e.next=19;break}throw e.t0;case 19:e.next=7;break;case 21:e.next=26;break;case 23:e.prev=23,e.t1=e.catch(5),o.e(e.t1);case 26:return e.prev=26,o.f(),e.finish(26);case 29:return e.next=31,a.ready();case 31:case"end":return e.stop()}}),e,null,[[5,23,26,29],[9,15]])})))).apply(this,arguments)}function qP(){return(qP=CB(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.modelUrl,n=window,i=n.blazeface,e.abrupt("return",r?i.load({modelUrl:r}):i.load());case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function HP(){return(HP=CB(regeneratorRuntime.mark((function e(t){var r,n,i,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.modelUrl,n=window,i=n.tflite,e.next=4,xP(r);case 4:return a=e.sent,o=a.u8arr,e.abrupt("return",i.loadTFLiteModel(o,{numThreads:navigator.hardwareConcurrency/2}));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var QP=Object.freeze({__proto__:null,loadTensorFlow:zP,initTensorFlow:function(){return KP.apply(this,arguments)},loadBlazefaceModel:function(e){return qP.apply(this,arguments)},loadTFLiteModel:function(e){return HP.apply(this,arguments)}}),GP=Object.freeze({__proto__:null,enableAntiDebug:function(){var e,t,r=["action","gger","stateObject","apply","chain","test","input","Hello World!","constructor","counter","length","debu","call"];e=r,t=185,function(t){for(;--t;)e.push(e.shift())}(++t);var n,i,a=function(e,t){return r[e-=0]};function o(e){function t(e){if("string"==typeof e)return function(e){}[a("0x5")]("while (true) {}")[a("0x0")](a("0x6"));1!=="".concat(e/e)[a("0x7")]||e%20==0?function(){return!0}[a("0x5")]("".concat(a("0x8"),"gger"))[a("0x9")](a("0xa")):function(){return!1}.constructor("debu".concat(a("0xb")))[a("0x0")](a("0xc")),t(++e)}try{if(e)return t;t(0)}catch(e){}}setInterval((function(){o()}),4e3),n=!0,i=function(e,t){var r=n?function(){if(t){var r=t[a("0x0")](e,arguments);return t=null,r}}:function(){};return n=!1,r},function(){i(this,(function(){var e=new RegExp("function *\\( *\\)"),t=new RegExp("\\+\\+ *(?:_0x(?:[a-f0-9]){4,6}|(?:\\b|\\d)[a-z0-9]{1,4}(?:\\b|\\d))","i"),r=o("init");e.test(r+a("0x1"))&&t[a("0x2")](r+a("0x3"))?o():r("0")}))()}(),console.log(a("0x4"))}}),WP=Object.freeze({__proto__:null,useThemeContext:function(){return SC.useContext(iB)}});function XP(){return(XP=CB(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.key,n=new TextEncoder,(i=n.encode(r)).reverse(),e.abrupt("return",crypto.subtle.digest("SHA-256",i));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var YP=Object.freeze({__proto__:null,encrypt:function(e){var t=e.blob,r=e.key;return new Promise((function(e){var n=new FileReader;n.onload=function(t){var n=t.target.result;(function(e){return XP.apply(this,arguments)})({key:r}).then((function(t){window.crypto.subtle.importKey("raw",t,"AES-GCM",!0,["encrypt","decrypt"]).then((function(t){window.crypto.subtle.encrypt({name:"AES-GCM",iv:new Uint8Array(12),tagLength:128},t,n).then((function(t){var r;e({hex:(r=t,TB(new Uint8Array(r)).map((function(e){return e.toString(16).padStart(2,"0")})).join(""))})}))}))}))},n.readAsArrayBuffer(t)}))}}),$P=function(){return URL.createObjectURL(new Blob(['\'use strict\';(function(){function T(a,b){let c=[],d="";b=a.readBits([8,16,16][b]);for(let d=0;d<b;d++){let b=a.readBits(8);c.push(b)}try{d+=decodeURIComponent(c.map(a=>`%${("0"+a.toString(16)).substr(-2)}`).join(""))}catch(e){}return{bytes:c,text:d}}function U(a,b){a=new V(a);let c=9>=b?0:26>=b?1:2;for(b={text:"",bytes:[],chunks:[],version:b};4<=a.available();){var d=a.readBits(4);if(d===t.Terminator)return b;if(d===t.ECI)0===a.readBits(1)?b.chunks.push({type:r.ECI,assignmentNumber:a.readBits(7)}):\n0===a.readBits(1)?b.chunks.push({type:r.ECI,assignmentNumber:a.readBits(14)}):0===a.readBits(1)?b.chunks.push({type:r.ECI,assignmentNumber:a.readBits(21)}):b.chunks.push({type:r.ECI,assignmentNumber:-1});else if(d===t.Numeric){var e=a;d=[];for(var f="",g=e.readBits([10,12,14][c]);3<=g;){var h=e.readBits(10);if(1E3<=h)throw Error("Invalid numeric value above 999");var k=Math.floor(h/100),n=Math.floor(h/10)%10;h%=10;d.push(48+k,48+n,48+h);f+=k.toString()+n.toString()+h.toString();g-=3}if(2===g){g=e.readBits(7);\nif(100<=g)throw Error("Invalid numeric value above 99");e=Math.floor(g/10);g%=10;d.push(48+e,48+g);f+=e.toString()+g.toString()}else if(1===g){e=e.readBits(4);if(10<=e)throw Error("Invalid numeric value above 9");d.push(48+e);f+=e.toString()}d={bytes:d,text:f};b.text+=d.text;b.bytes.push(...d.bytes);b.chunks.push({type:r.Numeric,text:d.text})}else if(d===t.Alphanumeric){e=a;d=[];f="";for(g=e.readBits([9,11,13][c]);2<=g;)n=e.readBits(11),k=Math.floor(n/45),n%=45,d.push(B[k].charCodeAt(0),B[n].charCodeAt(0)),\nf+=B[k]+B[n],g-=2;1===g&&(e=e.readBits(6),d.push(B[e].charCodeAt(0)),f+=B[e]);d={bytes:d,text:f};b.text+=d.text;b.bytes.push(...d.bytes);b.chunks.push({type:r.Alphanumeric,text:d.text})}else if(d===t.Byte)d=T(a,c),b.text+=d.text,b.bytes.push(...d.bytes),b.chunks.push({type:r.Byte,bytes:d.bytes,text:d.text});else if(d===t.Kanji){f=a;d=[];e=f.readBits([8,10,12][c]);for(g=0;g<e;g++)k=f.readBits(13),k=Math.floor(k/192)<<8|k%192,k=7936>k?k+33088:k+49472,d.push(k>>8,k&255);f=(new TextDecoder("shift-jis")).decode(Uint8Array.from(d));\nd={bytes:d,text:f};b.text+=d.text;b.bytes.push(...d.bytes);b.chunks.push({type:r.Kanji,bytes:d.bytes,text:d.text})}else d===t.StructuredAppend&&b.chunks.push({type:r.StructuredAppend,currentSequence:a.readBits(4),totalSequence:a.readBits(4),parity:a.readBits(8)})}if(0===a.available()||0===a.readBits(a.available()))return b}function J(a,b){return a^b}function W(a,b,c,d){b.degree()<c.degree()&&([b,c]=[c,b]);let e=a.zero;for(var f=a.one;c.degree()>=d/2;){var g=b;let d=e;b=c;e=f;if(b.isZero())return null;\nc=g;f=a.zero;g=b.getCoefficient(b.degree());for(g=a.inverse(g);c.degree()>=b.degree()&&!c.isZero();){let d=c.degree()-b.degree(),e=a.multiply(c.getCoefficient(c.degree()),g);f=f.addOrSubtract(a.buildMonomial(d,e));c=c.addOrSubtract(b.multiplyByMonomial(d,e))}f=f.multiplyPoly(e).addOrSubtract(d);if(c.degree()>=b.degree())return null}d=f.getCoefficient(0);if(0===d)return null;a=a.inverse(d);return[f.multiply(a),c.multiply(a)]}function X(a,b){let c=new Uint8ClampedArray(a.length);c.set(a);a=new Y(285,\n256,0);var d=new w(a,c),e=new Uint8ClampedArray(b),f=!1;for(var g=0;g<b;g++){var h=d.evaluateAt(a.exp(g+a.generatorBase));e[e.length-1-g]=h;0!==h&&(f=!0)}if(!f)return c;d=new w(a,e);d=W(a,a.buildMonomial(b,1),d,b);if(null===d)return null;b=d[0];g=b.degree();if(1===g)b=[b.getCoefficient(1)];else{e=Array(g);f=0;for(h=1;h<a.size&&f<g;h++)0===b.evaluateAt(h)&&(e[f]=a.inverse(h),f++);b=f!==g?null:e}if(null==b)return null;d=d[1];e=b.length;f=Array(e);for(g=0;g<e;g++){h=a.inverse(b[g]);let c=1;for(let d=\n0;d<e;d++)g!==d&&(c=a.multiply(c,J(1,a.multiply(b[d],h))));f[g]=a.multiply(d.evaluateAt(h),a.inverse(c));0!==a.generatorBase&&(f[g]=a.multiply(f[g],h))}d=f;for(e=0;e<b.length;e++){f=c.length-1-a.log(b[e]);if(0>f)return null;c[f]^=d[e]}return c}function E(a,b){a^=b;for(b=0;a;)b++,a&=a-1;return b}function C(a,b){return b<<1|a}function Z(a,b,c){c=aa[c.dataMask];let d=a.height;var e=17+4*b.versionNumber,f=A.createEmpty(e,e);f.setRegion(0,0,9,9,!0);f.setRegion(e-8,0,8,9,!0);f.setRegion(0,e-8,9,8,!0);for(var g of b.alignmentPatternCenters)for(var h of b.alignmentPatternCenters)6===\ng&&6===h||6===g&&h===e-7||g===e-7&&6===h||f.setRegion(g-2,h-2,5,5,!0);f.setRegion(6,9,1,e-17,!0);f.setRegion(9,6,e-17,1,!0);6<b.versionNumber&&(f.setRegion(e-11,0,3,6,!0),f.setRegion(0,e-11,6,3,!0));b=f;g=[];e=h=0;f=!0;for(let k=d-1;0<k;k-=2){6===k&&k--;for(let n=0;n<d;n++){let m=f?d-1-n:n;for(let d=0;2>d;d++){let f=k-d;if(!b.get(f,m)){e++;let b=a.get(f,m);c({y:m,x:f})&&(b=!b);h=h<<1|b;8===e&&(g.push(h),h=e=0)}}}f=!f}return g}function ba(a){var b=a.height,c=Math.floor((b-17)/4);if(6>=c)return K[c-\n1];c=0;for(var d=5;0<=d;d--)for(var e=b-9;e>=b-11;e--)c=C(a.get(e,d),c);d=0;for(e=5;0<=e;e--)for(let c=b-9;c>=b-11;c--)d=C(a.get(e,c),d);a=Infinity;let f;for(let e of K){if(e.infoBits===c||e.infoBits===d)return e;b=E(c,e.infoBits);b<a&&(f=e,a=b);b=E(d,e.infoBits);b<a&&(f=e,a=b)}if(3>=a)return f}function ca(a){let b=0;for(var c=0;8>=c;c++)6!==c&&(b=C(a.get(c,8),b));for(c=7;0<=c;c--)6!==c&&(b=C(a.get(8,c),b));var d=a.height;c=0;for(var e=d-1;e>=d-7;e--)c=C(a.get(8,e),c);for(e=d-8;e<d;e++)c=C(a.get(e,\n8),c);a=Infinity;d=null;for(let {bits:f,formatInfo:g}of da){if(f===b||f===c)return g;e=E(b,f);e<a&&(d=g,a=e);b!==c&&(e=E(c,f),e<a&&(d=g,a=e))}return 3>=a?d:null}function ea(a,b,c){let d=b.errorCorrectionLevels[c],e=[],f=0;d.ecBlocks.forEach(a=>{for(let b=0;b<a.numBlocks;b++)e.push({numDataCodewords:a.dataCodewordsPerBlock,codewords:[]}),f+=a.dataCodewordsPerBlock+d.ecCodewordsPerBlock});if(a.length<f)return null;a=a.slice(0,f);b=d.ecBlocks[0].dataCodewordsPerBlock;for(c=0;c<b;c++)for(var g of e)g.codewords.push(a.shift());\nif(1<d.ecBlocks.length)for(g=d.ecBlocks[0].numBlocks,b=d.ecBlocks[1].numBlocks,c=0;c<b;c++)e[g+c].codewords.push(a.shift());for(;0<a.length;)for(let b of e)b.codewords.push(a.shift());return e}function L(a){let b=ba(a);if(!b)return null;var c=ca(a);if(!c)return null;a=Z(a,b,c);var d=ea(a,b,c.errorCorrectionLevel);if(!d)return null;c=d.reduce((a,b)=>a+b.numDataCodewords,0);c=new Uint8ClampedArray(c);a=0;for(let b of d){d=X(b.codewords,b.codewords.length-b.numDataCodewords);if(!d)return null;for(let e=\n0;e<b.numDataCodewords;e++)c[a++]=d[e]}try{return U(c,b.versionNumber)}catch(e){return null}}function M(a,b,c,d){var e=a.x-b.x+c.x-d.x;let f=a.y-b.y+c.y-d.y;if(0===e&&0===f)return{a11:b.x-a.x,a12:b.y-a.y,a13:0,a21:c.x-b.x,a22:c.y-b.y,a23:0,a31:a.x,a32:a.y,a33:1};{let h=b.x-c.x;var g=d.x-c.x;let k=b.y-c.y,n=d.y-c.y;c=h*n-g*k;g=(e*n-g*f)/c;e=(h*f-e*k)/c;return{a11:b.x-a.x+g*b.x,a12:b.y-a.y+g*b.y,a13:g,a21:d.x-a.x+e*d.x,a22:d.y-a.y+e*d.y,a23:e,a31:a.x,a32:a.y,a33:1}}}function fa(a,b,c,d){a=M(a,b,c,d);\nreturn{a11:a.a22*a.a33-a.a23*a.a32,a12:a.a13*a.a32-a.a12*a.a33,a13:a.a12*a.a23-a.a13*a.a22,a21:a.a23*a.a31-a.a21*a.a33,a22:a.a11*a.a33-a.a13*a.a31,a23:a.a13*a.a21-a.a11*a.a23,a31:a.a21*a.a32-a.a22*a.a31,a32:a.a12*a.a31-a.a11*a.a32,a33:a.a11*a.a22-a.a12*a.a21}}function ha(a,b){var c=fa({x:3.5,y:3.5},{x:b.dimension-3.5,y:3.5},{x:b.dimension-6.5,y:b.dimension-6.5},{x:3.5,y:b.dimension-3.5}),d=M(b.topLeft,b.topRight,b.alignmentPattern,b.bottomLeft),e=d.a11*c.a11+d.a21*c.a12+d.a31*c.a13,f=d.a12*c.a11+\nd.a22*c.a12+d.a32*c.a13,g=d.a13*c.a11+d.a23*c.a12+d.a33*c.a13,h=d.a11*c.a21+d.a21*c.a22+d.a31*c.a23,k=d.a12*c.a21+d.a22*c.a22+d.a32*c.a23,n=d.a13*c.a21+d.a23*c.a22+d.a33*c.a23,m=d.a11*c.a31+d.a21*c.a32+d.a31*c.a33,l=d.a12*c.a31+d.a22*c.a32+d.a32*c.a33,p=d.a13*c.a31+d.a23*c.a32+d.a33*c.a33;c=A.createEmpty(b.dimension,b.dimension);d=(a,b)=>{const c=g*a+n*b+p;return{x:(e*a+h*b+m)/c,y:(f*a+k*b+l)/c}};for(let e=0;e<b.dimension;e++)for(let f=0;f<b.dimension;f++){let b=d(f+.5,e+.5);c.set(f,e,a.get(Math.floor(b.x),\nMath.floor(b.y)))}return{matrix:c,mappingFunction:d}}function x(a){return a.reduce((a,c)=>a+c)}function ia(a,b,c){let d=y(a,b),e=y(b,c),f=y(a,c),g,h,k;e>=d&&e>=f?[g,h,k]=[b,a,c]:f>=e&&f>=d?[g,h,k]=[a,b,c]:[g,h,k]=[a,c,b];0>(k.x-h.x)*(g.y-h.y)-(k.y-h.y)*(g.x-h.x)&&([g,k]=[k,g]);return{bottomLeft:g,topLeft:h,topRight:k}}function ja(a,b,c,d){d=(x(z(a,c,d,5))/7+x(z(a,b,d,5))/7+x(z(c,a,d,5))/7+x(z(b,a,d,5))/7)/4;if(1>d)throw Error("Invalid module size");b=Math.round(y(a,b)/d);a=Math.round(y(a,c)/d);a=\nMath.floor((b+a)/2)+7;switch(a%4){case 0:a++;break;case 2:a--}return{dimension:a,moduleSize:d}}function N(a,b,c,d){let e=[{x:Math.floor(a.x),y:Math.floor(a.y)}];var f=Math.abs(b.y-a.y)>Math.abs(b.x-a.x);if(f){var g=Math.floor(a.y);var h=Math.floor(a.x);a=Math.floor(b.y);b=Math.floor(b.x)}else g=Math.floor(a.x),h=Math.floor(a.y),a=Math.floor(b.x),b=Math.floor(b.y);let k=Math.abs(a-g),n=Math.abs(b-h),m=Math.floor(-k/2),l=g<a?1:-1,p=h<b?1:-1,q=!0;for(let v=g,u=h;v!==a+l;v+=l){g=f?u:v;h=f?v:u;if(c.get(g,\nh)!==q&&(q=!q,e.push({x:g,y:h}),e.length===d+1))break;m+=n;if(0<m){if(u===b)break;u+=p;m-=k}}c=[];for(f=0;f<d;f++)e[f]&&e[f+1]?c.push(y(e[f],e[f+1])):c.push(0);return c}function z(a,b,c,d){let e=b.y-a.y,f=b.x-a.x;b=N(a,b,c,Math.ceil(d/2));a=N(a,{x:a.x-f,y:a.y-e},c,Math.ceil(d/2));c=b.shift()+a.shift()-1;return a.concat(c).concat(...b)}function F(a,b){let c=x(a)/x(b),d=0;b.forEach((b,f)=>{d+=Math.pow(a[f]-b*c,2)});return{averageSize:c,error:d}}function O(a,b,c){try{let d=z(a,{x:-1,y:a.y},c,b.length),\ne=z(a,{x:a.x,y:-1},c,b.length),f=z(a,{x:Math.max(0,a.x-a.y)-1,y:Math.max(0,a.y-a.x)-1},c,b.length),g=z(a,{x:Math.min(c.width,a.x+a.y)+1,y:Math.min(c.height,a.y+a.x)+1},c,b.length),h=F(d,b),k=F(e,b),n=F(f,b),m=F(g,b),l=(h.averageSize+k.averageSize+n.averageSize+m.averageSize)/4;return Math.sqrt(h.error*h.error+k.error*k.error+n.error*n.error+m.error*m.error)+(Math.pow(h.averageSize-l,2)+Math.pow(k.averageSize-l,2)+Math.pow(n.averageSize-l,2)+Math.pow(m.averageSize-l,2))/l}catch(d){return Infinity}}\nfunction H(a,b){for(var c=Math.round(b.x);a.get(c,Math.round(b.y));)c--;for(var d=Math.round(b.x);a.get(d,Math.round(b.y));)d++;c=(c+d)/2;for(d=Math.round(b.y);a.get(Math.round(c),d);)d--;for(b=Math.round(b.y);a.get(Math.round(c),b);)b++;return{x:c,y:(d+b)/2}}function ka(a){var b=[],c=[];let d=[];var e=[];for(let m=0;m<=a.height;m++){var f=0,g=!1;let l=[0,0,0,0,0];for(let b=-1;b<=a.width;b++){var h=a.get(b,m);if(h===g)f++;else{l=[l[1],l[2],l[3],l[4],f];f=1;g=h;var k=x(l)/7;k=Math.abs(l[0]-k)<k&&Math.abs(l[1]-\nk)<k&&Math.abs(l[2]-3*k)<3*k&&Math.abs(l[3]-k)<k&&Math.abs(l[4]-k)<k&&!h;var n=x(l.slice(-3))/3;h=Math.abs(l[2]-n)<n&&Math.abs(l[3]-n)<n&&Math.abs(l[4]-n)<n&&h;if(k){let a=b-l[3]-l[4],d=a-l[2];k={startX:d,endX:a,y:m};n=c.filter(b=>d>=b.bottom.startX&&d<=b.bottom.endX||a>=b.bottom.startX&&d<=b.bottom.endX||d<=b.bottom.startX&&a>=b.bottom.endX&&1.5>l[2]/(b.bottom.endX-b.bottom.startX)&&.5<l[2]/(b.bottom.endX-b.bottom.startX));0<n.length?n[0].bottom=k:c.push({top:k,bottom:k})}if(h){let a=b-l[4],c=a-\nl[3];h={startX:c,y:m,endX:a};k=e.filter(b=>c>=b.bottom.startX&&c<=b.bottom.endX||a>=b.bottom.startX&&c<=b.bottom.endX||c<=b.bottom.startX&&a>=b.bottom.endX&&1.5>l[2]/(b.bottom.endX-b.bottom.startX)&&.5<l[2]/(b.bottom.endX-b.bottom.startX));0<k.length?k[0].bottom=h:e.push({top:h,bottom:h})}}}b.push(...c.filter(a=>a.bottom.y!==m&&2<=a.bottom.y-a.top.y));c=c.filter(a=>a.bottom.y===m);d.push(...e.filter(a=>a.bottom.y!==m));e=e.filter(a=>a.bottom.y===m)}b.push(...c.filter(a=>2<=a.bottom.y-a.top.y));d.push(...e);\nc=[];for(var m of b)2>m.bottom.y-m.top.y||(b=(m.top.startX+m.top.endX+m.bottom.startX+m.bottom.endX)/4,e=(m.top.y+m.bottom.y+1)/2,a.get(Math.round(b),Math.round(e))&&(f=[m.top.endX-m.top.startX,m.bottom.endX-m.bottom.startX,m.bottom.y-m.top.y+1],f=x(f)/f.length,g=O({x:Math.round(b),y:Math.round(e)},[1,1,3,1,1],a),c.push({score:g,x:b,y:e,size:f})));if(3>c.length)return null;c.sort((a,b)=>a.score-b.score);m=[];for(b=0;b<Math.min(c.length,5);++b){e=c[b];f=[];for(var l of c)l!==e&&f.push(Object.assign(Object.assign({},\nl),{score:l.score+Math.pow(l.size-e.size,2)/e.size}));f.sort((a,b)=>a.score-b.score);m.push({points:[e,f[0],f[1]],score:e.score+f[0].score+f[1].score})}m.sort((a,b)=>a.score-b.score);let {topRight:p,topLeft:q,bottomLeft:v}=ia(...m[0].points);m=P(a,d,p,q,v);l=[];m&&l.push({alignmentPattern:{x:m.alignmentPattern.x,y:m.alignmentPattern.y},bottomLeft:{x:v.x,y:v.y},dimension:m.dimension,topLeft:{x:q.x,y:q.y},topRight:{x:p.x,y:p.y}});m=H(a,p);b=H(a,q);c=H(a,v);(a=P(a,d,m,b,c))&&l.push({alignmentPattern:{x:a.alignmentPattern.x,\ny:a.alignmentPattern.y},bottomLeft:{x:c.x,y:c.y},topLeft:{x:b.x,y:b.y},topRight:{x:m.x,y:m.y},dimension:a.dimension});return 0===l.length?null:l}function P(a,b,c,d,e){let f,g;try{({dimension:f,moduleSize:g}=ja(d,c,e,a))}catch(m){return null}var h=c.x-d.x+e.x,k=c.y-d.y+e.y;c=(y(d,e)+y(d,c))/2/g;e=1-3/c;let n={x:d.x+e*(h-d.x),y:d.y+e*(k-d.y)};b=b.map(b=>{const c=(b.top.startX+b.top.endX+b.bottom.startX+b.bottom.endX)/4;b=(b.top.y+b.bottom.y+1)/2;if(a.get(Math.floor(c),Math.floor(b))){var d=O({x:Math.floor(c),\ny:Math.floor(b)},[1,1,1],a)+y({x:c,y:b},n);return{x:c,y:b,score:d}}}).filter(a=>!!a).sort((a,b)=>a.score-b.score);return{alignmentPattern:15<=c&&b.length?b[0]:n,dimension:f}}function Q(a){var b=ka(a);if(!b)return null;for(let e of b){b=ha(a,e);var c=b.matrix;if(null==c)c=null;else{var d=L(c);if(d)c=d;else{for(d=0;d<c.width;d++)for(let a=d+1;a<c.height;a++)c.get(d,a)!==c.get(a,d)&&(c.set(d,a,!c.get(d,a)),c.set(a,d,!c.get(a,d)));c=L(c)}}if(c)return{binaryData:c.bytes,data:c.text,chunks:c.chunks,version:c.version,\nlocation:{topRightCorner:b.mappingFunction(e.dimension,0),topLeftCorner:b.mappingFunction(0,0),bottomRightCorner:b.mappingFunction(e.dimension,e.dimension),bottomLeftCorner:b.mappingFunction(0,e.dimension),topRightFinderPattern:e.topRight,topLeftFinderPattern:e.topLeft,bottomLeftFinderPattern:e.bottomLeft,bottomRightAlignmentPattern:e.alignmentPattern},matrix:b.matrix}}return null}function R(a,b){Object.keys(b).forEach(c=>{a[c]=b[c]})}function I(a,b,c,d={}){let e=Object.create(null);R(e,la);R(e,d);\nd="onlyInvert"===e.inversionAttempts||"invertFirst"===e.inversionAttempts;var f="attemptBoth"===e.inversionAttempts||d;var g=e.greyScaleWeights,h=e.canOverwriteImage,k=b*c;if(a.length!==4*k)throw Error("Malformed data passed to binarizer.");var n=0;if(h){var m=new Uint8ClampedArray(a.buffer,n,k);n+=k}m=new S(b,c,m);if(g.useIntegerApproximation)for(var l=0;l<c;l++)for(var p=0;p<b;p++){var q=4*(l*b+p);m.set(p,l,g.red*a[q]+g.green*a[q+1]+g.blue*a[q+2]+128>>8)}else for(l=0;l<c;l++)for(p=0;p<b;p++)q=4*\n(l*b+p),m.set(p,l,g.red*a[q]+g.green*a[q+1]+g.blue*a[q+2]);g=Math.ceil(b/8);l=Math.ceil(c/8);p=g*l;if(h){var v=new Uint8ClampedArray(a.buffer,n,p);n+=p}v=new S(g,l,v);for(p=0;p<l;p++)for(q=0;q<g;q++){var u=Infinity,r=0;for(var t=0;8>t;t++)for(let a=0;8>a;a++){let b=m.get(8*q+a,8*p+t);u=Math.min(u,b);r=Math.max(r,b)}t=(u+r)/2;t=Math.min(255,1.11*t);24>=r-u&&(t=u/2,0<p&&0<q&&(r=(v.get(q,p-1)+2*v.get(q-1,p)+v.get(q-1,p-1))/4,u<r&&(t=r)));v.set(q,p,t)}h?(p=new Uint8ClampedArray(a.buffer,n,k),n+=k,p=new A(p,\nb)):p=A.createEmpty(b,c);q=null;f&&(h?(a=new Uint8ClampedArray(a.buffer,n,k),q=new A(a,b)):q=A.createEmpty(b,c));for(b=0;b<l;b++)for(a=0;a<g;a++){c=g-3;c=2>a?2:a>c?c:a;h=l-3;h=2>b?2:b>h?h:b;k=0;for(n=-2;2>=n;n++)for(u=-2;2>=u;u++)k+=v.get(c+n,h+u);c=k/25;for(h=0;8>h;h++)for(k=0;8>k;k++)n=8*a+h,u=8*b+k,r=m.get(n,u),p.set(n,u,r<=c),f&&q.set(n,u,!(r<=c))}f=f?{binarized:p,inverted:q}:{binarized:p};let {binarized:w,inverted:x}=f;(f=Q(d?x:w))||"attemptBoth"!==e.inversionAttempts&&"invertFirst"!==e.inversionAttempts||\n(f=Q(d?w:x));return f}class A{constructor(a,b){this.width=b;this.height=a.length/b;this.data=a}static createEmpty(a,b){return new A(new Uint8ClampedArray(a*b),a)}get(a,b){return 0>a||a>=this.width||0>b||b>=this.height?!1:!!this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c?1:0}setRegion(a,b,c,d,e){for(let f=b;f<b+d;f++)for(let b=a;b<a+c;b++)this.set(b,f,!!e)}}class S{constructor(a,b,c){this.width=a;a*=b;if(c&&c.length!==a)throw Error("Wrong buffer size");this.data=c||new Uint8ClampedArray(a)}get(a,\nb){return this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c}}class V{constructor(a){this.bitOffset=this.byteOffset=0;this.bytes=a}readBits(a){if(1>a||32<a||a>this.available())throw Error("Cannot read "+a.toString()+" bits");var b=0;if(0<this.bitOffset){b=8-this.bitOffset;var c=a<b?a:b;b-=c;b=(this.bytes[this.byteOffset]&255>>8-c<<b)>>b;a-=c;this.bitOffset+=c;8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(0<a){for(;8<=a;)b=b<<8|this.bytes[this.byteOffset]&255,this.byteOffset++,\na-=8;0<a&&(c=8-a,b=b<<a|(this.bytes[this.byteOffset]&255>>c<<c)>>c,this.bitOffset+=a)}return b}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}var r;(function(a){a.Numeric="numeric";a.Alphanumeric="alphanumeric";a.Byte="byte";a.Kanji="kanji";a.ECI="eci";a.StructuredAppend="structuredappend"})(r||(r={}));var t;(function(a){a[a.Terminator=0]="Terminator";a[a.Numeric=1]="Numeric";a[a.Alphanumeric=2]="Alphanumeric";a[a.Byte=4]="Byte";a[a.Kanji=8]="Kanji";a[a.ECI=7]="ECI";a[a.StructuredAppend=\n3]="StructuredAppend"})(t||(t={}));let B="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:".split("");class w{constructor(a,b){if(0===b.length)throw Error("No coefficients.");this.field=a;let c=b.length;if(1<c&&0===b[0]){let d=1;for(;d<c&&0===b[d];)d++;if(d===c)this.coefficients=a.zero.coefficients;else for(this.coefficients=new Uint8ClampedArray(c-d),a=0;a<this.coefficients.length;a++)this.coefficients[a]=b[d+a]}else this.coefficients=b}degree(){return this.coefficients.length-1}isZero(){return 0===\nthis.coefficients[0]}getCoefficient(a){return this.coefficients[this.coefficients.length-1-a]}addOrSubtract(a){if(this.isZero())return a;if(a.isZero())return this;let b=this.coefficients;a=a.coefficients;b.length>a.length&&([b,a]=[a,b]);let c=new Uint8ClampedArray(a.length),d=a.length-b.length;for(var e=0;e<d;e++)c[e]=a[e];for(e=d;e<a.length;e++)c[e]=b[e-d]^a[e];return new w(this.field,c)}multiply(a){if(0===a)return this.field.zero;if(1===a)return this;let b=this.coefficients.length,c=new Uint8ClampedArray(b);\nfor(let d=0;d<b;d++)c[d]=this.field.multiply(this.coefficients[d],a);return new w(this.field,c)}multiplyPoly(a){if(this.isZero()||a.isZero())return this.field.zero;let b=this.coefficients,c=b.length;a=a.coefficients;let d=a.length,e=new Uint8ClampedArray(c+d-1);for(let h=0;h<c;h++){let c=b[h];for(let b=0;b<d;b++){var f=h+b,g=this.field.multiply(c,a[b]);e[f]=e[h+b]^g}}return new w(this.field,e)}multiplyByMonomial(a,b){if(0>a)throw Error("Invalid degree less than 0");if(0===b)return this.field.zero;\nlet c=this.coefficients.length;a=new Uint8ClampedArray(c+a);for(let d=0;d<c;d++)a[d]=this.field.multiply(this.coefficients[d],b);return new w(this.field,a)}evaluateAt(a){let b=0;if(0===a)return this.getCoefficient(0);let c=this.coefficients.length;if(1===a)return this.coefficients.forEach(a=>{b^=a}),b;b=this.coefficients[0];for(let d=1;d<c;d++)b=J(this.field.multiply(a,b),this.coefficients[d]);return b}}class Y{constructor(a,b,c){this.primitive=a;this.size=b;this.generatorBase=c;this.expTable=Array(this.size);\nthis.logTable=Array(this.size);a=1;for(b=0;b<this.size;b++)this.expTable[b]=a,a*=2,a>=this.size&&(a=(a^this.primitive)&this.size-1);for(a=0;a<this.size-1;a++)this.logTable[this.expTable[a]]=a;this.zero=new w(this,Uint8ClampedArray.from([0]));this.one=new w(this,Uint8ClampedArray.from([1]))}multiply(a,b){return 0===a||0===b?0:this.expTable[(this.logTable[a]+this.logTable[b])%(this.size-1)]}inverse(a){if(0===a)throw Error("Can\'t invert 0");return this.expTable[this.size-this.logTable[a]-1]}buildMonomial(a,\nb){if(0>a)throw Error("Invalid monomial degree less than 0");if(0===b)return this.zero;a=new Uint8ClampedArray(a+1);a[0]=b;return new w(this,a)}log(a){if(0===a)throw Error("Can\'t take log(0)");return this.logTable[a]}exp(a){return this.expTable[a]}}let K=[{infoBits:null,versionNumber:1,alignmentPatternCenters:[],errorCorrectionLevels:[{ecCodewordsPerBlock:7,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:13,\necBlocks:[{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}]}]},\n{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,\ndataCodewordsPerBlock: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,\necBlocks:[{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}]},\n{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},\n{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},\n{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},\n{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,\ndataCodewordsPerBlock: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,\ndataCodewordsPerBlock: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}]},\n{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}]},\n{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},\n{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,\necBlocks:[{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}]},\n{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},\n{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,\necBlocks:[{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,\ndataCodewordsPerBlock: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,\ndataCodewordsPerBlock: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,\necBlocks:[{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,\necBlocks:[{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,\ndataCodewordsPerBlock: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,\necBlocks:[{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,\n32,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}]}]},\n{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},\n{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,\necBlocks:[{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,\ndataCodewordsPerBlock: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,\necBlocks:[{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},\n{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,\necBlocks:[{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}]},\n{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},\n{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,\necBlocks:[{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,\n30,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}]}]},\n{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,\ndataCodewordsPerBlock: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}]},\n{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,\ndataCodewordsPerBlock: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}]},\n{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,\ndataCodewordsPerBlock: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}]}]}],da=[{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,\ndataMask: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,\nformatInfo:{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,\ndataMask: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,\ndataMask:5}},{bits:11994,formatInfo:{errorCorrectionLevel:2,dataMask:6}},{bits:11245,formatInfo:{errorCorrectionLevel:2,dataMask:7}}],aa=[a=>0===(a.y+a.x)%2,a=>0===a.y%2,a=>0===a.x%3,a=>0===(a.y+a.x)%3,a=>0===(Math.floor(a.y/2)+Math.floor(a.x/3))%2,a=>0===a.x*a.y%2+a.x*a.y%3,a=>0===(a.y*a.x%2+a.y*a.x%3)%2,a=>0===((a.y+a.x)%2+a.y*a.x%3)%2],y=(a,b)=>Math.sqrt(Math.pow(b.x-a.x,2)+Math.pow(b.y-a.y,2)),la={inversionAttempts:"attemptBoth",greyScaleWeights:{red:.2126,green:.7152,blue:.0722,useIntegerApproximation:!1},\ncanOverwriteImage:!0};I.default=I;let G="dontInvert",D={red:77,green:150,blue:29,useIntegerApproximation:!0};self.onmessage=a=>{let b=a.data.data;switch(a.data.type){case "decode":a=I(b.data,b.width,b.height,{inversionAttempts:G,greyScaleWeights:D});self.postMessage({type:"qrResult",data:a?a.data:null});break;case "grayscaleWeights":D.red=b.red;D.green=b.green;D.blue=b.blue;D.useIntegerApproximation=b.useIntegerApproximation;break;case "inversionMode":switch(b){case "original":G="dontInvert";break;\ncase "invert":G="onlyInvert";break;case "both":G="attemptBoth";break;default:throw Error("Invalid inversion mode");}break;case "close":self.close()}}})()\n\n']))},ZP=s((function(e,t){var r,n,i,a,o;if("undefined"==typeof window||"function"!=typeof MessageChannel){var s=null,c=null,u=function(){if(null!==s)try{var e=t.unstable_now();s(!0,e),s=null}catch(e){throw setTimeout(u,0),e}},l=Date.now();t.unstable_now=function(){return Date.now()-l},r=function(e){null!==s?setTimeout(r,0,e):(s=e,setTimeout(u,0))},n=function(e,t){c=setTimeout(e,t)},i=function(){clearTimeout(c)},a=function(){return!1},o=t.unstable_forceFrameRate=function(){}}else{var d=window.performance,f=window.Date,p=window.setTimeout,h=window.clearTimeout;if("undefined"!=typeof console){var g=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof g&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof d&&"function"==typeof d.now)t.unstable_now=function(){return d.now()};else{var m=f.now();t.unstable_now=function(){return f.now()-m}}var y=!1,v=null,b=-1,C=5,E=0;a=function(){return t.unstable_now()>=E},o=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):C=0<e?Math.floor(1e3/e):5};var w=new MessageChannel,k=w.port2;w.port1.onmessage=function(){if(null!==v){var e=t.unstable_now();E=e+C;try{v(!0,e)?k.postMessage(null):(y=!1,v=null)}catch(e){throw k.postMessage(null),e}}else y=!1},r=function(e){v=e,y||(y=!0,k.postMessage(null))},n=function(e,r){b=p((function(){e(t.unstable_now())}),r)},i=function(){h(b),b=-1}}function S(e,t){var r=e.length;e.push(t);e:for(;;){var n=r-1>>>1,i=e[n];if(!(void 0!==i&&0<A(i,t)))break e;e[n]=t,e[r]=i,r=n}}function B(e){return void 0===(e=e[0])?null:e}function T(e){var t=e[0];if(void 0!==t){var r=e.pop();if(r!==t){e[0]=r;e:for(var n=0,i=e.length;n<i;){var a=2*(n+1)-1,o=e[a],s=a+1,c=e[s];if(void 0!==o&&0>A(o,r))void 0!==c&&0>A(c,o)?(e[n]=c,e[s]=r,n=s):(e[n]=o,e[a]=r,n=a);else{if(!(void 0!==c&&0>A(c,r)))break e;e[n]=c,e[s]=r,n=s}}}return t}return null}function A(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}var I=[],_=[],x=1,P=null,R=3,N=!1,O=!1,L=!1;function D(e){for(var t=B(_);null!==t;){if(null===t.callback)T(_);else{if(!(t.startTime<=e))break;T(_),t.sortIndex=t.expirationTime,S(I,t)}t=B(_)}}function U(e){if(L=!1,D(e),!O)if(null!==B(I))O=!0,r(M);else{var t=B(_);null!==t&&n(U,t.startTime-e)}}function M(e,r){O=!1,L&&(L=!1,i()),N=!0;var o=R;try{for(D(r),P=B(I);null!==P&&(!(P.expirationTime>r)||e&&!a());){var s=P.callback;if(null!==s){P.callback=null,R=P.priorityLevel;var c=s(P.expirationTime<=r);r=t.unstable_now(),"function"==typeof c?P.callback=c:P===B(I)&&T(I),D(r)}else T(I);P=B(I)}if(null!==P)var u=!0;else{var l=B(_);null!==l&&n(U,l.startTime-r),u=!1}return u}finally{P=null,R=o,N=!1}}function V(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var j=o;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){O||N||(O=!0,r(M))},t.unstable_getCurrentPriorityLevel=function(){return R},t.unstable_getFirstCallbackNode=function(){return B(I)},t.unstable_next=function(e){switch(R){case 1:case 2:case 3:var t=3;break;default:t=R}var r=R;R=t;try{return e()}finally{R=r}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=j,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=R;R=e;try{return t()}finally{R=r}},t.unstable_scheduleCallback=function(e,a,o){var s=t.unstable_now();if("object"==typeof o&&null!==o){var c=o.delay;c="number"==typeof c&&0<c?s+c:s,o="number"==typeof o.timeout?o.timeout:V(e)}else o=V(e),c=s;return e={id:x++,callback:a,priorityLevel:e,startTime:c,expirationTime:o=c+o,sortIndex:-1},c>s?(e.sortIndex=c,S(_,e),null===B(I)&&e===B(_)&&(L?i():L=!0,n(U,c-s))):(e.sortIndex=o,S(I,e),O||N||(O=!0,r(M))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();D(e);var r=B(I);return r!==P&&null!==P&&null!==r&&null!==r.callback&&r.startTime<=e&&r.expirationTime<P.expirationTime||a()},t.unstable_wrapCallback=function(e){var t=R;return function(){var r=R;R=t;try{return e.apply(this,arguments)}finally{R=r}}}})),JP=(s((function(e,t){})),s((function(e){e.exports=ZP})));function eR(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!SC)throw Error(eR(227));function tR(e,t,r,n,i,a,o,s,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(e){this.onError(e)}}var rR=!1,nR=null,iR=!1,aR=null,oR={onError:function(e){rR=!0,nR=e}};function sR(e,t,r,n,i,a,o,s,c){rR=!1,nR=null,tR.apply(oR,arguments)}function cR(e,t,r,n,i,a,o,s,c){if(sR.apply(this,arguments),rR){if(!rR)throw Error(eR(198));var u=nR;rR=!1,nR=null,iR||(iR=!0,aR=u)}}var uR=null,lR=null,dR=null;function fR(e,t,r){var n=e.type||"unknown-event";e.currentTarget=dR(r),cR(n,t,void 0,e),e.currentTarget=null}var pR=null,hR={};function gR(){if(pR)for(var e in hR){var t=hR[e],r=pR.indexOf(e);if(!(-1<r))throw Error(eR(96,e));if(!yR[r]){if(!t.extractEvents)throw Error(eR(97,e));for(var n in yR[r]=t,r=t.eventTypes){var i=void 0,a=r[n],o=t,s=n;if(vR.hasOwnProperty(s))throw Error(eR(99,s));vR[s]=a;var c=a.phasedRegistrationNames;if(c){for(i in c)c.hasOwnProperty(i)&&mR(c[i],o,s);i=!0}else a.registrationName?(mR(a.registrationName,o,s),i=!0):i=!1;if(!i)throw Error(eR(98,n,e))}}}}function mR(e,t,r){if(bR[e])throw Error(eR(100,e));bR[e]=t,CR[e]=t.eventTypes[r].dependencies}var yR=[],vR={},bR={},CR={};function ER(e){var t,r=!1;for(t in e)if(e.hasOwnProperty(t)){var n=e[t];if(!hR.hasOwnProperty(t)||hR[t]!==n){if(hR[t])throw Error(eR(102,t));hR[t]=n,r=!0}}r&&gR()}var wR=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),kR=null,SR=null,BR=null;function TR(e){if(e=lR(e)){if("function"!=typeof kR)throw Error(eR(280));var t=e.stateNode;t&&(t=uR(t),kR(e.stateNode,e.type,t))}}function AR(e){SR?BR?BR.push(e):BR=[e]:SR=e}function IR(){if(SR){var e=SR,t=BR;if(BR=SR=null,TR(e),t)for(e=0;e<t.length;e++)TR(t[e])}}function _R(e,t){return e(t)}function xR(e,t,r,n,i){return e(t,r,n,i)}function PR(){}var RR=_R,NR=!1,OR=!1;function LR(){null===SR&&null===BR||(PR(),IR())}function DR(e,t,r){if(OR)return e(t,r);OR=!0;try{return RR(e,t,r)}finally{OR=!1,LR()}}var UR=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,MR=Object.prototype.hasOwnProperty,VR={},jR={};function FR(e){return!!MR.call(jR,e)||!MR.call(VR,e)&&(UR.test(e)?jR[e]=!0:(VR[e]=!0,!1))}function zR(e,t,r,n){if(null!==r&&0===r.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!n&&(null!==r?!r.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}function KR(e,t,r,n){if(null==t||zR(e,t,r,n))return!0;if(n)return!1;if(null!==r)switch(r.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function qR(e,t,r,n,i,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a}var HR={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){HR[e]=new qR(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];HR[t]=new qR(t,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){HR[e]=new qR(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){HR[e]=new qR(e,2,!1,e,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){HR[e]=new qR(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){HR[e]=new qR(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){HR[e]=new qR(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){HR[e]=new qR(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){HR[e]=new qR(e,5,!1,e.toLowerCase(),null,!1)}));var QR=/[\-:]([a-z])/g;function GR(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(QR,GR);HR[t]=new qR(t,1,!1,e,null,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(QR,GR);HR[t]=new qR(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(QR,GR);HR[t]=new qR(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)})),["tabIndex","crossOrigin"].forEach((function(e){HR[e]=new qR(e,1,!1,e.toLowerCase(),null,!1)})),HR.xlinkHref=new qR("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach((function(e){HR[e]=new qR(e,1,!1,e.toLowerCase(),null,!0)}));var WR=SC.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function XR(e,t,r,n){var i=HR.hasOwnProperty(t)?HR[t]:null;(null!==i?0===i.type:!n&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(KR(t,r,i,n)&&(r=null),n||null===i?FR(t)&&(null===r?e.removeAttribute(t):e.setAttribute(t,""+r)):i.mustUseProperty?e[i.propertyName]=null===r?3!==i.type&&"":r:(t=i.attributeName,n=i.attributeNamespace,null===r?e.removeAttribute(t):(r=3===(i=i.type)||4===i&&!0===r?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}WR.hasOwnProperty("ReactCurrentDispatcher")||(WR.ReactCurrentDispatcher={current:null}),WR.hasOwnProperty("ReactCurrentBatchConfig")||(WR.ReactCurrentBatchConfig={suspense:null});var YR=/^(.*)[\\\/]/,$R="function"==typeof Symbol&&Symbol.for,ZR=$R?Symbol.for("react.element"):60103,JR=$R?Symbol.for("react.portal"):60106,eN=$R?Symbol.for("react.fragment"):60107,tN=$R?Symbol.for("react.strict_mode"):60108,rN=$R?Symbol.for("react.profiler"):60114,nN=$R?Symbol.for("react.provider"):60109,iN=$R?Symbol.for("react.context"):60110,aN=$R?Symbol.for("react.concurrent_mode"):60111,oN=$R?Symbol.for("react.forward_ref"):60112,sN=$R?Symbol.for("react.suspense"):60113,cN=$R?Symbol.for("react.suspense_list"):60120,uN=$R?Symbol.for("react.memo"):60115,lN=$R?Symbol.for("react.lazy"):60116,dN=$R?Symbol.for("react.block"):60121,fN="function"==typeof Symbol&&Symbol.iterator;function pN(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=fN&&e[fN]||e["@@iterator"])?e:null}function hN(e){if(-1===e._status){e._status=0;var t=e._ctor;t=t(),e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}}function gN(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case eN:return"Fragment";case JR:return"Portal";case rN:return"Profiler";case tN:return"StrictMode";case sN:return"Suspense";case cN:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case iN:return"Context.Consumer";case nN:return"Context.Provider";case oN:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case uN:return gN(e.type);case dN:return gN(e.render);case lN:if(e=1===e._status?e._result:null)return gN(e)}return null}function mN(e){var t="";do{e:switch(e.tag){case 3:case 4:case 6:case 7:case 10:case 9:var r="";break e;default:var n=e._debugOwner,i=e._debugSource,a=gN(e.type);r=null,n&&(r=gN(n.type)),n=a,a="",i?a=" (at "+i.fileName.replace(YR,"")+":"+i.lineNumber+")":r&&(a=" (created by "+r+")"),r="\n in "+(n||"Unknown")+a}t+=r,e=e.return}while(e);return t}function yN(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function vN(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function bN(e){var t=vN(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==r&&"function"==typeof r.get&&"function"==typeof r.set){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function CN(e){e._valueTracker||(e._valueTracker=bN(e))}function EN(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=vN(e)?e.checked?"true":"false":e.value),(e=n)!==r&&(t.setValue(e),!0)}function wN(e,t){var r=t.checked;return ob({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=r?r:e._wrapperState.initialChecked})}function kN(e,t){var r=null==t.defaultValue?"":t.defaultValue,n=null!=t.checked?t.checked:t.defaultChecked;r=yN(null!=t.value?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function SN(e,t){null!=(t=t.checked)&&XR(e,"checked",t,!1)}function BN(e,t){SN(e,t);var r=yN(t.value),n=t.type;if(null!=r)"number"===n?(0===r&&""===e.value||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if("submit"===n||"reset"===n)return void e.removeAttribute("value");t.hasOwnProperty("value")?AN(e,t.type,r):t.hasOwnProperty("defaultValue")&&AN(e,t.type,yN(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function TN(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!("submit"!==n&&"reset"!==n||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}""!==(r=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==r&&(e.name=r)}function AN(e,t,r){"number"===t&&e.ownerDocument.activeElement===e||(null==r?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}function IN(e){var t="";return SC.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}function _N(e,t){return e=ob({children:void 0},t),(t=IN(t.children))&&(e.children=t),e}function xN(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&n&&(e[r].defaultSelected=!0)}else{for(r=""+yN(r),t=null,i=0;i<e.length;i++){if(e[i].value===r)return e[i].selected=!0,void(n&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function PN(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(eR(91));return ob({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function RN(e,t){var r=t.value;if(null==r){if(r=t.children,t=t.defaultValue,null!=r){if(null!=t)throw Error(eR(92));if(Array.isArray(r)){if(!(1>=r.length))throw Error(eR(93));r=r[0]}t=r}null==t&&(t=""),r=t}e._wrapperState={initialValue:yN(r)}}function NN(e,t){var r=yN(t.value),n=yN(t.defaultValue);null!=r&&((r=""+r)!==e.value&&(e.value=r),null==t.defaultValue&&e.defaultValue!==r&&(e.defaultValue=r)),null!=n&&(e.defaultValue=""+n)}function ON(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var LN={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function DN(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function UN(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?DN(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var MN,VN,jN=(VN=function(e,t){if(e.namespaceURI!==LN.svg||"innerHTML"in e)e.innerHTML=t;else{for((MN=MN||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=MN.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,r,n){MSApp.execUnsafeLocalFunction((function(){return VN(e,t)}))}:VN);function FN(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&3===r.nodeType)return void(r.nodeValue=t)}e.textContent=t}function zN(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var KN={animationend:zN("Animation","AnimationEnd"),animationiteration:zN("Animation","AnimationIteration"),animationstart:zN("Animation","AnimationStart"),transitionend:zN("Transition","TransitionEnd")},qN={},HN={};function QN(e){if(qN[e])return qN[e];if(!KN[e])return e;var t,r=KN[e];for(t in r)if(r.hasOwnProperty(t)&&t in HN)return qN[e]=r[t];return e}wR&&(HN=document.createElement("div").style,"AnimationEvent"in window||(delete KN.animationend.animation,delete KN.animationiteration.animation,delete KN.animationstart.animation),"TransitionEvent"in window||delete KN.transitionend.transition);var GN=QN("animationend"),WN=QN("animationiteration"),XN=QN("animationstart"),YN=QN("transitionend"),$N="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),ZN=new("function"==typeof WeakMap?WeakMap:Map);function JN(e){var t=ZN.get(e);return void 0===t&&(t=new Map,ZN.set(e,t)),t}function eO(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).effectTag)&&(r=t.return),e=t.return}while(e)}return 3===t.tag?r:null}function tO(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function rO(e){if(eO(e)!==e)throw Error(eR(188))}function nO(e){var t=e.alternate;if(!t){if(null===(t=eO(e)))throw Error(eR(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(null===i)break;var a=i.alternate;if(null===a){if(null!==(n=i.return)){r=n;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===r)return rO(i),e;if(a===n)return rO(i),t;a=a.sibling}throw Error(eR(188))}if(r.return!==n.return)r=i,n=a;else{for(var o=!1,s=i.child;s;){if(s===r){o=!0,r=i,n=a;break}if(s===n){o=!0,n=i,r=a;break}s=s.sibling}if(!o){for(s=a.child;s;){if(s===r){o=!0,r=a,n=i;break}if(s===n){o=!0,n=a,r=i;break}s=s.sibling}if(!o)throw Error(eR(189))}}if(r.alternate!==n)throw Error(eR(190))}if(3!==r.tag)throw Error(eR(188));return r.stateNode.current===r?e:t}function iO(e){if(!(e=nO(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function aO(e,t){if(null==t)throw Error(eR(30));return null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function oO(e,t,r){Array.isArray(e)?e.forEach(t,r):e&&t.call(r,e)}var sO=null;function cO(e){if(e){var t=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(t))for(var n=0;n<t.length&&!e.isPropagationStopped();n++)fR(e,t[n],r[n]);else t&&fR(e,t,r);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}function uO(e){if(null!==e&&(sO=aO(sO,e)),e=sO,sO=null,e){if(oO(e,cO),sO)throw Error(eR(95));if(iR)throw e=aR,iR=!1,aR=null,e}}function lO(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}function dO(e){if(!wR)return!1;var t=(e="on"+e)in document;return t||((t=document.createElement("div")).setAttribute(e,"return;"),t="function"==typeof t[e]),t}var fO=[];function pO(e){e.topLevelType=null,e.nativeEvent=null,e.targetInst=null,e.ancestors.length=0,10>fO.length&&fO.push(e)}function hO(e,t,r,n){if(fO.length){var i=fO.pop();return i.topLevelType=e,i.eventSystemFlags=n,i.nativeEvent=t,i.targetInst=r,i}return{topLevelType:e,eventSystemFlags:n,nativeEvent:t,targetInst:r,ancestors:[]}}function gO(e){var t=e.targetInst,r=t;do{if(!r){e.ancestors.push(r);break}var n=r;if(3===n.tag)n=n.stateNode.containerInfo;else{for(;n.return;)n=n.return;n=3!==n.tag?null:n.stateNode.containerInfo}if(!n)break;5!==(t=r.tag)&&6!==t||e.ancestors.push(r),r=LL(n)}while(r);for(r=0;r<e.ancestors.length;r++){t=e.ancestors[r];var i=lO(e.nativeEvent);n=e.topLevelType;var a=e.nativeEvent,o=e.eventSystemFlags;0===r&&(o|=64);for(var s=null,c=0;c<yR.length;c++){var u=yR[c];u&&(u=u.extractEvents(n,t,a,i,o))&&(s=aO(s,u))}uO(s)}}function mO(e,t,r){if(!r.has(e)){switch(e){case"scroll":ZO(t,"scroll",!0);break;case"focus":case"blur":ZO(t,"focus",!0),ZO(t,"blur",!0),r.set("blur",null),r.set("focus",null);break;case"cancel":case"close":dO(e)&&ZO(t,e,!0);break;case"invalid":case"submit":case"reset":break;default:-1===$N.indexOf(e)&&$O(e,t)}r.set(e,null)}}var yO,vO,bO,CO=!1,EO=[],wO=null,kO=null,SO=null,BO=new Map,TO=new Map,AO=[],IO="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput close cancel copy cut paste click change contextmenu reset submit".split(" "),_O="focus blur dragenter dragleave mouseover mouseout pointerover pointerout gotpointercapture lostpointercapture".split(" ");function xO(e,t){var r=JN(t);IO.forEach((function(e){mO(e,t,r)})),_O.forEach((function(e){mO(e,t,r)}))}function PO(e,t,r,n,i){return{blockedOn:e,topLevelType:t,eventSystemFlags:32|r,nativeEvent:i,container:n}}function RO(e,t){switch(e){case"focus":case"blur":wO=null;break;case"dragenter":case"dragleave":kO=null;break;case"mouseover":case"mouseout":SO=null;break;case"pointerover":case"pointerout":BO.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":TO.delete(t.pointerId)}}function NO(e,t,r,n,i,a){return null===e||e.nativeEvent!==a?(e=PO(t,r,n,i,a),null!==t&&(null!==(t=DL(t))&&vO(t)),e):(e.eventSystemFlags|=n,e)}function OO(e,t,r,n,i){switch(t){case"focus":return wO=NO(wO,e,t,r,n,i),!0;case"dragenter":return kO=NO(kO,e,t,r,n,i),!0;case"mouseover":return SO=NO(SO,e,t,r,n,i),!0;case"pointerover":var a=i.pointerId;return BO.set(a,NO(BO.get(a)||null,e,t,r,n,i)),!0;case"gotpointercapture":return a=i.pointerId,TO.set(a,NO(TO.get(a)||null,e,t,r,n,i)),!0}return!1}function LO(e){var t=LL(e.target);if(null!==t){var r=eO(t);if(null!==r)if(13===(t=r.tag)){if(null!==(t=tO(r)))return e.blockedOn=t,void JP.unstable_runWithPriority(e.priority,(function(){bO(r)}))}else if(3===t&&r.stateNode.hydrate)return void(e.blockedOn=3===r.tag?r.stateNode.containerInfo:null)}e.blockedOn=null}function DO(e){if(null!==e.blockedOn)return!1;var t=rL(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);if(null!==t){var r=DL(t);return null!==r&&vO(r),e.blockedOn=t,!1}return!0}function UO(e,t,r){DO(e)&&r.delete(t)}function MO(){for(CO=!1;0<EO.length;){var e=EO[0];if(null!==e.blockedOn){null!==(e=DL(e.blockedOn))&&yO(e);break}var t=rL(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);null!==t?e.blockedOn=t:EO.shift()}null!==wO&&DO(wO)&&(wO=null),null!==kO&&DO(kO)&&(kO=null),null!==SO&&DO(SO)&&(SO=null),BO.forEach(UO),TO.forEach(UO)}function VO(e,t){e.blockedOn===t&&(e.blockedOn=null,CO||(CO=!0,JP.unstable_scheduleCallback(JP.unstable_NormalPriority,MO)))}function jO(e){function t(t){return VO(t,e)}if(0<EO.length){VO(EO[0],e);for(var r=1;r<EO.length;r++){var n=EO[r];n.blockedOn===e&&(n.blockedOn=null)}}for(null!==wO&&VO(wO,e),null!==kO&&VO(kO,e),null!==SO&&VO(SO,e),BO.forEach(t),TO.forEach(t),r=0;r<AO.length;r++)(n=AO[r]).blockedOn===e&&(n.blockedOn=null);for(;0<AO.length&&null===(r=AO[0]).blockedOn;)LO(r),null===r.blockedOn&&AO.shift()}var FO={},zO=new Map,KO=new Map,qO=["abort","abort",GN,"animationEnd",WN,"animationIteration",XN,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",YN,"transitionEnd","waiting","waiting"];function HO(e,t){for(var r=0;r<e.length;r+=2){var n=e[r],i=e[r+1],a="on"+(i[0].toUpperCase()+i.slice(1));a={phasedRegistrationNames:{bubbled:a,captured:a+"Capture"},dependencies:[n],eventPriority:t},KO.set(n,t),zO.set(n,a),FO[i]=a}}HO("blur blur cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focus focus input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),HO("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),HO(qO,2);for(var QO="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),GO=0;GO<QO.length;GO++)KO.set(QO[GO],0);var WO=JP.unstable_UserBlockingPriority,XO=JP.unstable_runWithPriority,YO=!0;function $O(e,t){ZO(t,e,!1)}function ZO(e,t,r){var n=KO.get(t);switch(void 0===n?2:n){case 0:n=JO.bind(null,t,1,e);break;case 1:n=eL.bind(null,t,1,e);break;default:n=tL.bind(null,t,1,e)}r?e.addEventListener(t,n,!0):e.addEventListener(t,n,!1)}function JO(e,t,r,n){NR||PR();var i=tL,a=NR;NR=!0;try{xR(i,e,t,r,n)}finally{(NR=a)||LR()}}function eL(e,t,r,n){XO(WO,tL.bind(null,e,t,r,n))}function tL(e,t,r,n){if(YO)if(0<EO.length&&-1<IO.indexOf(e))e=PO(null,e,t,r,n),EO.push(e);else{var i=rL(e,t,r,n);if(null===i)RO(e,n);else if(-1<IO.indexOf(e))e=PO(i,e,t,r,n),EO.push(e);else if(!OO(i,e,t,r,n)){RO(e,n),e=hO(e,n,null,t);try{DR(gO,e)}finally{pO(e)}}}}function rL(e,t,r,n){if(null!==(r=LL(r=lO(n)))){var i=eO(r);if(null===i)r=null;else{var a=i.tag;if(13===a){if(null!==(r=tO(i)))return r;r=null}else if(3===a){if(i.stateNode.hydrate)return 3===i.tag?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}e=hO(e,n,r,t);try{DR(gO,e)}finally{pO(e)}return null}var nL={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},iL=["Webkit","ms","Moz","O"];function aL(e,t,r){return null==t||"boolean"==typeof t||""===t?"":r||"number"!=typeof t||0===t||nL.hasOwnProperty(e)&&nL[e]?(""+t).trim():t+"px"}function oL(e,t){for(var r in e=e.style,t)if(t.hasOwnProperty(r)){var n=0===r.indexOf("--"),i=aL(r,t[r],n);"float"===r&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}Object.keys(nL).forEach((function(e){iL.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),nL[t]=nL[e]}))}));var sL=ob({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function cL(e,t){if(t){if(sL[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(eR(137,e,""));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(eR(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(eR(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(eR(62,""))}}function uL(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var lL=LN.html;function dL(e,t){var r=JN(e=9===e.nodeType||11===e.nodeType?e:e.ownerDocument);t=CR[t];for(var n=0;n<t.length;n++)mO(t[n],e,r)}function fL(){}function pL(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function hL(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function gL(e,t){var r,n=hL(e);for(e=0;n;){if(3===n.nodeType){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=hL(n)}}function mL(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?mL(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function yL(){for(var e=window,t=pL();t instanceof e.HTMLIFrameElement;){try{var r="string"==typeof t.contentWindow.location.href}catch(e){r=!1}if(!r)break;t=pL((e=t.contentWindow).document)}return t}function vL(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var bL="$",CL="/$",EL="$?",wL="$!",kL=null,SL=null;function BL(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function TL(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var AL="function"==typeof setTimeout?setTimeout:void 0,IL="function"==typeof clearTimeout?clearTimeout:void 0;function _L(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function xL(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var r=e.data;if(r===bL||r===wL||r===EL){if(0===t)return e;t--}else r===CL&&t++}e=e.previousSibling}return null}var PL=Math.random().toString(36).slice(2),RL="__reactInternalInstance$"+PL,NL="__reactEventHandlers$"+PL,OL="__reactContainere$"+PL;function LL(e){var t=e[RL];if(t)return t;for(var r=e.parentNode;r;){if(t=r[OL]||r[RL]){if(r=t.alternate,null!==t.child||null!==r&&null!==r.child)for(e=xL(e);null!==e;){if(r=e[RL])return r;e=xL(e)}return t}r=(e=r).parentNode}return null}function DL(e){return!(e=e[RL]||e[OL])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function UL(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(eR(33))}function ML(e){return e[NL]||null}function VL(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function jL(e,t){var r=e.stateNode;if(!r)return null;var n=uR(r);if(!n)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(n=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!n;break e;default:e=!1}if(e)return null;if(r&&"function"!=typeof r)throw Error(eR(231,t,typeof r));return r}function FL(e,t,r){(t=jL(e,r.dispatchConfig.phasedRegistrationNames[t]))&&(r._dispatchListeners=aO(r._dispatchListeners,t),r._dispatchInstances=aO(r._dispatchInstances,e))}function zL(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,r=[];t;)r.push(t),t=VL(t);for(t=r.length;0<t--;)FL(r[t],"captured",e);for(t=0;t<r.length;t++)FL(r[t],"bubbled",e)}}function KL(e,t,r){e&&r&&r.dispatchConfig.registrationName&&(t=jL(e,r.dispatchConfig.registrationName))&&(r._dispatchListeners=aO(r._dispatchListeners,t),r._dispatchInstances=aO(r._dispatchInstances,e))}function qL(e){e&&e.dispatchConfig.registrationName&&KL(e._targetInst,null,e)}function HL(e){oO(e,zL)}var QL=null,GL=null,WL=null;function XL(){if(WL)return WL;var e,t,r=GL,n=r.length,i="value"in QL?QL.value:QL.textContent,a=i.length;for(e=0;e<n&&r[e]===i[e];e++);var o=n-e;for(t=1;t<=o&&r[n-t]===i[a-t];t++);return WL=i.slice(e,1<t?1-t:void 0)}function YL(){return!0}function $L(){return!1}function ZL(e,t,r,n){for(var i in this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=r,e=this.constructor.Interface)e.hasOwnProperty(i)&&((t=e[i])?this[i]=t(r):"target"===i?this.target=n:this[i]=r[i]);return this.isDefaultPrevented=(null!=r.defaultPrevented?r.defaultPrevented:!1===r.returnValue)?YL:$L,this.isPropagationStopped=$L,this}function JL(e,t,r,n){if(this.eventPool.length){var i=this.eventPool.pop();return this.call(i,e,t,r,n),i}return new this(e,t,r,n)}function eD(e){if(!(e instanceof this))throw Error(eR(279));e.destructor(),10>this.eventPool.length&&this.eventPool.push(e)}function tD(e){e.eventPool=[],e.getPooled=JL,e.release=eD}ob(ZL.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=YL)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=YL)},persist:function(){this.isPersistent=YL},isPersistent:$L,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=$L,this._dispatchInstances=this._dispatchListeners=null}}),ZL.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},ZL.extend=function(e){function t(){}function r(){return n.apply(this,arguments)}var n=this;t.prototype=n.prototype;var i=new t;return ob(i,r.prototype),r.prototype=i,r.prototype.constructor=r,r.Interface=ob({},n.Interface,e),r.extend=n.extend,tD(r),r},tD(ZL);var rD=ZL.extend({data:null}),nD=ZL.extend({data:null}),iD=[9,13,27,32],aD=wR&&"CompositionEvent"in window,oD=null;wR&&"documentMode"in document&&(oD=document.documentMode);var sD=wR&&"TextEvent"in window&&!oD,cD=wR&&(!aD||oD&&8<oD&&11>=oD),uD=String.fromCharCode(32),lD={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},dD=!1;function fD(e,t){switch(e){case"keyup":return-1!==iD.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function pD(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var hD=!1;function gD(e,t){switch(e){case"compositionend":return pD(t);case"keypress":return 32!==t.which?null:(dD=!0,uD);case"textInput":return(e=t.data)===uD&&dD?null:e;default:return null}}function mD(e,t){if(hD)return"compositionend"===e||!aD&&fD(e,t)?(e=XL(),WL=GL=QL=null,hD=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return cD&&"ko"!==t.locale?null:t.data;default:return null}}var yD={eventTypes:lD,extractEvents:function(e,t,r,n){var i;if(aD)e:{switch(e){case"compositionstart":var a=lD.compositionStart;break e;case"compositionend":a=lD.compositionEnd;break e;case"compositionupdate":a=lD.compositionUpdate;break e}a=void 0}else hD?fD(e,r)&&(a=lD.compositionEnd):"keydown"===e&&229===r.keyCode&&(a=lD.compositionStart);return a?(cD&&"ko"!==r.locale&&(hD||a!==lD.compositionStart?a===lD.compositionEnd&&hD&&(i=XL()):(GL="value"in(QL=n)?QL.value:QL.textContent,hD=!0)),a=rD.getPooled(a,t,r,n),i?a.data=i:null!==(i=pD(r))&&(a.data=i),HL(a),i=a):i=null,(e=sD?gD(e,r):mD(e,r))?((t=nD.getPooled(lD.beforeInput,t,r,n)).data=e,HL(t)):t=null,null===i?t:null===t?i:[i,t]}},vD={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function bD(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!vD[e.type]:"textarea"===t}var CD={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}};function ED(e,t,r){return(e=ZL.getPooled(CD.change,e,t,r)).type="change",AR(r),HL(e),e}var wD=null,kD=null;function SD(e){uO(e)}function BD(e){if(EN(UL(e)))return e}function TD(e,t){if("change"===e)return t}var AD=!1;function ID(){wD&&(wD.detachEvent("onpropertychange",_D),kD=wD=null)}function _D(e){if("value"===e.propertyName&&BD(kD))if(e=ED(kD,e,lO(e)),NR)uO(e);else{NR=!0;try{_R(SD,e)}finally{NR=!1,LR()}}}function xD(e,t,r){"focus"===e?(ID(),kD=r,(wD=t).attachEvent("onpropertychange",_D)):"blur"===e&&ID()}function PD(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return BD(kD)}function RD(e,t){if("click"===e)return BD(t)}function ND(e,t){if("input"===e||"change"===e)return BD(t)}wR&&(AD=dO("input")&&(!document.documentMode||9<document.documentMode));var OD={eventTypes:CD,_isInputEventSupported:AD,extractEvents:function(e,t,r,n){var i=t?UL(t):window,a=i.nodeName&&i.nodeName.toLowerCase();if("select"===a||"input"===a&&"file"===i.type)var o=TD;else if(bD(i))if(AD)o=ND;else{o=PD;var s=xD}else(a=i.nodeName)&&"input"===a.toLowerCase()&&("checkbox"===i.type||"radio"===i.type)&&(o=RD);if(o&&(o=o(e,t)))return ED(o,r,n);s&&s(e,i,t),"blur"===e&&(e=i._wrapperState)&&e.controlled&&"number"===i.type&&AN(i,"number",i.value)}},LD=ZL.extend({view:null,detail:null}),DD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function UD(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=DD[e])&&!!t[e]}function MD(){return UD}var VD=0,jD=0,FD=!1,zD=!1,KD=LD.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:MD,button:null,buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},movementX:function(e){if("movementX"in e)return e.movementX;var t=VD;return VD=e.screenX,FD?"mousemove"===e.type?e.screenX-t:0:(FD=!0,0)},movementY:function(e){if("movementY"in e)return e.movementY;var t=jD;return jD=e.screenY,zD?"mousemove"===e.type?e.screenY-t:0:(zD=!0,0)}}),qD=KD.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),HD={mouseEnter:{registrationName:"onMouseEnter",dependencies:["mouseout","mouseover"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["mouseout","mouseover"]},pointerEnter:{registrationName:"onPointerEnter",dependencies:["pointerout","pointerover"]},pointerLeave:{registrationName:"onPointerLeave",dependencies:["pointerout","pointerover"]}},QD={eventTypes:HD,extractEvents:function(e,t,r,n,i){var a="mouseover"===e||"pointerover"===e,o="mouseout"===e||"pointerout"===e;if(a&&0==(32&i)&&(r.relatedTarget||r.fromElement)||!o&&!a)return null;(a=n.window===n?n:(a=n.ownerDocument)?a.defaultView||a.parentWindow:window,o)?(o=t,null!==(t=(t=r.relatedTarget||r.toElement)?LL(t):null)&&(t!==eO(t)||5!==t.tag&&6!==t.tag)&&(t=null)):o=null;if(o===t)return null;if("mouseout"===e||"mouseover"===e)var s=KD,c=HD.mouseLeave,u=HD.mouseEnter,l="mouse";else"pointerout"!==e&&"pointerover"!==e||(s=qD,c=HD.pointerLeave,u=HD.pointerEnter,l="pointer");if(e=null==o?a:UL(o),a=null==t?a:UL(t),(c=s.getPooled(c,o,r,n)).type=l+"leave",c.target=e,c.relatedTarget=a,(r=s.getPooled(u,t,r,n)).type=l+"enter",r.target=a,r.relatedTarget=e,l=t,(n=o)&&l)e:{for(u=l,o=0,e=s=n;e;e=VL(e))o++;for(e=0,t=u;t;t=VL(t))e++;for(;0<o-e;)s=VL(s),o--;for(;0<e-o;)u=VL(u),e--;for(;o--;){if(s===u||s===u.alternate)break e;s=VL(s),u=VL(u)}s=null}else s=null;for(u=s,s=[];n&&n!==u&&(null===(o=n.alternate)||o!==u);)s.push(n),n=VL(n);for(n=[];l&&l!==u&&(null===(o=l.alternate)||o!==u);)n.push(l),l=VL(l);for(l=0;l<s.length;l++)KL(s[l],"bubbled",c);for(l=n.length;0<l--;)KL(n[l],"captured",r);return 0==(64&i)?[c]:[c,r]}};function GD(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t}var WD="function"==typeof Object.is?Object.is:GD,XD=Object.prototype.hasOwnProperty;function YD(e,t){if(WD(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++)if(!XD.call(t,r[n])||!WD(e[r[n]],t[r[n]]))return!1;return!0}var $D=wR&&"documentMode"in document&&11>=document.documentMode,ZD={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},JD=null,eU=null,tU=null,rU=!1;function nU(e,t){var r=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return rU||null==JD||JD!==pL(r)?null:("selectionStart"in(r=JD)&&vL(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},tU&&YD(tU,r)?null:(tU=r,(e=ZL.getPooled(ZD.select,eU,e,t)).type="select",e.target=JD,HL(e),e))}var iU={eventTypes:ZD,extractEvents:function(e,t,r,n,i,a){if(!(a=!(i=a||(n.window===n?n.document:9===n.nodeType?n:n.ownerDocument)))){e:{i=JN(i),a=CR.onSelect;for(var o=0;o<a.length;o++)if(!i.has(a[o])){i=!1;break e}i=!0}a=!i}if(a)return null;switch(i=t?UL(t):window,e){case"focus":(bD(i)||"true"===i.contentEditable)&&(JD=i,eU=t,tU=null);break;case"blur":tU=eU=JD=null;break;case"mousedown":rU=!0;break;case"contextmenu":case"mouseup":case"dragend":return rU=!1,nU(r,n);case"selectionchange":if($D)break;case"keydown":case"keyup":return nU(r,n)}return null}},aU=ZL.extend({animationName:null,elapsedTime:null,pseudoElement:null}),oU=ZL.extend({clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),sU=LD.extend({relatedTarget:null});function cU(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}var uU={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},lU={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},dU=LD.extend({key:function(e){if(e.key){var t=uU[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=cU(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?lU[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:MD,charCode:function(e){return"keypress"===e.type?cU(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?cU(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),fU=KD.extend({dataTransfer:null}),pU=LD.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:MD}),hU=ZL.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),gU=KD.extend({deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),mU={eventTypes:FO,extractEvents:function(e,t,r,n){var i=zO.get(e);if(!i)return null;switch(e){case"keypress":if(0===cU(r))return null;case"keydown":case"keyup":e=dU;break;case"blur":case"focus":e=sU;break;case"click":if(2===r.button)return null;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":e=KD;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":e=fU;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":e=pU;break;case GN:case WN:case XN:e=aU;break;case YN:e=hU;break;case"scroll":e=LD;break;case"wheel":e=gU;break;case"copy":case"cut":case"paste":e=oU;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":e=qD;break;default:e=ZL}return HL(t=e.getPooled(i,t,r,n)),t}};if(pR)throw Error(eR(101));pR=Array.prototype.slice.call("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" ")),gR();var yU=DL;uR=ML,lR=yU,dR=UL,ER({SimpleEventPlugin:mU,EnterLeaveEventPlugin:QD,ChangeEventPlugin:OD,SelectEventPlugin:iU,BeforeInputEventPlugin:yD});var vU=[],bU=-1;function CU(e){0>bU||(e.current=vU[bU],vU[bU]=null,bU--)}function EU(e,t){bU++,vU[bU]=e.current,e.current=t}var wU={},kU={current:wU},SU={current:!1},BU=wU;function TU(e,t){var r=e.type.contextTypes;if(!r)return wU;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i,a={};for(i in r)a[i]=t[i];return n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function AU(e){return null!=(e=e.childContextTypes)}function IU(){CU(SU),CU(kU)}function _U(e,t,r){if(kU.current!==wU)throw Error(eR(168));EU(kU,t),EU(SU,r)}function xU(e,t,r){var n=e.stateNode;if(e=t.childContextTypes,"function"!=typeof n.getChildContext)return r;for(var i in n=n.getChildContext())if(!(i in e))throw Error(eR(108,gN(t)||"Unknown",i));return ob({},r,{},n)}function PU(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||wU,BU=kU.current,EU(kU,e),EU(SU,SU.current),!0}function RU(e,t,r){var n=e.stateNode;if(!n)throw Error(eR(169));r?(e=xU(e,t,BU),n.__reactInternalMemoizedMergedChildContext=e,CU(SU),CU(kU),EU(kU,e)):CU(SU),EU(SU,r)}var NU=JP.unstable_runWithPriority,OU=JP.unstable_scheduleCallback,LU=JP.unstable_cancelCallback,DU=JP.unstable_requestPaint,UU=JP.unstable_now,MU=JP.unstable_getCurrentPriorityLevel,VU=JP.unstable_ImmediatePriority,jU=JP.unstable_UserBlockingPriority,FU=JP.unstable_NormalPriority,zU=JP.unstable_LowPriority,KU=JP.unstable_IdlePriority,qU={},HU=JP.unstable_shouldYield,QU=void 0!==DU?DU:function(){},GU=null,WU=null,XU=!1,YU=UU(),$U=1e4>YU?UU:function(){return UU()-YU};function ZU(){switch(MU()){case VU:return 99;case jU:return 98;case FU:return 97;case zU:return 96;case KU:return 95;default:throw Error(eR(332))}}function JU(e){switch(e){case 99:return VU;case 98:return jU;case 97:return FU;case 96:return zU;case 95:return KU;default:throw Error(eR(332))}}function eM(e,t){return e=JU(e),NU(e,t)}function tM(e,t,r){return e=JU(e),OU(e,t,r)}function rM(e){return null===GU?(GU=[e],WU=OU(VU,iM)):GU.push(e),qU}function nM(){if(null!==WU){var e=WU;WU=null,LU(e)}iM()}function iM(){if(!XU&&null!==GU){XU=!0;var e=0;try{var t=GU;eM(99,(function(){for(;e<t.length;e++){var r=t[e];do{r=r(!0)}while(null!==r)}})),GU=null}catch(t){throw null!==GU&&(GU=GU.slice(e+1)),OU(VU,nM),t}finally{XU=!1}}}function aM(e,t,r){return 1073741821-(1+((1073741821-e+t/10)/(r/=10)|0))*r}function oM(e,t){if(e&&e.defaultProps)for(var r in t=ob({},t),e=e.defaultProps)void 0===t[r]&&(t[r]=e[r]);return t}var sM={current:null},cM=null,uM=null,lM=null;function dM(){lM=uM=cM=null}function fM(e){var t=sM.current;CU(sM),e.type._context._currentValue=t}function pM(e,t){for(;null!==e;){var r=e.alternate;if(e.childExpirationTime<t)e.childExpirationTime=t,null!==r&&r.childExpirationTime<t&&(r.childExpirationTime=t);else{if(!(null!==r&&r.childExpirationTime<t))break;r.childExpirationTime=t}e=e.return}}function hM(e,t){cM=e,lM=uM=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(e.expirationTime>=t&&(FV=!0),e.firstContext=null)}function gM(e,t){if(lM!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(lM=e,t=1073741823),t={context:e,observedBits:t,next:null},null===uM){if(null===cM)throw Error(eR(308));uM=t,cM.dependencies={expirationTime:0,firstContext:t,responders:null}}else uM=uM.next=t;return e._currentValue}var mM=!1;function yM(e){e.updateQueue={baseState:e.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}function vM(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,baseQueue:e.baseQueue,shared:e.shared,effects:e.effects})}function bM(e,t){return(e={expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null}).next=e}function CM(e,t){if(null!==(e=e.updateQueue)){var r=(e=e.shared).pending;null===r?t.next=t:(t.next=r.next,r.next=t),e.pending=t}}function EM(e,t){var r=e.alternate;null!==r&&vM(r,e),null===(r=(e=e.updateQueue).baseQueue)?(e.baseQueue=t.next=t,t.next=t):(t.next=r.next,r.next=t)}function wM(e,t,r,n){var i=e.updateQueue;mM=!1;var a=i.baseQueue,o=i.shared.pending;if(null!==o){if(null!==a){var s=a.next;a.next=o.next,o.next=s}a=o,i.shared.pending=null,null!==(s=e.alternate)&&(null!==(s=s.updateQueue)&&(s.baseQueue=o))}if(null!==a){s=a.next;var c=i.baseState,u=0,l=null,d=null,f=null;if(null!==s)for(var p=s;;){if((o=p.expirationTime)<n){var h={expirationTime:p.expirationTime,suspenseConfig:p.suspenseConfig,tag:p.tag,payload:p.payload,callback:p.callback,next:null};null===f?(d=f=h,l=c):f=f.next=h,o>u&&(u=o)}else{null!==f&&(f=f.next={expirationTime:1073741823,suspenseConfig:p.suspenseConfig,tag:p.tag,payload:p.payload,callback:p.callback,next:null}),_F(o,p.suspenseConfig);e:{var g=e,m=p;switch(o=t,h=r,m.tag){case 1:if("function"==typeof(g=m.payload)){c=g.call(h,c,o);break e}c=g;break e;case 3:g.effectTag=-4097&g.effectTag|64;case 0:if(null==(o="function"==typeof(g=m.payload)?g.call(h,c,o):g))break e;c=ob({},c,o);break e;case 2:mM=!0}}null!==p.callback&&(e.effectTag|=32,null===(o=i.effects)?i.effects=[p]:o.push(p))}if(null===(p=p.next)||p===s){if(null===(o=i.shared.pending))break;p=a.next=o.next,o.next=s,i.baseQueue=a=o,i.shared.pending=null}}null===f?l=c:f.next=d,i.baseState=l,i.baseQueue=f,xF(u),e.expirationTime=u,e.memoizedState=c}}function kM(e,t,r){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var n=e[t],i=n.callback;if(null!==i){if(n.callback=null,n=i,i=r,"function"!=typeof n)throw Error(eR(191,n));n.call(i)}}}var SM=WR.ReactCurrentBatchConfig,BM=(new SC.Component).refs;function TM(e,t,r,n){r=null==(r=r(n,t=e.memoizedState))?t:ob({},t,r),e.memoizedState=r,0===e.expirationTime&&(e.updateQueue.baseState=r)}var AM={isMounted:function(e){return!!(e=e._reactInternalFiber)&&eO(e)===e},enqueueSetState:function(e,t,r){e=e._reactInternalFiber;var n=gF(),i=SM.suspense;(i=bM(n=mF(n,e,i),i)).payload=t,null!=r&&(i.callback=r),CM(e,i),yF(e,n)},enqueueReplaceState:function(e,t,r){e=e._reactInternalFiber;var n=gF(),i=SM.suspense;(i=bM(n=mF(n,e,i),i)).tag=1,i.payload=t,null!=r&&(i.callback=r),CM(e,i),yF(e,n)},enqueueForceUpdate:function(e,t){e=e._reactInternalFiber;var r=gF(),n=SM.suspense;(n=bM(r=mF(r,e,n),n)).tag=2,null!=t&&(n.callback=t),CM(e,n),yF(e,r)}};function IM(e,t,r,n,i,a,o){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(n,a,o):!t.prototype||!t.prototype.isPureReactComponent||(!YD(r,n)||!YD(i,a))}function _M(e,t,r){var n=!1,i=wU,a=t.contextType;return"object"==typeof a&&null!==a?a=gM(a):(i=AU(t)?BU:kU.current,a=(n=null!=(n=t.contextTypes))?TU(e,i):wU),t=new t(r,a),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=AM,e.stateNode=t,t._reactInternalFiber=e,n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function xM(e,t,r,n){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(r,n),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&AM.enqueueReplaceState(t,t.state,null)}function PM(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs=BM,yM(e);var a=t.contextType;"object"==typeof a&&null!==a?i.context=gM(a):(a=AU(t)?BU:kU.current,i.context=TU(e,a)),wM(e,r,i,n),i.state=e.memoizedState,"function"==typeof(a=t.getDerivedStateFromProps)&&(TM(e,t,a,r),i.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(t=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&AM.enqueueReplaceState(i,i.state,null),wM(e,r,i,n),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.effectTag|=4)}var RM=Array.isArray;function NM(e,t,r){if(null!==(e=r.ref)&&"function"!=typeof e&&"object"!=typeof e){if(r._owner){if(r=r._owner){if(1!==r.tag)throw Error(eR(309));var n=r.stateNode}if(!n)throw Error(eR(147,e));var i=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===i?t.ref:((t=function(e){var t=n.refs;t===BM&&(t=n.refs={}),null===e?delete t[i]:t[i]=e})._stringRef=i,t)}if("string"!=typeof e)throw Error(eR(284));if(!r._owner)throw Error(eR(290,e))}return e}function OM(e,t){if("textarea"!==e.type)throw Error(eR(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t,""))}function LM(e){function t(t,r){if(e){var n=t.lastEffect;null!==n?(n.nextEffect=r,t.lastEffect=r):t.firstEffect=t.lastEffect=r,r.nextEffect=null,r.effectTag=8}}function r(r,n){if(!e)return null;for(;null!==n;)t(r,n),n=n.sibling;return null}function n(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=ZF(e,t)).index=0,e.sibling=null,e}function a(t,r,n){return t.index=n,e?null!==(n=t.alternate)?(n=n.index)<r?(t.effectTag=2,r):n:(t.effectTag=2,r):r}function o(t){return e&&null===t.alternate&&(t.effectTag=2),t}function s(e,t,r,n){return null===t||6!==t.tag?((t=tz(r,e.mode,n)).return=e,t):((t=i(t,r)).return=e,t)}function c(e,t,r,n){return null!==t&&t.elementType===r.type?((n=i(t,r.props)).ref=NM(e,t,r),n.return=e,n):((n=JF(r.type,r.key,r.props,null,e.mode,n)).ref=NM(e,t,r),n.return=e,n)}function u(e,t,r,n){return null===t||4!==t.tag||t.stateNode.containerInfo!==r.containerInfo||t.stateNode.implementation!==r.implementation?((t=rz(r,e.mode,n)).return=e,t):((t=i(t,r.children||[])).return=e,t)}function l(e,t,r,n,a){return null===t||7!==t.tag?((t=ez(r,e.mode,n,a)).return=e,t):((t=i(t,r)).return=e,t)}function d(e,t,r){if("string"==typeof t||"number"==typeof t)return(t=tz(""+t,e.mode,r)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case ZR:return(r=JF(t.type,t.key,t.props,null,e.mode,r)).ref=NM(e,null,t),r.return=e,r;case JR:return(t=rz(t,e.mode,r)).return=e,t}if(RM(t)||pN(t))return(t=ez(t,e.mode,r,null)).return=e,t;OM(e,t)}return null}function f(e,t,r,n){var i=null!==t?t.key:null;if("string"==typeof r||"number"==typeof r)return null!==i?null:s(e,t,""+r,n);if("object"==typeof r&&null!==r){switch(r.$$typeof){case ZR:return r.key===i?r.type===eN?l(e,t,r.props.children,n,i):c(e,t,r,n):null;case JR:return r.key===i?u(e,t,r,n):null}if(RM(r)||pN(r))return null!==i?null:l(e,t,r,n,null);OM(e,r)}return null}function p(e,t,r,n,i){if("string"==typeof n||"number"==typeof n)return s(t,e=e.get(r)||null,""+n,i);if("object"==typeof n&&null!==n){switch(n.$$typeof){case ZR:return e=e.get(null===n.key?r:n.key)||null,n.type===eN?l(t,e,n.props.children,i,n.key):c(t,e,n,i);case JR:return u(t,e=e.get(null===n.key?r:n.key)||null,n,i)}if(RM(n)||pN(n))return l(t,e=e.get(r)||null,n,i,null);OM(t,n)}return null}function h(i,o,s,c){for(var u=null,l=null,h=o,g=o=0,m=null;null!==h&&g<s.length;g++){h.index>g?(m=h,h=null):m=h.sibling;var y=f(i,h,s[g],c);if(null===y){null===h&&(h=m);break}e&&h&&null===y.alternate&&t(i,h),o=a(y,o,g),null===l?u=y:l.sibling=y,l=y,h=m}if(g===s.length)return r(i,h),u;if(null===h){for(;g<s.length;g++)null!==(h=d(i,s[g],c))&&(o=a(h,o,g),null===l?u=h:l.sibling=h,l=h);return u}for(h=n(i,h);g<s.length;g++)null!==(m=p(h,i,g,s[g],c))&&(e&&null!==m.alternate&&h.delete(null===m.key?g:m.key),o=a(m,o,g),null===l?u=m:l.sibling=m,l=m);return e&&h.forEach((function(e){return t(i,e)})),u}function g(i,o,s,c){var u=pN(s);if("function"!=typeof u)throw Error(eR(150));if(null==(s=u.call(s)))throw Error(eR(151));for(var l=u=null,h=o,g=o=0,m=null,y=s.next();null!==h&&!y.done;g++,y=s.next()){h.index>g?(m=h,h=null):m=h.sibling;var v=f(i,h,y.value,c);if(null===v){null===h&&(h=m);break}e&&h&&null===v.alternate&&t(i,h),o=a(v,o,g),null===l?u=v:l.sibling=v,l=v,h=m}if(y.done)return r(i,h),u;if(null===h){for(;!y.done;g++,y=s.next())null!==(y=d(i,y.value,c))&&(o=a(y,o,g),null===l?u=y:l.sibling=y,l=y);return u}for(h=n(i,h);!y.done;g++,y=s.next())null!==(y=p(h,i,g,y.value,c))&&(e&&null!==y.alternate&&h.delete(null===y.key?g:y.key),o=a(y,o,g),null===l?u=y:l.sibling=y,l=y);return e&&h.forEach((function(e){return t(i,e)})),u}return function(e,n,a,s){var c="object"==typeof a&&null!==a&&a.type===eN&&null===a.key;c&&(a=a.props.children);var u="object"==typeof a&&null!==a;if(u)switch(a.$$typeof){case ZR:e:{for(u=a.key,c=n;null!==c;){if(c.key===u){switch(c.tag){case 7:if(a.type===eN){r(e,c.sibling),(n=i(c,a.props.children)).return=e,e=n;break e}break;default:if(c.elementType===a.type){r(e,c.sibling),(n=i(c,a.props)).ref=NM(e,c,a),n.return=e,e=n;break e}}r(e,c);break}t(e,c),c=c.sibling}a.type===eN?((n=ez(a.props.children,e.mode,s,a.key)).return=e,e=n):((s=JF(a.type,a.key,a.props,null,e.mode,s)).ref=NM(e,n,a),s.return=e,e=s)}return o(e);case JR:e:{for(c=a.key;null!==n;){if(n.key===c){if(4===n.tag&&n.stateNode.containerInfo===a.containerInfo&&n.stateNode.implementation===a.implementation){r(e,n.sibling),(n=i(n,a.children||[])).return=e,e=n;break e}r(e,n);break}t(e,n),n=n.sibling}(n=rz(a,e.mode,s)).return=e,e=n}return o(e)}if("string"==typeof a||"number"==typeof a)return a=""+a,null!==n&&6===n.tag?(r(e,n.sibling),(n=i(n,a)).return=e,e=n):(r(e,n),(n=tz(a,e.mode,s)).return=e,e=n),o(e);if(RM(a))return h(e,n,a,s);if(pN(a))return g(e,n,a,s);if(u&&OM(e,a),void 0===a&&!c)switch(e.tag){case 1:case 0:throw e=e.type,Error(eR(152,e.displayName||e.name||"Component"))}return r(e,n)}}var DM=LM(!0),UM=LM(!1),MM={},VM={current:MM},jM={current:MM},FM={current:MM};function zM(e){if(e===MM)throw Error(eR(174));return e}function KM(e,t){switch(EU(FM,t),EU(jM,e),EU(VM,MM),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:UN(null,"");break;default:t=UN(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}CU(VM),EU(VM,t)}function qM(){CU(VM),CU(jM),CU(FM)}function HM(e){zM(FM.current);var t=zM(VM.current),r=UN(t,e.type);t!==r&&(EU(jM,e),EU(VM,r))}function QM(e){jM.current===e&&(CU(VM),CU(jM))}var GM={current:0};function WM(e){for(var t=e;null!==t;){if(13===t.tag){var r=t.memoizedState;if(null!==r&&(null===(r=r.dehydrated)||r.data===EL||r.data===wL))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.effectTag))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function XM(e,t){return{responder:e,props:t}}var YM=WR.ReactCurrentDispatcher,$M=WR.ReactCurrentBatchConfig,ZM=0,JM=null,eV=null,tV=null,rV=!1;function nV(){throw Error(eR(321))}function iV(e,t){if(null===t)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!WD(e[r],t[r]))return!1;return!0}function aV(e,t,r,n,i,a){if(ZM=a,JM=t,t.memoizedState=null,t.updateQueue=null,t.expirationTime=0,YM.current=null===e||null===e.memoizedState?IV:_V,e=r(n,i),t.expirationTime===ZM){a=0;do{if(t.expirationTime=0,!(25>a))throw Error(eR(301));a+=1,tV=eV=null,t.updateQueue=null,YM.current=xV,e=r(n,i)}while(t.expirationTime===ZM)}if(YM.current=AV,t=null!==eV&&null!==eV.next,ZM=0,tV=eV=JM=null,rV=!1,t)throw Error(eR(300));return e}function oV(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===tV?JM.memoizedState=tV=e:tV=tV.next=e,tV}function sV(){if(null===eV){var e=JM.alternate;e=null!==e?e.memoizedState:null}else e=eV.next;var t=null===tV?JM.memoizedState:tV.next;if(null!==t)tV=t,eV=e;else{if(null===e)throw Error(eR(310));e={memoizedState:(eV=e).memoizedState,baseState:eV.baseState,baseQueue:eV.baseQueue,queue:eV.queue,next:null},null===tV?JM.memoizedState=tV=e:tV=tV.next=e}return tV}function cV(e,t){return"function"==typeof t?t(e):t}function uV(e){var t=sV(),r=t.queue;if(null===r)throw Error(eR(311));r.lastRenderedReducer=e;var n=eV,i=n.baseQueue,a=r.pending;if(null!==a){if(null!==i){var o=i.next;i.next=a.next,a.next=o}n.baseQueue=i=a,r.pending=null}if(null!==i){i=i.next,n=n.baseState;var s=o=a=null,c=i;do{var u=c.expirationTime;if(u<ZM){var l={expirationTime:c.expirationTime,suspenseConfig:c.suspenseConfig,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null};null===s?(o=s=l,a=n):s=s.next=l,u>JM.expirationTime&&(JM.expirationTime=u,xF(u))}else null!==s&&(s=s.next={expirationTime:1073741823,suspenseConfig:c.suspenseConfig,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),_F(u,c.suspenseConfig),n=c.eagerReducer===e?c.eagerState:e(n,c.action);c=c.next}while(null!==c&&c!==i);null===s?a=n:s.next=o,WD(n,t.memoizedState)||(FV=!0),t.memoizedState=n,t.baseState=a,t.baseQueue=s,r.lastRenderedState=n}return[t.memoizedState,r.dispatch]}function lV(e){var t=sV(),r=t.queue;if(null===r)throw Error(eR(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,a=t.memoizedState;if(null!==i){r.pending=null;var o=i=i.next;do{a=e(a,o.action),o=o.next}while(o!==i);WD(a,t.memoizedState)||(FV=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function dV(e){var t=oV();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:cV,lastRenderedState:e}).dispatch=TV.bind(null,JM,e),[t.memoizedState,e]}function fV(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},null===(t=JM.updateQueue)?(t={lastEffect:null},JM.updateQueue=t,t.lastEffect=e.next=e):null===(r=t.lastEffect)?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e),e}function pV(){return sV().memoizedState}function hV(e,t,r,n){var i=oV();JM.effectTag|=e,i.memoizedState=fV(1|t,r,void 0,void 0===n?null:n)}function gV(e,t,r,n){var i=sV();n=void 0===n?null:n;var a=void 0;if(null!==eV){var o=eV.memoizedState;if(a=o.destroy,null!==n&&iV(n,o.deps))return void fV(t,r,a,n)}JM.effectTag|=e,i.memoizedState=fV(1|t,r,a,n)}function mV(e,t){return hV(516,4,e,t)}function yV(e,t){return gV(516,4,e,t)}function vV(e,t){return gV(4,2,e,t)}function bV(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function CV(e,t,r){return r=null!=r?r.concat([e]):null,gV(4,2,bV.bind(null,t,e),r)}function EV(){}function wV(e,t){return oV().memoizedState=[e,void 0===t?null:t],e}function kV(e,t){var r=sV();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&iV(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function SV(e,t){var r=sV();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&iV(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function BV(e,t,r){var n=ZU();eM(98>n?98:n,(function(){e(!0)})),eM(97<n?97:n,(function(){var n=$M.suspense;$M.suspense=void 0===t?null:t;try{e(!1),r()}finally{$M.suspense=n}}))}function TV(e,t,r){var n=gF(),i=SM.suspense;i={expirationTime:n=mF(n,e,i),suspenseConfig:i,action:r,eagerReducer:null,eagerState:null,next:null};var a=t.pending;if(null===a?i.next=i:(i.next=a.next,a.next=i),t.pending=i,a=e.alternate,e===JM||null!==a&&a===JM)rV=!0,i.expirationTime=ZM,JM.expirationTime=ZM;else{if(0===e.expirationTime&&(null===a||0===a.expirationTime)&&null!==(a=t.lastRenderedReducer))try{var o=t.lastRenderedState,s=a(o,r);if(i.eagerReducer=a,i.eagerState=s,WD(s,o))return}catch(e){}yF(e,n)}}var AV={readContext:gM,useCallback:nV,useContext:nV,useEffect:nV,useImperativeHandle:nV,useLayoutEffect:nV,useMemo:nV,useReducer:nV,useRef:nV,useState:nV,useDebugValue:nV,useResponder:nV,useDeferredValue:nV,useTransition:nV},IV={readContext:gM,useCallback:wV,useContext:gM,useEffect:mV,useImperativeHandle:function(e,t,r){return r=null!=r?r.concat([e]):null,hV(4,2,bV.bind(null,t,e),r)},useLayoutEffect:function(e,t){return hV(4,2,e,t)},useMemo:function(e,t){var r=oV();return t=void 0===t?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=oV();return t=void 0!==r?r(t):t,n.memoizedState=n.baseState=t,e=(e=n.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=TV.bind(null,JM,e),[n.memoizedState,e]},useRef:function(e){return e={current:e},oV().memoizedState=e},useState:dV,useDebugValue:EV,useResponder:XM,useDeferredValue:function(e,t){var r=dV(e),n=r[0],i=r[1];return mV((function(){var r=$M.suspense;$M.suspense=void 0===t?null:t;try{i(e)}finally{$M.suspense=r}}),[e,t]),n},useTransition:function(e){var t=dV(!1),r=t[0];return t=t[1],[wV(BV.bind(null,t,e),[t,e]),r]}},_V={readContext:gM,useCallback:kV,useContext:gM,useEffect:yV,useImperativeHandle:CV,useLayoutEffect:vV,useMemo:SV,useReducer:uV,useRef:pV,useState:function(){return uV(cV)},useDebugValue:EV,useResponder:XM,useDeferredValue:function(e,t){var r=uV(cV),n=r[0],i=r[1];return yV((function(){var r=$M.suspense;$M.suspense=void 0===t?null:t;try{i(e)}finally{$M.suspense=r}}),[e,t]),n},useTransition:function(e){var t=uV(cV),r=t[0];return t=t[1],[kV(BV.bind(null,t,e),[t,e]),r]}},xV={readContext:gM,useCallback:kV,useContext:gM,useEffect:yV,useImperativeHandle:CV,useLayoutEffect:vV,useMemo:SV,useReducer:lV,useRef:pV,useState:function(){return lV(cV)},useDebugValue:EV,useResponder:XM,useDeferredValue:function(e,t){var r=lV(cV),n=r[0],i=r[1];return yV((function(){var r=$M.suspense;$M.suspense=void 0===t?null:t;try{i(e)}finally{$M.suspense=r}}),[e,t]),n},useTransition:function(e){var t=lV(cV),r=t[0];return t=t[1],[kV(BV.bind(null,t,e),[t,e]),r]}},PV=null,RV=null,NV=!1;function OV(e,t){var r=XF(5,null,null,0);r.elementType="DELETED",r.type="DELETED",r.stateNode=t,r.return=e,r.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=r,e.lastEffect=r):e.firstEffect=e.lastEffect=r}function LV(e,t){switch(e.tag){case 5:var r=e.type;return null!==(t=1!==t.nodeType||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);case 13:default:return!1}}function DV(e){if(NV){var t=RV;if(t){var r=t;if(!LV(e,t)){if(!(t=_L(r.nextSibling))||!LV(e,t))return e.effectTag=-1025&e.effectTag|2,NV=!1,void(PV=e);OV(PV,r)}PV=e,RV=_L(t.firstChild)}else e.effectTag=-1025&e.effectTag|2,NV=!1,PV=e}}function UV(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;PV=e}function MV(e){if(e!==PV)return!1;if(!NV)return UV(e),NV=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!TL(t,e.memoizedProps))for(t=RV;t;)OV(e,t),t=_L(t.nextSibling);if(UV(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(eR(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var r=e.data;if(r===CL){if(0===t){RV=_L(e.nextSibling);break e}t--}else r!==bL&&r!==wL&&r!==EL||t++}e=e.nextSibling}RV=null}}else RV=PV?_L(e.stateNode.nextSibling):null;return!0}function VV(){RV=PV=null,NV=!1}var jV=WR.ReactCurrentOwner,FV=!1;function zV(e,t,r,n){t.child=null===e?UM(t,null,r,n):DM(t,e.child,r,n)}function KV(e,t,r,n,i){r=r.render;var a=t.ref;return hM(t,i),n=aV(e,t,r,n,a,i),null===e||FV?(t.effectTag|=1,zV(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=i&&(e.expirationTime=0),oj(e,t,i))}function qV(e,t,r,n,i,a){if(null===e){var o=r.type;return"function"!=typeof o||YF(o)||void 0!==o.defaultProps||null!==r.compare||void 0!==r.defaultProps?((e=JF(r.type,null,n,null,t.mode,a)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,HV(e,t,o,n,i,a))}return o=e.child,i<a&&(i=o.memoizedProps,(r=null!==(r=r.compare)?r:YD)(i,n)&&e.ref===t.ref)?oj(e,t,a):(t.effectTag|=1,(e=ZF(o,n)).ref=t.ref,e.return=t,t.child=e)}function HV(e,t,r,n,i,a){return null!==e&&YD(e.memoizedProps,n)&&e.ref===t.ref&&(FV=!1,i<a)?(t.expirationTime=e.expirationTime,oj(e,t,a)):GV(e,t,r,n,a)}function QV(e,t){var r=t.ref;(null===e&&null!==r||null!==e&&e.ref!==r)&&(t.effectTag|=128)}function GV(e,t,r,n,i){var a=AU(r)?BU:kU.current;return a=TU(t,a),hM(t,i),r=aV(e,t,r,n,a,i),null===e||FV?(t.effectTag|=1,zV(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=i&&(e.expirationTime=0),oj(e,t,i))}function WV(e,t,r,n,i){if(AU(r)){var a=!0;PU(t)}else a=!1;if(hM(t,i),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),_M(t,r,n),PM(t,r,n,i),n=!0;else if(null===e){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,u=r.contextType;"object"==typeof u&&null!==u?u=gM(u):u=TU(t,u=AU(r)?BU:kU.current);var l=r.getDerivedStateFromProps,d="function"==typeof l||"function"==typeof o.getSnapshotBeforeUpdate;d||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(s!==n||c!==u)&&xM(t,o,n,u),mM=!1;var f=t.memoizedState;o.state=f,wM(t,n,o,i),c=t.memoizedState,s!==n||f!==c||SU.current||mM?("function"==typeof l&&(TM(t,r,l,n),c=t.memoizedState),(s=mM||IM(t,r,s,n,f,c,u))?(d||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||("function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"==typeof o.componentDidMount&&(t.effectTag|=4)):("function"==typeof o.componentDidMount&&(t.effectTag|=4),t.memoizedProps=n,t.memoizedState=c),o.props=n,o.state=c,o.context=u,n=s):("function"==typeof o.componentDidMount&&(t.effectTag|=4),n=!1)}else o=t.stateNode,vM(e,t),s=t.memoizedProps,o.props=t.type===t.elementType?s:oM(t.type,s),c=o.context,"object"==typeof(u=r.contextType)&&null!==u?u=gM(u):u=TU(t,u=AU(r)?BU:kU.current),(d="function"==typeof(l=r.getDerivedStateFromProps)||"function"==typeof o.getSnapshotBeforeUpdate)||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(s!==n||c!==u)&&xM(t,o,n,u),mM=!1,c=t.memoizedState,o.state=c,wM(t,n,o,i),f=t.memoizedState,s!==n||c!==f||SU.current||mM?("function"==typeof l&&(TM(t,r,l,n),f=t.memoizedState),(l=mM||IM(t,r,s,n,c,f,u))?(d||"function"!=typeof o.UNSAFE_componentWillUpdate&&"function"!=typeof o.componentWillUpdate||("function"==typeof o.componentWillUpdate&&o.componentWillUpdate(n,f,u),"function"==typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(n,f,u)),"function"==typeof o.componentDidUpdate&&(t.effectTag|=4),"function"==typeof o.getSnapshotBeforeUpdate&&(t.effectTag|=256)):("function"!=typeof o.componentDidUpdate||s===e.memoizedProps&&c===e.memoizedState||(t.effectTag|=4),"function"!=typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&c===e.memoizedState||(t.effectTag|=256),t.memoizedProps=n,t.memoizedState=f),o.props=n,o.state=f,o.context=u,n=l):("function"!=typeof o.componentDidUpdate||s===e.memoizedProps&&c===e.memoizedState||(t.effectTag|=4),"function"!=typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&c===e.memoizedState||(t.effectTag|=256),n=!1);return XV(e,t,r,n,a,i)}function XV(e,t,r,n,i,a){QV(e,t);var o=0!=(64&t.effectTag);if(!n&&!o)return i&&RU(t,r,!1),oj(e,t,a);n=t.stateNode,jV.current=t;var s=o&&"function"!=typeof r.getDerivedStateFromError?null:n.render();return t.effectTag|=1,null!==e&&o?(t.child=DM(t,e.child,null,a),t.child=DM(t,null,s,a)):zV(e,t,s,a),t.memoizedState=n.state,i&&RU(t,r,!0),t.child}function YV(e){var t=e.stateNode;t.pendingContext?_U(0,t.pendingContext,t.pendingContext!==t.context):t.context&&_U(0,t.context,!1),KM(e,t.containerInfo)}var $V,ZV,JV,ej,tj={dehydrated:null,retryTime:0};function rj(e,t,r){var n,i=t.mode,a=t.pendingProps,o=GM.current,s=!1;if((n=0!=(64&t.effectTag))||(n=0!=(2&o)&&(null===e||null!==e.memoizedState)),n?(s=!0,t.effectTag&=-65):null!==e&&null===e.memoizedState||void 0===a.fallback||!0===a.unstable_avoidThisFallback||(o|=1),EU(GM,1&o),null===e){if(void 0!==a.fallback&&DV(t),s){if(s=a.fallback,(a=ez(null,i,0,null)).return=t,0==(2&t.mode))for(e=null!==t.memoizedState?t.child.child:t.child,a.child=e;null!==e;)e.return=a,e=e.sibling;return(r=ez(s,i,r,null)).return=t,a.sibling=r,t.memoizedState=tj,t.child=a,r}return i=a.children,t.memoizedState=null,t.child=UM(t,null,i,r)}if(null!==e.memoizedState){if(i=(e=e.child).sibling,s){if(a=a.fallback,(r=ZF(e,e.pendingProps)).return=t,0==(2&t.mode)&&(s=null!==t.memoizedState?t.child.child:t.child)!==e.child)for(r.child=s;null!==s;)s.return=r,s=s.sibling;return(i=ZF(i,a)).return=t,r.sibling=i,r.childExpirationTime=0,t.memoizedState=tj,t.child=r,i}return r=DM(t,e.child,a.children,r),t.memoizedState=null,t.child=r}if(e=e.child,s){if(s=a.fallback,(a=ez(null,i,0,null)).return=t,a.child=e,null!==e&&(e.return=a),0==(2&t.mode))for(e=null!==t.memoizedState?t.child.child:t.child,a.child=e;null!==e;)e.return=a,e=e.sibling;return(r=ez(s,i,r,null)).return=t,a.sibling=r,r.effectTag|=2,a.childExpirationTime=0,t.memoizedState=tj,t.child=a,r}return t.memoizedState=null,t.child=DM(t,e,a.children,r)}function nj(e,t){e.expirationTime<t&&(e.expirationTime=t);var r=e.alternate;null!==r&&r.expirationTime<t&&(r.expirationTime=t),pM(e.return,t)}function ij(e,t,r,n,i,a){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailExpiration:0,tailMode:i,lastEffect:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=n,o.tail=r,o.tailExpiration=0,o.tailMode=i,o.lastEffect=a)}function aj(e,t,r){var n=t.pendingProps,i=n.revealOrder,a=n.tail;if(zV(e,t,n.children,r),0!=(2&(n=GM.current)))n=1&n|2,t.effectTag|=64;else{if(null!==e&&0!=(64&e.effectTag))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&nj(e,r);else if(19===e.tag)nj(e,r);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(EU(GM,n),0==(2&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;null!==r;)null!==(e=r.alternate)&&null===WM(e)&&(i=r),r=r.sibling;null===(r=i)?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),ij(t,!1,i,r,a,t.lastEffect);break;case"backwards":for(r=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===WM(e)){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}ij(t,!0,r,null,a,t.lastEffect);break;case"together":ij(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function oj(e,t,r){null!==e&&(t.dependencies=e.dependencies);var n=t.expirationTime;if(0!==n&&xF(n),t.childExpirationTime<r)return null;if(null!==e&&t.child!==e.child)throw Error(eR(153));if(null!==t.child){for(r=ZF(e=t.child,e.pendingProps),t.child=r,r.return=t;null!==e.sibling;)e=e.sibling,(r=r.sibling=ZF(e,e.pendingProps)).return=t;r.sibling=null}return t.child}function sj(e,t){switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;null!==t;)null!==t.alternate&&(r=t),t=t.sibling;null===r?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;null!==r;)null!==r.alternate&&(n=r),r=r.sibling;null===n?t||null===e.tail?e.tail=null:e.tail.sibling=null:n.sibling=null}}function cj(e,t,r){var n=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return AU(t.type)&&IU(),null;case 3:return qM(),CU(SU),CU(kU),(r=t.stateNode).pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||!MV(t)||(t.effectTag|=4),ZV(t),null;case 5:QM(t),r=zM(FM.current);var i=t.type;if(null!==e&&null!=t.stateNode)JV(e,t,i,n,r),e.ref!==t.ref&&(t.effectTag|=128);else{if(!n){if(null===t.stateNode)throw Error(eR(166));return null}if(e=zM(VM.current),MV(t)){n=t.stateNode,i=t.type;var a=t.memoizedProps;switch(n[RL]=t,n[NL]=a,i){case"iframe":case"object":case"embed":$O("load",n);break;case"video":case"audio":for(e=0;e<$N.length;e++)$O($N[e],n);break;case"source":$O("error",n);break;case"img":case"image":case"link":$O("error",n),$O("load",n);break;case"form":$O("reset",n),$O("submit",n);break;case"details":$O("toggle",n);break;case"input":kN(n,a),$O("invalid",n),dL(r,"onChange");break;case"select":n._wrapperState={wasMultiple:!!a.multiple},$O("invalid",n),dL(r,"onChange");break;case"textarea":RN(n,a),$O("invalid",n),dL(r,"onChange")}for(var o in cL(i,a),e=null,a)if(a.hasOwnProperty(o)){var s=a[o];"children"===o?"string"==typeof s?n.textContent!==s&&(e=["children",s]):"number"==typeof s&&n.textContent!==""+s&&(e=["children",""+s]):bR.hasOwnProperty(o)&&null!=s&&dL(r,o)}switch(i){case"input":CN(n),TN(n,a,!0);break;case"textarea":CN(n),ON(n);break;case"select":case"option":break;default:"function"==typeof a.onClick&&(n.onclick=fL)}r=e,t.updateQueue=r,null!==r&&(t.effectTag|=4)}else{switch(o=9===r.nodeType?r:r.ownerDocument,e===lL&&(e=DN(i)),e===lL?"script"===i?((e=o.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof n.is?e=o.createElement(i,{is:n.is}):(e=o.createElement(i),"select"===i&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,i),e[RL]=t,e[NL]=n,$V(e,t,!1,!1),t.stateNode=e,o=uL(i,n),i){case"iframe":case"object":case"embed":$O("load",e),s=n;break;case"video":case"audio":for(s=0;s<$N.length;s++)$O($N[s],e);s=n;break;case"source":$O("error",e),s=n;break;case"img":case"image":case"link":$O("error",e),$O("load",e),s=n;break;case"form":$O("reset",e),$O("submit",e),s=n;break;case"details":$O("toggle",e),s=n;break;case"input":kN(e,n),s=wN(e,n),$O("invalid",e),dL(r,"onChange");break;case"option":s=_N(e,n);break;case"select":e._wrapperState={wasMultiple:!!n.multiple},s=ob({},n,{value:void 0}),$O("invalid",e),dL(r,"onChange");break;case"textarea":RN(e,n),s=PN(e,n),$O("invalid",e),dL(r,"onChange");break;default:s=n}cL(i,s);var c=s;for(a in c)if(c.hasOwnProperty(a)){var u=c[a];"style"===a?oL(e,u):"dangerouslySetInnerHTML"===a?null!=(u=u?u.__html:void 0)&&jN(e,u):"children"===a?"string"==typeof u?("textarea"!==i||""!==u)&&FN(e,u):"number"==typeof u&&FN(e,""+u):"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&"autoFocus"!==a&&(bR.hasOwnProperty(a)?null!=u&&dL(r,a):null!=u&&XR(e,a,u,o))}switch(i){case"input":CN(e),TN(e,n,!1);break;case"textarea":CN(e),ON(e);break;case"option":null!=n.value&&e.setAttribute("value",""+yN(n.value));break;case"select":e.multiple=!!n.multiple,null!=(r=n.value)?xN(e,!!n.multiple,r,!1):null!=n.defaultValue&&xN(e,!!n.multiple,n.defaultValue,!0);break;default:"function"==typeof s.onClick&&(e.onclick=fL)}BL(i,n)&&(t.effectTag|=4)}null!==t.ref&&(t.effectTag|=128)}return null;case 6:if(e&&null!=t.stateNode)ej(e,t,e.memoizedProps,n);else{if("string"!=typeof n&&null===t.stateNode)throw Error(eR(166));r=zM(FM.current),zM(VM.current),MV(t)?(r=t.stateNode,n=t.memoizedProps,r[RL]=t,r.nodeValue!==n&&(t.effectTag|=4)):((r=(9===r.nodeType?r:r.ownerDocument).createTextNode(n))[RL]=t,t.stateNode=r)}return null;case 13:return CU(GM),n=t.memoizedState,0!=(64&t.effectTag)?(t.expirationTime=r,t):(r=null!==n,n=!1,null===e?void 0!==t.memoizedProps.fallback&&MV(t):(n=null!==(i=e.memoizedState),r||null===i||null!==(i=e.child.sibling)&&(null!==(a=t.firstEffect)?(t.firstEffect=i,i.nextEffect=a):(t.firstEffect=t.lastEffect=i,i.nextEffect=null),i.effectTag=8)),r&&!n&&0!=(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!=(1&GM.current)?Xj===Vj&&(Xj=zj):(Xj!==Vj&&Xj!==zj||(Xj=Kj),0!==eF&&null!==Qj&&(az(Qj,Wj),oz(Qj,eF)))),(r||n)&&(t.effectTag|=4),null);case 4:return qM(),ZV(t),null;case 10:return fM(t),null;case 17:return AU(t.type)&&IU(),null;case 19:if(CU(GM),null===(n=t.memoizedState))return null;if(i=0!=(64&t.effectTag),null===(a=n.rendering)){if(i)sj(n,!1);else if(Xj!==Vj||null!==e&&0!=(64&e.effectTag))for(a=t.child;null!==a;){if(null!==(e=WM(a))){for(t.effectTag|=64,sj(n,!1),null!==(i=e.updateQueue)&&(t.updateQueue=i,t.effectTag|=4),null===n.lastEffect&&(t.firstEffect=null),t.lastEffect=n.lastEffect,n=t.child;null!==n;)a=r,(i=n).effectTag&=2,i.nextEffect=null,i.firstEffect=null,i.lastEffect=null,null===(e=i.alternate)?(i.childExpirationTime=0,i.expirationTime=a,i.child=null,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null):(i.childExpirationTime=e.childExpirationTime,i.expirationTime=e.expirationTime,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,a=e.dependencies,i.dependencies=null===a?null:{expirationTime:a.expirationTime,firstContext:a.firstContext,responders:a.responders}),n=n.sibling;return EU(GM,1&GM.current|2),t.child}a=a.sibling}}else{if(!i)if(null!==(e=WM(a))){if(t.effectTag|=64,i=!0,null!==(r=e.updateQueue)&&(t.updateQueue=r,t.effectTag|=4),sj(n,!0),null===n.tail&&"hidden"===n.tailMode&&!a.alternate)return null!==(t=t.lastEffect=n.lastEffect)&&(t.nextEffect=null),null}else 2*$U()-n.renderingStartTime>n.tailExpiration&&1<r&&(t.effectTag|=64,i=!0,sj(n,!1),t.expirationTime=t.childExpirationTime=r-1);n.isBackwards?(a.sibling=t.child,t.child=a):(null!==(r=n.last)?r.sibling=a:t.child=a,n.last=a)}return null!==n.tail?(0===n.tailExpiration&&(n.tailExpiration=$U()+500),r=n.tail,n.rendering=r,n.tail=r.sibling,n.lastEffect=t.lastEffect,n.renderingStartTime=$U(),r.sibling=null,t=GM.current,EU(GM,i?1&t|2:1&t),r):null}throw Error(eR(156,t.tag))}function uj(e){switch(e.tag){case 1:AU(e.type)&&IU();var t=e.effectTag;return 4096&t?(e.effectTag=-4097&t|64,e):null;case 3:if(qM(),CU(SU),CU(kU),0!=(64&(t=e.effectTag)))throw Error(eR(285));return e.effectTag=-4097&t|64,e;case 5:return QM(e),null;case 13:return CU(GM),4096&(t=e.effectTag)?(e.effectTag=-4097&t|64,e):null;case 19:return CU(GM),null;case 4:return qM(),null;case 10:return fM(e),null;default:return null}}function lj(e,t){return{value:e,source:t,stack:mN(t)}}$V=function(e,t){for(var r=t.child;null!==r;){if(5===r.tag||6===r.tag)e.appendChild(r.stateNode);else if(4!==r.tag&&null!==r.child){r.child.return=r,r=r.child;continue}if(r===t)break;for(;null===r.sibling;){if(null===r.return||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},ZV=function(){},JV=function(e,t,r,n,i){var a=e.memoizedProps;if(a!==n){var o,s,c=t.stateNode;switch(zM(VM.current),e=null,r){case"input":a=wN(c,a),n=wN(c,n),e=[];break;case"option":a=_N(c,a),n=_N(c,n),e=[];break;case"select":a=ob({},a,{value:void 0}),n=ob({},n,{value:void 0}),e=[];break;case"textarea":a=PN(c,a),n=PN(c,n),e=[];break;default:"function"!=typeof a.onClick&&"function"==typeof n.onClick&&(c.onclick=fL)}for(o in cL(r,n),r=null,a)if(!n.hasOwnProperty(o)&&a.hasOwnProperty(o)&&null!=a[o])if("style"===o)for(s in c=a[o])c.hasOwnProperty(s)&&(r||(r={}),r[s]="");else"dangerouslySetInnerHTML"!==o&&"children"!==o&&"suppressContentEditableWarning"!==o&&"suppressHydrationWarning"!==o&&"autoFocus"!==o&&(bR.hasOwnProperty(o)?e||(e=[]):(e=e||[]).push(o,null));for(o in n){var u=n[o];if(c=null!=a?a[o]:void 0,n.hasOwnProperty(o)&&u!==c&&(null!=u||null!=c))if("style"===o)if(c){for(s in c)!c.hasOwnProperty(s)||u&&u.hasOwnProperty(s)||(r||(r={}),r[s]="");for(s in u)u.hasOwnProperty(s)&&c[s]!==u[s]&&(r||(r={}),r[s]=u[s])}else r||(e||(e=[]),e.push(o,r)),r=u;else"dangerouslySetInnerHTML"===o?(u=u?u.__html:void 0,c=c?c.__html:void 0,null!=u&&c!==u&&(e=e||[]).push(o,u)):"children"===o?c===u||"string"!=typeof u&&"number"!=typeof u||(e=e||[]).push(o,""+u):"suppressContentEditableWarning"!==o&&"suppressHydrationWarning"!==o&&(bR.hasOwnProperty(o)?(null!=u&&dL(i,o),e||c===u||(e=[])):(e=e||[]).push(o,u))}r&&(e=e||[]).push("style",r),i=e,(t.updateQueue=i)&&(t.effectTag|=4)}},ej=function(e,t,r,n){r!==n&&(t.effectTag|=4)};var dj="function"==typeof WeakSet?WeakSet:Set;function fj(e,t){var r=t.source,n=t.stack;null===n&&null!==r&&(n=mN(r)),null!==r&&gN(r.type),t=t.value,null!==e&&1===e.tag&&gN(e.type);try{console.error(t)}catch(e){setTimeout((function(){throw e}))}}function pj(e,t){try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(t){zF(e,t)}}function hj(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(t){zF(e,t)}else t.current=null}function gj(e,t){switch(t.tag){case 0:case 11:case 15:case 22:return;case 1:if(256&t.effectTag&&null!==e){var r=e.memoizedProps,n=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?r:oM(t.type,r),n),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:case 5:case 6:case 4:case 17:return}throw Error(eR(163))}function mj(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var r=t=t.next;do{if((r.tag&e)===e){var n=r.destroy;r.destroy=void 0,void 0!==n&&n()}r=r.next}while(r!==t)}}function yj(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function vj(e,t,r){switch(r.tag){case 0:case 11:case 15:case 22:return void yj(3,r);case 1:if(e=r.stateNode,4&r.effectTag)if(null===t)e.componentDidMount();else{var n=r.elementType===r.type?t.memoizedProps:oM(r.type,t.memoizedProps);e.componentDidUpdate(n,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate)}return void(null!==(t=r.updateQueue)&&kM(r,t,e));case 3:if(null!==(t=r.updateQueue)){if(e=null,null!==r.child)switch(r.child.tag){case 5:e=r.child.stateNode;break;case 1:e=r.child.stateNode}kM(r,t,e)}return;case 5:return e=r.stateNode,void(null===t&&4&r.effectTag&&BL(r.type,r.memoizedProps)&&e.focus());case 6:case 4:case 12:return;case 13:return void(null===r.memoizedState&&(r=r.alternate,null!==r&&(r=r.memoizedState,null!==r&&(r=r.dehydrated,null!==r&&jO(r)))));case 19:case 17:case 20:case 21:return}throw Error(eR(163))}function bj(e,t,r){switch("function"==typeof QF&&QF(t),t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var n=e.next;eM(97<r?97:r,(function(){var e=n;do{var r=e.destroy;if(void 0!==r){var i=t;try{r()}catch(e){zF(i,e)}}e=e.next}while(e!==n)}))}break;case 1:hj(t),"function"==typeof(r=t.stateNode).componentWillUnmount&&pj(t,r);break;case 5:hj(t);break;case 4:Bj(e,t,r)}}function Cj(e){var t=e.alternate;e.return=null,e.child=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.alternate=null,e.firstEffect=null,e.lastEffect=null,e.pendingProps=null,e.memoizedProps=null,e.stateNode=null,null!==t&&Cj(t)}function Ej(e){return 5===e.tag||3===e.tag||4===e.tag}function wj(e){e:{for(var t=e.return;null!==t;){if(Ej(t)){var r=t;break e}t=t.return}throw Error(eR(160))}switch(t=r.stateNode,r.tag){case 5:var n=!1;break;case 3:case 4:t=t.containerInfo,n=!0;break;default:throw Error(eR(161))}16&r.effectTag&&(FN(t,""),r.effectTag&=-17);e:t:for(r=e;;){for(;null===r.sibling;){if(null===r.return||Ej(r.return)){r=null;break e}r=r.return}for(r.sibling.return=r.return,r=r.sibling;5!==r.tag&&6!==r.tag&&18!==r.tag;){if(2&r.effectTag)continue t;if(null===r.child||4===r.tag)continue t;r.child.return=r,r=r.child}if(!(2&r.effectTag)){r=r.stateNode;break e}}n?kj(e,r,t):Sj(e,r,t)}function kj(e,t,r){var n=e.tag,i=5===n||6===n;if(i)e=i?e.stateNode:e.stateNode.instance,t?8===r.nodeType?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(8===r.nodeType?(t=r.parentNode).insertBefore(e,r):(t=r).appendChild(e),null!=(r=r._reactRootContainer)||null!==t.onclick||(t.onclick=fL));else if(4!==n&&null!==(e=e.child))for(kj(e,t,r),e=e.sibling;null!==e;)kj(e,t,r),e=e.sibling}function Sj(e,t,r){var n=e.tag,i=5===n||6===n;if(i)e=i?e.stateNode:e.stateNode.instance,t?r.insertBefore(e,t):r.appendChild(e);else if(4!==n&&null!==(e=e.child))for(Sj(e,t,r),e=e.sibling;null!==e;)Sj(e,t,r),e=e.sibling}function Bj(e,t,r){for(var n,i,a=t,o=!1;;){if(!o){o=a.return;e:for(;;){if(null===o)throw Error(eR(160));switch(n=o.stateNode,o.tag){case 5:i=!1;break e;case 3:case 4:n=n.containerInfo,i=!0;break e}o=o.return}o=!0}if(5===a.tag||6===a.tag){e:for(var s=e,c=a,u=r,l=c;;)if(bj(s,l,u),null!==l.child&&4!==l.tag)l.child.return=l,l=l.child;else{if(l===c)break e;for(;null===l.sibling;){if(null===l.return||l.return===c)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}i?(s=n,c=a.stateNode,8===s.nodeType?s.parentNode.removeChild(c):s.removeChild(c)):n.removeChild(a.stateNode)}else if(4===a.tag){if(null!==a.child){n=a.stateNode.containerInfo,i=!0,a.child.return=a,a=a.child;continue}}else if(bj(e,a,r),null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break;for(;null===a.sibling;){if(null===a.return||a.return===t)return;4===(a=a.return).tag&&(o=!1)}a.sibling.return=a.return,a=a.sibling}}function Tj(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:return void mj(3,t);case 1:return;case 5:var r=t.stateNode;if(null!=r){var n=t.memoizedProps,i=null!==e?e.memoizedProps:n;e=t.type;var a=t.updateQueue;if(t.updateQueue=null,null!==a){for(r[NL]=n,"input"===e&&"radio"===n.type&&null!=n.name&&SN(r,n),uL(e,i),t=uL(e,n),i=0;i<a.length;i+=2){var o=a[i],s=a[i+1];"style"===o?oL(r,s):"dangerouslySetInnerHTML"===o?jN(r,s):"children"===o?FN(r,s):XR(r,o,s,t)}switch(e){case"input":BN(r,n);break;case"textarea":NN(r,n);break;case"select":t=r._wrapperState.wasMultiple,r._wrapperState.wasMultiple=!!n.multiple,null!=(e=n.value)?xN(r,!!n.multiple,e,!1):t!==!!n.multiple&&(null!=n.defaultValue?xN(r,!!n.multiple,n.defaultValue,!0):xN(r,!!n.multiple,n.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(eR(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((t=t.stateNode).hydrate&&(t.hydrate=!1,jO(t.containerInfo)));case 12:return;case 13:if(r=t,null===t.memoizedState?n=!1:(n=!0,r=t.child,rF=$U()),null!==r)e:for(e=r;;){if(5===e.tag)a=e.stateNode,n?"function"==typeof(a=a.style).setProperty?a.setProperty("display","none","important"):a.display="none":(a=e.stateNode,i=null!=(i=e.memoizedProps.style)&&i.hasOwnProperty("display")?i.display:null,a.style.display=aL("display",i));else if(6===e.tag)e.stateNode.nodeValue=n?"":e.memoizedProps;else{if(13===e.tag&&null!==e.memoizedState&&null===e.memoizedState.dehydrated){(a=e.child.sibling).return=e,e=a;continue}if(null!==e.child){e.child.return=e,e=e.child;continue}}if(e===r)break;for(;null===e.sibling;){if(null===e.return||e.return===r)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}return void Aj(t);case 19:return void Aj(t);case 17:return}throw Error(eR(163))}function Aj(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var r=e.stateNode;null===r&&(r=e.stateNode=new dj),t.forEach((function(t){var n=qF.bind(null,e,t);r.has(t)||(r.add(t),t.then(n,n))}))}}var Ij="function"==typeof WeakMap?WeakMap:Map;function _j(e,t,r){(r=bM(r,null)).tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){aF||(aF=!0,oF=n),fj(e,t)},r}function xj(e,t,r){(r=bM(r,null)).tag=3;var n=e.type.getDerivedStateFromError;if("function"==typeof n){var i=t.value;r.payload=function(){return fj(e,t),n(i)}}var a=e.stateNode;return null!==a&&"function"==typeof a.componentDidCatch&&(r.callback=function(){"function"!=typeof n&&(null===sF?sF=new Set([this]):sF.add(this),fj(e,t));var r=t.stack;this.componentDidCatch(t.value,{componentStack:null!==r?r:""})}),r}var Pj,Rj=Math.ceil,Nj=WR.ReactCurrentDispatcher,Oj=WR.ReactCurrentOwner,Lj=0,Dj=8,Uj=16,Mj=32,Vj=0,jj=1,Fj=2,zj=3,Kj=4,qj=5,Hj=Lj,Qj=null,Gj=null,Wj=0,Xj=Vj,Yj=null,$j=1073741823,Zj=1073741823,Jj=null,eF=0,tF=!1,rF=0,nF=500,iF=null,aF=!1,oF=null,sF=null,cF=!1,uF=null,lF=90,dF=null,fF=0,pF=null,hF=0;function gF(){return(Hj&(Uj|Mj))!==Lj?1073741821-($U()/10|0):0!==hF?hF:hF=1073741821-($U()/10|0)}function mF(e,t,r){if(0==(2&(t=t.mode)))return 1073741823;var n=ZU();if(0==(4&t))return 99===n?1073741823:1073741822;if((Hj&Uj)!==Lj)return Wj;if(null!==r)e=aM(e,0|r.timeoutMs||5e3,250);else switch(n){case 99:e=1073741823;break;case 98:e=aM(e,150,100);break;case 97:case 96:e=aM(e,5e3,250);break;case 95:e=2;break;default:throw Error(eR(326))}return null!==Qj&&e===Wj&&--e,e}function yF(e,t){if(50<fF)throw fF=0,pF=null,Error(eR(185));if(null!==(e=vF(e,t))){var r=ZU();1073741823===t?(Hj&Dj)!==Lj&&(Hj&(Uj|Mj))===Lj?wF(e):(CF(e),Hj===Lj&&nM()):CF(e),(4&Hj)===Lj||98!==r&&99!==r||(null===dF?dF=new Map([[e,t]]):(void 0===(r=dF.get(e))||r>t)&&dF.set(e,t))}}function vF(e,t){e.expirationTime<t&&(e.expirationTime=t);var r=e.alternate;null!==r&&r.expirationTime<t&&(r.expirationTime=t);var n=e.return,i=null;if(null===n&&3===e.tag)i=e.stateNode;else for(;null!==n;){if(r=n.alternate,n.childExpirationTime<t&&(n.childExpirationTime=t),null!==r&&r.childExpirationTime<t&&(r.childExpirationTime=t),null===n.return&&3===n.tag){i=n.stateNode;break}n=n.return}return null!==i&&(Qj===i&&(xF(t),Xj===Kj&&az(i,Wj)),oz(i,t)),i}function bF(e){var t=e.lastExpiredTime;if(0!==t)return t;if(!iz(e,t=e.firstPendingTime))return t;var r=e.lastPingedTime;return 2>=(e=r>(e=e.nextKnownPendingLevel)?r:e)&&t!==e?0:e}function CF(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=rM(wF.bind(null,e));else{var t=bF(e),r=e.callbackNode;if(0===t)null!==r&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var n=gF();if(1073741823===t?n=99:1===t||2===t?n=95:n=0>=(n=10*(1073741821-t)-10*(1073741821-n))?99:250>=n?98:5250>=n?97:95,null!==r){var i=e.callbackPriority;if(e.callbackExpirationTime===t&&i>=n)return;r!==qU&&LU(r)}e.callbackExpirationTime=t,e.callbackPriority=n,t=1073741823===t?rM(wF.bind(null,e)):tM(n,EF.bind(null,e),{timeout:10*(1073741821-t)-$U()}),e.callbackNode=t}}}function EF(e,t){if(hF=0,t)return sz(e,t=gF()),CF(e),null;var r=bF(e);if(0!==r){if(t=e.callbackNode,(Hj&(Uj|Mj))!==Lj)throw Error(eR(327));if(VF(),e===Qj&&r===Wj||TF(e,r),null!==Gj){var n=Hj;Hj|=Uj;for(var i=IF();;)try{RF();break}catch(t){AF(e,t)}if(dM(),Hj=n,Nj.current=i,Xj===jj)throw t=Yj,TF(e,r),az(e,r),CF(e),t;if(null===Gj)switch(i=e.finishedWork=e.current.alternate,e.finishedExpirationTime=r,n=Xj,Qj=null,n){case Vj:case jj:throw Error(eR(345));case Fj:sz(e,2<r?2:r);break;case zj:if(az(e,r),r===(n=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=LF(i)),1073741823===$j&&10<(i=rF+nF-$U())){if(tF){var a=e.lastPingedTime;if(0===a||a>=r){e.lastPingedTime=r,TF(e,r);break}}if(0!==(a=bF(e))&&a!==r)break;if(0!==n&&n!==r){e.lastPingedTime=n;break}e.timeoutHandle=AL(DF.bind(null,e),i);break}DF(e);break;case Kj:if(az(e,r),r===(n=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=LF(i)),tF&&(0===(i=e.lastPingedTime)||i>=r)){e.lastPingedTime=r,TF(e,r);break}if(0!==(i=bF(e))&&i!==r)break;if(0!==n&&n!==r){e.lastPingedTime=n;break}if(1073741823!==Zj?n=10*(1073741821-Zj)-$U():1073741823===$j?n=0:(n=10*(1073741821-$j)-5e3,0>(n=(i=$U())-n)&&(n=0),(r=10*(1073741821-r)-i)<(n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Rj(n/1960))-n)&&(n=r)),10<n){e.timeoutHandle=AL(DF.bind(null,e),n);break}DF(e);break;case qj:if(1073741823!==$j&&null!==Jj){a=$j;var o=Jj;if(0>=(n=0|o.busyMinDurationMs)?n=0:(i=0|o.busyDelayMs,n=(a=$U()-(10*(1073741821-a)-(0|o.timeoutMs||5e3)))<=i?0:i+n-a),10<n){az(e,r),e.timeoutHandle=AL(DF.bind(null,e),n);break}}DF(e);break;default:throw Error(eR(329))}if(CF(e),e.callbackNode===t)return EF.bind(null,e)}}return null}function wF(e){var t=e.lastExpiredTime;if(t=0!==t?t:1073741823,(Hj&(Uj|Mj))!==Lj)throw Error(eR(327));if(VF(),e===Qj&&t===Wj||TF(e,t),null!==Gj){var r=Hj;Hj|=Uj;for(var n=IF();;)try{PF();break}catch(t){AF(e,t)}if(dM(),Hj=r,Nj.current=n,Xj===jj)throw r=Yj,TF(e,t),az(e,t),CF(e),r;if(null!==Gj)throw Error(eR(261));e.finishedWork=e.current.alternate,e.finishedExpirationTime=t,Qj=null,DF(e),CF(e)}return null}function kF(){if(null!==dF){var e=dF;dF=null,e.forEach((function(e,t){sz(t,e),CF(t)})),nM()}}function SF(e,t){var r=Hj;Hj|=1;try{return e(t)}finally{(Hj=r)===Lj&&nM()}}function BF(e,t){var r=Hj;Hj&=-2,Hj|=Dj;try{return e(t)}finally{(Hj=r)===Lj&&nM()}}function TF(e,t){e.finishedWork=null,e.finishedExpirationTime=0;var r=e.timeoutHandle;if(-1!==r&&(e.timeoutHandle=-1,IL(r)),null!==Gj)for(r=Gj.return;null!==r;){var n=r;switch(n.tag){case 1:null!=(n=n.type.childContextTypes)&&IU();break;case 3:qM(),CU(SU),CU(kU);break;case 5:QM(n);break;case 4:qM();break;case 13:case 19:CU(GM);break;case 10:fM(n)}r=r.return}Qj=e,Gj=ZF(e.current,null),Wj=t,Xj=Vj,Yj=null,Zj=$j=1073741823,Jj=null,eF=0,tF=!1}function AF(e,t){for(;;){try{if(dM(),YM.current=AV,rV)for(var r=JM.memoizedState;null!==r;){var n=r.queue;null!==n&&(n.pending=null),r=r.next}if(ZM=0,tV=eV=JM=null,rV=!1,null===Gj||null===Gj.return)return Xj=jj,Yj=t,Gj=null;e:{var i=e,a=Gj.return,o=Gj,s=t;if(t=Wj,o.effectTag|=2048,o.firstEffect=o.lastEffect=null,null!==s&&"object"==typeof s&&"function"==typeof s.then){var c=s;if(0==(2&o.mode)){var u=o.alternate;u?(o.updateQueue=u.updateQueue,o.memoizedState=u.memoizedState,o.expirationTime=u.expirationTime):(o.updateQueue=null,o.memoizedState=null)}var l=0!=(1&GM.current),d=a;do{var f;if(f=13===d.tag){var p=d.memoizedState;if(null!==p)f=null!==p.dehydrated;else{var h=d.memoizedProps;f=void 0!==h.fallback&&(!0!==h.unstable_avoidThisFallback||!l)}}if(f){var g=d.updateQueue;if(null===g){var m=new Set;m.add(c),d.updateQueue=m}else g.add(c);if(0==(2&d.mode)){if(d.effectTag|=64,o.effectTag&=-2981,1===o.tag)if(null===o.alternate)o.tag=17;else{var y=bM(1073741823,null);y.tag=2,CM(o,y)}o.expirationTime=1073741823;break e}s=void 0,o=t;var v=i.pingCache;if(null===v?(v=i.pingCache=new Ij,s=new Set,v.set(c,s)):void 0===(s=v.get(c))&&(s=new Set,v.set(c,s)),!s.has(o)){s.add(o);var b=KF.bind(null,i,c,o);c.then(b,b)}d.effectTag|=4096,d.expirationTime=t;break e}d=d.return}while(null!==d);s=Error((gN(o.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display."+mN(o))}Xj!==qj&&(Xj=Fj),s=lj(s,o),d=a;do{switch(d.tag){case 3:c=s,d.effectTag|=4096,d.expirationTime=t,EM(d,_j(d,c,t));break e;case 1:c=s;var C=d.type,E=d.stateNode;if(0==(64&d.effectTag)&&("function"==typeof C.getDerivedStateFromError||null!==E&&"function"==typeof E.componentDidCatch&&(null===sF||!sF.has(E)))){d.effectTag|=4096,d.expirationTime=t,EM(d,xj(d,c,t));break e}}d=d.return}while(null!==d)}Gj=OF(Gj)}catch(e){t=e;continue}break}}function IF(){var e=Nj.current;return Nj.current=AV,null===e?AV:e}function _F(e,t){e<$j&&2<e&&($j=e),null!==t&&e<Zj&&2<e&&(Zj=e,Jj=t)}function xF(e){e>eF&&(eF=e)}function PF(){for(;null!==Gj;)Gj=NF(Gj)}function RF(){for(;null!==Gj&&!HU();)Gj=NF(Gj)}function NF(e){var t=Pj(e.alternate,e,Wj);return e.memoizedProps=e.pendingProps,null===t&&(t=OF(e)),Oj.current=null,t}function OF(e){Gj=e;do{var t=Gj.alternate;if(e=Gj.return,0==(2048&Gj.effectTag)){if(t=cj(t,Gj,Wj),1===Wj||1!==Gj.childExpirationTime){for(var r=0,n=Gj.child;null!==n;){var i=n.expirationTime,a=n.childExpirationTime;i>r&&(r=i),a>r&&(r=a),n=n.sibling}Gj.childExpirationTime=r}if(null!==t)return t;null!==e&&0==(2048&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=Gj.firstEffect),null!==Gj.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=Gj.firstEffect),e.lastEffect=Gj.lastEffect),1<Gj.effectTag&&(null!==e.lastEffect?e.lastEffect.nextEffect=Gj:e.firstEffect=Gj,e.lastEffect=Gj))}else{if(null!==(t=uj(Gj)))return t.effectTag&=2047,t;null!==e&&(e.firstEffect=e.lastEffect=null,e.effectTag|=2048)}if(null!==(t=Gj.sibling))return t;Gj=e}while(null!==Gj);return Xj===Vj&&(Xj=qj),null}function LF(e){var t=e.expirationTime;return t>(e=e.childExpirationTime)?t:e}function DF(e){var t=ZU();return eM(99,UF.bind(null,e,t)),null}function UF(e,t){do{VF()}while(null!==uF);if((Hj&(Uj|Mj))!==Lj)throw Error(eR(327));var r=e.finishedWork,n=e.finishedExpirationTime;if(null===r)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,r===e.current)throw Error(eR(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var i=LF(r);if(e.firstPendingTime=i,n<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:n<=e.firstSuspendedTime&&(e.firstSuspendedTime=n-1),n<=e.lastPingedTime&&(e.lastPingedTime=0),n<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===Qj&&(Gj=Qj=null,Wj=0),1<r.effectTag?null!==r.lastEffect?(r.lastEffect.nextEffect=r,i=r.firstEffect):i=r:i=r.firstEffect,null!==i){var a=Hj;Hj|=Mj,Oj.current=null,kL=YO;var o=yL();if(vL(o)){if("selectionStart"in o)var s={start:o.selectionStart,end:o.selectionEnd};else e:{var c=(s=(s=o.ownerDocument)&&s.defaultView||window).getSelection&&s.getSelection();if(c&&0!==c.rangeCount){s=c.anchorNode;var u=c.anchorOffset,l=c.focusNode;c=c.focusOffset;try{s.nodeType,l.nodeType}catch(e){s=null;break e}var d=0,f=-1,p=-1,h=0,g=0,m=o,y=null;t:for(;;){for(var v;m!==s||0!==u&&3!==m.nodeType||(f=d+u),m!==l||0!==c&&3!==m.nodeType||(p=d+c),3===m.nodeType&&(d+=m.nodeValue.length),null!==(v=m.firstChild);)y=m,m=v;for(;;){if(m===o)break t;if(y===s&&++h===u&&(f=d),y===l&&++g===c&&(p=d),null!==(v=m.nextSibling))break;y=(m=y).parentNode}m=v}s=-1===f||-1===p?null:{start:f,end:p}}else s=null}s=s||{start:0,end:0}}else s=null;SL={activeElementDetached:null,focusedElem:o,selectionRange:s},YO=!1,iF=i;do{try{MF()}catch(e){if(null===iF)throw Error(eR(330));zF(iF,e),iF=iF.nextEffect}}while(null!==iF);iF=i;do{try{for(o=e,s=t;null!==iF;){var b=iF.effectTag;if(16&b&&FN(iF.stateNode,""),128&b){var C=iF.alternate;if(null!==C){var E=C.ref;null!==E&&("function"==typeof E?E(null):E.current=null)}}switch(1038&b){case 2:wj(iF),iF.effectTag&=-3;break;case 6:wj(iF),iF.effectTag&=-3,Tj(iF.alternate,iF);break;case 1024:iF.effectTag&=-1025;break;case 1028:iF.effectTag&=-1025,Tj(iF.alternate,iF);break;case 4:Tj(iF.alternate,iF);break;case 8:Bj(o,u=iF,s),Cj(u)}iF=iF.nextEffect}}catch(e){if(null===iF)throw Error(eR(330));zF(iF,e),iF=iF.nextEffect}}while(null!==iF);if(E=SL,C=yL(),b=E.focusedElem,s=E.selectionRange,C!==b&&b&&b.ownerDocument&&mL(b.ownerDocument.documentElement,b)){null!==s&&vL(b)&&(C=s.start,void 0===(E=s.end)&&(E=C),"selectionStart"in b?(b.selectionStart=C,b.selectionEnd=Math.min(E,b.value.length)):(E=(C=b.ownerDocument||document)&&C.defaultView||window).getSelection&&(E=E.getSelection(),u=b.textContent.length,o=Math.min(s.start,u),s=void 0===s.end?o:Math.min(s.end,u),!E.extend&&o>s&&(u=s,s=o,o=u),u=gL(b,o),l=gL(b,s),u&&l&&(1!==E.rangeCount||E.anchorNode!==u.node||E.anchorOffset!==u.offset||E.focusNode!==l.node||E.focusOffset!==l.offset)&&((C=C.createRange()).setStart(u.node,u.offset),E.removeAllRanges(),o>s?(E.addRange(C),E.extend(l.node,l.offset)):(C.setEnd(l.node,l.offset),E.addRange(C))))),C=[];for(E=b;E=E.parentNode;)1===E.nodeType&&C.push({element:E,left:E.scrollLeft,top:E.scrollTop});for("function"==typeof b.focus&&b.focus(),b=0;b<C.length;b++)(E=C[b]).element.scrollLeft=E.left,E.element.scrollTop=E.top}YO=!!kL,SL=kL=null,e.current=r,iF=i;do{try{for(b=e;null!==iF;){var w=iF.effectTag;if(36&w&&vj(b,iF.alternate,iF),128&w){C=void 0;var k=iF.ref;if(null!==k){var S=iF.stateNode;switch(iF.tag){case 5:C=S;break;default:C=S}"function"==typeof k?k(C):k.current=C}}iF=iF.nextEffect}}catch(e){if(null===iF)throw Error(eR(330));zF(iF,e),iF=iF.nextEffect}}while(null!==iF);iF=null,QU(),Hj=a}else e.current=r;if(cF)cF=!1,uF=e,lF=t;else for(iF=i;null!==iF;)t=iF.nextEffect,iF.nextEffect=null,iF=t;if(0===(t=e.firstPendingTime)&&(sF=null),1073741823===t?e===pF?fF++:(fF=0,pF=e):fF=0,"function"==typeof HF&&HF(r.stateNode,n),CF(e),aF)throw aF=!1,e=oF,oF=null,e;return(Hj&Dj)!==Lj||nM(),null}function MF(){for(;null!==iF;){var e=iF.effectTag;0!=(256&e)&&gj(iF.alternate,iF),0==(512&e)||cF||(cF=!0,tM(97,(function(){return VF(),null}))),iF=iF.nextEffect}}function VF(){if(90!==lF){var e=97<lF?97:lF;return lF=90,eM(e,jF)}}function jF(){if(null===uF)return!1;var e=uF;if(uF=null,(Hj&(Uj|Mj))!==Lj)throw Error(eR(331));var t=Hj;for(Hj|=Mj,e=e.current.firstEffect;null!==e;){try{var r=e;if(0!=(512&r.effectTag))switch(r.tag){case 0:case 11:case 15:case 22:mj(5,r),yj(5,r)}}catch(t){if(null===e)throw Error(eR(330));zF(e,t)}r=e.nextEffect,e.nextEffect=null,e=r}return Hj=t,nM(),!0}function FF(e,t,r){CM(e,t=_j(e,t=lj(r,t),1073741823)),null!==(e=vF(e,1073741823))&&CF(e)}function zF(e,t){if(3===e.tag)FF(e,e,t);else for(var r=e.return;null!==r;){if(3===r.tag){FF(r,e,t);break}if(1===r.tag){var n=r.stateNode;if("function"==typeof r.type.getDerivedStateFromError||"function"==typeof n.componentDidCatch&&(null===sF||!sF.has(n))){CM(r,e=xj(r,e=lj(t,e),1073741823)),null!==(r=vF(r,1073741823))&&CF(r);break}}r=r.return}}function KF(e,t,r){var n=e.pingCache;null!==n&&n.delete(t),Qj===e&&Wj===r?Xj===Kj||Xj===zj&&1073741823===$j&&$U()-rF<nF?TF(e,Wj):tF=!0:iz(e,r)&&(0!==(t=e.lastPingedTime)&&t<r||(e.lastPingedTime=r,CF(e)))}function qF(e,t){var r=e.stateNode;null!==r&&r.delete(t),0===(t=0)&&(t=mF(t=gF(),e,null)),null!==(e=vF(e,t))&&CF(e)}Pj=function(e,t,r){var n=t.expirationTime;if(null!==e){var i=t.pendingProps;if(e.memoizedProps!==i||SU.current)FV=!0;else{if(n<r){switch(FV=!1,t.tag){case 3:YV(t),VV();break;case 5:if(HM(t),4&t.mode&&1!==r&&i.hidden)return t.expirationTime=t.childExpirationTime=1,null;break;case 1:AU(t.type)&&PU(t);break;case 4:KM(t,t.stateNode.containerInfo);break;case 10:n=t.memoizedProps.value,i=t.type._context,EU(sM,i._currentValue),i._currentValue=n;break;case 13:if(null!==t.memoizedState)return 0!==(n=t.child.childExpirationTime)&&n>=r?rj(e,t,r):(EU(GM,1&GM.current),null!==(t=oj(e,t,r))?t.sibling:null);EU(GM,1&GM.current);break;case 19:if(n=t.childExpirationTime>=r,0!=(64&e.effectTag)){if(n)return aj(e,t,r);t.effectTag|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null),EU(GM,GM.current),!n)return null}return oj(e,t,r)}FV=!1}}else FV=!1;switch(t.expirationTime=0,t.tag){case 2:if(n=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,i=TU(t,kU.current),hM(t,r),i=aV(null,t,n,e,i,r),t.effectTag|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,AU(n)){var a=!0;PU(t)}else a=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,yM(t);var o=n.getDerivedStateFromProps;"function"==typeof o&&TM(t,n,o,e),i.updater=AM,t.stateNode=i,i._reactInternalFiber=t,PM(t,n,e,r),t=XV(null,t,n,!0,a,r)}else t.tag=0,zV(null,t,i,r),t=t.child;return t;case 16:e:{if(i=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,hN(i),1!==i._status)throw i._result;switch(i=i._result,t.type=i,a=t.tag=$F(i),e=oM(i,e),a){case 0:t=GV(null,t,i,e,r);break e;case 1:t=WV(null,t,i,e,r);break e;case 11:t=KV(null,t,i,e,r);break e;case 14:t=qV(null,t,i,oM(i.type,e),n,r);break e}throw Error(eR(306,i,""))}return t;case 0:return n=t.type,i=t.pendingProps,GV(e,t,n,i=t.elementType===n?i:oM(n,i),r);case 1:return n=t.type,i=t.pendingProps,WV(e,t,n,i=t.elementType===n?i:oM(n,i),r);case 3:if(YV(t),n=t.updateQueue,null===e||null===n)throw Error(eR(282));if(n=t.pendingProps,i=null!==(i=t.memoizedState)?i.element:null,vM(e,t),wM(t,n,null,r),(n=t.memoizedState.element)===i)VV(),t=oj(e,t,r);else{if((i=t.stateNode.hydrate)&&(RV=_L(t.stateNode.containerInfo.firstChild),PV=t,i=NV=!0),i)for(r=UM(t,null,n,r),t.child=r;r;)r.effectTag=-3&r.effectTag|1024,r=r.sibling;else zV(e,t,n,r),VV();t=t.child}return t;case 5:return HM(t),null===e&&DV(t),n=t.type,i=t.pendingProps,a=null!==e?e.memoizedProps:null,o=i.children,TL(n,i)?o=null:null!==a&&TL(n,a)&&(t.effectTag|=16),QV(e,t),4&t.mode&&1!==r&&i.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(zV(e,t,o,r),t=t.child),t;case 6:return null===e&&DV(t),null;case 13:return rj(e,t,r);case 4:return KM(t,t.stateNode.containerInfo),n=t.pendingProps,null===e?t.child=DM(t,null,n,r):zV(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,KV(e,t,n,i=t.elementType===n?i:oM(n,i),r);case 7:return zV(e,t,t.pendingProps,r),t.child;case 8:case 12:return zV(e,t,t.pendingProps.children,r),t.child;case 10:e:{n=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value;var s=t.type._context;if(EU(sM,s._currentValue),s._currentValue=a,null!==o)if(s=o.value,0===(a=WD(s,a)?0:0|("function"==typeof n._calculateChangedBits?n._calculateChangedBits(s,a):1073741823))){if(o.children===i.children&&!SU.current){t=oj(e,t,r);break e}}else for(null!==(s=t.child)&&(s.return=t);null!==s;){var c=s.dependencies;if(null!==c){o=s.child;for(var u=c.firstContext;null!==u;){if(u.context===n&&0!=(u.observedBits&a)){1===s.tag&&((u=bM(r,null)).tag=2,CM(s,u)),s.expirationTime<r&&(s.expirationTime=r),null!==(u=s.alternate)&&u.expirationTime<r&&(u.expirationTime=r),pM(s.return,r),c.expirationTime<r&&(c.expirationTime=r);break}u=u.next}}else o=10===s.tag&&s.type===t.type?null:s.child;if(null!==o)o.return=s;else for(o=s;null!==o;){if(o===t){o=null;break}if(null!==(s=o.sibling)){s.return=o.return,o=s;break}o=o.return}s=o}zV(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=(a=t.pendingProps).children,hM(t,r),n=n(i=gM(i,a.unstable_observedBits)),t.effectTag|=1,zV(e,t,n,r),t.child;case 14:return a=oM(i=t.type,t.pendingProps),qV(e,t,i,a=oM(i.type,a),n,r);case 15:return HV(e,t,t.type,t.pendingProps,n,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:oM(n,i),null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),t.tag=1,AU(n)?(e=!0,PU(t)):e=!1,hM(t,r),_M(t,n,i),PM(t,n,i,r),XV(null,t,n,!0,e,r);case 19:return aj(e,t,r)}throw Error(eR(156,t.tag))};var HF=null,QF=null;function GF(e){if("undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)return!0;try{var r=t.inject(e);HF=function(e){try{t.onCommitFiberRoot(r,e,void 0,64==(64&e.current.effectTag))}catch(e){}},QF=function(e){try{t.onCommitFiberUnmount(r,e)}catch(e){}}}catch(e){}return!0}function WF(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childExpirationTime=this.expirationTime=0,this.alternate=null}function XF(e,t,r,n){return new WF(e,t,r,n)}function YF(e){return!(!(e=e.prototype)||!e.isReactComponent)}function $F(e){if("function"==typeof e)return YF(e)?1:0;if(null!=e){if((e=e.$$typeof)===oN)return 11;if(e===uN)return 14}return 2}function ZF(e,t){var r=e.alternate;return null===r?((r=XF(e.tag,t,e.key,e.mode)).elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.effectTag=0,r.nextEffect=null,r.firstEffect=null,r.lastEffect=null),r.childExpirationTime=e.childExpirationTime,r.expirationTime=e.expirationTime,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=null===t?null:{expirationTime:t.expirationTime,firstContext:t.firstContext,responders:t.responders},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function JF(e,t,r,n,i,a){var o=2;if(n=e,"function"==typeof e)YF(e)&&(o=1);else if("string"==typeof e)o=5;else e:switch(e){case eN:return ez(r.children,i,a,t);case aN:o=8,i|=7;break;case tN:o=8,i|=1;break;case rN:return(e=XF(12,r,t,8|i)).elementType=rN,e.type=rN,e.expirationTime=a,e;case sN:return(e=XF(13,r,t,i)).type=sN,e.elementType=sN,e.expirationTime=a,e;case cN:return(e=XF(19,r,t,i)).elementType=cN,e.expirationTime=a,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case nN:o=10;break e;case iN:o=9;break e;case oN:o=11;break e;case uN:o=14;break e;case lN:o=16,n=null;break e;case dN:o=22;break e}throw Error(eR(130,null==e?e:typeof e,""))}return(t=XF(o,r,t,i)).elementType=e,t.type=n,t.expirationTime=a,t}function ez(e,t,r,n){return(e=XF(7,e,n,t)).expirationTime=r,e}function tz(e,t,r){return(e=XF(6,e,null,t)).expirationTime=r,e}function rz(e,t,r){return(t=XF(4,null!==e.children?e.children:[],e.key,t)).expirationTime=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function nz(e,t,r){this.tag=t,this.current=null,this.containerInfo=e,this.pingCache=this.pendingChildren=null,this.finishedExpirationTime=0,this.finishedWork=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=r,this.callbackNode=null,this.callbackPriority=90,this.lastExpiredTime=this.lastPingedTime=this.nextKnownPendingLevel=this.lastSuspendedTime=this.firstSuspendedTime=this.firstPendingTime=0}function iz(e,t){var r=e.firstSuspendedTime;return e=e.lastSuspendedTime,0!==r&&r>=t&&e<=t}function az(e,t){var r=e.firstSuspendedTime,n=e.lastSuspendedTime;r<t&&(e.firstSuspendedTime=t),(n>t||0===r)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function oz(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var r=e.firstSuspendedTime;0!==r&&(t>=r?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function sz(e,t){var r=e.lastExpiredTime;(0===r||r>t)&&(e.lastExpiredTime=t)}function cz(e,t,r,n){var i=t.current,a=gF(),o=SM.suspense;a=mF(a,i,o);e:if(r){t:{if(eO(r=r._reactInternalFiber)!==r||1!==r.tag)throw Error(eR(170));var s=r;do{switch(s.tag){case 3:s=s.stateNode.context;break t;case 1:if(AU(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break t}}s=s.return}while(null!==s);throw Error(eR(171))}if(1===r.tag){var c=r.type;if(AU(c)){r=xU(r,c,s);break e}}r=s}else r=wU;return null===t.context?t.context=r:t.pendingContext=r,(t=bM(a,o)).payload={element:e},null!==(n=void 0===n?null:n)&&(t.callback=n),CM(i,t),yF(i,a),a}function uz(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function lz(e,t){null!==(e=e.memoizedState)&&null!==e.dehydrated&&e.retryTime<t&&(e.retryTime=t)}function dz(e,t){lz(e,t),(e=e.alternate)&&lz(e,t)}function fz(e,t,r){var n=new nz(e,t,r=null!=r&&!0===r.hydrate),i=XF(3,null,null,2===t?7:1===t?3:0);n.current=i,i.stateNode=n,yM(i),e[OL]=n.current,r&&0!==t&&xO(0,9===e.nodeType?e:e.ownerDocument),this._internalRoot=n}function pz(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function hz(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var r;r=e.lastChild;)e.removeChild(r);return new fz(e,0,t?{hydrate:!0}:void 0)}function gz(e,t,r,n,i){var a=r._reactRootContainer;if(a){var o=a._internalRoot;if("function"==typeof i){var s=i;i=function(){var e=uz(o);s.call(e)}}cz(t,o,e,i)}else{if(a=r._reactRootContainer=hz(r,n),o=a._internalRoot,"function"==typeof i){var c=i;i=function(){var e=uz(o);c.call(e)}}BF((function(){cz(t,o,e,i)}))}return uz(o)}function mz(e,t,r){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:JR,key:null==n?null:""+n,children:e,containerInfo:t,implementation:r}}function yz(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!pz(t))throw Error(eR(200));return mz(e,t,null,r)}fz.prototype.render=function(e){cz(e,this._internalRoot,null,null)},fz.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;cz(null,e,null,(function(){t[OL]=null}))},yO=function(e){if(13===e.tag){var t=aM(gF(),150,100);yF(e,t),dz(e,t)}},vO=function(e){13===e.tag&&(yF(e,3),dz(e,3))},bO=function(e){if(13===e.tag){var t=gF();yF(e,t=mF(t,e,null)),dz(e,t)}},kR=function(e,t,r){switch(t){case"input":if(BN(e,r),t=r.name,"radio"===r.type&&null!=t){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var i=ML(n);if(!i)throw Error(eR(90));EN(n),BN(n,i)}}}break;case"textarea":NN(e,r);break;case"select":null!=(t=r.value)&&xN(e,!!r.multiple,t,!1)}},_R=SF,xR=function(e,t,r,n,i){var a=Hj;Hj|=4;try{return eM(98,e.bind(null,t,r,n,i))}finally{(Hj=a)===Lj&&nM()}},PR=function(){(Hj&(1|Uj|Mj))===Lj&&(kF(),VF())},RR=function(e,t){var r=Hj;Hj|=2;try{return e(t)}finally{(Hj=r)===Lj&&nM()}};var vz={Events:[DL,UL,ML,ER,vR,HL,function(e){oO(e,qL)},AR,IR,tL,uO,VF,{current:!1}]};!function(e){var t=e.findFiberByHostInstance;GF(ob({},e,{overrideHookState:null,overrideProps:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:WR.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=iO(e))?null:e.stateNode},findFiberByHostInstance:function(e){return t?t(e):null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null}))}({findFiberByHostInstance:LL,bundleType:0,version:"16.14.0",rendererPackageName:"react-dom"});var bz=vz,Cz=yz,Ez=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternalFiber;if(void 0===t){if("function"==typeof e.render)throw Error(eR(188));throw Error(eR(268,Object.keys(e)))}return e=null===(e=iO(t))?null:e.stateNode},wz=function(e,t){if((Hj&(Uj|Mj))!==Lj)throw Error(eR(187));var r=Hj;Hj|=1;try{return eM(99,e.bind(null,t))}finally{Hj=r,nM()}},kz=function(e,t,r){if(!pz(t))throw Error(eR(200));return gz(null,e,t,!0,r)},Sz=function(e,t,r){if(!pz(t))throw Error(eR(200));return gz(null,e,t,!1,r)},Bz=function(e){if(!pz(e))throw Error(eR(40));return!!e._reactRootContainer&&(BF((function(){gz(null,null,e,!1,(function(){e._reactRootContainer=null,e[OL]=null}))})),!0)},Tz=SF,Az=function(e,t){return yz(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},Iz=function(e,t,r,n){if(!pz(r))throw Error(eR(200));if(null==e||void 0===e._reactInternalFiber)throw Error(eR(38));return gz(e,t,r,!1,n)},_z="16.14.0",xz={__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:bz,createPortal:Cz,findDOMNode:Ez,flushSync:wz,hydrate:kz,render:Sz,unmountComponentAtNode:Bz,unstable_batchedUpdates:Tz,unstable_createPortal:Az,unstable_renderSubtreeIntoContainer:Iz,version:_z},Pz=0,Rz=null,Nz=null,Oz=function(e){return e()},Lz=function(){return null},Dz=function(){return++Pz},Uz=function(){},Mz=function(e,t,r){return r()},Vz=function(){},jz=function(e){return e},Fz={__interactionsRef:Rz,__subscriberRef:Nz,unstable_clear:Oz,unstable_getCurrent:Lz,unstable_getThreadID:Dz,unstable_subscribe:Uz,unstable_trace:Mz,unstable_unsubscribe:Vz,unstable_wrap:jz},zz=(s((function(e,t){})),s((function(e){e.exports=Fz})),s((function(e,t){})),s((function(e){!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=xz})));function Kz(e){return(Kz="function"==typeof Symbol&&"symbol"==Iv(Symbol.iterator)?function(e){return Iv(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":Iv(e)})(e)}function qz(e,t,r,n,i,a,o){try{var s=e[a](o),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}function Hz(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var a=e.apply(t,r);function o(e){qz(a,n,i,o,s,"next",e)}function s(e){qz(a,n,i,o,s,"throw",e)}o(void 0)}))}}function Qz(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Gz(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wz(){return(Wz=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function Xz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Yz(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xz(Object(r),!0).forEach((function(t){Gz(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xz(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function $z(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Zz(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Jz(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}}(e,t)||tK(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eK(e){return function(e){if(Array.isArray(e))return rK(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||tK(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tK(e,t){if(e){if("string"==typeof e)return rK(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?rK(e,t):void 0}}function rK(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var nK="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function iK(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function aK(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}var oK,sK,cK,uK,lK,dK,fK,pK,hK,gK,mK,yK,vK=aK((function(e){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(e,t,r){e.exports={BROWSER_TYPES:{CHROME:"Chrome",FIREFOX:"Firefox",OPERA:"Opera",YANDEX:"Yandex",SAFARI:"Safari",INTERNET_EXPLORER:"Internet Explorer",EDGE:"Edge",CHROMIUM:"Chromium",IE:"IE",MOBILE_SAFARI:"Mobile Safari",EDGE_CHROMIUM:"Edge Chromium"},DEVICE_TYPES:{MOBILE:"mobile",TABLET:"tablet",SMART_TV:"smarttv",CONSOLE:"console",WEARABLE:"wearable",BROWSER:void 0},OS_TYPES:{IOS:"iOS",ANDROID:"Android",WINDOWS_PHONE:"Windows Phone",WINDOWS:"Windows",MAC_OS:"Mac OS"},defaultData:{isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1}}},function(e,t,r){var n,i=r(2),a=r(0),o=a.BROWSER_TYPES,s=a.OS_TYPES,c=a.DEVICE_TYPES,u=r(4),l=u.checkType,d=u.broPayload,f=u.mobilePayload,p=u.wearPayload,h=u.consolePayload,g=u.stvPayload,m=u.getNavigatorInstance,y=u.isIOS13Check,v=new i,b=v.getBrowser(),C=v.getDevice(),E=v.getEngine(),w=v.getOS(),k=v.getUA(),S=o.CHROME,B=o.CHROMIUM,T=o.IE,A=o.INTERNET_EXPLORER,I=o.OPERA,_=o.FIREFOX,x=o.SAFARI,P=o.EDGE,R=o.YANDEX,N=o.MOBILE_SAFARI,O=c.MOBILE,L=c.TABLET,D=c.SMART_TV,U=c.BROWSER,M=c.WEARABLE,V=c.CONSOLE,j=s.ANDROID,F=s.WINDOWS_PHONE,z=s.IOS,K=s.WINDOWS,q=s.MAC_OS,H=function(){return w.name===s.WINDOWS&&"10"===w.version&&"string"==typeof k&&-1!==k.indexOf("Edg/")},Q=function(){return b.name===P},G=function(){return y("iPad")},W=C.type===D,X=C.type===V,Y=C.type===M,$=b.name===N||G(),Z=b.name===B,J=function(){switch(C.type){case O:case L:return!0;default:return!1}}()||G(),ee=C.type===O,te=C.type===L||G(),re=C.type===U,ne=w.name===j,ie=w.name===F,ae=w.name===z||G(),oe=b.name===S,se=b.name===_,ce=b.name===x||b.name===N,ue=b.name===I,le=b.name===A||b.name===T,de=w.version?w.version:"none",fe=w.name?w.name:"none",pe=b.major,he=b.version,ge=b.name,me=C.vendor?C.vendor:"none",ye=C.model?C.model:"none",ve=E.name,be=E.version,Ce=k,Ee=Q()||H(),we=b.name===R,ke=C.type,Se=(n=m())&&(/iPad|iPhone|iPod/.test(n.platform)||"MacIntel"===n.platform&&n.maxTouchPoints>1)&&!window.MSStream,Be=G(),Te=y("iPhone"),Ae=y("iPod"),Ie=function(){var e=m(),t=e&&e.userAgent.toLowerCase();return"string"==typeof t&&/electron/.test(t)}(),_e=H(),xe=Q(),Pe=w.name===K,Re=w.name===q,Ne=l(C.type);e.exports={deviceDetect:function(){var e=Ne.isBrowser,t=Ne.isMobile,r=Ne.isTablet,n=Ne.isSmartTV,i=Ne.isConsole,a=Ne.isWearable;return e?d(e,b,E,w,k):n?g(n,E,w,k):i?h(i,E,w,k):t||r?f(Ne,C,w,k):a?p(a,E,w,k):void 0},isSmartTV:W,isConsole:X,isWearable:Y,isMobileSafari:$,isChromium:Z,isMobile:J,isMobileOnly:ee,isTablet:te,isBrowser:re,isAndroid:ne,isWinPhone:ie,isIOS:ae,isChrome:oe,isFirefox:se,isSafari:ce,isOpera:ue,isIE:le,osVersion:de,osName:fe,fullBrowserVersion:pe,browserVersion:he,browserName:ge,mobileVendor:me,mobileModel:ye,engineName:ve,engineVersion:be,getUA:Ce,isEdge:Ee,isYandex:we,deviceType:ke,isIOS13:Se,isIPad13:Be,isIPhone13:Te,isIPod13:Ae,isElectron:Ie,isEdgeChromium:_e,isLegacyEdge:xe,isWindows:Pe,isMacOs:Re}},function(e,t,r){var n;
|
46
|
+
/*!
|
47
|
+
* UAParser.js v0.7.18
|
48
|
+
* Lightweight JavaScript-based User-Agent string parser
|
49
|
+
* https://github.com/faisalman/ua-parser-js
|
50
|
+
*
|
51
|
+
* Copyright © 2012-2016 Faisal Salman <fyzlman@gmail.com>
|
52
|
+
* Dual licensed under GPLv2 or MIT
|
53
|
+
*/!function(i,a){var o="function",s="undefined",c="object",u="model",l="name",d="type",f="vendor",p="version",h="architecture",g="console",m="mobile",y="tablet",v="smarttv",b="wearable",C={extend:function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:a},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},E={rgx:function(e,t){for(var r,n,i,s,u,l,d=0;d<t.length&&!u;){var f=t[d],p=t[d+1];for(r=n=0;r<f.length&&!u;)if(u=f[r++].exec(e))for(i=0;i<p.length;i++)l=u[++n],Iv(s=p[i])===c&&s.length>0?2==s.length?Iv(s[1])==o?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:3==s.length?Iv(s[1])!==o||s[1].exec&&s[1].test?this[s[0]]=l?l.replace(s[1],s[2]):a:this[s[0]]=l?s[1].call(this,l,s[2]):a:4==s.length&&(this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):a):this[s]=l||a;d+=2}},str:function(e,t){for(var r in t)if(Iv(t[r])===c&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(C.has(t[r][n],e))return"?"===r?a:r}else if(C.has(t[r],e))return"?"===r?a:r;return e}},w={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},k={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[l,p],[/(opios)[\/\s]+([\w\.]+)/i],[[l,"Opera Mini"],p],[/\s(opr)\/([\w\.]+)/i],[[l,"Opera"],p],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]*)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark)\/([\w\.-]+)/i],[l,p],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[l,"IE"],p],[/(edge|edgios|edgea)\/((\d+)?[\w\.]+)/i],[[l,"Edge"],p],[/(yabrowser)\/([\w\.]+)/i],[[l,"Yandex"],p],[/(puffin)\/([\w\.]+)/i],[[l,"Puffin"],p],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[l,"UCBrowser"],p],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],p],[/(micromessenger)\/([\w\.]+)/i],[[l,"WeChat"],p],[/(qqbrowserlite)\/([\w\.]+)/i],[l,p],[/(QQ)\/([\d\.]+)/i],[l,p],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[l,p],[/(BIDUBrowser)[\/\s]?([\w\.]+)/i],[l,p],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[l,p],[/(MetaSr)[\/\s]?([\w\.]+)/i],[l],[/(LBBROWSER)/i],[l],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[p,[l,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[p,[l,"Facebook"]],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[p,[l,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[l,/(.+)/,"$1 WebView"],p],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[l,/(.+(?:g|us))(.+)/,"$1 $2"],p],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[p,[l,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[l,p],[/(dolfin)\/([\w\.]+)/i],[[l,"Dolphin"],p],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[l,"Chrome"],p],[/(coast)\/([\w\.]+)/i],[[l,"Opera Coast"],p],[/fxios\/([\w\.-]+)/i],[p,[l,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[p,[l,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[p,l],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[l,"GSA"],p],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[l,[p,E.str,w.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[l,p],[/(navigator|netscape)\/([\w\.-]+)/i],[[l,"Netscape"],p],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[l,p]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[h,"amd64"]],[/(ia32(?=;))/i],[[h,C.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[h,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[h,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[h,/ower/,"",C.lowerize]],[/(sun4\w)[;\)]/i],[[h,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[h,C.lowerize]]],device:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],[u,f,[d,y]],[/applecoremedia\/[\w\.]+ \((ipad)/],[u,[f,"Apple"],[d,y]],[/(apple\s{0,1}tv)/i],[[u,"Apple TV"],[f,"Apple"]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[f,u,[d,y]],[/(kf[A-z]+)\sbuild\/.+silk\//i],[u,[f,"Amazon"],[d,y]],[/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i],[[u,E.str,w.device.amazon.model],[f,"Amazon"],[d,m]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[u,f,[d,m]],[/\((ip[honed|\s\w*]+);/i],[u,[f,"Apple"],[d,m]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[f,u,[d,m]],[/\(bb10;\s(\w+)/i],[u,[f,"BlackBerry"],[d,m]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone)/i],[u,[f,"Asus"],[d,y]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[f,"Sony"],[u,"Xperia Tablet"],[d,y]],[/android.+\s([c-g]\d{4}|so[-l]\w+)\sbuild\//i],[u,[f,"Sony"],[d,m]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[f,u,[d,g]],[/android.+;\s(shield)\sbuild/i],[u,[f,"Nvidia"],[d,g]],[/(playstation\s[34portablevi]+)/i],[u,[f,"Sony"],[d,g]],[/(sprint\s(\w+))/i],[[f,E.str,w.device.sprint.vendor],[u,E.str,w.device.sprint.model],[d,m]],[/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i],[f,u,[d,y]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[f,[u,/_/g," "],[d,m]],[/(nexus\s9)/i],[u,[f,"HTC"],[d,y]],[/d\/huawei([\w\s-]+)[;\)]/i,/(nexus\s6p)/i],[u,[f,"Huawei"],[d,m]],[/(microsoft);\s(lumia[\s\w]+)/i],[f,u,[d,m]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[u,[f,"Microsoft"],[d,g]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[f,"Microsoft"],[d,m]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w*)/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[u,[f,"Motorola"],[d,m]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[u,[f,"Motorola"],[d,y]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[f,C.trim],[u,C.trim],[d,v]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[f,"Samsung"],[d,v]],[/\(dtv[\);].+(aquos)/i],[u,[f,"Sharp"],[d,v]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[f,"Samsung"],u,[d,y]],[/smart-tv.+(samsung)/i],[f,[d,v],u],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[f,"Samsung"],u,[d,m]],[/sie-(\w*)/i],[u,[f,"Siemens"],[d,m]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[f,"Nokia"],u,[d,m]],[/android\s3\.[\s\w;-]{10}(a\d{3})/i],[u,[f,"Acer"],[d,y]],[/android.+([vl]k\-?\d{3})\s+build/i],[u,[f,"LG"],[d,y]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[f,"LG"],u,[d,y]],[/(lg) netcast\.tv/i],[f,u,[d,v]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[u,[f,"LG"],[d,m]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[u,[f,"Lenovo"],[d,y]],[/linux;.+((jolla));/i],[f,u,[d,m]],[/((pebble))app\/[\d\.]+\s/i],[f,u,[d,b]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[f,u,[d,m]],[/crkey/i],[[u,"Chromecast"],[f,"Google"]],[/android.+;\s(glass)\s\d/i],[u,[f,"Google"],[d,b]],[/android.+;\s(pixel c)\s/i],[u,[f,"Google"],[d,y]],[/android.+;\s(pixel xl|pixel)\s/i],[u,[f,"Google"],[d,m]],[/android.+;\s(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:one|one[\s_]plus|note lte)?[\s_]*(?:\d?\w?)[\s_]*(?:plus)?)\s+build/i,/android.+(redmi[\s\-_]*(?:note)?(?:[\s_]*[\w\s]+))\s+build/i],[[u,/_/g," "],[f,"Xiaomi"],[d,m]],[/android.+(mi[\s\-_]*(?:pad)(?:[\s_]*[\w\s]+))\s+build/i],[[u,/_/g," "],[f,"Xiaomi"],[d,y]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[u,[f,"Meizu"],[d,y]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})\s+build/i],[u,[f,"OnePlus"],[d,m]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[u,[f,"RCA"],[d,y]],[/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i],[u,[f,"Dell"],[d,y]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[u,[f,"Verizon"],[d,y]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[f,"Barnes & Noble"],u,[d,y]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[u,[f,"NuVision"],[d,y]],[/android.+;\s(k88)\sbuild/i],[u,[f,"ZTE"],[d,y]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[u,[f,"Swiss"],[d,m]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[u,[f,"Swiss"],[d,y]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[u,[f,"Zeki"],[d,y]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[f,"Dragon Touch"],u,[d,y]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[u,[f,"Insignia"],[d,y]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[u,[f,"NextBook"],[d,y]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[f,"Voice"],u,[d,m]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[f,"LvTel"],u,[d,m]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[u,[f,"Envizen"],[d,y]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[f,u,[d,y]],[/android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i],[u,[f,"MachSpeed"],[d,y]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[f,u,[d,y]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[u,[f,"Rotor"],[d,y]],[/android.+(KS(.+))\s+build/i],[u,[f,"Amazon"],[d,y]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[f,u,[d,y]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[d,C.lowerize],f,u],[/(android[\w\.\s\-]{0,9});.+build/i],[u,[f,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[p,[l,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[l,p],[/rv\:([\w\.]{1,9}).+(gecko)/i],[p,l]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[l,p],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[l,[p,E.str,w.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[l,"Windows"],[p,E.str,w.os.windows.version]],[/\((bb)(10);/i],[[l,"BlackBerry"],p],[/(blackberry)\w*\/?([\w\.]*)/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]*)/i,/linux;.+(sailfish);/i],[l,p],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[l,"Symbian"],p],[/\((series40);/i],[l],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[l,"Firefox OS"],p],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i],[l,p],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[l,"Chromium OS"],p],[/(sunos)\s?([\w\.\d]*)/i],[[l,"Solaris"],p],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[l,p],[/(haiku)\s(\w+)/i],[l,p],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[p,/_/g,"."],[l,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[l,"Mac OS"],[p,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]*)/i],[l,p]]},S=function e(t,r){if("object"==Iv(t)&&(r=t,t=a),!(this instanceof e))return new e(t,r).getResult();var n=t||(i&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),o=r?C.extend(k,r):k;return this.getBrowser=function(){var e={name:a,version:a};return E.rgx.call(e,n,o.browser),e.major=C.major(e.version),e},this.getCPU=function(){var e={architecture:a};return E.rgx.call(e,n,o.cpu),e},this.getDevice=function(){var e={vendor:a,model:a,type:a};return E.rgx.call(e,n,o.device),e},this.getEngine=function(){var e={name:a,version:a};return E.rgx.call(e,n,o.engine),e},this.getOS=function(){var e={name:a,version:a};return E.rgx.call(e,n,o.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=e,this},this};S.VERSION="0.7.18",S.BROWSER={NAME:l,MAJOR:"major",VERSION:p},S.CPU={ARCHITECTURE:h},S.DEVICE={MODEL:u,VENDOR:f,TYPE:d,CONSOLE:g,MOBILE:m,SMARTTV:v,TABLET:y,WEARABLE:b,EMBEDDED:"embedded"},S.ENGINE={NAME:l,VERSION:p},S.OS={NAME:l,VERSION:p},Iv(t)!==s?(Iv(e)!==s&&e.exports&&(t=e.exports=S),t.UAParser=S):r(3)?(n=function(){return S}.call(t,r,t,e))===a||(e.exports=n):i&&(i.UAParser=S);var B=i&&(i.jQuery||i.Zepto);if(Iv(B)!==s){var T=new S;B.ua=T.getResult(),B.ua.get=function(){return T.getUA()},B.ua.set=function(e){T.setUA(e);var t=T.getResult();for(var r in t)B.ua[r]=t[r]}}}("object"==("undefined"==typeof window?"undefined":Iv(window))?window:this)},function(e,t){(function(t){e.exports=t}).call(t,{})},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i=r(0),a=i.DEVICE_TYPES,o=i.defaultData,s=t.getNavigatorInstance=function(){return!("undefined"==typeof window||!window.navigator&&!navigator)&&(window.navigator||navigator)},c=t.isIOS13Check=function(e){var t=s();return t&&t.platform&&(-1!==t.platform.indexOf(e)||"MacIntel"===t.platform&&t.maxTouchPoints>1&&!window.MSStream)};e.exports={checkType:function(e){switch(e){case a.MOBILE:return{isMobile:!0};case a.TABLET:return{isTablet:!0};case a.SMART_TV:return{isSmartTV:!0};case a.CONSOLE:return{isConsole:!0};case a.WEARABLE:return{isWearable:!0};case a.BROWSER:return{isBrowser:!0};default:return o}},broPayload:function(e,t,r,n,i){return{isBrowser:e,browserMajorVersion:t.major,browserFullVersion:t.version,browserName:t.name,engineName:r.name||!1,engineVersion:r.version,osName:n.name,osVersion:n.version,userAgent:i}},mobilePayload:function(e,t,r,i){return n({},e,{vendor:t.vendor,model:t.model,os:r.name,osVersion:r.version,ua:i})},stvPayload:function(e,t,r,n){return{isSmartTV:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},consolePayload:function(e,t,r,n){return{isConsole:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},wearPayload:function(e,t,r,n){return{isWearable:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},getNavigatorInstance:s,isIOS13Check:c}}])})),bK=iK(vK),CK=Object.freeze(Object.assign(Object.create(null),vK,{default:bK}));function EK(){return"function"==typeof navigator.enumerateDevices?navigator.enumerateDevices():"object"===Kz(navigator.mediaDevices)&&"function"==typeof navigator.mediaDevices.enumerateDevices?navigator.mediaDevices.enumerateDevices():new Promise((function(e,t){try{if(null==window.MediaStreamTrack||null==window.MediaStreamTrack.getSources)throw new Error;window.MediaStreamTrack.getSources((function(t){e(t.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 t(e)}}))}var wK=hB.Errors,kK=1e3,SK=cB.div(oK||(oK=Zz(["\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;"})),BK=cB.video(sK||(sK=Zz(["\n width: 100%;\n ","\n"])),(function(e){return e.flipHorizontal&&"\n transform: scaleX(-1);\n "})),TK=cB.div(cK||(cK=Zz(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),AK=cB(TK)(uK||(uK=Zz(["\n z-index: ",";\n position: absolute;\n top: 20px;\n right: 20px;\n width: 20px;\n"])),1100),IK=cB.div(lK||(lK=Zz(["\n z-index: ",";\n position: absolute;\n top: 40px;\n color: red;\n"])),1020),_K=cB.div(dK||(dK=Zz(["\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: ",";\n"])),1030),xK=cB.section(fK||(fK=Zz(["\n width: 260px;\n margin: 1.25rem;\n padding: 0.625rem 1.875rem;\n background: #ffffff;\n border-radius: 0.3125rem;\n box-shadow: 2px 2px 14px rgba(0, 0, 0, 0.15);\n"]))),PK=cB.header(pK||(pK=Zz(["\n text-align: center;\n padding: 0.625rem 0;\n border-bottom: 1px solid #dddddd;\n"]))),RK=cB.h2(hK||(hK=Zz(["\n margin: 0.25rem auto;\n padding: 0;\n font-weight: 600;\n font-size: 1.2rem;\n"]))),NK=cB.p(gK||(gK=Zz(["\n padding: 0 0 0.3125rem;\n margin: 0.25rem auto;\n font-size: 0.8rem;\n"]))),OK=cB.ul(mK||(mK=Zz(["\n list-style: none;\n padding: 0;\n"]))),LK=cB.li(yK||(yK=Zz(["\n padding: 0.625rem 0 0.9375rem;\n margin: 0;\n text-align: left;\n width: 100%;\n cursor: pointer;\n font-size: 0.82rem;\n transition: all 550ms ease-in-out;\n\n &:hover {\n opacity: 0.8;\n }\n"]))),DK=SC.createRef(),UK=function(){if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)return navigator.mediaDevices;var e=navigator.mozGetUserMedia||navigator.webkitGetUserMedia;return e?{getUserMedia:function(t){return new Promise((function(r,n){e.call(navigator,t,r,n)}))}}:null}();function MK(e){var t=e.checkCameraMode,r=e.frontCamera,n=e.onClose,i=e.children,a=e.onVideoPlayed,o=e.flipHorizontal,s=e.videoSettings,c=e.refVideo,u=e.onError,l=e.closeButton,d=e.videoClassName,f=vB.useSDKSettings().lang,p=c_.useSDKTracking().sendEvent,h=d_.useAsset("ic_close.png"),g=Jz(SC.useState(""),2),m=g[0],y=g[1],v=Jz(SC.useState([]),2),b=v[0],C=v[1],E=Jz(SC.useState(!1),2),w=E[0],k=E[1],S=SC.useRef(!1),B=SC.useRef(!1),T=SC.useCallback((function(){var e;(null==c||null===(e=c.current)||void 0===e?void 0:e.srcObject)instanceof MediaStream&&(c.current.srcObject.getTracks().forEach((function(e){return e.stop()})),c.current.srcObject=null)}),[c]),A=SC.useCallback(function(){var e=Hz(regeneratorRuntime.mark((function e(t){var n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return{},n=vK.isMobile?vK.isIOS?{width:{ideal:1460},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{width:{ideal:1650},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{height:{ideal:9999}},e.prev=2,e.next=5,UK.getUserMedia({audio:!1,video:Yz(Yz({},t?{deviceId:t}:{facingMode:r?"user":"environment"}),s||n)});case 5:return(i=e.sent)||(y(wK.not_supported.msg[f]),u(wK.not_supported)),e.abrupt("return",i);case 10:e.prev=10,e.t0=e.catch(2),"NotAllowedError"===e.t0.name?(y(wK.no_permission.msg[f]),u(wK.no_permission)):(k(!0),y(e.t0.message),u({code:e.t0.name||e.t0.code}));case 13:return e.abrupt("return",null);case 14:case"end":return e.stop()}}),e,null,[[2,10]])})));return function(t){return e.apply(this,arguments)}}(),[r,s,f,u]),I=SC.useCallback(function(){var e=Hz(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=c.current).oncanplaythrough=function(){r.play(),B.current=!0,y("");var e=window.innerWidth,t=window.innerHeight,n=V_.analyzeVideoAndWindowSizes(r),i=n.lostX,o=void 0===i?0:i,s=n.lostY,c=void 0===s?0:s,u=Math.min(e,Math.floor(e-2*o)),l=Math.min(t,Math.floor(t-2*c));a&&a({clientWidth:e,clientHeight:t,videoAreaWidth:u,videoAreaHeight:l,lostX:o,lostY:c})},e.next=4,A(t);case 4:(n=e.sent)&&(r.srcObject=n);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[c,A,a]);SC.useEffect((function(){function e(){return(e=Hz(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,EK();case 3:t=e.sent,r=t.filter((function(e){return e.deviceId&&"videoinput"===e.kind})),C(r),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)}w&&!S.current&&(S.current=!0,function(){e.apply(this,arguments)}())}),[w]),SC.useEffect((function(){function e(){return(e=Hz(regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,I();case 2:return e.next=4,EK();case 4:t=e.sent,(r=t.filter((function(e){return"videoinput"===e.kind&&e.label.includes("0")}))).length>0&&(n=r[0].deviceId,T(),I(n));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var t=c.current;return!UK||vK.browserName&&["facebook"].includes(vK.browserName.toLowerCase())||vK.getUA.includes("Zalo iOS")?(y(wK.not_supported.msg[f]),u(wK.not_supported)):t&&(vK.isAndroid&&!1===r?function(){e.apply(this,arguments)}():I()),function(){T()}}),[c,f,r,I,T,u]),SC.useEffect((function(){var e=setTimeout((function(){B.current||(y(wK.camera_timeout.msg[f]),u(wK.camera_timeout))}),3e5);return function(){clearTimeout(e)}}),[f,u]);var _=SC.useCallback((function(){T(),n&&n(),p({tag:"result",event:"user_activity.cancel",log:{}})}),[n,T,p]);return SC.createElement(SK,{checkCameraMode:t},w&&null!=b&&b.length?SC.createElement(_K,null,SC.createElement(xK,null,SC.createElement(PK,null,SC.createElement(RK,null,"Không thể mở camera mặc định"),SC.createElement(NK,null,"Vui lòng thử chọn camera khác trong danh sách dưới đây")),SC.createElement(OK,null,b.map((function(e,t){return SC.createElement(LK,{key:e.deviceId,onClick:function(){y(""),T(),k(!1),I(e.deviceId)}},e.label?e.label:"Camera ".concat(t+1))}))))):null,m?SC.createElement(IK,null,m):null,SC.createElement(BK,{ref:c,playsInline:!0,muted:!0,flipHorizontal:o,className:d}),i,l?SC.cloneElement(l,{onClick:_,"data-testid":"close-camera"}):SC.createElement(AK,{onClick:_,"data-testid":"close-camera"},SC.createElement("img",{src:h,alt:""})))}MK.propTypes={checkCameraMode:SE.bool,frontCamera:SE.bool,onClose:SE.func,onError:SE.func,onVideoPlayed:SE.func,children:SE.node,flipHorizontal:SE.bool,videoSettings:SE.object,refVideo:SE.object,closeButton:SE.node,videoClassName:SE.string},MK.defaultProps={checkCameraMode:!1,frontCamera:!0,onClose:null,onError:function(){},onVideoPlayed:null,children:null,flipHorizontal:!1,videoSettings:null,refVideo:null,closeButton:null,videoClassName:""};var VK,jK,FK,zK=SC.forwardRef((function(e,t){return SC.createElement(MK,Wz({},e,{refVideo:t||DK}))})),KK=cB.table(VK||(VK=Zz(["\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"]))),qK=cB.div(jK||(jK=Zz(["\n position: relative;\n"]))),HK=Array.from(Array(3).keys()),QK=Array.from(Array(3).keys());function GK(e){var t=e.children,r=e.x,n=e.y,i=e.width,a=e.height,o=e.className,s=e.surroundStyle;return SC.createElement(KK,{className:o},SC.createElement("tbody",null,HK.map((function(e,o){return SC.createElement("tr",{key:e,style:{height:0===o?n:"auto"},"data-testid":"row"},QK.map((function(e,n){var c=1===o&&1===n,u="auto";return c?u=i:0===n&&(u=r),SC.createElement("td",{"data-testid":c?"centeredCell":"cell",key:e,style:Yz({width:u,height:c?a:"auto"},c?{}:s)},c?SC.createElement(qK,{style:{width:u,height:a}},t):null)})))}))))}GK.propTypes={children:SE.node,x:SE.string,y:SE.string,width:SE.string,height:SE.string,className:SE.string,surroundStyle:SE.object},GK.defaultProps={children:null,x:"auto",y:"auto",width:"auto",height:"auto",className:"",surroundStyle:{}};var WK=cB(GK)(FK||(FK=Zz(["\n background: transparent;\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: ",";\n"])),1010);function XK(e){var t=e.className;return SC.createElement("svg",{className:t,width:"38px",height:"32px",viewBox:"0 0 24 21","data-testid":"camera-icon"},SC.createElement("title",null,"FA45C15C-1E21-4D7B-9585-07FB9F999CB8"),SC.createElement("desc",null,"Created with sketchtool."),SC.createElement("g",{id:"Web-demo",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},SC.createElement("g",{id:"step1",transform:"translate(-950.000000, -380.000000)",fill:"currentColor",fillRule:"nonzero"},SC.createElement("g",{id:"Group",transform:"translate(950.000000, 380.000000)"},SC.createElement("g",{id:"Group-2"},SC.createElement("g",{id:"camera"},SC.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"})))))))}XK.propTypes={className:SE.string},XK.defaultProps={className:""};var YK,$K=function(e){var t=Iv(e);return null!=e&&("object"==t||"function"==t)},ZK="object"==Iv(nK)&&nK&&nK.Object===Object&&nK,JK="object"==("undefined"==typeof self?"undefined":Iv(self))&&self&&self.Object===Object&&self,eq=ZK||JK||Function("return this")(),tq=function(){return eq.Date.now()},rq=eq.Symbol,nq=Object.prototype,iq=nq.hasOwnProperty,aq=nq.toString,oq=rq?rq.toStringTag:void 0,sq=function(e){var t=iq.call(e,oq),r=e[oq];try{e[oq]=void 0;var n=!0}catch(e){}var i=aq.call(e);return n&&(t?e[oq]=r:delete e[oq]),i},cq=Object.prototype.toString,uq=function(e){return cq.call(e)},lq=rq?rq.toStringTag:void 0,dq=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":lq&&lq in Object(e)?sq(e):uq(e)},fq=function(e){return null!=e&&"object"==Iv(e)},pq=function(e){return"symbol"==Iv(e)||fq(e)&&"[object Symbol]"==dq(e)},hq=/^\s+|\s+$/g,gq=/^[-+]0x[0-9a-f]+$/i,mq=/^0b[01]+$/i,yq=/^0o[0-7]+$/i,vq=parseInt,bq=function(e){if("number"==typeof e)return e;if(pq(e))return NaN;if($K(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=$K(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(hq,"");var r=mq.test(e);return r||yq.test(e)?vq(e.slice(2),r?2:8):gq.test(e)?NaN:+e},Cq=Math.max,Eq=Math.min,wq=function(e,t,r){var n,i,a,o,s,c,u=0,l=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var r=n,a=i;return n=i=void 0,u=t,o=e.apply(a,r)}function h(e){return u=e,s=setTimeout(m,t),l?p(e):o}function g(e){var r=e-c;return void 0===c||r>=t||r<0||d&&e-u>=a}function m(){var e=tq();if(g(e))return y(e);s=setTimeout(m,function(e){var r=t-(e-c);return d?Eq(r,a-(e-u)):r}(e))}function y(e){return s=void 0,f&&n?p(e):(n=i=void 0,o)}function v(){var e=tq(),r=g(e);if(n=arguments,i=this,c=e,r){if(void 0===s)return h(c);if(d)return clearTimeout(s),s=setTimeout(m,t),p(c)}return void 0===s&&(s=setTimeout(m,t)),o}return t=bq(t)||0,$K(r)&&(l=!!r.leading,a=(d="maxWait"in r)?Cq(bq(r.maxWait)||0,t):a,f="trailing"in r?!!r.trailing:f),v.cancel=function(){void 0!==s&&clearTimeout(s),u=0,n=c=i=s=void 0},v.flush=function(){return void 0===s?o:y(tq())},v},kq=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return $K(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),wq(e,t,{leading:n,maxWait:t,trailing:i})},Sq=function(e){if(!$K(e))return!1;var t=dq(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Bq=eq["__core-js_shared__"],Tq=(YK=/[^.]+$/.exec(Bq&&Bq.keys&&Bq.keys.IE_PROTO||""))?"Symbol(src)_1."+YK:"",Aq=function(e){return!!Tq&&Tq in e},Iq=Function.prototype.toString,_q=function(e){if(null!=e){try{return Iq.call(e)}catch(e){}try{return e+""}catch(e){}}return""},xq=/^\[object .+?Constructor\]$/,Pq=Function.prototype,Rq=Object.prototype,Nq=Pq.toString,Oq=Rq.hasOwnProperty,Lq=RegExp("^"+Nq.call(Oq).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Dq=function(e){return!(!$K(e)||Aq(e))&&(Sq(e)?Lq:xq).test(_q(e))},Uq=function(e,t){return null==e?void 0:e[t]},Mq=function(e,t){var r=Uq(e,t);return Dq(r)?r:void 0},Vq=function(){try{var e=Mq(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),jq=function(e,t,r){"__proto__"==t&&Vq?Vq(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r},Fq=function(e,t){return e===t||e!=e&&t!=t},zq=Object.prototype.hasOwnProperty,Kq=function(e,t,r){var n=e[t];zq.call(e,t)&&Fq(n,r)&&(void 0!==r||t in e)||jq(e,t,r)},qq=function(e,t,r,n){var i=!r;r||(r={});for(var a=-1,o=t.length;++a<o;){var s=t[a],c=n?n(r[s],e[s],s,r,e):void 0;void 0===c&&(c=e[s]),i?jq(r,s,c):Kq(r,s,c)}return r},Hq=function(e){return e},Qq=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)},Gq=Math.max,Wq=function(e,t,r){return t=Gq(void 0===t?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=Gq(n.length-t,0),o=Array(a);++i<a;)o[i]=n[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=n[i];return s[t]=r(o),Qq(e,this,s)}},Xq=function(e){return function(){return e}},Yq=Vq?function(e,t){return Vq(e,"toString",{configurable:!0,enumerable:!1,value:Xq(t),writable:!0})}:Hq,$q=Date.now,Zq=function(e){var t=0,r=0;return function(){var n=$q(),i=16-(n-r);if(r=n,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Yq),Jq=function(e,t){return Zq(Wq(e,t,Hq),e+"")},eH=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},tH=function(e){return null!=e&&eH(e.length)&&!Sq(e)},rH=/^(?:0|[1-9]\d*)$/,nH=function(e,t){var r=Iv(e);return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&rH.test(e))&&e>-1&&e%1==0&&e<t},iH=function(e,t,r){if(!$K(r))return!1;var n=Iv(t);return!!("number"==n?tH(r)&&nH(t,r.length):"string"==n&&t in r)&&Fq(r[t],e)},aH=function(e){return Jq((function(t,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,o&&iH(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++n<i;){var s=r[n];s&&e(t,s,n,a)}return t}))},oH=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n},sH=function(e){return fq(e)&&"[object Arguments]"==dq(e)},cH=Object.prototype,uH=cH.hasOwnProperty,lH=cH.propertyIsEnumerable,dH=sH(function(){return arguments}())?sH:function(e){return fq(e)&&uH.call(e,"callee")&&!lH.call(e,"callee")},fH=Array.isArray,pH=function(){return!1},hH=aK((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,i=n&&n.exports===r?eq.Buffer:void 0,a=(i?i.isBuffer:void 0)||pH;e.exports=a})),gH={};gH["[object Float32Array]"]=gH["[object Float64Array]"]=gH["[object Int8Array]"]=gH["[object Int16Array]"]=gH["[object Int32Array]"]=gH["[object Uint8Array]"]=gH["[object Uint8ClampedArray]"]=gH["[object Uint16Array]"]=gH["[object Uint32Array]"]=!0,gH["[object Arguments]"]=gH["[object Array]"]=gH["[object ArrayBuffer]"]=gH["[object Boolean]"]=gH["[object DataView]"]=gH["[object Date]"]=gH["[object Error]"]=gH["[object Function]"]=gH["[object Map]"]=gH["[object Number]"]=gH["[object Object]"]=gH["[object RegExp]"]=gH["[object Set]"]=gH["[object String]"]=gH["[object WeakMap]"]=!1;var mH=function(e){return fq(e)&&eH(e.length)&&!!gH[dq(e)]},yH=function(e){return function(t){return e(t)}},vH=aK((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,i=n&&n.exports===r&&ZK.process,a=function(){try{return n&&n.require&&n.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=a})),bH=vH&&vH.isTypedArray,CH=bH?yH(bH):mH,EH=Object.prototype.hasOwnProperty,wH=function(e,t){var r=fH(e),n=!r&&dH(e),i=!r&&!n&&hH(e),a=!r&&!n&&!i&&CH(e),o=r||n||i||a,s=o?oH(e.length,String):[],c=s.length;for(var u in e)!t&&!EH.call(e,u)||o&&("length"==u||i&&("offset"==u||"parent"==u)||a&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||nH(u,c))||s.push(u);return s},kH=Object.prototype,SH=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||kH)},BH=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t},TH=Object.prototype.hasOwnProperty,AH=function(e){if(!$K(e))return BH(e);var t=SH(e),r=[];for(var n in e)("constructor"!=n||!t&&TH.call(e,n))&&r.push(n);return r},IH=function(e){return tH(e)?wH(e,!0):AH(e)},_H=aH((function(e,t,r,n){qq(t,IH(t),e,n)})),xH=function(e,t){return function(r){return e(t(r))}},PH=xH(Object.getPrototypeOf,Object),RH=Function.prototype,NH=Object.prototype,OH=RH.toString,LH=NH.hasOwnProperty,DH=OH.call(Object),UH=function(e){if(!fq(e)||"[object Object]"!=dq(e))return!1;var t=PH(e);if(null===t)return!0;var r=LH.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&OH.call(r)==DH},MH=function(e){if(!fq(e))return!1;var t=dq(e);return"[object Error]"==t||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!UH(e)},VH=Jq((function(e,t){try{return Qq(e,void 0,t)}catch(e){return MH(e)?e:new Error(e)}})),jH=function(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i},FH=function(e,t){return jH(t,(function(t){return e[t]}))},zH=Object.prototype,KH=zH.hasOwnProperty,qH=function(e,t,r,n){return void 0===e||Fq(e,zH[r])&&!KH.call(n,r)?t:e},HH={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},QH=function(e){return"\\"+HH[e]},GH=xH(Object.keys,Object),WH=Object.prototype.hasOwnProperty,XH=function(e){if(!SH(e))return GH(e);var t=[];for(var r in Object(e))WH.call(e,r)&&"constructor"!=r&&t.push(r);return t},YH=function(e){return tH(e)?wH(e):XH(e)},$H=/<%=([\s\S]+?)%>/g,ZH=function(e){return function(t){return null==e?void 0:e[t]}}({"&":"&","<":"<",">":">",'"':""","'":"'"}),JH=rq?rq.prototype:void 0,eQ=JH?JH.toString:void 0,tQ=function e(t){if("string"==typeof t)return t;if(fH(t))return jH(t,e)+"";if(pq(t))return eQ?eQ.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r},rQ=function(e){return null==e?"":tQ(e)},nQ=/[&<>"']/g,iQ=RegExp(nQ.source),aQ={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:$H,variable:"",imports:{_:{escape:function(e){return(e=rQ(e))&&iQ.test(e)?e.replace(nQ,ZH):e}}}},oQ=/\b__p \+= '';/g,sQ=/\b(__p \+=) '' \+/g,cQ=/(__e\(.*?\)|\b__t\)) \+\n'';/g,uQ=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,lQ=/($^)/,dQ=/['\n\r\u2028\u2029\\]/g,fQ=Object.prototype.hasOwnProperty,pQ=function(e,t,r){var n=aQ.imports._.templateSettings||aQ;r&&iH(e,t,r)&&(t=void 0),e=rQ(e),t=_H({},t,n,qH);var i,a,o=_H({},t.imports,n.imports,qH),s=YH(o),c=FH(o,s),u=0,l=t.interpolate||lQ,d="__p += '",f=RegExp((t.escape||lQ).source+"|"+l.source+"|"+(l===$H?uQ:lQ).source+"|"+(t.evaluate||lQ).source+"|$","g"),p=fQ.call(t,"sourceURL")?"//# sourceURL="+(t.sourceURL+"").replace(/\s/g," ")+"\n":"";e.replace(f,(function(t,r,n,o,s,c){return n||(n=o),d+=e.slice(u,c).replace(dQ,QH),r&&(i=!0,d+="' +\n__e("+r+") +\n'"),s&&(a=!0,d+="';\n"+s+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=c+t.length,t})),d+="';\n";var h=fQ.call(t,"variable")&&t.variable;h||(d="with (obj) {\n"+d+"\n}\n"),d=(a?d.replace(oQ,""):d).replace(sQ,"$1").replace(cQ,"$1;"),d="function("+(h||"obj")+") {\n"+(h?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var g=VH((function(){return Function(s,p+"return "+d).apply(void 0,c)}));if(g.source=d,MH(g))throw g;return g},hQ=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,gQ=/^\w*$/,mQ=function(e,t){if(fH(e))return!1;var r=Iv(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!pq(e))||gQ.test(e)||!hQ.test(e)||null!=t&&e in Object(t)},yQ=Mq(Object,"create"),vQ=function(){this.__data__=yQ?yQ(null):{},this.size=0},bQ=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},CQ=Object.prototype.hasOwnProperty,EQ=function(e){var t=this.__data__;if(yQ){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return CQ.call(t,e)?t[e]:void 0},wQ=Object.prototype.hasOwnProperty,kQ=function(e){var t=this.__data__;return yQ?void 0!==t[e]:wQ.call(t,e)},SQ=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=yQ&&void 0===t?"__lodash_hash_undefined__":t,this};function BQ(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}BQ.prototype.clear=vQ,BQ.prototype.delete=bQ,BQ.prototype.get=EQ,BQ.prototype.has=kQ,BQ.prototype.set=SQ;var TQ=BQ,AQ=function(){this.__data__=[],this.size=0},IQ=function(e,t){for(var r=e.length;r--;)if(Fq(e[r][0],t))return r;return-1},_Q=Array.prototype.splice,xQ=function(e){var t=this.__data__,r=IQ(t,e);return!(r<0||(r==t.length-1?t.pop():_Q.call(t,r,1),--this.size,0))},PQ=function(e){var t=this.__data__,r=IQ(t,e);return r<0?void 0:t[r][1]},RQ=function(e){return IQ(this.__data__,e)>-1},NQ=function(e,t){var r=this.__data__,n=IQ(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function OQ(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}OQ.prototype.clear=AQ,OQ.prototype.delete=xQ,OQ.prototype.get=PQ,OQ.prototype.has=RQ,OQ.prototype.set=NQ;var LQ=OQ,DQ=Mq(eq,"Map"),UQ=function(){this.size=0,this.__data__={hash:new TQ,map:new(DQ||LQ),string:new TQ}},MQ=function(e){var t=Iv(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e},VQ=function(e,t){var r=e.__data__;return MQ(t)?r["string"==typeof t?"string":"hash"]:r.map},jQ=function(e){var t=VQ(this,e).delete(e);return this.size-=t?1:0,t},FQ=function(e){return VQ(this,e).get(e)},zQ=function(e){return VQ(this,e).has(e)},KQ=function(e,t){var r=VQ(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function qQ(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}qQ.prototype.clear=UQ,qQ.prototype.delete=jQ,qQ.prototype.get=FQ,qQ.prototype.has=zQ,qQ.prototype.set=KQ;var HQ=qQ;function QQ(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function r(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(QQ.Cache||HQ),r}QQ.Cache=HQ;var GQ=QQ,WQ=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,XQ=/\\(\\)?/g,YQ=function(e){var t=GQ((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(WQ,(function(e,r,n,i){t.push(n?i.replace(XQ,"$1"):r||e)})),t}),(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}(),$Q=function(e,t){return fH(e)?e:mQ(e,t)?[e]:YQ(rQ(e))},ZQ=function(e){if("string"==typeof e||pq(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},JQ=function(e,t){for(var r=0,n=(t=$Q(t,e)).length;null!=e&&r<n;)e=e[ZQ(t[r++])];return r&&r==n?e:void 0},eG=function(e,t,r){var n=null==e?void 0:JQ(e,t);return void 0===n?r:n},tG=hB.Errors;function rG(e){var t=e.livenessSettings,r=e.apiClient,n=e.apiCheck,i=e.onError,a=Jz(SC.useState({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,limit_time_liveness_check:{enable:!1,limit_time_second:45},terminate_if_no_face:{enable:!1,max_invalid_frame:5,max_time_ms:1e3}}),2),o=a[0],s=a[1];return SC.useEffect((function(){t?s(Yz({},t)):n&&r.clientSettings().then((function(e){if(e&&e.data){var t,r=eG(e,"data.settings.sdk_settings.server_log_settings.enable"),n=eG(e,"data.settings.sdk_settings.active_liveness_settings"),a=eG(n,"save_encoded_frames",{});a.enable&&(t={enable:!0,framesIntervalTime:a.frames_interval_ms,framesBatchLength:a.frames_batch_len}),s(Yz(Yz({},n),{},{enableTracking:r,captureFrameSettings:t}))}e&&e.errors&&i(tG.server_error)})).catch((function(e){i(e)}))}),[t,r,i,n]),o}var nG=function(e){var t=e.curStep,r=e.faceDirection,n=eG(t,"stepTimeConstraints.delayTime");return!!n&&(null===t.firstFrameSpottedAt?(t.name===r&&(t.firstFrameSpottedAt=(new Date).getTime()),!0):(new Date).getTime()-t.firstFrameSpottedAt<n)},iG=function(e){return e?1/0===(e=bq(e))||-1/0===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0},aG=function(e){var t=iG(e),r=t%1;return t==t?r?t-r:t:0},oG=function(e,t){var r;if("function"!=typeof t)throw new TypeError("Expected a function");return e=aG(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}},sG=function(e){return oG(2,e)};function cG(){return(cG=Hz(regeneratorRuntime.mark((function e(){var t,r,n,i,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=t.blazefaceModelUrl,n=t.tfScriptUrls,e.next=3,QP.loadTensorFlow(n);case 3:return e.next=5,QP.initTensorFlow({preferredBackends:["webgl","wasm","cpu"]});case 5:return e.next=7,QP.loadBlazefaceModel({modelUrl:r});case 7:return i=e.sent,e.abrupt("return",{blazefaceModel:i});case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var uG,lG,dG,fG,pG,hG,gG,mG=sG((function(){return cG.apply(this,arguments)})),yG=[],vG=function(){yG=[]},bG=function(e,t,r){r&&vG(),yG.push({id:null});var n=yG.length-1;t.httpClient.post("/v1/files",{frames:e,metadata:JSON.stringify({type:"selfie"})}).then((function(e){e&&e.data&&e.data.file_id?yG[n].id=e.data.file_id:yG[n].id=-1}))},CG=function(){return new Promise((function(e){var t=setInterval((function(){yG.every((function(e){return e.id}))&&(e(),clearInterval(t))}),200)}))},EG=function(e){return e.enable?yG.some((function(e){return-1===e.id}))?null:yG:[]},wG=ex.faceTracker(),kG=hB.Mode,SG=hB.FaceDirection,BG=hB.Errors,TG=hB.Messages;function AG(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.apiCheck,n=t.mode,i=t.bgCameraMask,a=t.bgCameraMaskRed,o=t.surroundStyle,s=t.cropAreaDimension,c=t.customInstructions,u=t.customIcon,l=t.customDirectionIcon,d=t.customStepTimeConstraints,f=void 0===d?(Gz(e={},hB.FaceDirection.UP,{delayTime:1e3}),Gz(e,hB.FaceDirection.LEFT,{delayTime:1e3}),Gz(e,hB.FaceDirection.RIGHT,{delayTime:1e3}),Gz(e,hB.FaceDirection.FRONTAL,{delayTime:2e3}),e):d,p=t.onLivenessDetectionDone,h=t.onError,g=t.frontalMinSize,m=t.waitingTimeToGetBetterFrames,y=void 0===m?500:m,v=t.captureFrameSettings,b=void 0===v?{enable:!1,framesIntervalTime:180,framesBatchLength:0}:v,C=t.livenessSettings,E=t.setRemainingTime,w=void 0===E?function(){}:E,k=t.onProcessing,S=void 0===k?function(){}:k,B=t.customErrors,T=t.customMessages,A=t.apiCredentials,I=void 0===A?{}:A,_=t.onFramesCaptured,x=void 0===_?function(){}:_,P=SC.useState(!1),R=Jz(P,2),N=R[0],O=R[1],L=SC.useState(!1),D=Jz(L,2),U=D[0],M=D[1],V=SC.useState(!1),j=Jz(V,2),F=j[0],z=j[1],K=SC.useRef(null),q=vB.useSDKSettings(),H=q.lang,Q=q.assetRoot,G=q.customUrls,W=kP.useApiClient({apiCredentials:I}),X=W.apiClient,Y=n===kG.ACTIVE,$=SC.useReducer((function(e){return e+1}),0),Z=Jz($,2),J=(Z[0],Z[1]),ee=SC.useRef(null),te=SC.useRef(!1),re=SC.useState(!1),ne=Jz(re,2),ie=ne[0],ae=ne[1],oe=SC.useRef({}),se=c_.useSDKTracking(),ce=se.sendEvent,ue=SC.useRef(null);null===ue.current&&(ue.current=ex.initFaceVerificationData({assetRoot:Q,customInstructions:c,customIcon:u,customDirectionIcon:l,customStepTimeConstraints:f}));var le=SC.useState(),de=Jz(le,2),fe=de[0],pe=de[1],he=SC.useMemo((function(){return kq(pe,500)}),[pe]),ge=SC.useRef([]),me=SC.useRef(),ye=SC.useRef(),ve=rG({livenessSettings:C,apiClient:X,apiCheck:r,onError:h}),be=ve.face_tracking_setting,Ce=ve.flow_interval_time_ms,Ee=ve.limit_time_liveness_check,we=ve.terminate_if_no_face,ke=ve.captureFrameSettings,Se=void 0===ke?b:ke,Be=ve.enableTracking,Te=SC.useMemo((function(){return kq((function(e){r&&!Be||ce(e)}),2e3)}),[r,Be,ce]),Ae=SC.useRef(0),Ie=SC.useRef();SC.useEffect((function(){Te({tag:"selfie",event:"user_activity.start",log:{}})}),[Te]),SC.useEffect((function(){function e(){return(e=Hz(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ie){e.next=9;break}return ye.current=performance.now(),e.next=4,mG(G);case 4:oe.current=e.sent,ae(!0),Te({tag:"selfie",event:"user_activity.show",log:{}}),Te({tag:"selfie",event:"sdk.load_model",log:{status:"success",time_in_ms:performance.now()-ye.current}}),ye.current=null;case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[ie,G,Te]);var _e=SC.useCallback((function(){w(""),ue.current.curStepIndex=ue.current.steps.length,M(!1),setTimeout((function(){ue.current=ex.initFaceVerificationData({assetRoot:Q,customInstructions:c,customIcon:u,customDirectionIcon:l}),me.current=Date.now(),Ae.current=0,Ie.current=null,ge.current=[],z(!1),vG(),J()}),Ce)}),[Q,c,u,l,Ce,w]),xe=SC.useRef(null),Pe=SC.useMemo((function(){return Yz(Yz({},BG),B)}),[B]),Re=SC.useMemo((function(){return Yz(Yz({},TG),T)}),[T]),Ne=400;SC.useEffect((function(){if(N&&Ee.enable&&F){me.current=Date.now();var e=Ee.limit_time_second+1,t=Ee.remain_time_show||10,r=Ee.format||"s";xe.current=setInterval((function(){var n=Math.round((1e3*e-(Date.now()-me.current))/1e3);if(ue.current.curStepIndex<ue.current.steps.length){if(n<=t&&n>=1){var i=pQ(Re.REMAIN_TIME[H]),a=n;switch(r){case"mm:ss":a=n.toString().padStart(5,"00:00");break;case"ss":a=n.toString().padStart(2,"0")}w(i({x:a}))}if(Math.round((Date.now()-me.current)/1e3)===e){var o,s={};Object.keys(null===(o=Pe.liveness_terminated_time_out)||void 0===o?void 0:o.msg).forEach((function(e){var t,r=pQ(null===(t=Pe.liveness_terminated_time_out)||void 0===t?void 0:t.msg[e]);s[e]=r({x:Ee.limit_time_second})})),pe(Yz(Yz({},Pe.liveness_terminated_time_out),{},{msg:s,duration:Ce})),Te({tag:"selfie",event:"sdk_ui.show_alert",log:{alert:"liveness_terminated_time_out,"}}),_e()}}}),1e3)}return function(){clearInterval(xe.current)}}),[_e,w,N,H,Ce,Ee.enable,Ee.limit_time_second,F,Pe.liveness_terminated_time_out,Re.REMAIN_TIME,Ee.format,Ee.remain_time_show,Te]);var Oe=SC.useCallback((function(e){var t,r,n=e.clientWidth,a=e.clientHeight,c=e.videoAreaWidth,u=e.videoAreaHeight,l=e.lostX,d=e.lostY;vK.isMobile?r=t=c:t=r=u-200;var f=Math.floor((c-t)/2)+l,p=5+d,h=i;ee.current={x:f,y:p,width:t,height:r,image:h,surroundStyle:o},"object"===Kz(s)?ee.current=Yz(Yz({},ee.current),s):"function"==typeof s&&(ee.current=Yz(Yz({},ee.current),s({clientWidth:n,clientHeight:a,videoAreaWidth:c,videoAreaHeight:u,lostX:l,lostY:d,isMobile:vK.isMobile,width:t,height:r}))),J(),O(!0)}),[i,o,s]),Le=SC.useState(3),De=Jz(Le,2),Ue=De[0],Me=De[1],Ve=SC.useState(!1),je=Jz(Ve,2),Fe=je[0],ze=je[1],Ke=SC.useRef(!1),qe=SC.useCallback((function(e){ze(e),Ke.current=e}),[]),He=SC.useRef(null),Qe=SC.useRef([]),Ge=SC.useCallback((function(){Me(3),clearInterval(He.current),qe(!0);var e=function(){var e=Hz(regeneratorRuntime.mark((function e(t){var n,i,a,o,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t-1!=0){e.next=9;break}return clearInterval(He.current),n=Qe.current,S(),i=n.map((function(e){return uP.resizeBlobImg(e.blob,Ne,Ne)})),e.next=7,Promise.all(i);case 7:a=e.sent,r?(o=eK(ge.current),s=n.map((function(e,t){return X.uploadImage({file:a[t],label:"portrait",metadata:JSON.stringify({gesture_score:e.leftRightScore,gesture:SG.FRONTAL})})})),Promise.all(s).then((function(e){return X.verifyFaceLiveness({images:e.map((function(e){return{id:e.data.image_id}})),videos:[{frames:o}]})})).then((function(e){p({apiCheckPassed:e.data.is_live,verifyFaceLivenessResult:e.data})})).catch((function(e){h({error:e})}))):p({frontalFaces:a,capturedFrames:ge.current});case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();He.current=setInterval((function(){Me((function(t){return e(t),t-1}))}),1e3)}),[qe,r,p,X,h,S]);SC.useEffect((function(){fe&&(clearInterval(He.current),qe(!1))}),[fe,qe]),SC.useEffect((function(){var e,t=K.current,n=function(){var e=Hz(regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=ue.current.steps,r=[],t.forEach((function(e){var t=e.name,n=e.image,i=e.frontalFaceImage;t!==SG.FRONTAL?r.push(X.uploadImage({file:n.blob,label:"portrait",metadata:JSON.stringify({gesture_score:n.leftRightScore,gesture:t})})):r.push(Promise.resolve({data:{image_id:null}})),i.blob?r.push(X.uploadImage({file:i.blob,label:"portrait",metadata:JSON.stringify({gesture_score:i.leftRightScore,gesture:SG.FRONTAL})})):r.push(Promise.resolve({data:{image_id:null}}))})),e.next=5,Promise.all(r);case 5:n=e.sent,t.forEach((function(e,t){e.image.imageId=n[2*t].data.image_id,e.frontalFaceImage.imageId=n[2*t+1].data.image_id}));case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),o=function(){var e=Hz(regeneratorRuntime.mark((function e(){var t,r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n();case 3:if(t=ue.current.steps,0!==(r=t.filter((function(e){return e.frontalFaceImage.imageId}))).length){e.next=9;break}p({error:"wrong_face_movement"}),e.next=13;break;case 9:return e.next=11,CG();case 11:(i=EG(Se))?X.verifyFaceLiveness({images:r.map((function(e){return{id:e.frontalFaceImage.imageId}})),gesture_images:t.filter((function(e){return e.image.imageId&&e.name!==SG.FRONTAL})).map((function(e){return{gesture:e.name,images:[{id:e.image.imageId}]}})),videos:i}).then((function(e){var n=!0===e.data.is_live;p({apiCheckPassed:n,verifyFaceLivenessResult:e.data,frontalFaces:r.map((function(e){return{id:e.frontalFaceImage.imageId,blob:e.frontalFaceImage.blob}})),steps:t.filter((function(e){return e.image.imageId&&e.name!==SG.FRONTAL})).map((function(e){var t=e.name,r=e.image;return{name:t,blob:r.blob,id:r.imageId}}))})})):p({error:"network_error"});case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),h({error:e.t0});case 18:case"end":return e.stop()}}),e,null,[[0,15]])})));return function(){return e.apply(this,arguments)}}(),s=function(){var e=Hz(regeneratorRuntime.mark((function e(){var t,r,n,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=ue.current.steps,r=[],t.map((function(e){return r.push({name:e.name,blob:e.image.blob}),e.frontalFaceImage.blob&&r.push({name:e.name,blob:e.frontalFaceImage.blob}),0})),n=r.map((function(e){return uP.resizeBlobImg(e.blob,Ne,Ne)})),e.next=6,Promise.all(n);case 6:i=e.sent,a=r.map((function(e,t){return{name:e.name,blob:i[t]}})),t.map((function(e,r){var n=a.filter((function(t){return t.name===e.name}));return t[r].image.blob=n[0].blob,e.frontalFaceImage.blob&&(t[r].frontalFaceImage.blob=n[1].blob),0}));case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),c=function(){var e=Hz(regeneratorRuntime.mark((function e(){var t,n,i,a,c,u,l,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=ue.current.steps,n=t[ue.current.curStepIndex],Te({tag:"selfie",event:"user_activity.".concat(n.name),log:{time_capture_in_seconds:((performance.now()-ye.current)/1e3).toFixed(1)}}),ue.current.curStepIndex++,ye.current=performance.now(),be.enable&&"each_gesture"===be.limit_for&&(Ae.current=0),ue.current.curStepIndex!==t.length){e.next=33;break}if(Ee.enable&&w(""),!p){e.next=33;break}return Se.enable&&(Se.framesBatchLength>0?(x(ge.current.slice(ge.current.length%Se.framesBatchLength*-1).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),r&&bG(ge.current.slice(ge.current.length%Se.framesBatchLength*-1),X)):x(ge.current.map((function(e){return{base64:e.base64,label:e.label,index:e.index}})))),Te({tag:"selfie",event:"user_activity",log:{time_capture_in_seconds:((Date.now()-me.current)/1e3).toFixed(1)}}),S(),e.next=14,s();case 14:if(r){e.next=31;break}if(c=t.filter((function(e){return e.name!==SG.FRONTAL})).map((function(e){return{name:e.name,image:{blob:e.image.blob}}})),u=t.filter((function(e){return e.name!==SG.FRONTAL})).map((function(e){return e.frontalFaceImage.blob})).filter((function(e){return null!==e})),!(l=null===(i=t.find((function(e){return e.name===SG.FRONTAL})))||void 0===i||null===(a=i.image)||void 0===a?void 0:a.blob)||!g){e.next=24;break}return e.next=21,uP.scaleImage(l,{minSize:g});case 21:e.t0=e.sent,e.next=25;break;case 24:e.t0=null;case 25:d=e.t0,l&&u.push(l),Te({tag:"result",event:"sdk_mode.liveness",log:{result_object:{steps:c,frontalFaces:u,frontalScaledImage:d}}}),p({steps:c,frontalFaces:u,frontalScaledImage:d,capturedFrames:ge.current}),e.next=33;break;case 31:return e.next=33,o();case 33:J();case 34:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),u=wq((function(){var e=ue.current,t=e.curStepIndex,r=e.steps,n=r[t],i=null!==(null==n?void 0:n.image.blob),a=null!==(null==n?void 0:n.frontalFaceImage.blob),o=r.filter((function(e){return e.frontalFaceImage.blob})).length,s=!1;return i&&(a||![1].includes(t)||o>=1)?(te.current=!1,c(),s=!0):te.current=!(!i||a),M(!1),s}),y);function l(e,t,r,n){return d.apply(this,arguments)}function d(){return(d=Hz(regeneratorRuntime.mark((function e(t,r,n,i){var a,o,s,l,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=ue.current,o=a.curStepIndex,s=a.steps,!(o<s.length)){e.next=24;break}if(l=s[o],!nG({faceDirection:t,curStep:l})){e.next=5;break}return e.abrupt("return");case 5:if(t!==SG.FRONTAL||null!==l.frontalFaceImage.blurScore&&!U_.hasBetterBlurScore(n,l.frontalFaceImage.blurScore)){e.next=13;break}return l.frontalFaceImage.blurScore=n,e.next=9,V_.takePicture({canvas:r});case 9:d=e.sent,l.frontalFaceImage.blob=d,l.frontalFaceImage.leftRightScore=i,te.current&&(te.current=!1,c());case 13:if(l.name!==t||null!==l.image.blurScore&&!U_.hasBetterBlurScore(n,l.image.blurScore)){e.next=24;break}return M(!0),l.image.blurScore=n,e.next=18,V_.takePicture({canvas:r});case 18:f=e.sent,l.image.blob=f,l.image.leftRightScore=i,l.image.objUrl&&URL.revokeObjectURL(l.image.objUrl),l.image.objUrl=URL.createObjectURL(f),u();case 24:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function f(e,t,r){return m.apply(this,arguments)}function m(){return(m=Hz(regeneratorRuntime.mark((function e(t,r,n){var i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(!0===Ke.current&&t===SG.FRONTAL&&Qe.current.length<3)){e.next=5;break}return e.next=3,V_.takePicture({canvas:r});case 3:i=e.sent,Qe.current.push({blob:i,leftRightScore:n});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(e,t,n,i){if(ge.current.length&&Date.now()-ge.current[ge.current.length-1].time<Se.framesIntervalTime)return null;if(Se.enable&&!i){var a=e.topLeft,o=e.bottomRight,s=[].concat(eK(a),eK(o)),c=[];[a,o].forEach((function(e){c=[].concat(eK(c),[e[0]/ix.SIZE*t.width,e[1]/ix.SIZE*t.height])}));var u=wG(e,0===ge.current.length),l=u.score,d=u.time,f=t.toDataURL("image/jpeg",.8);return ge.current.push({label:"portrait",base64:f.split(",")[1],landmarks:n,original_landmarks:n.map((function(e){return[e[0]/ix.SIZE*t.width,e[1]/ix.SIZE*t.height]})),score:l,time:d,index:ge.current.length,bbox:s,original_bbox:c}),Se.framesBatchLength>0&&ge.current.length%Se.framesBatchLength==0&&x&&(x(ge.current.slice(-Se.framesBatchLength).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),r&&bG(ge.current.slice(-Se.framesBatchLength),X,ge.current.length===Se.framesBatchLength)),l}return null}function b(e){if(!be.enable||null===e||!F)return!0;var t=be.web_warning_threshold,r=be.web_terminate_threshold,n=be.max_warning_time;return e<t||(e<r&&Ae.current<n?(Ae.current++,Ae.current===n?(pe(Yz(Yz({},Pe.liveness_terminated_face_tracking),{},{duration:Ce})),Te({tag:"selfie",event:"sdk_ui.show_alert",log:{alert:"liveness_terminated_face_tracking"}})):pe(Yz(Yz({},Pe.liveness_too_fast),{},{duration:1500})),!0):(pe(Yz(Yz({},Pe.liveness_terminated),{},{duration:Ce})),Te({tag:"selfie",event:"sdk_ui.show_alert",log:{alert:"liveness_terminated"}}),_e(),!1))}function C(e){if(we.enable&&F){var t=we.max_time_ms;Ie.current&&e||(Ie.current={time:Date.now(),frame:0}),e&&Ie.current.frame++;var r=Ie.current.time;e&&Date.now()-r>=t&&(pe(Yz(Yz({},Pe.liveness_terminated_no_face),{},{duration:Ce})),Te({tag:"selfie",event:"sdk_ui.show_alert",log:{alert:"liveness_terminated_no_face"}}),_e())}}function E(e,t){return k.apply(this,arguments)}function k(){return(k=Hz(regeneratorRuntime.mark((function r(n,o){var s,c,u,d,p,h,g,m,y,w,k,S,B,T,A,I,_,x,P,R,N;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return s=n.cropX,c=n.cropY,u=n.cropWidth,d=n.cropHeight,o.getContext("2d").drawImage(t,s,c,u,d,0,0,u,d),p=oe.current.blazefaceModel,r.next=6,U_.calculateBlurScore(o);case 6:return h=r.sent,r.next=9,ix.getModelPredictions({model:p,sCanvas:o});case 9:return g=r.sent,r.next=12,ex.validatePredictions({predictions:g,width:ix.SIZE,height:ix.SIZE});case 12:if(m=r.sent,y=m.error,w=m.fullFace,ee.current.image=i,S=null,B=null,T=null,A=ue.current,I=A.curStepIndex,_=A.steps,!w){r.next=27;break}return x=_[I],T=w.landmarks,r.next=25,ex.calculateFaceDirection({landmarks:T,getPerfectFrontal:x&&x.name===SG.FRONTAL});case 25:(P=r.sent)&&(S=P.gesture,B=P.leftRightScore);case 27:if(R="no_face"===(null==y?void 0:y.code)||"partial_face"===(null==y?void 0:y.code),N=I<_.length,C(R&&N),null!=y&&y.code&&Te({tag:"selfie",event:"sdk_ui.show_alert",log:{alert:y.code}}),y&&("face_too_small"!==y.code||![SG.DOWN,SG.UP,SG.LEFT,SG.RIGHT].includes(S))){r.next=50;break}if(Y||v(g[0],o,T),!Y){r.next=41;break}if(F||(z(!0),ye.current=performance.now(),me.current=Date.now()),!b(v(g[0],o,T,I>=_.length))){r.next=39;break}return r.next=39,l(S,o,h,B);case 39:r.next=48;break;case 41:if(![SG.LEFT,SG.RIGHT].includes(S)){r.next=46;break}k=Pe.not_frontal_face,ee.current.image=a,r.next=48;break;case 46:return r.next=48,f(S,o,B);case 48:r.next=51;break;case 50:I<_.length&&(k=Pe[y.code],ee.current.image=a);case 51:he(k),-1!==e&&(e=requestAnimationFrame((function(){return E(n,o)})));case 53:case"end":return r.stop()}}),r)})))).apply(this,arguments)}function B(){return(B=Hz(regeneratorRuntime.mark((function e(){var r,n,i,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=V_.analyzeVideoAndWindowSizes(t,ee.current),n=r.cropWidth,i=r.cropHeight,(a=document.createElement("canvas")).width=n,a.height=i,(o=a.getContext("2d")).translate(n,0),o.scale(-1,1),E(r,a);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return N&&ie&&setTimeout((function(){!function(){B.apply(this,arguments)}()}),2e3),function(){cancelAnimationFrame(e),e=-1}}),[N,H,Y,X,r,i,a,p,h,g,y,Se,S,be,Ee.enable,w,he,Ce,_e,we,F,Pe,ie,Te,x]);var We=ue.current,Xe=We.curStepIndex,Ye=We.steps,$e=SC.useMemo((function(){return Ye.find((function(e){return e.name===hB.FaceDirection.FRONTAL}))}),[Ye]),Ze=te.current?$e:Ye[Xe],Je=Ze&&F?Ze.instructions[H]:null,et=Ze&&F?Ze.directionIcon:"",tt=Ze?Ze.directionIconAnimation:"";return{countdownToTakePicture:Ue,cropArea:ee,curStepIndex:Xe,directionIcon:et,directionIconAnimation:tt,faceDetectionError:fe,handleTriggerPassiveMode:Ge,handleVideoPlayed:Oe,instructions:Je,isActiveMode:Y,refVideo:K,showCountdown:Fe,steps:Ye,videoPlayed:N,activeCapturing:U,isFirstValidFrameFound:F,warmupDone:ie}}var IG=(Gz(uG={},hB.FaceDirection.LEFT,90),Gz(uG,hB.FaceDirection.RIGHT,270),Gz(uG,hB.FaceDirection.UP,180),Gz(uG,hB.FaceDirection.DOWN,0),uG),_G=dB(["0%{opacity:0.15;}50%{opacity:0.3;}100%{opacity:1;}"]),xG=cB.div(lG||(lG=Zz(["\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"])),IG[hB.FaceDirection.DOWN],IG[hB.FaceDirection.LEFT],IG[hB.FaceDirection.UP],IG[hB.FaceDirection.RIGHT]),PG=cB.div(dG||(dG=Zz(["\n width: 70px;\n transform: rotate(","deg);\n"])),(function(e){var t,r=e.direction;return null!==(t=IG[r])&&void 0!==t?t:0})),RG=cB.span(fG||(fG=Zz(["\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"])),_G),NG=cB(RG)(pG||(pG=Zz(["\n animation-delay: 0s;\n"]))),OG=cB(RG)(hG||(hG=Zz(["\n animation-delay: 0.5s;\n"]))),LG=cB(RG)(gG||(gG=Zz(["\n animation-delay: 1s;\n"])));function DG(e){var t=e.type;return t!==hB.FaceDirection.FRONTAL?SC.createElement(PG,{direction:t},SC.createElement(NG,null),SC.createElement(OG,null),SC.createElement(LG,null)):SC.createElement(xG,null,SC.createElement(PG,{className:"top"},SC.createElement(NG,null),SC.createElement(OG,null),SC.createElement(LG,null)),SC.createElement(PG,{className:"right"},SC.createElement(NG,null),SC.createElement(OG,null),SC.createElement(LG,null)),SC.createElement(PG,{className:"bottom"},SC.createElement(NG,null),SC.createElement(OG,null),SC.createElement(LG,null)),SC.createElement(PG,{className:"left"},SC.createElement(NG,null),SC.createElement(OG,null),SC.createElement(LG,null)))}DG.propTypes={type:SE.oneOf([hB.FaceDirection.LEFT,hB.FaceDirection.RIGHT,hB.FaceDirection.UP,hB.FaceDirection.FRONTAL])},DG.defaultProps={type:hB.FaceDirection.LEFT};var UG,MG=hB.ErrorDuration;function VG(e){var t=e.children,r=e.errorMsg,n=e.className;return SC.isValidElement(t)?r?SC.createElement("div",{className:n},SC.cloneElement(t,{errorMsg:r})):null:r?SC.createElement("div",{className:n},r):null}function jG(e){var t=e.children,r=e.className,n=e.error,i=SC.useRef(0),a=SC.useRef(""),o=vB.useSDKSettings().lang,s=SC.useRef(MG.SHORT),c=n||{},u=c.msg,l=c.duration,d=void 0===l?MG.SHORT:l,f=null==u?void 0:u[o];return Date.now()-i.current>=s.current?(i.current=Date.now(),s.current=d,a.current=f,VG({children:t,errorMsg:f,className:r})):VG({children:t,errorMsg:a.current,className:r})}jG.propTypes={children:SE.node,className:SE.string},jG.defaultProps={className:""};var FG=cB.circle(UG||(UG=Zz(["\n transition: stroke-dashoffset 0.4s;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n"])));function zG(e){var t=e.className,r=e.style,n=e.radius,i=e.strokeWidth,a=e.progress,o=e.hasError,s=e.activeColor,c=e.innerPadding,u=e.outsideRingColor,l=e.outsideRingOpacity,d=e.insideRingColor,f=e.insideRingWidth,p=e.insideRingStrokeDash,h=e.errorRingWidth,g=e.errorRingColor,m=e.dashedRingColor,y=e.dashedRingOpacity,v=e.dashedRingWidth,b=e.dashedRingLineThick,C=e.dashedRingLineSpacing,E=e.dashedInsideRingColor,w=e.dashedInsideRingWidth,k=e.showOutsideRing,S=e.showInsideRing,B=e.showDashedRing,T=2*n,A=2*n,I=n-2*i,_=2*Math.PI*I,x=_-a/100*_,P=I-v/2-i/2-c,R=2*Math.PI*P,N=R-a/100*R,O=P-w/2-v/2,L=2*Math.PI*O,D=L-a/100*L,U=O-f/2-w/2,M=O-h/2-w/2;return SC.createElement("svg",{className:t,style:r,width:T,height:A,viewBox:"0 0 ".concat(T," ").concat(A),fill:"none",xmlns:"http://www.w3.org/2000/svg"},k?SC.createElement(SC.Fragment,null,SC.createElement("circle",{"data-testid":"outsideRing",opacity:l,cx:n,cy:n,r:I,stroke:u}),SC.createElement(FG,{"data-testid":"outsideAnimateRing",cx:n,cy:n,r:I,stroke:s,strokeWidth:i,strokeLinecap:"round",strokeDasharray:"".concat(_," ").concat(_),style:{strokeDashoffset:x}})):null,B?SC.createElement(SC.Fragment,null,SC.createElement("circle",{"data-testid":"dashedRing",opacity:y,cx:n,cy:n,r:P,stroke:m,strokeWidth:v,strokeDasharray:"".concat(b," ").concat(C)}),SC.createElement("mask",{id:"mask0","mask-type":"alpha",maskUnits:"userSpaceOnUse"},SC.createElement("circle",{cx:n,cy:n,r:P,stroke:s,strokeWidth:v,strokeDasharray:"".concat(b," ").concat(C)})),SC.createElement("g",{mask:"url(#mask0)"},SC.createElement(FG,{"data-testid":"dashedAnimateRing",cx:n,cy:n,r:P,stroke:s,strokeWidth:v,strokeDasharray:"".concat(R," ").concat(R),style:{strokeDashoffset:N}})),SC.createElement("circle",{"data-testid":"dashedInsideRing",opacity:y,cx:n,cy:n,r:O,stroke:E,strokeWidth:w}),SC.createElement(FG,{"data-testid":"dashedInsideAnimateRing",cx:n,cy:n,r:O,stroke:s,strokeWidth:w,strokeLinecap:"round",strokeDasharray:"".concat(L," ").concat(L),style:{strokeDashoffset:D}})):null,S?SC.createElement("circle",{"data-testid":"insideRing",strokeDasharray:p,cx:n,cy:n,r:U,stroke:d,strokeWidth:f}):null,o?SC.createElement("circle",{"data-testid":"errorRing",strokeDasharray:p,cx:n,cy:n,r:M,stroke:g,strokeWidth:h}):null)}function KG(e){var t=e.className;return SC.createElement("svg",{className:t,width:"320",height:"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg"},SC.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 qG(){return(qG=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}zG.propTypes={className:SE.string,style:SE.shape({}),radius:SE.number,strokeWidth:SE.number,progress:SE.number,hasError:SE.bool,activeColor:SE.string,innerPadding:SE.number,outsideRingColor:SE.string,outsideRingOpacity:SE.number,insideRingColor:SE.string,insideRingWidth:SE.number,insideRingStrokeDash:SE.string,errorRingColor:SE.string,errorRingWidth:SE.number,dashedRingColor:SE.string,dashedRingOpacity:SE.number,dashedRingWidth:SE.number,dashedRingLineThick:SE.number,dashedRingLineSpacing:SE.number,dashedInsideRingColor:SE.string,dashedInsideRingWidth:SE.number,showOutsideRing:SE.bool,showDashedRing:SE.bool,showInsideRing:SE.bool},zG.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},KG.propTypes={className:SE.string},KG.defaultProps={className:""};var HG,QG,GG="undefined"!=typeof window?SC.useLayoutEffect:SC.useEffect,WG={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}}},XG=["top left","top center","top right","right top","right center","right bottom","bottom left","bottom center","bottom right","left top","left center","left bottom"],YG=function(e,t,r,n,i){var a=i.offsetX,o=i.offsetY,s=n?8:0,c=r.split(" "),u=e.top+e.height/2,l=e.left+e.width/2,d=t.height,f=t.width,p=u-d/2,h=l-f/2,g="",m="0%",y="0%";switch(c[0]){case"top":p-=d/2+e.height/2+s,g="rotate(180deg) translateX(50%)",m="100%",y="50%";break;case"bottom":p+=d/2+e.height/2+s,g="rotate(0deg) translateY(-100%) translateX(-50%)",y="50%";break;case"left":h-=f/2+e.width/2+s,g=" rotate(90deg) translateY(50%) translateX(-25%)",y="100%",m="50%";break;case"right":h+=f/2+e.width/2+s,g="rotate(-90deg) translateY(-150%) translateX(25%)",m="50%"}switch(c[1]){case"top":p=e.top,m=e.height/2+"px";break;case"bottom":p=e.top-d+e.height,m=d-e.height/2+"px";break;case"left":h=e.left,y=e.width/2+"px";break;case"right":h=e.left-f+e.width,y=f-e.width/2+"px"}return{top:p="top"===c[0]?p-o:p+o,left:h="left"===c[0]?h-a:h+a,transform:g,arrowLeft:y,arrowTop:m}},$G=function(e,t,r,n,i,a){var o=i.offsetX,s=i.offsetY,c={arrowLeft:"0%",arrowTop:"0%",left:0,top:0,transform:"rotate(135deg)"},u=0,l=function(e){var t={top:0,left:0,width:window.innerWidth,height:window.innerHeight};if("string"==typeof e){var r=document.querySelector(e);null!==r&&(t=r.getBoundingClientRect())}return t}(a),d=Array.isArray(r)?r:[r];for((a||Array.isArray(r))&&(d=[].concat(d,XG));u<d.length;){var f={top:(c=YG(e,t,d[u],n,{offsetX:o,offsetY:s})).top,left:c.left,width:t.width,height:t.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},ZG=0,JG=SC.forwardRef((function(e,t){var r=e.trigger,n=void 0===r?null:r,i=e.onOpen,a=void 0===i?function(){}:i,o=e.onClose,s=void 0===o?function(){}:o,c=e.defaultOpen,u=void 0!==c&&c,l=e.open,d=void 0===l?void 0:l,f=e.disabled,p=void 0!==f&&f,h=e.nested,g=void 0!==h&&h,m=e.closeOnDocumentClick,y=void 0===m||m,v=e.repositionOnResize,b=void 0===v||v,C=e.closeOnEscape,E=void 0===C||C,w=e.on,k=void 0===w?["click"]:w,S=e.contentStyle,B=void 0===S?{}:S,T=e.arrowStyle,A=void 0===T?{}:T,I=e.overlayStyle,_=void 0===I?{}:I,x=e.className,P=void 0===x?"":x,R=e.position,N=void 0===R?"bottom center":R,O=e.modal,L=void 0!==O&&O,D=e.lockScroll,U=void 0!==D&&D,M=e.arrow,V=void 0===M||M,j=e.offsetX,F=void 0===j?0:j,z=e.offsetY,K=void 0===z?0:z,q=e.mouseEnterDelay,H=void 0===q?100:q,Q=e.mouseLeaveDelay,G=void 0===Q?100:Q,W=e.keepTooltipInside,X=void 0!==W&&W,Y=e.children,$=SC.useState(d||u),Z=$[0],J=$[1],ee=SC.useRef(null),te=SC.useRef(null),re=SC.useRef(null),ne=SC.useRef(null),ie=SC.useRef("popup-"+ ++ZG),ae=!!L||!n,oe=SC.useRef(0);GG((function(){return Z?(ne.current=document.activeElement,ve(),ge(),pe()):he(),function(){clearTimeout(oe.current)}}),[Z]),SC.useEffect((function(){"boolean"==typeof d&&(d?se():ce())}),[d,p]);var se=function(e){Z||p||(J(!0),setTimeout((function(){return a(e)}),0))},ce=function(e){var t;Z&&!p&&(J(!1),ae&&(null===(t=ne.current)||void 0===t||t.focus()),setTimeout((function(){return s(e)}),0))},ue=function(e){null==e||e.stopPropagation(),Z?ce(e):se(e)},le=function(e){clearTimeout(oe.current),oe.current=setTimeout((function(){return se(e)}),H)},de=function(e){null==e||e.preventDefault(),ue()},fe=function(e){clearTimeout(oe.current),oe.current=setTimeout((function(){return ce(e)}),G)},pe=function(){ae&&U&&(document.getElementsByTagName("body")[0].style.overflow="hidden")},he=function(){ae&&U&&(document.getElementsByTagName("body")[0].style.overflow="auto")},ge=function(){var e,t=null==te||null===(e=te.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"]'),r=Array.prototype.slice.call(t)[0];null==r||r.focus()};SC.useImperativeHandle(t,(function(){return{open:function(){se()},close:function(){ce()},toggle:function(){ue()}}}));var me,ye,ve=function(){if(!ae&&Z&&(null==ee?void 0:ee.current)&&(null==ee?void 0:ee.current)&&(null==te?void 0:te.current)){var e,t,r=ee.current.getBoundingClientRect(),n=te.current.getBoundingClientRect(),i=$G(r,n,N,V,{offsetX:F,offsetY:K},X);te.current.style.top=i.top+window.scrollY+"px",te.current.style.left=i.left+window.scrollX+"px",V&&re.current&&(re.current.style.transform=i.transform,re.current.style.setProperty("-ms-transform",i.transform),re.current.style.setProperty("-webkit-transform",i.transform),re.current.style.top=(null===(e=A.top)||void 0===e?void 0:e.toString())||i.arrowTop,re.current.style.left=(null===(t=A.left)||void 0===t?void 0:t.toString())||i.arrowLeft)}};void 0===(ye=E)&&(ye=!0),SC.useEffect((function(){if(ye){var e=function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){"Escape"===e.key&&me(e)}));return document.addEventListener("keyup",e),function(){ye&&document.removeEventListener("keyup",e)}}}),[me=ce,ye]),function(e,t){void 0===t&&(t=!0),SC.useEffect((function(){if(t){var r=function(t){if(9===t.keyCode){var r,n=null==e||null===(r=e.current)||void 0===r?void 0:r.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'),i=Array.prototype.slice.call(n);if(1===i.length)return void t.preventDefault();var a=i[0],o=i[i.length-1];t.shiftKey&&document.activeElement===a?(t.preventDefault(),o.focus()):document.activeElement===o&&(t.preventDefault(),a.focus())}};return document.addEventListener("keydown",r),function(){t&&document.removeEventListener("keydown",r)}}}),[e,t])}(te,Z&&ae),function(e,t){void 0===t&&(t=!0),SC.useEffect((function(){if(t){var r=function(){e()};return window.addEventListener("resize",r),function(){t&&window.removeEventListener("resize",r)}}}),[e,t])}(ve,b),function(e,t,r){void 0===r&&(r=!0),SC.useEffect((function(){if(r){var n=function(r){var n=Array.isArray(e)?e:[e],i=!1;n.forEach((function(e){e.current&&!e.current.contains(r.target)||(i=!0)})),r.stopPropagation(),i||t(r)};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),function(){r&&(document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n))}}}),[e,t,r])}(n?[te,ee]:[te],ce,y&&!g);var be,Ce=function(){return SC.createElement("div",Object.assign({},(e=ae?WG.popupContent.modal:WG.popupContent.tooltip,t={className:"popup-content "+(""!==P?P.split(" ").map((function(e){return e+"-content"})).join(" "):""),style:qG({},e,B,{pointerEvents:"auto"}),ref:te,onClick:function(e){e.stopPropagation()}},!L&&k.indexOf("hover")>=0&&(t.onMouseEnter=le,t.onMouseLeave=fe),t),{key:"C",role:ae?"dialog":"tooltip",id:ie.current}),V&&!ae&&SC.createElement("div",{ref:re,style:WG.popupArrow},SC.createElement("svg",{"data-testid":"arrow",className:"popup-arrow "+(""!==P?P.split(" ").map((function(e){return e+"-arrow"})).join(" "):""),viewBox:"0 0 32 16",style:qG({position:"absolute"},A)},SC.createElement("path",{d:"M16 0l16 16H0z",fill:"currentcolor"}))),Y&&"function"==typeof Y?Y(ce,Z):Y);var e,t},Ee=!(k.indexOf("hover")>=0),we=ae?WG.overlay.modal:WG.overlay.tooltip,ke=[Ee&&SC.createElement("div",{key:"O","data-testid":"overlay","data-popup":ae?"modal":"tooltip",className:"popup-overlay "+(""!==P?P.split(" ").map((function(e){return e+"-overlay"})).join(" "):""),style:qG({},we,_,{pointerEvents:y&&g||ae?"auto":"none"}),onClick:y&&g?ce:void 0,tabIndex:-1},ae&&Ce()),!ae&&Ce()];return SC.createElement(SC.Fragment,null,function(){for(var e={key:"T",ref:ee,"aria-describedby":ie.current},t=Array.isArray(k)?k:[k],r=0,i=t.length;r<i;r++)switch(t[r]){case"click":e.onClick=ue;break;case"right-click":e.onContextMenu=de;break;case"hover":e.onMouseEnter=le,e.onMouseLeave=fe;break;case"focus":e.onFocus=le,e.onBlur=fe}if("function"==typeof n){var a=n(Z);return!!n&&SC.cloneElement(a,e)}return!!n&&SC.cloneElement(n,e)}(),Z&&zz.createPortal(ke,(null===(be=document.getElementById("popup-root"))&&((be=document.createElement("div")).setAttribute("id","popup-root"),document.body.appendChild(be)),be)))})),eW=lB(HG||(HG=Zz(["\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"]))),tW=["open","children","overlayStyle"],rW=function(e){var t=e.open,r=e.children,n=e.overlayStyle,i=$z(e,tW);return SC.createElement(SC.Fragment,null,SC.createElement(JG,Wz({overlayStyle:Yz(Yz({},n),{},{zIndex:2e3}),closeOnDocumentClick:!1,closeOnEscape:!1,modal:!0,open:t},i),r),SC.createElement(eW,null))};rW.propTypes={open:SE.bool,children:SE.node,overlayStyle:SE.shape({})},rW.defaultProps={open:!1,children:null,overlayStyle:{}};var nW,iW,aW,oW,sW,cW,uW,lW,dW,fW,pW,hW,gW,mW,yW,vW,bW={WARMUP_INTRO:{en:"Warming up... Please wait a moment",vi:"Đang khởi động, vui lòng chờ trong giây lát..."}},CW=cB.div(QG||(QG=Zz(["\n font-size: 18px;\n text-align: center;\n padding: 10px;\n"]))),EW=function(e){var t=e.contentStyle,r=vB.useSDKSettings().lang;return SC.createElement(rW,{open:!0,contentStyle:t},SC.createElement(CW,{className:"warmup-message"},bW.WARMUP_INTRO[r]))};EW.propTypes={contentStyle:SE.shape({})},EW.defaultProps={contentStyle:{}};var wW=GS(["z-index:",";color:#ffffff;"],1020),kW=cB.div(nW||(nW=Zz(["\n ","\n"])),wW),SW=cB(jG)(iW||(iW=Zz(["\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"])),wW,(function(e){var t=e.top;return t&&GS(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&GS(["bottom:","px;"],t)}),(function(e){return e.centerY&&GS(["top:50%;transform:translateY(-50%);"])})),BW=cB(kW)(aW||(aW=Zz(["\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 t=e.top;return t&&GS(["top:","px;"],t)})),TW=cB(kW)(oW||(oW=Zz(["\n position: absolute;\n ","\n ","\n font-size: ",";\n text-shadow: 2px 2px 4px #000000;\n"])),(function(e){var t=e.top;return t&&GS(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&GS(["bottom:","px;"],t)}),(function(){return vK.isMobile?"20px":"22px"})),AW=cB.div(sW||(sW=Zz(["\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 vK.isMobile?"50px":"70px"}),(function(e){var t=e.top;return t&&GS(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&GS(["bottom:","px;"],t)}),1020),IW=cB.div(cW||(cW=Zz(["\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 vK.isMobile?"40px":"50px"}),(function(){return vK.isMobile?"40px":"50px"}),(function(e){return!e.active&&GS(["opacity:0.6;"])})),_W=cB.div(uW||(uW=Zz(["\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),xW=cB.div(lW||(lW=Zz(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),PW=cB.div(dW||(dW=Zz(["\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"]))),RW=cB.div(fW||(fW=Zz(["\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"]))),NW=cB(zG)(pW||(pW=Zz(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"]))),OW=cB(KG)(hW||(hW=Zz(["\n width: 100%;\n height: 100%;\n vertical-align: middle;\n margin: 0;\n color: ",";\n"])),(function(e){var t=e.color;return null!=t?t:"rgba(0, 0, 0, 0.6)"})),LW=cB.div(gW||(gW=Zz(["\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"]))),DW=dB(["from{opacity:1;}to{opacity:0;}"]),UW=cB.div(mW||(mW=Zz(["\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"])),DW),MW=vK.isMobile?{width:640}:null,VW={background:"#000000",opacity:.6};function jW(e){var t=e.apiCheck,r=e.mode,n=e.onLivenessDetectionDone,i=e.onClose,a=e.onError,o=e.captureFrameSettings,s=e.onFramesCaptured,c=e.frontCamera,u=e.customDirectionIcon,l=e.customStepTimeConstraints,d=e.onProcessing,f=e.customErrors,p=e.livenessSettings,h=e.apiCredentials,g=d_.useAsset("bg_camera_mask.png"),m=d_.useAsset("bg_camera_mask_red.png"),y=Jz(SC.useState({}),2),v=y[0],b=y[1],C=v.yFaceDetectionError,E=v.yFaceVerificationStepsWrapper,w=Jz(SC.useState(""),2),k=w[0],S=w[1],B=SC.useCallback((function(e){var t=e.lostY,r=e.height,n=t+25,i=n+30;return b({yFaceDetectionError:n,yFaceVerificationStepsWrapper:i+r+20}),{y:Math.floor(i)}}),[]),T=AG({apiCheck:t,mode:r,bgCameraMask:g,bgCameraMaskRed:m,surroundStyle:VW,onLivenessDetectionDone:n,onError:a,cropAreaDimension:B,customDirectionIcon:u,captureFrameSettings:o,onFramesCaptured:s,livenessSettings:p,setRemainingTime:S,customStepTimeConstraints:l,onProcessing:d,customErrors:f,apiCredentials:h}),A=T.countdownToTakePicture,I=T.cropArea,_=T.curStepIndex,x=T.directionIcon,P=T.faceDetectionError,R=T.handleTriggerPassiveMode,N=T.handleVideoPlayed,O=T.instructions,L=T.isActiveMode,D=T.refVideo,U=T.showCountdown,M=T.steps,V=T.videoPlayed,j=T.activeCapturing,F=T.isFirstValidFrameFound,z=T.warmupDone;return SC.createElement(zK,{frontCamera:c,onVideoPlayed:N,onClose:i,flipHorizontal:c,ref:D,videoSettings:MW,onError:a},!z&&SC.createElement(EW,null),V?SC.createElement(SC.Fragment,null,SC.createElement(SW,{top:C-15,className:"face-detection-error",error:P}),I.current?SC.createElement(WK,{x:"".concat(I.current.x,"px"),y:"".concat(I.current.y,"px"),width:"".concat(I.current.width,"px"),height:"".concat(I.current.height,"px"),surroundStyle:I.current.surroundStyle},SC.createElement(OW,null),SC.createElement(NW,{progress:_/M.length*100,hasError:!!P,showDashedRing:!1,showOutsideRing:!1,insideRingWidth:1,errorRingWidth:1,insideRingStrokeDash:"2"}),U?SC.createElement(PW,null,A):null,L?SC.createElement(SC.Fragment,null,SC.createElement(RW,null,x),j&&SC.createElement(UW,null)):null,P&&SC.createElement(LW,null)):null,L?SC.createElement(SC.Fragment,null,k&&SC.createElement(BW,{top:E-30},k),O?SC.createElement(TW,{top:E+5,className:"instructions"},O):null,F&&SC.createElement(AW,{top:E+35},M.map((function(e,t){var r=e.name,n=e.image.objUrl;return SC.createElement(IW,{key:r,active:_>=t,className:"step-item"},n?SC.createElement("img",{src:n,alt:""}):SC.createElement("span",null,t+1))})))):SC.createElement(SC.Fragment,null,P?null:SC.createElement(_W,null,SC.createElement(xW,{onClick:R},SC.createElement(XK,null))))):null)}jW.propTypes={apiCheck:SE.bool,mode:SE.string,onLivenessDetectionDone:SE.func,onClose:SE.func,onError:SE.func,captureFrameSettings:SE.shape({}),onFramesCaptured:SE.func,frontCamera:SE.bool,customDirectionIcon:SE.shape({}),customStepTimeConstraints:SE.shape({}),onProcessing:SE.func,customErrors:SE.shape({}),livenessSettings:SE.shape({}),apiCredentials:SE.shape({accessKey:SE.string,secretKey:SE.string,apiUrl:SE.string})},jW.defaultProps={apiCheck:!1,mode:null,onLivenessDetectionDone:null,onClose:null,onError:function(){},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},onFramesCaptured:function(){},frontCamera:!0,customDirectionIcon:(yW={},Gz(yW,hB.FaceDirection.LEFT,SC.createElement(DG,{type:hB.FaceDirection.LEFT})),Gz(yW,hB.FaceDirection.RIGHT,SC.createElement(DG,{type:hB.FaceDirection.RIGHT})),Gz(yW,hB.FaceDirection.UP,SC.createElement(DG,{type:hB.FaceDirection.UP})),Gz(yW,hB.FaceDirection.FRONTAL,SC.createElement(DG,{type:hB.FaceDirection.FRONTAL})),yW),customStepTimeConstraints:(vW={},Gz(vW,hB.FaceDirection.UP,{delayTime:0}),Gz(vW,hB.FaceDirection.LEFT,{delayTime:0}),Gz(vW,hB.FaceDirection.RIGHT,{delayTime:0}),Gz(vW,hB.FaceDirection.FRONTAL,{delayTime:2e3}),vW),onProcessing:function(){},customErrors:null,livenessSettings:null,apiCredentials:{accessKey:"5767c20d-87aa-4cad-8dbb-f5429f76c34b",secretKey:"c1446919-e60a-4575-a05d-304318212a1b",apiUrl:"https://tv-testing.trustingsocial.com/api"}};var FW,zW=Object.freeze({__proto__:null,Text:kW,FaceDetectionError:SW,CountdownTime:BW,FaceVerificationInstructions:TW,FaceVerificationStepsWrapper:AW,StepItem:IW,BottomButtonsOverlay:_W,Button:xW,CountDownOverlay:PW,InstructionsOverlay:RW,default:jW,useLivenessDetection:AG}),KW=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.frontCamera,r=void 0===t||t,n=document.createElement("div");document.body.appendChild(n);var i=function(){zz.unmountComponentAtNode(n)};return new Promise((function(e){zz.render(SC.createElement(vB.SDKSettingsProvider,{value:{lang:"en"}},SC.createElement(zK,{checkCameraMode:!0,frontCamera:r,onVideoPlayed:function(){i(),e(null)},onClose:i,onError:function(t){i(),e(t)}})),n)}))},qW=cB.input(FW||(FW=Zz(["\n display: none;\n"]))),HW=SC.forwardRef((function(e,t){var r=e.useFileBrowse,n=e.accept,i=e.frontCamera,a=e.onCaptureDone,o=e.outputEncryptionSettings,s=SC.useCallback(function(){var e=Hz(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.target.files,!a){e.next=8;break}if(n=r[0],!o||!o.key){e.next=7;break}return e.next=6,YP.encrypt({blob:n,key:o.key});case 6:i=e.sent;case 7:a({file:n,encrypted:i});case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[a,o]);return SC.createElement(qW,Wz({ref:t,type:"file",accept:n,onChange:s},r?{}:{capture:i?"user":"environment"}))}));HW.propTypes={useFileBrowse:SE.bool,accept:SE.string,frontCamera:SE.bool,onCaptureDone:SE.func,outputEncryptionSettings:SE.shape({key:SE.string})},HW.defaultProps={useFileBrowse:!1,accept:"image/*",frontCamera:!1,onCaptureDone:null,outputEncryptionSettings:{key:""}};var QW,GW=Object.freeze({__proto__:null,Camera:XK}),WW={LANDSCAPE:"landscape",PORTRAIT:"portrait",DESKTOP:"desktop"},XW=function(){var e=SC.useRef(screen.width>screen.height?WW.LANDSCAPE:WW.PORTRAIT),t=Jz(SC.useState(e.current),2),r=t[0],n=t[1];return SC.useEffect((function(){function e(){screen.width>screen.heightt?n(WW.LANDSCAPE):n(WW.PORTRAIT)}return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]),vK.isMobile?{curOrientation:r,initOrientation:e.current}:{curOrientation:WW.DESKTOP}},YW=["tracking","clientSettings","livenessSettings"],$W=hB.Errors,ZW=cB.div(QW||(QW=Zz(["\n text-align: center;\n font-size: 20px;\n font-weight: 600;\n"])));function JW(e){var t=e.tracking,r=void 0===t?{enable:!0}:t,n=e.clientSettings,i=e.livenessSettings,a=$z(e,YW),o=vB.useSDKSettings().lang,s=$W.wrong_orientation.msg[o],c=XW().curOrientation,u=eG(n,"data.settings.sdk_settings.active_liveness_settings",i),l=eG(n,"data.settings.sdk_settings.server_log_settings.enable",r.enable);return SC.createElement(SC.Fragment,null,c===WW.LANDSCAPE&&SC.createElement(rW,{open:!0},SC.createElement(ZW,null,s)),(c===WW.PORTRAIT||c===WW.DESKTOP)&&SC.createElement(c_.SDKTrackingProvider,{value:{tracking:Yz(Yz({},r),{},{enable:l})}},SC.createElement(jW,Wz({},a,{livenessSettings:u}))))}function eX(){return(eX=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function tX(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}function rX(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function nX(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var iX=!1,aX=SC.createContext(null),oX="entering",sX="entered",cX=function(e){function t(t,r){var n;n=e.call(this,t,r)||this;var i,a=r&&!r.isMounting?t.enter:t.appear;return n.appearStatus=null,t.in?a?(i="exited",n.appearStatus=oX):i=sX:i=t.unmountOnExit||t.mountOnEnter?"unmounted":"exited",n.state={status:i},n.nextCallback=null,n}rX(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&"unmounted"===t.status?{status:"exited"}:null};var r=t.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(e){var t=null;if(e!==this.props){var r=this.state.status;this.props.in?r!==oX&&r!==sX&&(t=oX):r!==oX&&r!==sX||(t="exiting")}this.updateStatus(!1,t)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var e,t,r,n=this.props.timeout;return e=t=r=n,null!=n&&"number"!=typeof n&&(e=n.exit,t=n.enter,r=void 0!==n.appear?n.appear:t),{exit:e,enter:t,appear:r}},r.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),t===oX?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&"exited"===this.state.status&&this.setState({status:"unmounted"})},r.performEnter=function(e){var t=this,r=this.props.enter,n=this.context?this.context.isMounting:e,i=this.props.nodeRef?[n]:[zz.findDOMNode(this),n],a=i[0],o=i[1],s=this.getTimeouts(),c=n?s.appear:s.enter;!e&&!r||iX?this.safeSetState({status:sX},(function(){t.props.onEntered(a)})):(this.props.onEnter(a,o),this.safeSetState({status:oX},(function(){t.props.onEntering(a,o),t.onTransitionEnd(c,(function(){t.safeSetState({status:sX},(function(){t.props.onEntered(a,o)}))}))})))},r.performExit=function(){var e=this,t=this.props.exit,r=this.getTimeouts(),n=this.props.nodeRef?void 0:zz.findDOMNode(this);t&&!iX?(this.props.onExit(n),this.safeSetState({status:"exiting"},(function(){e.props.onExiting(n),e.onTransitionEnd(r.exit,(function(){e.safeSetState({status:"exited"},(function(){e.props.onExited(n)}))}))}))):this.safeSetState({status:"exited"},(function(){e.props.onExited(n)}))},r.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},r.setNextCallback=function(e){var t=this,r=!0;return this.nextCallback=function(n){r&&(r=!1,t.nextCallback=null,e(n))},this.nextCallback.cancel=function(){r=!1},this.nextCallback},r.onTransitionEnd=function(e,t){this.setNextCallback(t);var r=this.props.nodeRef?this.props.nodeRef.current:zz.findDOMNode(this),n=null==e&&!this.props.addEndListener;if(r&&!n){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[r,this.nextCallback],a=i[0],o=i[1];this.props.addEndListener(a,o)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},r.render=function(){var e=this.state.status;if("unmounted"===e)return null;var t=this.props,r=t.children,n=(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,tX(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return SC.createElement(aX.Provider,{value:null},"function"==typeof r?r(e,n):SC.cloneElement(SC.Children.only(r),n))},t}(SC.Component);function uX(){}cX.contextType=aX,cX.propTypes={},cX.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:uX,onEntering:uX,onEntered:uX,onExit:uX,onExiting:uX,onExited:uX},cX.UNMOUNTED="unmounted",cX.EXITED="exited",cX.ENTERING=oX,cX.ENTERED=sX,cX.EXITING="exiting";var lX,dX,fX=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return n=t,void((r=e).classList?r.classList.add(n):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(r,n)||("string"==typeof r.className?r.className=r.className+" "+n:r.setAttribute("class",(r.className&&r.className.baseVal||"")+" "+n)));var r,n}))},pX=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return n=t,void((r=e).classList?r.classList.remove(n):"string"==typeof r.className?r.className=nX(r.className,n):r.setAttribute("class",nX(r.className&&r.className.baseVal||"",n)));var r,n}))},hX=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(t=e.call.apply(e,[this].concat(n))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,r){var n=t.resolveArguments(e,r),i=n[0],a=n[1];t.removeClasses(i,"exit"),t.addClass(i,a?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,r)},t.onEntering=function(e,r){var n=t.resolveArguments(e,r),i=n[0],a=n[1]?"appear":"enter";t.addClass(i,a,"active"),t.props.onEntering&&t.props.onEntering(e,r)},t.onEntered=function(e,r){var n=t.resolveArguments(e,r),i=n[0],a=n[1]?"appear":"enter";t.removeClasses(i,a),t.addClass(i,a,"done"),t.props.onEntered&&t.props.onEntered(e,r)},t.onExit=function(e){var r=t.resolveArguments(e)[0];t.removeClasses(r,"appear"),t.removeClasses(r,"enter"),t.addClass(r,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var r=t.resolveArguments(e)[0];t.addClass(r,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var r=t.resolveArguments(e)[0];t.removeClasses(r,"exit"),t.addClass(r,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,r){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,r]},t.getClassNames=function(e){var r=t.props.classNames,n="string"==typeof r,i=n?(n&&r?r+"-":"")+e:r[e];return{baseClassName:i,activeClassName:n?i+"-active":r[e+"Active"],doneClassName:n?i+"-done":r[e+"Done"]}},t}rX(t,e);var r=t.prototype;return r.addClass=function(e,t,r){var n=this.getClassNames(t)[r+"ClassName"],i=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===r&&i&&(n+=" "+i),"active"===r&&e&&e.scrollTop,n&&(this.appliedClasses[t][r]=n,fX(e,n))},r.removeClasses=function(e,t){var r=this.appliedClasses[t],n=r.base,i=r.active,a=r.done;this.appliedClasses[t]={},n&&pX(e,n),i&&pX(e,i),a&&pX(e,a)},r.render=function(){var e=this.props,t=(e.classNames,tX(e,["classNames"]));return SC.createElement(cX,eX({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(SC.Component);hX.defaultProps={classNames:""},hX.propTypes={};var gX="out-in",mX="in-out",yX=function(e,t,r){return function(){var n;e.props[t]&&(n=e.props)[t].apply(n,arguments),r()}},vX=((lX={})[gX]=function(e){var t=e.current,r=e.changeState;return SC.cloneElement(t,{in:!1,onExited:yX(t,"onExited",(function(){r(oX,null)}))})},lX[mX]=function(e){var t=e.current,r=e.changeState,n=e.children;return[t,SC.cloneElement(n,{in:!0,onEntered:yX(n,"onEntered",(function(){r(oX)}))})]},lX),bX=((dX={})[gX]=function(e){var t=e.children,r=e.changeState;return SC.cloneElement(t,{in:!0,onEntered:yX(t,"onEntered",(function(){r(sX,SC.cloneElement(t,{in:!0}))}))})},dX[mX]=function(e){var t=e.current,r=e.children,n=e.changeState;return[SC.cloneElement(t,{in:!1,onExited:yX(t,"onExited",(function(){n(sX,SC.cloneElement(r,{in:!0}))}))}),SC.cloneElement(r,{in:!0})]},dX),CX=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(t=e.call.apply(e,[this].concat(n))||this).state={status:sX,current:null},t.appeared=!1,t.changeState=function(e,r){void 0===r&&(r=t.state.current),t.setState({status:e,current:r})},t}rX(t,e);var r=t.prototype;return r.componentDidMount=function(){this.appeared=!0},t.getDerivedStateFromProps=function(e,t){return null==e.children?{current:null}:t.status===oX&&e.mode===mX?{status:oX}:!t.current||((r=t.current)===(n=e.children)||SC.isValidElement(r)&&SC.isValidElement(n)&&null!=r.key&&r.key===n.key)?{current:SC.cloneElement(e.children,{in:!0})}:{status:"exiting"};var r,n},r.render=function(){var e,t=this.props,r=t.children,n=t.mode,i=this.state,a=i.status,o=i.current,s={children:r,current:o,changeState:this.changeState,status:a};switch(a){case oX:e=bX[n](s);break;case"exiting":e=vX[n](s);break;case sX:e=o}return SC.createElement(aX.Provider,{value:{isMounting:!this.appeared}},e)},t}(SC.Component);CX.propTypes={},CX.defaultProps={mode:gX};var EX={DEFAULT:"default",ERROR:"error"};function wX(e){var t=e.className,r=e.width,n=e.height,i=e.type,a=e.strokeStyles,o=e.strokeWidth,s=e.radius,c=e.paddingStyle,u=SC.useMemo((function(){var e;return Yz((Gz(e={},EX.DEFAULT,{fill:"none",strokeWidth:o,stroke:"#fff",strokeDasharray:"7, 4",opacity:.6}),Gz(e,EX.ERROR,{fill:"rgba(234,50,35, 0.1)",strokeWidth:o,stroke:"#ea3223"}),e),a)}),[o,a]),l=s+.8*o,d=u[i];return SC.createElement("svg",{width:r,height:n,className:t},SC.createElement("rect",{x:o/2,y:o/2,rx:s,ry:s,width:r-o,height:n-o,style:d}),SC.createElement("path",{d:"M0,".concat(l," Q0,0 ").concat(l,",0 L0,0 Z"),style:c}),SC.createElement("path",{d:"M0,".concat(n-l," Q0,").concat(n," ").concat(l,",").concat(n," L0,").concat(n," Z"),style:c}),SC.createElement("path",{d:"M".concat(r-l,",").concat(n," Q").concat(r,",").concat(n," ").concat(r,",").concat(n-l," L").concat(r,",").concat(n," Z"),style:c}),SC.createElement("path",{d:"M".concat(r-l,",0 Q").concat(r,",0 ").concat(r,",").concat(l," L").concat(r,",0 Z"),style:c}))}wX.propTypes={className:SE.string,width:SE.number,height:SE.number,strokeWidth:SE.number,strokeStyles:SE.shape({}),type:SE.oneOf([EX.DEFAULT,EX.ERROR]),radius:SE.number,paddingStyle:SE.shape({})},wX.defaultProps={className:"",width:600,height:400,strokeWidth:2,strokeStyles:{},type:EX.DEFAULT,radius:10,paddingStyle:{fill:"rgba(0, 0, 0, 0.6)"}};var kX,SX,BX,TX,AX,IX,_X,xX,PX,RX,NX,OX,LX,DX,UX,MX,VX,jX,FX,zX=dB(["from{transform:perspective(400px);}to{transform:perspective(400px) rotateY(90deg);}"]),KX=dB(["from{transform:perspective(400px) rotateY(-90deg);}to{transform:perspective(400px);}"]),qX=GS([".flipY-exit{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}.flipY-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-out;}"],zX,500,KX,500),HX=Object.freeze({__proto__:null,animationDuration:500,default:qX}),QX=dB(["from,to{transform:translate3d(-","px,0,0);}50%{transform:translate3d(","px,0,0);}"],20,20),GX=dB(["from,to{transform:translate3d(0,-","px,0);}50%{transform:translate3d(0,","px,0);}"],20,20),WX=GS([".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;}"],QX,GX),XX=Object.freeze({__proto__:null,default:WX}),YX=dB(["from,to{opacity:1;}50%{opacity:0;}"]),$X=GS([".blink{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}"],YX),ZX=Object.freeze({__proto__:null,default:$X}),JX=cB.div(kX||(kX=Zz(["\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),eY=dB(["from{background:#000;}to{}"]),tY=GS([".splash-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}"],eY,300),rY=cB.div(SX||(SX=Zz(["\n ","\n"])),tY),nY=function(e){var t=e.keyForTransition,r=void 0===t?0:t;return SC.createElement(rY,null,SC.createElement(CX,null,SC.createElement(hX,{key:r,timeout:{enter:300,exit:0},classNames:"splash",unmountOnExit:!1},SC.createElement(JX,null))))},iY=Object.freeze({__proto__:null,default:nY}),aY=dB(["from{transform:rotate(0deg);}to{transform:rotate(360deg);}"]),oY=GS([".spin{animation-name:",";animation-iteration-count:infinite;animation-duration:1000ms;animation-timing-function:linear;}"],aY),sY=Object.freeze({__proto__:null,default:oY}),cY=Object.freeze({__proto__:null,flipY:HX,slide:XX,blink:ZX,splash:iY,spin:sY}),uY=nY,lY=cB.div(BX||(BX=Zz(["\n ","\n ","\n"])),qX,oY),dY=cB.img(TX||(TX=Zz(["\n border-radius: 5px;\n opacity: 0.7;\n height: 38px;\n"]))),fY=cB.div(AX||(AX=Zz(["\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,vK.isMobile?GS(["top:",";"],(function(e){return e.y})):GS(["bottom:","px;"],10)),pY=cB.div(IX||(IX=Zz(["\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),hY=cB.div(_X||(_X=Zz(["\n color: #fff;\n text-align: center;\n"]))),gY=cB.div(xX||(xX=Zz(["\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),mY=cB.div(PX||(PX=Zz(["\n display: flex;\n align-items: center;\n"]))),yY=cB(hY)(RX||(RX=Zz(["\n font-size: 20px;\n margin-left: 10px;\n color: #fff;\n"]))),vY=cB(hY)(NX||(NX=Zz(["\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),bY=cB(hY)(OX||(OX=Zz(["\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),CY=cB(bY)(LX||(LX=Zz(["\n background: #ea3223;\n padding: 5px 10px;\n border-radius: 3px;\n"]))),EY=cB(hY)(DX||(DX=Zz(["\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),wY=(cB.div(UX||(UX=Zz(["\n font-size: 18px;\n text-align: center;\n padding: 10px;\n"]))),cB(wX)(MX||(MX=Zz(["\n position: absolute;\n top: 0;\n left: 0;\n"])))),kY={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"}},SY=hB.IDCardMessage,BY=cB.div(VX||(VX=Zz(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),TY=cB.div(jX||(jX=Zz(["\n text-align: center;\n font-size: 1rem;\n"]))),AY=cB.button(FX||(FX=Zz(["\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})),IY=function(e){var t=e.onOk,r=e.maxSessionTime,n=vB.useSDKSettings().lang;return SC.createElement(BY,null,SC.createElement(TY,{className:"popup-message"},pQ(SY.TIMEOUT_INSTRUCTION[n])({x:r})),SC.createElement(AY,{className:"popup-button",onClick:t},kY.BTN_OK[n]))};IY.propTypes={onOk:SE.func,maxSessionTime:SE.number},IY.defaultProps={onOk:function(){},maxSessionTime:30};var _Y=function(){var e=Jz(SC.useState(!1),2),t=e[0],r=e[1],n=Jz(SC.useState(null),2),i=n[0],a=n[1],o=Jz(SC.useState({}),2),s=o[0],c=o[1];return{showPopup:SC.useCallback((function(e){var t=e.popupType,n=e.props;c(void 0===n?{}:n),a(t),r(null!==t)}),[]),popupShown:t,popupType:i,props:s}},xY="SESSION_TIMEOUT",PY="CONFIRM",RY="QR_INVALID",NY="QR_INSTRUCTIONS",OY=hB.Errors;function LY(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)}function DY(e,t){return Math.sqrt(LY(e,t))}function UY(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.canvas,r=e.imgMargin,n=void 0===r?.15:r,i=window,a=i.cv,o=t.width,s=t.height,c=n;c<1&&(c=parseInt(.5*(s+o)*c,10));var u=a.imread(t),l=new a.Mat;return a.copyMakeBorder(u,l,c,c,c,c,a.BORDER_CONSTANT,new a.Scalar(0,0,0,255)),u.delete(),{mat:l,margin:c}}function MY(e,t){var r=window.cv,n=Jz(t.map((function(e){return e.location})),4),i=n[0],a=n[1],o=n[2],s=n[3],c=DY(o,s),u=DY(a,i),l=Math.max(c,u),d=DY(a,o),f=DY(i,s),p=Math.max(d,f),h=[i.x,i.y,a.x,a.y,o.x,o.y,s.x,s.y],g=[0,0,l-1,0,l-1,p-1,0,p-1],m=r.imread(e),y=new r.Mat,v=new r.Size(l,p),b=r.matFromArray(4,1,r.CV_32FC2,h),C=r.matFromArray(4,1,r.CV_32FC2,g),E=r.getPerspectiveTransform(b,C);r.warpPerspective(m,y,E,v,r.INTER_LINEAR,r.BORDER_CONSTANT,new r.Scalar);var w=new ImageData(new Uint8ClampedArray(y.data),y.cols,y.rows);return m.delete(),y.delete(),b.delete(),C.delete(),w}function VY(e){var t=e.corners,r=e.width,n=e.height,i=Number.MAX_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;t.forEach((function(e){var t=e.location,r=t.x,n=t.y;i=Math.min(i,r),a=Math.min(a,n),o=Math.max(o,r),s=Math.max(s,n)}));var c=.02;return i/r>=c&&a/n>=c&&(n-s)/n>=c&&(r-o)/r>=c}function jY(){return FY.apply(this,arguments)}function FY(){return(FY=Hz(regeneratorRuntime.mark((function e(){var t,r,n,i,a,o,s,c,u,l,d,f,p=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=p.length>0&&void 0!==p[0]?p[0]:{},r=t.canvas,n=t.paddingPercent,i=void 0===n?.04:n,a=r.width,o=r.height,s=Math.floor(a*i),c=Math.floor(o*i),u=a-2*s,l=o-2*c,d=document.createElement("canvas"),f=d.getContext("2d"),d.width=u,d.height=l,f.drawImage(r,s,c,u,l,0,0,u,l),e.abrupt("return",pP.isCardGlare(d));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function zY(e){for(var t,r,n,i,a,o,s,c=e.length,u=0;u<c;u++){var l=(u+c-1)%c,d=(u+1)%c,f=(t=e[u].location,r=e[l].location,n=e[d].location,void 0,void 0,void 0,void 0,i={x:r.x-t.x,y:r.y-t.y},a={x:n.x-t.x,y:n.y-t.y},o=Math.sqrt(Math.pow(i.x,2)+Math.pow(i.y,2)),s=Math.sqrt(Math.pow(a.x,2)+Math.pow(a.y,2)),180*Math.acos((i.x*a.x+i.y*a.y)/(o*s))/Math.PI);if(f<70||f>110)return!1}return!0}function KY(e){return qY.apply(this,arguments)}function qY(){return(qY=Hz(regeneratorRuntime.mark((function e(t){var r,n,i,a,o,s,c,u,l,d,f,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.blazefaceModel,n=t.predictedIdCardCanvas,i=t.frontSide,a=n.width,o=n.height,s=Math.floor(a/3),c=Math.floor(4*o/5),u=document.createElement("canvas"),l=u.getContext("2d"),u.width=s,u.height=c,l.drawImage(n,0,Math.floor(o/5),s,c,0,0,s,c),e.next=12,ix.getModelPredictions({model:r,sCanvas:u});case 12:if(d=e.sent,f=d.filter((function(e){var t=e.topLeft,r=e.bottomRight,n=Jz(e.probability,1)[0],i=e.landmarks;return!(n<.9||i.length<4||Q_.rectAreaRatio({small:{coords:[t,r]},big:{coords:[[0,0],[ix.SIZE,ix.SIZE]]}})<.025)})),p=f.length,!i){e.next=22;break}if(0!==p){e.next=18;break}return e.abrupt("return",OY.id_detector_error_front_side_no_faces);case 18:if(!(p>1)){e.next=20;break}return e.abrupt("return",OY.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",OY.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 HY=function(e,t,r){return e==e&&(void 0!==r&&(e=e<=r?e:r),void 0!==t&&(e=e>=t?e:t)),e},QY=function(e,t,r){return void 0===r&&(r=t,t=void 0),void 0!==r&&(r=(r=bq(r))==r?r:0),void 0!==t&&(t=(t=bq(t))==t?t:0),HY(bq(e),t,r)},GY="https://unpkg.com/@tsocial/tv_web_sdk_resources@1.0.0/libs/opencv.js";function WY(){return(WY=Hz(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.url,n=void 0===r?GY:r,!window.cv){e.next=3;break}return e.abrupt("return",Promise.resolve());case 3:return e.next=5,PP.loadExternalScript({url:n});case 5:return e.abrupt("return",new Promise((function(e){window.cv.onRuntimeInitialized=e})));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var XY=sG((function(e){return WY.apply(this,arguments)})),YY="https://unpkg.com/@tsocial/tv_web_sdk_resources@1.0.0/models/id-card/tflite/qtf16_model_224x224.tflite",$Y={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"};function ZY(e){var t,r,n,i,a,o=e.card,s=e.corners,c=o.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=function(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=tK(e))){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){throw e})),f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){s=!0,a=e})),f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}(s);try{for(f.s();!(a=f.n()).done;){var p=a.value;switch(p.label){case"top-left":t||(t=p.location);break;case"top-right":r||(r=p.location);break;case"bottom-right":n||(n=p.location);break;case"bottom-left":i||(i=p.location)}}}catch(e){f.e(e)}finally{f.f()}if(![t,r,n,i].every(Boolean))return console.debug("Not qualified, corners missing"),!1;var h={x:(t.x+n.x)/2,y:(t.y+n.y)/2},g={x:(r.x+i.x)/2,y:(r.y+i.y)/2},m=LY(u,h),y=LY(u,g);return Math.sqrt(m)>(l+d)/8||Math.sqrt(y)>(l+d)/8?(console.debug("Not qualified, not close enough"),!1):(console.debug("Qualified"),!0)}var JY=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r,n,i,a,o,s;return t=e,(r=[{key:"load",value:(s=Hz(regeneratorRuntime.mark((function e(){var t,r,n,i=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.length>0&&void 0!==i[0]?i[0]:{},r=t.opencvUrl,n=t.modelUrl,e.next=3,Promise.all([XY({url:r}),this.loadModel({modelUrl:n})]);case 3:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"loadModel",value:(o=Hz(regeneratorRuntime.mark((function e(){var t,r,n,i,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},r=t.modelUrl,n=void 0===r?YY:r,e.next=3,QP.initTensorFlow({preferredBackends:["webgl","wasm","cpu"]});case 3:return e.next=5,QP.loadTFLiteModel({modelUrl:n});case 5:this.model=e.sent,i=this.model.inputs,this.inputSize=[i[0].shape[1],i[0].shape[2]];case 8:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"dispose",value:(a=Hz(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 a.apply(this,arguments)})},{key:"predict",value:(i=Hz(regeneratorRuntime.mark((function e(t){var r,n,i,a,o,s,c,u,l,d,f,p,h,g,m,y,v,b,C,E,w,k,S,B,T,A,I,_=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=_.length>1&&void 0!==_[1]?_[1]:{},n=r.imgMargin,i=void 0===n?.5:n,a=r.detectThreshold,o=void 0===a?.3:a,s=r.maxNumReturns,c=void 0===s?100:s,u=window,l=u.cv,d={},f=t.width,p=t.height,d.originalWidth=f,d.originalHeight=p,h=UY({canvas:t,imgMargin:i}),g=h.margin,m=h.mat,y=Jz(this.inputSize,2),v=y[0],b=y[1],C=new l.Mat,l.resize(m,C,new l.Size(v,b),0,0,l.INTER_AREA),E=m.cols/v,w=m.rows/b,(k=document.createElement("canvas")).width=v,k.height=b,k.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(C.data),C.cols,C.rows),0,0),m.delete(),C.delete(),d.canvas=k,d.margin=g,e.next=24,this.detect(k,{detectThreshold:o,maxNumReturns:c});case 24:if(S=e.sent,B={inputImage:d,card:null},T=[],A=[],S.forEach((function(e){var t=Jz(e.box,4),r=t[0],n=t[1],i=t[2],a=t[3];e.clazz<=3?T.push({clazz:e.clazz,label:e.label,score:e.score,location:{x:QY(Math.floor((a+n)/2*E-g),0,f),y:QY(Math.floor((r+i)/2*w-g),0,p)},scaledLocation:{x:QY(Math.floor((a+n)/2),0,k.width),y:QY(Math.floor((r+i)/2),0,k.height)}}):A.push({label:e.label,score:e.score,box:[QY(Math.floor(r*w-g),0,p),QY(Math.floor(n*E-g),0,f),QY(Math.floor(i*w-g),0,p),QY(Math.floor(a*E-g),0,f)]})})),T.sort((function(e,t){return t.score-e.score})),A.sort((function(e,t){return t.score-e.score})),!(A.length>0)){e.next=40;break}if(ZY({card:I=A[0],corners:T})){e.next=36;break}return console.debug("Not qualified.",I,T),e.abrupt("return",B);case 36:return T.sort((function(e,t){return e.clazz-t.clazz})),I.corners=T,B.card=I,e.abrupt("return",B);case 40:return e.abrupt("return",B);case 41:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"detect",value:(n=Hz(regeneratorRuntime.mark((function e(t){var r,n,i,a,o,s,c,u,l,d,f,p,h,g,m,y,v,b,C,E,w,k,S,B=this,T=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=T.length>1&&void 0!==T[1]?T[1]:{},n=r.detectThreshold,i=r.maxNumReturns,a=window,o=a.tf,s=t.width,c=t.height,u=o.tidy((function(){var e=o.expandDims(o.cast(o.image.resizeNearestNeighbor(o.browser.fromPixels(t),B.inputSize),"float32"));return B.model.predict(e)})),e.next=7,Promise.all([u["StatefulPartitionedCall:1"].data(),u["StatefulPartitionedCall:2"].data(),u["StatefulPartitionedCall:3"].array()]);case 7:for(l=e.sent,d=Jz(l,3),f=d[0],p=d[1],h=Jz(d[2],1),g=h[0],m=[],y=Math.min(f.length,i),v=0;v<y;v++)(b=f[v])>n&&(E=p[v],w=null!==(C=$Y[Math.round(E)])&&void 0!==C?C:"NA",k=g[v],S=[k[0]*c,k[3]*s,k[2]*c,k[1]*s],m.push({score:b,clazz:E,box:S,label:w}));return e.abrupt("return",m);case 17:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})}])&&Qz(t.prototype,r),e}();function e$(e){return t$.apply(this,arguments)}function t$(){return(t$=Hz(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.idCardModel,e.abrupt("return",new Promise((function(e,t){var n=document.createElement("canvas");setTimeout(t,1e3),r.predict(n).then(e)})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function r$(e){return n$.apply(this,arguments)}function n$(){return(n$=Hz(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.idCardModel,n=!0,e.prev=2,i=performance.now(),e.next=6,e$({idCardModel:r});case 6:performance.now()-i>1e3&&(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 i$(){return(i$=Hz(regeneratorRuntime.mark((function e(){var t,r,n,i,a,o,s,c,u,l,d,f,p,h=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=h.length>0&&void 0!==h[0]?h[0]:{},r=t.opencvUrl,n=t.idCardModelUrl,i=t.blazefaceModelUrl,a=t.tfScriptUrls,"iOS"!==vK.osName||!vK.osVersion.includes("12.")){e.next=5;break}return e.next=4,XY({url:r});case 4:return e.abrupt("return",{ableToUseModel:!1});case 5:return e.next=7,QP.loadTensorFlow(a);case 7:return o=new JY,e.next=10,Promise.all([QP.loadBlazefaceModel({modelUrl:i}),o.load({opencvUrl:r,modelUrl:n})]);case 10:return s=e.sent,c=Jz(s,1),u=c[0],l=!0,d=document.createElement("canvas"),e.prev=15,e.next=18,o.predict(d);case 18:return e.next=20,r$({idCardModel:o});case 20:f=e.sent,p=f.fastEnough,l=p,e.next=28;break;case 25:e.prev=25,e.t0=e.catch(15),l=!1;case 28:return e.abrupt("return",{ableToUseModel:l,idCardModel:o,blazefaceModel:u});case 29:case"end":return e.stop()}}),e,null,[[15,25]])})))).apply(this,arguments)}var a$=sG((function(){return i$.apply(this,arguments)})),o$=hB.Errors;function s$(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,i=e.settings,a=SC.useRef(null);null===a.current&&(a.current=document.createElement("canvas"));var o=SC.useRef(!1),s=SC.useRef(uP.createResizer({width:960,height:640})),c=SC.useRef(null),u=SC.useRef([{id:null,frames:[]}]),l=SC.useCallback((function(){!0===o.current&&(o.current=!1)}),[]),d=SC.useCallback((function(){u.current=[{id:null,frames:[]}]}),[]),f=SC.useCallback((function(){var e=u.current;e[e.length-1].frames.length>0&&e.push({id:null,frames:[]})}),[]),p=SC.useCallback(function(){var e=Hz(regeneratorRuntime.mark((function e(t){var r,n,a,o,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.workingCanvas,n=s.current,a=u.current,o=n.resize({srcCanvas:r}),c=o.toDataURL("image/jpeg",i.saveFrameQuality/100).split(",")[1],a[a.length-1].frames.push({base64:c});case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[i]),h=SC.useCallback(Hz(regeneratorRuntime.mark((function e(){var r,n,s,u,l,d,f,h,g,m,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i){e.next=2;break}return e.abrupt("return");case 2:if(r=i.frameCaptureIntervalMs,i.enableRecording){e.next=5;break}return e.abrupt("return");case 5:n=c.current,s=t.current,o.current=!0,u=n.cropX,l=n.cropY,d=n.cropWidth,f=n.cropHeight,(h=a.current).width=d,h.height=f,g=h.getContext("2d"),m=null;case 14:if(g.drawImage(s,u,l,d,f,0,0,d,f),!r){e.next=25;break}if(!((y=(new Date).getTime())-m>=r)){e.next=23;break}return e.next=22,p({workingCanvas:h});case 22:m=y;case 23:e.next=27;break;case 25:return e.next=27,p({workingCanvas:h});case 27:if(o.current){e.next=29;break}return e.abrupt("break",33);case 29:return e.next=31,p_.sleep(15);case 31:e.next=14;break;case 33:case"end":return e.stop()}}),e)}))),[t,p,i]);return SC.useEffect((function(){var e=t.current;function i(){return(i=Hz(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c.current=V_.analyzeVideoAndWindowSizes(e,n),t.next=3,h();case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return r&&n&&function(){i.apply(this,arguments)}(),function(){l()}}),[r,n,t,l,f,h]),{refWorkingCanvas:a,stopCheckFrame:l,splitVideos:f,resetRecordedVideos:d,checkFrame:h,refRecordedVideos:u}}var c$,u$,l$,d$=function(e){var t=e.lang,r=e.onAboutToTimeout,n=e.onSessionTimeout,i=e.onVideoTimeLimitReached,a=e.settings,o=e.shouldStartTimers,s=e.sessionTime,c=SC.useRef(),u=Jz(SC.useState(0),2),l=u[0],d=u[1],f=SC.useCallback((function(){clearInterval(c.current)}),[]),p=SC.useCallback((function(){d((function(e){return e+1}))}),[]);return SC.useEffect((function(){if(o){var e=a.maxRecordingTimePerVideo,t=0,u=s/3;c.current=setInterval((function(){var a=s-(t+=1);a<=u&&r&&r({curTimeLeft:a}),t>0&&t%e==0&&i&&i(),0===a&&(f(),n&&n())}),1e3)}return function(){f()}}),[o,t,r,f,n,i,l,a,s]),{stopTimers:f,startTimers:p}},f$=function(e){var t=e.shouldStart,r=e.refVideo,n=e.cropArea,i=e.settings,a=e.onModelErrorChange,o=e.frontSide,s=e.onDebugInfoChange,c=e.onAboutToTimeout,u=e.onSessionTimeout,l=e.onCaptureDone,d=e.outputEncryptionSettings,f=SC.useRef(!1),p=Jz(SC.useState(!1),2),h=p[0],g=p[1],m=SC.useRef((function(){})),y=c_.useSDKTracking().sendEvent,v=SC.useRef(),b=SC.useRef(),C=SC.useRef(),E=vB.useSDKSettings(),w=E.debug,k=E.lang,S=E.enableAntiDebug;SC.useEffect((function(){S&&GP.enableAntiDebug()}),[S]);var B=SC.useCallback(function(){var e=Hz(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return y({tag:o?"id_front":"id_back",event:"sdk_ui.auto_capture",log:{}}),e.next=3,m.current(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[y,o]),T=SC.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];a.apply(void 0,t);var n=eG(t,"0.code");n&&n!==v.current&&y({tag:o?"id_front":"id_back",event:"sdk_ui.show_alert",log:{alert:n}}),v.current=n}),[a,o,y]),A=function(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,i=e.settings,a=e.onError,o=e.frontSide,s=e.onAutoCaptureSuccess,c=SC.useRef(null);null===c.current&&(c.current=document.createElement("canvas"));var u=SC.useRef(!1),l=SC.useRef(null),d=Jz(SC.useState(!1),2),f=d[0],p=d[1],h=SC.useRef({imageBlob:null,takenAt:null,blurScore:null,detectedCard:null}),g=SC.useRef({imageBlob:null,blurScore:null,error:null,detectedCard:null}),m=SC.useRef(!1),y=SC.useRef(!1),v=SC.useRef(null),b=SC.useRef(!1),C=SC.useRef({}),E=vB.useSDKSettings().customUrls;SC.useEffect((function(){function e(){return(e=Hz(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!i||f){e.next=10;break}if(!i.enableIdDetection){e.next=8;break}return e.next=4,a$(E);case 4:C.current=e.sent,v.current=i.enableBlurCheck&&C.current.ableToUseModel,e.next=9;break;case 8:v.current=!1;case 9:p(!0);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[f,i,E]);var w=SC.useCallback((function(){!0===u.current&&(u.current=!1)}),[]),k=SC.useCallback(function(){var e=Hz(regeneratorRuntime.mark((function e(t){var r,n,a,o,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.blurScore,n=t.detectedCard,a=i.blurThreshold,o=h.current,s=g.current,!(r<a&&U_.hasBetterCardBlurScore(r,o.blurScore))){e.next=15;break}if(!b.current){e.next=9;break}o.imageBlob=s.imageBlob,e.next=12;break;case 9:return e.next=11,V_.takePicture({canvas:c.current});case 11:o.imageBlob=e.sent;case 12:o.takenAt=(new Date).getTime(),o.blurScore=r,o.detectedCard=n;case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[i]),S=SC.useCallback(function(){var e=Hz(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.blurScore,n=t.detectedCard,y.current=!0,i=g.current,!U_.hasBetterCardBlurScore(r,i.blurScore)){e.next=10;break}return e.next=6,V_.takePicture({canvas:c.current});case 6:i.imageBlob=e.sent,i.blurScore=r,i.detectedCard=n,b.current=!0;case 10:y.current=!1;case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[]),B=SC.useCallback(Hz(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=i.waitForBestImageTimeMs,null===(r=h.current).imageBlob){e.next=8;break}if(!((new Date).getTime()-r.takenAt>t)){e.next=8;break}return e.next=7,s(r);case 7:w();case 8:case"end":return e.stop()}}),e)}))),[s,i,w]),T=SC.useCallback((function(){m.current=!0}),[]),A=SC.useCallback((function(){return new Promise((function(e){m.current=!1;var t=setInterval((function(){y.current||(clearInterval(t),e())}),150)}))}),[]),I=SC.useCallback(Hz(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 t=i.blurThreshold,r=g.current;v.current?(T(),setTimeout((function(){A().then((function(){U_.hasBetterCardBlurScore(r.blurScore,t)||(r.error=o$.id_detector_error_blur),null===r.imageBlob?V_.takePicture({canvas:c.current}).then((function(t){r.imageBlob=t,e(r)})):e(r)}))}),2e3)):V_.takePicture({canvas:c.current}).then((function(t){r.imageBlob=t,e(r)}))})));case 1:case"end":return e.stop()}}),e)}))),[i,T,A]),_=SC.useCallback(Hz(regeneratorRuntime.mark((function e(){var r,n,s,d,p,y,v,E,w,T,A,I,_,x,P,R,N,O,L,D,U,M,V,j,F;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i&&f&&!u.current){e.next=2;break}return e.abrupt("return");case 2:h.current={imageBlob:null,takenAt:null,blurScore:null,detectedCard:null},g.current={imageBlob:null,blurScore:null,error:null,detectedCard:null},r=i.enableAutoCapture,n=i.enableBlurCheck,s=i.enableIdDetection,d=C.current,p=d.idCardModel,y=d.blazefaceModel,v=d.ableToUseModel,E=l.current,w=t.current,u.current=!0,T=E.cropX,A=E.cropY,I=E.cropWidth,_=E.cropHeight,x=E.cropWidthWithoutPadding,P=E.cropHeightWithoutPadding,(R=c.current).width=I,R.height=_,N=R.getContext("2d"),O=document.createElement("canvas"),L=O.getContext("2d"),D=s&&v?15:700;case 17:if(N.drawImage(w,T,A,I,_,0,0,I,_),b.current=!1,!s||!v){e.next=74;break}return U=null,e.next=24,p.predict(R,{detectThreshold:.3});case 24:if(!(M=e.sent).card){e.next=70;break}if(!VY({corners:M.card.corners,width:I,height:_})){e.next=67;break}if(!zY(M.card.corners)){e.next=64;break}if(V=MY(R,M.card.corners),!((j=Q_.rectAreaRatio({small:{area:V.width*V.height},big:{area:x*P}}))<.5)){e.next=36;break}U=o$.id_detector_card_too_small,e.next=62;break;case 36:if(!(j>.95)){e.next=40;break}U=o$.id_detector_error_incomplete,e.next=62;break;case 40:return O.width=V.width,O.height=V.height,L.putImageData(V,0,0),e.next=45,jY({canvas:O});case 45:if(!e.sent){e.next=50;break}U=o$.glare_detected,e.next=62;break;case 50:return e.next=52,KY({blazefaceModel:y,predictedIdCardCanvas:O,frontSide:o});case 52:if(U=e.sent){e.next=62;break}if(!n){e.next=62;break}if(F=U_.calculateIdCardBlurScore({canvas:O}),!m.current){e.next=59;break}return e.next=59,S({blurScore:F,detectedCard:M.card});case 59:if(!r){e.next=62;break}return e.next=62,k({blurScore:F,detectedCard:M.card});case 62:e.next=65;break;case 64:U=o$.id_detector_validate_angle_error;case 65:e.next=68;break;case 67:U=o$.id_detector_error_incomplete;case 68:e.next=71;break;case 70:U=o$.id_detector_no_cards;case 71:return a(U),e.next=74,B();case 74:if(u.current){e.next=76;break}return e.abrupt("break",80);case 76:return e.next=78,p_.sleep(D);case 78:e.next=17;break;case 80:case"end":return e.stop()}}),e)}))),[t,i,f,o,a,k,S,B]);SC.useEffect((function(){var e=t.current;function i(){return(i=Hz(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.current=V_.analyzeVideoAndWindowSizes(e,n,.05),t.next=3,_();case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}r&&n&&f&&function(){i.apply(this,arguments)}()}),[r,n,t,w,_,f]);var x=SC.useCallback((function(){w()}),[w]);return SC.useEffect((function(){return x}),[x]),{refWorkingCanvas:c,stopCheckFrame:w,checkFrame:_,warmupDone:f,takePictureManually:I,refAbleToRunBurstMode:v}}({refVideo:r,shouldStart:t,cropArea:n,settings:i,onError:T,frontSide:o,onAutoCaptureSuccess:B}),I=A.refWorkingCanvas,_=A.stopCheckFrame,x=A.checkFrame,P=A.warmupDone,R=A.takePictureManually,N=A.refAbleToRunBurstMode,O=s$({refVideo:r,shouldStart:t&&P,cropArea:n,settings:i}),L=O.stopCheckFrame,D=O.splitVideos,U=O.resetRecordedVideos,M=O.checkFrame,V=O.refRecordedVideos;!function(e){var t=e.debug,r=e.refRecordedVideos,n=e.refWorkingCanvas,i=e.refVideo,a=e.onChange;SC.useEffect((function(){var e;return t&&(e=setInterval((function(){var e=i.current,t=r.current,o=n.current,s=t[t.length-1],c={videoWidth:e.videoWidth,videoHeight:e.videoHeight,framesCount:s.frames.length,"window.innerWidth":window.innerWidth,"window.innerHeight":window.innerHeight,"canvas.width":null==o?void 0:o.width,"canvas.height":null==o?void 0:o.height};a&&a(JSON.stringify(c,null,2))}),1e3)),function(){return clearInterval(e)}}),[a,t,r,n,i])}({debug:w,refRecordedVideos:V,refWorkingCanvas:I,refVideo:r,onChange:s});var j=SC.useCallback((function(){L(),_(),U(),u()}),[U,L,_,u]),F=SC.useCallback((function(){D()}),[D]),z=d$({lang:k,onAboutToTimeout:c,onSessionTimeout:j,onVideoTimeLimitReached:F,settings:i,shouldStartTimers:P&&t&&(null==i?void 0:i.enableTimers),sessionTime:null==i?void 0:i.idCardSessionTime}),K=z.stopTimers,q=z.startTimers,H=SC.useCallback((function(){f.current=!1}),[]),Q=SC.useCallback(Hz(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return H(),q(),e.next=4,Promise.all([M(),x()]);case 4:case"end":return e.stop()}}),e)}))),[M,x,q,H]),G=SC.useCallback(Hz(regeneratorRuntime.mark((function e(){var t,r,n,i,a,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]?c[0]:{},r=t.imageBlob,n=t.error,i=t.detectedCard,!f.current){e.next=3;break}return e.abrupt("return");case 3:if(f.current=!0,g(!0),L(),_(),K(),T(null),!d||!d.key){e.next=14;break}return s=d.key,e.next=13,YP.encrypt({blob:r,key:s});case 13:a=e.sent;case 14:l({image:{blob:r,encrypted:a,detectedCard:i},error:n,recordedVideos:V.current}),g(!1),y({tag:o?"id_front":"id_back",event:"user_activity",log:{time_capture_in_seconds:(performance.now()-C.current)/1e3}});case 17:case"end":return e.stop()}}),e)}))),[L,_,K,T,l,V,o,y,d]);m.current=G;var W=SC.useCallback(Hz(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g(!0),K(),L(),N.current||_(),e.next=6,R();case 6:return t=e.sent,e.next=9,G(t);case 9:g(!1),y({tag:o?"id_front":"id_back",event:"user_activity.capture",log:{}});case 11:case"end":return e.stop()}}),e)}))),[R,G,K,N,L,_,y,o]);return SC.useEffect((function(){t&&(y({tag:o?"id_front":"id_back",event:"user_activity.start",log:{}}),b.current=performance.now())}),[y,o,t]),SC.useEffect((function(){P&&(y({tag:o?"id_front":"id_back",event:"user_activity.show",log:{}}),y({tag:o?"id_front":"id_back",event:"sdk.load_model",log:{status:"success",time_in_ms:performance.now()-b.current}}),C.current=performance.now())}),[y,o,P]),{warmupDone:P,isProcessing:h,takePictureManually:W,restartSession:Q,resetIsProcessingImageBlobTaken:H}},p$=hB.IDCardMessage,h$=SC.forwardRef((function(e,t){var r=e.description,n=e.usePortraitMask,i=e.windowAndVideoInfo,a=e.refVideo,o=e.frontSide,s=e.settings,c=e.onCaptureDone,u=e.onUISpacingChange,l=e.outputEncryptionSettings,d=Jz(SC.useState({}),2),f=d[0],p=d[1],h=f.yDescription,g=f.yMessage,m=f.yCaptureButton,y=d_.useAsset("ic_camera.svg"),v=d_.useAsset("ic_loading.png"),b=Jz(SC.useState(""),2),C=b[0],E=b[1],w=vB.useSDKSettings(),k=w.debug,S=w.lang,B=Jz(SC.useState(null),2),T=B[0],A=B[1],I=Jz(SC.useState(""),2),_=I[0],x=I[1],P=Jz(SC.useState(null),2),R=P[0],N=P[1],O=_Y(),L=O.showPopup,D=O.popupShown,U=O.popupType,M=SC.useCallback((function(e){x(null===e?"":pQ(e.msg[S])({side:o?kY.FRONT[S]:kY.BACK[S]}))}),[S,o]),V=SC.useCallback((function(){A(""),L({popupType:xY})}),[L]),j=SC.useCallback((function(){A(""),c.apply(void 0,arguments)}),[c]),F=SC.useCallback((function(e){var t=e.curTimeLeft;A(pQ(p$.REMAINING_TIME[S])({x:t}))}),[S]),z=f$({shouldStart:!0,refVideo:a,cropArea:R,settings:s,onModelErrorChange:M,frontSide:o,onDebugInfoChange:E,onSessionTimeout:V,onCaptureDone:j,onAboutToTimeout:F,outputEncryptionSettings:l}),K=z.warmupDone,q=z.isProcessing,H=z.takePictureManually,Q=z.restartSession,G=z.resetIsProcessingImageBlobTaken,W=SC.useCallback((function(){L({popupType:null}),G()}),[L,G]),X=SC.useCallback(Hz(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return W(),e.next=3,Q();case 3:case"end":return e.stop()}}),e)}))),[Q,W]);SC.useEffect((function(){if(i){var e,t,r,a,o,s,c,l=i.videoAreaWidth,d=i.videoAreaHeight,f=i.lostX,h=i.lostY,g=i.clientHeight;n?(o=.7*(s=d-165),r=(c=(e=h+10)+45)+20,a=(t=c+s+10)+60):(o=vK.isMobile?l-6:Math.floor(.7*l),r=(c=(e=h+10)+50)+20,a=(t=c+(s=Math.floor(Math.min(o/1.5,g-2*h-80-100)))+10)+60);var m=Math.floor((l-o)/2)+f;N({x:m,y:c,width:o,height:s,surroundStyle:{opacity:.6,background:"#000"}});var y={yTitle:e,yDescription:t,yMessage:r,yCaptureButton:a};p(y),u(y)}}),[i,n,u]);var Y=SC.useCallback(Hz(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return A(""),e.next=3,H();case 3:case"end":return e.stop()}}),e)}))),[H]);return SC.useImperativeHandle(t,(function(){return{restartSession:X}}),[X]),SC.createElement(SC.Fragment,null,!K&&SC.createElement(EW,null),k&&SC.createElement(vY,null,C),q&&SC.createElement(pY,null,SC.createElement("img",{src:v,alt:"",className:"spin"})),R&&SC.createElement(WK,{x:"".concat(R.x,"px"),y:"".concat(R.y,"px"),width:"".concat(R.width,"px"),height:"".concat(R.height,"px"),surroundStyle:R.surroundStyle},SC.createElement(wY,{width:R.width,height:R.height,type:_?EX.ERROR:EX.DEFAULT})),!_&&SC.createElement(bY,{y:"".concat(h,"px"),className:"description"},r),_&&SC.createElement(CY,{y:"".concat(h,"px")},_),!q&&(!(null!=s&&s.disableCaptureButtonIfAlert)||!_)&&SC.createElement(fY,{onClick:Y,y:"".concat(m,"px")},SC.createElement("img",{src:y,alt:""})),T&&SC.createElement(EY,{key:T,className:"message",y:"".concat(g,"px")},T),SC.createElement(rW,{open:D},U===xY&&SC.createElement(IY,{onOk:X,maxSessionTime:null==s?void 0:s.idCardSessionTime})))}));h$.propTypes={usePortraitMask:SE.bool,description:SE.string,windowAndVideoInfo:SE.shape({}),refVideo:SE.shape({}),frontSide:SE.bool,settings:SE.shape({}),onCaptureDone:SE.func,onUISpacingChange:SE.func,outputEncryptionSettings:SE.shape({})},h$.defaultProps={usePortraitMask:!1,description:"",windowAndVideoInfo:{},refVideo:{},frontSide:!0,settings:{},onCaptureDone:function(){},onUISpacingChange:function(){},outputEncryptionSettings:null};var g$,m$,y$=cB.div(c$||(c$=Zz(["\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),v$=cB.div(u$||(u$=Zz(["\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")})),b$=function(e){var t=e.children,r=e.y;return SC.createElement(y$,{y:r,background:"#00ce78"},SC.createElement(v$,{arrowSize:10,top:-10,color:"#00ce78"}),t)},C$=cB.div(l$||(l$=Zz(["\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),E$={QR_INSTRUCTIONS_TEXT:{en:SC.createElement("span",null,"Please follow the instructions below to scan QR code:",SC.createElement("br",null),SC.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:SC.createElement("span",null,"Vui lòng quét mã QR theo hướng dẫn sau:",SC.createElement("br",null),SC.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:SC.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",SC.createElement("br",null),SC.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",SC.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:SC.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",SC.createElement("br",null),SC.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",SC.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"}},w$=function(e){var t=e.children,r=e.mt,n=e.mb,i=e.ml,a=e.mr,o=e.mx,s=e.my,c=e.pt,u=e.pb,l=e.pl,d=e.pr,f=e.px,p=e.py,h=t.props.style||{},g={};return null!==o&&(g.marginLeft=o,g.marginRight=o),null!==s&&(g.marginTop=s,g.marginBottom=s),null!==r&&(g.marginTop=r),null!==n&&(g.marginBottom=n),null!==i&&(g.marginLeft=i),null!==a&&(g.marginRight=a),null!==f&&(g.paddingLeft=f,g.paddingRight=f),null!==p&&(g.paddingTop=p,g.paddingBottom=p),null!==c&&(g.paddingTop=c),null!==u&&(g.paddingBottom=u),null!==l&&(g.paddingLeft=l),null!==d&&(g.paddingRight=d),SC.cloneElement(t,{style:Yz(Yz({},h),g)})};w$.propTypes={mt:SE.string,ml:SE.string,mr:SE.string,mb:SE.string,mx:SE.string,my:SE.string,pt:SE.string,pl:SE.string,pr:SE.string,pb:SE.string,px:SE.string,py:SE.string},w$.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 k$,S$,B$,T$,A$,I$,_$=cB.button(g$||(g$=Zz(["\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})),x$=cB.a(m$||(m$=Zz(["\n color: ",";\n cursor: pointer;\n"])),(function(e){return e.theme.tsBlue})),P$=cB.div(k$||(k$=Zz(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),R$=cB.div(S$||(S$=Zz(["\n color: ",";\n font-weight: bold;\n font-size: 16px;\n"])),(function(e){return e.theme.tsSecondary})),N$=cB.div(B$||(B$=Zz(["\n color: ",";\n font-weight: normal;\n font-size: 16px;\n text-align: center;\n"])),(function(e){return e.theme.tsSecondary})),O$=function(e){var t=e.onRetry,r=e.onSkip,n=vB.useSDKSettings().lang;return SC.createElement(P$,null,SC.createElement(w$,{mt:"25px"},SC.createElement(R$,null,E$.QR_INVALID_POPUP_TITLE[n])),SC.createElement(w$,{mt:"30px"},SC.createElement(N$,null,E$.QR_INVALID_POPUP_DESCRIPTION[n])),SC.createElement(w$,{mt:"30px"},SC.createElement(_$,{onClick:t},E$.QR_INVALID_POPUP_RETRY_BUTTON[n])),SC.createElement(w$,{my:"20px"},SC.createElement(x$,{onClick:r},E$.QR_INVALID_POPUP_SKIP_BUTTON[n])))};O$.propTypes={onRetry:SE.func,onSkip:SE.func},O$.defaultProps={onRetry:function(){},onSkip:function(){}};var L$=cB.div(T$||(T$=Zz(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),D$=cB.div(A$||(A$=Zz(["\n background: #e7e6e6;\n width: 100%;\n display: flex;\n justify-content: center;\n"]))),U$=cB.div(I$||(I$=Zz(["\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})),M$=function(e){var t=e.onRetry,r=e.onSkip,n=vB.useSDKSettings().lang,i=d_.useAsset("qr_code_banner.svg");return SC.createElement(L$,null,SC.createElement(D$,null,SC.createElement("img",{src:i,alt:""})),SC.createElement(w$,{mt:"30px"},SC.createElement(U$,null,E$.SESSION_TIMEOUT_POPUP_DESCRIPTION[n])),SC.createElement(w$,{mt:"30px"},SC.createElement(_$,{onClick:t},E$.SESSION_TIMEOUT_POPUP_RETRY_BUTTON[n])),SC.createElement(w$,{my:"20px"},SC.createElement(x$,{onClick:r},E$.SESSION_TIMEOUT_POPUP_SKIP_BUTTON[n])))};M$.propTypes={onRetry:SE.func,onSkip:SE.func},M$.defaultProps={onRetry:function(){},onSkip:function(){}};var V$,j$,F$,z$,K$,q$,H$=["children","ratio","padding"],Q$=cB.div(V$||(V$=Zz(["\n width: 100%;\n padding-bottom: ","%;\n position: relative;\n"])),(function(e){return 1/e.ratio*100})),G$=cB.div(j$||(j$=Zz(["\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})),W$=function(e){var t=e.children,r=e.ratio,n=e.padding,i=$z(e,H$);return SC.createElement(Q$,Wz({ratio:r},i),SC.createElement(G$,{padding:n},t))};W$.propTypes={children:SE.node,ratio:SE.number,padding:SE.string},W$.defaultProps={children:null,ratio:4/3,padding:"0"};var X$=cB.div(F$||(F$=Zz(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),Y$=cB.div(z$||(z$=Zz(["\n background: #e7e6e6;\n width: 100%;\n"]))),$$=cB.img(K$||(K$=Zz(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),Z$=cB.div(q$||(q$=Zz(["\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})),J$=function(e){var t=e.onClickStart,r=e.onTimeout,n=e.timeout,i=vB.useSDKSettings().lang,a=d_.useAsset("qr_code_banner.png"),o=SC.useRef(n),s=Jz(SC.useState((function(){return pQ(E$.QR_INSTRUCTIONS_COUNTDOWN[i])({x:n})})),2),c=s[0],u=s[1];return SC.useEffect((function(){var e=pQ(E$.QR_INSTRUCTIONS_COUNTDOWN[i]),t=setInterval((function(){o.current--,u(e({x:o.current})),o.current<=0&&(clearInterval(t),r&&r())}),1e3);return function(){clearInterval(t)}}),[i,r]),SC.createElement(X$,null,SC.createElement(Y$,null,SC.createElement(W$,{ratio:1.6},SC.createElement($$,{src:a}))),SC.createElement(w$,{mt:"30px"},SC.createElement(Z$,null,E$.QR_INSTRUCTIONS_TEXT[i])),SC.createElement(w$,{mt:"30px"},SC.createElement(_$,{onClick:t},E$.QR_INSTRUCTIONS_START_BUTTON[i])),SC.createElement(w$,{my:"20px"},SC.createElement(Z$,null,c)))};J$.propTypes={onClickStart:SE.func,onTimeout:SE.func,timeout:SE.number},J$.defaultProps={onClickStart:null,onTimeout:null,timeout:10};var eZ=/^\d{12}\|(\d{9})?\|.+\|\d{8}\|((Nam)|(Nữ))\|.+\|\d{8}$/g,tZ=function(e){var t=e.match(eZ);return{valid:Boolean(t)}},rZ=function(){function t(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this._onDecodeError,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this._calculateScanRegion,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"environment";Pv(this,t),this.$video=e,this.$canvas=document.createElement("canvas"),this._onDecode=r,this._legacyCanvasSize=t.DEFAULT_CANVAS_SIZE,this._preferredCamera=a,this._active=!1,this._paused=!1,this._flashOn=!1,"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._onDecodeError=n,"number"==typeof i?(this._legacyCanvasSize=i,console.warn("You're using a deprecated version of the QrScanner constructor which will be removed in the future")):this._calculateScanRegion=i,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;var o=!1;e.hidden&&(e.hidden=!1,o=!0),document.body.contains(e)||(document.body.appendChild(e),o=!0),requestAnimationFrame((function(){var t=window.getComputedStyle(e);"none"===t.display&&(e.style.setProperty("display","block","important"),o=!0),"visible"!==t.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=t.createQrEngine()}return Nv(t,[{key:"hasFlash",value:function(){var e=null;return(this.$video.srcObject?Promise.resolve(this.$video.srcObject.getVideoTracks()[0]):this._getCameraStream().then((function(t){var r=t.stream;return console.warn("Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream"),e=r,r.getVideoTracks()[0]}))).then((function(e){return"torch"in e.getSettings()})).catch((function(){return!1})).finally((function(){if(e){var t,r=eb(e.getTracks());try{for(r.s();!(t=r.n()).done;){var n=t.value;n.stop(),e.removeTrack(n)}}catch(e){r.e(e)}finally{r.f()}}}))}},{key:"isFlashOn",value:function(){return this._flashOn}},{key:"toggleFlash",value:function(){return this._flashOn?this.turnFlashOff():this.turnFlashOn()}},{key:"turnFlashOn",value:function(){var t=this;return this._flashOn?Promise.resolve():(this._flashOn=!0,!this._active||this._paused?Promise.resolve():this.hasFlash().then((function(e){return e?t.$video.srcObject.getVideoTracks()[0].applyConstraints({advanced:[{torch:!0}]}):Promise.reject("No flash available")})).catch((function(){throw t._flashOn=!1,e})))}},{key:"turnFlashOff",value:function(){if(this._flashOn)return this._flashOn=!1,this._restartVideoStream()}},{key:"destroy",value:function(){this.$video.removeEventListener("loadedmetadata",this._onLoadedMetaData),this.$video.removeEventListener("play",this._onPlay),document.removeEventListener("visibilitychange",this._onVisibilityChange),this.stop(),t._postWorkerMessage(this._qrEnginePromise,"close")}},{key:"start",value:function(){var e=this;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((function(t){var r=t.stream,n=t.facingMode;e.$video.srcObject=r,e.$video.play(),e._setVideoMirror(n),e._flashOn&&(e._flashOn=!1,e.turnFlashOn().catch((function(){})))})).catch((function(t){throw e._active=!1,t}))))}},{key:"stop",value:function(){this.pause(),this._active=!1}},{key:"pause",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this._paused=!0,!this._active)return Promise.resolve(!0);this.$video.pause();var r=function(){var t,r=eb(e.$video.srcObject?e.$video.srcObject.getTracks():[]);try{for(r.s();!(t=r.n()).done;){var n=t.value;n.stop(),e.$video.srcObject.removeTrack(n)}}catch(e){r.e(e)}finally{r.f()}e.$video.srcObject=null};return t?(r(),Promise.resolve(!0)):new Promise((function(e){return setTimeout(e,300)})).then((function(){return!!e._paused&&(r(),!0)}))}},{key:"setCamera",value:function(e){return e===this._preferredCamera?Promise.resolve():(this._preferredCamera=e,this._restartVideoStream())}},{key:"setGrayscaleWeights",value:function(e,r,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];t._postWorkerMessage(this._qrEnginePromise,"grayscaleWeights",{red:e,green:r,blue:n,useIntegerApproximation:i})}},{key:"setInversionMode",value:function(e){t._postWorkerMessage(this._qrEnginePromise,"inversionMode",e)}},{key:"_onPlay",value:function(){this._scanRegion=this._calculateScanRegion(this.$video),this._scanFrame()}},{key:"_onLoadedMetaData",value:function(){this._scanRegion=this._calculateScanRegion(this.$video)}},{key:"_onVisibilityChange",value:function(){document.hidden?this.pause():this._active&&this.start()}},{key:"_calculateScanRegion",value:function(e){var t=Math.min(e.videoWidth,e.videoHeight),r=Math.round(2/3*t);return{x:Math.round((e.videoWidth-r)/2),y:Math.round((e.videoHeight-r)/2),width:r,height:r,downScaledWidth:this._legacyCanvasSize,downScaledHeight:this._legacyCanvasSize}}},{key:"_scanFrame",value:function(){var e=this;if(!this._active||this.$video.paused||this.$video.ended)return!1;requestAnimationFrame((function(){e.$video.readyState<=1?e._scanFrame():e._qrEnginePromise.then((function(r){return t.scanImage(e.$video,e._scanRegion,r,e.$canvas)})).then(e._onDecode,(function(r){e._active&&(-1!==(r.message||r).indexOf("service unavailable")&&(e._qrEnginePromise=t.createQrEngine()),e._onDecodeError(r))})).then((function(){return e._scanFrame()}))}))}},{key:"_onDecodeError",value:function(e){e!==t.NO_QR_CODE_FOUND&&console.log(e)}},{key:"_getCameraStream",value:function(){var e=this;if(!navigator.mediaDevices)return Promise.reject("Camera not found.");var t="environment"===this._preferredCamera||"user"===this._preferredCamera?"facingMode":"deviceId",r=[{width:{min:1024}},{width:{min:768}},{}];return[].concat(Hv(r.map((function(r){return Object.assign({},r,Ov({},t,{exact:e._preferredCamera}))}))),r).reduceRight((function(t,r){return function(){return navigator.mediaDevices.getUserMedia({video:r,audio:!1}).then((function(t){return{stream:t,facingMode:e._getFacingMode(t)||(r.facingMode?e._preferredCamera:"environment"===e._preferredCamera?"user":"environment")}})).catch(t)}}),(function(){return Promise.reject("Camera not found.")}))()}},{key:"_restartVideoStream",value:function(){var e=this,t=this._paused;return this.pause(!0).then((function(r){if(r&&!t&&e._active)return e.start()}))}},{key:"_setVideoMirror",value:function(e){var t="user"===e?-1:1;this.$video.style.transform="scaleX("+t+")"}},{key:"_getFacingMode",value:function(e){var t=e.getVideoTracks()[0];return t?/rear|back|environment/i.test(t.label)?"environment":/front|user|face/i.test(t.label)?"user":null:null}}],[{key:"hasCamera",value:function(){return t.listCameras(!1).then((function(e){return!!e.length})).catch((function(){return!1}))}},{key:"listCameras",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!navigator.mediaDevices)return Promise.resolve([]);var t=null;return(e?navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then((function(e){return t=e})).catch((function(){})):Promise.resolve()).then((function(){return navigator.mediaDevices.enumerateDevices()})).then((function(e){return e.filter((function(e){return"videoinput"===e.kind})).map((function(e,t){return{id:e.deviceId,label:e.label||(0===t?"Default Camera":"Camera ".concat(t+1))}}))})).finally((function(){if(t){var e,r=eb(t.getTracks());try{for(r.s();!(e=r.n()).done;){var n=e.value;n.stop(),t.removeTrack(n)}}catch(e){r.e(e)}finally{r.f()}}}))}},{key:"scanImage",value:function(e){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],c=i instanceof Worker,u=Promise.all([i||t.createQrEngine(),t._loadImage(e)]).then((function(e){var s,u,l=qv(e,2),d=l[0],f=l[1];return i=d,s=qv(r._drawToCanvas(f,n,a,o),2),a=s[0],u=s[1],i instanceof Worker?(c||i.postMessage({type:"inversionMode",data:"both"}),new Promise((function(e,r){var n,o,s;o=function(a){"qrResult"===a.data.type&&(i.removeEventListener("message",o),i.removeEventListener("error",s),clearTimeout(n),null!==a.data.data?e(a.data.data):r(t.NO_QR_CODE_FOUND))},s=function(e){i.removeEventListener("message",o),i.removeEventListener("error",s),clearTimeout(n);var t=e?e.message||e:"Unknown Error";r("Scanner error: "+t)},i.addEventListener("message",o),i.addEventListener("error",s),n=setTimeout((function(){return s("timeout")}),1e4);var c=u.getImageData(0,0,a.width,a.height);i.postMessage({type:"decode",data:c},[c.data.buffer])}))):new Promise((function(e,r){var n=setTimeout((function(){return r("Scanner error: timeout")}),1e4);i.detect(a).then((function(n){n.length?e(n[0].rawValue):r(t.NO_QR_CODE_FOUND)})).catch((function(e){return r("Scanner error: "+(e.message||e))})).finally((function(){return clearTimeout(n)}))}))}));return n&&s&&(u=u.catch((function(){return t.scanImage(e,null,i,a,o)}))),u=u.finally((function(){c||t._postWorkerMessage(i,"close")}))}},{key:"createQrEngine",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.WORKER_PATH;return("BarcodeDetector"in window&&BarcodeDetector.getSupportedFormats?BarcodeDetector.getSupportedFormats():Promise.resolve([])).then((function(t){return-1!==t.indexOf("qr_code")?new BarcodeDetector({formats:["qr_code"]}):new Worker(e)}))}},{key:"_drawToCanvas",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];r=r||document.createElement("canvas");var i=t&&t.x?t.x:0,a=t&&t.y?t.y:0,o=t&&t.width?t.width:e.width||e.videoWidth,s=t&&t.height?t.height:e.height||e.videoHeight;if(!n){var c=t&&t.downScaledWidth?t.downScaledWidth:o,u=t&&t.downScaledHeight?t.downScaledHeight:s;r.width!==c&&(r.width=c),r.height!==u&&(r.height=u)}var l=r.getContext("2d",{alpha:!1});return l.imageSmoothingEnabled=!1,l.drawImage(e,i,a,o,s,0,0,r.width,r.height),[r,l]}},{key:"_loadImage",value:function(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 t._awaitImageLoad(e).then((function(){return e}));if(e instanceof File||e instanceof Blob||e instanceof URL||"string"==typeof e){var r=new Image;return e instanceof File||e instanceof Blob?r.src=URL.createObjectURL(e):r.src=e,t._awaitImageLoad(r).then((function(){return(e instanceof File||e instanceof Blob)&&URL.revokeObjectURL(r.src),r}))}return Promise.reject("Unsupported image type.")}},{key:"_awaitImageLoad",value:function(e){return new Promise((function(t,r){var n,i;e.complete&&0!==e.naturalWidth?t():(n=function(){e.removeEventListener("load",n),e.removeEventListener("error",i),t()},i=function(){e.removeEventListener("load",n),e.removeEventListener("error",i),r("Image load error")},e.addEventListener("load",n),e.addEventListener("error",i))}))}},{key:"_postWorkerMessage",value:function(e,t,r){return Promise.resolve(e).then((function(e){e instanceof Worker&&e.postMessage({type:t,data:r})}))}}]),t}();function nZ(){return iZ.apply(this,arguments)}function iZ(){return(iZ=Hz(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return rZ.WORKER_PATH=$P(),e.next=3,rZ.createQrEngine(rZ.WORKER_PATH);case 3:return t=e.sent,e.abrupt("return",{qrEngine:t});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function aZ(){return(aZ=Hz(regeneratorRuntime.mark((function e(){var t,r,n,i,a,o,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=c.length>0&&void 0!==c[0]?c[0]:{},r=t.opencvUrl,e.next=3,Promise.all([nZ(),XY({url:r})]);case 3:return n=e.sent,i=Jz(n,1),a=i[0].qrEngine,o=window,s=o.cv,e.abrupt("return",{qrScannerResources:{engine:a,canvas:document.createElement("canvas")},blackAndWhiteConverterResources:{kernel:s.matFromArray(3,3,s.CV_32FC1,[-1,-1,-1,-1,11,-1,-1,-1,-1]),canvas:document.createElement("canvas"),dst:new s.Mat}});case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}rZ.DEFAULT_CANVAS_SIZE=400,rZ.NO_QR_CODE_FOUND="No QR code found",rZ.WORKER_PATH="qr-scanner-worker.min.js";var oZ=sG((function(){return aZ.apply(this,arguments)})),sZ=iK(aK((function(e,t){var r;r=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){this.width=t,this.height=e.length/t,this.data=e}return e.createEmpty=function(t,r){return new e(new Uint8ClampedArray(t*r),t)},e.prototype.get=function(e,t){return!(e<0||e>=this.width||t<0||t>=this.height||!this.data[t*this.width+e])},e.prototype.set=function(e,t,r){this.data[t*this.width+e]=r?1:0},e.prototype.setRegion=function(e,t,r,n,i){for(var a=t;a<t+n;a++)for(var o=e;o<e+r;o++)this.set(o,a,!!i)},e}();t.BitMatrix=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(2);t.addOrSubtractGF=function(e,t){return e^t};var i=function(){function e(e,t,r){this.primitive=e,this.size=t,this.generatorBase=r,this.expTable=new Array(this.size),this.logTable=new Array(this.size);for(var i=1,a=0;a<this.size;a++)this.expTable[a]=i,(i*=2)>=this.size&&(i=(i^this.primitive)&this.size-1);for(a=0;a<this.size-1;a++)this.logTable[this.expTable[a]]=a;this.zero=new n.default(this,Uint8ClampedArray.from([0])),this.one=new n.default(this,Uint8ClampedArray.from([1]))}return e.prototype.multiply=function(e,t){return 0===e||0===t?0:this.expTable[(this.logTable[e]+this.logTable[t])%(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,t){if(e<0)throw new Error("Invalid monomial degree less than 0");if(0===t)return this.zero;var r=new Uint8ClampedArray(e+1);return r[0]=t,new n.default(this,r)},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}();t.default=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),i=function(){function e(e,t){if(0===t.length)throw new Error("No coefficients.");this.field=e;var r=t.length;if(r>1&&0===t[0]){for(var n=1;n<r&&0===t[n];)n++;if(n===r)this.coefficients=e.zero.coefficients;else{this.coefficients=new Uint8ClampedArray(r-n);for(var i=0;i<this.coefficients.length;i++)this.coefficients[i]=t[n+i]}}else this.coefficients=t}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(t){var r;if(this.isZero())return t;if(t.isZero())return this;var i=this.coefficients,a=t.coefficients;i.length>a.length&&(i=(r=[a,i])[0],a=r[1]);for(var o=new Uint8ClampedArray(a.length),s=a.length-i.length,c=0;c<s;c++)o[c]=a[c];for(c=s;c<a.length;c++)o[c]=n.addOrSubtractGF(i[c-s],a[c]);return new e(this.field,o)},e.prototype.multiply=function(t){if(0===t)return this.field.zero;if(1===t)return this;for(var r=this.coefficients.length,n=new Uint8ClampedArray(r),i=0;i<r;i++)n[i]=this.field.multiply(this.coefficients[i],t);return new e(this.field,n)},e.prototype.multiplyPoly=function(t){if(this.isZero()||t.isZero())return this.field.zero;for(var r=this.coefficients,i=r.length,a=t.coefficients,o=a.length,s=new Uint8ClampedArray(i+o-1),c=0;c<i;c++)for(var u=r[c],l=0;l<o;l++)s[c+l]=n.addOrSubtractGF(s[c+l],this.field.multiply(u,a[l]));return new e(this.field,s)},e.prototype.multiplyByMonomial=function(t,r){if(t<0)throw new Error("Invalid degree less than 0");if(0===r)return this.field.zero;for(var n=this.coefficients.length,i=new Uint8ClampedArray(n+t),a=0;a<n;a++)i[a]=this.field.multiply(this.coefficients[a],r);return new e(this.field,i)},e.prototype.evaluateAt=function(e){var t=0;if(0===e)return this.getCoefficient(0);var r=this.coefficients.length;if(1===e)return this.coefficients.forEach((function(e){t=n.addOrSubtractGF(t,e)})),t;t=this.coefficients[0];for(var i=1;i<r;i++)t=n.addOrSubtractGF(this.field.multiply(e,t),this.coefficients[i]);return t},e}();t.default=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),i=r(5),a=r(11),o=r(12);function s(e){var t=o.locate(e);if(!t)return null;for(var r=0,n=t;r<n.length;r++){var s=n[r],c=a.extract(e,s),u=i.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,t,r,i){void 0===i&&(i={});var a=c;Object.keys(a||{}).forEach((function(e){a[e]=i[e]||a[e]}));var o="attemptBoth"===a.inversionAttempts||"invertFirst"===a.inversionAttempts,u="onlyInvert"===a.inversionAttempts||"invertFirst"===a.inversionAttempts,l=n.binarize(e,t,r,o),d=l.binarized,f=l.inverted,p=s(u?f:d);return p||"attemptBoth"!==a.inversionAttempts&&"invertFirst"!==a.inversionAttempts||(p=s(u?d:f)),p}u.default=u,t.default=u},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);function i(e,t,r){return e<t?t:e>r?r:e}var a=function(){function e(e,t){this.width=e,this.data=new Uint8ClampedArray(e*t)}return e.prototype.get=function(e,t){return this.data[t*this.width+e]},e.prototype.set=function(e,t,r){this.data[t*this.width+e]=r},e}();t.binarize=function(e,t,r,o){if(e.length!==t*r*4)throw new Error("Malformed data passed to binarizer.");for(var s=new a(t,r),c=0;c<t;c++)for(var u=0;u<r;u++){var l=e[4*(u*t+c)+0],d=e[4*(u*t+c)+1],f=e[4*(u*t+c)+2];s.set(c,u,.2126*l+.7152*d+.0722*f)}for(var p=Math.ceil(t/8),h=Math.ceil(r/8),g=new a(p,h),m=0;m<h;m++)for(var y=0;y<p;y++){var v=0,b=1/0,C=0;for(u=0;u<8;u++)for(c=0;c<8;c++){var E=s.get(8*y+c,8*m+u);v+=E,b=Math.min(b,E),C=Math.max(C,E)}var w=v/Math.pow(8,2);if(C-b<=24&&(w=b/2,m>0&&y>0)){var k=(g.get(y,m-1)+2*g.get(y-1,m)+g.get(y-1,m-1))/4;b<k&&(w=k)}g.set(y,m,w)}var S=n.BitMatrix.createEmpty(t,r),B=null;for(o&&(B=n.BitMatrix.createEmpty(t,r)),m=0;m<h;m++)for(y=0;y<p;y++){for(var T=i(y,2,p-3),A=i(m,2,h-3),I=(v=0,-2);I<=2;I++)for(var _=-2;_<=2;_++)v+=g.get(T+I,A+_);var x=v/25;for(I=0;I<8;I++)for(_=0;_<8;_++){c=8*y+I,u=8*m+_;var P=s.get(c,u);S.set(c,u,P<=x),o&&B.set(c,u,!(P<=x))}}return o?{binarized:S,inverted:B}:{binarized:S}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),i=r(6),a=r(9),o=r(10);function s(e,t){for(var r=e^t,n=0;r;)n++,r&=r-1;return n}function c(e,t){return t<<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,t,r){for(var i=l[r.dataMask],a=e.height,o=function(e){var t=17+4*e.versionNumber,r=n.BitMatrix.createEmpty(t,t);r.setRegion(0,0,9,9,!0),r.setRegion(t-8,0,8,9,!0),r.setRegion(0,t-8,9,8,!0);for(var i=0,a=e.alignmentPatternCenters;i<a.length;i++)for(var o=a[i],s=0,c=e.alignmentPatternCenters;s<c.length;s++){var u=c[s];6===o&&6===u||6===o&&u===t-7||o===t-7&&6===u||r.setRegion(o-2,u-2,5,5,!0)}return r.setRegion(6,9,1,t-17,!0),r.setRegion(9,6,t-17,1,!0),e.versionNumber>6&&(r.setRegion(t-11,0,3,6,!0),r.setRegion(0,t-11,6,3,!0)),r}(t),s=[],u=0,d=0,f=!0,p=a-1;p>0;p-=2){6===p&&p--;for(var h=0;h<a;h++)for(var g=f?a-1-h:h,m=0;m<2;m++){var y=p-m;if(!o.get(y,g)){d++;var v=e.get(y,g);i({y:g,x:y})&&(v=!v),u=c(v,u),8===d&&(s.push(u),d=0,u=0)}}f=!f}return s}function f(e){var t=function(e){var t=e.height,r=Math.floor((t-17)/4);if(r<=6)return o.VERSIONS[r-1];for(var n=0,i=5;i>=0;i--)for(var a=t-9;a>=t-11;a--)n=c(e.get(a,i),n);var u=0;for(a=5;a>=0;a--)for(i=t-9;i>=t-11;i--)u=c(e.get(a,i),u);for(var l,d=1/0,f=0,p=o.VERSIONS;f<p.length;f++){var h=p[f];if(h.infoBits===n||h.infoBits===u)return h;var g=s(n,h.infoBits);g<d&&(l=h,d=g),(g=s(u,h.infoBits))<d&&(l=h,d=g)}return d<=3?l:void 0}(e);if(!t)return null;var r=function(e){for(var t=0,r=0;r<=8;r++)6!==r&&(t=c(e.get(r,8),t));for(var n=7;n>=0;n--)6!==n&&(t=c(e.get(8,n),t));var i=e.height,a=0;for(n=i-1;n>=i-7;n--)a=c(e.get(8,n),a);for(r=i-8;r<i;r++)a=c(e.get(r,8),a);for(var o=1/0,l=null,d=0,f=u;d<f.length;d++){var p=f[d],h=p.bits,g=p.formatInfo;if(h===t||h===a)return g;var m=s(t,h);m<o&&(l=g,o=m),t!==a&&(m=s(a,h))<o&&(l=g,o=m)}return o<=3?l:null}(e);if(!r)return null;var n=function(e,t,r){var n=t.errorCorrectionLevels[r],i=[],a=0;if(n.ecBlocks.forEach((function(e){for(var t=0;t<e.numBlocks;t++)i.push({numDataCodewords:e.dataCodewordsPerBlock,codewords:[]}),a+=e.dataCodewordsPerBlock+n.ecCodewordsPerBlock})),e.length<a)return null;e=e.slice(0,a);for(var o=n.ecBlocks[0].dataCodewordsPerBlock,s=0;s<o;s++)for(var c=0,u=i;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++)i[l+s].codewords.push(e.shift())}for(;e.length>0;)for(var f=0,p=i;f<p.length;f++)p[f].codewords.push(e.shift());return i}(d(e,t,r),t,r.errorCorrectionLevel);if(!n)return null;for(var l=n.reduce((function(e,t){return e+t.numDataCodewords}),0),f=new Uint8ClampedArray(l),p=0,h=0,g=n;h<g.length;h++){var m=g[h],y=a.decode(m.codewords,m.codewords.length-m.numDataCodewords);if(!y)return null;for(var v=0;v<m.numDataCodewords;v++)f[p++]=y[v]}try{return i.decode(f,t.versionNumber)}catch(e){return null}}t.decode=function(e){if(null==e)return null;var t=f(e);if(t)return t;for(var r=0;r<e.width;r++)for(var n=r+1;n<e.height;n++)e.get(r,n)!==e.get(n,r)&&(e.set(r,n,!e.get(r,n)),e.set(n,r,!e.get(n,r)));return f(e)}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n,i,a=r(7),o=r(8);function s(e,t){for(var r=[],n="",i=[10,12,14][t],a=e.readBits(i);a>=3;){if((u=e.readBits(10))>=1e3)throw new Error("Invalid numeric value above 999");var o=Math.floor(u/100),s=Math.floor(u/10)%10,c=u%10;r.push(48+o,48+s,48+c),n+=o.toString()+s.toString()+c.toString(),a-=3}if(2===a){if((u=e.readBits(7))>=100)throw new Error("Invalid numeric value above 99");o=Math.floor(u/10),s=u%10,r.push(48+o,48+s),n+=o.toString()+s.toString()}else if(1===a){var u;if((u=e.readBits(4))>=10)throw new Error("Invalid numeric value above 9");r.push(48+u),n+=u.toString()}return{bytes:r,text:n}}!function(e){e.Numeric="numeric",e.Alphanumeric="alphanumeric",e.Byte="byte",e.Kanji="kanji",e.ECI="eci"}(n=t.Mode||(t.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"}(i||(i={}));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,t){for(var r=[],n="",i=[9,11,13][t],a=e.readBits(i);a>=2;){var o=e.readBits(11),s=Math.floor(o/45),u=o%45;r.push(c[s].charCodeAt(0),c[u].charCodeAt(0)),n+=c[s]+c[u],a-=2}return 1===a&&(s=e.readBits(6),r.push(c[s].charCodeAt(0)),n+=c[s]),{bytes:r,text:n}}function l(e,t){for(var r=[],n="",i=[8,16,16][t],a=e.readBits(i),o=0;o<a;o++){var s=e.readBits(8);r.push(s)}try{n+=decodeURIComponent(r.map((function(e){return"%"+("0"+e.toString(16)).substr(-2)})).join(""))}catch(e){}return{bytes:r,text:n}}function d(e,t){for(var r=[],n="",i=[8,10,12][t],a=e.readBits(i),s=0;s<a;s++){var c=e.readBits(13),u=Math.floor(c/192)<<8|c%192;u+=u<7936?33088:49472,r.push(u>>8,255&u),n+=String.fromCharCode(o.shiftJISTable[u])}return{bytes:r,text:n}}t.decode=function(e,t){for(var r,o,c,f,p=new a.BitStream(e),h=t<=9?0:t<=26?1:2,g={text:"",bytes:[],chunks:[],version:t};p.available()>=4;){var m=p.readBits(4);if(m===i.Terminator)return g;if(m===i.ECI)0===p.readBits(1)?g.chunks.push({type:n.ECI,assignmentNumber:p.readBits(7)}):0===p.readBits(1)?g.chunks.push({type:n.ECI,assignmentNumber:p.readBits(14)}):0===p.readBits(1)?g.chunks.push({type:n.ECI,assignmentNumber:p.readBits(21)}):g.chunks.push({type:n.ECI,assignmentNumber:-1});else if(m===i.Numeric){var y=s(p,h);g.text+=y.text,(r=g.bytes).push.apply(r,y.bytes),g.chunks.push({type:n.Numeric,text:y.text})}else if(m===i.Alphanumeric){var v=u(p,h);g.text+=v.text,(o=g.bytes).push.apply(o,v.bytes),g.chunks.push({type:n.Alphanumeric,text:v.text})}else if(m===i.Byte){var b=l(p,h);g.text+=b.text,(c=g.bytes).push.apply(c,b.bytes),g.chunks.push({type:n.Byte,bytes:b.bytes,text:b.text})}else if(m===i.Kanji){var C=d(p,h);g.text+=C.text,(f=g.bytes).push.apply(f,C.bytes),g.chunks.push({type:n.Kanji,bytes:C.bytes,text:C.text})}}if(0===p.available()||0===p.readBits(p.available()))return g}},function(e,t,r){Object.defineProperty(t,"__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 t=0;if(this.bitOffset>0){var r=8-this.bitOffset,n=e<r?e:r,i=255>>8-n<<(a=r-n);t=(this.bytes[this.byteOffset]&i)>>a,e-=n,this.bitOffset+=n,8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(e>0){for(;e>=8;)t=t<<8|255&this.bytes[this.byteOffset],this.byteOffset++,e-=8;var a;e>0&&(i=255>>(a=8-e)<<a,t=t<<e|(this.bytes[this.byteOffset]&i)>>a,this.bitOffset+=e)}return t},e.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},e}();t.BitStream=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.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,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),i=r(2);t.decode=function(e,t){var r=new Uint8ClampedArray(e.length);r.set(e);for(var a=new n.default(285,256,0),o=new i.default(a,r),s=new Uint8ClampedArray(t),c=!1,u=0;u<t;u++){var l=o.evaluateAt(a.exp(u+a.generatorBase));s[s.length-1-u]=l,0!==l&&(c=!0)}if(!c)return r;var d=new i.default(a,s),f=function(e,t,r,n){var i;t.degree()<r.degree()&&(t=(i=[r,t])[0],r=i[1]);for(var a=t,o=r,s=e.zero,c=e.one;o.degree()>=n/2;){var u=a,l=s;if(s=c,(a=o).isZero())return null;o=u;for(var d=e.zero,f=a.getCoefficient(a.degree()),p=e.inverse(f);o.degree()>=a.degree()&&!o.isZero();){var h=o.degree()-a.degree(),g=e.multiply(o.getCoefficient(o.degree()),p);d=d.addOrSubtract(e.buildMonomial(h,g)),o=o.addOrSubtract(a.multiplyByMonomial(h,g))}if(c=d.multiplyPoly(s).addOrSubtract(l),o.degree()>=a.degree())return null}var m=c.getCoefficient(0);if(0===m)return null;var y=e.inverse(m);return[c.multiply(y),o.multiply(y)]}(a,a.buildMonomial(t,1),d,t);if(null===f)return null;var p=function(e,t){var r=t.degree();if(1===r)return[t.getCoefficient(1)];for(var n=new Array(r),i=0,a=1;a<e.size&&i<r;a++)0===t.evaluateAt(a)&&(n[i]=e.inverse(a),i++);return i!==r?null:n}(a,f[0]);if(null==p)return null;for(var h=function(e,t,r){for(var i=r.length,a=new Array(i),o=0;o<i;o++){for(var s=e.inverse(r[o]),c=1,u=0;u<i;u++)o!==u&&(c=e.multiply(c,n.addOrSubtractGF(1,e.multiply(r[u],s))));a[o]=e.multiply(t.evaluateAt(s),e.inverse(c)),0!==e.generatorBase&&(a[o]=e.multiply(a[o],s))}return a}(a,f[1],p),g=0;g<p.length;g++){var m=r.length-1-a.log(p[g]);if(m<0)return null;r[m]=n.addOrSubtractGF(r[m],h[g])}return r}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.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,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);function i(e,t,r,n){var i=e.x-t.x+r.x-n.x,a=e.y-t.y+r.y-n.y;if(0===i&&0===a)return{a11:t.x-e.x,a12:t.y-e.y,a13:0,a21:r.x-t.x,a22:r.y-t.y,a23:0,a31:e.x,a32:e.y,a33:1};var o=t.x-r.x,s=n.x-r.x,c=t.y-r.y,u=n.y-r.y,l=o*u-s*c,d=(i*u-s*a)/l,f=(o*a-i*c)/l;return{a11:t.x-e.x+d*t.x,a12:t.y-e.y+d*t.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}}t.extract=function(e,t){for(var r,a,o=(a=function(e,t,r,n){var a=i({x:3.5,y:3.5},t,r,n);return{a11:a.a22*a.a33-a.a23*a.a32,a12:a.a13*a.a32-a.a12*a.a33,a13:a.a12*a.a23-a.a13*a.a22,a21:a.a23*a.a31-a.a21*a.a33,a22:a.a11*a.a33-a.a13*a.a31,a23:a.a13*a.a21-a.a11*a.a23,a31:a.a21*a.a32-a.a22*a.a31,a32:a.a12*a.a31-a.a11*a.a32,a33:a.a11*a.a22-a.a12*a.a21}}(0,{x:t.dimension-3.5,y:3.5},{x:t.dimension-6.5,y:t.dimension-6.5},{x:3.5,y:t.dimension-3.5}),{a11:(r=i(t.topLeft,t.topRight,t.alignmentPattern,t.bottomLeft)).a11*a.a11+r.a21*a.a12+r.a31*a.a13,a12:r.a12*a.a11+r.a22*a.a12+r.a32*a.a13,a13:r.a13*a.a11+r.a23*a.a12+r.a33*a.a13,a21:r.a11*a.a21+r.a21*a.a22+r.a31*a.a23,a22:r.a12*a.a21+r.a22*a.a22+r.a32*a.a23,a23:r.a13*a.a21+r.a23*a.a22+r.a33*a.a23,a31:r.a11*a.a31+r.a21*a.a32+r.a31*a.a33,a32:r.a12*a.a31+r.a22*a.a32+r.a32*a.a33,a33:r.a13*a.a31+r.a23*a.a32+r.a33*a.a33}),s=n.BitMatrix.createEmpty(t.dimension,t.dimension),c=function(e,t){var r=o.a13*e+o.a23*t+o.a33;return{x:(o.a11*e+o.a21*t+o.a31)/r,y:(o.a12*e+o.a22*t+o.a32)/r}},u=0;u<t.dimension;u++)for(var l=0;l<t.dimension;l++){var d=c(l+.5,u+.5);s.set(l,u,e.get(Math.floor(d.x),Math.floor(d.y)))}return{matrix:s,mappingFunction:c}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))};function i(e){return e.reduce((function(e,t){return e+t}))}function a(e,t,r,i){var a,o,s,c,u=[{x:Math.floor(e.x),y:Math.floor(e.y)}],l=Math.abs(t.y-e.y)>Math.abs(t.x-e.x);l?(a=Math.floor(e.y),o=Math.floor(e.x),s=Math.floor(t.y),c=Math.floor(t.x)):(a=Math.floor(e.x),o=Math.floor(e.y),s=Math.floor(t.x),c=Math.floor(t.y));for(var d=Math.abs(s-a),f=Math.abs(c-o),p=Math.floor(-d/2),h=a<s?1:-1,g=o<c?1:-1,m=!0,y=a,v=o;y!==s+h;y+=h){var b=l?v:y,C=l?y:v;if(r.get(b,C)!==m&&(m=!m,u.push({x:b,y:C}),u.length===i+1))break;if((p+=f)>0){if(v===c)break;v+=g,p-=d}}for(var E=[],w=0;w<i;w++)u[w]&&u[w+1]?E.push(n(u[w],u[w+1])):E.push(0);return E}function o(e,t,r,n){var i,o=t.y-e.y,s=t.x-e.x,c=a(e,t,r,Math.ceil(n/2)),u=a(e,{x:e.x-s,y:e.y-o},r,Math.ceil(n/2)),l=c.shift()+u.shift()-1;return(i=u.concat(l)).concat.apply(i,c)}function s(e,t){var r=i(e)/i(t),n=0;return t.forEach((function(t,i){n+=Math.pow(e[i]-t*r,2)})),{averageSize:r,error:n}}function c(e,t,r){try{var n=o(e,{x:-1,y:e.y},r,t.length),i=o(e,{x:e.x,y:-1},r,t.length),a=o(e,{x:Math.max(0,e.x-e.y)-1,y:Math.max(0,e.y-e.x)-1},r,t.length),c=o(e,{x:Math.min(r.width,e.x+e.y)+1,y:Math.min(r.height,e.y+e.x)+1},r,t.length),u=s(n,t),l=s(i,t),d=s(a,t),f=s(c,t),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,t){for(var r=Math.round(t.x);e.get(r,Math.round(t.y));)r--;for(var n=Math.round(t.x);e.get(n,Math.round(t.y));)n++;for(var i=(r+n)/2,a=Math.round(t.y);e.get(Math.round(i),a);)a--;for(var o=Math.round(t.y);e.get(Math.round(i),o);)o++;return{x:i,y:(a+o)/2}}function l(e,t,r,a,s){var u,l,d;try{u=function(e,t,r,a){var s=(i(o(e,r,a,5))/7+i(o(e,t,a,5))/7+i(o(r,e,a,5))/7+i(o(t,e,a,5))/7)/4;if(s<1)throw new Error("Invalid module size");var c=Math.round(n(e,t)/s),u=Math.round(n(e,r)/s),l=Math.floor((c+u)/2)+7;switch(l%4){case 0:l++;break;case 2:l--}return{dimension:l,moduleSize:s}}(a,r,s,e),l=u.dimension,d=u.moduleSize}catch(e){return null}var f=r.x-a.x+s.x,p=r.y-a.y+s.y,h=(n(a,s)+n(a,r))/2/d,g=1-3/h,m={x:a.x+g*(f-a.x),y:a.y+g*(p-a.y)},y=t.map((function(t){var r=(t.top.startX+t.top.endX+t.bottom.startX+t.bottom.endX)/4,a=(t.top.y+t.bottom.y+1)/2;if(e.get(Math.floor(r),Math.floor(a)))return i([t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1]),{x:r,y:a,score:c({x:Math.floor(r),y:Math.floor(a)},[1,1,1],e)+n({x:r,y:a},m)}})).filter((function(e){return!!e})).sort((function(e,t){return e.score-t.score}));return{alignmentPattern:h>=15&&y.length?y[0]:m,dimension:l}}t.locate=function(e){for(var t=[],r=[],a=[],o=[],s=function(n){for(var s=0,c=!1,u=[0,0,0,0,0],l=function(t){var a=e.get(t,n);if(a===c)s++;else{u=[u[1],u[2],u[3],u[4],s],s=1,c=a;var l=i(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&&!a,f=i(u.slice(-3))/3,p=Math.abs(u[2]-f)<f&&Math.abs(u[3]-f)<f&&Math.abs(u[4]-f)<f&&a;if(d){var h=t-u[3]-u[4],g=h-u[2],m={startX:g,endX:h,y:n};(y=r.filter((function(e){return g>=e.bottom.startX&&g<=e.bottom.endX||h>=e.bottom.startX&&g<=e.bottom.endX||g<=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?y[0].bottom=m:r.push({top:m,bottom:m})}if(p){var y,v=t-u[4],b=v-u[3];m={startX:b,y:n,endX:v},(y=o.filter((function(e){return b>=e.bottom.startX&&b<=e.bottom.endX||v>=e.bottom.startX&&b<=e.bottom.endX||b<=e.bottom.startX&&v>=e.bottom.endX&&u[2]/(e.bottom.endX-e.bottom.startX)<1.5&&u[2]/(e.bottom.endX-e.bottom.startX)>.5}))).length>0?y[0].bottom=m:o.push({top:m,bottom:m})}}},d=-1;d<=e.width;d++)l(d);t.push.apply(t,r.filter((function(e){return e.bottom.y!==n&&e.bottom.y-e.top.y>=2}))),r=r.filter((function(e){return e.bottom.y===n})),a.push.apply(a,o.filter((function(e){return e.bottom.y!==n}))),o=o.filter((function(e){return e.bottom.y===n}))},d=0;d<=e.height;d++)s(d);t.push.apply(t,r.filter((function(e){return e.bottom.y-e.top.y>=2}))),a.push.apply(a,o);var f=t.filter((function(e){return e.bottom.y-e.top.y>=2})).map((function(t){var r=(t.top.startX+t.top.endX+t.bottom.startX+t.bottom.endX)/4,n=(t.top.y+t.bottom.y+1)/2;if(e.get(Math.round(r),Math.round(n))){var a=[t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1],o=i(a)/a.length;return{score:c({x:Math.round(r),y:Math.round(n)},[1,1,3,1,1],e),x:r,y:n,size:o}}})).filter((function(e){return!!e})).sort((function(e,t){return e.score-t.score})).map((function(e,t,r){if(t>4)return null;var n=r.filter((function(e,r){return t!==r})).map((function(t){return{x:t.x,y:t.y,score:t.score+Math.pow(t.size-e.size,2)/e.size,size:t.size}})).sort((function(e,t){return e.score-t.score}));if(n.length<2)return null;var i=e.score+n[0].score+n[1].score;return{points:[e].concat(n.slice(0,2)),score:i}})).filter((function(e){return!!e})).sort((function(e,t){return e.score-t.score}));if(0===f.length)return null;var p=function(e,t,r){var i,a,o,s,c,u,l,d=n(e,t),f=n(t,r),p=n(e,r);return f>=d&&f>=p?(c=(i=[t,e,r])[0],u=i[1],l=i[2]):p>=f&&p>=d?(c=(a=[e,t,r])[0],u=a[1],l=a[2]):(c=(o=[e,r,t])[0],u=o[1],l=o[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,g=p.topLeft,m=p.bottomLeft,y=l(e,a,h,g,m),v=[];y&&v.push({alignmentPattern:{x:y.alignmentPattern.x,y:y.alignmentPattern.y},bottomLeft:{x:m.x,y:m.y},dimension:y.dimension,topLeft:{x:g.x,y:g.y},topRight:{x:h.x,y:h.y}});var b=u(e,h),C=u(e,g),E=u(e,m),w=l(e,a,b,C,E);return w&&v.push({alignmentPattern:{x:w.alignmentPattern.x,y:w.alignmentPattern.y},bottomLeft:{x:E.x,y:E.y},topLeft:{x:C.x,y:C.y},topRight:{x:b.x,y:b.y},dimension:w.dimension}),0===v.length?null:v}}]).default},e.exports=r()})));function cZ(e){return uZ.apply(this,arguments)}function uZ(){return(uZ=Hz(regeneratorRuntime.mark((function e(t){var r,n,i,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.imageData,n=t.canvas,(i=r)||(a=n.getContext("2d"),i=a.getImageData(0,0,n.width,n.height)),!(o=sZ(i.data,i.width,i.height,{inversionAttempts:"dontInvert"}))){e.next=6;break}return e.abrupt("return",o.data);case 6:return e.abrupt("return","");case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function lZ(e){return dZ.apply(this,arguments)}function dZ(){return(dZ=Hz(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.canvas,n=t.qrScannerResources,e.abrupt("return",new Promise((function(e){setTimeout((function(){return e("")}),1e3),rZ.scanImage(r,void 0,void 0,n.canvas).then(e).catch((function(){return e("")}))})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var fZ,pZ,hZ,gZ,mZ,yZ,vZ=function(){var e=Hz(regeneratorRuntime.mark((function e(t){var r,n,i,a,o,s,c,u,l,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.canvas,n=t.blackAndWhiteConverterResources,i=t.qrScannerResources,a=n.kernel,o=n.canvas,s=n.dst,c=window,u=c.cv,l="",d=u.imread(r),u.cvtColor(d,s,u.COLOR_RGBA2GRAY),u.filter2D(s,s,-1,a),u.imshow(o,s),e.next=10,cZ({canvas:o});case 10:if(l=e.sent){e.next=15;break}return e.next=14,lZ({canvas:o,qrScannerResources:i});case 14:l=e.sent;case 15:return d.delete(),e.abrupt("return",l);case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),bZ=function(){var e=Hz(regeneratorRuntime.mark((function e(t){var r,n,i,a,o,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.canvas,n=t.blob,i=t.qrScannerResources,a=t.blackAndWhiteConverterResources,o=r,!n){e.next=6;break}return e.next=5,uP.blobToCanvas({blob:n});case 5:o=e.sent;case 6:return s=o.getContext("2d"),e.next=9,cZ({imageData:s.getImageData(0,0,o.width,o.height)});case 9:if(c=e.sent){e.next=18;break}return e.next=13,lZ({canvas:o,qrScannerResources:i});case 13:if(c=e.sent){e.next=18;break}return e.next=17,vZ({canvas:o,blackAndWhiteConverterResources:a,qrScannerResources:i});case 17:c=e.sent;case 18:return e.abrupt("return",c);case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),CZ=function(){var e=Hz(regeneratorRuntime.mark((function e(){var t,r,n,i,a,o,s,c,u,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=l.length>0&&void 0!==l[0]?l[0]:{},r=t.blob,n=t.resultWarmup,i=t.enableValidation,a=void 0===i||i,o=n.qrScannerResources,s=n.blackAndWhiteConverterResources,c={},e.next=5,bZ({blob:r,qrScannerResources:o,blackAndWhiteConverterResources:s});case 5:return u=e.sent,a&&u&&(c=tZ(u)),e.abrupt("return",{result:u,validateResult:c});case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),EZ=function(e){var t=e.shouldStart,r=e.refVideo,n=e.cropArea,i=e.settings,a=e.onSessionTimeout,o=e.onCaptureDone,s=e.onAboutToTimeout,c=Jz(SC.useState(!1),2),u=c[0],l=c[1],d=SC.useRef((function(){})),f=SC.useRef((function(){})),p=vB.useSDKSettings().lang,h=function(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,i=e.settings,a=e.onResult,o=SC.useRef(null);null===o.current&&(o.current=document.createElement("canvas"));var s=SC.useRef(!1),c=SC.useRef(null),u=Jz(SC.useState(!1),2),l=u[0],d=u[1],f=SC.useRef({}),p=vB.useSDKSettings().customUrls;SC.useEffect((function(){function e(){return(e=Hz(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l){e.next=5;break}return e.next=3,oZ(p);case 3:f.current=e.sent,d(!0);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[l,p]);var h=SC.useCallback((function(){!0===s.current&&(s.current=!1)}),[]),g=SC.useCallback(Hz(regeneratorRuntime.mark((function e(){var r,n,u,d,p,g,m,y,v,b,C,E,w,k;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l&&i&&!s.current){e.next=2;break}return e.abrupt("return");case 2:r=f.current,n=r.qrScannerResources,u=r.blackAndWhiteConverterResources,d=c.current,p=t.current,s.current=!0,g=d.cropX,m=d.cropY,y=d.cropWidth,v=d.cropHeight,(b=o.current).width=y,b.height=v,C=b.getContext("2d");case 11:return C.drawImage(p,g,m,y,v,0,0,y,v),e.next=15,bZ({canvas:b,qrScannerResources:n,blackAndWhiteConverterResources:u});case 15:if(!(E=e.sent)){e.next=23;break}return h(),w=tZ(E),e.next=21,V_.takePicture({canvas:o.current});case 21:k=e.sent,a({result:E,validateResult:w,image:{blob:k}});case 23:if(s.current){e.next=25;break}return e.abrupt("break",27);case 25:e.next=11;break;case 27:case"end":return e.stop()}}),e)}))),[t,i,l,a,h]);SC.useEffect((function(){var e=t.current;function i(){return(i=Hz(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c.current=V_.analyzeVideoAndWindowSizes(e,n,0),t.next=3,g();case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}l&&r&&n&&function(){i.apply(this,arguments)}()}),[r,n,t,h,g,l]);var m=SC.useCallback((function(){h()}),[h]);return SC.useEffect((function(){return m}),[m]),{refWorkingCanvas:o,stopCheckFrame:h,checkFrame:g,warmupDone:l}}({refVideo:r,shouldStart:t,cropArea:n,settings:i,onResult:SC.useCallback((function(){d.current.apply(d,arguments)}),[])}),g=h.stopCheckFrame,m=h.checkFrame,y=h.warmupDone,v=s$({refVideo:r,shouldStart:t&&y,cropArea:n,settings:i}),b=v.stopCheckFrame,C=v.refRecordedVideos,E=v.splitVideos,w=v.resetRecordedVideos,k=v.checkFrame;d.current=SC.useCallback((function(e){l(!0),b(),g(),f.current(),o(Yz(Yz({},e),{},{recordedVideos:C.current})),l(!1)}),[b,o,C,g]);var S=SC.useCallback((function(){b(),g(),w(),a()}),[w,b,g,a]),B=SC.useCallback((function(){E()}),[E]),T=d$({lang:p,onAboutToTimeout:s,onSessionTimeout:S,onVideoTimeLimitReached:B,settings:i,shouldStartTimers:t&&y,sessionTime:null==i?void 0:i.scanQrLimitTimeSecond}),A=T.stopTimers,I=T.startTimers;return f.current=A,{isProcessing:u,restartSession:SC.useCallback(Hz(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return I(),e.next=3,Promise.all([k(),m()]);case 3:case"end":return e.stop()}}),e)}))),[k,m,I]),refRecordedVideos:C,warmupDone:y}};function wZ(e){var t=e.windowAndVideoInfo,r=e.onUISpacingChange,n=e.refVideo,i=e.settings,a=e.onCaptureDone,o=Jz(SC.useState(null),2),s=o[0],c=o[1],u=d_.useAsset("qr_capture_cursor.png"),l=Jz(SC.useState({}),2),d=l[0],f=l[1],p=d.yTooltip,h=d.yMessage,g=vB.useSDKSettings().lang,m=_Y(),y=m.showPopup,v=m.popupShown,b=m.popupType,C=Jz(SC.useState(!1),2),E=C[0],w=C[1],k=Jz(SC.useState(null),2),S=k[0],B=k[1],T=d_.useAsset("ic_loading.png");SC.useEffect((function(){y({popupType:NY})}),[y]),SC.useEffect((function(){if(t){var e=t.videoAreaWidth,n=t.lostX,i=t.lostY,a=vK.isMobile?Math.min(e-6,220):220,o=a,s=i+10,u=s+90,l=u+40,d=l+o+20,p=Math.floor((e-a)/2)+n;c({x:p,y:l,width:a,height:o,surroundStyle:{opacity:.6,background:"#000"}});var h={yTitle:s,yTooltip:d,yMessage:u};f(h),r(h)}}),[t,r]);var A=SC.useCallback((function(){B(""),a()}),[a]),I=SC.useCallback((function(e){var t=e.validateResult.valid;B(""),t?a(e):y({popupType:RY})}),[y,a]),_=SC.useCallback((function(e){var t=e.curTimeLeft;B(pQ(E$.REMAINING_TIME[g])({x:t}))}),[g]),x=EZ({shouldStart:E,refVideo:n,cropArea:s,settings:i,onSessionTimeout:A,onCaptureDone:I,onAboutToTimeout:_}),P=x.isProcessing,R=x.restartSession,N=x.warmupDone,O=SC.useCallback((function(){y({popupType:null})}),[y]),L=SC.useCallback(Hz(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return O(),e.next=3,R();case 3:case"end":return e.stop()}}),e)}))),[R,O]),D=SC.useCallback((function(){O(),a()}),[O,a]),U=SC.useCallback((function(){O(),setTimeout((function(){w(!0)}),200)}),[O]);return SC.createElement(SC.Fragment,null,!N&&SC.createElement(EW,{contentStyle:{maxWidth:"300px"}}),s&&SC.createElement(WK,{x:"".concat(s.x,"px"),y:"".concat(s.y,"px"),width:"".concat(s.width,"px"),height:"".concat(s.height,"px"),surroundStyle:s.surroundStyle},SC.createElement("div",null,SC.createElement("img",{src:u,width:s.width,height:s.height,alt:""}))),SC.createElement(b$,{y:"".concat(p,"px")},E$.QR_TOOLTIP[g]),S&&SC.createElement(C$,{key:S,className:"message",y:"".concat(h,"px")},S),P&&SC.createElement(pY,null,SC.createElement("img",{src:T,alt:"",className:"spin"})),SC.createElement(rW,{contentStyle:{maxWidth:"332px"},open:v},b===RY&&SC.createElement(O$,{onRetry:L,onSkip:D}),b===xY&&SC.createElement(M$,{onRetry:L,onSkip:D}),b===NY&&SC.createElement(J$,{onClickStart:U,onTimeout:U})))}wZ.propTypes={windowAndVideoInfo:SE.shape({}),onUISpacingChange:SE.func,refVideo:SE.shape({}),settings:SE.shape({}),onCaptureDone:SE.func},wZ.defaultProps={windowAndVideoInfo:{},onUISpacingChange:function(){},refVideo:{},settings:{},onCaptureDone:function(){}};var kZ,SZ,BZ,TZ,AZ,IZ={SUCCESS:"SUCCESS",WARNING:"WARNING"},_Z=(Gz(fZ={},IZ.SUCCESS,"52,206,95"),Gz(fZ,IZ.WARNING,"255,148,50"),fZ),xZ=(Gz(pZ={},IZ.SUCCESS,"✓"),Gz(pZ,IZ.WARNING,"!"),pZ),PZ=cB.div(hZ||(hZ=Zz(["\n font-weight: normal;\n"]))),RZ=cB.div(gZ||(gZ=Zz(["\n height: 2px;\n width: 100%;\n background: ",";\n"])),(function(e){return GS(["linear-gradient(to right,rgba(",",0),rgba(",",1),rgba(",",0));"],_Z[e.type],_Z[e.type],_Z[e.type])})),NZ=cB.div(mZ||(mZ=Zz(["\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 GS(["rgb(",")"],_Z[e.type])})),OZ=cB.div(yZ||(yZ=Zz(["\n display: flex;\n justify-content: center;\n align-items: center;\n margin: 10px 0;\n"]))),LZ=function(e){var t=e.children,r=e.type,n=e.className;return SC.createElement(PZ,{className:n},SC.createElement(RZ,{type:r}),SC.createElement(OZ,null,SC.createElement(NZ,{type:r},xZ[r]),t),SC.createElement(RZ,{type:r}))};LZ.propTypes={children:SE.node,type:SE.string,className:SE.string},LZ.defaultProps={children:null,type:IZ.SUCCESS,className:""};var DZ=cB.div(kZ||(kZ=Zz(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),UZ=cB.div(SZ||(SZ=Zz(["\n text-align: center;\n font-size: 1rem;\n color: #ea3223;\n margin-top: 10px;\n"]))),MZ=cB.button(BZ||(BZ=Zz(["\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})),VZ=cB.img(TZ||(TZ=Zz(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),jZ=cB.div(AZ||(AZ=Zz(["\n margin: 20px 0;\n width: 100%;\n display: flex;\n justify-content: space-evenly;\n gap: 10px;\n"]))),FZ=function(e){var t=e.imageTaken,r=e.onConfirm,n=e.onTryAgain,i=e.error,a=e.hasValidQR,o=Jz(SC.useState(null),2),s=o[0],c=o[1],u=vB.useSDKSettings().lang;return SC.useEffect((function(){var e;return t&&(e=URL.createObjectURL(t.blob),c(e)),function(){URL.revokeObjectURL(e)}}),[t]),SC.createElement(DZ,null,null!==a&&SC.createElement(w$,{mb:"20px"},SC.createElement("div",null,SC.createElement(LZ,{type:a?IZ.SUCCESS:IZ.WARNING},a?kY.CONFIRM_POPUP_VALID_QR[u]:kY.CONFIRM_POPUP_INVALID_QR[u]))),SC.createElement(W$,{ratio:1.5},SC.createElement(VZ,{src:s})),i&&SC.createElement(UZ,{className:"confirm-popup-error-message"},i.msg[u]),SC.createElement(jZ,null,SC.createElement(MZ,{onClick:n},kY.BTN_TRY_AGAIN[u]),SC.createElement(MZ,{onClick:r},kY.BTN_USE_THIS_PICTURE[u])))};FZ.propTypes={imageTaken:SE.shape({}),error:SE.shape({msg:SE.shape({})}),onConfirm:SE.func,onTryAgain:SE.func,hasValidQR:SE.bool},FZ.defaultProps={imageTaken:null,error:null,onConfirm:function(){},onTryAgain:function(){},hasValidQR:null};var zZ={tsBlue:"#0276f1",tsSecondary:"rgba(0, 47, 117, 0.6)"},KZ=function(){this.__data__=new LQ,this.size=0},qZ=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},HZ=function(e){return this.__data__.get(e)},QZ=function(e){return this.__data__.has(e)},GZ=function(e,t){var r=this.__data__;if(r instanceof LQ){var n=r.__data__;if(!DQ||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new HQ(n)}return r.set(e,t),this.size=r.size,this};function WZ(e){var t=this.__data__=new LQ(e);this.size=t.size}WZ.prototype.clear=KZ,WZ.prototype.delete=qZ,WZ.prototype.get=HZ,WZ.prototype.has=QZ,WZ.prototype.set=GZ;var XZ,YZ=WZ,$Z=function(e,t,r){(void 0!==r&&!Fq(e[t],r)||void 0===r&&!(t in e))&&jq(e,t,r)},ZZ=function(e,t,r){for(var n=-1,i=Object(e),a=r(e),o=a.length;o--;){var s=a[++n];if(!1===t(i[s],s,i))break}return e},JZ=aK((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,i=n&&n.exports===r?eq.Buffer:void 0,a=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=a?a(r):new e.constructor(r);return e.copy(n),n}})),eJ=eq.Uint8Array,tJ=function(e){var t=new e.constructor(e.byteLength);return new eJ(t).set(new eJ(e)),t},rJ=function(e,t){var r=t?tJ(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)},nJ=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t},iJ=Object.create,aJ=function(){function e(){}return function(t){if(!$K(t))return{};if(iJ)return iJ(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),oJ=function(e){return"function"!=typeof e.constructor||SH(e)?{}:aJ(PH(e))},sJ=function(e){return fq(e)&&tH(e)},cJ=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]},uJ=function(e){return qq(e,IH(e))},lJ=function(e,t,r,n,i,a,o){var s=cJ(e,r),c=cJ(t,r),u=o.get(c);if(u)$Z(e,r,u);else{var l=a?a(s,c,r+"",e,t,o):void 0,d=void 0===l;if(d){var f=fH(c),p=!f&&hH(c),h=!f&&!p&&CH(c);l=c,f||p||h?fH(s)?l=s:sJ(s)?l=nJ(s):p?(d=!1,l=JZ(c,!0)):h?(d=!1,l=rJ(c,!0)):l=[]:UH(c)||dH(c)?(l=s,dH(s)?l=uJ(s):$K(s)&&!Sq(s)||(l=oJ(c))):d=!1}d&&(o.set(c,l),i(l,c,n,a,o),o.delete(c)),$Z(e,r,l)}},dJ=function e(t,r,n,i,a){t!==r&&ZZ(r,(function(o,s){if(a||(a=new YZ),$K(o))lJ(t,r,s,n,e,i,a);else{var c=i?i(cJ(t,s),o,s+"",t,r,a):void 0;void 0===c&&(c=o),$Z(t,s,c)}}),IH)},fJ=aH((function(e,t,r){dJ(e,t,r)})),pJ={data:{settings:{sdk_settings:{id_detection_settings:{auto_capture:{enable:!0,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,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}}}}}};function hJ(e){var t=e.clientSettings,r=Jz(SC.useState(null),2),n=r[0],i=r[1];return SC.useEffect((function(){var e=fJ(pJ,t),r=eG(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.enable"),n=eG(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.frames_interval_ms"),a=eG(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.quality_web"),o=eG(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.enable"),s=eG(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.limit_time_second"),c=eG(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.video_partial_length_seconds"),u=eG(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.enable"),l=eG(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.wait_for_best_image_time_ms_web"),d=eG(e,"data.settings.sdk_settings.id_detection_settings.blur_check.enable"),f=eG(e,"data.settings.sdk_settings.id_detection_settings.blur_check.threshold_web"),p=eG(e,"data.settings.sdk_settings.id_detection_settings.disable_capture_button_if_alert"),h=eG(e,"data.settings.sdk_settings.id_detection_settings.id_detection.enable"),g=eG(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.enable"),m=eG(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.limit_time_second");i({enableRecording:r,frameCaptureIntervalMs:n,idCardSessionTime:s,maxRecordingTimePerVideo:c,saveFrameQuality:a,enableTimers:o,enableAutoCapture:u,waitForBestImageTimeMs:l,enableBlurCheck:d,blurThreshold:f,disableCaptureButtonIfAlert:p,enableIdDetection:h,enableScanQr:g,scanQrLimitTimeSecond:m})}),[t]),{settings:n}}var gJ=lB(XZ||(XZ=Zz(["\n .text-primary {\n color: ",";\n }\n"])),(function(e){return e.theme.tsBlue})),mJ=hB.IDCardSide,yJ=hB.IDCardType,vJ=hB.Errors,bJ={ID_CARD:"id_card",QR_CODE:"qr_code"},CJ=[{scannerType:bJ.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:hB.IDCardSide.FRONT,cardType:yJ.VN,frontCamera:!1,enableConfirmPopup:!0},{scannerType:bJ.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:hB.IDCardSide.BACK,cardType:yJ.VN,frontCamera:!1,enableConfirmPopup:!0}],EJ={scannerType:bJ.QR_CODE,title:"Quét mã QR trên CCCD",frontCamera:!1};function wJ(e){var t=e.onClose,r=e.onError,n=e.clientSettings,i=e.detectIdCard,a=e.onStepDone,o=e.steps,s=e.outputEncryptionSettings,c=Jz(SC.useState(0),2),u=c[0],l=c[1],d=Jz(SC.useState(o[u]),2),f=d[0],p=d[1],h=SC.useRef(null),g=Jz(SC.useState(null),2),m=g[0],y=g[1],v=Jz(SC.useState(!1),2),b=v[0],C=v[1],E=Jz(SC.useState(0),2),w=E[0],k=E[1],S=SC.useRef(),B=f.scannerType,T=f.frontCamera,A=f.title,I=f.titleIcon,_=f.cardSide,x=f.description,P=f.usePortraitMask,R=f.cardType,N=f.enableConfirmPopup,O=_===mJ.FRONT,L=d_.useAsset(I),D=_Y(),U=D.showPopup,M=D.popupShown,V=D.popupType,j=D.props,F=Jz(SC.useState(!1),2),z=F[0],K=F[1],q=d_.useAsset("ic_loading.png"),H=SC.useRef({}),Q=SC.useRef(null),G=SC.useRef([]),W=hJ({clientSettings:n}).settings,X=Jz(SC.useState({}),2),Y=X[0],$=X[1],Z=Y.yTitle,J=SC.useCallback((function(e){y(e),C(!0)}),[]);SC.useEffect((function(){C(!1)}),[T]);var ee=SC.useCallback((function(){U({popupType:null})}),[U]),te=SC.useCallback((function(e){e>=o.length||setTimeout((function(){l(e),p(o[e])}),200)}),[o]),re=SC.useCallback((function(){te(u+1)}),[te,u]),ne=SC.useCallback((function(){setTimeout((function(){p((function(e){return Yz(Yz({},EJ),{},{enableConfirmPopup:e.enableConfirmPopup})}))}),200)}),[]),ie=SC.useCallback(Hz(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={stepNumber:u,image:H.current,recordedVideos:null!=W&&W.enableRecording?G.current:[]},B===bJ.QR_CODE&&(t.qrScannedResult=Q.current),K(!0),e.next=5,a(t);case 5:K(!1),re();case 7:case"end":return e.stop()}}),e)}))),[W,u,a,re,B]),ae=SC.useCallback((function(){ee(),B===bJ.QR_CODE?te(u):B===bJ.ID_CARD&&S.current.restartSession()}),[te,u,ee,B]),oe=SC.useCallback((function(){ee(),ie()}),[ie,ee]),se=SC.useCallback(function(){var e=Hz(regeneratorRuntime.mark((function e(t){var n,a,o,s,c,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.image,a=t.error,o=t.recordedVideos,H.current=n,G.current=o,k((function(e){return e+1})),_!==hB.IDCardSide.FRONT){e.next=23;break}if(!W.enableScanQr||!vK.isMobile){e.next=23;break}if(c=null==n||null===(s=n.detectedCard)||void 0===s?void 0:s.label){e.next=20;break}return K(!0),e.prev=9,e.next=12,i({image:n,cardType:R,cardSide:_});case 12:u=e.sent,c=u.card_label,e.next=19;break;case 16:e.prev=16,e.t0=e.catch(9),r(vJ.detect_id_card_error);case 19:K(!1);case 20:if(!c||!"vn.cccd_new.front".includes(c)){e.next=23;break}return ne(),e.abrupt("return");case 23:N?U({popupType:PY,props:{imageTaken:H.current,error:a}}):ie();case 24:case"end":return e.stop()}}),e,null,[[9,16]])})));return function(t){return e.apply(this,arguments)}}(),[N,U,_,W,R,i,ie,ne,r]),ce=SC.useCallback((function(e){var t;if(Q.current=e,e){var r,n=e.recordedVideos;(r=G.current).push.apply(r,eK(n))}k((function(e){return e+1}));var i=Boolean(null==e||null===(t=e.validateResult)||void 0===t?void 0:t.valid);N?U({popupType:PY,props:{hasValidQR:i,imageTaken:H.current}}):ie()}),[U,N,ie]);return SC.createElement(aB,{theme:zZ},SC.createElement(lY,null,SC.createElement(zK,{key:T,frontCamera:T,onVideoPlayed:J,onClose:t,flipHorizontal:T,ref:h,onError:r},b&&SC.createElement(SC.Fragment,null,B===bJ.ID_CARD&&SC.createElement(h$,{key:u,ref:S,windowAndVideoInfo:m,refVideo:h,settings:W,onCaptureDone:se,onUISpacingChange:$,frontSide:O,description:x,usePortraitMask:P,outputEncryptionSettings:s}),B===bJ.QR_CODE&&SC.createElement(wZ,{key:u,refVideo:h,windowAndVideoInfo:m,settings:W,onCaptureDone:ce,onUISpacingChange:$})),SC.createElement(uY,{keyForTransition:w}),SC.createElement(gY,{y:"".concat(Z,"px")},SC.createElement(CX,null,SC.createElement(hX,{key:A,timeout:{enter:500,exit:500},classNames:"flipY",unmountOnExit:!0},SC.createElement(mY,null,I&&SC.createElement(dY,{src:L,alt:""}),SC.createElement(yY,{className:"title"},A))))),z&&SC.createElement(pY,null,SC.createElement("img",{src:q,alt:"",className:"spin"}))),SC.createElement(rW,{open:M},V===PY&&SC.createElement(FZ,Wz({},j,{onConfirm:oe,onTryAgain:ae})))),SC.createElement(gJ,null))}wJ.propTypes={onClose:SE.func,onError:SE.func,clientSettings:SE.shape({}),detectIdCard:SE.func,onStepDone:SE.func,steps:SE.arrayOf(SE.shape({})),outputEncryptionSettings:SE.shape({})},wJ.defaultProps={onClose:function(){},onError:function(){},clientSettings:{},detectIdCard:function(){return Promise.resolve({card_label:""})},onStepDone:function(){},steps:CJ,outputEncryptionSettings:null};var kJ=["tracking","clientSettings"];function SJ(e){var t=e.tracking,r=e.clientSettings,n=$z(e,kJ),i=SC.useMemo((function(){return eG(r,"data.settings.sdk_settings.server_log_settings.enable",null==t?void 0:t.enable)}),[r,t]);return SC.createElement(c_.SDKTrackingProvider,{value:{tracking:Yz(Yz({},t),{},{enable:i})}},SC.createElement(wJ,Wz({},n,{clientSettings:r})))}SJ.propTypes={tracking:SE.shape({}),clientSettings:SE.shape({})},SJ.defaultProps={tracking:void 0,clientSettings:void 0};var BJ=hB.IDCardSide,TJ=hB.Errors;function AJ(e){return IJ.apply(this,arguments)}function IJ(){return(IJ=Hz(regeneratorRuntime.mark((function e(t){var r,n,i,a,o,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.image,n=t.cardType,i=t.cardSide,a=t.apiClient,o=t.outputEncryptionSettings,s={label:"id_card.".concat(n,".").concat(i)},!o||!o.key){e.next=4;break}return e.abrupt("return",a.httpClient.post("/v1/images",Yz({base64:r.encrypted.hex},s),{"X-TV-Key":o.key}));case 4:return e.abrupt("return",a.uploadImage(Yz({file:r.blob},s)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _J(e){return xJ.apply(this,arguments)}function xJ(){return(xJ=Hz(regeneratorRuntime.mark((function e(t){var r,n,i,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.image,n=t.apiClient,i=t.rawString,a=t.outputEncryptionSettings,o={label:"qr_code",metadata:JSON.stringify({raw:i})},!a||!a.key){e.next=4;break}return e.abrupt("return",n.httpClient.post("/v1/images",Yz({base64:r.encrypted.hex},o),{"X-TV-Key":a.key}));case 4:return e.abrupt("return",n.uploadImage(Yz({file:r.blob},o)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function PJ(e){return RJ.apply(this,arguments)}function RJ(){return(RJ=Hz(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.imageId,n=t.cardType,i=t.apiClient,e.abrupt("return",i.requestVerifyIDCard({card_type:n,image1:{id:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function NJ(e){return OJ.apply(this,arguments)}function OJ(){return(OJ=Hz(regeneratorRuntime.mark((function e(t){var r,n,i,a,o,s,c,u,l,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.apiClient,n=t.cardType,i=t.frontCardId,a=t.isCapturingFrontSide,o=t.backCardId,s=t.recordedVideos,c=t.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 r.fileService.request({frames:e.frames})})));case 5:return d=e.sent,f={card_type:n,image:{id:i},image2:a?void 0:{id:o},videos:[].concat(eK(u.map((function(e){return{id:e.id}}))),eK(d.map((function(e){return{id:e.data.file_id}}))))},c&&(f.qr1_images=[{id:c}]),e.abrupt("return",r.detectIDTampering(f));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function LJ(e){return DJ.apply(this,arguments)}function DJ(){return(DJ=Hz(regeneratorRuntime.mark((function e(t){var r,n,i,a,o,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.cardType,n=t.apiClient,i=t.frontCardId,a=t.backCardId,o=t.isCapturingFrontSide,s=t.qrImageId,c={card_type:r,image1:o?{id:i}:{id:a}},s&&(c.qr1_images=[{id:s}]),e.abrupt("return",n.readIDCard(c));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function UJ(e){return MJ.apply(this,arguments)}function MJ(){return(MJ=Hz(regeneratorRuntime.mark((function e(t){var r,n,i,a,o,s,c,u,l,d,f,p,h,g,m,y,v,b,C,E,w,k,S,B;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.image,i=t.frontCardId,a=t.qrImageId,o=t.onError,s=t.recordedVideos,c=t.apiClient,u=t.cardType,l=t.cardSide,d=t.qrScannedResult,f=t.outputEncryptionSettings,l!==BJ.BACK||i){e.next=4;break}return o(TJ.missing_front_id_card),e.abrupt("return");case 4:return p=[AJ({image:n,cardType:u,cardSide:l,apiClient:c,outputEncryptionSettings:f})],d&&p.push(_J({image:d.image,apiClient:c,rawString:d.result,outputEncryptionSettings:f})),e.next=8,Promise.all(p);case 8:if(h=e.sent,g=Jz(h,2),m=g[0],y=g[1],!m.errors){e.next=15;break}return o(Yz(Yz({},TJ.upload_error),{},{details:m.errors})),e.abrupt("return");case 15:return v=m.data.image_id,b=(null==y||null===(r=y.data)||void 0===r?void 0:r.image_id)||a,(w=l===BJ.FRONT)?C=v:(C=i,E=v),e.next=21,PJ({imageId:v,cardType:u,apiClient:c});case 21:if(!(k=e.sent).errors){e.next=25;break}return o(Yz(Yz({},TJ.sanity_check_error),{},{details:k.errors})),e.abrupt("return");case 25:return e.next=27,LJ({cardType:u,apiClient:c,frontCardId:C,backCardId:E,isCapturingFrontSide:w,qrImageId:b});case 27:if(!(S=e.sent).errors){e.next=31;break}return o(Yz(Yz({},TJ.read_id_card_error),{},{details:S.errors})),e.abrupt("return");case 31:return e.next=33,NJ({apiClient:c,cardType:u,frontCardId:C,isCapturingFrontSide:w,backCardId:E,recordedVideos:s,qrImageId:b});case 33:if(!(B=e.sent).errors){e.next=37;break}return o(Yz(Yz({},TJ.detect_id_tampering_error),{},{details:B.errors})),e.abrupt("return");case 37:return e.abrupt("return",{sanityResult:k.data,tamperingInfo:B.data,cardInfo:S.data,qrImageId:b});case 38:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var VJ=["onClose","onError","detectIdCard","steps","onStepDone","apiCredentials","tracking","outputEncryptionSettings"],jJ=hB.Errors,FJ=function(e){var t=e.onClose,r=e.onError,n=e.detectIdCard,i=e.steps,a=e.onStepDone,o=e.apiCredentials,s=e.tracking,c=e.outputEncryptionSettings,u=$z(e,VJ),l=Jz(SC.useState(null),2),d=l[0],f=l[1],p=kP.useApiClient({apiCredentials:o,tracking:s}).apiClient,h=SC.useRef(""),g=SC.useRef("");SC.useEffect((function(){function e(){return(e=Hz(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.clientSettings();case 2:t=e.sent,f(t);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[p]);var m=SC.useCallback(function(){var e=Hz(regeneratorRuntime.mark((function e(t){var n,o,s,u,l,d,f,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.stepNumber,o=t.recordedVideos,s=t.qrScannedResult,u=t.image,l=i[n],d=l.cardType,f=l.cardSide,m=null,e.prev=3,e.next=6,UJ({image:u,cardSide:f,frontCardId:h.current,qrImageId:g.current,onError:r,apiClient:p,cardType:d,recordedVideos:o,qrScannedResult:s,outputEncryptionSettings:c});case 6:m=e.sent,f===hB.IDCardSide.FRONT&&(h.current=m.cardInfo.image1.id),g.current=m.qrImageId,e.next=14;break;case 11:e.prev=11,e.t0=e.catch(3),r(Yz(Yz({},jJ.api_call_error),{},{details:e.t0}));case 14:m&&a(Yz(Yz({},t),{},{apiResult:m}));case 15:case"end":return e.stop()}}),e,null,[[3,11]])})));return function(t){return e.apply(this,arguments)}}(),[p,r,i,a,c]);return d&&SC.createElement(SJ,Wz({tracking:s,onClose:t,onError:r,detectIdCard:n,onStepDone:m,steps:i,outputEncryptionSettings:c},u,{clientSettings:d}))};FJ.propTypes={onClose:SE.func,onError:SE.func,detectIdCard:SE.func,onStepDone:SE.func,steps:SE.arrayOf(SE.shape({})),apiCredentials:SE.shape({accessKey:SE.string,secretKey:SE.string,apiUrl:SE.string}),tracking:SE.shape({}),outputEncryptionSettings:SE.shape({})},FJ.defaultProps={onClose:function(){},onError:function(){},detectIdCard:function(){return Promise.resolve({card_label:""})},onStepDone:function(){},steps:CJ,apiCredentials:{accessKey:"5767c20d-87aa-4cad-8dbb-f5429f76c34b",secretKey:"c1446919-e60a-4575-a05d-304318212a1b",apiUrl:"https://tv-testing.trustingsocial.com/api"},outputEncryptionSettings:{key:""},tracking:void 0};var zJ=function(){var e=Hz(regeneratorRuntime.mark((function e(t){var r,n,i,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.blob,n=t.resultWarmup,i=n.idCardModel,a=n.ableToUseModel){e.next=4;break}return e.abrupt("return",{ableToUseModel:a});case 4:return e.next=6,uP.blobToCanvas({blob:r});case 6:return o=e.sent,e.abrupt("return",i.predict(o,{detectThreshold:.3}));case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),KJ=AG,qJ=$z(zW,["useLivenessDetection"]);function HJ(){return(HJ=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function QJ(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}function GJ(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function WJ(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}function XJ(e,t){e.classList?e.classList.add(t):WJ(e,t)||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function YJ(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function $J(e,t){e.classList?e.classList.remove(t):"string"==typeof e.className?e.className=YJ(e.className,t):e.setAttribute("class",YJ(e.className&&e.className.baseVal||"",t))}var ZJ={disabled:!1},JJ=SC.createContext(null),e0="unmounted",t0="exited",r0="entering",n0="entered",i0="exiting",a0=function(e){function t(t,r){var n;n=e.call(this,t,r)||this;var i,a=r&&!r.isMounting?t.enter:t.appear;return n.appearStatus=null,t.in?a?(i=t0,n.appearStatus=r0):i=n0:i=t.unmountOnExit||t.mountOnEnter?e0:t0,n.state={status:i},n.nextCallback=null,n}GJ(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===e0?{status:t0}:null};var r=t.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(e){var t=null;if(e!==this.props){var r=this.state.status;this.props.in?r!==r0&&r!==n0&&(t=r0):r!==r0&&r!==n0||(t=i0)}this.updateStatus(!1,t)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var e,t,r,n=this.props.timeout;return e=t=r=n,null!=n&&"number"!=typeof n&&(e=n.exit,t=n.enter,r=void 0!==n.appear?n.appear:t),{exit:e,enter:t,appear:r}},r.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),t===r0?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&this.state.status===t0&&this.setState({status:e0})},r.performEnter=function(e){var t=this,r=this.props.enter,n=this.context?this.context.isMounting:e,i=this.props.nodeRef?[n]:[zz.findDOMNode(this),n],a=i[0],o=i[1],s=this.getTimeouts(),c=n?s.appear:s.enter;!e&&!r||ZJ.disabled?this.safeSetState({status:n0},(function(){t.props.onEntered(a)})):(this.props.onEnter(a,o),this.safeSetState({status:r0},(function(){t.props.onEntering(a,o),t.onTransitionEnd(c,(function(){t.safeSetState({status:n0},(function(){t.props.onEntered(a,o)}))}))})))},r.performExit=function(){var e=this,t=this.props.exit,r=this.getTimeouts(),n=this.props.nodeRef?void 0:zz.findDOMNode(this);t&&!ZJ.disabled?(this.props.onExit(n),this.safeSetState({status:i0},(function(){e.props.onExiting(n),e.onTransitionEnd(r.exit,(function(){e.safeSetState({status:t0},(function(){e.props.onExited(n)}))}))}))):this.safeSetState({status:t0},(function(){e.props.onExited(n)}))},r.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},r.setNextCallback=function(e){var t=this,r=!0;return this.nextCallback=function(n){r&&(r=!1,t.nextCallback=null,e(n))},this.nextCallback.cancel=function(){r=!1},this.nextCallback},r.onTransitionEnd=function(e,t){this.setNextCallback(t);var r=this.props.nodeRef?this.props.nodeRef.current:zz.findDOMNode(this),n=null==e&&!this.props.addEndListener;if(r&&!n){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[r,this.nextCallback],a=i[0],o=i[1];this.props.addEndListener(a,o)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},r.render=function(){var e=this.state.status;if(e===e0)return null;var t=this.props,r=t.children,n=(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,QJ(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return SC.createElement(JJ.Provider,{value:null},"function"==typeof r?r(e,n):SC.cloneElement(SC.Children.only(r),n))},t}(SC.Component);function o0(){}a0.contextType=JJ,a0.propTypes={},a0.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:o0,onEntering:o0,onEntered:o0,onExit:o0,onExiting:o0,onExited:o0},a0.UNMOUNTED=e0,a0.EXITED=t0,a0.ENTERING=r0,a0.ENTERED=n0,a0.EXITING=i0;var s0,c0,u0=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return XJ(e,t)}))},l0=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return $J(e,t)}))},d0=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(t=e.call.apply(e,[this].concat(n))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,r){var n=t.resolveArguments(e,r),i=n[0],a=n[1];t.removeClasses(i,"exit"),t.addClass(i,a?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,r)},t.onEntering=function(e,r){var n=t.resolveArguments(e,r),i=n[0],a=n[1]?"appear":"enter";t.addClass(i,a,"active"),t.props.onEntering&&t.props.onEntering(e,r)},t.onEntered=function(e,r){var n=t.resolveArguments(e,r),i=n[0],a=n[1]?"appear":"enter";t.removeClasses(i,a),t.addClass(i,a,"done"),t.props.onEntered&&t.props.onEntered(e,r)},t.onExit=function(e){var r=t.resolveArguments(e)[0];t.removeClasses(r,"appear"),t.removeClasses(r,"enter"),t.addClass(r,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var r=t.resolveArguments(e)[0];t.addClass(r,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var r=t.resolveArguments(e)[0];t.removeClasses(r,"exit"),t.addClass(r,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,r){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,r]},t.getClassNames=function(e){var r=t.props.classNames,n="string"==typeof r,i=n?""+(n&&r?r+"-":"")+e:r[e];return{baseClassName:i,activeClassName:n?i+"-active":r[e+"Active"],doneClassName:n?i+"-done":r[e+"Done"]}},t}GJ(t,e);var r=t.prototype;return r.addClass=function(e,t,r){var n=this.getClassNames(t)[r+"ClassName"],i=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===r&&i&&(n+=" "+i),"active"===r&&e&&e.scrollTop,n&&(this.appliedClasses[t][r]=n,u0(e,n))},r.removeClasses=function(e,t){var r=this.appliedClasses[t],n=r.base,i=r.active,a=r.done;this.appliedClasses[t]={},n&&l0(e,n),i&&l0(e,i),a&&l0(e,a)},r.render=function(){var e=this.props,t=(e.classNames,QJ(e,["classNames"]));return SC.createElement(a0,HJ({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(SC.Component);function f0(e,t){return e!==t&&(!SC.isValidElement(e)||!SC.isValidElement(t)||null==e.key||e.key!==t.key)}d0.defaultProps={classNames:""},d0.propTypes={};var p0={out:"out-in",in:"in-out"},h0=function(e,t,r){return function(){var n;e.props[t]&&(n=e.props)[t].apply(n,arguments),r()}},g0=((s0={})[p0.out]=function(e){var t=e.current,r=e.changeState;return SC.cloneElement(t,{in:!1,onExited:h0(t,"onExited",(function(){r(r0,null)}))})},s0[p0.in]=function(e){var t=e.current,r=e.changeState,n=e.children;return[t,SC.cloneElement(n,{in:!0,onEntered:h0(n,"onEntered",(function(){r(r0)}))})]},s0),m0=((c0={})[p0.out]=function(e){var t=e.children,r=e.changeState;return SC.cloneElement(t,{in:!0,onEntered:h0(t,"onEntered",(function(){r(n0,SC.cloneElement(t,{in:!0}))}))})},c0[p0.in]=function(e){var t=e.current,r=e.children,n=e.changeState;return[SC.cloneElement(t,{in:!1,onExited:h0(t,"onExited",(function(){n(n0,SC.cloneElement(r,{in:!0}))}))}),SC.cloneElement(r,{in:!0})]},c0),y0=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(t=e.call.apply(e,[this].concat(n))||this).state={status:n0,current:null},t.appeared=!1,t.changeState=function(e,r){void 0===r&&(r=t.state.current),t.setState({status:e,current:r})},t}GJ(t,e);var r=t.prototype;return r.componentDidMount=function(){this.appeared=!0},t.getDerivedStateFromProps=function(e,t){return null==e.children?{current:null}:t.status===r0&&e.mode===p0.in?{status:r0}:t.current&&f0(t.current,e.children)?{status:i0}:{current:SC.cloneElement(e.children,{in:!0})}},r.render=function(){var e,t=this.props,r=t.children,n=t.mode,i=this.state,a=i.status,o=i.current,s={children:r,current:o,changeState:this.changeState,status:a};switch(a){case r0:e=m0[n](s);break;case i0:e=g0[n](s);break;case n0:e=o}return SC.createElement(JJ.Provider,{value:{isMounting:!this.appeared}},e)},t}(SC.Component);y0.propTypes={},y0.defaultProps={mode:p0.out};var v0=s((function(e){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(e,t,r){var n={MOBILE:"mobile",TABLET:"tablet",SMART_TV:"smarttv",CONSOLE:"console",WEARABLE:"wearable",BROWSER:void 0};e.exports={BROWSER_TYPES:{CHROME:"Chrome",FIREFOX:"Firefox",OPERA:"Opera",YANDEX:"Yandex",SAFARI:"Safari",INTERNET_EXPLORER:"Internet Explorer",EDGE:"Edge",CHROMIUM:"Chromium",IE:"IE",MOBILE_SAFARI:"Mobile Safari",EDGE_CHROMIUM:"Edge Chromium"},DEVICE_TYPES:n,OS_TYPES:{IOS:"iOS",ANDROID:"Android",WINDOWS_PHONE:"Windows Phone",WINDOWS:"Windows",MAC_OS:"Mac OS"},defaultData:{isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1}}},function(e,t,r){var n,i=r(2),a=r(0),o=a.BROWSER_TYPES,s=a.OS_TYPES,c=a.DEVICE_TYPES,u=r(4),l=u.checkType,d=u.broPayload,f=u.mobilePayload,p=u.wearPayload,h=u.consolePayload,g=u.stvPayload,m=u.getNavigatorInstance,y=u.isIOS13Check,v=new i,b=v.getBrowser(),C=v.getDevice(),E=v.getEngine(),w=v.getOS(),k=v.getUA(),S=o.CHROME,B=o.CHROMIUM,T=o.IE,A=o.INTERNET_EXPLORER,I=o.OPERA,_=o.FIREFOX,x=o.SAFARI,P=o.EDGE,R=o.YANDEX,N=o.MOBILE_SAFARI,O=c.MOBILE,L=c.TABLET,D=c.SMART_TV,U=c.BROWSER,M=c.WEARABLE,V=c.CONSOLE,j=s.ANDROID,F=s.WINDOWS_PHONE,z=s.IOS,K=s.WINDOWS,q=s.MAC_OS,H=function(){return w.name===s.WINDOWS&&"10"===w.version&&("string"==typeof k&&-1!==k.indexOf("Edg/"))},Q=function(){return b.name===P},G=function(){return y("iPad")},W=C.type===D,X=C.type===V,Y=C.type===M,$=b.name===N||G(),Z=b.name===B,J=function(){switch(C.type){case O:case L:return!0;default:return!1}}()||G(),ee=C.type===O,te=C.type===L||G(),re=C.type===U,ne=w.name===j,ie=w.name===F,ae=w.name===z||G(),oe=b.name===S,se=b.name===_,ce=b.name===x||b.name===N,ue=b.name===I,le=b.name===A||b.name===T,de=w.version?w.version:"none",fe=w.name?w.name:"none",pe=b.major,he=b.version,ge=b.name,me=C.vendor?C.vendor:"none",ye=C.model?C.model:"none",ve=E.name,be=E.version,Ce=k,Ee=Q()||H(),we=b.name===R,ke=C.type,Se=(n=m())&&(/iPad|iPhone|iPod/.test(n.platform)||"MacIntel"===n.platform&&n.maxTouchPoints>1)&&!window.MSStream,Be=G(),Te=y("iPhone"),Ae=y("iPod"),Ie=function(){var e=m(),t=e&&e.userAgent.toLowerCase();return"string"==typeof t&&/electron/.test(t)}(),_e=H(),xe=Q(),Pe=w.name===K,Re=w.name===q,Ne=l(C.type);e.exports={deviceDetect:function(){var e=Ne.isBrowser,t=Ne.isMobile,r=Ne.isTablet,n=Ne.isSmartTV,i=Ne.isConsole,a=Ne.isWearable;return e?d(e,b,E,w,k):n?g(n,E,w,k):i?h(i,E,w,k):t||r?f(Ne,C,w,k):a?p(a,E,w,k):void 0},isSmartTV:W,isConsole:X,isWearable:Y,isMobileSafari:$,isChromium:Z,isMobile:J,isMobileOnly:ee,isTablet:te,isBrowser:re,isAndroid:ne,isWinPhone:ie,isIOS:ae,isChrome:oe,isFirefox:se,isSafari:ce,isOpera:ue,isIE:le,osVersion:de,osName:fe,fullBrowserVersion:pe,browserVersion:he,browserName:ge,mobileVendor:me,mobileModel:ye,engineName:ve,engineVersion:be,getUA:Ce,isEdge:Ee,isYandex:we,deviceType:ke,isIOS13:Se,isIPad13:Be,isIPhone13:Te,isIPod13:Ae,isElectron:Ie,isEdgeChromium:_e,isLegacyEdge:xe,isWindows:Pe,isMacOs:Re}},function(e,t,r){var n;
|
54
|
+
/*!
|
55
|
+
* UAParser.js v0.7.18
|
56
|
+
* Lightweight JavaScript-based User-Agent string parser
|
57
|
+
* https://github.com/faisalman/ua-parser-js
|
58
|
+
*
|
59
|
+
* Copyright © 2012-2016 Faisal Salman <fyzlman@gmail.com>
|
60
|
+
* Dual licensed under GPLv2 or MIT
|
61
|
+
*/!function(i,a){var o="function",s="undefined",c="object",u="model",l="name",d="type",f="vendor",p="version",h="architecture",g="console",m="mobile",y="tablet",v="smarttv",b="wearable",C={extend:function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:a},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},E={rgx:function(e,t){for(var r,n,i,s,u,l,d=0;d<t.length&&!u;){var f=t[d],p=t[d+1];for(r=n=0;r<f.length&&!u;)if(u=f[r++].exec(e))for(i=0;i<p.length;i++)l=u[++n],typeof(s=p[i])===c&&s.length>0?2==s.length?typeof s[1]==o?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:3==s.length?typeof s[1]!==o||s[1].exec&&s[1].test?this[s[0]]=l?l.replace(s[1],s[2]):a:this[s[0]]=l?s[1].call(this,l,s[2]):a:4==s.length&&(this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):a):this[s]=l||a;d+=2}},str:function(e,t){for(var r in t)if(typeof t[r]===c&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(C.has(t[r][n],e))return"?"===r?a:r}else if(C.has(t[r],e))return"?"===r?a:r;return e}},w={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},k={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[l,p],[/(opios)[\/\s]+([\w\.]+)/i],[[l,"Opera Mini"],p],[/\s(opr)\/([\w\.]+)/i],[[l,"Opera"],p],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]*)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark)\/([\w\.-]+)/i],[l,p],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[l,"IE"],p],[/(edge|edgios|edgea)\/((\d+)?[\w\.]+)/i],[[l,"Edge"],p],[/(yabrowser)\/([\w\.]+)/i],[[l,"Yandex"],p],[/(puffin)\/([\w\.]+)/i],[[l,"Puffin"],p],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[l,"UCBrowser"],p],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],p],[/(micromessenger)\/([\w\.]+)/i],[[l,"WeChat"],p],[/(qqbrowserlite)\/([\w\.]+)/i],[l,p],[/(QQ)\/([\d\.]+)/i],[l,p],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[l,p],[/(BIDUBrowser)[\/\s]?([\w\.]+)/i],[l,p],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[l,p],[/(MetaSr)[\/\s]?([\w\.]+)/i],[l],[/(LBBROWSER)/i],[l],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[p,[l,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[p,[l,"Facebook"]],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[p,[l,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[l,/(.+)/,"$1 WebView"],p],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[l,/(.+(?:g|us))(.+)/,"$1 $2"],p],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[p,[l,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[l,p],[/(dolfin)\/([\w\.]+)/i],[[l,"Dolphin"],p],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[l,"Chrome"],p],[/(coast)\/([\w\.]+)/i],[[l,"Opera Coast"],p],[/fxios\/([\w\.-]+)/i],[p,[l,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[p,[l,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[p,l],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[l,"GSA"],p],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[l,[p,E.str,w.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[l,p],[/(navigator|netscape)\/([\w\.-]+)/i],[[l,"Netscape"],p],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[l,p]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[h,"amd64"]],[/(ia32(?=;))/i],[[h,C.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[h,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[h,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[h,/ower/,"",C.lowerize]],[/(sun4\w)[;\)]/i],[[h,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[h,C.lowerize]]],device:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],[u,f,[d,y]],[/applecoremedia\/[\w\.]+ \((ipad)/],[u,[f,"Apple"],[d,y]],[/(apple\s{0,1}tv)/i],[[u,"Apple TV"],[f,"Apple"]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[f,u,[d,y]],[/(kf[A-z]+)\sbuild\/.+silk\//i],[u,[f,"Amazon"],[d,y]],[/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i],[[u,E.str,w.device.amazon.model],[f,"Amazon"],[d,m]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[u,f,[d,m]],[/\((ip[honed|\s\w*]+);/i],[u,[f,"Apple"],[d,m]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[f,u,[d,m]],[/\(bb10;\s(\w+)/i],[u,[f,"BlackBerry"],[d,m]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone)/i],[u,[f,"Asus"],[d,y]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[f,"Sony"],[u,"Xperia Tablet"],[d,y]],[/android.+\s([c-g]\d{4}|so[-l]\w+)\sbuild\//i],[u,[f,"Sony"],[d,m]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[f,u,[d,g]],[/android.+;\s(shield)\sbuild/i],[u,[f,"Nvidia"],[d,g]],[/(playstation\s[34portablevi]+)/i],[u,[f,"Sony"],[d,g]],[/(sprint\s(\w+))/i],[[f,E.str,w.device.sprint.vendor],[u,E.str,w.device.sprint.model],[d,m]],[/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i],[f,u,[d,y]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[f,[u,/_/g," "],[d,m]],[/(nexus\s9)/i],[u,[f,"HTC"],[d,y]],[/d\/huawei([\w\s-]+)[;\)]/i,/(nexus\s6p)/i],[u,[f,"Huawei"],[d,m]],[/(microsoft);\s(lumia[\s\w]+)/i],[f,u,[d,m]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[u,[f,"Microsoft"],[d,g]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[f,"Microsoft"],[d,m]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w*)/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[u,[f,"Motorola"],[d,m]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[u,[f,"Motorola"],[d,y]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[f,C.trim],[u,C.trim],[d,v]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[f,"Samsung"],[d,v]],[/\(dtv[\);].+(aquos)/i],[u,[f,"Sharp"],[d,v]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[f,"Samsung"],u,[d,y]],[/smart-tv.+(samsung)/i],[f,[d,v],u],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[f,"Samsung"],u,[d,m]],[/sie-(\w*)/i],[u,[f,"Siemens"],[d,m]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[f,"Nokia"],u,[d,m]],[/android\s3\.[\s\w;-]{10}(a\d{3})/i],[u,[f,"Acer"],[d,y]],[/android.+([vl]k\-?\d{3})\s+build/i],[u,[f,"LG"],[d,y]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[f,"LG"],u,[d,y]],[/(lg) netcast\.tv/i],[f,u,[d,v]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[u,[f,"LG"],[d,m]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[u,[f,"Lenovo"],[d,y]],[/linux;.+((jolla));/i],[f,u,[d,m]],[/((pebble))app\/[\d\.]+\s/i],[f,u,[d,b]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[f,u,[d,m]],[/crkey/i],[[u,"Chromecast"],[f,"Google"]],[/android.+;\s(glass)\s\d/i],[u,[f,"Google"],[d,b]],[/android.+;\s(pixel c)\s/i],[u,[f,"Google"],[d,y]],[/android.+;\s(pixel xl|pixel)\s/i],[u,[f,"Google"],[d,m]],[/android.+;\s(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:one|one[\s_]plus|note lte)?[\s_]*(?:\d?\w?)[\s_]*(?:plus)?)\s+build/i,/android.+(redmi[\s\-_]*(?:note)?(?:[\s_]*[\w\s]+))\s+build/i],[[u,/_/g," "],[f,"Xiaomi"],[d,m]],[/android.+(mi[\s\-_]*(?:pad)(?:[\s_]*[\w\s]+))\s+build/i],[[u,/_/g," "],[f,"Xiaomi"],[d,y]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[u,[f,"Meizu"],[d,y]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})\s+build/i],[u,[f,"OnePlus"],[d,m]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[u,[f,"RCA"],[d,y]],[/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i],[u,[f,"Dell"],[d,y]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[u,[f,"Verizon"],[d,y]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[f,"Barnes & Noble"],u,[d,y]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[u,[f,"NuVision"],[d,y]],[/android.+;\s(k88)\sbuild/i],[u,[f,"ZTE"],[d,y]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[u,[f,"Swiss"],[d,m]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[u,[f,"Swiss"],[d,y]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[u,[f,"Zeki"],[d,y]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[f,"Dragon Touch"],u,[d,y]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[u,[f,"Insignia"],[d,y]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[u,[f,"NextBook"],[d,y]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[f,"Voice"],u,[d,m]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[f,"LvTel"],u,[d,m]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[u,[f,"Envizen"],[d,y]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[f,u,[d,y]],[/android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i],[u,[f,"MachSpeed"],[d,y]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[f,u,[d,y]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[u,[f,"Rotor"],[d,y]],[/android.+(KS(.+))\s+build/i],[u,[f,"Amazon"],[d,y]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[f,u,[d,y]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[d,C.lowerize],f,u],[/(android[\w\.\s\-]{0,9});.+build/i],[u,[f,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[p,[l,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[l,p],[/rv\:([\w\.]{1,9}).+(gecko)/i],[p,l]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[l,p],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[l,[p,E.str,w.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[l,"Windows"],[p,E.str,w.os.windows.version]],[/\((bb)(10);/i],[[l,"BlackBerry"],p],[/(blackberry)\w*\/?([\w\.]*)/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]*)/i,/linux;.+(sailfish);/i],[l,p],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[l,"Symbian"],p],[/\((series40);/i],[l],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[l,"Firefox OS"],p],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i],[l,p],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[l,"Chromium OS"],p],[/(sunos)\s?([\w\.\d]*)/i],[[l,"Solaris"],p],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[l,p],[/(haiku)\s(\w+)/i],[l,p],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[p,/_/g,"."],[l,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[l,"Mac OS"],[p,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]*)/i],[l,p]]},S=function(e,t){if("object"==typeof e&&(t=e,e=a),!(this instanceof S))return new S(e,t).getResult();var r=e||(i&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),n=t?C.extend(k,t):k;return this.getBrowser=function(){var e={name:a,version:a};return E.rgx.call(e,r,n.browser),e.major=C.major(e.version),e},this.getCPU=function(){var e={architecture:a};return E.rgx.call(e,r,n.cpu),e},this.getDevice=function(){var e={vendor:a,model:a,type:a};return E.rgx.call(e,r,n.device),e},this.getEngine=function(){var e={name:a,version:a};return E.rgx.call(e,r,n.engine),e},this.getOS=function(){var e={name:a,version:a};return E.rgx.call(e,r,n.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(e){return r=e,this},this};S.VERSION="0.7.18",S.BROWSER={NAME:l,MAJOR:"major",VERSION:p},S.CPU={ARCHITECTURE:h},S.DEVICE={MODEL:u,VENDOR:f,TYPE:d,CONSOLE:g,MOBILE:m,SMARTTV:v,TABLET:y,WEARABLE:b,EMBEDDED:"embedded"},S.ENGINE={NAME:l,VERSION:p},S.OS={NAME:l,VERSION:p},typeof t!==s?(typeof e!==s&&e.exports&&(t=e.exports=S),t.UAParser=S):r(3)?(n=function(){return S}.call(t,r,t,e))===a||(e.exports=n):i&&(i.UAParser=S);var B=i&&(i.jQuery||i.Zepto);if(typeof B!==s){var T=new S;B.ua=T.getResult(),B.ua.get=function(){return T.getUA()},B.ua.set=function(e){T.setUA(e);var t=T.getResult();for(var r in t)B.ua[r]=t[r]}}}("object"==typeof window?window:this)},function(e,t){(function(t){e.exports=t}).call(t,{})},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i=r(0),a=i.DEVICE_TYPES,o=i.defaultData,s=t.getNavigatorInstance=function(){return!("undefined"==typeof window||!window.navigator&&!navigator)&&(window.navigator||navigator)},c=t.isIOS13Check=function(e){var t=s();return t&&t.platform&&(-1!==t.platform.indexOf(e)||"MacIntel"===t.platform&&t.maxTouchPoints>1&&!window.MSStream)};e.exports={checkType:function(e){switch(e){case a.MOBILE:return{isMobile:!0};case a.TABLET:return{isTablet:!0};case a.SMART_TV:return{isSmartTV:!0};case a.CONSOLE:return{isConsole:!0};case a.WEARABLE:return{isWearable:!0};case a.BROWSER:return{isBrowser:!0};default:return o}},broPayload:function(e,t,r,n,i){return{isBrowser:e,browserMajorVersion:t.major,browserFullVersion:t.version,browserName:t.name,engineName:r.name||!1,engineVersion:r.version,osName:n.name,osVersion:n.version,userAgent:i}},mobilePayload:function(e,t,r,i){return n({},e,{vendor:t.vendor,model:t.model,os:r.name,osVersion:r.version,ua:i})},stvPayload:function(e,t,r,n){return{isSmartTV:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},consolePayload:function(e,t,r,n){return{isConsole:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},wearPayload:function(e,t,r,n){return{isWearable:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},getNavigatorInstance:s,isIOS13Check:c}}])})),b0="object"==typeof a&&a&&a.Object===Object&&a,C0=b0,E0="object"==typeof self&&self&&self.Object===Object&&self,w0=C0||E0||Function("return this")(),k0=w0,S0=k0.Symbol,B0=S0,T0=Object.prototype,A0=T0.hasOwnProperty,I0=T0.toString,_0=B0?B0.toStringTag:void 0;function x0(e){var t=A0.call(e,_0),r=e[_0];try{e[_0]=void 0;var n=!0}catch(e){}var i=I0.call(e);return n&&(t?e[_0]=r:delete e[_0]),i}var P0=x0,R0=Object.prototype,N0=R0.toString;function O0(e){return N0.call(e)}var L0=O0,D0="[object Null]",U0="[object Undefined]",M0=B0?B0.toStringTag:void 0;function V0(e){return null==e?void 0===e?U0:D0:M0&&M0 in Object(e)?P0(e):L0(e)}var j0=V0;function F0(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var z0=F0,K0="[object AsyncFunction]",q0="[object Function]",H0="[object GeneratorFunction]",Q0="[object Proxy]";function G0(e){if(!z0(e))return!1;var t=j0(e);return t==q0||t==H0||t==K0||t==Q0}var W0=G0,X0=k0["__core-js_shared__"],Y0=X0,$0=function(){var e=/[^.]+$/.exec(Y0&&Y0.keys&&Y0.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Z0(e){return!!$0&&$0 in e}var J0=Z0,e1=Function.prototype,t1=e1.toString;function r1(e){if(null!=e){try{return t1.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var n1=r1,i1=/[\\^$.*+?()[\]{}|]/g,a1=/^\[object .+?Constructor\]$/,o1=Function.prototype,s1=Object.prototype,c1=o1.toString,u1=s1.hasOwnProperty,l1=RegExp("^"+c1.call(u1).replace(i1,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d1(e){return!(!z0(e)||J0(e))&&(W0(e)?l1:a1).test(n1(e))}var f1=d1;function p1(e,t){return null==e?void 0:e[t]}var h1=p1;function g1(e,t){var r=h1(e,t);return f1(r)?r:void 0}var m1=g1,y1=function(){try{var e=m1(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),v1=y1;function b1(e,t,r){"__proto__"==t&&v1?v1(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var C1=b1;function E1(e,t){return e===t||e!=e&&t!=t}var w1=E1,k1=Object.prototype,S1=k1.hasOwnProperty;function B1(e,t,r){var n=e[t];S1.call(e,t)&&w1(n,r)&&(void 0!==r||t in e)||C1(e,t,r)}var T1=B1;function A1(e,t,r,n){var i=!r;r||(r={});for(var a=-1,o=t.length;++a<o;){var s=t[a],c=n?n(r[s],e[s],s,r,e):void 0;void 0===c&&(c=e[s]),i?C1(r,s,c):T1(r,s,c)}return r}var I1=A1;function _1(e){return e}var x1=_1;function P1(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var R1=P1,N1=Math.max;function O1(e,t,r){return t=N1(void 0===t?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=N1(n.length-t,0),o=Array(a);++i<a;)o[i]=n[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=n[i];return s[t]=r(o),R1(e,this,s)}}var L1=O1;function D1(e){return function(){return e}}var U1=D1,M1=v1?function(e,t){return v1(e,"toString",{configurable:!0,enumerable:!1,value:U1(t),writable:!0})}:x1,V1=M1,j1=800,F1=16,z1=Date.now;function K1(e){var t=0,r=0;return function(){var n=z1(),i=F1-(n-r);if(r=n,i>0){if(++t>=j1)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var q1=K1,H1=q1(V1),Q1=H1;function G1(e,t){return Q1(L1(e,t,x1),e+"")}var W1=G1,X1=9007199254740991;function Y1(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=X1}var $1=Y1;function Z1(e){return null!=e&&$1(e.length)&&!W0(e)}var J1=Z1,e3=9007199254740991,t3=/^(?:0|[1-9]\d*)$/;function r3(e,t){var r=typeof e;return!!(t=null==t?e3:t)&&("number"==r||"symbol"!=r&&t3.test(e))&&e>-1&&e%1==0&&e<t}var n3=r3;function i3(e,t,r){if(!z0(r))return!1;var n=typeof t;return!!("number"==n?J1(r)&&n3(t,r.length):"string"==n&&t in r)&&w1(r[t],e)}var a3=i3;function o3(e){return W1((function(t,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,o&&a3(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++n<i;){var s=r[n];s&&e(t,s,n,a)}return t}))}var s3=o3;function c3(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var u3=c3;function l3(e){return null!=e&&"object"==typeof e}var d3=l3,f3="[object Arguments]";function p3(e){return d3(e)&&j0(e)==f3}var h3=p3,g3=Object.prototype,m3=g3.hasOwnProperty,y3=g3.propertyIsEnumerable,v3=h3(function(){return arguments}())?h3:function(e){return d3(e)&&m3.call(e,"callee")&&!y3.call(e,"callee")},b3=v3,C3=Array.isArray,E3=C3;function w3(){return!1}var k3=w3,S3=s((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,i=n&&n.exports===r?k0.Buffer:void 0,a=(i?i.isBuffer:void 0)||k3;e.exports=a})),B3="[object Arguments]",T3="[object Array]",A3="[object Boolean]",I3="[object Date]",_3="[object Error]",x3="[object Function]",P3="[object Map]",R3="[object Number]",N3="[object Object]",O3="[object RegExp]",L3="[object Set]",D3="[object String]",U3="[object WeakMap]",M3="[object ArrayBuffer]",V3="[object DataView]",j3="[object Float32Array]",F3="[object Float64Array]",z3="[object Int8Array]",K3="[object Int16Array]",q3="[object Int32Array]",H3="[object Uint8Array]",Q3="[object Uint8ClampedArray]",G3="[object Uint16Array]",W3="[object Uint32Array]",X3={};function Y3(e){return d3(e)&&$1(e.length)&&!!X3[j0(e)]}X3[j3]=X3[F3]=X3[z3]=X3[K3]=X3[q3]=X3[H3]=X3[Q3]=X3[G3]=X3[W3]=!0,X3[B3]=X3[T3]=X3[M3]=X3[A3]=X3[V3]=X3[I3]=X3[_3]=X3[x3]=X3[P3]=X3[R3]=X3[N3]=X3[O3]=X3[L3]=X3[D3]=X3[U3]=!1;var $3=Y3;function Z3(e){return function(t){return e(t)}}var J3=Z3,e2=s((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,i=n&&n.exports===r&&C0.process,a=function(){try{var e=n&&n.require&&n.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=a})),t2=e2&&e2.isTypedArray,r2=t2?J3(t2):$3,n2=r2,i2=Object.prototype,a2=i2.hasOwnProperty;function o2(e,t){var r=E3(e),n=!r&&b3(e),i=!r&&!n&&S3(e),a=!r&&!n&&!i&&n2(e),o=r||n||i||a,s=o?u3(e.length,String):[],c=s.length;for(var u in e)!t&&!a2.call(e,u)||o&&("length"==u||i&&("offset"==u||"parent"==u)||a&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||n3(u,c))||s.push(u);return s}var s2=o2,c2=Object.prototype;function u2(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||c2)}var l2=u2;function d2(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}var f2=d2,p2=Object.prototype,h2=p2.hasOwnProperty;function g2(e){if(!z0(e))return f2(e);var t=l2(e),r=[];for(var n in e)("constructor"!=n||!t&&h2.call(e,n))&&r.push(n);return r}var m2=g2;function y2(e){return J1(e)?s2(e,!0):m2(e)}var v2=y2,b2=s3((function(e,t,r,n){I1(t,v2(t),e,n)})),C2=b2;function E2(e,t){return function(r){return e(t(r))}}var w2=E2,k2=w2(Object.getPrototypeOf,Object),S2=k2,B2="[object Object]",T2=Function.prototype,A2=Object.prototype,I2=T2.toString,_2=A2.hasOwnProperty,x2=I2.call(Object);function P2(e){if(!d3(e)||j0(e)!=B2)return!1;var t=S2(e);if(null===t)return!0;var r=_2.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&I2.call(r)==x2}var R2=P2,N2="[object DOMException]",O2="[object Error]";function L2(e){if(!d3(e))return!1;var t=j0(e);return t==O2||t==N2||"string"==typeof e.message&&"string"==typeof e.name&&!R2(e)}var D2=L2,U2=W1((function(e,t){try{return R1(e,void 0,t)}catch(e){return D2(e)?e:new Error(e)}})),M2=U2;function V2(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var j2=V2;function F2(e,t){return j2(t,(function(t){return e[t]}))}var z2=F2,K2=Object.prototype,q2=K2.hasOwnProperty;function H2(e,t,r,n){return void 0===e||w1(e,K2[r])&&!q2.call(n,r)?t:e}var Q2=H2,G2={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function W2(e){return"\\"+G2[e]}var X2=W2,Y2=w2(Object.keys,Object),$2=Y2,Z2=Object.prototype,J2=Z2.hasOwnProperty;function e5(e){if(!l2(e))return $2(e);var t=[];for(var r in Object(e))J2.call(e,r)&&"constructor"!=r&&t.push(r);return t}var t5=e5;function r5(e){return J1(e)?s2(e):t5(e)}var n5=r5,i5=/<%=([\s\S]+?)%>/g,a5=i5;function o5(e){return function(t){return null==e?void 0:e[t]}}var s5=o5,c5={"&":"&","<":"<",">":">",'"':""","'":"'"},u5=s5(c5),l5=u5,d5="[object Symbol]";function f5(e){return"symbol"==typeof e||d3(e)&&j0(e)==d5}var p5=f5,h5=1/0,g5=B0?B0.prototype:void 0,m5=g5?g5.toString:void 0;function y5(e){if("string"==typeof e)return e;if(E3(e))return j2(e,y5)+"";if(p5(e))return m5?m5.call(e):"";var t=e+"";return"0"==t&&1/e==-h5?"-0":t}var v5=y5;function b5(e){return null==e?"":v5(e)}var C5=b5,E5=/[&<>"']/g,w5=RegExp(E5.source);function k5(e){return(e=C5(e))&&w5.test(e)?e.replace(E5,l5):e}var S5=k5,B5=/<%-([\s\S]+?)%>/g,T5=B5,A5=/<%([\s\S]+?)%>/g,I5=A5,_5={escape:T5,evaluate:I5,interpolate:a5,variable:"",imports:{_:{escape:S5}}},x5=_5,P5=/\b__p \+= '';/g,R5=/\b(__p \+=) '' \+/g,N5=/(__e\(.*?\)|\b__t\)) \+\n'';/g,O5=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,L5=/($^)/,D5=/['\n\r\u2028\u2029\\]/g,U5=Object.prototype,M5=U5.hasOwnProperty;function V5(e,t,r){var n=x5.imports._.templateSettings||x5;r&&a3(e,t,r)&&(t=void 0),e=C5(e),t=C2({},t,n,Q2);var i,a,o=C2({},t.imports,n.imports,Q2),s=n5(o),c=z2(o,s),u=0,l=t.interpolate||L5,d="__p += '",f=RegExp((t.escape||L5).source+"|"+l.source+"|"+(l===a5?O5:L5).source+"|"+(t.evaluate||L5).source+"|$","g"),p=M5.call(t,"sourceURL")?"//# sourceURL="+(t.sourceURL+"").replace(/\s/g," ")+"\n":"";e.replace(f,(function(t,r,n,o,s,c){return n||(n=o),d+=e.slice(u,c).replace(D5,X2),r&&(i=!0,d+="' +\n__e("+r+") +\n'"),s&&(a=!0,d+="';\n"+s+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=c+t.length,t})),d+="';\n";var h=M5.call(t,"variable")&&t.variable;h||(d="with (obj) {\n"+d+"\n}\n"),d=(a?d.replace(P5,""):d).replace(R5,"$1").replace(N5,"$1;"),d="function("+(h||"obj")+") {\n"+(h?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var g=M2((function(){return Function(s,p+"return "+d).apply(void 0,c)}));if(g.source=d,D2(g))throw g;return g}var j5=V5,F5={SESSION_TIMEOUT:"SESSION_TIMEOUT",CONFIRM:"CONFIRM",QR_INVALID:"QR_INVALID",QR_INSTRUCTIONS:"QR_INSTRUCTIONS"},z5=function(){var e=qv(SC.useState(!1),2),t=e[0],r=e[1],n=qv(SC.useState(null),2),i=n[0],a=n[1],o=qv(SC.useState({}),2),s=o[0],c=o[1];return{showPopup:SC.useCallback((function(e){var t=e.popupType,n=e.props;c(void 0===n?{}:n),a(t),r(null!==t)}),[]),popupShown:t,popupType:i,props:s}};function K5(){return(K5=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var q5,H5,Q5,G5,W5,X5,Y5,$5,Z5,J5,e4,t4,r4=function(e,t){void 0===t&&(t=!0),SC.useEffect((function(){if(t){var r=function(t){"Escape"===t.key&&e(t)};return document.addEventListener("keyup",r),function(){t&&document.removeEventListener("keyup",r)}}}),[e,t])},n4=function(e,t){void 0===t&&(t=!0),SC.useEffect((function(){if(t){var r=function(){e()};return window.addEventListener("resize",r),function(){t&&window.removeEventListener("resize",r)}}}),[e,t])},i4=function(e,t,r){void 0===r&&(r=!0),SC.useEffect((function(){if(r){var n=function(r){var n=Array.isArray(e)?e:[e],i=!1;n.forEach((function(e){e.current&&!e.current.contains(r.target)||(i=!0)})),r.stopPropagation(),i||t(r)};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),function(){r&&(document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n))}}}),[e,t,r])},a4=function(e,t){void 0===t&&(t=!0),SC.useEffect((function(){if(t){var r=function(t){if(9===t.keyCode){var r,n=null==e||null===(r=e.current)||void 0===r?void 0:r.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'),i=Array.prototype.slice.call(n);if(1===i.length)return void t.preventDefault();var a=i[0],o=i[i.length-1];t.shiftKey&&document.activeElement===a?(t.preventDefault(),o.focus()):document.activeElement===o&&(t.preventDefault(),a.focus())}};return document.addEventListener("keydown",r),function(){t&&document.removeEventListener("keydown",r)}}}),[e,t])},o4="undefined"!=typeof window?SC.useLayoutEffect:SC.useEffect,s4={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}}},c4=["top left","top center","top right","right top","right center","right bottom","bottom left","bottom center","bottom right","left top","left center","left bottom"],u4=function(e,t,r,n,i){var a=i.offsetX,o=i.offsetY,s=n?8:0,c=r.split(" "),u=e.top+e.height/2,l=e.left+e.width/2,d=t.height,f=t.width,p=u-d/2,h=l-f/2,g="",m="0%",y="0%";switch(c[0]){case"top":p-=d/2+e.height/2+s,g="rotate(180deg) translateX(50%)",m="100%",y="50%";break;case"bottom":p+=d/2+e.height/2+s,g="rotate(0deg) translateY(-100%) translateX(-50%)",y="50%";break;case"left":h-=f/2+e.width/2+s,g=" rotate(90deg) translateY(50%) translateX(-25%)",y="100%",m="50%";break;case"right":h+=f/2+e.width/2+s,g="rotate(-90deg) translateY(-150%) translateX(25%)",m="50%"}switch(c[1]){case"top":p=e.top,m=e.height/2+"px";break;case"bottom":p=e.top-d+e.height,m=d-e.height/2+"px";break;case"left":h=e.left,y=e.width/2+"px";break;case"right":h=e.left-f+e.width,y=f-e.width/2+"px"}return{top:p="top"===c[0]?p-o:p+o,left:h="left"===c[0]?h-a:h+a,transform:g,arrowLeft:y,arrowTop:m}},l4=function(e){var t={top:0,left:0,width:window.innerWidth,height:window.innerHeight};if("string"==typeof e){var r=document.querySelector(e);null!==r&&(t=r.getBoundingClientRect())}return t},d4=function(e,t,r,n,i,a){var o=i.offsetX,s=i.offsetY,c={arrowLeft:"0%",arrowTop:"0%",left:0,top:0,transform:"rotate(135deg)"},u=0,l=l4(a),d=Array.isArray(r)?r:[r];for((a||Array.isArray(r))&&(d=[].concat(d,c4));u<d.length;){var f={top:(c=u4(e,t,d[u],n,{offsetX:o,offsetY:s})).top,left:c.left,width:t.width,height:t.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},f4=0,p4=function(){var e=document.getElementById("popup-root");return null===e&&((e=document.createElement("div")).setAttribute("id","popup-root"),document.body.appendChild(e)),e},h4=SC.forwardRef((function(e,t){var r=e.trigger,n=void 0===r?null:r,i=e.onOpen,a=void 0===i?function(){}:i,o=e.onClose,s=void 0===o?function(){}:o,c=e.defaultOpen,u=void 0!==c&&c,l=e.open,d=void 0===l?void 0:l,f=e.disabled,p=void 0!==f&&f,h=e.nested,g=void 0!==h&&h,m=e.closeOnDocumentClick,y=void 0===m||m,v=e.repositionOnResize,b=void 0===v||v,C=e.closeOnEscape,E=void 0===C||C,w=e.on,k=void 0===w?["click"]:w,S=e.contentStyle,B=void 0===S?{}:S,T=e.arrowStyle,A=void 0===T?{}:T,I=e.overlayStyle,_=void 0===I?{}:I,x=e.className,P=void 0===x?"":x,R=e.position,N=void 0===R?"bottom center":R,O=e.modal,L=void 0!==O&&O,D=e.lockScroll,U=void 0!==D&&D,M=e.arrow,V=void 0===M||M,j=e.offsetX,F=void 0===j?0:j,z=e.offsetY,K=void 0===z?0:z,q=e.mouseEnterDelay,H=void 0===q?100:q,Q=e.mouseLeaveDelay,G=void 0===Q?100:Q,W=e.keepTooltipInside,X=void 0!==W&&W,Y=e.children,$=SC.useState(d||u),Z=$[0],J=$[1],ee=SC.useRef(null),te=SC.useRef(null),re=SC.useRef(null),ne=SC.useRef(null),ie=SC.useRef("popup-"+ ++f4),ae=!!L||!n,oe=SC.useRef(0);o4((function(){return Z?(ne.current=document.activeElement,me(),ge(),pe()):he(),function(){clearTimeout(oe.current)}}),[Z]),SC.useEffect((function(){"boolean"==typeof d&&(d?se():ce())}),[d,p]);var se=function(e){Z||p||(J(!0),setTimeout((function(){return a(e)}),0))},ce=function(e){var t;Z&&!p&&(J(!1),ae&&(null===(t=ne.current)||void 0===t||t.focus()),setTimeout((function(){return s(e)}),0))},ue=function(e){null==e||e.stopPropagation(),Z?ce(e):se(e)},le=function(e){clearTimeout(oe.current),oe.current=setTimeout((function(){return se(e)}),H)},de=function(e){null==e||e.preventDefault(),ue()},fe=function(e){clearTimeout(oe.current),oe.current=setTimeout((function(){return ce(e)}),G)},pe=function(){ae&&U&&(document.getElementsByTagName("body")[0].style.overflow="hidden")},he=function(){ae&&U&&(document.getElementsByTagName("body")[0].style.overflow="auto")},ge=function(){var e,t=null==te||null===(e=te.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"]'),r=Array.prototype.slice.call(t)[0];null==r||r.focus()};SC.useImperativeHandle(t,(function(){return{open:function(){se()},close:function(){ce()},toggle:function(){ue()}}}));var me=function(){if(!ae&&Z&&(null==ee?void 0:ee.current)&&(null==ee?void 0:ee.current)&&(null==te?void 0:te.current)){var e,t,r=ee.current.getBoundingClientRect(),n=te.current.getBoundingClientRect(),i=d4(r,n,N,V,{offsetX:F,offsetY:K},X);if(te.current.style.top=i.top+window.scrollY+"px",te.current.style.left=i.left+window.scrollX+"px",V&&re.current)re.current.style.transform=i.transform,re.current.style.setProperty("-ms-transform",i.transform),re.current.style.setProperty("-webkit-transform",i.transform),re.current.style.top=(null===(e=A.top)||void 0===e?void 0:e.toString())||i.arrowTop,re.current.style.left=(null===(t=A.left)||void 0===t?void 0:t.toString())||i.arrowLeft}};r4(ce,E),a4(te,Z&&ae),n4(me,b),i4(n?[te,ee]:[te],ce,y&&!g);var ye=function(){return SC.createElement("div",Object.assign({},(e=ae?s4.popupContent.modal:s4.popupContent.tooltip,t={className:"popup-content "+(""!==P?P.split(" ").map((function(e){return e+"-content"})).join(" "):""),style:K5({},e,B,{pointerEvents:"auto"}),ref:te,onClick:function(e){e.stopPropagation()}},!L&&k.indexOf("hover")>=0&&(t.onMouseEnter=le,t.onMouseLeave=fe),t),{key:"C",role:ae?"dialog":"tooltip",id:ie.current}),V&&!ae&&SC.createElement("div",{ref:re,style:s4.popupArrow},SC.createElement("svg",{"data-testid":"arrow",className:"popup-arrow "+(""!==P?P.split(" ").map((function(e){return e+"-arrow"})).join(" "):""),viewBox:"0 0 32 16",style:K5({position:"absolute"},A)},SC.createElement("path",{d:"M16 0l16 16H0z",fill:"currentcolor"}))),Y&&"function"==typeof Y?Y(ce,Z):Y);var e,t},ve=!(k.indexOf("hover")>=0),be=ae?s4.overlay.modal:s4.overlay.tooltip,Ce=[ve&&SC.createElement("div",{key:"O","data-testid":"overlay","data-popup":ae?"modal":"tooltip",className:"popup-overlay "+(""!==P?P.split(" ").map((function(e){return e+"-overlay"})).join(" "):""),style:K5({},be,_,{pointerEvents:y&&g||ae?"auto":"none"}),onClick:y&&g?ce:void 0,tabIndex:-1},ae&&ye()),!ae&&ye()];return SC.createElement(SC.Fragment,null,function(){for(var e={key:"T",ref:ee,"aria-describedby":ie.current},t=Array.isArray(k)?k:[k],r=0,i=t.length;r<i;r++)switch(t[r]){case"click":e.onClick=ue;break;case"right-click":e.onContextMenu=de;break;case"hover":e.onMouseEnter=le,e.onMouseLeave=fe;break;case"focus":e.onFocus=le,e.onBlur=fe}if("function"==typeof n){var a=n(Z);return!!n&&SC.cloneElement(a,e)}return!!n&&SC.cloneElement(n,e)}(),Z&&zz.createPortal(Ce,p4()))}));function g4(){if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)return navigator.mediaDevices;var e=navigator.mozGetUserMedia||navigator.webkitGetUserMedia;return e?{getUserMedia:function(t){return new Promise((function(r,n){e.call(navigator,t,r,n)}))}}:null}function m4(){return"function"==typeof navigator.enumerateDevices?navigator.enumerateDevices():"object"===Iv(navigator.mediaDevices)&&"function"==typeof navigator.mediaDevices.enumerateDevices?navigator.mediaDevices.enumerateDevices():new Promise((function(e,t){try{if(null==window.MediaStreamTrack||null==window.MediaStreamTrack.getSources)throw new Error;window.MediaStreamTrack.getSources((function(t){e(t.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 t(e)}}))}var y4,v4=hB.Errors,b4=1e3,C4=cB.div(q5||(q5=Kv(["\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"])),b4,(function(e){return e.checkCameraMode&&"opacity: 0;"})),E4=cB.video(H5||(H5=Kv(["\n width: 100%;\n ","\n"])),(function(e){return e.flipHorizontal&&"\n transform: scaleX(-1);\n "})),w4=cB.div(Q5||(Q5=Kv(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),k4=cB(w4)(G5||(G5=Kv(["\n z-index: ",";\n position: absolute;\n top: 20px;\n right: 20px;\n width: 20px;\n"])),b4+100),S4=cB.div(W5||(W5=Kv(["\n z-index: ",";\n position: absolute;\n top: 40px;\n color: red;\n"])),b4+20),B4=cB.div(X5||(X5=Kv(["\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: ",";\n"])),b4+30),T4=cB.section(Y5||(Y5=Kv(["\n width: 260px;\n margin: 1.25rem;\n padding: 0.625rem 1.875rem;\n background: #ffffff;\n border-radius: 0.3125rem;\n box-shadow: 2px 2px 14px rgba(0, 0, 0, 0.15);\n"]))),A4=cB.header($5||($5=Kv(["\n text-align: center;\n padding: 0.625rem 0;\n border-bottom: 1px solid #dddddd;\n"]))),I4=cB.h2(Z5||(Z5=Kv(["\n margin: 0.25rem auto;\n padding: 0;\n font-weight: 600;\n font-size: 1.2rem;\n"]))),_4=cB.p(J5||(J5=Kv(["\n padding: 0 0 0.3125rem;\n margin: 0.25rem auto;\n font-size: 0.8rem;\n"]))),x4=cB.ul(e4||(e4=Kv(["\n list-style: none;\n padding: 0;\n"]))),P4=cB.li(t4||(t4=Kv(["\n padding: 0.625rem 0 0.9375rem;\n margin: 0;\n text-align: left;\n width: 100%;\n cursor: pointer;\n font-size: 0.82rem;\n transition: all 550ms ease-in-out;\n\n &:hover {\n opacity: 0.8;\n }\n"]))),R4=g4();function N4(e){var t=e.checkCameraMode,r=e.frontCamera,n=e.onClose,i=e.children,a=e.onVideoPlayed,o=e.flipHorizontal,s=e.videoSettings,c=e.refVideo,u=e.onError,l=e.closeButton,d=e.videoClassName,f=vB.useSDKSettings().lang,p=c_.useSDKTracking().sendEvent,h=d_.useAsset("ic_close.png"),g=qv(SC.useState(""),2),m=g[0],y=g[1],v=qv(SC.useState([]),2),b=v[0],C=v[1],E=qv(SC.useState(!1),2),w=E[0],k=E[1],S=SC.useRef(!1),B=SC.useRef(!1),T=SC.useCallback((function(){var e;(null==c||null===(e=c.current)||void 0===e?void 0:e.srcObject)instanceof MediaStream&&(c.current.srcObject.getTracks().forEach((function(e){return e.stop()})),c.current.srcObject=null)}),[c]),A=SC.useCallback(function(){var e=xv(regeneratorRuntime.mark((function e(t){var n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},n=v0.isMobile?v0.isIOS?{width:{ideal:1460},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{width:{ideal:1650},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{height:{ideal:9999}},e.prev=2,e.next=5,R4.getUserMedia({audio:!1,video:Uv(Uv({},t?{deviceId:t}:{facingMode:r?"user":"environment"}),s||n)});case 5:return(i=e.sent)||(y(v4.not_supported.msg[f]),u(v4.not_supported)),e.abrupt("return",i);case 10:e.prev=10,e.t0=e.catch(2),"NotAllowedError"===e.t0.name?(y(v4.no_permission.msg[f]),u(v4.no_permission)):(k(!0),y(e.t0.message),u({code:e.t0.name||e.t0.code}));case 13:return e.abrupt("return",null);case 14:case"end":return e.stop()}}),e,null,[[2,10]])})));return function(t){return e.apply(this,arguments)}}(),[r,s,f,u]),I=SC.useCallback(function(){var e=xv(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=c.current).oncanplaythrough=function(){r.play(),B.current=!0,y("");var e=window.innerWidth,t=window.innerHeight,n=V_.analyzeVideoAndWindowSizes(r),i=n.lostX,o=void 0===i?0:i,s=n.lostY,c=void 0===s?0:s,u=Math.min(e,Math.floor(e-2*o)),l=Math.min(t,Math.floor(t-2*c));a&&a({clientWidth:e,clientHeight:t,videoAreaWidth:u,videoAreaHeight:l,lostX:o,lostY:c})},e.next=4,A(t);case 4:(n=e.sent)&&(r.srcObject=n);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[c,A,a]);SC.useEffect((function(){function e(){return(e=xv(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,m4();case 3:t=e.sent,r=t.filter((function(e){return e.deviceId&&"videoinput"===e.kind})),C(r),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)}w&&!S.current&&(S.current=!0,function(){e.apply(this,arguments)}())}),[w]),SC.useEffect((function(){function e(){return(e=xv(regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,I();case 2:return e.next=4,m4();case 4:t=e.sent,(r=t.filter((function(e){return"videoinput"===e.kind&&e.label.includes("0")}))).length>0&&(n=r[0].deviceId,T(),I(n));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var t=c.current;return!R4||v0.browserName&&["facebook"].includes(v0.browserName.toLowerCase())||v0.getUA.includes("Zalo iOS")?(y(v4.not_supported.msg[f]),u(v4.not_supported)):t&&(v0.isAndroid&&!1===r?function(){e.apply(this,arguments)}():I()),function(){T()}}),[c,f,r,I,T,u]),SC.useEffect((function(){var e=setTimeout((function(){B.current||(y(v4.camera_timeout.msg[f]),u(v4.camera_timeout))}),3e5);return function(){clearTimeout(e)}}),[f,u]);var _=SC.useCallback((function(){T(),n&&n(),p({tag:"result",event:"user_activity.cancel",log:{}})}),[n,T,p]);return SC.createElement(C4,{checkCameraMode:t},w&&null!=b&&b.length?SC.createElement(B4,null,SC.createElement(T4,null,SC.createElement(A4,null,SC.createElement(I4,null,"Không thể mở camera mặc định"),SC.createElement(_4,null,"Vui lòng thử chọn camera khác trong danh sách dưới đây")),SC.createElement(x4,null,b.map((function(e,t){return SC.createElement(P4,{key:e.deviceId,onClick:function(){y(""),T(),k(!1),I(e.deviceId)}},e.label?e.label:"Camera ".concat(t+1))}))))):null,m?SC.createElement(S4,null,m):null,SC.createElement(E4,{ref:c,playsInline:!0,muted:!0,flipHorizontal:o,className:d}),i,l?SC.cloneElement(l,{onClick:_,"data-testid":"close-camera"}):SC.createElement(k4,{onClick:_,"data-testid":"close-camera"},SC.createElement("img",{src:h,alt:""})))}N4.propTypes={checkCameraMode:SE.bool,frontCamera:SE.bool,onClose:SE.func,onError:SE.func,onVideoPlayed:SE.func,children:SE.node,flipHorizontal:SE.bool,videoSettings:SE.object,refVideo:SE.object,closeButton:SE.node,videoClassName:SE.string},N4.defaultProps={checkCameraMode:!1,frontCamera:!0,onClose:null,onError:function(){},onVideoPlayed:null,children:null,flipHorizontal:!1,videoSettings:null,refVideo:null,closeButton:null,videoClassName:""};var O4,L4,D4,U4,M4,V4,j4,F4,z4,K4,q4,H4,Q4,G4,W4,X4=lB(y4||(y4=Kv(["\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"]))),Y4=["open","children","overlayStyle"],$4=b4+1e3,Z4=function(e){var t=e.open,r=e.children,n=e.overlayStyle,i=zv(e,Y4);return SC.createElement(SC.Fragment,null,SC.createElement(h4,Lv({overlayStyle:Uv(Uv({},n),{},{zIndex:$4}),closeOnDocumentClick:!1,closeOnEscape:!1,modal:!0,open:t},i),r),SC.createElement(X4,null))};Z4.propTypes={open:SE.bool,children:SE.node,overlayStyle:SE.shape({})},Z4.defaultProps={open:!1,children:null,overlayStyle:{}};var J4,e6,t6,r6=cY.flipY,n6=cY.spin,i6=cY.splash,a6=r6.animationDuration,o6=i6.default,s6=cB.div(O4||(O4=Kv(["\n ","\n ","\n"])),r6.default,n6.default),c6=(cB.img(L4||(L4=Kv(["\n border-radius: 5px;\n opacity: 0.7;\n height: 38px;\n"]))),80),u6=10,l6=60,d6=cB.div(D4||(D4=Kv(["\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"])),l6,kK+20,v0.isMobile?GS(["top:",";"],(function(e){return e.y})):GS(["bottom:","px;"],u6)),f6=cB.div(U4||(U4=Kv(["\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"])),c6,c6,kK+20),p6=cB.div(M4||(M4=Kv(["\n color: #fff;\n text-align: center;\n"]))),h6=cB.div(V4||(V4=Kv(["\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}),kK+20),g6=cB.div(j4||(j4=Kv(["\n display: flex;\n align-items: center;\n"]))),m6=cB(p6)(F4||(F4=Kv(["\n font-size: ","px;\n color: #38383d;\n font-weight: 500;\n"])),v0.isMobile?16:24),y6=cB.div(z4||(z4=Kv(["\n margin: 0 auto;\n padding: 0 5px;\n position: absolute;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),kK+20),v6=cB(p6)(K4||(K4=Kv(["\n text-align: center;\n color: ",";\n font-weight: 500;\n padding: 5px 10px;\n font-size: ","px;\n"])),(function(e){return e.theme.dangerColor}),v0.isMobile?14:16),b6=function(e){var t=e.children,r=e.y;return SC.createElement(y6,{y:r},SC.createElement(v6,null,t))},C6=cB(wX)(q4||(q4=Kv(["\n position: absolute;\n top: 0;\n left: 0;\n"]))),E6=cB(p6)(H4||(H4=Kv(["\n color: ",";\n font-weight: 500;\n padding: 5px 10px;\n font-size: ","px;\n position: absolute;\n text-align: center;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.theme.dangerColor}),v0.isMobile?14:16,(function(e){return e.y}),kK+20),w6=cB(p6)(Q4||(Q4=Kv(["\n font-weight: normal;\n padding: 5px 10px;\n color: #38383d;\n font-size: ","px;\n position: absolute;\n text-align: center;\n top: ",";\n z-index: ",";\n"])),v0.isMobile?14:16,(function(e){return e.y}),kK+20),k6=cB.div(G4||(G4=Kv(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),S6=cB(k6)(W4||(W4=Kv(["\n z-index: ",";\n position: absolute;\n ","\n top: 16px;\n width: 24px;\n"])),kK+100,v0.isMobile?"left: 16px;":"right: 16px;"),B6=hB.Errors,T6={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:"Nhìn ổn đấy!"},BTN_TRY_AGAIN:{en:"Try again",vi:"Chụp 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"}},A6=Uv(Uv({},B6),{},{id_detector_no_cards:{code:"id_detector_no_cards",msg:{en:"Take a photo of your ID card's <%= side %> side. Make sure the image of the card fits in the frame, (minimum 50% of frame).",vi:"Mặt <%= side %> CMND/CCCD cần nằm gọn trong khung hình, chiếm tối thiểu 50%."}},id_detector_validate_angle_error:{code:"id_detector_validate_angle_error",msg:{en:"Please put your ID card straight, not be oblique",vi:"Vui lòng đặt giấy tờ thẳng góc, không bị xô lệch khi chụp"}},id_detector_card_too_small:{code:"id_detector_card_too_small",msg:{en:"Please hold your ID card closer",vi:"Vui lòng đưa CMND/CCCD lại gần hơn"}},id_detector_error_incomplete:{code:"id_detector_error_incomplete",msg:{en:"Please hold your ID card further",vi:"Vui lòng đưa CMND/CCCD ra xa hơn"}},id_detector_error_front_side_no_faces:{code:"id_detector_error_front_side_no_faces",msg:{en:"Take a photo of your ID card's front side",vi:"Vui lòng chụp ảnh mặt trước của CMND/CCCD"}},id_detector_error_front_side_multiple_faces:{code:"id_detector_error_front_side_multiple_faces",msg:{en:"Please remove other items out of the frame",vi:"Vui lòng không để lẫn vật thể khác trong khung chụp hình"}},glare_detected:{code:"glare_detected",msg:{en:"Your photo ID is glare. Please adjust the shooting angle.",vi:"Ảnh chụp bị lóa sáng. Vui lòng chụp lại"}}}),I6=hB.IDCardMessage,_6=cB.div(J4||(J4=Kv(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),x6=cB.div(e6||(e6=Kv(["\n text-align: center;\n font-size: 1rem;\n"]))),P6=cB.button(t6||(t6=Kv(["\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.primaryColor})),R6=function(e){var t=e.onOk,r=e.maxSessionTime,n=vB.useSDKSettings().lang;return SC.createElement(_6,null,SC.createElement(x6,null,j5(I6.TIMEOUT_INSTRUCTION[n])({x:r})),SC.createElement(P6,{onClick:t},T6.BTN_OK[n]))};R6.propTypes={onOk:SE.func,maxSessionTime:SE.number},R6.defaultProps={onOk:function(){},maxSessionTime:30};var N6,O6,L6,D6=hB.IDCardMessage,U6=SC.forwardRef((function(e,t){var r,n=e.usePortraitMask,i=e.windowAndVideoInfo,a=e.refVideo,o=e.frontSide,s=e.settings,c=e.onCaptureDone,u=e.onUISpacingChange,l=e.outputEncryptionSettings,d=qv(SC.useState({}),2),f=d[0],p=d[1],h=f.yErrorMessage,g=f.yDescription,m=f.yCaptureButton,y=f.yMessage,v=d_.useAsset("ic_camera.png"),b=d_.useAsset("ic_camera_disabled.png"),C=d_.useAsset("ic_id.png"),E=d_.useAsset("ic_loading.png"),w=vB.useSDKSettings().lang,k=qv(SC.useState(""),2),S=k[0],B=k[1],T=qv(SC.useState(null),2),A=T[0],I=T[1],_=WP.useThemeContext(),x=qv(SC.useState(null),2),P=x[0],R=x[1],N=_.primaryColor,O=_.dangerColor,L=z5(),D=L.showPopup,U=L.popupShown,M=L.popupType,V=SC.useRef((function(){})),j=SC.useCallback((function(e){B(null===e?"":j5(A6[e.code].msg[w])({side:o?T6.FRONT[w]:T6.BACK[w]}))}),[w,o]),F=SC.useCallback((function(){R(""),D({popupType:F5.SESSION_TIMEOUT})}),[D]),z=SC.useCallback((function(e){var t=e.curTimeLeft;R(j5(D6.REMAINING_TIME[w])({x:t}))}),[w]),K=f$({shouldStart:!0,refVideo:a,cropArea:A,settings:s,onModelErrorChange:j,frontSide:o,onSessionTimeout:F,onCaptureDone:c,onAboutToTimeout:z,outputEncryptionSettings:l}),q=K.warmupDone,H=K.isProcessing,Q=K.takePictureManually,G=K.restartSession,W=K.resetIsProcessingImageBlobTaken,X=SC.useCallback((function(){D({popupType:null}),W()}),[D,W]),Y=SC.useCallback(xv(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return X(),e.next=3,G();case 3:case"end":return e.stop()}}),e)}))),[G,X]);V.current=Y,SC.useEffect((function(){if(i){var e,t,r,a,o,s,c,l,d=i.videoAreaWidth,f=i.videoAreaHeight,h=i.lostX,g=i.lostY,m=i.clientHeight;n?(s=.7*(c=f-165),r=(l=(e=g+10)+45)+20,a=l+c+70):(s=v0.isMobile?d-6:Math.floor(.7*d),c=Math.floor(Math.min(s/1.5,m-2*g-(l6+2*u6)-145)),r=(t=(l=(e=g+16)+(v0.isMobile?40:65))+c+10)+(v0.isMobile?35:25),o=v0.isMobile?t+60:e+30,a=t+158);var y=Math.floor((d-s)/2)+h;I({x:y,y:l,width:s,height:c,surroundStyle:{background:"#fff"}});var v={yTitle:e,yErrorMessage:t,yMessage:r,yDescription:o,yCaptureButton:a};p(v),u(v)}}),[i,n,u]);var $=SC.useCallback(xv(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return R(""),e.next=3,Q();case 3:case"end":return e.stop()}}),e)}))),[Q]);SC.useImperativeHandle(t,(function(){return{restartSession:Y}}),[Y]);var Z=!(H||null!=s&&s.disableCaptureButtonIfAlert&&S);return SC.createElement(SC.Fragment,null,!q&&SC.createElement(EW,null),H&&SC.createElement(f6,null,SC.createElement("img",{src:E,alt:"",className:"spin"})),A&&SC.createElement(WK,{x:"".concat(A.x,"px"),y:"".concat(A.y,"px"),width:"".concat(A.width,"px"),height:"".concat(A.height,"px"),surroundStyle:A.surroundStyle},SC.createElement(C6,{strokeStyles:(r={},Ov(r,EX.DEFAULT,{fill:"none",strokeWidth:5,stroke:"primaryColor"}),Ov(r,EX.ERROR,{fill:"none",strokeWidth:5,stroke:N}),r),paddingStyle:{fill:"#fff"},strokeWidth:5,errorColor:O,width:A.width,height:A.height,type:S?EX.ERROR:EX.DEFAULT})),S&&SC.createElement(b6,{y:"".concat(h,"px")},S),SC.createElement(w6,{y:"".concat(g,"px")},v0.isMobile&&SC.createElement("div",null,SC.createElement("img",{src:C,width:70,height:45,alt:""})),"Đặt CMND/CCCD của bạn vào giữa khung. Hình ảnh rõ ràng, không bị chói, mờ & cắt góc."),SC.createElement(d6,{onClick:Z?$:null,y:"".concat(m,"px")},SC.createElement("img",{src:Z?v:b,alt:""})),P&&SC.createElement(E6,{key:P,y:"".concat(y,"px")},P),SC.createElement(Z4,{open:U},M===F5.SESSION_TIMEOUT&&SC.createElement(R6,{onOk:Y,maxSessionTime:null==s?void 0:s.idCardSessionTime})))}));U6.propTypes={usePortraitMask:SE.bool,windowAndVideoInfo:SE.shape({}),refVideo:SE.shape({}),frontSide:SE.bool,settings:SE.shape({}),onCaptureDone:SE.func,onUISpacingChange:SE.func,outputEncryptionSettings:SE.shape({})},U6.defaultProps={usePortraitMask:!1,windowAndVideoInfo:{},refVideo:{},frontSide:!0,settings:{},onCaptureDone:function(){},onUISpacingChange:function(){},outputEncryptionSettings:null};var M6,V6,j6,F6,z6,K6,q6,H6,Q6=cB.button(N6||(N6=Kv(["\n background: #0b74e5;\n height: 44px;\n border-radius: 4px;\n border: 0;\n padding: 0 20px;\n color: #fff;\n cursor: pointer;\n font-size: 16px;\n font-weight: 500;\n width: 160px;\n"]))),G6=cB.button(O6||(O6=Kv(["\n background: #fff;\n height: 44px;\n border-radius: 4px;\n border: 1px solid #0b74e5;\n padding: 0 20px;\n color: #0b74e5;\n cursor: pointer;\n font-size: 16px;\n font-weight: 500;\n width: 160px;\n &:focus {\n outline: none;\n box-shadow: none;\n }\n"]))),W6=(cB.a(L6||(L6=Kv(["\n text-decoration: underline;\n font-size: 16px;\n color: #000;\n cursor: pointer;\n"]))),cB.div(M6||(M6=Kv(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"])))),X6=cB.div(V6||(V6=Kv(["\n text-align: center;\n font-size: 1rem;\n color: ",";\n margin-top: 10px;\n"])),(function(e){return e.theme.dangerColor})),Y6=cB.img(j6||(j6=Kv(["\n width: 100%;\n height: 100%;\n border-radius: 3px;\n"]))),$6=cB.div(F6||(F6=Kv(["\n margin: 20px 0;\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 10px;\n"]))),Z6=cB.div(z6||(z6=Kv(["\n width: 100%;\n max-width: 960px;\n border: 5px solid #1aa7ff;\n border-radius: 8px;\n margin-top: ","px;\n"])),v0.isMobile?20:0),J6=cB.div(K6||(K6=Kv(["\n font-size: ","px;\n font-weight: 500;\n color: #38383d;\n"])),v0.isMobile?16:24),e8=cB.div(q6||(q6=Kv(["\n margin: 8px 0;\n font-size: ","px;\n font-weight: normal;\n color: #38383d;\n text-align: center;\n"])),v0.isMobile?14:16),t8=cB.div(H6||(H6=Kv(["\n margin-top: 20px;\n font-size: ","px;\n font-weight: normal;\n color: #38383d;\n text-align: center;\n"])),v0.isMobile?14:16),r8=function(e){var t=e.imageTaken,r=e.onConfirm,n=e.onTryAgain,i=e.error,a=e.hasValidQR,o=qv(SC.useState(null),2),s=o[0],c=o[1],u=vB.useSDKSettings().lang;return SC.useEffect((function(){var e;return t&&(e=URL.createObjectURL(t.blob),c(e)),function(){URL.revokeObjectURL(e)}}),[t]),SC.createElement(W6,null,null!==a&&SC.createElement(w$,{mb:"20px"},SC.createElement("div",null,SC.createElement(LZ,{type:a?IZ.SUCCESS:IZ.WARNING},a?T6.CONFIRM_POPUP_VALID_QR[u]:T6.CONFIRM_POPUP_INVALID_QR[u]))),SC.createElement(J6,null,"Chụp mặt trước"),!v0.isMobile&&SC.createElement(e8,null,"Đặt CMND / CCCD của bạn vào giữa khung. Hình ảnh rõ ràng, không bị chói mờ & cắt góc."),SC.createElement(Z6,null,SC.createElement(W$,{ratio:1.5},SC.createElement(Y6,{src:s}))),SC.createElement(t8,null,"Nhìn ổn chứ? Bạn có thể tự chụp lại để có ảnh tốt hơn."),i&&SC.createElement(X6,{className:"confirm-popup-error-message"},i.msg[u]),SC.createElement($6,null,SC.createElement(G6,{type:"button",onClick:n},T6.BTN_TRY_AGAIN[u]),SC.createElement(Q6,{onClick:r},T6.BTN_USE_THIS_PICTURE[u])))};r8.propTypes={imageTaken:SE.shape({}),error:SE.shape({msg:SE.shape({})}),onConfirm:SE.func,onTryAgain:SE.func,hasValidQR:SE.bool},r8.defaultProps={imageTaken:null,error:null,onConfirm:function(){},onTryAgain:function(){},hasValidQR:null};var n8,i8={primaryColor:"#1AA7FF",dangerColor:"#FF424E"},a8={SESSION_TIMEOUT:"SESSION_TIMEOUT",CONFIRM:"CONFIRM",QR_INVALID:"QR_INVALID"},o8=lB(n8||(n8=Kv(["\n"]))),s8=hB.IDCardSide,c8=hB.IDCardType,u8={ID_CARD:"id_card",QR_CODE:"qr_code"},l8=[{scannerType:u8.ID_CARD,title:"Chụp mặt trước",cardSide:hB.IDCardSide.FRONT,cardType:c8.VN,frontCamera:!1,enableConfirmPopup:!0},{scannerType:u8.ID_CARD,title:"Chụp mặt sau",cardSide:hB.IDCardSide.BACK,cardType:c8.VN,frontCamera:!1,enableConfirmPopup:!0}];function d8(e){var t=e.onClose,r=e.onError,n=e.clientSettings,i=e.onStepDone,a=e.steps,o=e.outputEncryptionSettings,s=qv(SC.useState(0),2),c=s[0],u=s[1],l=qv(SC.useState(a[c]),2),d=l[0],f=l[1],p=SC.useRef(null),h=qv(SC.useState(null),2),g=h[0],m=h[1],y=qv(SC.useState(!1),2),v=y[0],b=y[1],C=qv(SC.useState(0),2),E=C[0],w=C[1],k=SC.useRef(),S=d.scannerType,B=d.frontCamera,T=d.title,A=d.cardSide,I=d.usePortraitMask,_=d.enableConfirmPopup,x=d_.useAsset("ic_close.png"),P=d_.useAsset("ic_close_desktop.png"),R=d_.useAsset("ic_loading.png"),N=A===s8.FRONT,O=_Y(),L=O.showPopup,D=O.popupShown,U=O.popupType,M=O.props,V=qv(SC.useState(!1),2),j=V[0],F=V[1],z=SC.useRef(null),K=SC.useRef(null),q=SC.useRef([]),H=hJ({clientSettings:n}).settings,Q=qv(SC.useState({}),2),G=Q[0],W=Q[1],X=G.yTitle,Y=c_.useSDKTracking().sendEvent,$=SC.useCallback((function(e){m(e),b(!0)}),[]);SC.useEffect((function(){b(!1)}),[B]);var Z=SC.useCallback((function(){L({popupType:null})}),[L]),J=SC.useCallback((function(e){e>=a.length||setTimeout((function(){u(e),f(a[e])}),200)}),[a]),ee=SC.useCallback((function(){J(c+1)}),[J,c]),te=SC.useCallback(xv(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={stepNumber:c,image:z.current,recordedVideos:null!=H&&H.enableRecording?q.current:[]},S===u8.QR_CODE&&(t.qrScannedResult=K.current),F(!0),e.next=5,i(t);case 5:Y({tag:"result",event:"sdk_mode.read_id_card_one_side",log:{result_object:t}}),F(!1),ee();case 8:case"end":return e.stop()}}),e)}))),[H,c,i,ee,S,Y]),re=SC.useCallback((function(){Z(),S===u8.QR_CODE?J(c):S===u8.ID_CARD&&(Y({tag:N?"id_front":"id_back",event:"user_activity.retry",log:{}}),k.current.restartSession())}),[J,c,Z,S,N,Y]),ne=SC.useCallback((function(){Z(),Y({tag:N?"id_front":"id_back",event:"user_activity.submit",log:{}}),te()}),[te,Z,Y,N]),ie=SC.useCallback(function(){var e=xv(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.image,n=t.error,i=t.recordedVideos,z.current=r,q.current=i,w((function(e){return e+1})),_?L({popupType:a8.CONFIRM,props:{imageTaken:z.current,error:n}}):te();case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[_,L,te]);return SC.createElement(aB,{theme:i8},SC.createElement(s6,null,SC.createElement(zK,{key:B,frontCamera:B,onVideoPlayed:$,onClose:t,flipHorizontal:B,ref:p,onError:r,closeButton:SC.createElement(S6,null,SC.createElement("img",{src:v0.isMobile?x:P,alt:""}))},v&&SC.createElement(SC.Fragment,null,S===u8.ID_CARD&&SC.createElement(U6,{key:c,ref:k,windowAndVideoInfo:g,refVideo:p,settings:H,onCaptureDone:ie,onUISpacingChange:W,frontSide:N,usePortraitMask:I,outputEncryptionSettings:o})),SC.createElement(o6,{keyForTransition:E}),SC.createElement(h6,{y:"".concat(X,"px")},SC.createElement(y0,null,SC.createElement(d0,{key:T,timeout:{enter:a6,exit:a6},classNames:"flipY",unmountOnExit:!0},SC.createElement(g6,null,SC.createElement(m6,null,T))))),j&&SC.createElement(f6,null,SC.createElement("img",{src:R,alt:"",className:"spin"}))),SC.createElement(rW,{open:D,overlayStyle:{padding:0},contentStyle:{maxWidth:"none",width:"100%",height:"100%",borderRadius:0}},U===a8.CONFIRM&&SC.createElement(r8,Lv({},M,{onConfirm:ne,onTryAgain:re})))),SC.createElement(o8,null))}d8.propTypes={onClose:SE.func,onError:SE.func,clientSettings:SE.shape({}),detectIdCard:SE.func,onStepDone:SE.func,steps:SE.arrayOf(SE.shape({})),outputEncryptionSettings:SE.shape({})},d8.defaultProps={onClose:function(){},onError:function(){},clientSettings:{},detectIdCard:function(){return Promise.resolve({card_label:""})},onStepDone:function(){},steps:l8,outputEncryptionSettings:null};var f8=function(e,t,r,n,i,a,o,s){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,n,i,a,o,s],l=0;(c=new Error(t.replace(/%s/g,(function(){return u[l++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}},p8=f8,h8=s((function(e,t){!function(e,t){t=t&&t.hasOwnProperty("default")?t.default:t;var r=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.post("/v1/read_id_card_info_sync",e,t)},e}(),n=function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};
|
62
|
+
/*! *****************************************************************************
|
63
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
64
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
65
|
+
this file except in compliance with the License. You may obtain a copy of the
|
66
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
67
|
+
|
68
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
69
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
70
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
71
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
72
|
+
|
73
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
74
|
+
and limitations under the License.
|
75
|
+
***************************************************************************** */function i(e,t,r,n){var i,a=arguments.length,o=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,r,o):i(t,r))||o);return a>3&&o&&Object.defineProperty(t,r,o),o}function o(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function s(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))}function c(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}var u=function(){function e(e){this.httpClient=e}return e.prototype.uploadImage=function(e){return this.httpClient.postFormData("/v1/images",e)},e.prototype.request=function(e){var t="application/pdf"===e.file.type;return this.httpClient.postFormData(t?"/v1/files":"/v1/images",e)},e.prototype.requestWithHeaders=function(e,t){return this.httpClient.postFormData("/v1/images",e,t)},e.prototype.download=function(e){return s(this,void 0,void 0,(function(){var t;return c(this,(function(r){switch(r.label){case 0:return[4,this.httpClient.downloadFile("/v1/images/"+e)];case 1:return t=r.sent(),[4,URL.createObjectURL(t)];case 2:return[2,r.sent()]}}))}))},e.prototype.updateMetadata=function(e,t){return this.httpClient.patch("/v1/images/"+e,t)},e}(),l=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.post("/v1/files",e,t)},e.prototype.uploadFile=function(e){return this.httpClient.postFormData("/v1/files",e)},e.prototype.requestWithHeaders=function(e,t){return this.httpClient.postFormData("/v1/files",e,t)},e}(),d=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.post("/v1/compare_faces_sync",e,t)},e}(),f=function(){function e(e){this.httpClient=e}return e.prototype.getClientSettings=function(){return this.httpClient.get("/v1/client_settings")},e.prototype.request=function(){return this.httpClient.get("/v1/client_settings")},e}(),p=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.post("/v1/verify_face_liveness_sync",e,t)},e}(),h=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.post("/v1/verify_id_card_sanity_sync",e,t)},e}(),g=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.post("/v1/verify_portrait_sanity_sync",e,t)},e}(),m=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.post("/v1/detect_id_card_tampering_sync",e,t)},e.prototype.requestWithAuthHeaders=function(e,t){return this.httpClient.post("/v1/detect_id_card_tampering_sync",e,t)},e}(),y=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.post("/v1/search_faces_sync",e,t)},e.prototype.indexFaces=function(e,t){return this.httpClient.post("/v1/index_faces_sync",e,t)},e.prototype.deleteFaces=function(e,t){return this.httpClient.post("/v1/delete_faces",e,t)},e.prototype.downloadFaceImage=function(e){return s(this,void 0,void 0,(function(){var t;return c(this,(function(r){switch(r.label){case 0:return[4,this.httpClient.downloadFile("/v1/face_images/"+e)];case 1:return t=r.sent(),[2,URL.createObjectURL(t)]}}))}))},e}(),v=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.postFormData("/v1/convert_pdf_sync",e,t)},e}(),b=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.post("/v1/ekyc_pdf",e,t)},e}(),C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==a?a:"undefined"!=typeof self?self:{};function E(e,t){return e(t={exports:{}},t.exports),t.exports}var w=E((function(e){var t,r;t=C,r=function(){function e(e){var t=[];if(0===e.length)return"";if("string"!=typeof e[0])throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var r=e.shift();e[0]=r+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var n=0;n<e.length;n++){var i=e[n];if("string"!=typeof i)throw new TypeError("Url must be a string. Received "+i);""!==i&&(n>0&&(i=i.replace(/^[\/]+/,"")),i=n<e.length-1?i.replace(/[\/]+$/,""):i.replace(/[\/]+$/,"/"),t.push(i))}var a=t.join("/"),o=(a=a.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return o.shift()+(o.length>0?"?":"")+o.join("&")}return function(){return e("object"==typeof arguments[0]?arguments[0]:[].slice.call(arguments))}},e.exports?e.exports=r():t.urljoin=r()}));function k(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var S=function(e,t,r,n){t=t||"&",r=r||"=";var i={};if("string"!=typeof e||0===e.length)return i;var a=/\+/g;e=e.split(t);var o=1e3;n&&"number"==typeof n.maxKeys&&(o=n.maxKeys);var s=e.length;o>0&&s>o&&(s=o);for(var c=0;c<s;++c){var u,l,d,f,p=e[c].replace(a,"%20"),h=p.indexOf(r);h>=0?(u=p.substr(0,h),l=p.substr(h+1)):(u=p,l=""),d=decodeURIComponent(u),f=decodeURIComponent(l),k(i,d)?Array.isArray(i[d])?i[d].push(f):i[d]=[i[d],f]:i[d]=f}return i},B=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},T=function(e,t,r,n){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(n){var i=encodeURIComponent(B(n))+r;return Array.isArray(e[n])?e[n].map((function(e){return i+encodeURIComponent(B(e))})).join(t):i+encodeURIComponent(B(e[n]))})).join(t):n?encodeURIComponent(B(n))+r+encodeURIComponent(B(e)):""},A=E((function(e,t){t.decode=t.parse=S,t.encode=t.stringify=T})),I=(A.decode,A.parse,A.encode,A.stringify),_=function(){function e(e){this.authorizer=e.authorizer,this.domain=e.domain,this.onError=e.onError,this.configHeaders=e.headers}return e.prototype.get=function(e,t,r){var n=new URL(this.resolveUrl(e));return t&&(n.search=I(t)),this.request(n.toString(),{requestPath:e,method:"GET",headers:r})},e.prototype.post=function(e,t,r){var i=this.resolveUrl(e);return this.request(i,{requestPath:e,method:"POST",body:JSON.stringify(t),headers:n({"Content-Type":"application/json"},r)})},e.prototype.postFormData=function(e,t,r){var n,i=t instanceof FormData?t:(n=t,Object.entries(n).reduce((function(e,t){var r=t[0],n=t[1];return Array.isArray(n)?n.forEach((function(t,i){return e.append(r+"["+i+"]",n)})):!(n instanceof Object)||n instanceof File||n instanceof Date||n instanceof Blob?e.append(r,n):Object.entries(n).forEach((function(t,i){return e.append(r+"["+i+"]",n[i])})),e}),new FormData)),a=this.resolveUrl(e);return this.request(a,{requestPath:e,method:"POST",body:i,headers:r})},e.prototype.patch=function(e,t,r){var i=this.resolveUrl(e);return this.request(i,{requestPath:e,method:"PATCH",body:JSON.stringify(t),headers:n({"Content-Type":"application/json"},r)})},e.prototype.delete=function(e,t,r){var i=this.resolveUrl(e);return this.request(i,{requestPath:e,method:"DELETE",body:JSON.stringify(t),headers:n({"Content-Type":"application/json"},r)})},e.prototype.downloadFile=function(e){var t=this.resolveUrl(e);return this.request(t,{requestPath:e,method:"GET"},"blob")},e.prototype.request=function(e,t,r){return void 0===r&&(r="json"),s(this,void 0,void 0,(function(){var i,a,o,s;return c(this,(function(c){switch(c.label){case 0:return i={},a={},this.authorizer&&(i=this.authorizer.getHeaders(t)),this.configHeaders&&(a=this.configHeaders),t.headers=n(n(n({},t.headers),i),a),[4,fetch(e,t)];case 1:return o=c.sent(),[4,"blob"===r?o.blob():o.json()];case 2:if((s=c.sent()).errors&&this.onError)throw this.onError(s.errors),s;return[2,s]}}))}))},e.prototype.resolveUrl=function(e){return w(this.domain,e)},e}(),x=function(){function e(e){this.mocks=e}return e.prototype.get=function(e,t){return this.findInMocks(e,t)},e.prototype.post=function(e,t){return this.findInMocks(e)},e.prototype.postFormData=function(e,t){return this.findInMocks(e)},e.prototype.patch=function(e,t){return this.findInMocks(e)},e.prototype.delete=function(e,t){return this.findInMocks(e)},e.prototype.downloadFile=function(e){return this.findInMocks(e)},e.prototype.resolveUrl=function(e){return this.mocks.resolveUrl?this.mocks.resolveUrl(e):e},e.prototype.findInMocks=function(e,t){return s(this,void 0,void 0,(function(){return c(this,(function(r){return this.mocks[e]?"function"==typeof this.mocks[e]?[2,Promise.resolve(this.mocks[e](t))]:[2,Promise.resolve(this.mocks[e])]:[2,Promise.reject(new Error(e+" is not presented in mocks"))]}))}))},e}(),P=E((function(e,t){var r;e.exports=r=r||function(e,t){var r=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),n={},i=n.lib={},a=i.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},o=i.WordArray=a.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||c).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var a=0;a<i;a++){var o=r[a>>>2]>>>24-a%4*8&255;t[n+a>>>2]|=o<<24-(n+a)%4*8}else for(a=0;a<i;a+=4)t[n+a>>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r,n=[],i=function(t){t=t;var r=987654321,n=4294967295;return function(){var i=((r=36969*(65535&r)+(r>>16)&n)<<16)+(t=18e3*(65535&t)+(t>>16)&n)&n;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}},a=0;a<t;a+=4){var s=i(4294967296*(r||e.random()));r=987654071*s(),n.push(4294967296*s()|0)}return new o.init(n,t)}}),s=n.enc={},c=s.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var a=t[i>>>2]>>>24-i%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new o.init(r,t/2)}},u=s.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var a=t[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new o.init(r,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},d=i.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,n=r.words,i=r.sigBytes,a=this.blockSize,s=i/(4*a),c=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,u=e.min(4*c,i);if(c){for(var l=0;l<c;l+=a)this._doProcessBlock(n,l);var d=n.splice(0,c);r.sigBytes-=u}return new o.init(d,u)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),f=(i.Hasher=d.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new f.HMAC.init(e,r).finalize(t)}}}),n.algo={});return n}(Math)})),R=E((function(e,t){var r,n,i;e.exports=(n=(r=i=P).lib.WordArray,r.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],a=0;a<r;a+=3)for(var o=(t[a>>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.75*s<r;s++)i.push(n.charAt(o>>>6*(3-s)&63));var c=n.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(e){var t=e.length,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a<r.length;a++)i[r.charCodeAt(a)]=a}var o=r.charAt(64);if(o){var s=e.indexOf(o);-1!==s&&(t=s)}return function(e,t,r){for(var i=[],a=0,o=0;o<t;o++)if(o%4){var s=r[e.charCodeAt(o-1)]<<o%4*2,c=r[e.charCodeAt(o)]>>>6-o%4*2;i[a>>>2]|=(s|c)<<24-a%4*8,a++}return n.create(i,a)}(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},i.enc.Base64)})),N=(E((function(e,t){var r;e.exports=(r=P,function(e){var t=r,n=t.lib,i=n.WordArray,a=n.Hasher,o=t.algo,s=[],c=[];!function(){function t(t){for(var r=e.sqrt(t),n=2;n<=r;n++)if(!(t%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)t(n)&&(i<8&&(s[i]=r(e.pow(n,.5))),c[i]=r(e.pow(n,1/3)),i++),n++}();var u=[],l=o.SHA256=a.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],l=r[5],d=r[6],f=r[7],p=0;p<64;p++){if(p<16)u[p]=0|e[t+p];else{var h=u[p-15],g=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,m=u[p-2],y=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;u[p]=g+u[p-7]+y+u[p-16]}var v=n&i^n&a^i&a,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),C=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&d)+c[p]+u[p];f=d,d=l,l=s,s=o+C|0,o=a,a=i,i=n,n=C+(b+v)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0,r[5]=r[5]+l|0,r[6]=r[6]+d|0,r[7]=r[7]+f|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=e.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=a._createHelper(l),t.HmacSHA256=a._createHmacHelper(l)}(Math),r.SHA256)})),E((function(e,t){var r,n,i;e.exports=(n=(r=P).lib.Base,i=r.enc.Utf8,void(r.algo.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=i.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var a=this._oKey=t.clone(),o=this._iKey=t.clone(),s=a.words,c=o.words,u=0;u<r;u++)s[u]^=1549556828,c[u]^=909522486;a.sigBytes=o.sigBytes=n,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,r=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(r))}})))})),E((function(e,t){e.exports=P.HmacSHA256}))),O=function(){function e(e,t){this.accessKey=e,this.keySecret=t}return e.prototype.getHeaders=function(e){var t=function(e){function t(e){return e<10?"0"+e:e}return e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())+"T"+t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds())+(0===(r=e.getTimezoneOffset())?"Z":(n=r>0?"-":"+",r=Math.abs(r),n+t(Math.floor(r/60))+":"+t(r%60)));var r,n}(new Date);return{Authorization:this.generateAuthorization(e.requestPath,e.method,t),"X-TV-Timestamp":t}},e.prototype.generateAuthorization=function(e,t,r){var n=this.computeStringToSign(e,t,r),i=R.stringify(this.computeSignature(n));return this.formatAuthToken("TV",i)},e.prototype.formatAuthToken=function(e,t){return e+" "+this.accessKey+":"+t},e.prototype.computeStringToSign=function(e,t,r){return t+"\n"+e+"\n"+r},e.prototype.computeSignature=function(e){return N(e,this.keySecret)},e}();function L(e){switch(e){case"testing":return"https://tv-testing.trustingsocial.com/api";case"staging":return"https://tv-staging.trustingsocial.com/api";case"production":return"https://vn-vision.trustingsocial.com/api";default:return e}}function D(e,t,r,n){void 0===r&&(r="production");var i=(void 0===n?{}:n).headers,a=new O(e,t),o=L(r);return new _({authorizer:a,domain:o,headers:i})}var U=function(){function e(e){void 0===e&&(e="production");var t=new _({domain:L(e)});this.imagesService=new u(t),this.detectIDTamperingService=new m(t)}return e.prototype.uploadImage=function(e,t){return this.imagesService.requestWithHeaders(e,t)},e.prototype.detectTampering=function(e,t){return this.detectIDTamperingService.requestWithAuthHeaders(e,t)},e}();function M(e){var t=e.headerIndex;return function(e,r,i){var a=i.value,o=n({},i);return o.value=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return s(this,void 0,void 0,(function(){var r,i,o,s;return c(this,(function(c){switch(c.label){case 0:return this.transactionEnabled?[4,this.transactionManager.begin()]:[3,4];case 1:return r=c.sent(),i=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)n[i]=a[o];return n}(e),(o=n({},i[t]))["X-TV-Transaction"]=r,i[t]=o,[4,a.apply(this,i)];case 2:return s=c.sent(),[4,this.transactionManager.end()];case 3:return c.sent(),[2,s];case 4:return[4,a.apply(this,e)];case 5:return[2,c.sent()]}}))}))},o}}function V(e){return void 0===e&&(e={encryptedField:"data"}),function(t,r,i){var a=i.value,o=n({},i);return o.value=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return s(this,void 0,void 0,(function(){var r,n;return c(this,(function(i){switch(i.label){case 0:return[4,a.apply(this,t)];case 1:return r=i.sent(),this.encryptionEnabled&&"string"==typeof r[e.encryptedField]?(n=this.encryptionService.decrypt(r[e.encryptedField],{transactionID:this.transactionManager.currentTransactionID}),[2,JSON.parse(n)]):[2,r]}}))}))},o}}var j=function(){function e(e){this.httpClient=e,this.transactionID="",this.totalTransactions=0,this.currentTransaction=0}return Object.defineProperty(e.prototype,"currentTransactionID",{get:function(){return this.transactionID},enumerable:!0,configurable:!0}),e.prototype.begin=function(){return s(this,void 0,void 0,(function(){var e,t,r=this;return c(this,(function(n){switch(n.label){case 0:return e=this.totalTransactions++,[4,new Promise((function(t,n){var i=window.performance.now(),a=setInterval((function(){e===r.currentTransaction&&(clearInterval(a),t(!0)),window.performance.now()-i>=3e3&&(clearInterval(a),n(new Error("Transaction timeout")))}),100)}))];case 1:return n.sent(),[4,this.httpClient.post("/v1/transactions",{})];case 2:return t=n.sent().data,this.transactionID=t.id,[2,t.id]}}))}))},e.prototype.end=function(){return s(this,void 0,void 0,(function(){var e;return c(this,(function(t){switch(t.label){case 0:return[4,this.httpClient.post("/v1/transactions/"+this.transactionID+"/finish")];case 1:return e=t.sent(),this.transactionID="",this.currentTransaction++,[2,e]}}))}))},e}(),F={options:{usePureJavaScript:!1}},z={},K=z,q={};z.encode=function(e,t,r){if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!=typeof r)throw new TypeError('"maxline" must be a number.');var n="";if(e instanceof Uint8Array){var i=0,a=t.length,o=t.charAt(0),s=[0];for(i=0;i<e.length;++i){for(var c=0,u=e[i];c<s.length;++c)u+=s[c]<<8,s[c]=u%a,u=u/a|0;for(;u>0;)s.push(u%a),u=u/a|0}for(i=0;0===e[i]&&i<e.length-1;++i)n+=o;for(i=s.length-1;i>=0;--i)n+=t[s[i]]}else n=function(e,t){var r=0,n=t.length,i=t.charAt(0),a=[0];for(r=0;r<e.length();++r){for(var o=0,s=e.at(r);o<a.length;++o)s+=a[o]<<8,a[o]=s%n,s=s/n|0;for(;s>0;)a.push(s%n),s=s/n|0}var c="";for(r=0;0===e.at(r)&&r<e.length()-1;++r)c+=i;for(r=a.length-1;r>=0;--r)c+=t[a[r]];return c}(e,t);if(r){var l=new RegExp(".{1,"+r+"}","g");n=n.match(l).join("\r\n")}return n},z.decode=function(e,t){if("string"!=typeof e)throw new TypeError('"input" must be a string.');if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');var r=q[t];if(!r){r=q[t]=[];for(var n=0;n<t.length;++n)r[t.charCodeAt(n)]=n}e=e.replace(/\s/g,"");var i=t.length,a=t.charAt(0),o=[0];for(n=0;n<e.length;n++){var s=r[e.charCodeAt(n)];if(void 0===s)return;for(var c=0,u=s;c<o.length;++c)u+=o[c]*i,o[c]=255&u,u>>=8;for(;u>0;)o.push(255&u),u>>=8}for(var l=0;e[l]===a&&l<e.length-1;++l)o.push(0);return"undefined"!=typeof Buffer?Buffer.from(o.reverse()):new Uint8Array(o.reverse())},E((function(e){var t=e.exports=F.util=F.util||{};function r(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function n(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(t.isArrayBuffer(e)||t.isArrayBufferView(e))if("undefined"!=typeof Buffer&&e instanceof Buffer)this.data=e.toString("binary");else{var r=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,r)}catch(e){for(var i=0;i<r.length;++i)this.putByte(r[i])}}else(e instanceof n||"object"==typeof e&&"string"==typeof e.data&&"number"==typeof e.read)&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}!function(){if("undefined"!=typeof process&&process.nextTick&&!process.browser)return t.nextTick=process.nextTick,void("function"==typeof setImmediate?t.setImmediate=setImmediate:t.setImmediate=t.nextTick);if("function"==typeof setImmediate)return t.setImmediate=function(){return setImmediate.apply(void 0,arguments)},void(t.nextTick=function(e){return setImmediate(e)});if(t.setImmediate=function(e){setTimeout(e,0)},"undefined"!=typeof window&&"function"==typeof window.postMessage){var e="forge.setImmediate",r=[];t.setImmediate=function(t){r.push(t),1===r.length&&window.postMessage(e,"*")},window.addEventListener("message",(function(t){if(t.source===window&&t.data===e){t.stopPropagation();var n=r.slice();r.length=0,n.forEach((function(e){e()}))}}),!0)}if("undefined"!=typeof MutationObserver){var n=Date.now(),i=!0,a=document.createElement("div");r=[],new MutationObserver((function(){var e=r.slice();r.length=0,e.forEach((function(e){e()}))})).observe(a,{attributes:!0});var o=t.setImmediate;t.setImmediate=function(e){Date.now()-n>15?(n=Date.now(),o(e)):(r.push(e),1===r.length&&a.setAttribute("a",i=!i))}}t.nextTick=t.setImmediate}(),t.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,t.globalScope=t.isNodejs?C:"undefined"==typeof self?window:self,t.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},t.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},t.isArrayBufferView=function(e){return e&&t.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},t.ByteBuffer=n,t.ByteStringBuffer=n,t.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},t.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},t.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},t.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},t.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},t.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},t.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(t.encodeUtf8(e))},t.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},t.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},t.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},t.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},t.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},t.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},t.ByteStringBuffer.prototype.putInt=function(e,t){r(t);var n="";do{t-=8,n+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(n)},t.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},t.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())},t.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},t.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e},t.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e},t.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e},t.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e},t.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e},t.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e},t.ByteStringBuffer.prototype.getInt=function(e){r(e);var t=0;do{t=(t<<8)+this.data.charCodeAt(this.read++),e-=8}while(e>0);return t},t.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},t.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},t.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},t.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},t.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},t.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},t.ByteStringBuffer.prototype.copy=function(){var e=t.createBuffer(this.data);return e.read=this.read,e},t.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},t.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},t.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},t.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var r=this.data.charCodeAt(t);r<16&&(e+="0"),e+=r.toString(16)}return e},t.ByteStringBuffer.prototype.toString=function(){return t.decodeUtf8(this.bytes())},t.DataBuffer=function(e,r){r=r||{},this.read=r.readOffset||0,this.growSize=r.growSize||1024;var n=t.isArrayBuffer(e),i=t.isArrayBufferView(e);if(n||i)return this.data=n?new DataView(e):new DataView(e.buffer,e.byteOffset,e.byteLength),void(this.write="writeOffset"in r?r.writeOffset:this.data.byteLength);this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!=e&&this.putBytes(e),"writeOffset"in r&&(this.write=r.writeOffset)},t.DataBuffer.prototype.length=function(){return this.write-this.read},t.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},t.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this},t.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},t.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r<t;++r)this.data.setUint8(e);return this},t.DataBuffer.prototype.putBytes=function(e,r){if(t.isArrayBufferView(e)){var n=(i=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)).byteLength-i.byteOffset;return this.accommodate(n),new Uint8Array(this.data.buffer,this.write).set(i),this.write+=n,this}if(t.isArrayBuffer(e)){var i=new Uint8Array(e);return this.accommodate(i.byteLength),new Uint8Array(this.data.buffer).set(i,this.write),this.write+=i.byteLength,this}if(e instanceof t.DataBuffer||"object"==typeof e&&"number"==typeof e.read&&"number"==typeof e.write&&t.isArrayBufferView(e.data))return i=new Uint8Array(e.data.byteLength,e.read,e.length()),this.accommodate(i.byteLength),new Uint8Array(e.data.byteLength,this.write).set(i),this.write+=i.byteLength,this;if(e instanceof t.ByteStringBuffer&&(e=e.data,r="binary"),r=r||"binary","string"==typeof e){var a;if("hex"===r)return this.accommodate(Math.ceil(e.length/2)),a=new Uint8Array(this.data.buffer,this.write),this.write+=t.binary.hex.decode(e,a,this.write),this;if("base64"===r)return this.accommodate(3*Math.ceil(e.length/4)),a=new Uint8Array(this.data.buffer,this.write),this.write+=t.binary.base64.decode(e,a,this.write),this;if("utf8"===r&&(e=t.encodeUtf8(e),r="binary"),"binary"===r||"raw"===r)return this.accommodate(e.length),a=new Uint8Array(this.data.buffer,this.write),this.write+=t.binary.raw.decode(a),this;if("utf16"===r)return this.accommodate(2*e.length),a=new Uint16Array(this.data.buffer,this.write),this.write+=t.text.utf16.encode(a),this;throw new Error("Invalid encoding: "+r)}throw Error("Invalid parameter: "+e)},t.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this},t.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")},t.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this},t.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},t.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},t.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},t.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},t.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},t.DataBuffer.prototype.putInt=function(e,t){r(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},t.DataBuffer.prototype.putSignedInt=function(e,t){return r(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)},t.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},t.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e},t.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e},t.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e},t.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e},t.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e},t.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e},t.DataBuffer.prototype.getInt=function(e){r(e);var t=0;do{t=(t<<8)+this.data.getInt8(this.read++),e-=8}while(e>0);return t},t.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},t.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},t.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},t.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},t.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},t.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},t.DataBuffer.prototype.copy=function(){return new t.DataBuffer(this)},t.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},t.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},t.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},t.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var r=this.data.getUint8(t);r<16&&(e+="0"),e+=r.toString(16)}return e},t.DataBuffer.prototype.toString=function(e){var r=new Uint8Array(this.data,this.read,this.length());if("binary"===(e=e||"utf8")||"raw"===e)return t.binary.raw.encode(r);if("hex"===e)return t.binary.hex.encode(r);if("base64"===e)return t.binary.base64.encode(r);if("utf8"===e)return t.text.utf8.decode(r);if("utf16"===e)return t.text.utf16.decode(r);throw new Error("Invalid encoding: "+e)},t.createBuffer=function(e,r){return r=r||"raw",void 0!==e&&"utf8"===r&&(e=t.encodeUtf8(e)),new t.ByteBuffer(e)},t.fillString=function(e,t){for(var r="";t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},t.xorBytes=function(e,t,r){for(var n="",i="",a="",o=0,s=0;r>0;--r,++o)i=e.charCodeAt(o)^t.charCodeAt(o),s>=10&&(n+=a,a="",s=0),a+=String.fromCharCode(i),++s;return n+a},t.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r<e.length;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t},t.bytesToHex=function(e){return t.createBuffer(e).toHex()},t.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],o="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";t.encode64=function(e,t){for(var r,n,a,o="",s="",c=0;c<e.length;)r=e.charCodeAt(c++),n=e.charCodeAt(c++),a=e.charCodeAt(c++),o+=i.charAt(r>>2),o+=i.charAt((3&r)<<4|n>>4),isNaN(n)?o+="==":(o+=i.charAt((15&n)<<2|a>>6),o+=isNaN(a)?"=":i.charAt(63&a)),t&&o.length>t&&(s+=o.substr(0,t)+"\r\n",o=o.substr(t));return s+o},t.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,n,i,o="",s=0;s<e.length;)t=a[e.charCodeAt(s++)-43],r=a[e.charCodeAt(s++)-43],n=a[e.charCodeAt(s++)-43],i=a[e.charCodeAt(s++)-43],o+=String.fromCharCode(t<<2|r>>4),64!==n&&(o+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(o+=String.fromCharCode((3&n)<<6|i)));return o},t.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},t.decodeUtf8=function(e){return decodeURIComponent(escape(e))},t.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:K.encode,decode:K.decode}},t.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},t.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,a=0;a<e.length;++a)n[i++]=e.charCodeAt(a);return t?i-r:n},t.binary.hex.encode=t.bytesToHex,t.binary.hex.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(Math.ceil(e.length/2)));var i=0,a=r=r||0;for(1&e.length&&(i=1,n[a++]=parseInt(e[0],16));i<e.length;i+=2)n[a++]=parseInt(e.substr(i,2),16);return t?a-r:n},t.binary.base64.encode=function(e,t){for(var r,n,a,o="",s="",c=0;c<e.byteLength;)r=e[c++],n=e[c++],a=e[c++],o+=i.charAt(r>>2),o+=i.charAt((3&r)<<4|n>>4),isNaN(n)?o+="==":(o+=i.charAt((15&n)<<2|a>>6),o+=isNaN(a)?"=":i.charAt(63&a)),t&&o.length>t&&(s+=o.substr(0,t)+"\r\n",o=o.substr(t));return s+o},t.binary.base64.decode=function(e,t,r){var n,i,o,s,c=t;c||(c=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,l=r=r||0;u<e.length;)n=a[e.charCodeAt(u++)-43],i=a[e.charCodeAt(u++)-43],o=a[e.charCodeAt(u++)-43],s=a[e.charCodeAt(u++)-43],c[l++]=n<<2|i>>4,64!==o&&(c[l++]=(15&i)<<4|o>>2,64!==s&&(c[l++]=(3&o)<<6|s));return t?l-r:c.subarray(0,l)},t.binary.base58.encode=function(e,r){return t.binary.baseN.encode(e,o,r)},t.binary.base58.decode=function(e,r){return t.binary.baseN.decode(e,o,r)},t.text={utf8:{},utf16:{}},t.text.utf8.encode=function(e,r,n){e=t.encodeUtf8(e);var i=r;i||(i=new Uint8Array(e.length));for(var a=n=n||0,o=0;o<e.length;++o)i[a++]=e.charCodeAt(o);return r?a-n:i},t.text.utf8.decode=function(e){return t.decodeUtf8(String.fromCharCode.apply(null,e))},t.text.utf16.encode=function(e,t,r){var n=t;n||(n=new Uint8Array(2*e.length));for(var i=new Uint16Array(n.buffer),a=r=r||0,o=r,s=0;s<e.length;++s)i[o++]=e.charCodeAt(s),a+=2;return t?a-r:n},t.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))},t.deflate=function(e,r,n){if(r=t.decode64(e.deflate(t.encode64(r)).rval),n){var i=2;32&r.charCodeAt(1)&&(i=6),r=r.substring(i,r.length-4)}return r},t.inflate=function(e,r,n){var i=e.inflate(t.encode64(r)).rval;return null===i?null:t.decode64(i)};var s=function(e,r,n){if(!e)throw new Error("WebStorage not available.");var i;if(null===n?i=e.removeItem(r):(n=t.encode64(JSON.stringify(n)),i=e.setItem(r,n)),void 0!==i&&!0!==i.rval){var a=new Error(i.error.message);throw a.id=i.error.id,a.name=i.error.name,a}},c=function(e,r){if(!e)throw new Error("WebStorage not available.");var n=e.getItem(r);if(e.init)if(null===n.rval){if(n.error){var i=new Error(n.error.message);throw i.id=n.error.id,i.name=n.error.name,i}n=null}else n=n.rval;return null!==n&&(n=JSON.parse(t.decode64(n))),n},u=function(e,t,r,n){var i=c(e,t);null===i&&(i={}),i[r]=n,s(e,t,i)},l=function(e,t,r){var n=c(e,t);return null!==n&&(n=r in n?n[r]:null),n},d=function(e,t,r){var n=c(e,t);if(null!==n&&r in n){delete n[r];var i=!0;for(var a in n){i=!1;break}i&&(n=null),s(e,t,n)}},f=function(e,t){s(e,t,null)},p=function(e,t,r){var n,i=null;void 0===r&&(r=["web","flash"]);var a=!1,o=null;for(var s in r){n=r[s];try{if("flash"===n||"both"===n){if(null===t[0])throw new Error("Flash local storage not available.");i=e.apply(this,t),a="flash"===n}"web"!==n&&"both"!==n||(t[0]=localStorage,i=e.apply(this,t),a=!0)}catch(e){o=e}if(a)break}if(!a)throw o;return i};t.setItem=function(e,t,r,n,i){p(u,arguments,i)},t.getItem=function(e,t,r,n){return p(l,arguments,n)},t.removeItem=function(e,t,r,n){p(d,arguments,n)},t.clearItems=function(e,t,r){p(f,arguments,r)},t.parseUrl=function(e){var t=/^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g;t.lastIndex=0;var r=t.exec(e),n=null===r?null:{full:e,scheme:r[1],host:r[2],port:r[3],path:r[4]};return n&&(n.fullHost=n.host,n.port?(80!==n.port&&"http"===n.scheme||443!==n.port&&"https"===n.scheme)&&(n.fullHost+=":"+n.port):"http"===n.scheme?n.port=80:"https"===n.scheme&&(n.port=443),n.full=n.scheme+"://"+n.fullHost),n};var h=null;t.getQueryVariables=function(e){var t,r=function(e){for(var t={},r=e.split("&"),n=0;n<r.length;n++){var i,a,o=r[n].indexOf("=");o>0?(i=r[n].substring(0,o),a=r[n].substring(o+1)):(i=r[n],a=null),i in t||(t[i]=[]),i in Object.prototype||null===a||t[i].push(unescape(a))}return t};return void 0===e?(null===h&&(h="undefined"!=typeof window&&window.location&&window.location.search?r(window.location.search.substring(1)):{}),t=h):t=r(e),t},t.parseFragment=function(e){var r=e,n="",i=e.indexOf("?");i>0&&(r=e.substring(0,i),n=e.substring(i+1));var a=r.split("/");return a.length>0&&""===a[0]&&a.shift(),{pathString:r,queryString:n,path:a,query:""===n?{}:t.getQueryVariables(n)}},t.makeRequest=function(e){var r=t.parseFragment(e),n={path:r.pathString,query:r.queryString,getPath:function(e){return void 0===e?r.path:r.path[e]},getQuery:function(e,t){var n;return void 0===e?n=r.query:(n=r.query[e])&&void 0!==t&&(n=n[t]),n},getQueryLast:function(e,t){var r=n.getQuery(e);return r?r[r.length-1]:t}};return n},t.makeLink=function(e,t,r){e=jQuery.isArray(e)?e.join("/"):e;var n=jQuery.param(t||{});return r=r||"",e+(n.length>0?"?"+n:"")+(r.length>0?"#"+r:"")},t.setPath=function(e,t,r){if("object"==typeof e&&null!==e)for(var n=0,i=t.length;n<i;){var a=t[n++];if(n==i)e[a]=r;else{var o=a in e;(!o||o&&"object"!=typeof e[a]||o&&null===e[a])&&(e[a]={}),e=e[a]}}},t.getPath=function(e,t,r){for(var n=0,i=t.length,a=!0;a&&n<i&&"object"==typeof e&&null!==e;){var o=t[n++];(a=o in e)&&(e=e[o])}return a?e:r},t.deletePath=function(e,t){if("object"==typeof e&&null!==e)for(var r=0,n=t.length;r<n;){var i=t[r++];if(r==n)delete e[i];else{if(!(i in e)||"object"!=typeof e[i]||null===e[i])break;e=e[i]}}},t.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},t.format=function(e){for(var t,r,n=/%./g,i=0,a=[],o=0;t=n.exec(e);){(r=e.substring(o,n.lastIndex-2)).length>0&&a.push(r),o=n.lastIndex;var s=t[0][1];switch(s){case"s":case"o":i<arguments.length?a.push(arguments[1+i++]):a.push("<?>");break;case"%":a.push("%");break;default:a.push("<%"+s+"?>")}}return a.push(e.substring(o)),a.join("")},t.formatNumber=function(e,t,r,n){var i=e,a=isNaN(t=Math.abs(t))?2:t,o=void 0===r?",":r,s=void 0===n?".":n,c=i<0?"-":"",u=parseInt(i=Math.abs(+i||0).toFixed(a),10)+"",l=u.length>3?u.length%3:0;return c+(l?u.substr(0,l)+s:"")+u.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+s)+(a?o+Math.abs(i-u).toFixed(a).slice(2):"")},t.formatSize=function(e){return e>=1073741824?t.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?t.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?t.formatNumber(e/1024,0)+" KiB":t.formatNumber(e,0)+" bytes"},t.bytesFromIP=function(e){return-1!==e.indexOf(".")?t.bytesFromIPv4(e):-1!==e.indexOf(":")?t.bytesFromIPv6(e):null},t.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var r=t.createBuffer(),n=0;n<e.length;++n){var i=parseInt(e[n],10);if(isNaN(i))return null;r.putByte(i)}return r.getBytes()},t.bytesFromIPv6=function(e){for(var r=0,n=2*(8-(e=e.split(":").filter((function(e){return 0===e.length&&++r,!0}))).length+r),i=t.createBuffer(),a=0;a<8;++a)if(e[a]&&0!==e[a].length){var o=t.hexToBytes(e[a]);o.length<2&&i.putByte(0),i.putBytes(o)}else i.fillWithByte(0,n),n=0;return i.getBytes()},t.bytesToIP=function(e){return 4===e.length?t.bytesToIPv4(e):16===e.length?t.bytesToIPv6(e):null},t.bytesToIPv4=function(e){if(4!==e.length)return null;for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t.join(".")},t.bytesToIPv6=function(e){if(16!==e.length)return null;for(var r=[],n=[],i=0,a=0;a<e.length;a+=2){for(var o=t.bytesToHex(e[a]+e[a+1]);"0"===o[0]&&"0"!==o;)o=o.substr(1);if("0"===o){var s=n[n.length-1],c=r.length;s&&c===s.end+1?(s.end=c,s.end-s.start>n[i].end-n[i].start&&(i=n.length-1)):n.push({start:c,end:c})}r.push(o)}if(n.length>0){var u=n[i];u.end-u.start>0&&(r.splice(u.start,u.end-u.start+1,""),0===u.start&&r.unshift(""),7===u.end&&r.push(""))}return r.join(":")},t.estimateCores=function(e,r){if("function"==typeof e&&(r=e,e={}),e=e||{},"cores"in t&&!e.update)return r(null,t.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return t.cores=navigator.hardwareConcurrency,r(null,t.cores);if("undefined"==typeof Worker)return t.cores=1,r(null,t.cores);if("undefined"==typeof Blob)return t.cores=2,r(null,t.cores);var n=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(e){var t=Date.now(),r=t+4;self.postMessage({st:t,et:r})}))}.toString(),")()"],{type:"application/javascript"}));!function e(i,a,o){if(0===a){var s=Math.floor(i.reduce((function(e,t){return e+t}),0)/i.length);return t.cores=Math.max(1,s),URL.revokeObjectURL(n),r(null,t.cores)}!function(e,t){for(var r=[],i=[],a=0;a<e;++a){var o=new Worker(n);o.addEventListener("message",(function(n){if(i.push(n.data),i.length===e){for(var a=0;a<e;++a)r[a].terminate();t(null,i)}})),r.push(o)}for(a=0;a<e;++a)r[a].postMessage(a)}(o,(function(t,r){i.push(function(e,t){for(var r=[],n=0;n<e;++n)for(var i=t[n],a=r[n]=[],o=0;o<e;++o)if(n!==o){var s=t[o];(i.st>s.st&&i.st<s.et||s.st>i.st&&s.st<i.et)&&a.push(o)}return r.reduce((function(e,t){return Math.max(e,t.length)}),0)}(o,r)),e(i,a-1,o)}))}([],5,16)}})),F.cipher=F.cipher||{},F.cipher.algorithms=F.cipher.algorithms||{},F.cipher.createCipher=function(e,t){var r=e;if("string"==typeof r&&(r=F.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new F.cipher.BlockCipher({algorithm:r,key:t,decrypt:!1})},F.cipher.createDecipher=function(e,t){var r=e;if("string"==typeof r&&(r=F.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new F.cipher.BlockCipher({algorithm:r,key:t,decrypt:!0})},F.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),F.cipher.algorithms[e]=t},F.cipher.getAlgorithm=function(e){return(e=e.toUpperCase())in F.cipher.algorithms?F.cipher.algorithms[e]:null};var H=F.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};function Q(e,t){F.cipher.registerAlgorithm(e,(function(){return new F.aes.Algorithm(e,t)}))}H.prototype.start=function(e){e=e||{};var t={};for(var r in e)t[r]=e[r];t.decrypt=this._decrypt,this._finish=!1,this._input=F.util.createBuffer(),this.output=e.output||F.util.createBuffer(),this.mode.start(t)},H.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},H.prototype.finish=function(e){!e||"ECB"!==this.mode.name&&"CBC"!==this.mode.name||(this.mode.pad=function(t){return e(this.blockSize,t,!1)},this.mode.unpad=function(t){return e(this.blockSize,t,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t)||this.mode.afterFinish&&!this.mode.afterFinish(this.output,t)))},E((function(e){F.cipher=F.cipher||{};var t=e.exports=F.cipher.modes=F.cipher.modes||{};function r(e,t){if("string"==typeof e&&(e=F.util.createBuffer(e)),F.util.isArray(e)&&e.length>4){var r=e;e=F.util.createBuffer();for(var n=0;n<r.length;++n)e.putByte(r[n])}if(e.length()<t)throw new Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!F.util.isArray(e)){var i=[],a=t/4;for(n=0;n<a;++n)i.push(e.getInt32());e=i}return e}function n(e){e[e.length-1]=e[e.length-1]+1&4294967295}function i(e){return[e/4294967296|0,4294967295&e]}t.ecb=function(e){e=e||{},this.name="ECB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},t.ecb.prototype.start=function(e){},t.ecb.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();for(this.cipher.encrypt(this._inBlock,this._outBlock),n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},t.ecb.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();for(this.cipher.decrypt(this._inBlock,this._outBlock),n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},t.ecb.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},t.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2||(e.truncate(n),0))},t.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},t.cbc.prototype.start=function(e){if(null===e.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=r(e.iv,this.blockSize),this._prev=this._iv.slice(0)}},t.cbc.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=this._prev[n]^e.getInt32();for(this.cipher.encrypt(this._inBlock,this._outBlock),n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]);this._prev=this._outBlock},t.cbc.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();for(this.cipher.decrypt(this._inBlock,this._outBlock),n=0;n<this._ints;++n)t.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)},t.cbc.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},t.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2||(e.truncate(n),0))},t.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=F.util.createBuffer(),this._partialBytes=0},t.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=r(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},t.cfb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32()^this._outBlock[i],t.putInt32(this._inBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;for(a>0&&(a=this.blockSize-a),this._partialOutput.clear(),i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(a>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},t.cfb.prototype.decrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32(),t.putInt32(this._inBlock[i]^this._outBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;for(a>0&&(a=this.blockSize-a),this._partialOutput.clear(),i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(a>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},t.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=F.util.createBuffer(),this._partialBytes=0},t.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=r(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},t.ofb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===e.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];else{var a=(this.blockSize-n)%this.blockSize;for(a>0&&(a=this.blockSize-a),this._partialOutput.clear(),i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},t.ofb.prototype.decrypt=t.ofb.prototype.encrypt,t.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=F.util.createBuffer(),this._partialBytes=0},t.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=r(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},t.ctr.prototype.encrypt=function(e,t,r){var i=e.length();if(0===i)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&i>=this.blockSize)for(var a=0;a<this._ints;++a)t.putInt32(e.getInt32()^this._outBlock[a]);else{var o=(this.blockSize-i)%this.blockSize;for(o>0&&(o=this.blockSize-o),this._partialOutput.clear(),a=0;a<this._ints;++a)this._partialOutput.putInt32(e.getInt32()^this._outBlock[a]);if(o>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=0}n(this._inBlock)},t.ctr.prototype.decrypt=t.ctr.prototype.encrypt,t.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=F.util.createBuffer(),this._partialBytes=0,this._R=3774873600},t.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t,r=F.util.createBuffer(e.iv);if(this._cipherLength=0,t="additionalData"in e?F.util.createBuffer(e.additionalData):F.util.createBuffer(),this._tagLength="tagLength"in e?e.tagLength:128,this._tag=null,e.decrypt&&(this._tag=F.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var a=r.length();if(12===a)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(i(8*a)))}this._inBlock=this._j0.slice(0),n(this._inBlock),this._partialBytes=0,t=F.util.createBuffer(t),this._aDataLength=i(8*t.length());var o=t.length()%this.blockSize;for(o&&t.fillWithByte(0,this.blockSize-o),this._s=[0,0,0,0];t.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()])},t.gcm.prototype.encrypt=function(e,t,r){var i=e.length();if(0===i)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&i>=this.blockSize){for(var a=0;a<this._ints;++a)t.putInt32(this._outBlock[a]^=e.getInt32());this._cipherLength+=this.blockSize}else{var o=(this.blockSize-i)%this.blockSize;for(o>0&&(o=this.blockSize-o),this._partialOutput.clear(),a=0;a<this._ints;++a)this._partialOutput.putInt32(e.getInt32()^this._outBlock[a]);if(o<=0||r){if(r){var s=i%this.blockSize;this._cipherLength+=s,this._partialOutput.truncate(this.blockSize-s)}else this._cipherLength+=this.blockSize;for(a=0;a<this._ints;++a)this._outBlock[a]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),n(this._inBlock)},t.gcm.prototype.decrypt=function(e,t,r){var i=e.length();if(i<this.blockSize&&!(r&&i>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),n(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var a=0;a<this._ints;++a)t.putInt32(this._outBlock[a]^this._hashBlock[a]);i<this.blockSize?this._cipherLength+=i%this.blockSize:this._cipherLength+=this.blockSize},t.gcm.prototype.afterFinish=function(e,t){var r=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=F.util.createBuffer();var n=this._aDataLength.concat(i(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,n);var a=[];this.cipher.encrypt(this._j0,a);for(var o=0;o<this._ints;++o)this.tag.putInt32(this._s[o]^a[o]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r},t.gcm.prototype.multiply=function(e,t){for(var r=[0,0,0,0],n=t.slice(0),i=0;i<128;++i)e[i/32|0]&1<<31-i%32&&(r[0]^=n[0],r[1]^=n[1],r[2]^=n[2],r[3]^=n[3]),this.pow(n,n);return r},t.gcm.prototype.pow=function(e,t){for(var r=1&e[3],n=3;n>0;--n)t[n]=e[n]>>>1|(1&e[n-1])<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)},t.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var n=e[r/8|0]>>>4*(7-r%8)&15,i=this._m[r][n];t[0]^=i[0],t[1]^=i[1],t[2]^=i[2],t[3]^=i[3]}return t},t.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)},t.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,n=4*r,i=16*r,a=new Array(i),o=0;o<i;++o){var s=[0,0,0,0],c=(n-1-o%n)*t;s[o/n|0]=1<<t-1<<c,a[o]=this.generateSubHashTable(this.multiply(s,e),t)}return a},t.gcm.prototype.generateSubHashTable=function(e,t){var r=1<<t,n=r>>>1,i=new Array(r);i[n]=e.slice(0);for(var a=n>>>1;a>0;)this.pow(i[2*a],i[a]=[]),a>>=1;for(a=2;a<n;){for(var o=1;o<a;++o){var s=i[a],c=i[o];i[a+o]=[s[0]^c[0],s[1]^c[1],s[2]^c[2],s[3]^c[3]]}a*=2}for(i[0]=[0,0,0,0],a=n+1;a<r;++a){var u=i[a^n];i[a]=[e[0]^u[0],e[1]^u[1],e[2]^u[2],e[3]^u[3]]}return i}})),F.aes=F.aes||{},F.aes.startEncrypting=function(e,t,r,n){var i=ne({key:e,output:r,decrypt:!1,mode:n});return i.start(t),i},F.aes.createEncryptionCipher=function(e,t){return ne({key:e,output:null,decrypt:!1,mode:t})},F.aes.startDecrypting=function(e,t,r,n){var i=ne({key:e,output:r,decrypt:!0,mode:n});return i.start(t),i},F.aes.createDecryptionCipher=function(e,t){return ne({key:e,output:null,decrypt:!0,mode:t})},F.aes.Algorithm=function(e,t){Z||ee();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return re(r._w,e,t,!1)},decrypt:function(e,t){return re(r._w,e,t,!0)}}}),r._init=!1},F.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t,r=e.key;if("string"!=typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(F.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){t=r,r=F.util.createBuffer();for(var n=0;n<t.length;++n)r.putByte(t[n])}}else r=F.util.createBuffer(r);if(!F.util.isArray(r)){t=r,r=[];var i=t.length();if(16===i||24===i||32===i)for(i>>>=2,n=0;n<i;++n)r.push(t.getInt32())}if(!F.util.isArray(r)||4!==r.length&&6!==r.length&&8!==r.length)throw new Error("Invalid key parameter.");var a=this.mode.name,o=-1!==["CFB","OFB","CTR","GCM"].indexOf(a);this._w=te(r,e.decrypt&&!o),this._init=!0}},F.aes._expandKey=function(e,t){return Z||ee(),te(e,t)},F.aes._updateBlock=re,Q("AES-ECB",F.cipher.modes.ecb),Q("AES-CBC",F.cipher.modes.cbc),Q("AES-CFB",F.cipher.modes.cfb),Q("AES-OFB",F.cipher.modes.ofb),Q("AES-CTR",F.cipher.modes.ctr),Q("AES-GCM",F.cipher.modes.gcm);var G,W,X,Y,$,Z=!1,J=4;function ee(){Z=!0,X=[0,1,2,4,8,16,32,64,128,27,54];for(var e=new Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;for(G=new Array(256),W=new Array(256),Y=new Array(4),$=new Array(4),t=0;t<4;++t)Y[t]=new Array(256),$[t]=new Array(256);var r,n,i,a,o,s,c,u=0,l=0;for(t=0;t<256;++t){a=(a=l^l<<1^l<<2^l<<3^l<<4)>>8^255&a^99,G[u]=a,W[a]=u,s=(o=e[a])<<24^a<<16^a<<8^a^o,c=((r=e[u])^(n=e[r])^(i=e[n]))<<24^(u^i)<<16^(u^n^i)<<8^u^r^i;for(var d=0;d<4;++d)Y[d][u]=s,$[d][a]=c,s=s<<24|s>>>8,c=c<<24|c>>>8;0===u?u=l=1:(u=r^e[e[e[r^i]]],l^=e[e[l]])}}function te(e,t){for(var r,n=e.slice(0),i=1,a=n.length,o=J*(a+6+1),s=a;s<o;++s)r=n[s-1],s%a==0?(r=G[r>>>16&255]<<24^G[r>>>8&255]<<16^G[255&r]<<8^G[r>>>24]^X[i]<<24,i++):a>6&&s%a==4&&(r=G[r>>>24]<<24^G[r>>>16&255]<<16^G[r>>>8&255]<<8^G[255&r]),n[s]=n[s-a]^r;if(t){for(var c,u=$[0],l=$[1],d=$[2],f=$[3],p=n.slice(0),h=(s=0,(o=n.length)-J);s<o;s+=J,h-=J)if(0===s||s===o-J)p[s]=n[h],p[s+1]=n[h+3],p[s+2]=n[h+2],p[s+3]=n[h+1];else for(var g=0;g<J;++g)c=n[h+g],p[s+(3&-g)]=u[G[c>>>24]]^l[G[c>>>16&255]]^d[G[c>>>8&255]]^f[G[255&c]];n=p}return n}function re(e,t,r,n){var i,a,o,s,c,u,l,d,f,p,h,g,m=e.length/4-1;n?(i=$[0],a=$[1],o=$[2],s=$[3],c=W):(i=Y[0],a=Y[1],o=Y[2],s=Y[3],c=G),u=t[0]^e[0],l=t[n?3:1]^e[1],d=t[2]^e[2],f=t[n?1:3]^e[3];for(var y=3,v=1;v<m;++v)p=i[u>>>24]^a[l>>>16&255]^o[d>>>8&255]^s[255&f]^e[++y],h=i[l>>>24]^a[d>>>16&255]^o[f>>>8&255]^s[255&u]^e[++y],g=i[d>>>24]^a[f>>>16&255]^o[u>>>8&255]^s[255&l]^e[++y],f=i[f>>>24]^a[u>>>16&255]^o[l>>>8&255]^s[255&d]^e[++y],u=p,l=h,d=g;r[0]=c[u>>>24]<<24^c[l>>>16&255]<<16^c[d>>>8&255]<<8^c[255&f]^e[++y],r[n?3:1]=c[l>>>24]<<24^c[d>>>16&255]<<16^c[f>>>8&255]<<8^c[255&u]^e[++y],r[2]=c[d>>>24]<<24^c[f>>>16&255]<<16^c[u>>>8&255]<<8^c[255&l]^e[++y],r[n?1:3]=c[f>>>24]<<24^c[u>>>16&255]<<16^c[l>>>8&255]<<8^c[255&d]^e[++y]}function ne(e){var t,r="AES-"+((e=e||{}).mode||"CBC").toUpperCase(),n=(t=e.decrypt?F.cipher.createDecipher(r,e.key):F.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var i=null;r instanceof F.util.ByteBuffer&&(i=r,r={}),(r=r||{}).output=i,r.iv=e,n.call(t,r)},t}function ie(e,t){F.cipher.registerAlgorithm(e,(function(){return new F.des.Algorithm(e,t)}))}E((function(e){F.pki=F.pki||{};var t=e.exports=F.pki.oids=F.oids=F.oids||{};function r(e,r){t[e]=r,t[r]=e}function n(e,r){t[e]=r}r("1.2.840.113549.1.1.1","rsaEncryption"),r("1.2.840.113549.1.1.4","md5WithRSAEncryption"),r("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),r("1.2.840.113549.1.1.7","RSAES-OAEP"),r("1.2.840.113549.1.1.8","mgf1"),r("1.2.840.113549.1.1.9","pSpecified"),r("1.2.840.113549.1.1.10","RSASSA-PSS"),r("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),r("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),r("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),r("1.3.101.112","EdDSA25519"),r("1.2.840.10040.4.3","dsa-with-sha1"),r("1.3.14.3.2.7","desCBC"),r("1.3.14.3.2.26","sha1"),r("2.16.840.1.101.3.4.2.1","sha256"),r("2.16.840.1.101.3.4.2.2","sha384"),r("2.16.840.1.101.3.4.2.3","sha512"),r("1.2.840.113549.2.5","md5"),r("1.2.840.113549.1.7.1","data"),r("1.2.840.113549.1.7.2","signedData"),r("1.2.840.113549.1.7.3","envelopedData"),r("1.2.840.113549.1.7.4","signedAndEnvelopedData"),r("1.2.840.113549.1.7.5","digestedData"),r("1.2.840.113549.1.7.6","encryptedData"),r("1.2.840.113549.1.9.1","emailAddress"),r("1.2.840.113549.1.9.2","unstructuredName"),r("1.2.840.113549.1.9.3","contentType"),r("1.2.840.113549.1.9.4","messageDigest"),r("1.2.840.113549.1.9.5","signingTime"),r("1.2.840.113549.1.9.6","counterSignature"),r("1.2.840.113549.1.9.7","challengePassword"),r("1.2.840.113549.1.9.8","unstructuredAddress"),r("1.2.840.113549.1.9.14","extensionRequest"),r("1.2.840.113549.1.9.20","friendlyName"),r("1.2.840.113549.1.9.21","localKeyId"),r("1.2.840.113549.1.9.22.1","x509Certificate"),r("1.2.840.113549.1.12.10.1.1","keyBag"),r("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),r("1.2.840.113549.1.12.10.1.3","certBag"),r("1.2.840.113549.1.12.10.1.4","crlBag"),r("1.2.840.113549.1.12.10.1.5","secretBag"),r("1.2.840.113549.1.12.10.1.6","safeContentsBag"),r("1.2.840.113549.1.5.13","pkcs5PBES2"),r("1.2.840.113549.1.5.12","pkcs5PBKDF2"),r("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),r("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),r("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),r("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),r("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),r("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),r("1.2.840.113549.2.7","hmacWithSHA1"),r("1.2.840.113549.2.8","hmacWithSHA224"),r("1.2.840.113549.2.9","hmacWithSHA256"),r("1.2.840.113549.2.10","hmacWithSHA384"),r("1.2.840.113549.2.11","hmacWithSHA512"),r("1.2.840.113549.3.7","des-EDE3-CBC"),r("2.16.840.1.101.3.4.1.2","aes128-CBC"),r("2.16.840.1.101.3.4.1.22","aes192-CBC"),r("2.16.840.1.101.3.4.1.42","aes256-CBC"),r("2.5.4.3","commonName"),r("2.5.4.5","serialName"),r("2.5.4.6","countryName"),r("2.5.4.7","localityName"),r("2.5.4.8","stateOrProvinceName"),r("2.5.4.9","streetAddress"),r("2.5.4.10","organizationName"),r("2.5.4.11","organizationalUnitName"),r("2.5.4.13","description"),r("2.5.4.15","businessCategory"),r("2.5.4.17","postalCode"),r("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),r("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),r("2.16.840.1.113730.1.1","nsCertType"),r("2.16.840.1.113730.1.13","nsComment"),n("2.5.29.1","authorityKeyIdentifier"),n("2.5.29.2","keyAttributes"),n("2.5.29.3","certificatePolicies"),n("2.5.29.4","keyUsageRestriction"),n("2.5.29.5","policyMapping"),n("2.5.29.6","subtreesConstraint"),n("2.5.29.7","subjectAltName"),n("2.5.29.8","issuerAltName"),n("2.5.29.9","subjectDirectoryAttributes"),n("2.5.29.10","basicConstraints"),n("2.5.29.11","nameConstraints"),n("2.5.29.12","policyConstraints"),n("2.5.29.13","basicConstraints"),r("2.5.29.14","subjectKeyIdentifier"),r("2.5.29.15","keyUsage"),n("2.5.29.16","privateKeyUsagePeriod"),r("2.5.29.17","subjectAltName"),r("2.5.29.18","issuerAltName"),r("2.5.29.19","basicConstraints"),n("2.5.29.20","cRLNumber"),n("2.5.29.21","cRLReason"),n("2.5.29.22","expirationDate"),n("2.5.29.23","instructionCode"),n("2.5.29.24","invalidityDate"),n("2.5.29.25","cRLDistributionPoints"),n("2.5.29.26","issuingDistributionPoint"),n("2.5.29.27","deltaCRLIndicator"),n("2.5.29.28","issuingDistributionPoint"),n("2.5.29.29","certificateIssuer"),n("2.5.29.30","nameConstraints"),r("2.5.29.31","cRLDistributionPoints"),r("2.5.29.32","certificatePolicies"),n("2.5.29.33","policyMappings"),n("2.5.29.34","policyConstraints"),r("2.5.29.35","authorityKeyIdentifier"),n("2.5.29.36","policyConstraints"),r("2.5.29.37","extKeyUsage"),n("2.5.29.46","freshestCRL"),n("2.5.29.54","inhibitAnyPolicy"),r("1.3.6.1.4.1.11129.2.4.2","timestampList"),r("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),r("1.3.6.1.5.5.7.3.1","serverAuth"),r("1.3.6.1.5.5.7.3.2","clientAuth"),r("1.3.6.1.5.5.7.3.3","codeSigning"),r("1.3.6.1.5.5.7.3.4","emailProtection"),r("1.3.6.1.5.5.7.3.8","timeStamping")})),E((function(e){var t=e.exports=F.asn1=F.asn1||{};function r(e,t,r){if(r>t){var n=new Error("Too few bytes to parse DER.");throw n.available=e.length(),n.remaining=t,n.requested=r,n}}t.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},t.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},t.create=function(e,r,n,i,a){if(F.util.isArray(i)){for(var o=[],s=0;s<i.length;++s)void 0!==i[s]&&o.push(i[s]);i=o}var c={tagClass:e,type:r,constructed:n,composed:n||F.util.isArray(i),value:i};return a&&"bitStringContents"in a&&(c.bitStringContents=a.bitStringContents,c.original=t.copy(c)),c},t.copy=function(e,r){var n;if(F.util.isArray(e)){n=[];for(var i=0;i<e.length;++i)n.push(t.copy(e[i],r));return n}return"string"==typeof e?e:(n={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:t.copy(e.value,r)},r&&!r.excludeBitStringContents&&(n.bitStringContents=e.bitStringContents),n)},t.equals=function(e,r,n){if(F.util.isArray(e)){if(!F.util.isArray(r))return!1;if(e.length!==r.length)return!1;for(var i=0;i<e.length;++i)if(!t.equals(e[i],r[i]))return!1;return!0}if(typeof e!=typeof r)return!1;if("string"==typeof e)return e===r;var a=e.tagClass===r.tagClass&&e.type===r.type&&e.constructed===r.constructed&&e.composed===r.composed&&t.equals(e.value,r.value);return n&&n.includeBitStringContents&&(a=a&&e.bitStringContents===r.bitStringContents),a},t.getBerValueLength=function(e){var t=e.getByte();if(128!==t)return 128&t?e.getInt((127&t)<<3):t};var n=function(e,t){var n=e.getByte();if(t--,128!==n){var i;if(128&n){var a=127&n;r(e,t,a),i=e.getInt(a<<3)}else i=n;if(i<0)throw new Error("Negative length: "+i);return i}};t.fromDer=function(e,i){return void 0===i&&(i={strict:!0,decodeBitStrings:!0}),"boolean"==typeof i&&(i={strict:i,decodeBitStrings:!0}),"strict"in i||(i.strict=!0),"decodeBitStrings"in i||(i.decodeBitStrings=!0),"string"==typeof e&&(e=F.util.createBuffer(e)),function e(i,a,o,s){var c;r(i,a,2);var u=i.getByte();a--;var l=192&u,d=31&u;c=i.length();var f,p,h=n(i,a);if(a-=c-i.length(),void 0!==h&&h>a){if(s.strict){var g=new Error("Too few bytes to read ASN.1 value.");throw g.available=i.length(),g.remaining=a,g.requested=h,g}h=a}var m=32==(32&u);if(m)if(f=[],void 0===h)for(;;){if(r(i,a,2),i.bytes(2)===String.fromCharCode(0,0)){i.getBytes(2),a-=2;break}c=i.length(),f.push(e(i,a,o+1,s)),a-=c-i.length()}else for(;h>0;)c=i.length(),f.push(e(i,h,o+1,s)),a-=c-i.length(),h-=c-i.length();if(void 0===f&&l===t.Class.UNIVERSAL&&d===t.Type.BITSTRING&&(p=i.bytes(h)),void 0===f&&s.decodeBitStrings&&l===t.Class.UNIVERSAL&&d===t.Type.BITSTRING&&h>1){var y=i.read,v=a,b=0;if(d===t.Type.BITSTRING&&(r(i,a,1),b=i.getByte(),a--),0===b)try{c=i.length();var C=e(i,a,o+1,{verbose:s.verbose,strict:!0,decodeBitStrings:!0}),E=c-i.length();a-=E,d==t.Type.BITSTRING&&E++;var w=C.tagClass;E!==h||w!==t.Class.UNIVERSAL&&w!==t.Class.CONTEXT_SPECIFIC||(f=[C])}catch(e){}void 0===f&&(i.read=y,a=v)}if(void 0===f){if(void 0===h){if(s.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");h=a}if(d===t.Type.BMPSTRING)for(f="";h>0;h-=2)r(i,a,2),f+=String.fromCharCode(i.getInt16()),a-=2;else f=i.getBytes(h)}var k=void 0===p?null:{bitStringContents:p};return t.create(l,d,m,f,k)}(e,e.length(),0,i)},t.toDer=function(e){var r=F.util.createBuffer(),n=e.tagClass|e.type,i=F.util.createBuffer(),a=!1;if("bitStringContents"in e&&(a=!0,e.original&&(a=t.equals(e,e.original))),a)i.putBytes(e.bitStringContents);else if(e.composed){e.constructed?n|=32:i.putByte(0);for(var o=0;o<e.value.length;++o)void 0!==e.value[o]&&i.putBuffer(t.toDer(e.value[o]))}else if(e.type===t.Type.BMPSTRING)for(o=0;o<e.value.length;++o)i.putInt16(e.value.charCodeAt(o));else e.type===t.Type.INTEGER&&e.value.length>1&&(0===e.value.charCodeAt(0)&&0==(128&e.value.charCodeAt(1))||255===e.value.charCodeAt(0)&&128==(128&e.value.charCodeAt(1)))?i.putBytes(e.value.substr(1)):i.putBytes(e.value);if(r.putByte(n),i.length()<=127)r.putByte(127&i.length());else{var s=i.length(),c="";do{c+=String.fromCharCode(255&s),s>>>=8}while(s>0);for(r.putByte(128|c.length),o=c.length-1;o>=0;--o)r.putByte(c.charCodeAt(o))}return r.putBuffer(i),r},t.oidToDer=function(e){var t,r,n,i,a=e.split("."),o=F.util.createBuffer();o.putByte(40*parseInt(a[0],10)+parseInt(a[1],10));for(var s=2;s<a.length;++s){t=!0,r=[],n=parseInt(a[s],10);do{i=127&n,n>>>=7,t||(i|=128),r.push(i),t=!1}while(n>0);for(var c=r.length-1;c>=0;--c)o.putByte(r[c])}return o},t.derToOid=function(e){var t;"string"==typeof e&&(e=F.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var n=0;e.length()>0;)n<<=7,128&(r=e.getByte())?n+=127&r:(t+="."+(n+r),n=0);return t},t.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(e.substr(2,2),10)-1,i=parseInt(e.substr(4,2),10),a=parseInt(e.substr(6,2),10),o=parseInt(e.substr(8,2),10),s=0;if(e.length>11){var c=e.charAt(10),u=10;"+"!==c&&"-"!==c&&(s=parseInt(e.substr(10,2),10),u+=2)}if(t.setUTCFullYear(r,n,i),t.setUTCHours(a,o,s,0),u&&("+"===(c=e.charAt(u))||"-"===c)){var l=60*parseInt(e.substr(u+1,2),10)+parseInt(e.substr(u+4,2),10);l*=6e4,"+"===c?t.setTime(+t-l):t.setTime(+t+l)}return t},t.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),n=parseInt(e.substr(4,2),10)-1,i=parseInt(e.substr(6,2),10),a=parseInt(e.substr(8,2),10),o=parseInt(e.substr(10,2),10),s=parseInt(e.substr(12,2),10),c=0,u=0,l=!1;"Z"===e.charAt(e.length-1)&&(l=!0);var d=e.length-5,f=e.charAt(d);return"+"!==f&&"-"!==f||(u=60*parseInt(e.substr(d+1,2),10)+parseInt(e.substr(d+4,2),10),u*=6e4,"+"===f&&(u*=-1),l=!0),"."===e.charAt(14)&&(c=1e3*parseFloat(e.substr(14),10)),l?(t.setUTCFullYear(r,n,i),t.setUTCHours(a,o,s,c),t.setTime(+t+u)):(t.setFullYear(r,n,i),t.setHours(a,o,s,c)),t},t.dateToUtcTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push((""+e.getUTCFullYear()).substr(2)),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+"Z"},t.dateToGeneralizedTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push(""+e.getUTCFullYear()),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+"Z"},t.integerToDer=function(e){var t=F.util.createBuffer();if(e>=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=e,r},t.derToInteger=function(e){"string"==typeof e&&(e=F.util.createBuffer(e));var t=8*e.length();if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},t.validate=function(e,r,n,i){var a=!1;if(e.tagClass!==r.tagClass&&void 0!==r.tagClass||e.type!==r.type&&void 0!==r.type)i&&(e.tagClass!==r.tagClass&&i.push("["+r.name+'] Expected tag class "'+r.tagClass+'", got "'+e.tagClass+'"'),e.type!==r.type&&i.push("["+r.name+'] Expected type "'+r.type+'", got "'+e.type+'"'));else if(e.constructed===r.constructed||void 0===r.constructed){if(a=!0,r.value&&F.util.isArray(r.value))for(var o=0,s=0;a&&s<r.value.length;++s)a=r.value[s].optional||!1,e.value[o]&&((a=t.validate(e.value[o],r.value[s],n,i))?++o:r.value[s].optional&&(a=!0)),!a&&i&&i.push("["+r.name+'] Tag class "'+r.tagClass+'", type "'+r.type+'" expected value length "'+r.value.length+'", got "'+e.value.length+'"');if(a&&n&&(r.capture&&(n[r.capture]=e.value),r.captureAsn1&&(n[r.captureAsn1]=e),r.captureBitStringContents&&"bitStringContents"in e&&(n[r.captureBitStringContents]=e.bitStringContents),r.captureBitStringValue&&"bitStringContents"in e))if(e.bitStringContents.length<2)n[r.captureBitStringValue]="";else{if(0!==e.bitStringContents.charCodeAt(0))throw new Error("captureBitStringValue only supported for zero unused bits");n[r.captureBitStringValue]=e.bitStringContents.slice(1)}}else i&&i.push("["+r.name+'] Expected constructed "'+r.constructed+'", got "'+e.constructed+'"');return a};var i=/[^\\u0000-\\u00ff]/;t.prettyPrint=function(e,r,n){var a="";n=n||2,(r=r||0)>0&&(a+="\n");for(var o="",s=0;s<r*n;++s)o+=" ";switch(a+=o+"Tag: ",e.tagClass){case t.Class.UNIVERSAL:a+="Universal:";break;case t.Class.APPLICATION:a+="Application:";break;case t.Class.CONTEXT_SPECIFIC:a+="Context-Specific:";break;case t.Class.PRIVATE:a+="Private:"}if(e.tagClass===t.Class.UNIVERSAL)switch(a+=e.type,e.type){case t.Type.NONE:a+=" (None)";break;case t.Type.BOOLEAN:a+=" (Boolean)";break;case t.Type.INTEGER:a+=" (Integer)";break;case t.Type.BITSTRING:a+=" (Bit string)";break;case t.Type.OCTETSTRING:a+=" (Octet string)";break;case t.Type.NULL:a+=" (Null)";break;case t.Type.OID:a+=" (Object Identifier)";break;case t.Type.ODESC:a+=" (Object Descriptor)";break;case t.Type.EXTERNAL:a+=" (External or Instance of)";break;case t.Type.REAL:a+=" (Real)";break;case t.Type.ENUMERATED:a+=" (Enumerated)";break;case t.Type.EMBEDDED:a+=" (Embedded PDV)";break;case t.Type.UTF8:a+=" (UTF8)";break;case t.Type.ROID:a+=" (Relative Object Identifier)";break;case t.Type.SEQUENCE:a+=" (Sequence)";break;case t.Type.SET:a+=" (Set)";break;case t.Type.PRINTABLESTRING:a+=" (Printable String)";break;case t.Type.IA5String:a+=" (IA5String (ASCII))";break;case t.Type.UTCTIME:a+=" (UTC time)";break;case t.Type.GENERALIZEDTIME:a+=" (Generalized time)";break;case t.Type.BMPSTRING:a+=" (BMP String)"}else a+=e.type;if(a+="\n",a+=o+"Constructed: "+e.constructed+"\n",e.composed){var c=0,u="";for(s=0;s<e.value.length;++s)void 0!==e.value[s]&&(c+=1,u+=t.prettyPrint(e.value[s],r+1,n),s+1<e.value.length&&(u+=","));a+=o+"Sub values: "+c+u}else{if(a+=o+"Value: ",e.type===t.Type.OID){var l=t.derToOid(e.value);a+=l,F.pki&&F.pki.oids&&l in F.pki.oids&&(a+=" ("+F.pki.oids[l]+") ")}if(e.type===t.Type.INTEGER)try{a+=t.derToInteger(e.value)}catch(t){a+="0x"+F.util.bytesToHex(e.value)}else if(e.type===t.Type.BITSTRING){if(e.value.length>1?a+="0x"+F.util.bytesToHex(e.value.slice(1)):a+="(none)",e.value.length>0){var d=e.value.charCodeAt(0);1==d?a+=" (1 unused bit shown)":d>1&&(a+=" ("+d+" unused bits shown)")}}else e.type===t.Type.OCTETSTRING?(i.test(e.value)||(a+="("+e.value+") "),a+="0x"+F.util.bytesToHex(e.value)):e.type===t.Type.UTF8?a+=F.util.decodeUtf8(e.value):e.type===t.Type.PRINTABLESTRING||e.type===t.Type.IA5String?a+=e.value:i.test(e.value)?a+="0x"+F.util.bytesToHex(e.value):0===e.value.length?a+="[null]":a+=e.value}return a}})),F.md=F.md||{},F.md.algorithms=F.md.algorithms||{},E((function(e){(e.exports=F.hmac=F.hmac||{}).create=function(){var e=null,t=null,r=null,n=null,i={start:function(i,a){if(null!==i)if("string"==typeof i){if(!((i=i.toLowerCase())in F.md.algorithms))throw new Error('Unknown hash algorithm "'+i+'"');t=F.md.algorithms[i].create()}else t=i;if(null===a)a=e;else{if("string"==typeof a)a=F.util.createBuffer(a);else if(F.util.isArray(a)){var o=a;a=F.util.createBuffer();for(var s=0;s<o.length;++s)a.putByte(o[s])}var c=a.length();for(c>t.blockLength&&(t.start(),t.update(a.bytes()),a=t.digest()),r=F.util.createBuffer(),n=F.util.createBuffer(),c=a.length(),s=0;s<c;++s)o=a.at(s),r.putByte(54^o),n.putByte(92^o);if(c<t.blockLength)for(o=t.blockLength-c,s=0;s<o;++s)r.putByte(54),n.putByte(92);e=a,r=r.bytes(),n=n.bytes()}t.start(),t.update(r)},update:function(e){t.update(e)},getMac:function(){var e=t.digest().bytes();return t.start(),t.update(n),t.update(e),t.digest()}};return i.digest=i.getMac,i}})),E((function(e){var t=e.exports=F.md5=F.md5||{};F.md.md5=F.md.algorithms.md5=t,t.create=function(){o||function(){r=String.fromCharCode(128),r+=F.util.fillString(String.fromCharCode(0),64),n=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],i=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],a=new Array(64);for(var e=0;e<64;++e)a[e]=Math.floor(4294967296*Math.abs(Math.sin(e+1)));o=!0}();var e=null,t=F.util.createBuffer(),c=new Array(16),u={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){u.messageLength=0,u.fullMessageLength=u.messageLength64=[];for(var r=u.messageLengthSize/4,n=0;n<r;++n)u.fullMessageLength.push(0);return t=F.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},u}};return u.start(),u.update=function(r,n){"utf8"===n&&(r=F.util.encodeUtf8(r));var i=r.length;u.messageLength+=i,i=[i/4294967296>>>0,i>>>0];for(var a=u.fullMessageLength.length-1;a>=0;--a)u.fullMessageLength[a]+=i[1],i[1]=i[0]+(u.fullMessageLength[a]/4294967296>>>0),u.fullMessageLength[a]=u.fullMessageLength[a]>>>0,i[0]=i[1]/4294967296>>>0;return t.putBytes(r),s(e,c,t),(t.read>2048||0===t.length())&&t.compact(),u},u.digest=function(){var n=F.util.createBuffer();n.putBytes(t.bytes());var i=u.fullMessageLength[u.fullMessageLength.length-1]+u.messageLengthSize&u.blockLength-1;n.putBytes(r.substr(0,u.blockLength-i));for(var a,o=0,l=u.fullMessageLength.length-1;l>=0;--l)o=(a=8*u.fullMessageLength[l]+o)/4294967296>>>0,n.putInt32Le(a>>>0);var d={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};s(d,c,n);var f=F.util.createBuffer();return f.putInt32Le(d.h0),f.putInt32Le(d.h1),f.putInt32Le(d.h2),f.putInt32Le(d.h3),f},u};var r=null,n=null,i=null,a=null,o=!1;function s(e,t,r){for(var o,s,c,u,l,d,f,p=r.length();p>=64;){for(s=e.h0,c=e.h1,u=e.h2,l=e.h3,f=0;f<16;++f)t[f]=r.getInt32Le(),o=s+(l^c&(u^l))+a[f]+t[f],s=l,l=u,u=c,c+=o<<(d=i[f])|o>>>32-d;for(;f<32;++f)o=s+(u^l&(c^u))+a[f]+t[n[f]],s=l,l=u,u=c,c+=o<<(d=i[f])|o>>>32-d;for(;f<48;++f)o=s+(c^u^l)+a[f]+t[n[f]],s=l,l=u,u=c,c+=o<<(d=i[f])|o>>>32-d;for(;f<64;++f)o=s+(u^(c|~l))+a[f]+t[n[f]],s=l,l=u,u=c,c+=o<<(d=i[f])|o>>>32-d;e.h0=e.h0+s|0,e.h1=e.h1+c|0,e.h2=e.h2+u|0,e.h3=e.h3+l|0,p-=64}}})),E((function(e){var t=e.exports=F.pem=F.pem||{};function r(e){for(var t=e.name+": ",r=[],n=function(e,t){return" "+t},i=0;i<e.values.length;++i)r.push(e.values[i].replace(/^(\S+\r\n)/,n));t+=r.join(",")+"\r\n";var a=0,o=-1;for(i=0;i<t.length;++i,++a)if(a>65&&-1!==o){var s=t[o];","===s?(++o,t=t.substr(0,o)+"\r\n "+t.substr(o)):t=t.substr(0,o)+"\r\n"+s+t.substr(o+1),a=i-o-1,o=-1,++i}else" "!==t[i]&&"\t"!==t[i]&&","!==t[i]||(o=i);return t}function n(e){return e.replace(/^\s+/,"")}t.encode=function(e,t){t=t||{};var n,i="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(i+=r(n={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(i+=r(n={name:"Content-Domain",values:[e.contentDomain]})),e.dekInfo&&(n={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&n.values.push(e.dekInfo.parameters),i+=r(n)),e.headers)for(var a=0;a<e.headers.length;++a)i+=r(e.headers[a]);return e.procType&&(i+="\r\n"),(i+=F.util.encode64(e.body,t.maxline||64)+"\r\n")+"-----END "+e.type+"-----\r\n"},t.decode=function(e){for(var t,r=[],i=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,a=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,o=/\r?\n/;t=i.exec(e);){var s={type:t[1],procType:null,contentDomain:null,dekInfo:null,headers:[],body:F.util.decode64(t[3])};if(r.push(s),t[2]){for(var c=t[2].split(o),u=0;t&&u<c.length;){for(var l=c[u].replace(/\s+$/,""),d=u+1;d<c.length;++d){var f=c[d];if(!/\s/.test(f[0]))break;l+=f,u=d}if(t=l.match(a)){for(var p={name:t[1],values:[]},h=t[2].split(","),g=0;g<h.length;++g)p.values.push(n(h[g]));if(s.procType)if(s.contentDomain||"Content-Domain"!==p.name)if(s.dekInfo||"DEK-Info"!==p.name)s.headers.push(p);else{if(0===p.values.length)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');s.dekInfo={algorithm:h[0],parameters:h[1]||null}}else s.contentDomain=h[0]||"";else{if("Proc-Type"!==p.name)throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==p.values.length)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');s.procType={version:h[0],type:h[1]}}}++u}if("ENCRYPTED"===s.procType&&!s.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(0===r.length)throw new Error("Invalid PEM formatted message.");return r}})),F.des=F.des||{},F.des.startEncrypting=function(e,t,r,n){var i=he({key:e,output:r,decrypt:!1,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},F.des.createEncryptionCipher=function(e,t){return he({key:e,output:null,decrypt:!1,mode:t})},F.des.startDecrypting=function(e,t,r,n){var i=he({key:e,output:r,decrypt:!0,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},F.des.createDecryptionCipher=function(e,t){return he({key:e,output:null,decrypt:!0,mode:t})},F.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(e,t){return pe(r._keys,e,t,!1)},decrypt:function(e,t){return pe(r._keys,e,t,!0)}}}),r._init=!1},F.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=F.util.createBuffer(e.key);if(0===this.name.indexOf("3DES")&&24!==t.length())throw new Error("Invalid Triple-DES key size: "+8*t.length());this._keys=function(e){for(var t,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],i=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],a=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],o=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],c=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],u=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],l=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],d=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],f=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],p=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],h=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],g=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],m=e.length()>8?3:1,y=[],v=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],b=0,C=0;C<m;C++){var E=e.getInt32(),w=e.getInt32();E^=(t=252645135&(E>>>4^w))<<4,E^=t=65535&((w^=t)>>>-16^E),E^=(t=858993459&(E>>>2^(w^=t<<-16)))<<2,E^=t=65535&((w^=t)>>>-16^E),E^=(t=1431655765&(E>>>1^(w^=t<<-16)))<<1,E^=t=16711935&((w^=t)>>>8^E),t=(E^=(t=1431655765&(E>>>1^(w^=t<<8)))<<1)<<8|(w^=t)>>>20&240,E=w<<24|w<<8&16711680|w>>>8&65280|w>>>24&240,w=t;for(var k=0;k<v.length;++k){v[k]?(E=E<<2|E>>>26,w=w<<2|w>>>26):(E=E<<1|E>>>27,w=w<<1|w>>>27);var S=r[(E&=-15)>>>28]|n[E>>>24&15]|i[E>>>20&15]|a[E>>>16&15]|o[E>>>12&15]|s[E>>>8&15]|c[E>>>4&15],B=u[(w&=-15)>>>28]|l[w>>>24&15]|d[w>>>20&15]|f[w>>>16&15]|p[w>>>12&15]|h[w>>>8&15]|g[w>>>4&15];t=65535&(B>>>16^S),y[b++]=S^t,y[b++]=B^t<<16}}return y}(t),this._init=!0}},ie("DES-ECB",F.cipher.modes.ecb),ie("DES-CBC",F.cipher.modes.cbc),ie("DES-CFB",F.cipher.modes.cfb),ie("DES-OFB",F.cipher.modes.ofb),ie("DES-CTR",F.cipher.modes.ctr),ie("3DES-ECB",F.cipher.modes.ecb),ie("3DES-CBC",F.cipher.modes.cbc),ie("3DES-CFB",F.cipher.modes.cfb),ie("3DES-OFB",F.cipher.modes.ofb),ie("3DES-CTR",F.cipher.modes.ctr);var ae=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],oe=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],se=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],ce=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],ue=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],le=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],de=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],fe=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function pe(e,t,r,n){var i,a,o=32===e.length?3:9;i=3===o?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var s=t[0],c=t[1];s^=(a=252645135&(s>>>4^c))<<4,s^=(a=65535&(s>>>16^(c^=a)))<<16,s^=a=858993459&((c^=a)>>>2^s),s^=a=16711935&((c^=a<<2)>>>8^s),s=(s^=(a=1431655765&(s>>>1^(c^=a<<8)))<<1)<<1|s>>>31,c=(c^=a)<<1|c>>>31;for(var u=0;u<o;u+=3){for(var l=i[u+1],d=i[u+2],f=i[u];f!=l;f+=d){var p=c^e[f],h=(c>>>4|c<<28)^e[f+1];a=s,s=c,c=a^(oe[p>>>24&63]|ce[p>>>16&63]|le[p>>>8&63]|fe[63&p]|ae[h>>>24&63]|se[h>>>16&63]|ue[h>>>8&63]|de[63&h])}a=s,s=c,c=a}c=c>>>1|c<<31,c^=a=1431655765&((s=s>>>1|s<<31)>>>1^c),c^=(a=16711935&(c>>>8^(s^=a<<1)))<<8,c^=(a=858993459&(c>>>2^(s^=a)))<<2,c^=a=65535&((s^=a)>>>16^c),c^=a=252645135&((s^=a<<16)>>>4^c),s^=a<<4,r[0]=s,r[1]=c}function he(e){var t,r="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),n=(t=e.decrypt?F.cipher.createDecipher(r,e.key):F.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var i=null;r instanceof F.util.ByteBuffer&&(i=r,r={}),(r=r||{}).output=i,r.iv=e,n.call(t,r)},t}var ge,me=F.pkcs5=F.pkcs5||{};F.util.isNodejs&&!F.options.usePureJavaScript&&(ge=t),F.pbkdf2=me.pbkdf2=function(e,t,r,n,i,a){if("function"==typeof i&&(a=i,i=null),F.util.isNodejs&&!F.options.usePureJavaScript&&ge.pbkdf2&&(null===i||"object"!=typeof i)&&(ge.pbkdf2Sync.length>4||!i||"sha1"===i))return"string"!=typeof i&&(i="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),a?4===ge.pbkdf2Sync.length?ge.pbkdf2(e,t,r,n,(function(e,t){if(e)return a(e);a(null,t.toString("binary"))})):ge.pbkdf2(e,t,r,n,i,(function(e,t){if(e)return a(e);a(null,t.toString("binary"))})):4===ge.pbkdf2Sync.length?ge.pbkdf2Sync(e,t,r,n).toString("binary"):ge.pbkdf2Sync(e,t,r,n,i).toString("binary");if(null==i&&(i="sha1"),"string"==typeof i){if(!(i in F.md.algorithms))throw new Error("Unknown hash algorithm: "+i);i=F.md[i].create()}var o=i.digestLength;if(n>4294967295*o){var s=new Error("Derived key is too long.");if(a)return a(s);throw s}var c=Math.ceil(n/o),u=n-(c-1)*o,l=F.hmac.create();l.start(i,e);var d,f,p,h="";if(!a){for(var g=1;g<=c;++g){l.start(null,null),l.update(t),l.update(F.util.int32ToBytes(g)),d=p=l.digest().getBytes();for(var m=2;m<=r;++m)l.start(null,null),l.update(p),f=l.digest().getBytes(),d=F.util.xorBytes(d,f,o),p=f;h+=g<c?d:d.substr(0,u)}return h}function y(){if(g>c)return a(null,h);l.start(null,null),l.update(t),l.update(F.util.int32ToBytes(g)),d=p=l.digest().getBytes(),m=2,v()}function v(){if(m<=r)return l.start(null,null),l.update(p),f=l.digest().getBytes(),d=F.util.xorBytes(d,f,o),p=f,++m,F.util.setImmediate(v);h+=g<c?d:d.substr(0,u),++g,y()}g=1,y()},E((function(e){var t=e.exports=F.sha256=F.sha256||{};F.md.sha256=F.md.algorithms.sha256=t,t.create=function(){n||(r=String.fromCharCode(128),r+=F.util.fillString(String.fromCharCode(0),64),i=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],n=!0);var e=null,t=F.util.createBuffer(),o=new Array(64),s={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){s.messageLength=0,s.fullMessageLength=s.messageLength64=[];for(var r=s.messageLengthSize/4,n=0;n<r;++n)s.fullMessageLength.push(0);return t=F.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},s}};return s.start(),s.update=function(r,n){"utf8"===n&&(r=F.util.encodeUtf8(r));var i=r.length;s.messageLength+=i,i=[i/4294967296>>>0,i>>>0];for(var c=s.fullMessageLength.length-1;c>=0;--c)s.fullMessageLength[c]+=i[1],i[1]=i[0]+(s.fullMessageLength[c]/4294967296>>>0),s.fullMessageLength[c]=s.fullMessageLength[c]>>>0,i[0]=i[1]/4294967296>>>0;return t.putBytes(r),a(e,o,t),(t.read>2048||0===t.length())&&t.compact(),s},s.digest=function(){var n=F.util.createBuffer();n.putBytes(t.bytes());var i,c=s.fullMessageLength[s.fullMessageLength.length-1]+s.messageLengthSize&s.blockLength-1;n.putBytes(r.substr(0,s.blockLength-c));for(var u=8*s.fullMessageLength[0],l=0;l<s.fullMessageLength.length-1;++l)u+=(i=8*s.fullMessageLength[l+1])/4294967296>>>0,n.putInt32(u>>>0),u=i>>>0;n.putInt32(u);var d={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};a(d,o,n);var f=F.util.createBuffer();return f.putInt32(d.h0),f.putInt32(d.h1),f.putInt32(d.h2),f.putInt32(d.h3),f.putInt32(d.h4),f.putInt32(d.h5),f.putInt32(d.h6),f.putInt32(d.h7),f},s};var r=null,n=!1,i=null;function a(e,t,r){for(var n,a,o,s,c,u,l,d,f,p,h,g,m,y=r.length();y>=64;){for(c=0;c<16;++c)t[c]=r.getInt32();for(;c<64;++c)n=((n=t[c-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,a=((a=t[c-15])>>>7|a<<25)^(a>>>18|a<<14)^a>>>3,t[c]=n+t[c-7]+a+t[c-16]|0;for(u=e.h0,l=e.h1,d=e.h2,f=e.h3,p=e.h4,h=e.h5,g=e.h6,m=e.h7,c=0;c<64;++c)o=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),s=u&l|d&(u^l),n=m+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(g^p&(h^g))+i[c]+t[c],m=g,g=h,h=p,p=f+n>>>0,f=d,d=l,l=u,u=n+(a=o+s)>>>0;e.h0=e.h0+u|0,e.h1=e.h1+l|0,e.h2=e.h2+d|0,e.h3=e.h3+f|0,e.h4=e.h4+p|0,e.h5=e.h5+h|0,e.h6=e.h6+g|0,e.h7=e.h7+m|0,y-=64}}})),E((function(e){var r=null;!F.util.isNodejs||F.options.usePureJavaScript||process.versions["node-webkit"]||(r=t),(e.exports=F.prng=F.prng||{}).create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},n=e.md,i=new Array(32),a=0;a<32;++a)i[a]=n.create();function o(){if(t.pools[0].messageLength>=32)return s();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),s()}function s(){t.reseeds=4294967295===t.reseeds?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var r=1,n=0;n<32;++n)t.reseeds%r==0&&(e.update(t.pools[n].digest().getBytes()),t.pools[n].start()),r<<=1;t.keyBytes=e.digest().getBytes(),e.start(),e.update(t.keyBytes);var i=e.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(i),t.generated=0}function c(e){var t=null,r=F.util.globalScope,n=r.crypto||r.msCrypto;n&&n.getRandomValues&&(t=function(e){return n.getRandomValues(e)});var i=F.util.createBuffer();if(t)for(;i.length()<e;){var a=Math.max(1,Math.min(e-i.length(),65536)/4),o=new Uint32Array(Math.floor(a));try{t(o);for(var s=0;s<o.length;++s)i.putInt32(o[s])}catch(e){if(!("undefined"!=typeof QuotaExceededError&&e instanceof QuotaExceededError))throw e}}if(i.length()<e)for(var c,u,l,d=Math.floor(65536*Math.random());i.length()<e;)for(u=16807*(65535&d),u+=(32767&(c=16807*(d>>16)))<<16,d=4294967295&(u=(2147483647&(u+=c>>15))+(u>>31)),s=0;s<3;++s)l=d>>>(s<<3),l^=Math.floor(256*Math.random()),i.putByte(String.fromCharCode(255&l));return i.getBytes(e)}return t.pools=i,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var n=t.plugin.cipher,i=t.plugin.increment,a=t.plugin.formatKey,o=t.plugin.formatSeed,c=F.util.createBuffer();t.key=null,function u(l){if(l)return r(l);if(c.length()>=e)return r(null,c.getBytes(e));if(t.generated>1048575&&(t.key=null),null===t.key)return F.util.nextTick((function(){!function(e){if(t.pools[0].messageLength>=32)return s(),e();var r=32-t.pools[0].messageLength<<5;t.seedFile(r,(function(r,n){if(r)return e(r);t.collect(n),s(),e()}))}(u)}));var d=n(t.key,t.seed);t.generated+=d.length,c.putBytes(d),t.key=a(n(t.key,i(t.seed))),t.seed=o(n(t.key,t.seed)),F.util.setImmediate(u)}()},t.generateSync=function(e){var r=t.plugin.cipher,n=t.plugin.increment,i=t.plugin.formatKey,a=t.plugin.formatSeed;t.key=null;for(var s=F.util.createBuffer();s.length()<e;){t.generated>1048575&&(t.key=null),null===t.key&&o();var c=r(t.key,t.seed);t.generated+=c.length,s.putBytes(c),t.key=i(r(t.key,n(t.seed))),t.seed=a(r(t.key,t.seed))}return s.getBytes(e)},r?(t.seedFile=function(e,t){r.randomBytes(e,(function(e,r){if(e)return t(e);t(null,r.toString())}))},t.seedFileSync=function(e){return r.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,c(e))}catch(e){t(e)}},t.seedFileSync=c),t.collect=function(e){for(var r=e.length,n=0;n<r;++n)t.pools[t.pool].update(e.substr(n,1)),t.pool=31===t.pool?0:t.pool+1},t.collectInt=function(e,r){for(var n="",i=0;i<r;i+=8)n+=String.fromCharCode(e>>i&255);t.collect(n)},t.registerWorker=function(e){e===self?t.seedFile=function(e,t){self.addEventListener("message",(function e(r){var n=r.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",e),t(n.forge.prng.err,n.forge.prng.bytes))})),self.postMessage({forge:{prng:{needed:e}}})}:e.addEventListener("message",(function(r){var n=r.data;n.forge&&n.forge.prng&&t.seedFile(n.forge.prng.needed,(function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})}))}))},t}})),E((function(e){F.random&&F.random.getBytes?e.exports=F.random:function(t){var r={},n=new Array(4),i=F.util.createBuffer();function a(){var e=F.prng.create(r);return e.getBytes=function(t,r){return e.generate(t,r)},e.getBytesSync=function(t){return e.generate(t)},e}r.formatKey=function(e){var t=F.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),F.aes._expandKey(e,!1)},r.formatSeed=function(e){var t=F.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),e},r.cipher=function(e,t){return F.aes._updateBlock(e,t,n,!1),i.putInt32(n[0]),i.putInt32(n[1]),i.putInt32(n[2]),i.putInt32(n[3]),i.getBytes()},r.increment=function(e){return++e[3],e},r.md=F.md.sha256;var o=a(),s=null,c=F.util.globalScope,u=c.crypto||c.msCrypto;if(u&&u.getRandomValues&&(s=function(e){return u.getRandomValues(e)}),!F.util.isNodejs&&!s){if(o.collectInt(+new Date,32),"undefined"!=typeof navigator){var l="";for(var d in navigator)try{"string"==typeof navigator[d]&&(l+=navigator[d])}catch(e){}o.collect(l),l=null}t&&(t().mousemove((function(e){o.collectInt(e.clientX,16),o.collectInt(e.clientY,16)})),t().keypress((function(e){o.collectInt(e.charCode,8)})))}if(F.random)for(var d in o)F.random[d]=o[d];else F.random=o;F.random.createInstance=a,e.exports=F.random}("undefined"!=typeof jQuery?jQuery:null)}));var ye=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],ve=[1,2,3,5],be=function(e,t){return e<<t&65535|(65535&e)>>16-t},Ce=function(e,t){return(65535&e)>>t|e<<16-t&65535};F.rc2=F.rc2||{},F.rc2.expandKey=function(e,t){"string"==typeof e&&(e=F.util.createBuffer(e)),t=t||128;var r,n=e,i=e.length(),a=t,o=Math.ceil(a/8),s=255>>(7&a);for(r=i;r<128;r++)n.putByte(ye[n.at(r-1)+n.at(r-i)&255]);for(n.setAt(128-o,ye[n.at(128-o)&s]),r=127-o;r>=0;r--)n.setAt(r,ye[n.at(r+1)^n.at(r+o)]);return n};var Ee,we=function(e,t,r){var n,i,a,o,s=!1,c=null,u=null,l=null,d=[];for(e=F.rc2.expandKey(e,t),a=0;a<64;a++)d.push(e.getInt16Le());r?(n=function(e){for(a=0;a<4;a++)e[a]+=d[o]+(e[(a+3)%4]&e[(a+2)%4])+(~e[(a+3)%4]&e[(a+1)%4]),e[a]=be(e[a],ve[a]),o++},i=function(e){for(a=0;a<4;a++)e[a]+=d[63&e[(a+3)%4]]}):(n=function(e){for(a=3;a>=0;a--)e[a]=Ce(e[a],ve[a]),e[a]-=d[o]+(e[(a+3)%4]&e[(a+2)%4])+(~e[(a+3)%4]&e[(a+1)%4]),o--},i=function(e){for(a=3;a>=0;a--)e[a]-=d[63&e[(a+3)%4]]});var f=function(e){var t=[];for(a=0;a<4;a++){var n=c.getInt16Le();null!==l&&(r?n^=l.getInt16Le():l.putInt16Le(n)),t.push(65535&n)}o=r?0:63;for(var i=0;i<e.length;i++)for(var s=0;s<e[i][0];s++)e[i][1](t);for(a=0;a<4;a++)null!==l&&(r?l.putInt16Le(t[a]):t[a]^=l.getInt16Le()),u.putInt16Le(t[a])},p=null;return p={start:function(e,t){e&&"string"==typeof e&&(e=F.util.createBuffer(e)),s=!1,c=F.util.createBuffer(),u=t||new F.util.createBuffer,l=e,p.output=u},update:function(e){for(s||c.putBuffer(e);c.length()>=8;)f([[5,n],[1,i],[6,n],[1,i],[5,n]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,c,!r);else{var n=8===c.length()?8:8-c.length();c.fillWithByte(n,n)}if(t&&(s=!0,p.update()),!r&&(t=0===c.length()))if(e)t=e(8,u,!r);else{var i=u.length(),a=u.at(i-1);a>i?t=!1:u.truncate(a)}return t}}};function ke(e,t,r){this.data=[],null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function Se(){return new ke(null)}function Be(e,t,r,n,i,a){for(var o=16383&t,s=t>>14;--a>=0;){var c=16383&this.data[e],u=this.data[e++]>>14,l=s*c+u*o;i=((c=o*c+((16383&l)<<14)+r.data[n]+i)>>28)+(l>>14)+s*u,r.data[n++]=268435455&c}return i}F.rc2.startEncrypting=function(e,t,r){var n=F.rc2.createEncryptionCipher(e,128);return n.start(t,r),n},F.rc2.createEncryptionCipher=function(e,t){return we(e,t,!0)},F.rc2.startDecrypting=function(e,t,r){var n=F.rc2.createDecryptionCipher(e,128);return n.start(t,r),n},F.rc2.createDecryptionCipher=function(e,t){return we(e,t,!1)},F.jsbn=F.jsbn||{},F.jsbn.BigInteger=ke,"undefined"==typeof navigator?(ke.prototype.am=Be,Ee=28):"Microsoft Internet Explorer"==navigator.appName?(ke.prototype.am=function(e,t,r,n,i,a){for(var o=32767&t,s=t>>15;--a>=0;){var c=32767&this.data[e],u=this.data[e++]>>15,l=s*c+u*o;i=((c=o*c+((32767&l)<<15)+r.data[n]+(1073741823&i))>>>30)+(l>>>15)+s*u+(i>>>30),r.data[n++]=1073741823&c}return i},Ee=30):"Netscape"!=navigator.appName?(ke.prototype.am=function(e,t,r,n,i,a){for(;--a>=0;){var o=t*this.data[e++]+r.data[n]+i;i=Math.floor(o/67108864),r.data[n++]=67108863&o}return i},Ee=26):(ke.prototype.am=Be,Ee=28),ke.prototype.DB=Ee,ke.prototype.DM=(1<<Ee)-1,ke.prototype.DV=1<<Ee,ke.prototype.FV=Math.pow(2,52),ke.prototype.F1=52-Ee,ke.prototype.F2=2*Ee-52;var Te,Ae,Ie="0123456789abcdefghijklmnopqrstuvwxyz",_e=new Array;for(Te="0".charCodeAt(0),Ae=0;Ae<=9;++Ae)_e[Te++]=Ae;for(Te="a".charCodeAt(0),Ae=10;Ae<36;++Ae)_e[Te++]=Ae;for(Te="A".charCodeAt(0),Ae=10;Ae<36;++Ae)_e[Te++]=Ae;function xe(e){return Ie.charAt(e)}function Pe(e,t){var r=_e[e.charCodeAt(t)];return null==r?-1:r}function Re(e){var t=Se();return t.fromInt(e),t}function Ne(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function Oe(e){this.m=e}function Le(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function De(e,t){return e&t}function Ue(e,t){return e|t}function Me(e,t){return e^t}function Ve(e,t){return e&~t}function je(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function Fe(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function ze(){}function Ke(e){return e}function qe(e){this.r2=Se(),this.q3=Se(),ke.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}Oe.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},Oe.prototype.revert=function(e){return e},Oe.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},Oe.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},Oe.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},Le.prototype.convert=function(e){var t=Se();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(ke.ZERO)>0&&this.m.subTo(t,t),t},Le.prototype.revert=function(e){var t=Se();return e.copyTo(t),this.reduce(t),t},Le.prototype.reduce=function(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e.data[t],n=r*this.mpl+((r*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,n,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},Le.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},Le.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},ke.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s},ke.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0},ke.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var n=e.length,i=!1,a=0;--n>=0;){var o=8==r?255&e[n]:Pe(e,n);o<0?"-"==e.charAt(n)&&(i=!0):(i=!1,0==a?this.data[this.t++]=o:a+r>this.DB?(this.data[this.t-1]|=(o&(1<<this.DB-a)-1)<<a,this.data[this.t++]=o>>this.DB-a):this.data[this.t-1]|=o<<a,(a+=r)>=this.DB&&(a-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,a>0&&(this.data[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&ke.ZERO.subTo(this,this)},ke.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t},ke.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s},ke.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t.data[r-e]=this.data[r];t.t=Math.max(this.t-e,0),t.s=this.s},ke.prototype.lShiftTo=function(e,t){var r,n=e%this.DB,i=this.DB-n,a=(1<<i)-1,o=Math.floor(e/this.DB),s=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)t.data[r+o+1]=this.data[r]>>i|s,s=(this.data[r]&a)<<n;for(r=o-1;r>=0;--r)t.data[r]=0;t.data[o]=s,t.t=this.t+o+1,t.s=this.s,t.clamp()},ke.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,a=(1<<n)-1;t.data[0]=this.data[r]>>n;for(var o=r+1;o<this.t;++o)t.data[o-r-1]|=(this.data[o]&a)<<i,t.data[o-r]=this.data[o]>>n;n>0&&(t.data[this.t-r-1]|=(this.s&a)<<i),t.t=this.t-r,t.clamp()}},ke.prototype.subTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]-e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t.data[r++]=this.DV+n:n>0&&(t.data[r++]=n),t.t=r,t.clamp()},ke.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t.data[i]=0;for(i=0;i<n.t;++i)t.data[i+r.t]=r.am(0,n.data[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&ke.ZERO.subTo(t,t)},ke.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e.data[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t.data[r],e,2*r,0,1);(e.data[r+t.t]+=t.am(r+1,2*t.data[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp()},ke.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t)return null!=t&&t.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=Se());var a=Se(),o=this.s,s=e.s,c=this.DB-Ne(n.data[n.t-1]);c>0?(n.lShiftTo(c,a),i.lShiftTo(c,r)):(n.copyTo(a),i.copyTo(r));var u=a.t,l=a.data[u-1];if(0!=l){var d=l*(1<<this.F1)+(u>1?a.data[u-2]>>this.F2:0),f=this.FV/d,p=(1<<this.F1)/d,h=1<<this.F2,g=r.t,m=g-u,y=null==t?Se():t;for(a.dlShiftTo(m,y),r.compareTo(y)>=0&&(r.data[r.t++]=1,r.subTo(y,r)),ke.ONE.dlShiftTo(u,y),y.subTo(a,a);a.t<u;)a.data[a.t++]=0;for(;--m>=0;){var v=r.data[--g]==l?this.DM:Math.floor(r.data[g]*f+(r.data[g-1]+h)*p);if((r.data[g]+=a.am(0,v,r,m,0,u))<v)for(a.dlShiftTo(m,y),r.subTo(y,r);r.data[g]<--v;)r.subTo(y,r)}null!=t&&(r.drShiftTo(u,t),o!=s&&ke.ZERO.subTo(t,t)),r.t=u,r.clamp(),c>0&&r.rShiftTo(c,r),o<0&&ke.ZERO.subTo(r,r)}}},ke.prototype.invDigit=function(){if(this.t<1)return 0;var e=this.data[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},ke.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},ke.prototype.exp=function(e,t){if(e>4294967295||e<1)return ke.ONE;var r=Se(),n=Se(),i=t.convert(this),a=Ne(e)-1;for(i.copyTo(r);--a>=0;)if(t.sqrTo(r,n),(e&1<<a)>0)t.mulTo(n,i,r);else{var o=r;r=n,n=o}return t.revert(r)},ke.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<<t)-1,i=!1,a="",o=this.t,s=this.DB-o*this.DB%t;if(o-- >0)for(s<this.DB&&(r=this.data[o]>>s)>0&&(i=!0,a=xe(r));o>=0;)s<t?(r=(this.data[o]&(1<<s)-1)<<t-s,r|=this.data[--o]>>(s+=this.DB-t)):(r=this.data[o]>>(s-=t)&n,s<=0&&(s+=this.DB,--o)),r>0&&(i=!0),i&&(a+=xe(r));return i?a:"0"},ke.prototype.negate=function(){var e=Se();return ke.ZERO.subTo(this,e),e},ke.prototype.abs=function(){return this.s<0?this.negate():this},ke.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this.data[r]-e.data[r]))return t;return 0},ke.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+Ne(this.data[this.t-1]^this.s&this.DM)},ke.prototype.mod=function(e){var t=Se();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(ke.ZERO)>0&&e.subTo(t,t),t},ke.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new Oe(t):new Le(t),this.exp(e,r)},ke.ZERO=Re(0),ke.ONE=Re(1),ze.prototype.convert=Ke,ze.prototype.revert=Ke,ze.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},ze.prototype.sqrTo=function(e,t){e.squareTo(t)},qe.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=Se();return e.copyTo(t),this.reduce(t),t},qe.prototype.revert=function(e){return e},qe.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},qe.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},qe.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var He=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],Qe=(1<<26)/He[He.length-1];if(ke.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},ke.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=Re(r),i=Se(),a=Se(),o="";for(this.divRemTo(n,i,a);i.signum()>0;)o=(r+a.intValue()).toString(e).substr(1)+o,i.divRemTo(n,i,a);return a.intValue().toString(e)+o},ke.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,a=0,o=0,s=0;s<e.length;++s){var c=Pe(e,s);c<0?"-"==e.charAt(s)&&0==this.signum()&&(i=!0):(o=t*o+c,++a>=r&&(this.dMultiply(n),this.dAddOffset(o,0),a=0,o=0))}a>0&&(this.dMultiply(Math.pow(t,a)),this.dAddOffset(o,0)),i&&ke.ZERO.subTo(this,this)},ke.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(ke.ONE.shiftLeft(e-1),Ue,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(ke.ONE.shiftLeft(e-1),this);else{var n=new Array,i=7&e;n.length=1+(e>>3),t.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}},ke.prototype.bitwiseTo=function(e,t,r){var n,i,a=Math.min(e.t,this.t);for(n=0;n<a;++n)r.data[n]=t(this.data[n],e.data[n]);if(e.t<this.t){for(i=e.s&this.DM,n=a;n<this.t;++n)r.data[n]=t(this.data[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=a;n<e.t;++n)r.data[n]=t(i,e.data[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},ke.prototype.changeBit=function(e,t){var r=ke.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r},ke.prototype.addTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]+e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t.data[r++]=n:n<-1&&(t.data[r++]=this.DV+n),t.t=r,t.clamp()},ke.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},ke.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}},ke.prototype.multiplyLowerTo=function(e,t,r){var n,i=Math.min(this.t+e.t,t);for(r.s=0,r.t=i;i>0;)r.data[--i]=0;for(n=r.t-this.t;i<n;++i)r.data[i+this.t]=this.am(0,e.data[i],r,i,0,this.t);for(n=Math.min(e.t,t);i<n;++i)this.am(0,e.data[i],r,i,0,t-i);r.clamp()},ke.prototype.multiplyUpperTo=function(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r.data[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r.data[this.t+n-t]=this.am(t-n,e.data[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)},ke.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this.data[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this.data[n])%e;return r},ke.prototype.millerRabin=function(e){var t=this.subtract(ke.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var n,i=t.shiftRight(r),a={nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(256*Math.random())}},o=0;o<e;++o){do{n=new ke(this.bitLength(),a)}while(n.compareTo(ke.ONE)<=0||n.compareTo(t)>=0);var s=n.modPow(i,this);if(0!=s.compareTo(ke.ONE)&&0!=s.compareTo(t)){for(var c=1;c++<r&&0!=s.compareTo(t);)if(0==(s=s.modPowInt(2,this)).compareTo(ke.ONE))return!1;if(0!=s.compareTo(t))return!1}}return!0},ke.prototype.clone=function(){var e=Se();return this.copyTo(e),e},ke.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this.data[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this.data[0];if(0==this.t)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]},ke.prototype.byteValue=function(){return 0==this.t?this.s:this.data[0]<<24>>24},ke.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},ke.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},ke.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,i=0;if(e-- >0)for(n<this.DB&&(r=this.data[e]>>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this.data[e]&(1<<n)-1)<<8-n,r|=this.data[--e]>>(n+=this.DB-8)):(r=this.data[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},ke.prototype.equals=function(e){return 0==this.compareTo(e)},ke.prototype.min=function(e){return this.compareTo(e)<0?this:e},ke.prototype.max=function(e){return this.compareTo(e)>0?this:e},ke.prototype.and=function(e){var t=Se();return this.bitwiseTo(e,De,t),t},ke.prototype.or=function(e){var t=Se();return this.bitwiseTo(e,Ue,t),t},ke.prototype.xor=function(e){var t=Se();return this.bitwiseTo(e,Me,t),t},ke.prototype.andNot=function(e){var t=Se();return this.bitwiseTo(e,Ve,t),t},ke.prototype.not=function(){for(var e=Se(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e},ke.prototype.shiftLeft=function(e){var t=Se();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},ke.prototype.shiftRight=function(e){var t=Se();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},ke.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this.data[e])return e*this.DB+je(this.data[e]);return this.s<0?this.t*this.DB:-1},ke.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=Fe(this.data[r]^t);return e},ke.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this.data[t]&1<<e%this.DB)},ke.prototype.setBit=function(e){return this.changeBit(e,Ue)},ke.prototype.clearBit=function(e){return this.changeBit(e,Ve)},ke.prototype.flipBit=function(e){return this.changeBit(e,Me)},ke.prototype.add=function(e){var t=Se();return this.addTo(e,t),t},ke.prototype.subtract=function(e){var t=Se();return this.subTo(e,t),t},ke.prototype.multiply=function(e){var t=Se();return this.multiplyTo(e,t),t},ke.prototype.divide=function(e){var t=Se();return this.divRemTo(e,t,null),t},ke.prototype.remainder=function(e){var t=Se();return this.divRemTo(e,null,t),t},ke.prototype.divideAndRemainder=function(e){var t=Se(),r=Se();return this.divRemTo(e,t,r),new Array(t,r)},ke.prototype.modPow=function(e,t){var r,n,i=e.bitLength(),a=Re(1);if(i<=0)return a;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new Oe(t):t.isEven()?new qe(t):new Le(t);var o=new Array,s=3,c=r-1,u=(1<<r)-1;if(o[1]=n.convert(this),r>1){var l=Se();for(n.sqrTo(o[1],l);s<=u;)o[s]=Se(),n.mulTo(l,o[s-2],o[s]),s+=2}var d,f,p=e.t-1,h=!0,g=Se();for(i=Ne(e.data[p])-1;p>=0;){for(i>=c?d=e.data[p]>>i-c&u:(d=(e.data[p]&(1<<i+1)-1)<<c-i,p>0&&(d|=e.data[p-1]>>this.DB+i-c)),s=r;0==(1&d);)d>>=1,--s;if((i-=s)<0&&(i+=this.DB,--p),h)o[d].copyTo(a),h=!1;else{for(;s>1;)n.sqrTo(a,g),n.sqrTo(g,a),s-=2;s>0?n.sqrTo(a,g):(f=a,a=g,g=f),n.mulTo(g,o[d],a)}for(;p>=0&&0==(e.data[p]&1<<i);)n.sqrTo(a,g),f=a,a=g,g=f,--i<0&&(i=this.DB-1,--p)}return n.revert(a)},ke.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return ke.ZERO;for(var r=e.clone(),n=this.clone(),i=Re(1),a=Re(0),o=Re(0),s=Re(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?(i.isEven()&&a.isEven()||(i.addTo(this,i),a.subTo(e,a)),i.rShiftTo(1,i)):a.isEven()||a.subTo(e,a),a.rShiftTo(1,a);for(;n.isEven();)n.rShiftTo(1,n),t?(o.isEven()&&s.isEven()||(o.addTo(this,o),s.subTo(e,s)),o.rShiftTo(1,o)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);r.compareTo(n)>=0?(r.subTo(n,r),t&&i.subTo(o,i),a.subTo(s,a)):(n.subTo(r,n),t&&o.subTo(i,o),s.subTo(a,s))}return 0!=n.compareTo(ke.ONE)?ke.ZERO:s.compareTo(e)>=0?s.subtract(e):s.signum()<0?(s.addTo(e,s),s.signum()<0?s.add(e):s):s},ke.prototype.pow=function(e){return this.exp(e,new ze)},ke.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return t;for(i<a&&(a=i),a>0&&(t.rShiftTo(a,t),r.rShiftTo(a,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r},ke.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=He[He.length-1]){for(t=0;t<He.length;++t)if(r.data[0]==He[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<He.length;){for(var n=He[t],i=t+1;i<He.length&&n<Qe;)n*=He[i++];for(n=r.modInt(n);t<i;)if(n%He[t++]==0)return!1}return r.millerRabin(e)},E((function(e){var t=e.exports=F.sha1=F.sha1||{};F.md.sha1=F.md.algorithms.sha1=t,t.create=function(){n||(r=String.fromCharCode(128),r+=F.util.fillString(String.fromCharCode(0),64),n=!0);var e=null,t=F.util.createBuffer(),a=new Array(80),o={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){o.messageLength=0,o.fullMessageLength=o.messageLength64=[];for(var r=o.messageLengthSize/4,n=0;n<r;++n)o.fullMessageLength.push(0);return t=F.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},o}};return o.start(),o.update=function(r,n){"utf8"===n&&(r=F.util.encodeUtf8(r));var s=r.length;o.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var c=o.fullMessageLength.length-1;c>=0;--c)o.fullMessageLength[c]+=s[1],s[1]=s[0]+(o.fullMessageLength[c]/4294967296>>>0),o.fullMessageLength[c]=o.fullMessageLength[c]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(r),i(e,a,t),(t.read>2048||0===t.length())&&t.compact(),o},o.digest=function(){var n=F.util.createBuffer();n.putBytes(t.bytes());var s,c=o.fullMessageLength[o.fullMessageLength.length-1]+o.messageLengthSize&o.blockLength-1;n.putBytes(r.substr(0,o.blockLength-c));for(var u=8*o.fullMessageLength[0],l=0;l<o.fullMessageLength.length-1;++l)u+=(s=8*o.fullMessageLength[l+1])/4294967296>>>0,n.putInt32(u>>>0),u=s>>>0;n.putInt32(u);var d={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};i(d,a,n);var f=F.util.createBuffer();return f.putInt32(d.h0),f.putInt32(d.h1),f.putInt32(d.h2),f.putInt32(d.h3),f.putInt32(d.h4),f},o};var r=null,n=!1;function i(e,t,r){for(var n,i,a,o,s,c,u,l=r.length();l>=64;){for(i=e.h0,a=e.h1,o=e.h2,s=e.h3,c=e.h4,u=0;u<16;++u)n=r.getInt32(),t[u]=n,n=(i<<5|i>>>27)+(s^a&(o^s))+c+1518500249+n,c=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<20;++u)n=(n=t[u-3]^t[u-8]^t[u-14]^t[u-16])<<1|n>>>31,t[u]=n,n=(i<<5|i>>>27)+(s^a&(o^s))+c+1518500249+n,c=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<32;++u)n=(n=t[u-3]^t[u-8]^t[u-14]^t[u-16])<<1|n>>>31,t[u]=n,n=(i<<5|i>>>27)+(a^o^s)+c+1859775393+n,c=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<40;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(i<<5|i>>>27)+(a^o^s)+c+1859775393+n,c=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<60;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(i<<5|i>>>27)+(a&o|s&(a^o))+c+2400959708+n,c=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;u<80;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(i<<5|i>>>27)+(a^o^s)+c+3395469782+n,c=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+o|0,e.h3=e.h3+s|0,e.h4=e.h4+c|0,l-=64}}})),E((function(e){var t=e.exports=F.pkcs1=F.pkcs1||{};function r(e,t,r){r||(r=F.md.sha1.create());for(var n="",i=Math.ceil(t/r.digestLength),a=0;a<i;++a){var o=String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,255&a);r.start(),r.update(e+o),n+=r.digest().getBytes()}return n.substring(0,t)}t.encode_rsa_oaep=function(e,t,n){var i,a,o,s;"string"==typeof n?(i=n,a=arguments[3]||void 0,o=arguments[4]||void 0):n&&(i=n.label||void 0,a=n.seed||void 0,o=n.md||void 0,n.mgf1&&n.mgf1.md&&(s=n.mgf1.md)),o?o.start():o=F.md.sha1.create(),s||(s=o);var c=Math.ceil(e.n.bitLength()/8),u=c-2*o.digestLength-2;if(t.length>u)throw(h=new Error("RSAES-OAEP input message length is too long.")).length=t.length,h.maxLength=u,h;i||(i=""),o.update(i,"raw");for(var l=o.digest(),d="",f=u-t.length,p=0;p<f;p++)d+="\0";var h,g=l.getBytes()+d+""+t;if(a){if(a.length!==o.digestLength)throw(h=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.")).seedLength=a.length,h.digestLength=o.digestLength,h}else a=F.random.getBytes(o.digestLength);var m=r(a,c-o.digestLength-1,s),y=F.util.xorBytes(g,m,g.length),v=r(y,o.digestLength,s);return"\0"+F.util.xorBytes(a,v,a.length)+y},t.decode_rsa_oaep=function(e,t,n){var i,a,o;"string"==typeof n?(i=n,a=arguments[3]||void 0):n&&(i=n.label||void 0,a=n.md||void 0,n.mgf1&&n.mgf1.md&&(o=n.mgf1.md));var s=Math.ceil(e.n.bitLength()/8);if(t.length!==s)throw(m=new Error("RSAES-OAEP encoded message length is invalid.")).length=t.length,m.expectedLength=s,m;if(void 0===a?a=F.md.sha1.create():a.start(),o||(o=a),s<2*a.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");i||(i=""),a.update(i,"raw");for(var c=a.digest().getBytes(),u=t.charAt(0),l=t.substring(1,a.digestLength+1),d=t.substring(1+a.digestLength),f=r(d,a.digestLength,o),p=r(F.util.xorBytes(l,f,l.length),s-a.digestLength-1,o),h=F.util.xorBytes(d,p,d.length),g=h.substring(0,a.digestLength),m="\0"!==u,y=0;y<a.digestLength;++y)m|=c.charAt(y)!==g.charAt(y);for(var v=1,b=a.digestLength,C=a.digestLength;C<h.length;C++){var E=h.charCodeAt(C);m|=E&(v?65534:0),b+=v&=1&E^1}if(m||1!==h.charCodeAt(b))throw new Error("Invalid RSAES-OAEP padding.");return h.substring(b+1)}})),E((function(e){!function(){if(F.prime)e.exports=F.prime;else{var t=e.exports=F.prime=F.prime||{},r=F.jsbn.BigInteger,n=[6,4,2,4,2,4,6,2],i=new r(null);i.fromInt(30);var a=function(e,t){return e|t};t.generateProbablePrime=function(e,t,n){"function"==typeof t&&(n=t,t={});var i=(t=t||{}).algorithm||"PRIMEINC";"string"==typeof i&&(i={name:i}),i.options=i.options||{};var a=t.prng||F.random,c={nextBytes:function(e){for(var t=a.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}};if("PRIMEINC"===i.name)return function(e,t,n,i){return"workers"in n?function(e,t,n,i){if("undefined"==typeof Worker)return o(e,t,n,i);var a=s(e,t),c=n.workers,u=n.workLoad||100,l=30*u/8,d=n.workerScript||"forge/prime.worker.js";if(-1===c)return F.util.estimateCores((function(e,t){e&&(t=2),c=t-1,f()}));function f(){c=Math.max(1,c);for(var n=[],o=0;o<c;++o)n[o]=new Worker(d);for(o=0;o<c;++o)n[o].addEventListener("message",p);var f=!1;function p(o){if(!f){var c=o.data;if(c.found){for(var d=0;d<n.length;++d)n[d].terminate();return f=!0,i(null,new r(c.prime,16))}a.bitLength()>e&&(a=s(e,t));var p=a.toString(16);o.target.postMessage({hex:p,workLoad:u}),a.dAddOffset(l,0)}}}f()}(e,t,n,i):o(e,t,n,i)}(e,c,i.options,n);throw new Error("Invalid prime generation algorithm: "+i.name)}}function o(e,t,r,i){var a=s(e,t),o=function(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}(a.bitLength());"millerRabinTests"in r&&(o=r.millerRabinTests);var c=10;"maxBlockTime"in r&&(c=r.maxBlockTime),function e(t,r,i,a,o,c,u){var l=+new Date;do{if(t.bitLength()>r&&(t=s(r,i)),t.isProbablePrime(o))return u(null,t);t.dAddOffset(n[a++%8],0)}while(c<0||+new Date-l<c);F.util.setImmediate((function(){e(t,r,i,a,o,c,u)}))}(a,e,t,0,o,c,i)}function s(e,t){var n=new r(e,t),o=e-1;return n.testBit(o)||n.bitwiseTo(r.ONE.shiftLeft(o),a,n),n.dAddOffset(31-n.mod(i).byteValue(),0),n}}()})),void 0===Ge)var Ge=F.jsbn.BigInteger;var We=F.util.isNodejs?t:null,Xe=F.asn1,Ye=F.util;F.pki=F.pki||{},F.pki.rsa=F.rsa=F.rsa||{};var $e=F.pki,Ze=[6,4,2,4,2,4,6,2],Je={name:"PrivateKeyInfo",tagClass:Xe.Class.UNIVERSAL,type:Xe.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:Xe.Class.UNIVERSAL,type:Xe.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:Xe.Class.UNIVERSAL,type:Xe.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Xe.Class.UNIVERSAL,type:Xe.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:Xe.Class.UNIVERSAL,type:Xe.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},et={name:"RSAPrivateKey",tagClass:Xe.Class.UNIVERSAL,type:Xe.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:Xe.Class.UNIVERSAL,type:Xe.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:Xe.Class.UNIVERSAL,type:Xe.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:Xe.Class.UNIVERSAL,type:Xe.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:Xe.Class.UNIVERSAL,type:Xe.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:Xe.Class.UNIVERSAL,type:Xe.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:Xe.Class.UNIVERSAL,type:Xe.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:Xe.Class.UNIVERSAL,type:Xe.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:Xe.Class.UNIVERSAL,type:Xe.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:Xe.Class.UNIVERSAL,type:Xe.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},tt={name:"RSAPublicKey",tagClass:Xe.Class.UNIVERSAL,type:Xe.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:Xe.Class.UNIVERSAL,type:Xe.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:Xe.Class.UNIVERSAL,type:Xe.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},rt=F.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:Xe.Class.UNIVERSAL,type:Xe.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:Xe.Class.UNIVERSAL,type:Xe.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Xe.Class.UNIVERSAL,type:Xe.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:Xe.Class.UNIVERSAL,type:Xe.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:Xe.Class.UNIVERSAL,type:Xe.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},nt=function(e){var t;if(!(e.algorithm in $e.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}t=$e.oids[e.algorithm];var n=Xe.oidToDer(t).getBytes(),i=Xe.create(Xe.Class.UNIVERSAL,Xe.Type.SEQUENCE,!0,[]),a=Xe.create(Xe.Class.UNIVERSAL,Xe.Type.SEQUENCE,!0,[]);a.value.push(Xe.create(Xe.Class.UNIVERSAL,Xe.Type.OID,!1,n)),a.value.push(Xe.create(Xe.Class.UNIVERSAL,Xe.Type.NULL,!1,""));var o=Xe.create(Xe.Class.UNIVERSAL,Xe.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(a),i.value.push(o),Xe.toDer(i).getBytes()},it=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);var n;t.dP||(t.dP=t.d.mod(t.p.subtract(Ge.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(Ge.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do{n=new Ge(F.util.bytesToHex(F.random.getBytes(t.n.bitLength()/8)),16)}while(n.compareTo(t.n)>=0||!n.gcd(t.n).equals(Ge.ONE));for(var i=(e=e.multiply(n.modPow(t.e,t.n)).mod(t.n)).mod(t.p).modPow(t.dP,t.p),a=e.mod(t.q).modPow(t.dQ,t.q);i.compareTo(a)<0;)i=i.add(t.p);var o=i.subtract(a).multiply(t.qInv).mod(t.p).multiply(t.q).add(a);return o.multiply(n.modInverse(t.n)).mod(t.n)};function at(e,t,r){var n=F.util.createBuffer(),i=Math.ceil(t.n.bitLength()/8);if(e.length>i-11){var a=new Error("Message is too long for PKCS#1 v1.5 padding.");throw a.length=e.length,a.max=i-11,a}n.putByte(0),n.putByte(r);var o,s=i-3-e.length;if(0===r||1===r){o=0===r?0:255;for(var c=0;c<s;++c)n.putByte(o)}else for(;s>0;){var u=0,l=F.random.getBytes(s);for(c=0;c<s;++c)0===(o=l.charCodeAt(c))?++u:n.putByte(o);s=u}return n.putByte(0),n.putBytes(e),n}function ot(e,t,r,n){var i=Math.ceil(t.n.bitLength()/8),a=F.util.createBuffer(e),o=a.getByte(),s=a.getByte();if(0!==o||r&&0!==s&&1!==s||!r&&2!=s||r&&0===s&&void 0===n)throw new Error("Encryption block is invalid.");var c=0;if(0===s){c=i-3-n;for(var u=0;u<c;++u)if(0!==a.getByte())throw new Error("Encryption block is invalid.")}else if(1===s)for(c=0;a.length()>1;){if(255!==a.getByte()){--a.read;break}++c}else if(2===s)for(c=0;a.length()>1;){if(0===a.getByte()){--a.read;break}++c}if(0!==a.getByte()||c!==i-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}function st(e,t,r){"function"==typeof t&&(r=t,t={});var n={algorithm:{name:(t=t||{}).algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};function i(){a(e.pBits,(function(t,n){return t?r(t):(e.p=n,null!==e.q?o(t,e.q):void a(e.qBits,o))}))}function a(e,t){F.prime.generateProbablePrime(e,n,t)}function o(t,n){if(t)return r(t);if(e.q=n,e.p.compareTo(e.q)<0){var s=e.p;e.p=e.q,e.q=s}if(0!==e.p.subtract(Ge.ONE).gcd(e.e).compareTo(Ge.ONE))return e.p=null,void i();if(0!==e.q.subtract(Ge.ONE).gcd(e.e).compareTo(Ge.ONE))return e.q=null,void a(e.qBits,o);if(e.p1=e.p.subtract(Ge.ONE),e.q1=e.q.subtract(Ge.ONE),e.phi=e.p1.multiply(e.q1),0!==e.phi.gcd(e.e).compareTo(Ge.ONE))return e.p=e.q=null,void i();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void a(e.qBits,o);var c=e.e.modInverse(e.phi);e.keys={privateKey:$e.rsa.setPrivateKey(e.n,e.e,c,e.p,e.q,c.mod(e.p1),c.mod(e.q1),e.q.modInverse(e.p)),publicKey:$e.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}"prng"in t&&(n.prng=t.prng),i()}function ct(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=F.util.hexToBytes(t);return r.length>1&&(0===r.charCodeAt(0)&&0==(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128==(128&r.charCodeAt(1)))?r.substr(1):r}function ut(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function lt(e){return F.util.isNodejs&&"function"==typeof We[e]}function dt(e){return void 0!==Ye.globalScope&&"object"==typeof Ye.globalScope.crypto&&"object"==typeof Ye.globalScope.crypto.subtle&&"function"==typeof Ye.globalScope.crypto.subtle[e]}function ft(e){return void 0!==Ye.globalScope&&"object"==typeof Ye.globalScope.msCrypto&&"object"==typeof Ye.globalScope.msCrypto.subtle&&"function"==typeof Ye.globalScope.msCrypto.subtle[e]}function pt(e){for(var t=F.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),n=0;n<t.length;++n)r[n]=t.charCodeAt(n);return r}if($e.rsa.encrypt=function(e,t,r){var n,i=r,a=Math.ceil(t.n.bitLength()/8);!1!==r&&!0!==r?(i=2===r,n=at(e,t,r)):(n=F.util.createBuffer()).putBytes(e);for(var o=new Ge(n.toHex(),16),s=it(o,t,i).toString(16),c=F.util.createBuffer(),u=a-Math.ceil(s.length/2);u>0;)c.putByte(0),--u;return c.putBytes(F.util.hexToBytes(s)),c.getBytes()},$e.rsa.decrypt=function(e,t,r,n){var i=Math.ceil(t.n.bitLength()/8);if(e.length!==i){var a=new Error("Encrypted message length is invalid.");throw a.length=e.length,a.expected=i,a}var o=new Ge(F.util.createBuffer(e).toHex(),16);if(o.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var s=it(o,t,r).toString(16),c=F.util.createBuffer(),u=i-Math.ceil(s.length/2);u>0;)c.putByte(0),--u;return c.putBytes(F.util.hexToBytes(s)),!1!==n?ot(c.getBytes(),t,r):c.getBytes()},$e.rsa.createKeyPairGenerationState=function(e,t,r){"string"==typeof e&&(e=parseInt(e,10)),e=e||2048;var n,i=(r=r||{}).prng||F.random,a={nextBytes:function(e){for(var t=i.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}},o=r.algorithm||"PRIMEINC";if("PRIMEINC"!==o)throw new Error("Invalid key generation algorithm: "+o);return(n={algorithm:o,state:0,bits:e,rng:a,eInt:t||65537,e:new Ge(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(n.eInt),n},$e.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new Ge(null);r.fromInt(30);for(var n,i=0,a=function(e,t){return e|t},o=+new Date,s=0;null===e.keys&&(t<=0||s<t);){if(0===e.state){var c=null===e.p?e.pBits:e.qBits,u=c-1;0===e.pqState?(e.num=new Ge(c,e.rng),e.num.testBit(u)||e.num.bitwiseTo(Ge.ONE.shiftLeft(u),a,e.num),e.num.dAddOffset(31-e.num.mod(r).byteValue(),0),i=0,++e.pqState):1===e.pqState?e.num.bitLength()>c?e.pqState=0:e.num.isProbablePrime(ut(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(Ze[i++%8],0):2===e.pqState?e.pqState=0===e.num.subtract(Ge.ONE).gcd(e.e).compareTo(Ge.ONE)?3:0:3===e.pqState&&(e.pqState=0,null===e.p?e.p=e.num:e.q=e.num,null!==e.p&&null!==e.q&&++e.state,e.num=null)}else if(1===e.state)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(2===e.state)e.p1=e.p.subtract(Ge.ONE),e.q1=e.q.subtract(Ge.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(Ge.ONE)?++e.state:(e.p=null,e.q=null,e.state=0);else if(4===e.state)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(5===e.state){var l=e.e.modInverse(e.phi);e.keys={privateKey:$e.rsa.setPrivateKey(e.n,e.e,l,e.p,e.q,l.mod(e.p1),l.mod(e.q1),e.q.modInverse(e.p)),publicKey:$e.rsa.setPublicKey(e.n,e.e)}}s+=(n=+new Date)-o,o=n}return null!==e.keys},$e.rsa.generateKeyPair=function(e,t,r,n){if(1===arguments.length?"object"==typeof e?(r=e,e=void 0):"function"==typeof e&&(n=e,e=void 0):2===arguments.length?"number"==typeof e?"function"==typeof t?(n=t,t=void 0):"number"!=typeof t&&(r=t,t=void 0):(r=e,n=t,e=void 0,t=void 0):3===arguments.length&&("number"==typeof t?"function"==typeof r&&(n=r,r=void 0):(n=r,r=t,t=void 0)),r=r||{},void 0===e&&(e=r.bits||2048),void 0===t&&(t=r.e||65537),!r.prng&&e>=256&&e<=16384&&(65537===t||3===t))if(n){if(lt("generateKeyPair"))return We.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},(function(e,t,r){if(e)return n(e);n(null,{privateKey:$e.privateKeyFromPem(r),publicKey:$e.publicKeyFromPem(t)})}));if(dt("generateKey")&&dt("exportKey"))return Ye.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:pt(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then((function(e){return Ye.globalScope.crypto.subtle.exportKey("pkcs8",e.privateKey)})).then(void 0,(function(e){n(e)})).then((function(e){if(e){var t=$e.privateKeyFromAsn1(Xe.fromDer(F.util.createBuffer(e)));n(null,{privateKey:t,publicKey:$e.setRsaPublicKey(t.n,t.e)})}}));if(ft("generateKey")&&ft("exportKey")){var i=Ye.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:pt(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);return i.oncomplete=function(e){var t=e.target.result,r=Ye.globalScope.msCrypto.subtle.exportKey("pkcs8",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=$e.privateKeyFromAsn1(Xe.fromDer(F.util.createBuffer(t)));n(null,{privateKey:r,publicKey:$e.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){n(e)}},void(i.onerror=function(e){n(e)})}}else if(lt("generateKeyPairSync")){var a=We.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:$e.privateKeyFromPem(a.privateKey),publicKey:$e.publicKeyFromPem(a.publicKey)}}var o=$e.rsa.createKeyPairGenerationState(e,t,r);if(!n)return $e.rsa.stepKeyPairGenerationState(o,0),o.keys;st(o,r,n)},$e.setRsaPublicKey=$e.rsa.setPublicKey=function(e,t){var r={n:e,e:t,encrypt:function(e,t,n){if("string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===t)t={encode:function(e,t,r){return at(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return F.pkcs1.encode_rsa_oaep(t,e,n)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(t))t={encode:function(e){return e}};else if("string"==typeof t)throw new Error('Unsupported encryption scheme: "'+t+'".');var i=t.encode(e,r,!0);return $e.rsa.encrypt(i,r,!0)},verify:function(e,t,n){"string"==typeof n?n=n.toUpperCase():void 0===n&&(n="RSASSA-PKCS1-V1_5"),"RSASSA-PKCS1-V1_5"===n?n={verify:function(e,t){return t=ot(t,r,!0),e===Xe.fromDer(t).value[1].value}}:"NONE"!==n&&"NULL"!==n&&null!==n||(n={verify:function(e,t){return e===ot(t,r,!0)}});var i=$e.rsa.decrypt(t,r,!0,!1);return n.verify(e,i,r.n.bitLength())}};return r},$e.setRsaPrivateKey=$e.rsa.setPrivateKey=function(e,t,r,n,i,a,o,s){var c={n:e,e:t,d:r,p:n,q:i,dP:a,dQ:o,qInv:s,decrypt:function(e,t,r){"string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var n=$e.rsa.decrypt(e,c,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:ot};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return F.pkcs1.decode_rsa_oaep(t,e,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(t))throw new Error('Unsupported encryption scheme: "'+t+'".');t={decode:function(e){return e}}}return t.decode(n,c,!1)},sign:function(e,t){var r=!1;"string"==typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:nt},r=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},r=1);var n=t.encode(e,c.n.bitLength());return $e.rsa.encrypt(n,c,r)}};return c},$e.wrapRsaPrivateKey=function(e){return Xe.create(Xe.Class.UNIVERSAL,Xe.Type.SEQUENCE,!0,[Xe.create(Xe.Class.UNIVERSAL,Xe.Type.INTEGER,!1,Xe.integerToDer(0).getBytes()),Xe.create(Xe.Class.UNIVERSAL,Xe.Type.SEQUENCE,!0,[Xe.create(Xe.Class.UNIVERSAL,Xe.Type.OID,!1,Xe.oidToDer($e.oids.rsaEncryption).getBytes()),Xe.create(Xe.Class.UNIVERSAL,Xe.Type.NULL,!1,"")]),Xe.create(Xe.Class.UNIVERSAL,Xe.Type.OCTETSTRING,!1,Xe.toDer(e).getBytes())])},$e.privateKeyFromAsn1=function(e){var t,r,n,i,a,o,s,c,u={},l=[];if(Xe.validate(e,Je,u,l)&&(e=Xe.fromDer(F.util.createBuffer(u.privateKey))),u={},l=[],!Xe.validate(e,et,u,l)){var d=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw d.errors=l,d}return t=F.util.createBuffer(u.privateKeyModulus).toHex(),r=F.util.createBuffer(u.privateKeyPublicExponent).toHex(),n=F.util.createBuffer(u.privateKeyPrivateExponent).toHex(),i=F.util.createBuffer(u.privateKeyPrime1).toHex(),a=F.util.createBuffer(u.privateKeyPrime2).toHex(),o=F.util.createBuffer(u.privateKeyExponent1).toHex(),s=F.util.createBuffer(u.privateKeyExponent2).toHex(),c=F.util.createBuffer(u.privateKeyCoefficient).toHex(),$e.setRsaPrivateKey(new Ge(t,16),new Ge(r,16),new Ge(n,16),new Ge(i,16),new Ge(a,16),new Ge(o,16),new Ge(s,16),new Ge(c,16))},$e.privateKeyToAsn1=$e.privateKeyToRSAPrivateKey=function(e){return Xe.create(Xe.Class.UNIVERSAL,Xe.Type.SEQUENCE,!0,[Xe.create(Xe.Class.UNIVERSAL,Xe.Type.INTEGER,!1,Xe.integerToDer(0).getBytes()),Xe.create(Xe.Class.UNIVERSAL,Xe.Type.INTEGER,!1,ct(e.n)),Xe.create(Xe.Class.UNIVERSAL,Xe.Type.INTEGER,!1,ct(e.e)),Xe.create(Xe.Class.UNIVERSAL,Xe.Type.INTEGER,!1,ct(e.d)),Xe.create(Xe.Class.UNIVERSAL,Xe.Type.INTEGER,!1,ct(e.p)),Xe.create(Xe.Class.UNIVERSAL,Xe.Type.INTEGER,!1,ct(e.q)),Xe.create(Xe.Class.UNIVERSAL,Xe.Type.INTEGER,!1,ct(e.dP)),Xe.create(Xe.Class.UNIVERSAL,Xe.Type.INTEGER,!1,ct(e.dQ)),Xe.create(Xe.Class.UNIVERSAL,Xe.Type.INTEGER,!1,ct(e.qInv))])},$e.publicKeyFromAsn1=function(e){var t={},r=[];if(Xe.validate(e,rt,t,r)){var n,i=Xe.derToOid(t.publicKeyOid);if(i!==$e.oids.rsaEncryption)throw(n=new Error("Cannot read public key. Unknown OID.")).oid=i,n;e=t.rsaPublicKey}if(r=[],!Xe.validate(e,tt,t,r))throw(n=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,n;var a=F.util.createBuffer(t.publicKeyModulus).toHex(),o=F.util.createBuffer(t.publicKeyExponent).toHex();return $e.setRsaPublicKey(new Ge(a,16),new Ge(o,16))},$e.publicKeyToAsn1=$e.publicKeyToSubjectPublicKeyInfo=function(e){return Xe.create(Xe.Class.UNIVERSAL,Xe.Type.SEQUENCE,!0,[Xe.create(Xe.Class.UNIVERSAL,Xe.Type.SEQUENCE,!0,[Xe.create(Xe.Class.UNIVERSAL,Xe.Type.OID,!1,Xe.oidToDer($e.oids.rsaEncryption).getBytes()),Xe.create(Xe.Class.UNIVERSAL,Xe.Type.NULL,!1,"")]),Xe.create(Xe.Class.UNIVERSAL,Xe.Type.BITSTRING,!1,[$e.publicKeyToRSAPublicKey(e)])])},$e.publicKeyToRSAPublicKey=function(e){return Xe.create(Xe.Class.UNIVERSAL,Xe.Type.SEQUENCE,!0,[Xe.create(Xe.Class.UNIVERSAL,Xe.Type.INTEGER,!1,ct(e.n)),Xe.create(Xe.Class.UNIVERSAL,Xe.Type.INTEGER,!1,ct(e.e))])},void 0===ht)var ht=F.jsbn.BigInteger;var gt=F.asn1,mt=F.pki=F.pki||{},yt=(mt.pbe=F.pbe=F.pbe||{},mt.oids),vt={name:"EncryptedPrivateKeyInfo",tagClass:gt.Class.UNIVERSAL,type:gt.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:gt.Class.UNIVERSAL,type:gt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:gt.Class.UNIVERSAL,type:gt.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:gt.Class.UNIVERSAL,type:gt.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:gt.Class.UNIVERSAL,type:gt.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},bt={name:"PBES2Algorithms",tagClass:gt.Class.UNIVERSAL,type:gt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:gt.Class.UNIVERSAL,type:gt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:gt.Class.UNIVERSAL,type:gt.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:gt.Class.UNIVERSAL,type:gt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:gt.Class.UNIVERSAL,type:gt.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:gt.Class.UNIVERSAL,type:gt.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:gt.Class.UNIVERSAL,type:gt.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:gt.Class.UNIVERSAL,type:gt.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:gt.Class.UNIVERSAL,type:gt.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:gt.Class.UNIVERSAL,type:gt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:gt.Class.UNIVERSAL,type:gt.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:gt.Class.UNIVERSAL,type:gt.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},Ct={name:"pkcs-12PbeParams",tagClass:gt.Class.UNIVERSAL,type:gt.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:gt.Class.UNIVERSAL,type:gt.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:gt.Class.UNIVERSAL,type:gt.Type.INTEGER,constructed:!1,capture:"iterations"}]};function Et(e,t){return e.start().update(t).digest().getBytes()}function wt(e){var t;if(e){if(!(t=mt.oids[gt.derToOid(e)])){var r=new Error("Unsupported PRF OID.");throw r.oid=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}}else t="hmacWithSHA1";return kt(t)}function kt(e){var t=F.md;switch(e){case"hmacWithSHA224":t=F.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var r=new Error("Unsupported PRF algorithm.");throw r.algorithm=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}mt.encryptPrivateKeyInfo=function(e,t,r){(r=r||{}).saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var n,i,a,o=F.random.getBytesSync(r.saltSize),s=r.count,c=gt.integerToDer(s);if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){var u,l,d;switch(r.algorithm){case"aes128":n=16,u=16,l=yt["aes128-CBC"],d=F.aes.createEncryptionCipher;break;case"aes192":n=24,u=16,l=yt["aes192-CBC"],d=F.aes.createEncryptionCipher;break;case"aes256":n=32,u=16,l=yt["aes256-CBC"],d=F.aes.createEncryptionCipher;break;case"des":n=8,u=8,l=yt.desCBC,d=F.des.createEncryptionCipher;break;default:throw(y=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,y}var f="hmacWith"+r.prfAlgorithm.toUpperCase(),p=kt(f),h=F.pkcs5.pbkdf2(t,o,s,n,p),g=F.random.getBytesSync(u);(v=d(h)).start(g),v.update(gt.toDer(e)),v.finish(),a=v.output.getBytes();var m=function(e,t,r,n){var i=gt.create(gt.Class.UNIVERSAL,gt.Type.SEQUENCE,!0,[gt.create(gt.Class.UNIVERSAL,gt.Type.OCTETSTRING,!1,e),gt.create(gt.Class.UNIVERSAL,gt.Type.INTEGER,!1,t.getBytes())]);return"hmacWithSHA1"!==n&&i.value.push(gt.create(gt.Class.UNIVERSAL,gt.Type.INTEGER,!1,F.util.hexToBytes(r.toString(16))),gt.create(gt.Class.UNIVERSAL,gt.Type.SEQUENCE,!0,[gt.create(gt.Class.UNIVERSAL,gt.Type.OID,!1,gt.oidToDer(mt.oids[n]).getBytes()),gt.create(gt.Class.UNIVERSAL,gt.Type.NULL,!1,"")])),i}(o,c,n,f);i=gt.create(gt.Class.UNIVERSAL,gt.Type.SEQUENCE,!0,[gt.create(gt.Class.UNIVERSAL,gt.Type.OID,!1,gt.oidToDer(yt.pkcs5PBES2).getBytes()),gt.create(gt.Class.UNIVERSAL,gt.Type.SEQUENCE,!0,[gt.create(gt.Class.UNIVERSAL,gt.Type.SEQUENCE,!0,[gt.create(gt.Class.UNIVERSAL,gt.Type.OID,!1,gt.oidToDer(yt.pkcs5PBKDF2).getBytes()),m]),gt.create(gt.Class.UNIVERSAL,gt.Type.SEQUENCE,!0,[gt.create(gt.Class.UNIVERSAL,gt.Type.OID,!1,gt.oidToDer(l).getBytes()),gt.create(gt.Class.UNIVERSAL,gt.Type.OCTETSTRING,!1,g)])])])}else{var y;if("3des"!==r.algorithm)throw(y=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,y;n=24;var v,b=new F.util.ByteBuffer(o);h=mt.pbe.generatePkcs12Key(t,b,1,s,n),g=mt.pbe.generatePkcs12Key(t,b,2,s,n),(v=F.des.createEncryptionCipher(h)).start(g),v.update(gt.toDer(e)),v.finish(),a=v.output.getBytes(),i=gt.create(gt.Class.UNIVERSAL,gt.Type.SEQUENCE,!0,[gt.create(gt.Class.UNIVERSAL,gt.Type.OID,!1,gt.oidToDer(yt["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),gt.create(gt.Class.UNIVERSAL,gt.Type.SEQUENCE,!0,[gt.create(gt.Class.UNIVERSAL,gt.Type.OCTETSTRING,!1,o),gt.create(gt.Class.UNIVERSAL,gt.Type.INTEGER,!1,c.getBytes())])])}return gt.create(gt.Class.UNIVERSAL,gt.Type.SEQUENCE,!0,[i,gt.create(gt.Class.UNIVERSAL,gt.Type.OCTETSTRING,!1,a)])},mt.decryptPrivateKeyInfo=function(e,t){var r=null,n={},i=[];if(!gt.validate(e,vt,n,i)){var a=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}var o=gt.derToOid(n.encryptionOid),s=mt.pbe.getCipher(o,n.encryptionParams,t),c=F.util.createBuffer(n.encryptedData);return s.update(c),s.finish()&&(r=gt.fromDer(s.output)),r},mt.encryptedPrivateKeyToPem=function(e,t){var r={type:"ENCRYPTED PRIVATE KEY",body:gt.toDer(e).getBytes()};return F.pem.encode(r,{maxline:t})},mt.encryptedPrivateKeyFromPem=function(e){var t=F.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==t.type){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return gt.fromDer(t.body)},mt.encryptRsaPrivateKey=function(e,t,r){if(!(r=r||{}).legacy){var n=mt.wrapRsaPrivateKey(mt.privateKeyToAsn1(e));return n=mt.encryptPrivateKeyInfo(n,t,r),mt.encryptedPrivateKeyToPem(n)}var i,a,o,s;switch(r.algorithm){case"aes128":i="AES-128-CBC",o=16,a=F.random.getBytesSync(16),s=F.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",o=24,a=F.random.getBytesSync(16),s=F.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",o=32,a=F.random.getBytesSync(16),s=F.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",o=24,a=F.random.getBytesSync(8),s=F.des.createEncryptionCipher;break;case"des":i="DES-CBC",o=8,a=F.random.getBytesSync(8),s=F.des.createEncryptionCipher;break;default:var c=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw c.algorithm=r.algorithm,c}var u=s(F.pbe.opensslDeriveBytes(t,a.substr(0,8),o));u.start(a),u.update(gt.toDer(mt.privateKeyToAsn1(e))),u.finish();var l={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:F.util.bytesToHex(a).toUpperCase()},body:u.output.getBytes()};return F.pem.encode(l)},mt.decryptRsaPrivateKey=function(e,t){var r=null,n=F.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==n.type&&"PRIVATE KEY"!==n.type&&"RSA PRIVATE KEY"!==n.type)throw(o=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".')).headerType=o,o;if(n.procType&&"ENCRYPTED"===n.procType.type){var i,a;switch(n.dekInfo.algorithm){case"DES-CBC":i=8,a=F.des.createDecryptionCipher;break;case"DES-EDE3-CBC":i=24,a=F.des.createDecryptionCipher;break;case"AES-128-CBC":i=16,a=F.aes.createDecryptionCipher;break;case"AES-192-CBC":i=24,a=F.aes.createDecryptionCipher;break;case"AES-256-CBC":i=32,a=F.aes.createDecryptionCipher;break;case"RC2-40-CBC":i=5,a=function(e){return F.rc2.createDecryptionCipher(e,40)};break;case"RC2-64-CBC":i=8,a=function(e){return F.rc2.createDecryptionCipher(e,64)};break;case"RC2-128-CBC":i=16,a=function(e){return F.rc2.createDecryptionCipher(e,128)};break;default:var o;throw(o=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".')).algorithm=n.dekInfo.algorithm,o}var s=F.util.hexToBytes(n.dekInfo.parameters),c=a(F.pbe.opensslDeriveBytes(t,s.substr(0,8),i));if(c.start(s),c.update(F.util.createBuffer(n.body)),!c.finish())return r;r=c.output.getBytes()}else r=n.body;return null!==(r="ENCRYPTED PRIVATE KEY"===n.type?mt.decryptPrivateKeyInfo(gt.fromDer(r),t):gt.fromDer(r))&&(r=mt.privateKeyFromAsn1(r)),r},mt.pbe.generatePkcs12Key=function(e,t,r,n,i,a){var o,s;if(null==a){if(!("sha1"in F.md))throw new Error('"sha1" hash algorithm unavailable.');a=F.md.sha1.create()}var c=a.digestLength,u=a.blockLength,l=new F.util.ByteBuffer,d=new F.util.ByteBuffer;if(null!=e){for(s=0;s<e.length;s++)d.putInt16(e.charCodeAt(s));d.putInt16(0)}var f=d.length(),p=t.length(),h=new F.util.ByteBuffer;h.fillWithByte(r,u);var g=u*Math.ceil(p/u),m=new F.util.ByteBuffer;for(s=0;s<g;s++)m.putByte(t.at(s%p));var y=u*Math.ceil(f/u),v=new F.util.ByteBuffer;for(s=0;s<y;s++)v.putByte(d.at(s%f));var b=m;b.putBuffer(v);for(var C=Math.ceil(i/c),E=1;E<=C;E++){var w=new F.util.ByteBuffer;w.putBytes(h.bytes()),w.putBytes(b.bytes());for(var k=0;k<n;k++)a.start(),a.update(w.getBytes()),w=a.digest();var S=new F.util.ByteBuffer;for(s=0;s<u;s++)S.putByte(w.at(s%c));var B=Math.ceil(p/u)+Math.ceil(f/u),T=new F.util.ByteBuffer;for(o=0;o<B;o++){var A=new F.util.ByteBuffer(b.getBytes(u)),I=511;for(s=S.length()-1;s>=0;s--)I>>=8,I+=S.at(s)+A.at(s),A.setAt(s,255&I);T.putBuffer(A)}b=T,l.putBuffer(w)}return l.truncate(l.length()-i),l},mt.pbe.getCipher=function(e,t,r){switch(e){case mt.oids.pkcs5PBES2:return mt.pbe.getCipherForPBES2(e,t,r);case mt.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case mt.oids["pbewithSHAAnd40BitRC2-CBC"]:return mt.pbe.getCipherForPKCS12PBE(e,t,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=e,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}},mt.pbe.getCipherForPBES2=function(e,t,r){var n,i={},a=[];if(!gt.validate(t,bt,i,a))throw(n=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=a,n;if((e=gt.derToOid(i.kdfOid))!==mt.oids.pkcs5PBKDF2)throw(n=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=e,n.supportedOids=["pkcs5PBKDF2"],n;if((e=gt.derToOid(i.encOid))!==mt.oids["aes128-CBC"]&&e!==mt.oids["aes192-CBC"]&&e!==mt.oids["aes256-CBC"]&&e!==mt.oids["des-EDE3-CBC"]&&e!==mt.oids.desCBC)throw(n=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=e,n.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],n;var o,s,c=i.kdfSalt,u=F.util.createBuffer(i.kdfIterationCount);switch(u=u.getInt(u.length()<<3),mt.oids[e]){case"aes128-CBC":o=16,s=F.aes.createDecryptionCipher;break;case"aes192-CBC":o=24,s=F.aes.createDecryptionCipher;break;case"aes256-CBC":o=32,s=F.aes.createDecryptionCipher;break;case"des-EDE3-CBC":o=24,s=F.des.createDecryptionCipher;break;case"desCBC":o=8,s=F.des.createDecryptionCipher}var l=wt(i.prfOid),d=F.pkcs5.pbkdf2(r,c,u,o,l),f=i.encIv,p=s(d);return p.start(f),p},mt.pbe.getCipherForPKCS12PBE=function(e,t,r){var n={},i=[];if(!gt.validate(t,Ct,n,i))throw(l=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=i,l;var a,o,s,c=F.util.createBuffer(n.salt),u=F.util.createBuffer(n.iterations);switch(u=u.getInt(u.length()<<3),e){case mt.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:a=24,o=8,s=F.des.startDecrypting;break;case mt.oids["pbewithSHAAnd40BitRC2-CBC"]:a=5,o=8,s=function(e,t){var r=F.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var l;throw(l=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=e,l}var d=wt(n.prfOid),f=mt.pbe.generatePkcs12Key(r,c,1,u,a,d);return d.start(),s(f,mt.pbe.generatePkcs12Key(r,c,2,u,o,d))},mt.pbe.opensslDeriveBytes=function(e,t,r,n){if(null==n){if(!("md5"in F.md))throw new Error('"md5" hash algorithm unavailable.');n=F.md.md5.create()}null===t&&(t="");for(var i=[Et(n,e+t)],a=16,o=1;a<r;++o,a+=16)i.push(Et(n,i[o-1]+e+t));return i.join("").substr(0,r)},E((function(e){var t=F.asn1,r=e.exports=F.pkcs7asn1=F.pkcs7asn1||{};F.pkcs7=F.pkcs7||{},F.pkcs7.asn1=r;var n={name:"ContentInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};r.contentInfoValidator=n;var i={name:"EncryptedContentInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:t.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};r.envelopedDataValidator={name:"EnvelopedData",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(i)},r.encryptedDataValidator={name:"EncryptedData",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"}].concat(i)};var a={name:"SignerInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:t.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:t.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};r.signedDataValidator={name:"SignedData",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},n,{name:"SignedData.Certificates",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:t.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,capture:"signerInfos",optional:!0,value:[a]}]},r.recipientInfoValidator={name:"RecipientInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:t.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter"}]},{name:"RecipientInfo.encryptedKey",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}})),E((function(e){F.mgf=F.mgf||{},(e.exports=F.mgf.mgf1=F.mgf1=F.mgf1||{}).create=function(e){return{generate:function(t,r){for(var n=new F.util.ByteBuffer,i=Math.ceil(r/e.digestLength),a=0;a<i;a++){var o=new F.util.ByteBuffer;o.putInt32(a),e.start(),e.update(t+o.getBytes()),n.putBuffer(e.digest())}return n.truncate(n.length()-r),n.getBytes()}}}})),F.mgf=F.mgf||{},F.mgf.mgf1=F.mgf1,E((function(e){(e.exports=F.pss=F.pss||{}).create=function(e){3===arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t,r=e.md,n=e.mgf,i=r.digestLength,a=e.salt||null;if("string"==typeof a&&(a=F.util.createBuffer(a)),"saltLength"in e)t=e.saltLength;else{if(null===a)throw new Error("Salt length not specified or specific salt not given.");t=a.length()}if(null!==a&&a.length()!==t)throw new Error("Given salt length does not match length of given salt.");var o=e.prng||F.random;return{encode:function(e,s){var c,u,l=s-1,d=Math.ceil(l/8),f=e.digest().getBytes();if(d<i+t+2)throw new Error("Message is too long to encrypt.");u=null===a?o.getBytesSync(t):a.bytes();var p=new F.util.ByteBuffer;p.fillWithByte(0,8),p.putBytes(f),p.putBytes(u),r.start(),r.update(p.getBytes());var h=r.digest().getBytes(),g=new F.util.ByteBuffer;g.fillWithByte(0,d-t-i-2),g.putByte(1),g.putBytes(u);var m=g.getBytes(),y=d-i-1,v=n.generate(h,y),b="";for(c=0;c<y;c++)b+=String.fromCharCode(m.charCodeAt(c)^v.charCodeAt(c));var C=65280>>8*d-l&255;return(b=String.fromCharCode(b.charCodeAt(0)&~C)+b.substr(1))+h+String.fromCharCode(188)},verify:function(e,a,o){var s,c=o-1,u=Math.ceil(c/8);if(a=a.substr(-u),u<i+t+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(188!==a.charCodeAt(u-1))throw new Error("Encoded message does not end in 0xBC.");var l=u-i-1,d=a.substr(0,l),f=a.substr(l,i),p=65280>>8*u-c&255;if(0!=(d.charCodeAt(0)&p))throw new Error("Bits beyond keysize not zero as expected.");var h=n.generate(f,l),g="";for(s=0;s<l;s++)g+=String.fromCharCode(d.charCodeAt(s)^h.charCodeAt(s));g=String.fromCharCode(g.charCodeAt(0)&~p)+g.substr(1);var m=u-i-t-2;for(s=0;s<m;s++)if(0!==g.charCodeAt(s))throw new Error("Leftmost octets not zero as expected");if(1!==g.charCodeAt(m))throw new Error("Inconsistent PSS signature, 0x01 marker not found");var y=g.substr(-t),v=new F.util.ByteBuffer;return v.fillWithByte(0,8),v.putBytes(e),v.putBytes(y),r.start(),r.update(v.getBytes()),f===r.digest().getBytes()}}}})),E((function(e){var t=F.asn1,r=e.exports=F.pki=F.pki||{},n=r.oids,i={};i.CN=n.commonName,i.commonName="CN",i.C=n.countryName,i.countryName="C",i.L=n.localityName,i.localityName="L",i.ST=n.stateOrProvinceName,i.stateOrProvinceName="ST",i.O=n.organizationName,i.organizationName="O",i.OU=n.organizationalUnitName,i.organizationalUnitName="OU",i.E=n.emailAddress,i.emailAddress="E";var a=F.pki.rsa.publicKeyValidator,o={name:"Certificate",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:t.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:t.Class.UNIVERSAL,type:t.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:t.Class.UNIVERSAL,type:t.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:t.Class.UNIVERSAL,type:t.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:t.Class.UNIVERSAL,type:t.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},a,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:t.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:t.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:t.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:t.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},s={name:"rsapss",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:t.Class.UNIVERSAL,type:t.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:t.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:t.Class.UNIVERSAL,type:t.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:t.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:t.Class.UNIVERSAL,type:t.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:t.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:t.Class.UNIVERSAL,type:t.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},c={name:"CertificationRequestInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},a,{name:"CertificationRequestInfo.attributes",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0}]}]}]},u={name:"CertificationRequest",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[c,{name:"CertificationRequest.signatureAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:t.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};function l(e,t){"string"==typeof t&&(t={shortName:t});for(var r,n=null,i=0;null===n&&i<e.attributes.length;++i)r=e.attributes[i],(t.type&&t.type===r.type||t.name&&t.name===r.name||t.shortName&&t.shortName===r.shortName)&&(n=r);return n}r.RDNAttributesAsArray=function(e,r){for(var a,o,s,c=[],u=0;u<e.value.length;++u){a=e.value[u];for(var l=0;l<a.value.length;++l)s={},o=a.value[l],s.type=t.derToOid(o.value[0].value),s.value=o.value[1].value,s.valueTagClass=o.value[1].type,s.type in n&&(s.name=n[s.type],s.name in i&&(s.shortName=i[s.name])),r&&(r.update(s.type),r.update(s.value)),c.push(s)}return c},r.CRIAttributesAsArray=function(e){for(var a=[],o=0;o<e.length;++o)for(var s=e[o],c=t.derToOid(s.value[0].value),u=s.value[1].value,l=0;l<u.length;++l){var d={};if(d.type=c,d.value=u[l].value,d.valueTagClass=u[l].type,d.type in n&&(d.name=n[d.type],d.name in i&&(d.shortName=i[d.name])),d.type===n.extensionRequest){d.extensions=[];for(var f=0;f<d.value.length;++f)d.extensions.push(r.certificateExtensionFromAsn1(d.value[f]))}a.push(d)}return a};var d=function(e,r,i){var a={};if(e!==n["RSASSA-PSS"])return a;i&&(a={hash:{algorithmOid:n.sha1},mgf:{algorithmOid:n.mgf1,hash:{algorithmOid:n.sha1}},saltLength:20});var o={},c=[];if(!t.validate(r,s,o,c)){var u=new Error("Cannot read RSASSA-PSS parameter block.");throw u.errors=c,u}return void 0!==o.hashOid&&(a.hash=a.hash||{},a.hash.algorithmOid=t.derToOid(o.hashOid)),void 0!==o.maskGenOid&&(a.mgf=a.mgf||{},a.mgf.algorithmOid=t.derToOid(o.maskGenOid),a.mgf.hash=a.mgf.hash||{},a.mgf.hash.algorithmOid=t.derToOid(o.maskGenHashOid)),void 0!==o.saltLength&&(a.saltLength=o.saltLength.charCodeAt(0)),a};function f(e){for(var r,n,i=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]),a=e.attributes,o=0;o<a.length;++o){var s=(r=a[o]).value,c=t.Type.PRINTABLESTRING;"valueTagClass"in r&&(c=r.valueTagClass)===t.Type.UTF8&&(s=F.util.encodeUtf8(s)),n=t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.type).getBytes()),t.create(t.Class.UNIVERSAL,c,!1,s)])]),i.value.push(n)}return i}function p(e){for(var a,o=0;o<e.length;++o){if(void 0===(a=e[o]).name&&(a.type&&a.type in r.oids?a.name=r.oids[a.type]:a.shortName&&a.shortName in i&&(a.name=r.oids[i[a.shortName]])),void 0===a.type){if(!a.name||!(a.name in r.oids))throw(c=new Error("Attribute type not specified.")).attribute=a,c;a.type=r.oids[a.name]}if(void 0===a.shortName&&a.name&&a.name in i&&(a.shortName=i[a.name]),a.type===n.extensionRequest&&(a.valueConstructed=!0,a.valueTagClass=t.Type.SEQUENCE,!a.value&&a.extensions)){a.value=[];for(var s=0;s<a.extensions.length;++s)a.value.push(r.certificateExtensionToAsn1(h(a.extensions[s])))}var c;if(void 0===a.value)throw(c=new Error("Attribute value not specified.")).attribute=a,c}}function h(e,i){if(i=i||{},void 0===e.name&&e.id&&e.id in r.oids&&(e.name=r.oids[e.id]),void 0===e.id){if(!e.name||!(e.name in r.oids))throw(C=new Error("Extension ID not specified.")).extension=e,C;e.id=r.oids[e.name]}if(void 0!==e.value)return e;if("keyUsage"===e.name){var a=0,o=0,s=0;e.digitalSignature&&(o|=128,a=7),e.nonRepudiation&&(o|=64,a=6),e.keyEncipherment&&(o|=32,a=5),e.dataEncipherment&&(o|=16,a=4),e.keyAgreement&&(o|=8,a=3),e.keyCertSign&&(o|=4,a=2),e.cRLSign&&(o|=2,a=1),e.encipherOnly&&(o|=1,a=0),e.decipherOnly&&(s|=128,a=7);var c=String.fromCharCode(a);0!==s?c+=String.fromCharCode(o)+String.fromCharCode(s):0!==o&&(c+=String.fromCharCode(o)),e.value=t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,c)}else if("basicConstraints"===e.name)e.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(t.create(t.Class.UNIVERSAL,t.Type.BOOLEAN,!1,String.fromCharCode(255))),"pathLenConstraint"in e&&e.value.value.push(t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(e.pathLenConstraint).getBytes()));else if("extKeyUsage"===e.name){e.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);var u=e.value.value;for(var l in e)!0===e[l]&&(l in n?u.push(t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(n[l]).getBytes())):-1!==l.indexOf(".")&&u.push(t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(l).getBytes())))}else if("nsCertType"===e.name)a=0,o=0,e.client&&(o|=128,a=7),e.server&&(o|=64,a=6),e.email&&(o|=32,a=5),e.objsign&&(o|=16,a=4),e.reserved&&(o|=8,a=3),e.sslCA&&(o|=4,a=2),e.emailCA&&(o|=2,a=1),e.objCA&&(o|=1,a=0),c=String.fromCharCode(a),0!==o&&(c+=String.fromCharCode(o)),e.value=t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,c);else if("subjectAltName"===e.name||"issuerAltName"===e.name){e.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);for(var d=0;d<e.altNames.length;++d){if(c=(y=e.altNames[d]).value,7===y.type&&y.ip){if(null===(c=F.util.bytesFromIP(y.ip)))throw(C=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,C}else 8===y.type&&(c=y.oid?t.oidToDer(t.oidToDer(y.oid)):t.oidToDer(c));e.value.value.push(t.create(t.Class.CONTEXT_SPECIFIC,y.type,!1,c))}}else if("nsComment"===e.name&&i.cert){if(!/^[\x00-\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw new Error('Invalid "nsComment" content.');e.value=t.create(t.Class.UNIVERSAL,t.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&i.cert){var p=i.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=p.toHex(),e.value=t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,p.getBytes())}else if("authorityKeyIdentifier"===e.name&&i.cert){if(e.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]),u=e.value.value,e.keyIdentifier){var h=!0===e.keyIdentifier?i.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;u.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!1,h))}if(e.authorityCertIssuer){var g=[t.create(t.Class.CONTEXT_SPECIFIC,4,!0,[f(!0===e.authorityCertIssuer?i.cert.issuer:e.authorityCertIssuer)])];u.push(t.create(t.Class.CONTEXT_SPECIFIC,1,!0,g))}if(e.serialNumber){var m=F.util.hexToBytes(!0===e.serialNumber?i.cert.serialNumber:e.serialNumber);u.push(t.create(t.Class.CONTEXT_SPECIFIC,2,!1,m))}}else if("cRLDistributionPoints"===e.name){e.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]),u=e.value.value;var y,v=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]),b=t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[]);for(d=0;d<e.altNames.length;++d){if(c=(y=e.altNames[d]).value,7===y.type&&y.ip){if(null===(c=F.util.bytesFromIP(y.ip)))throw(C=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,C}else 8===y.type&&(c=y.oid?t.oidToDer(t.oidToDer(y.oid)):t.oidToDer(c));b.value.push(t.create(t.Class.CONTEXT_SPECIFIC,y.type,!1,c))}v.value.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[b])),u.push(v)}var C;if(void 0===e.value)throw(C=new Error("Extension value not specified.")).extension=e,C;return e}function g(e,r){switch(e){case n["RSASSA-PSS"]:var i=[];return void 0!==r.hash.algorithmOid&&i.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.hash.algorithmOid).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")])])),void 0!==r.mgf.algorithmOid&&i.push(t.create(t.Class.CONTEXT_SPECIFIC,1,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.mgf.algorithmOid).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.mgf.hash.algorithmOid).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")])])])),void 0!==r.saltLength&&i.push(t.create(t.Class.CONTEXT_SPECIFIC,2,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(r.saltLength).getBytes())])),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,i);default:return t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")}}function m(e){var r=t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===e.attributes.length)return r;for(var n=e.attributes,i=0;i<n.length;++i){var a=n[i],o=a.value,s=t.Type.UTF8;"valueTagClass"in a&&(s=a.valueTagClass),s===t.Type.UTF8&&(o=F.util.encodeUtf8(o));var c=!1;"valueConstructed"in a&&(c=a.valueConstructed);var u=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(a.type).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[t.create(t.Class.UNIVERSAL,s,c,o)])]);r.value.push(u)}return r}r.certificateFromPem=function(e,n,i){var a=F.pem.decode(e)[0];if("CERTIFICATE"!==a.type&&"X509 CERTIFICATE"!==a.type&&"TRUSTED CERTIFICATE"!==a.type){var o=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw o.headerType=a.type,o}if(a.procType&&"ENCRYPTED"===a.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var s=t.fromDer(a.body,i);return r.certificateFromAsn1(s,n)},r.certificateToPem=function(e,n){var i={type:"CERTIFICATE",body:t.toDer(r.certificateToAsn1(e)).getBytes()};return F.pem.encode(i,{maxline:n})},r.publicKeyFromPem=function(e){var n=F.pem.decode(e)[0];if("PUBLIC KEY"!==n.type&&"RSA PUBLIC KEY"!==n.type){var i=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw i.headerType=n.type,i}if(n.procType&&"ENCRYPTED"===n.procType.type)throw new Error("Could not convert public key from PEM; PEM is encrypted.");var a=t.fromDer(n.body);return r.publicKeyFromAsn1(a)},r.publicKeyToPem=function(e,n){var i={type:"PUBLIC KEY",body:t.toDer(r.publicKeyToAsn1(e)).getBytes()};return F.pem.encode(i,{maxline:n})},r.publicKeyToRSAPublicKeyPem=function(e,n){var i={type:"RSA PUBLIC KEY",body:t.toDer(r.publicKeyToRSAPublicKey(e)).getBytes()};return F.pem.encode(i,{maxline:n})},r.getPublicKeyFingerprint=function(e,n){var i,a=(n=n||{}).md||F.md.sha1.create();switch(n.type||"RSAPublicKey"){case"RSAPublicKey":i=t.toDer(r.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":i=t.toDer(r.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+n.type+'".')}a.start(),a.update(i);var o=a.digest();if("hex"===n.encoding){var s=o.toHex();return n.delimiter?s.match(/.{2}/g).join(n.delimiter):s}if("binary"===n.encoding)return o.getBytes();if(n.encoding)throw new Error('Unknown encoding "'+n.encoding+'".');return o},r.certificationRequestFromPem=function(e,n,i){var a=F.pem.decode(e)[0];if("CERTIFICATE REQUEST"!==a.type){var o=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw o.headerType=a.type,o}if(a.procType&&"ENCRYPTED"===a.procType.type)throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var s=t.fromDer(a.body,i);return r.certificationRequestFromAsn1(s,n)},r.certificationRequestToPem=function(e,n){var i={type:"CERTIFICATE REQUEST",body:t.toDer(r.certificationRequestToAsn1(e)).getBytes()};return F.pem.encode(i,{maxline:n})},r.createCertificate=function(){var e={version:2,serialNumber:"00",signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.validity={},e.validity.notBefore=new Date,e.validity.notAfter=new Date,e.issuer={},e.issuer.getField=function(t){return l(e.issuer,t)},e.issuer.addField=function(t){p([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return l(e.subject,t)},e.subject.addField=function(t){p([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.extensions=[],e.publicKey=null,e.md=null,e.setSubject=function(t,r){p(t),e.subject.attributes=t,delete e.subject.uniqueId,r&&(e.subject.uniqueId=r),e.subject.hash=null},e.setIssuer=function(t,r){p(t),e.issuer.attributes=t,delete e.issuer.uniqueId,r&&(e.issuer.uniqueId=r),e.issuer.hash=null},e.setExtensions=function(t){for(var r=0;r<t.length;++r)h(t[r],{cert:e});e.extensions=t},e.getExtension=function(t){"string"==typeof t&&(t={name:t});for(var r,n=null,i=0;null===n&&i<e.extensions.length;++i)r=e.extensions[i],(t.id&&r.id===t.id||t.name&&r.name===t.name)&&(n=r);return n},e.sign=function(i,a){e.md=a||F.md.sha1.create();var o=n[e.md.algorithm+"WithRSAEncryption"];if(!o){var s=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw s.algorithm=e.md.algorithm,s}e.signatureOid=e.siginfo.algorithmOid=o,e.tbsCertificate=r.getTBSCertificate(e);var c=t.toDer(e.tbsCertificate);e.md.update(c.getBytes()),e.signature=i.sign(e.md)},e.verify=function(i){var a=!1;if(!e.issued(i)){var o=i.issuer,s=e.subject;throw(h=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.")).expectedIssuer=o.attributes,h.actualIssuer=s.attributes,h}var c=i.md;if(null===c){if(i.signatureOid in n)switch(n[i.signatureOid]){case"sha1WithRSAEncryption":c=F.md.sha1.create();break;case"md5WithRSAEncryption":c=F.md.md5.create();break;case"sha256WithRSAEncryption":c=F.md.sha256.create();break;case"sha384WithRSAEncryption":c=F.md.sha384.create();break;case"sha512WithRSAEncryption":c=F.md.sha512.create();break;case"RSASSA-PSS":c=F.md.sha256.create()}if(null===c)throw(h=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=i.signatureOid,h;var u=i.tbsCertificate||r.getTBSCertificate(i),l=t.toDer(u);c.update(l.getBytes())}if(null!==c){var d;switch(i.signatureOid){case n.sha1WithRSAEncryption:d=void 0;break;case n["RSASSA-PSS"]:var f,p,h;if(void 0===(f=n[i.signatureParameters.mgf.hash.algorithmOid])||void 0===F.md[f])throw(h=new Error("Unsupported MGF hash function.")).oid=i.signatureParameters.mgf.hash.algorithmOid,h.name=f,h;if(void 0===(p=n[i.signatureParameters.mgf.algorithmOid])||void 0===F.mgf[p])throw(h=new Error("Unsupported MGF function.")).oid=i.signatureParameters.mgf.algorithmOid,h.name=p,h;if(p=F.mgf[p].create(F.md[f].create()),void 0===(f=n[i.signatureParameters.hash.algorithmOid])||void 0===F.md[f])throw{message:"Unsupported RSASSA-PSS hash function.",oid:i.signatureParameters.hash.algorithmOid,name:f};d=F.pss.create(F.md[f].create(),p,i.signatureParameters.saltLength)}a=e.publicKey.verify(c.digest().getBytes(),i.signature,d)}return a},e.isIssuer=function(t){var r=!1,n=e.issuer,i=t.subject;if(n.hash&&i.hash)r=n.hash===i.hash;else if(n.attributes.length===i.attributes.length){var a,o;r=!0;for(var s=0;r&&s<n.attributes.length;++s)a=n.attributes[s],o=i.attributes[s],a.type===o.type&&a.value===o.value||(r=!1)}return r},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return r.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=n.subjectKeyIdentifier,r=0;r<e.extensions.length;++r){var i=e.extensions[r];if(i.id===t){var a=e.generateSubjectKeyIdentifier().getBytes();return F.util.hexToBytes(i.subjectKeyIdentifier)===a}}return!1},e},r.certificateFromAsn1=function(e,i){var a={},s=[];if(!t.validate(e,o,a,s))throw(h=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.")).errors=s,h;if(t.derToOid(a.publicKeyOid)!==r.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var c=r.createCertificate();c.version=a.certVersion?a.certVersion.charCodeAt(0):0;var u=F.util.createBuffer(a.certSerialNumber);c.serialNumber=u.toHex(),c.signatureOid=F.asn1.derToOid(a.certSignatureOid),c.signatureParameters=d(c.signatureOid,a.certSignatureParams,!0),c.siginfo.algorithmOid=F.asn1.derToOid(a.certinfoSignatureOid),c.siginfo.parameters=d(c.siginfo.algorithmOid,a.certinfoSignatureParams,!1),c.signature=a.certSignature;var f=[];if(void 0!==a.certValidity1UTCTime&&f.push(t.utcTimeToDate(a.certValidity1UTCTime)),void 0!==a.certValidity2GeneralizedTime&&f.push(t.generalizedTimeToDate(a.certValidity2GeneralizedTime)),void 0!==a.certValidity3UTCTime&&f.push(t.utcTimeToDate(a.certValidity3UTCTime)),void 0!==a.certValidity4GeneralizedTime&&f.push(t.generalizedTimeToDate(a.certValidity4GeneralizedTime)),f.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(f.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(c.validity.notBefore=f[0],c.validity.notAfter=f[1],c.tbsCertificate=a.tbsCertificate,i){var h;if(c.md=null,c.signatureOid in n)switch(n[c.signatureOid]){case"sha1WithRSAEncryption":c.md=F.md.sha1.create();break;case"md5WithRSAEncryption":c.md=F.md.md5.create();break;case"sha256WithRSAEncryption":c.md=F.md.sha256.create();break;case"sha384WithRSAEncryption":c.md=F.md.sha384.create();break;case"sha512WithRSAEncryption":c.md=F.md.sha512.create();break;case"RSASSA-PSS":c.md=F.md.sha256.create()}if(null===c.md)throw(h=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=c.signatureOid,h;var g=t.toDer(c.tbsCertificate);c.md.update(g.getBytes())}var m=F.md.sha1.create();c.issuer.getField=function(e){return l(c.issuer,e)},c.issuer.addField=function(e){p([e]),c.issuer.attributes.push(e)},c.issuer.attributes=r.RDNAttributesAsArray(a.certIssuer,m),a.certIssuerUniqueId&&(c.issuer.uniqueId=a.certIssuerUniqueId),c.issuer.hash=m.digest().toHex();var y=F.md.sha1.create();return c.subject.getField=function(e){return l(c.subject,e)},c.subject.addField=function(e){p([e]),c.subject.attributes.push(e)},c.subject.attributes=r.RDNAttributesAsArray(a.certSubject,y),a.certSubjectUniqueId&&(c.subject.uniqueId=a.certSubjectUniqueId),c.subject.hash=y.digest().toHex(),a.certExtensions?c.extensions=r.certificateExtensionsFromAsn1(a.certExtensions):c.extensions=[],c.publicKey=r.publicKeyFromAsn1(a.subjectPublicKeyInfo),c},r.certificateExtensionsFromAsn1=function(e){for(var t=[],n=0;n<e.value.length;++n)for(var i=e.value[n],a=0;a<i.value.length;++a)t.push(r.certificateExtensionFromAsn1(i.value[a]));return t},r.certificateExtensionFromAsn1=function(e){var r={};if(r.id=t.derToOid(e.value[0].value),r.critical=!1,e.value[1].type===t.Type.BOOLEAN?(r.critical=0!==e.value[1].value.charCodeAt(0),r.value=e.value[2].value):r.value=e.value[1].value,r.id in n)if(r.name=n[r.id],"keyUsage"===r.name){var i=0,a=0;(s=t.fromDer(r.value)).value.length>1&&(i=s.value.charCodeAt(1),a=s.value.length>2?s.value.charCodeAt(2):0),r.digitalSignature=128==(128&i),r.nonRepudiation=64==(64&i),r.keyEncipherment=32==(32&i),r.dataEncipherment=16==(16&i),r.keyAgreement=8==(8&i),r.keyCertSign=4==(4&i),r.cRLSign=2==(2&i),r.encipherOnly=1==(1&i),r.decipherOnly=128==(128&a)}else if("basicConstraints"===r.name){(s=t.fromDer(r.value)).value.length>0&&s.value[0].type===t.Type.BOOLEAN?r.cA=0!==s.value[0].value.charCodeAt(0):r.cA=!1;var o=null;s.value.length>0&&s.value[0].type===t.Type.INTEGER?o=s.value[0].value:s.value.length>1&&(o=s.value[1].value),null!==o&&(r.pathLenConstraint=t.derToInteger(o))}else if("extKeyUsage"===r.name)for(var s=t.fromDer(r.value),c=0;c<s.value.length;++c){var u=t.derToOid(s.value[c].value);u in n?r[n[u]]=!0:r[u]=!0}else if("nsCertType"===r.name)i=0,(s=t.fromDer(r.value)).value.length>1&&(i=s.value.charCodeAt(1)),r.client=128==(128&i),r.server=64==(64&i),r.email=32==(32&i),r.objsign=16==(16&i),r.reserved=8==(8&i),r.sslCA=4==(4&i),r.emailCA=2==(2&i),r.objCA=1==(1&i);else if("subjectAltName"===r.name||"issuerAltName"===r.name){var l;r.altNames=[],s=t.fromDer(r.value);for(var d=0;d<s.value.length;++d){var f={type:(l=s.value[d]).type,value:l.value};switch(r.altNames.push(f),l.type){case 1:case 2:case 6:break;case 7:f.ip=F.util.bytesToIP(l.value);break;case 8:f.oid=t.derToOid(l.value)}}}else"subjectKeyIdentifier"===r.name&&(s=t.fromDer(r.value),r.subjectKeyIdentifier=F.util.bytesToHex(s.value));return r},r.certificationRequestFromAsn1=function(e,i){var a={},o=[];if(!t.validate(e,u,a,o))throw(c=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.")).errors=o,c;if(t.derToOid(a.publicKeyOid)!==r.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var s=r.createCertificationRequest();if(s.version=a.csrVersion?a.csrVersion.charCodeAt(0):0,s.signatureOid=F.asn1.derToOid(a.csrSignatureOid),s.signatureParameters=d(s.signatureOid,a.csrSignatureParams,!0),s.siginfo.algorithmOid=F.asn1.derToOid(a.csrSignatureOid),s.siginfo.parameters=d(s.siginfo.algorithmOid,a.csrSignatureParams,!1),s.signature=a.csrSignature,s.certificationRequestInfo=a.certificationRequestInfo,i){var c;if(s.md=null,s.signatureOid in n)switch(n[s.signatureOid]){case"sha1WithRSAEncryption":s.md=F.md.sha1.create();break;case"md5WithRSAEncryption":s.md=F.md.md5.create();break;case"sha256WithRSAEncryption":s.md=F.md.sha256.create();break;case"sha384WithRSAEncryption":s.md=F.md.sha384.create();break;case"sha512WithRSAEncryption":s.md=F.md.sha512.create();break;case"RSASSA-PSS":s.md=F.md.sha256.create()}if(null===s.md)throw(c=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=s.signatureOid,c;var f=t.toDer(s.certificationRequestInfo);s.md.update(f.getBytes())}var h=F.md.sha1.create();return s.subject.getField=function(e){return l(s.subject,e)},s.subject.addField=function(e){p([e]),s.subject.attributes.push(e)},s.subject.attributes=r.RDNAttributesAsArray(a.certificationRequestInfoSubject,h),s.subject.hash=h.digest().toHex(),s.publicKey=r.publicKeyFromAsn1(a.subjectPublicKeyInfo),s.getAttribute=function(e){return l(s,e)},s.addAttribute=function(e){p([e]),s.attributes.push(e)},s.attributes=r.CRIAttributesAsArray(a.certificationRequestInfoAttributes||[]),s},r.createCertificationRequest=function(){var e={version:0,signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return l(e.subject,t)},e.subject.addField=function(t){p([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return l(e,t)},e.addAttribute=function(t){p([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){p(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){p(t),e.attributes=t},e.sign=function(i,a){e.md=a||F.md.sha1.create();var o=n[e.md.algorithm+"WithRSAEncryption"];if(!o){var s=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw s.algorithm=e.md.algorithm,s}e.signatureOid=e.siginfo.algorithmOid=o,e.certificationRequestInfo=r.getCertificationRequestInfo(e);var c=t.toDer(e.certificationRequestInfo);e.md.update(c.getBytes()),e.signature=i.sign(e.md)},e.verify=function(){var i=!1,a=e.md;if(null===a){if(e.signatureOid in n)switch(n[e.signatureOid]){case"sha1WithRSAEncryption":a=F.md.sha1.create();break;case"md5WithRSAEncryption":a=F.md.md5.create();break;case"sha256WithRSAEncryption":a=F.md.sha256.create();break;case"sha384WithRSAEncryption":a=F.md.sha384.create();break;case"sha512WithRSAEncryption":a=F.md.sha512.create();break;case"RSASSA-PSS":a=F.md.sha256.create()}if(null===a)throw(d=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=e.signatureOid,d;var o=e.certificationRequestInfo||r.getCertificationRequestInfo(e),s=t.toDer(o);a.update(s.getBytes())}if(null!==a){var c;switch(e.signatureOid){case n.sha1WithRSAEncryption:break;case n["RSASSA-PSS"]:var u,l,d;if(void 0===(u=n[e.signatureParameters.mgf.hash.algorithmOid])||void 0===F.md[u])throw(d=new Error("Unsupported MGF hash function.")).oid=e.signatureParameters.mgf.hash.algorithmOid,d.name=u,d;if(void 0===(l=n[e.signatureParameters.mgf.algorithmOid])||void 0===F.mgf[l])throw(d=new Error("Unsupported MGF function.")).oid=e.signatureParameters.mgf.algorithmOid,d.name=l,d;if(l=F.mgf[l].create(F.md[u].create()),void 0===(u=n[e.signatureParameters.hash.algorithmOid])||void 0===F.md[u])throw(d=new Error("Unsupported RSASSA-PSS hash function.")).oid=e.signatureParameters.hash.algorithmOid,d.name=u,d;c=F.pss.create(F.md[u].create(),l,e.signatureParameters.saltLength)}i=e.publicKey.verify(a.digest().getBytes(),e.signature,c)}return i},e};var y=new Date("1950-01-01T00:00:00Z"),v=new Date("2050-01-01T00:00:00Z");function b(e){return e>=y&&e<v?t.create(t.Class.UNIVERSAL,t.Type.UTCTIME,!1,t.dateToUtcTime(e)):t.create(t.Class.UNIVERSAL,t.Type.GENERALIZEDTIME,!1,t.dateToGeneralizedTime(e))}r.getTBSCertificate=function(e){var n=b(e.validity.notBefore),i=b(e.validity.notAfter),a=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(e.version).getBytes())]),t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,F.util.hexToBytes(e.serialNumber)),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.siginfo.algorithmOid).getBytes()),g(e.siginfo.algorithmOid,e.siginfo.parameters)]),f(e.issuer),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[n,i]),f(e.subject),r.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&a.value.push(t.create(t.Class.CONTEXT_SPECIFIC,1,!0,[t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,String.fromCharCode(0)+e.issuer.uniqueId)])),e.subject.uniqueId&&a.value.push(t.create(t.Class.CONTEXT_SPECIFIC,2,!0,[t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,String.fromCharCode(0)+e.subject.uniqueId)])),e.extensions.length>0&&a.value.push(r.certificateExtensionsToAsn1(e.extensions)),a},r.getCertificationRequestInfo=function(e){return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(e.version).getBytes()),f(e.subject),r.publicKeyToAsn1(e.publicKey),m(e)])},r.distinguishedNameToAsn1=function(e){return f(e)},r.certificateToAsn1=function(e){var n=e.tbsCertificate||r.getTBSCertificate(e);return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[n,t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.signatureOid).getBytes()),g(e.signatureOid,e.signatureParameters)]),t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},r.certificateExtensionsToAsn1=function(e){var n=t.create(t.Class.CONTEXT_SPECIFIC,3,!0,[]),i=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);n.value.push(i);for(var a=0;a<e.length;++a)i.value.push(r.certificateExtensionToAsn1(e[a]));return n},r.certificateExtensionToAsn1=function(e){var r=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);r.value.push(t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.id).getBytes())),e.critical&&r.value.push(t.create(t.Class.UNIVERSAL,t.Type.BOOLEAN,!1,String.fromCharCode(255)));var n=e.value;return"string"!=typeof e.value&&(n=t.toDer(n).getBytes()),r.value.push(t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,n)),r},r.certificationRequestToAsn1=function(e){var n=e.certificationRequestInfo||r.getCertificationRequestInfo(e);return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[n,t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.signatureOid).getBytes()),g(e.signatureOid,e.signatureParameters)]),t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},r.createCaStore=function(e){var n={certs:{}};function i(e){return a(e),n.certs[e.hash]||null}function a(e){if(!e.hash){var t=F.md.sha1.create();e.attributes=r.RDNAttributesAsArray(f(e),t),e.hash=t.digest().toHex()}}if(n.getIssuer=function(e){return i(e.issuer)},n.addCertificate=function(e){if("string"==typeof e&&(e=F.pki.certificateFromPem(e)),a(e.subject),!n.hasCertificate(e))if(e.subject.hash in n.certs){var t=n.certs[e.subject.hash];F.util.isArray(t)||(t=[t]),t.push(e),n.certs[e.subject.hash]=t}else n.certs[e.subject.hash]=e},n.hasCertificate=function(e){"string"==typeof e&&(e=F.pki.certificateFromPem(e));var n=i(e.subject);if(!n)return!1;F.util.isArray(n)||(n=[n]);for(var a=t.toDer(r.certificateToAsn1(e)).getBytes(),o=0;o<n.length;++o)if(a===t.toDer(r.certificateToAsn1(n[o])).getBytes())return!0;return!1},n.listAllCertificates=function(){var e=[];for(var t in n.certs)if(n.certs.hasOwnProperty(t)){var r=n.certs[t];if(F.util.isArray(r))for(var i=0;i<r.length;++i)e.push(r[i]);else e.push(r)}return e},n.removeCertificate=function(e){var o;if("string"==typeof e&&(e=F.pki.certificateFromPem(e)),a(e.subject),!n.hasCertificate(e))return null;var s=i(e.subject);if(!F.util.isArray(s))return o=n.certs[e.subject.hash],delete n.certs[e.subject.hash],o;for(var c=t.toDer(r.certificateToAsn1(e)).getBytes(),u=0;u<s.length;++u)c===t.toDer(r.certificateToAsn1(s[u])).getBytes()&&(o=s[u],s.splice(u,1));return 0===s.length&&delete n.certs[e.subject.hash],o},e)for(var o=0;o<e.length;++o){var s=e[o];n.addCertificate(s)}return n},r.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"},r.verifyCertificateChain=function(e,t,n){"function"==typeof n&&(n={verify:n}),n=n||{};var i=(t=t.slice(0)).slice(0),a=n.validityCheckDate;void 0===a&&(a=new Date);var o=!0,s=null,c=0;do{var u=t.shift(),l=null,d=!1;if(a&&(a<u.validity.notBefore||a>u.validity.notAfter)&&(s={message:"Certificate is not valid yet or has expired.",error:r.certificateError.certificate_expired,notBefore:u.validity.notBefore,notAfter:u.validity.notAfter,now:a}),null===s){if(null===(l=t[0]||e.getIssuer(u))&&u.isIssuer(u)&&(d=!0,l=u),l){var f=l;F.util.isArray(f)||(f=[f]);for(var p=!1;!p&&f.length>0;){l=f.shift();try{p=l.verify(u)}catch(e){}}p||(s={message:"Certificate signature is invalid.",error:r.certificateError.bad_certificate})}null!==s||l&&!d||e.hasCertificate(u)||(s={message:"Certificate is not trusted.",error:r.certificateError.unknown_ca})}if(null===s&&l&&!u.isIssuer(l)&&(s={message:"Certificate issuer is invalid.",error:r.certificateError.bad_certificate}),null===s)for(var h={keyUsage:!0,basicConstraints:!0},g=0;null===s&&g<u.extensions.length;++g){var m=u.extensions[g];!m.critical||m.name in h||(s={message:"Certificate has an unsupported critical extension.",error:r.certificateError.unsupported_certificate})}if(null===s&&(!o||0===t.length&&(!l||d))){var y=u.getExtension("basicConstraints"),v=u.getExtension("keyUsage");null!==v&&(v.keyCertSign&&null!==y||(s={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:r.certificateError.bad_certificate})),null!==s||null===y||y.cA||(s={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:r.certificateError.bad_certificate}),null===s&&null!==v&&"pathLenConstraint"in y&&c-1>y.pathLenConstraint&&(s={message:"Certificate basicConstraints pathLenConstraint violated.",error:r.certificateError.bad_certificate})}var b=null===s||s.error,C=n.verify?n.verify(b,c,i):b;if(!0!==C)throw!0===b&&(s={message:"The application rejected the certificate.",error:r.certificateError.bad_certificate}),(C||0===C)&&("object"!=typeof C||F.util.isArray(C)?"string"==typeof C&&(s.error=C):(C.message&&(s.message=C.message),C.error&&(s.error=C.error))),s;s=null,o=!1,++c}while(t.length>0);return!0}})),E((function(e){var t=F.asn1,r=F.pki,n=e.exports=F.pkcs12=F.pkcs12||{},i={name:"ContentInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:t.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},a={name:"PFX",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"},i,{name:"PFX.macData",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:t.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},o={name:"SafeBag",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:t.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},s={name:"Attribute",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0,capture:"values"}]},c={name:"CertBag",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:t.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:t.Class.UNIVERSAL,type:t.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function u(e,t,r,n){for(var i=[],a=0;a<e.length;a++)for(var o=0;o<e[a].safeBags.length;o++){var s=e[a].safeBags[o];void 0!==n&&s.type!==n||(null!==t?void 0!==s.attributes[t]&&s.attributes[t].indexOf(r)>=0&&i.push(s):i.push(s))}return i}function l(e){if(e.composed||e.constructed){for(var t=F.util.createBuffer(),r=0;r<e.value.length;++r)t.putBytes(e.value[r].value);e.composed=e.constructed=!1,e.value=t.getBytes()}return e}function d(e,n){var i={},a=[];if(!t.validate(e,F.pkcs7.asn1.encryptedDataValidator,i,a))throw(o=new Error("Cannot read EncryptedContentInfo.")).errors=a,o;var o,s=t.derToOid(i.contentType);if(s!==r.oids.data)throw(o=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.")).oid=s,o;s=t.derToOid(i.encAlgorithm);var c=r.pbe.getCipher(s,i.encParameter,n),u=l(i.encryptedContentAsn1),d=F.util.createBuffer(u.value);if(c.update(d),!c.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return c.output.getBytes()}function f(e,n,i){if(!n&&0===e.length)return[];if((e=t.fromDer(e,n)).tagClass!==t.Class.UNIVERSAL||e.type!==t.Type.SEQUENCE||!0!==e.constructed)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var a=[],s=0;s<e.value.length;s++){var u=e.value[s],l={},d=[];if(!t.validate(u,o,l,d))throw(y=new Error("Cannot read SafeBag.")).errors=d,y;var f,h,g={type:t.derToOid(l.bagId),attributes:p(l.bagAttributes)};a.push(g);var m=l.bagValue.value[0];switch(g.type){case r.oids.pkcs8ShroudedKeyBag:if(null===(m=r.decryptPrivateKeyInfo(m,i)))throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case r.oids.keyBag:try{g.key=r.privateKeyFromAsn1(m)}catch(e){g.key=null,g.asn1=m}continue;case r.oids.certBag:f=c,h=function(){if(t.derToOid(l.certId)!==r.oids.x509Certificate){var e=new Error("Unsupported certificate type, only X.509 supported.");throw e.oid=t.derToOid(l.certId),e}var i=t.fromDer(l.cert,n);try{g.cert=r.certificateFromAsn1(i,!0)}catch(e){g.cert=null,g.asn1=i}};break;default:var y;throw(y=new Error("Unsupported PKCS#12 SafeBag type.")).oid=g.type,y}if(void 0!==f&&!t.validate(m,f,l,d))throw(y=new Error("Cannot read PKCS#12 "+f.name)).errors=d,y;h()}return a}function p(e){var n={};if(void 0!==e)for(var i=0;i<e.length;++i){var a={},o=[];if(!t.validate(e[i],s,a,o)){var c=new Error("Cannot read PKCS#12 BagAttribute.");throw c.errors=o,c}var u=t.derToOid(a.oid);if(void 0!==r.oids[u]){n[r.oids[u]]=[];for(var l=0;l<a.values.length;++l)n[r.oids[u]].push(a.values[l].value)}}return n}n.pkcs12FromAsn1=function(e,o,s){"string"==typeof o?(s=o,o=!0):void 0===o&&(o=!0);var c={};if(!t.validate(e,a,c,[]))throw(p=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.")).errors=p,p;var p,h={version:c.version.charCodeAt(0),safeContents:[],getBags:function(e){var t,r={};return"localKeyId"in e?t=e.localKeyId:"localKeyIdHex"in e&&(t=F.util.hexToBytes(e.localKeyIdHex)),void 0===t&&!("friendlyName"in e)&&"bagType"in e&&(r[e.bagType]=u(h.safeContents,null,null,e.bagType)),void 0!==t&&(r.localKeyId=u(h.safeContents,"localKeyId",t,e.bagType)),"friendlyName"in e&&(r.friendlyName=u(h.safeContents,"friendlyName",e.friendlyName,e.bagType)),r},getBagsByFriendlyName:function(e,t){return u(h.safeContents,"friendlyName",e,t)},getBagsByLocalKeyId:function(e,t){return u(h.safeContents,"localKeyId",e,t)}};if(3!==c.version.charCodeAt(0))throw(p=new Error("PKCS#12 PFX of version other than 3 not supported.")).version=c.version.charCodeAt(0),p;if(t.derToOid(c.contentType)!==r.oids.data)throw(p=new Error("Only PKCS#12 PFX in password integrity mode supported.")).oid=t.derToOid(c.contentType),p;var g=c.content.value[0];if(g.tagClass!==t.Class.UNIVERSAL||g.type!==t.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(g=l(g),c.mac){var m=null,y=0,v=t.derToOid(c.macAlgorithm);switch(v){case r.oids.sha1:m=F.md.sha1.create(),y=20;break;case r.oids.sha256:m=F.md.sha256.create(),y=32;break;case r.oids.sha384:m=F.md.sha384.create(),y=48;break;case r.oids.sha512:m=F.md.sha512.create(),y=64;break;case r.oids.md5:m=F.md.md5.create(),y=16}if(null===m)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+v);var b=new F.util.ByteBuffer(c.macSalt),C="macIterations"in c?parseInt(F.util.bytesToHex(c.macIterations),16):1,E=n.generateKey(s,b,3,C,y,m),w=F.hmac.create();if(w.start(m,E),w.update(g.value),w.getMac().getBytes()!==c.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return function(e,n,a,o){if((n=t.fromDer(n,a)).tagClass!==t.Class.UNIVERSAL||n.type!==t.Type.SEQUENCE||!0!==n.constructed)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var s=0;s<n.value.length;s++){var c=n.value[s],u={},p=[];if(!t.validate(c,i,u,p))throw(y=new Error("Cannot read ContentInfo.")).errors=p,y;var h={encrypted:!1},g=null,m=u.content.value[0];switch(t.derToOid(u.contentType)){case r.oids.data:if(m.tagClass!==t.Class.UNIVERSAL||m.type!==t.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");g=l(m).value;break;case r.oids.encryptedData:g=d(m,o),h.encrypted=!0;break;default:var y;throw(y=new Error("Unsupported PKCS#12 contentType.")).contentType=t.derToOid(u.contentType),y}h.safeBags=f(g,a,o),e.safeContents.push(h)}}(h,g.value,o,s),h},n.toPkcs12Asn1=function(e,i,a,o){(o=o||{}).saltSize=o.saltSize||8,o.count=o.count||2048,o.algorithm=o.algorithm||o.encAlgorithm||"aes128","useMac"in o||(o.useMac=!0),"localKeyId"in o||(o.localKeyId=null),"generateLocalKeyId"in o||(o.generateLocalKeyId=!0);var s,c=o.localKeyId;if(null!==c)c=F.util.hexToBytes(c);else if(o.generateLocalKeyId)if(i){var u=F.util.isArray(i)?i[0]:i;"string"==typeof u&&(u=r.certificateFromPem(u)),(T=F.md.sha1.create()).update(t.toDer(r.certificateToAsn1(u)).getBytes()),c=T.digest().getBytes()}else c=F.random.getBytes(20);var l=[];null!==c&&l.push(t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.localKeyId).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,c)])])),"friendlyName"in o&&l.push(t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.friendlyName).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[t.create(t.Class.UNIVERSAL,t.Type.BMPSTRING,!1,o.friendlyName)])])),l.length>0&&(s=t.create(t.Class.UNIVERSAL,t.Type.SET,!0,l));var d=[],f=[];null!==i&&(f=F.util.isArray(i)?i:[i]);for(var p=[],h=0;h<f.length;++h){"string"==typeof(i=f[h])&&(i=r.certificateFromPem(i));var g=0===h?s:void 0,m=r.certificateToAsn1(i),y=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.certBag).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.x509Certificate).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,t.toDer(m).getBytes())])])]),g]);p.push(y)}if(p.length>0){var v=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,p),b=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.data).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,t.toDer(v).getBytes())])]);d.push(b)}var C=null;if(null!==e){var E=r.wrapRsaPrivateKey(r.privateKeyToAsn1(e));C=null===a?t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.keyBag).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[E]),s]):t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.pkcs8ShroudedKeyBag).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[r.encryptPrivateKeyInfo(E,a,o)]),s]);var w=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[C]),k=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.data).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,t.toDer(w).getBytes())])]);d.push(k)}var S,B=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,d);if(o.useMac){var T=F.md.sha1.create(),A=new F.util.ByteBuffer(F.random.getBytes(o.saltSize)),I=o.count,_=(e=n.generateKey(a,A,3,I,20),F.hmac.create());_.start(T,e),_.update(t.toDer(B).getBytes());var x=_.getMac();S=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.sha1).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")]),t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,x.getBytes())]),t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,A.getBytes()),t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(I).getBytes())])}return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(3).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.data).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,t.toDer(B).getBytes())])]),S])},n.generateKey=F.pbe.generatePkcs12Key})),E((function(e){var t=F.asn1,r=e.exports=F.pki=F.pki||{};r.pemToDer=function(e){var t=F.pem.decode(e)[0];if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert PEM to DER; PEM is encrypted.");return F.util.createBuffer(t.body)},r.privateKeyFromPem=function(e){var n=F.pem.decode(e)[0];if("PRIVATE KEY"!==n.type&&"RSA PRIVATE KEY"!==n.type){var i=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw i.headerType=n.type,i}if(n.procType&&"ENCRYPTED"===n.procType.type)throw new Error("Could not convert private key from PEM; PEM is encrypted.");var a=t.fromDer(n.body);return r.privateKeyFromAsn1(a)},r.privateKeyToPem=function(e,n){var i={type:"RSA PRIVATE KEY",body:t.toDer(r.privateKeyToAsn1(e)).getBytes()};return F.pem.encode(i,{maxline:n})},r.privateKeyInfoToPem=function(e,r){var n={type:"PRIVATE KEY",body:t.toDer(e).getBytes()};return F.pem.encode(n,{maxline:r})}}));var St=function(e,t,r,n){var i=F.util.createBuffer(),a=e.length>>1,o=a+(1&e.length),s=e.substr(0,o),c=e.substr(a,o),u=F.util.createBuffer(),l=F.hmac.create();r=t+r;var d=Math.ceil(n/16),f=Math.ceil(n/20);l.start("MD5",s);var p=F.util.createBuffer();u.putBytes(r);for(var h=0;h<d;++h)l.start(null,null),l.update(u.getBytes()),u.putBuffer(l.digest()),l.start(null,null),l.update(u.bytes()+r),p.putBuffer(l.digest());l.start("SHA1",c);var g=F.util.createBuffer();for(u.clear(),u.putBytes(r),h=0;h<f;++h)l.start(null,null),l.update(u.getBytes()),u.putBuffer(l.digest()),l.start(null,null),l.update(u.bytes()+r),g.putBuffer(l.digest());return i.putBytes(F.util.xorBytes(p.getBytes(),g.getBytes(),n)),i},Bt=function(e,t,r){var n=!1;try{var i=e.deflate(t.fragment.getBytes());t.fragment=F.util.createBuffer(i),t.length=i.length,n=!0}catch(e){}return n},Tt=function(e,t,r){var n=!1;try{var i=e.inflate(t.fragment.getBytes());t.fragment=F.util.createBuffer(i),t.length=i.length,n=!0}catch(e){}return n},At=function(e,t){var r=0;switch(t){case 1:r=e.getByte();break;case 2:r=e.getInt16();break;case 3:r=e.getInt24();break;case 4:r=e.getInt32()}return F.util.createBuffer(e.getBytes(r))},It=function(e,t,r){e.putInt(r.length(),t<<3),e.putBuffer(r)},_t={Versions:{TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}}};_t.SupportedVersions=[_t.Versions.TLS_1_1,_t.Versions.TLS_1_0],_t.Version=_t.SupportedVersions[0],_t.MaxFragment=15360,_t.ConnectionEnd={server:0,client:1},_t.PRFAlgorithm={tls_prf_sha256:0},_t.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2},_t.CipherType={stream:0,block:1,aead:2},_t.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4},_t.CompressionMethod={none:0,deflate:1},_t.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24},_t.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20},_t.Alert={},_t.Alert.Level={warning:1,fatal:2},_t.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100},_t.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2},_t.CipherSuites={},_t.getCipherSuite=function(e){var t=null;for(var r in _t.CipherSuites){var n=_t.CipherSuites[r];if(n.id[0]===e.charCodeAt(0)&&n.id[1]===e.charCodeAt(1)){t=n;break}}return t},_t.handleUnexpected=function(e,t){!e.open&&e.entity===_t.ConnectionEnd.client||e.error(e,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.unexpected_message}})},_t.handleHelloRequest=function(e,t,r){!e.handshaking&&e.handshakes>0&&(_t.queue(e,_t.createAlert(e,{level:_t.Alert.Level.warning,description:_t.Alert.Description.no_renegotiation})),_t.flush(e)),e.process()},_t.parseHelloMessage=function(e,t,r){var n=null,i=e.entity===_t.ConnectionEnd.client;if(r<38)e.error(e,{message:i?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.illegal_parameter}});else{var a=t.fragment,o=a.length();if(n={version:{major:a.getByte(),minor:a.getByte()},random:F.util.createBuffer(a.getBytes(32)),session_id:At(a,1),extensions:[]},i?(n.cipher_suite=a.getBytes(2),n.compression_method=a.getByte()):(n.cipher_suites=At(a,2),n.compression_methods=At(a,1)),(o=r-(o-a.length()))>0){for(var s=At(a,2);s.length()>0;)n.extensions.push({type:[s.getByte(),s.getByte()],data:At(s,2)});if(!i)for(var c=0;c<n.extensions.length;++c){var u=n.extensions[c];if(0===u.type[0]&&0===u.type[1])for(var l=At(u.data,2);l.length()>0&&0===l.getByte();)e.session.extensions.server_name.serverNameList.push(At(l,2).getBytes())}}if(e.session.version&&(n.version.major!==e.session.version.major||n.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.protocol_version}});if(i)e.session.cipherSuite=_t.getCipherSuite(n.cipher_suite);else for(var d=F.util.createBuffer(n.cipher_suites.bytes());d.length()>0&&(e.session.cipherSuite=_t.getCipherSuite(d.getBytes(2)),null===e.session.cipherSuite););if(null===e.session.cipherSuite)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.handshake_failure},cipherSuite:F.util.bytesToHex(n.cipher_suite)});e.session.compressionMethod=i?n.compression_method:_t.CompressionMethod.none}return n},_t.createSecurityParameters=function(e,t){var r=e.entity===_t.ConnectionEnd.client,n=t.random.bytes(),i=r?e.session.sp.client_random:n,a=r?n:_t.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:_t.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:i,server_random:a}},_t.handleServerHello=function(e,t,r){var n=_t.parseHelloMessage(e,t,r);if(!e.fail){if(!(n.version.minor<=e.version.minor))return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.protocol_version}});e.version.minor=n.version.minor,e.session.version=e.version;var i=n.session_id.bytes();i.length>0&&i===e.session.id?(e.expect=Ot,e.session.resuming=!0,e.session.sp.server_random=n.random.bytes()):(e.expect=xt,e.session.resuming=!1,_t.createSecurityParameters(e,n)),e.session.id=i,e.process()}},_t.handleClientHello=function(e,t,r){var n=_t.parseHelloMessage(e,t,r);if(!e.fail){var i=n.session_id.bytes(),a=null;if(e.sessionCache&&(null===(a=e.sessionCache.getSession(i))?i="":(a.version.major!==n.version.major||a.version.minor>n.version.minor)&&(a=null,i="")),0===i.length&&(i=F.random.getBytes(32)),e.session.id=i,e.session.clientHelloVersion=n.version,e.session.sp={},a)e.version=e.session.version=a.version,e.session.sp=a.sp;else{for(var o,s=1;s<_t.SupportedVersions.length&&!((o=_t.SupportedVersions[s]).minor<=n.version.minor);++s);e.version={major:o.major,minor:o.minor},e.session.version=e.version}null!==a?(e.expect=Ft,e.session.resuming=!0,e.session.sp.client_random=n.random.bytes()):(e.expect=!1!==e.verifyClient?Mt:Vt,e.session.resuming=!1,_t.createSecurityParameters(e,n)),e.open=!0,_t.queue(e,_t.createRecord(e,{type:_t.ContentType.handshake,data:_t.createServerHello(e)})),e.session.resuming?(_t.queue(e,_t.createRecord(e,{type:_t.ContentType.change_cipher_spec,data:_t.createChangeCipherSpec()})),e.state.pending=_t.createConnectionState(e),e.state.current.write=e.state.pending.write,_t.queue(e,_t.createRecord(e,{type:_t.ContentType.handshake,data:_t.createFinished(e)}))):(_t.queue(e,_t.createRecord(e,{type:_t.ContentType.handshake,data:_t.createCertificate(e)})),e.fail||(_t.queue(e,_t.createRecord(e,{type:_t.ContentType.handshake,data:_t.createServerKeyExchange(e)})),!1!==e.verifyClient&&_t.queue(e,_t.createRecord(e,{type:_t.ContentType.handshake,data:_t.createCertificateRequest(e)})),_t.queue(e,_t.createRecord(e,{type:_t.ContentType.handshake,data:_t.createServerHelloDone(e)})))),_t.flush(e),e.process()}},_t.handleCertificate=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.illegal_parameter}});var n,i,a=t.fragment,o={certificate_list:At(a,3)},s=[];try{for(;o.certificate_list.length()>0;)n=At(o.certificate_list,3),i=F.asn1.fromDer(n),n=F.pki.certificateFromAsn1(i,!0),s.push(n)}catch(t){return e.error(e,{message:"Could not parse certificate list.",cause:t,send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.bad_certificate}})}var c=e.entity===_t.ConnectionEnd.client;!c&&!0!==e.verifyClient||0!==s.length?0===s.length?e.expect=c?Pt:Vt:(c?e.session.serverCertificate=s[0]:e.session.clientCertificate=s[0],_t.verifyCertificateChain(e,s)&&(e.expect=c?Pt:Vt)):e.error(e,{message:c?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.illegal_parameter}}),e.process()},_t.handleServerKeyExchange=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.unsupported_certificate}});e.expect=Rt,e.process()},_t.handleClientKeyExchange=function(e,t,r){if(r<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.unsupported_certificate}});var n=t.fragment,i={enc_pre_master_secret:At(n,2).getBytes()},a=null;if(e.getPrivateKey)try{a=e.getPrivateKey(e,e.session.serverCertificate),a=F.pki.privateKeyFromPem(a)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.internal_error}})}if(null===a)return e.error(e,{message:"No private key set.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.internal_error}});try{var o=e.session.sp;o.pre_master_secret=a.decrypt(i.enc_pre_master_secret);var s=e.session.clientHelloVersion;if(s.major!==o.pre_master_secret.charCodeAt(0)||s.minor!==o.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch(e){o.pre_master_secret=F.random.getBytes(48)}e.expect=Ft,null!==e.session.clientCertificate&&(e.expect=jt),e.process()},_t.handleCertificateRequest=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.illegal_parameter}});var n=t.fragment,i={certificate_types:At(n,1),certificate_authorities:At(n,2)};e.session.certificateRequest=i,e.expect=Nt,e.process()},_t.handleCertificateVerify=function(e,t,r){if(r<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.illegal_parameter}});var n=t.fragment;n.read-=4;var i=n.bytes();n.read+=4;var a={signature:At(n,2).getBytes()},o=F.util.createBuffer();o.putBuffer(e.session.md5.digest()),o.putBuffer(e.session.sha1.digest()),o=o.getBytes();try{if(!e.session.clientCertificate.publicKey.verify(o,a.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(i),e.session.sha1.update(i)}catch(t){return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.handshake_failure}})}e.expect=Ft,e.process()},_t.handleServerHelloDone=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.record_overflow}});if(null===e.serverCertificate){var n={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.insufficient_security}},i=e.verify(e,n.alert.description,0,[]);if(!0!==i)return(i||0===i)&&("object"!=typeof i||F.util.isArray(i)?"number"==typeof i&&(n.alert.description=i):(i.message&&(n.message=i.message),i.alert&&(n.alert.description=i.alert))),e.error(e,n)}null!==e.session.certificateRequest&&(t=_t.createRecord(e,{type:_t.ContentType.handshake,data:_t.createCertificate(e)}),_t.queue(e,t)),t=_t.createRecord(e,{type:_t.ContentType.handshake,data:_t.createClientKeyExchange(e)}),_t.queue(e,t),e.expect=Ut;var a=function(e,t){null!==e.session.certificateRequest&&null!==e.session.clientCertificate&&_t.queue(e,_t.createRecord(e,{type:_t.ContentType.handshake,data:_t.createCertificateVerify(e,t)})),_t.queue(e,_t.createRecord(e,{type:_t.ContentType.change_cipher_spec,data:_t.createChangeCipherSpec()})),e.state.pending=_t.createConnectionState(e),e.state.current.write=e.state.pending.write,_t.queue(e,_t.createRecord(e,{type:_t.ContentType.handshake,data:_t.createFinished(e)})),e.expect=Ot,_t.flush(e),e.process()};if(null===e.session.certificateRequest||null===e.session.clientCertificate)return a(e,null);_t.getClientSignature(e,a)},_t.handleChangeCipherSpec=function(e,t){if(1!==t.fragment.getByte())return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.illegal_parameter}});var r=e.entity===_t.ConnectionEnd.client;(e.session.resuming&&r||!e.session.resuming&&!r)&&(e.state.pending=_t.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&r||e.session.resuming&&!r)&&(e.state.pending=null),e.expect=r?Lt:zt,e.process()},_t.handleFinished=function(e,t,r){var n=t.fragment;n.read-=4;var i=n.bytes();n.read+=4;var a=t.fragment.getBytes();(n=F.util.createBuffer()).putBuffer(e.session.md5.digest()),n.putBuffer(e.session.sha1.digest());var o=e.entity===_t.ConnectionEnd.client,s=o?"server finished":"client finished",c=e.session.sp;if((n=St(c.master_secret,s,n.getBytes(),12)).getBytes()!==a)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.decrypt_error}});e.session.md5.update(i),e.session.sha1.update(i),(e.session.resuming&&o||!e.session.resuming&&!o)&&(_t.queue(e,_t.createRecord(e,{type:_t.ContentType.change_cipher_spec,data:_t.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,_t.queue(e,_t.createRecord(e,{type:_t.ContentType.handshake,data:_t.createFinished(e)}))),e.expect=o?Dt:Kt,e.handshaking=!1,++e.handshakes,e.peerCertificate=o?e.session.serverCertificate:e.session.clientCertificate,_t.flush(e),e.isConnected=!0,e.connected(e),e.process()},_t.handleAlert=function(e,t){var r,n=t.fragment,i={level:n.getByte(),description:n.getByte()};switch(i.description){case _t.Alert.Description.close_notify:r="Connection closed.";break;case _t.Alert.Description.unexpected_message:r="Unexpected message.";break;case _t.Alert.Description.bad_record_mac:r="Bad record MAC.";break;case _t.Alert.Description.decryption_failed:r="Decryption failed.";break;case _t.Alert.Description.record_overflow:r="Record overflow.";break;case _t.Alert.Description.decompression_failure:r="Decompression failed.";break;case _t.Alert.Description.handshake_failure:r="Handshake failure.";break;case _t.Alert.Description.bad_certificate:r="Bad certificate.";break;case _t.Alert.Description.unsupported_certificate:r="Unsupported certificate.";break;case _t.Alert.Description.certificate_revoked:r="Certificate revoked.";break;case _t.Alert.Description.certificate_expired:r="Certificate expired.";break;case _t.Alert.Description.certificate_unknown:r="Certificate unknown.";break;case _t.Alert.Description.illegal_parameter:r="Illegal parameter.";break;case _t.Alert.Description.unknown_ca:r="Unknown certificate authority.";break;case _t.Alert.Description.access_denied:r="Access denied.";break;case _t.Alert.Description.decode_error:r="Decode error.";break;case _t.Alert.Description.decrypt_error:r="Decrypt error.";break;case _t.Alert.Description.export_restriction:r="Export restriction.";break;case _t.Alert.Description.protocol_version:r="Unsupported protocol version.";break;case _t.Alert.Description.insufficient_security:r="Insufficient security.";break;case _t.Alert.Description.internal_error:r="Internal error.";break;case _t.Alert.Description.user_canceled:r="User canceled.";break;case _t.Alert.Description.no_renegotiation:r="Renegotiation not supported.";break;default:r="Unknown error."}if(i.description===_t.Alert.Description.close_notify)return e.close();e.error(e,{message:r,send:!1,origin:e.entity===_t.ConnectionEnd.client?"server":"client",alert:i}),e.process()},_t.handleHandshake=function(e,t){var r=t.fragment,n=r.getByte(),i=r.getInt24();if(i>r.length())return e.fragmented=t,t.fragment=F.util.createBuffer(),r.read-=4,e.process();e.fragmented=null,r.read-=4;var a=r.bytes(i+4);r.read+=4,n in ir[e.entity][e.expect]?(e.entity!==_t.ConnectionEnd.server||e.open||e.fail||(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:F.md.md5.create(),sha1:F.md.sha1.create()}),n!==_t.HandshakeType.hello_request&&n!==_t.HandshakeType.certificate_verify&&n!==_t.HandshakeType.finished&&(e.session.md5.update(a),e.session.sha1.update(a)),ir[e.entity][e.expect][n](e,t,i)):_t.handleUnexpected(e,t)},_t.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()},_t.handleHeartbeat=function(e,t){var r=t.fragment,n=r.getByte(),i=r.getInt16(),a=r.getBytes(i);if(n===_t.HeartbeatMessageType.heartbeat_request){if(e.handshaking||i>a.length)return e.process();_t.queue(e,_t.createRecord(e,{type:_t.ContentType.heartbeat,data:_t.createHeartbeat(_t.HeartbeatMessageType.heartbeat_response,a)})),_t.flush(e)}else if(n===_t.HeartbeatMessageType.heartbeat_response){if(a!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,F.util.createBuffer(a))}e.process()};var xt=1,Pt=2,Rt=3,Nt=4,Ot=5,Lt=6,Dt=7,Ut=8,Mt=1,Vt=2,jt=3,Ft=4,zt=5,Kt=6,qt=_t.handleUnexpected,Ht=_t.handleChangeCipherSpec,Qt=_t.handleAlert,Gt=_t.handleHandshake,Wt=_t.handleApplicationData,Xt=_t.handleHeartbeat,Yt=[];Yt[_t.ConnectionEnd.client]=[[qt,Qt,Gt,qt,Xt],[qt,Qt,Gt,qt,Xt],[qt,Qt,Gt,qt,Xt],[qt,Qt,Gt,qt,Xt],[qt,Qt,Gt,qt,Xt],[Ht,Qt,qt,qt,Xt],[qt,Qt,Gt,qt,Xt],[qt,Qt,Gt,Wt,Xt],[qt,Qt,Gt,qt,Xt]],Yt[_t.ConnectionEnd.server]=[[qt,Qt,Gt,qt,Xt],[qt,Qt,Gt,qt,Xt],[qt,Qt,Gt,qt,Xt],[qt,Qt,Gt,qt,Xt],[Ht,Qt,qt,qt,Xt],[qt,Qt,Gt,qt,Xt],[qt,Qt,Gt,Wt,Xt],[qt,Qt,Gt,qt,Xt]];var $t=_t.handleHelloRequest,Zt=_t.handleServerHello,Jt=_t.handleCertificate,er=_t.handleServerKeyExchange,tr=_t.handleCertificateRequest,rr=_t.handleServerHelloDone,nr=_t.handleFinished,ir=[];ir[_t.ConnectionEnd.client]=[[qt,qt,Zt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt],[$t,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,Jt,er,tr,rr,qt,qt,qt,qt,qt,qt],[$t,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,er,tr,rr,qt,qt,qt,qt,qt,qt],[$t,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,tr,rr,qt,qt,qt,qt,qt,qt],[$t,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,rr,qt,qt,qt,qt,qt,qt],[$t,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt],[$t,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,nr],[$t,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt],[$t,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt]];var ar=_t.handleClientHello,or=_t.handleClientKeyExchange,sr=_t.handleCertificateVerify;ir[_t.ConnectionEnd.server]=[[qt,ar,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt],[qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,Jt,qt,qt,qt,qt,qt,qt,qt,qt,qt],[qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,or,qt,qt,qt,qt],[qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,sr,qt,qt,qt,qt,qt],[qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt],[qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,nr],[qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt],[qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt,qt]],_t.generateKeys=function(e,t){var r=St,n=t.client_random+t.server_random;e.session.resuming||(t.master_secret=r(t.pre_master_secret,"master secret",n,48).bytes(),t.pre_master_secret=null),n=t.server_random+t.client_random;var i=2*t.mac_key_length+2*t.enc_key_length,a=e.version.major===_t.Versions.TLS_1_0.major&&e.version.minor===_t.Versions.TLS_1_0.minor;a&&(i+=2*t.fixed_iv_length);var o=r(t.master_secret,"key expansion",n,i),s={client_write_MAC_key:o.getBytes(t.mac_key_length),server_write_MAC_key:o.getBytes(t.mac_key_length),client_write_key:o.getBytes(t.enc_key_length),server_write_key:o.getBytes(t.enc_key_length)};return a&&(s.client_write_IV=o.getBytes(t.fixed_iv_length),s.server_write_IV=o.getBytes(t.fixed_iv_length)),s},_t.createConnectionState=function(e){var t=e.entity===_t.ConnectionEnd.client,r=function(){var e={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(e){return!0},compressionState:null,compressFunction:function(e){return!0},updateSequenceNumber:function(){4294967295===e.sequenceNumber[1]?(e.sequenceNumber[1]=0,++e.sequenceNumber[0]):++e.sequenceNumber[1]}};return e},n={read:r(),write:r()};if(n.read.update=function(e,t){return n.read.cipherFunction(t,n.read)?n.read.compressFunction(e,t,n.read)||e.error(e,{message:"Could not decompress record.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.decompression_failure}}):e.error(e,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.bad_record_mac}}),!e.fail},n.write.update=function(e,t){return n.write.compressFunction(e,t,n.write)?n.write.cipherFunction(t,n.write)||e.error(e,{message:"Could not encrypt record.",send:!1,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.internal_error}}):e.error(e,{message:"Could not compress record.",send:!1,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.internal_error}}),!e.fail},e.session){var i=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(i),i.keys=_t.generateKeys(e,i),n.read.macKey=t?i.keys.server_write_MAC_key:i.keys.client_write_MAC_key,n.write.macKey=t?i.keys.client_write_MAC_key:i.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(n,e,i),i.compression_algorithm){case _t.CompressionMethod.none:break;case _t.CompressionMethod.deflate:n.read.compressFunction=Tt,n.write.compressFunction=Bt;break;default:throw new Error("Unsupported compression algorithm.")}}return n},_t.createRandom=function(){var e=new Date,t=+e+6e4*e.getTimezoneOffset(),r=F.util.createBuffer();return r.putInt32(t),r.putBytes(F.random.getBytes(28)),r},_t.createRecord=function(e,t){return t.data?{type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data}:null},_t.createAlert=function(e,t){var r=F.util.createBuffer();return r.putByte(t.level),r.putByte(t.description),_t.createRecord(e,{type:_t.ContentType.alert,data:r})},_t.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=F.util.createBuffer(),r=0;r<e.cipherSuites.length;++r){var n=e.cipherSuites[r];t.putByte(n.id[0]),t.putByte(n.id[1])}var i=t.length(),a=F.util.createBuffer();a.putByte(_t.CompressionMethod.none);var o=a.length(),s=F.util.createBuffer();if(e.virtualHost){var c=F.util.createBuffer();c.putByte(0),c.putByte(0);var u=F.util.createBuffer();u.putByte(0),It(u,2,F.util.createBuffer(e.virtualHost));var l=F.util.createBuffer();It(l,2,u),It(c,2,l),s.putBuffer(c)}var d=s.length();d>0&&(d+=2);var f=e.session.id,p=f.length+1+2+4+28+2+i+1+o+d,h=F.util.createBuffer();return h.putByte(_t.HandshakeType.client_hello),h.putInt24(p),h.putByte(e.version.major),h.putByte(e.version.minor),h.putBytes(e.session.sp.client_random),It(h,1,F.util.createBuffer(f)),It(h,2,t),It(h,1,a),d>0&&It(h,2,s),h},_t.createServerHello=function(e){var t=e.session.id,r=t.length+1+2+4+28+2+1,n=F.util.createBuffer();return n.putByte(_t.HandshakeType.server_hello),n.putInt24(r),n.putByte(e.version.major),n.putByte(e.version.minor),n.putBytes(e.session.sp.server_random),It(n,1,F.util.createBuffer(t)),n.putByte(e.session.cipherSuite.id[0]),n.putByte(e.session.cipherSuite.id[1]),n.putByte(e.session.compressionMethod),n},_t.createCertificate=function(e){var t,r=e.entity===_t.ConnectionEnd.client,n=null;e.getCertificate&&(t=r?e.session.certificateRequest:e.session.extensions.server_name.serverNameList,n=e.getCertificate(e,t));var i=F.util.createBuffer();if(null!==n)try{F.util.isArray(n)||(n=[n]);for(var a=null,o=0;o<n.length;++o){var s=F.pem.decode(n[o])[0];if("CERTIFICATE"!==s.type&&"X509 CERTIFICATE"!==s.type&&"TRUSTED CERTIFICATE"!==s.type){var c=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw c.headerType=s.type,c}if(s.procType&&"ENCRYPTED"===s.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var u=F.util.createBuffer(s.body);null===a&&(a=F.asn1.fromDer(u.bytes(),!1));var l=F.util.createBuffer();It(l,3,u),i.putBuffer(l)}n=F.pki.certificateFromAsn1(a),r?e.session.clientCertificate=n:e.session.serverCertificate=n}catch(t){return e.error(e,{message:"Could not send certificate list.",cause:t,send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.bad_certificate}})}var d=3+i.length(),f=F.util.createBuffer();return f.putByte(_t.HandshakeType.certificate),f.putInt24(d),It(f,3,i),f},_t.createClientKeyExchange=function(e){var t=F.util.createBuffer();t.putByte(e.session.clientHelloVersion.major),t.putByte(e.session.clientHelloVersion.minor),t.putBytes(F.random.getBytes(46));var r=e.session.sp;r.pre_master_secret=t.getBytes();var n=(t=e.session.serverCertificate.publicKey.encrypt(r.pre_master_secret)).length+2,i=F.util.createBuffer();return i.putByte(_t.HandshakeType.client_key_exchange),i.putInt24(n),i.putInt16(t.length),i.putBytes(t),i},_t.createServerKeyExchange=function(e){return F.util.createBuffer()},_t.getClientSignature=function(e,t){var r=F.util.createBuffer();r.putBuffer(e.session.md5.digest()),r.putBuffer(e.session.sha1.digest()),r=r.getBytes(),e.getSignature=e.getSignature||function(e,t,r){var n=null;if(e.getPrivateKey)try{n=e.getPrivateKey(e,e.session.clientCertificate),n=F.pki.privateKeyFromPem(n)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.internal_error}})}null===n?e.error(e,{message:"No private key set.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.internal_error}}):t=n.sign(t,null),r(e,t)},e.getSignature(e,r,t)},_t.createCertificateVerify=function(e,t){var r=t.length+2,n=F.util.createBuffer();return n.putByte(_t.HandshakeType.certificate_verify),n.putInt24(r),n.putInt16(t.length),n.putBytes(t),n},_t.createCertificateRequest=function(e){var t=F.util.createBuffer();t.putByte(1);var r=F.util.createBuffer();for(var n in e.caStore.certs){var i=e.caStore.certs[n],a=F.pki.distinguishedNameToAsn1(i.subject),o=F.asn1.toDer(a);r.putInt16(o.length()),r.putBuffer(o)}var s=1+t.length()+2+r.length(),c=F.util.createBuffer();return c.putByte(_t.HandshakeType.certificate_request),c.putInt24(s),It(c,1,t),It(c,2,r),c},_t.createServerHelloDone=function(e){var t=F.util.createBuffer();return t.putByte(_t.HandshakeType.server_hello_done),t.putInt24(0),t},_t.createChangeCipherSpec=function(){var e=F.util.createBuffer();return e.putByte(1),e},_t.createFinished=function(e){var t=F.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var r=e.entity===_t.ConnectionEnd.client,n=e.session.sp,i=r?"client finished":"server finished";t=St(n.master_secret,i,t.getBytes(),12);var a=F.util.createBuffer();return a.putByte(_t.HandshakeType.finished),a.putInt24(t.length()),a.putBuffer(t),a},_t.createHeartbeat=function(e,t,r){void 0===r&&(r=t.length);var n=F.util.createBuffer();n.putByte(e),n.putInt16(r),n.putBytes(t);var i=n.length(),a=Math.max(16,i-r-3);return n.putBytes(F.random.getBytes(a)),n},_t.queue=function(e,t){if(t&&(0!==t.fragment.length()||t.type!==_t.ContentType.handshake&&t.type!==_t.ContentType.alert&&t.type!==_t.ContentType.change_cipher_spec)){if(t.type===_t.ContentType.handshake){var r=t.fragment.bytes();e.session.md5.update(r),e.session.sha1.update(r),r=null}var n;if(t.fragment.length()<=_t.MaxFragment)n=[t];else{n=[];for(var i=t.fragment.bytes();i.length>_t.MaxFragment;)n.push(_t.createRecord(e,{type:t.type,data:F.util.createBuffer(i.slice(0,_t.MaxFragment))})),i=i.slice(_t.MaxFragment);i.length>0&&n.push(_t.createRecord(e,{type:t.type,data:F.util.createBuffer(i)}))}for(var a=0;a<n.length&&!e.fail;++a){var o=n[a];e.state.current.write.update(e,o)&&e.records.push(o)}}},_t.flush=function(e){for(var t=0;t<e.records.length;++t){var r=e.records[t];e.tlsData.putByte(r.type),e.tlsData.putByte(r.version.major),e.tlsData.putByte(r.version.minor),e.tlsData.putInt16(r.fragment.length()),e.tlsData.putBuffer(e.records[t].fragment)}return e.records=[],e.tlsDataReady(e)};var cr=function(e){switch(e){case!0:return!0;case F.pki.certificateError.bad_certificate:return _t.Alert.Description.bad_certificate;case F.pki.certificateError.unsupported_certificate:return _t.Alert.Description.unsupported_certificate;case F.pki.certificateError.certificate_revoked:return _t.Alert.Description.certificate_revoked;case F.pki.certificateError.certificate_expired:return _t.Alert.Description.certificate_expired;case F.pki.certificateError.certificate_unknown:return _t.Alert.Description.certificate_unknown;case F.pki.certificateError.unknown_ca:return _t.Alert.Description.unknown_ca;default:return _t.Alert.Description.bad_certificate}};for(var ur in _t.verifyCertificateChain=function(e,t){try{var r={};for(var n in e.verifyOptions)r[n]=e.verifyOptions[n];r.verify=function(t,r,n){cr(t);var i=e.verify(e,t,r,n);if(!0!==i){if("object"==typeof i&&!F.util.isArray(i)){var a=new Error("The application rejected the certificate.");throw a.send=!0,a.alert={level:_t.Alert.Level.fatal,description:_t.Alert.Description.bad_certificate},i.message&&(a.message=i.message),i.alert&&(a.alert.description=i.alert),a}i!==t&&(i=function(e){switch(e){case!0:return!0;case _t.Alert.Description.bad_certificate:return F.pki.certificateError.bad_certificate;case _t.Alert.Description.unsupported_certificate:return F.pki.certificateError.unsupported_certificate;case _t.Alert.Description.certificate_revoked:return F.pki.certificateError.certificate_revoked;case _t.Alert.Description.certificate_expired:return F.pki.certificateError.certificate_expired;case _t.Alert.Description.certificate_unknown:return F.pki.certificateError.certificate_unknown;case _t.Alert.Description.unknown_ca:return F.pki.certificateError.unknown_ca;default:return F.pki.certificateError.bad_certificate}}(i))}return i},F.pki.verifyCertificateChain(e.caStore,t,r)}catch(t){var i=t;("object"!=typeof i||F.util.isArray(i))&&(i={send:!0,alert:{level:_t.Alert.Level.fatal,description:cr(t)}}),"send"in i||(i.send=!0),"alert"in i||(i.alert={level:_t.Alert.Level.fatal,description:cr(i.error)}),e.error(e,i)}return!e.fail},_t.createSessionCache=function(e,t){var r=null;if(e&&e.getSession&&e.setSession&&e.order)r=e;else{for(var n in(r={}).cache=e||{},r.capacity=Math.max(t||100,1),r.order=[],e)r.order.length<=t?r.order.push(n):delete e[n];r.getSession=function(e){var t=null,n=null;if(e?n=F.util.bytesToHex(e):r.order.length>0&&(n=r.order[0]),null!==n&&n in r.cache)for(var i in t=r.cache[n],delete r.cache[n],r.order)if(r.order[i]===n){r.order.splice(i,1);break}return t},r.setSession=function(e,t){if(r.order.length===r.capacity){var n=r.order.shift();delete r.cache[n]}n=F.util.bytesToHex(e),r.order.push(n),r.cache[n]=t}}return r},_t.createConnection=function(e){var t=null;t=e.caStore?F.util.isArray(e.caStore)?F.pki.createCaStore(e.caStore):e.caStore:F.pki.createCaStore();var r=e.cipherSuites||null;if(null===r)for(var n in r=[],_t.CipherSuites)r.push(_t.CipherSuites[n]);var i=e.server?_t.ConnectionEnd.server:_t.ConnectionEnd.client,a=e.sessionCache?_t.createSessionCache(e.sessionCache):null,o={version:{major:_t.Version.major,minor:_t.Version.minor},entity:i,sessionId:e.sessionId,caStore:t,sessionCache:a,cipherSuites:r,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(e,t,r,n){return t},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:F.util.createBuffer(),tlsData:F.util.createBuffer(),data:F.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(t,r){r.origin=r.origin||(t.entity===_t.ConnectionEnd.client?"client":"server"),r.send&&(_t.queue(t,_t.createAlert(t,r.alert)),_t.flush(t));var n=!1!==r.fatal;n&&(t.fail=!0),e.error(t,r),n&&t.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null,reset:function(e){o.version={major:_t.Version.major,minor:_t.Version.minor},o.record=null,o.session=null,o.peerCertificate=null,o.state={pending:null,current:null},o.expect=(_t.ConnectionEnd.client,0),o.fragmented=null,o.records=[],o.open=!1,o.handshakes=0,o.handshaking=!1,o.isConnected=!1,o.fail=!(e||void 0===e),o.input.clear(),o.tlsData.clear(),o.data.clear(),o.state.current=_t.createConnectionState(o)}};return o.reset(),o.handshake=function(e){if(o.entity!==_t.ConnectionEnd.client)o.error(o,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(o.handshaking)o.error(o,{message:"Handshake already in progress.",fatal:!1});else{o.fail&&!o.open&&0===o.handshakes&&(o.fail=!1),o.handshaking=!0;var t=null;(e=e||"").length>0&&(o.sessionCache&&(t=o.sessionCache.getSession(e)),null===t&&(e="")),0===e.length&&o.sessionCache&&null!==(t=o.sessionCache.getSession())&&(e=t.id),o.session={id:e,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:F.md.md5.create(),sha1:F.md.sha1.create()},t&&(o.version=t.version,o.session.sp=t.sp),o.session.sp.client_random=_t.createRandom().getBytes(),o.open=!0,_t.queue(o,_t.createRecord(o,{type:_t.ContentType.handshake,data:_t.createClientHello(o)})),_t.flush(o)}},o.process=function(e){var t=0;return e&&o.input.putBytes(e),o.fail||(null!==o.record&&o.record.ready&&o.record.fragment.isEmpty()&&(o.record=null),null===o.record&&(t=function(e){var t=0,r=e.input,n=r.length();if(n<5)t=5-n;else{e.record={type:r.getByte(),version:{major:r.getByte(),minor:r.getByte()},length:r.getInt16(),fragment:F.util.createBuffer(),ready:!1};var i=e.record.version.major===e.version.major;i&&e.session&&e.session.version&&(i=e.record.version.minor===e.version.minor),i||e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.protocol_version}})}return t}(o)),o.fail||null===o.record||o.record.ready||(t=function(e){var t=0,r=e.input,n=r.length();return n<e.record.length?t=e.record.length-n:(e.record.fragment.putBytes(r.getBytes(e.record.length)),r.compact(),e.state.current.read.update(e,e.record)&&(null!==e.fragmented&&(e.fragmented.type===e.record.type?(e.fragmented.fragment.putBuffer(e.record.fragment),e.record=e.fragmented):e.error(e,{message:"Invalid fragmented record.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.unexpected_message}})),e.record.ready=!0)),t}(o)),!o.fail&&null!==o.record&&o.record.ready&&function(e,t){var r=t.type-_t.ContentType.change_cipher_spec,n=Yt[e.entity][e.expect];r in n?n[r](e,t):_t.handleUnexpected(e,t)}(o,o.record)),t},o.prepare=function(e){return _t.queue(o,_t.createRecord(o,{type:_t.ContentType.application_data,data:F.util.createBuffer(e)})),_t.flush(o)},o.prepareHeartbeatRequest=function(e,t){return e instanceof F.util.ByteBuffer&&(e=e.bytes()),void 0===t&&(t=e.length),o.expectedHeartbeatPayload=e,_t.queue(o,_t.createRecord(o,{type:_t.ContentType.heartbeat,data:_t.createHeartbeat(_t.HeartbeatMessageType.heartbeat_request,e,t)})),_t.flush(o)},o.close=function(e){if(!o.fail&&o.sessionCache&&o.session){var t={id:o.session.id,version:o.session.version,sp:o.session.sp};t.sp.keys=null,o.sessionCache.setSession(t.id,t)}o.open&&(o.open=!1,o.input.clear(),(o.isConnected||o.handshaking)&&(o.isConnected=o.handshaking=!1,_t.queue(o,_t.createAlert(o,{level:_t.Alert.Level.warning,description:_t.Alert.Description.close_notify})),_t.flush(o)),o.closed(o)),o.reset(e)},o},F.tls=F.tls||{},_t)"function"!=typeof _t[ur]&&(F.tls[ur]=_t[ur]);F.tls.prf_tls1=St,F.tls.hmac_sha1=function(e,t,r){var n=F.hmac.create();n.start("SHA1",e);var i=F.util.createBuffer();return i.putInt32(t[0]),i.putInt32(t[1]),i.putByte(r.type),i.putByte(r.version.major),i.putByte(r.version.minor),i.putInt16(r.length),i.putBytes(r.fragment.bytes()),n.update(i.getBytes()),n.digest().getBytes()},F.tls.createSessionCache=_t.createSessionCache,F.tls.createConnection=_t.createConnection,E((function(e){var t=e.exports=F.tls;function r(e,r,i){var a=r.entity===F.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:F.cipher.createDecipher("AES-CBC",a?i.keys.server_write_key:i.keys.client_write_key),iv:a?i.keys.server_write_IV:i.keys.client_write_IV},e.write.cipherState={init:!1,cipher:F.cipher.createCipher("AES-CBC",a?i.keys.client_write_key:i.keys.server_write_key),iv:a?i.keys.client_write_IV:i.keys.server_write_IV},e.read.cipherFunction=o,e.write.cipherFunction=n,e.read.macLength=e.write.macLength=i.mac_length,e.read.macFunction=e.write.macFunction=t.hmac_sha1}function n(e,r){var n,a=!1,o=r.macFunction(r.macKey,r.sequenceNumber,e);e.fragment.putBytes(o),r.updateSequenceNumber(),n=e.version.minor===t.Versions.TLS_1_0.minor?r.cipherState.init?null:r.cipherState.iv:F.random.getBytesSync(16),r.cipherState.init=!0;var s=r.cipherState.cipher;return s.start({iv:n}),e.version.minor>=t.Versions.TLS_1_1.minor&&s.output.putBytes(n),s.update(e.fragment),s.finish(i)&&(e.fragment=s.output,e.length=e.fragment.length(),a=!0),a}function i(e,t,r){if(!r){var n=e-t.length()%e;t.fillWithByte(n-1,n)}return!0}function a(e,t,r){var n=!0;if(r){for(var i=t.length(),a=t.last(),o=i-1-a;o<i-1;++o)n=n&&t.at(o)==a;n&&t.truncate(a+1)}return n}function o(e,r){var n,i=!1;n=e.version.minor===t.Versions.TLS_1_0.minor?r.cipherState.init?null:r.cipherState.iv:e.fragment.getBytes(16),r.cipherState.init=!0;var o=r.cipherState.cipher;o.start({iv:n}),o.update(e.fragment),i=o.finish(a);var s=r.macLength,c=F.random.getBytesSync(s),u=o.output.length();u>=s?(e.fragment=o.output.getBytes(u-s),c=o.output.getBytes(s)):e.fragment=o.output.getBytes(),e.fragment=F.util.createBuffer(e.fragment),e.length=e.fragment.length();var l=r.macFunction(r.macKey,r.sequenceNumber,e);return r.updateSequenceNumber(),function(e,t,r){var n=F.hmac.create();return n.start("SHA1",e),n.update(t),t=n.digest().getBytes(),n.start(null,null),n.update(r),t===(r=n.digest().getBytes())}(r.macKey,c,l)&&i}t.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=t.BulkCipherAlgorithm.aes,e.cipher_type=t.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=t.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:r},t.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=t.BulkCipherAlgorithm.aes,e.cipher_type=t.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=t.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:r}})),F.debug=F.debug||{},F.debug.storage={},F.debug.get=function(e,t){var r;return void 0===e?r=F.debug.storage:e in F.debug.storage&&(r=void 0===t?F.debug.storage[e]:F.debug.storage[e][t]),r},F.debug.set=function(e,t,r){e in F.debug.storage||(F.debug.storage[e]={}),F.debug.storage[e][t]=r},F.debug.clear=function(e,t){void 0===e?F.debug.storage={}:e in F.debug.storage&&(void 0===t?delete F.debug.storage[e]:delete F.debug.storage[e][t])},E((function(e){var t=e.exports=F.sha512=F.sha512||{};F.md.sha512=F.md.algorithms.sha512=t;var r=F.sha384=F.sha512.sha384=F.sha512.sha384||{};r.create=function(){return t.create("SHA-384")},F.md.sha384=F.md.algorithms.sha384=r,F.sha512.sha256=F.sha512.sha256||{create:function(){return t.create("SHA-512/256")}},F.md["sha512/256"]=F.md.algorithms["sha512/256"]=F.sha512.sha256,F.sha512.sha224=F.sha512.sha224||{create:function(){return t.create("SHA-512/224")}},F.md["sha512/224"]=F.md.algorithms["sha512/224"]=F.sha512.sha224,t.create=function(e){if(i||(n=String.fromCharCode(128),n+=F.util.fillString(String.fromCharCode(0),128),a=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],(o={})["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],o["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],o["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],o["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],i=!0),void 0===e&&(e="SHA-512"),!(e in o))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=o[e],r=null,c=F.util.createBuffer(),u=new Array(80),l=0;l<80;++l)u[l]=new Array(2);var d=64;switch(e){case"SHA-384":d=48;break;case"SHA-512/256":d=32;break;case"SHA-512/224":d=28}var f={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:d,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){f.messageLength=0,f.fullMessageLength=f.messageLength128=[];for(var e=f.messageLengthSize/4,n=0;n<e;++n)f.fullMessageLength.push(0);for(c=F.util.createBuffer(),r=new Array(t.length),n=0;n<t.length;++n)r[n]=t[n].slice(0);return f}};return f.start(),f.update=function(e,t){"utf8"===t&&(e=F.util.encodeUtf8(e));var n=e.length;f.messageLength+=n,n=[n/4294967296>>>0,n>>>0];for(var i=f.fullMessageLength.length-1;i>=0;--i)f.fullMessageLength[i]+=n[1],n[1]=n[0]+(f.fullMessageLength[i]/4294967296>>>0),f.fullMessageLength[i]=f.fullMessageLength[i]>>>0,n[0]=n[1]/4294967296>>>0;return c.putBytes(e),s(r,u,c),(c.read>2048||0===c.length())&&c.compact(),f},f.digest=function(){var t=F.util.createBuffer();t.putBytes(c.bytes());var i,a=f.fullMessageLength[f.fullMessageLength.length-1]+f.messageLengthSize&f.blockLength-1;t.putBytes(n.substr(0,f.blockLength-a));for(var o=8*f.fullMessageLength[0],l=0;l<f.fullMessageLength.length-1;++l)o+=(i=8*f.fullMessageLength[l+1])/4294967296>>>0,t.putInt32(o>>>0),o=i>>>0;t.putInt32(o);var d=new Array(r.length);for(l=0;l<r.length;++l)d[l]=r[l].slice(0);s(d,u,t);var p,h=F.util.createBuffer();for(p="SHA-512"===e?d.length:"SHA-384"===e?d.length-2:d.length-4,l=0;l<p;++l)h.putInt32(d[l][0]),l===p-1&&"SHA-512/224"===e||h.putInt32(d[l][1]);return h},f};var n=null,i=!1,a=null,o=null;function s(e,t,r){for(var n,i,o,s,c,u,l,d,f,p,h,g,m,y,v,b,C,E,w,k,S,B,T,A,I,_,x,P,R,N,O,L,D,U=r.length();U>=128;){for(x=0;x<16;++x)t[x][0]=r.getInt32()>>>0,t[x][1]=r.getInt32()>>>0;for(;x<80;++x)n=(((P=(N=t[x-2])[0])>>>19|(R=N[1])<<13)^(R>>>29|P<<3)^P>>>6)>>>0,i=((P<<13|R>>>19)^(R<<3|P>>>29)^(P<<26|R>>>6))>>>0,o=(((P=(L=t[x-15])[0])>>>1|(R=L[1])<<31)^(P>>>8|R<<24)^P>>>7)>>>0,s=((P<<31|R>>>1)^(P<<24|R>>>8)^(P<<25|R>>>7))>>>0,O=t[x-7],D=t[x-16],R=i+O[1]+s+D[1],t[x][0]=n+O[0]+o+D[0]+(R/4294967296>>>0)>>>0,t[x][1]=R>>>0;for(h=e[0][0],g=e[0][1],m=e[1][0],y=e[1][1],v=e[2][0],b=e[2][1],C=e[3][0],E=e[3][1],w=e[4][0],k=e[4][1],S=e[5][0],B=e[5][1],T=e[6][0],A=e[6][1],I=e[7][0],_=e[7][1],x=0;x<80;++x)l=((w>>>14|k<<18)^(w>>>18|k<<14)^(k>>>9|w<<23))>>>0,d=(T^w&(S^T))>>>0,c=((h>>>28|g<<4)^(g>>>2|h<<30)^(g>>>7|h<<25))>>>0,u=((h<<4|g>>>28)^(g<<30|h>>>2)^(g<<25|h>>>7))>>>0,f=(h&m|v&(h^m))>>>0,p=(g&y|b&(g^y))>>>0,R=_+(((w<<18|k>>>14)^(w<<14|k>>>18)^(k<<23|w>>>9))>>>0)+((A^k&(B^A))>>>0)+a[x][1]+t[x][1],n=I+l+d+a[x][0]+t[x][0]+(R/4294967296>>>0)>>>0,i=R>>>0,o=c+f+((R=u+p)/4294967296>>>0)>>>0,s=R>>>0,I=T,_=A,T=S,A=B,S=w,B=k,w=C+n+((R=E+i)/4294967296>>>0)>>>0,k=R>>>0,C=v,E=b,v=m,b=y,m=h,y=g,h=n+o+((R=i+s)/4294967296>>>0)>>>0,g=R>>>0;R=e[0][1]+g,e[0][0]=e[0][0]+h+(R/4294967296>>>0)>>>0,e[0][1]=R>>>0,R=e[1][1]+y,e[1][0]=e[1][0]+m+(R/4294967296>>>0)>>>0,e[1][1]=R>>>0,R=e[2][1]+b,e[2][0]=e[2][0]+v+(R/4294967296>>>0)>>>0,e[2][1]=R>>>0,R=e[3][1]+E,e[3][0]=e[3][0]+C+(R/4294967296>>>0)>>>0,e[3][1]=R>>>0,R=e[4][1]+k,e[4][0]=e[4][0]+w+(R/4294967296>>>0)>>>0,e[4][1]=R>>>0,R=e[5][1]+B,e[5][0]=e[5][0]+S+(R/4294967296>>>0)>>>0,e[5][1]=R>>>0,R=e[6][1]+A,e[6][0]=e[6][0]+T+(R/4294967296>>>0)>>>0,e[6][1]=R>>>0,R=e[7][1]+_,e[7][0]=e[7][0]+I+(R/4294967296>>>0)>>>0,e[7][1]=R>>>0,U-=128}}}));var lr=F.asn1,dr={privateKeyValidator:{name:"PrivateKeyInfo",tagClass:lr.Class.UNIVERSAL,type:lr.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:lr.Class.UNIVERSAL,type:lr.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:lr.Class.UNIVERSAL,type:lr.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:lr.Class.UNIVERSAL,type:lr.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:lr.Class.UNIVERSAL,type:lr.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},publicKeyValidator:{name:"SubjectPublicKeyInfo",tagClass:lr.Class.UNIVERSAL,type:lr.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:lr.Class.UNIVERSAL,type:lr.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:lr.Class.UNIVERSAL,type:lr.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:lr.Class.UNIVERSAL,type:lr.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}},fr=dr.publicKeyValidator,pr=dr.privateKeyValidator;if(void 0===hr)var hr=F.jsbn.BigInteger;var gr=F.util.ByteBuffer,mr="undefined"==typeof Buffer?Uint8Array:Buffer;F.pki=F.pki||{},F.pki.ed25519=F.ed25519=F.ed25519||{};var yr=F.ed25519;function vr(e){var t=e.message;if(t instanceof Uint8Array||t instanceof mr)return t;var r=e.encoding;if(void 0===t){if(!e.md)throw new TypeError('"options.message" or "options.md" not specified.');t=e.md.digest().getBytes(),r="binary"}if("string"==typeof t&&!r)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if("string"==typeof t){if("undefined"!=typeof Buffer)return Buffer.from(t,r);t=new gr(t,r)}else if(!(t instanceof gr))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var n=new mr(t.length()),i=0;i<n.length;++i)n[i]=t.at(i);return n}yr.constants={},yr.constants.PUBLIC_KEY_BYTE_LENGTH=32,yr.constants.PRIVATE_KEY_BYTE_LENGTH=64,yr.constants.SEED_BYTE_LENGTH=32,yr.constants.SIGN_BYTE_LENGTH=64,yr.constants.HASH_BYTE_LENGTH=64,yr.generateKeyPair=function(e){var t=(e=e||{}).seed;if(void 0===t)t=F.random.getBytesSync(yr.constants.SEED_BYTE_LENGTH);else if("string"==typeof t){if(t.length!==yr.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+yr.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');t=vr({message:t,encoding:"binary"});for(var r=new mr(yr.constants.PUBLIC_KEY_BYTE_LENGTH),n=new mr(yr.constants.PRIVATE_KEY_BYTE_LENGTH),i=0;i<32;++i)n[i]=t[i];return function(e,t){var r,n=[zr(),zr(),zr(),zr()],i=Ar(t,32);for(i[0]&=248,i[31]&=127,i[31]|=64,Mr(n,i),Rr(e,n),r=0;r<32;++r)t[r+32]=e[r]}(r,n),{publicKey:r,privateKey:n}},yr.privateKeyFromAsn1=function(e){var t={},r=[];if(!F.asn1.validate(e,pr,t,r)){var n=new Error("Invalid Key.");throw n.errors=r,n}var i=F.asn1.derToOid(t.privateKeyOid),a=F.oids.EdDSA25519;if(i!==a)throw new Error('Invalid OID "'+i+'"; OID must be "'+a+'".');var o=t.privateKey;return{privateKeyBytes:vr({message:F.asn1.fromDer(o).value,encoding:"binary"})}},yr.publicKeyFromAsn1=function(e){var t={},r=[];if(!F.asn1.validate(e,fr,t,r)){var n=new Error("Invalid Key.");throw n.errors=r,n}var i=F.asn1.derToOid(t.publicKeyOid),a=F.oids.EdDSA25519;if(i!==a)throw new Error('Invalid OID "'+i+'"; OID must be "'+a+'".');var o=t.ed25519PublicKey;if(o.length!==yr.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return vr({message:o,encoding:"binary"})},yr.publicKeyFromPrivateKey=function(e){var t=vr({message:(e=e||{}).privateKey,encoding:"binary"});if(t.length!==yr.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+yr.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new mr(yr.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n<r.length;++n)r[n]=t[32+n];return r},yr.sign=function(e){var t=vr(e=e||{}),r=vr({message:e.privateKey,encoding:"binary"});if(r.length===yr.constants.SEED_BYTE_LENGTH)r=yr.generateKeyPair({seed:r}).privateKey;else if(r.length!==yr.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+yr.constants.SEED_BYTE_LENGTH+" or "+yr.constants.PRIVATE_KEY_BYTE_LENGTH);var n=new mr(yr.constants.SIGN_BYTE_LENGTH+t.length);!function(e,t,r,n){var i,a,o=new Float64Array(64),s=[zr(),zr(),zr(),zr()],c=Ar(n,32);for(c[0]&=248,c[31]&=127,c[31]|=64,i=0;i<r;++i)e[64+i]=t[i];for(i=0;i<32;++i)e[32+i]=c[32+i];var u=Ar(e.subarray(32),r+32);for(_r(u),Mr(s,u),Rr(e,s),i=32;i<64;++i)e[i]=n[i];var l=Ar(e,r+64);for(_r(l),i=32;i<64;++i)o[i]=0;for(i=0;i<32;++i)o[i]=u[i];for(i=0;i<32;++i)for(a=0;a<32;a++)o[i+a]+=l[i]*c[a];Ir(e.subarray(32),o)}(n,t,t.length,r);for(var i=new mr(yr.constants.SIGN_BYTE_LENGTH),a=0;a<i.length;++a)i[a]=n[a];return i},yr.verify=function(e){var t=vr(e=e||{});if(void 0===e.signature)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var r=vr({message:e.signature,encoding:"binary"});if(r.length!==yr.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+yr.constants.SIGN_BYTE_LENGTH);var n=vr({message:e.publicKey,encoding:"binary"});if(n.length!==yr.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+yr.constants.PUBLIC_KEY_BYTE_LENGTH);var i,a=new mr(yr.constants.SIGN_BYTE_LENGTH+t.length),o=new mr(yr.constants.SIGN_BYTE_LENGTH+t.length);for(i=0;i<yr.constants.SIGN_BYTE_LENGTH;++i)a[i]=r[i];for(i=0;i<t.length;++i)a[i+yr.constants.SIGN_BYTE_LENGTH]=t[i];return function(e,t,r,n){var i,a=new mr(32),o=[zr(),zr(),zr(),zr()],s=[zr(),zr(),zr(),zr()];if(r<64)return-1;if(function(e,t){var r=zr(),n=zr(),i=zr(),a=zr(),o=zr(),s=zr(),c=zr();return Vr(e[2],Cr),function(e,t){var r;for(r=0;r<16;++r)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}(e[1],t),Hr(i,e[1]),Qr(a,i,Er),qr(i,i,e[2]),Kr(a,e[2],a),Hr(o,a),Hr(s,o),Qr(c,s,o),Qr(r,c,i),Qr(r,r,a),function(e,t){var r,n=zr();for(r=0;r<16;++r)n[r]=t[r];for(r=250;r>=0;--r)Hr(n,n),1!==r&&Qr(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}(r,r),Qr(r,r,i),Qr(r,r,a),Qr(r,r,a),Qr(e[0],r,a),Hr(n,e[0]),Qr(n,n,a),Or(n,i)&&Qr(e[0],e[0],Tr),Hr(n,e[0]),Qr(n,n,a),Or(n,i)?-1:(Dr(e[0])===t[31]>>7&&qr(e[0],br,e[0]),Qr(e[3],e[0],e[1]),0)}(s,n))return-1;for(i=0;i<r;++i)e[i]=t[i];for(i=0;i<32;++i)e[i+32]=n[i];var c=Ar(e,r);if(_r(c),Ur(o,s,c),Mr(s,t.subarray(32)),xr(o,s),Rr(a,o),r-=64,Lr(t,0,a,0)){for(i=0;i<r;++i)e[i]=0;return-1}for(i=0;i<r;++i)e[i]=t[i+64];return r}(o,a,a.length,n)>=0};var br=zr(),Cr=zr([1]),Er=zr([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),wr=zr([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),kr=zr([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),Sr=zr([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),Br=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),Tr=zr([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Ar(e,t){var r=F.md.sha512.create(),n=new gr(e);r.update(n.getBytes(t),"binary");var i=r.digest().getBytes();if("undefined"!=typeof Buffer)return Buffer.from(i,"binary");for(var a=new mr(yr.constants.HASH_BYTE_LENGTH),o=0;o<64;++o)a[o]=i.charCodeAt(o);return a}function Ir(e,t){var r,n,i,a;for(n=63;n>=32;--n){for(r=0,i=n-32,a=n-12;i<a;++i)t[i]+=r-16*t[n]*Br[i-(n-32)],r=t[i]+128>>8,t[i]-=256*r;t[i]+=r,t[n]=0}for(r=0,i=0;i<32;++i)t[i]+=r-(t[31]>>4)*Br[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;++i)t[i]-=r*Br[i];for(n=0;n<32;++n)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function _r(e){for(var t=new Float64Array(64),r=0;r<64;++r)t[r]=e[r],e[r]=0;Ir(e,t)}function xr(e,t){var r=zr(),n=zr(),i=zr(),a=zr(),o=zr(),s=zr(),c=zr(),u=zr(),l=zr();qr(r,e[1],e[0]),qr(l,t[1],t[0]),Qr(r,r,l),Kr(n,e[0],e[1]),Kr(l,t[0],t[1]),Qr(n,n,l),Qr(i,e[3],t[3]),Qr(i,i,wr),Qr(a,e[2],t[2]),Kr(a,a,a),qr(o,n,r),qr(s,a,i),Kr(c,a,i),Kr(u,n,r),Qr(e[0],o,s),Qr(e[1],u,c),Qr(e[2],c,s),Qr(e[3],o,u)}function Pr(e,t,r){for(var n=0;n<4;++n)Fr(e[n],t[n],r)}function Rr(e,t){var r=zr(),n=zr(),i=zr();!function(e,t){var r,n=zr();for(r=0;r<16;++r)n[r]=t[r];for(r=253;r>=0;--r)Hr(n,n),2!==r&&4!==r&&Qr(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}(i,t[2]),Qr(r,t[0],i),Qr(n,t[1],i),Nr(e,n),e[31]^=Dr(r)<<7}function Nr(e,t){var r,n,i,a=zr(),o=zr();for(r=0;r<16;++r)o[r]=t[r];for(jr(o),jr(o),jr(o),n=0;n<2;++n){for(a[0]=o[0]-65517,r=1;r<15;++r)a[r]=o[r]-65535-(a[r-1]>>16&1),a[r-1]&=65535;a[15]=o[15]-32767-(a[14]>>16&1),i=a[15]>>16&1,a[14]&=65535,Fr(o,a,1-i)}for(r=0;r<16;r++)e[2*r]=255&o[r],e[2*r+1]=o[r]>>8}function Or(e,t){var r=new mr(32),n=new mr(32);return Nr(r,e),Nr(n,t),Lr(r,0,n,0)}function Lr(e,t,r,n){return function(e,t,r,n,i){var a,o=0;for(a=0;a<i;++a)o|=e[t+a]^r[n+a];return(1&o-1>>>8)-1}(e,t,r,n,32)}function Dr(e){var t=new mr(32);return Nr(t,e),1&t[0]}function Ur(e,t,r){var n,i;for(Vr(e[0],br),Vr(e[1],Cr),Vr(e[2],Cr),Vr(e[3],br),i=255;i>=0;--i)Pr(e,t,n=r[i/8|0]>>(7&i)&1),xr(t,e),xr(e,e),Pr(e,t,n)}function Mr(e,t){var r=[zr(),zr(),zr(),zr()];Vr(r[0],kr),Vr(r[1],Sr),Vr(r[2],Cr),Qr(r[3],kr,Sr),Ur(e,r,t)}function Vr(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function jr(e){var t,r,n=1;for(t=0;t<16;++t)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function Fr(e,t,r){for(var n,i=~(r-1),a=0;a<16;++a)n=i&(e[a]^t[a]),e[a]^=n,t[a]^=n}function zr(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;++t)r[t]=e[t];return r}function Kr(e,t,r){for(var n=0;n<16;++n)e[n]=t[n]+r[n]}function qr(e,t,r){for(var n=0;n<16;++n)e[n]=t[n]-r[n]}function Hr(e,t){Qr(e,t,t)}function Qr(e,t,r){var n,i,a=0,o=0,s=0,c=0,u=0,l=0,d=0,f=0,p=0,h=0,g=0,m=0,y=0,v=0,b=0,C=0,E=0,w=0,k=0,S=0,B=0,T=0,A=0,I=0,_=0,x=0,P=0,R=0,N=0,O=0,L=0,D=r[0],U=r[1],M=r[2],V=r[3],j=r[4],F=r[5],z=r[6],K=r[7],q=r[8],H=r[9],Q=r[10],G=r[11],W=r[12],X=r[13],Y=r[14],$=r[15];a+=(n=t[0])*D,o+=n*U,s+=n*M,c+=n*V,u+=n*j,l+=n*F,d+=n*z,f+=n*K,p+=n*q,h+=n*H,g+=n*Q,m+=n*G,y+=n*W,v+=n*X,b+=n*Y,C+=n*$,o+=(n=t[1])*D,s+=n*U,c+=n*M,u+=n*V,l+=n*j,d+=n*F,f+=n*z,p+=n*K,h+=n*q,g+=n*H,m+=n*Q,y+=n*G,v+=n*W,b+=n*X,C+=n*Y,E+=n*$,s+=(n=t[2])*D,c+=n*U,u+=n*M,l+=n*V,d+=n*j,f+=n*F,p+=n*z,h+=n*K,g+=n*q,m+=n*H,y+=n*Q,v+=n*G,b+=n*W,C+=n*X,E+=n*Y,w+=n*$,c+=(n=t[3])*D,u+=n*U,l+=n*M,d+=n*V,f+=n*j,p+=n*F,h+=n*z,g+=n*K,m+=n*q,y+=n*H,v+=n*Q,b+=n*G,C+=n*W,E+=n*X,w+=n*Y,k+=n*$,u+=(n=t[4])*D,l+=n*U,d+=n*M,f+=n*V,p+=n*j,h+=n*F,g+=n*z,m+=n*K,y+=n*q,v+=n*H,b+=n*Q,C+=n*G,E+=n*W,w+=n*X,k+=n*Y,S+=n*$,l+=(n=t[5])*D,d+=n*U,f+=n*M,p+=n*V,h+=n*j,g+=n*F,m+=n*z,y+=n*K,v+=n*q,b+=n*H,C+=n*Q,E+=n*G,w+=n*W,k+=n*X,S+=n*Y,B+=n*$,d+=(n=t[6])*D,f+=n*U,p+=n*M,h+=n*V,g+=n*j,m+=n*F,y+=n*z,v+=n*K,b+=n*q,C+=n*H,E+=n*Q,w+=n*G,k+=n*W,S+=n*X,B+=n*Y,T+=n*$,f+=(n=t[7])*D,p+=n*U,h+=n*M,g+=n*V,m+=n*j,y+=n*F,v+=n*z,b+=n*K,C+=n*q,E+=n*H,w+=n*Q,k+=n*G,S+=n*W,B+=n*X,T+=n*Y,A+=n*$,p+=(n=t[8])*D,h+=n*U,g+=n*M,m+=n*V,y+=n*j,v+=n*F,b+=n*z,C+=n*K,E+=n*q,w+=n*H,k+=n*Q,S+=n*G,B+=n*W,T+=n*X,A+=n*Y,I+=n*$,h+=(n=t[9])*D,g+=n*U,m+=n*M,y+=n*V,v+=n*j,b+=n*F,C+=n*z,E+=n*K,w+=n*q,k+=n*H,S+=n*Q,B+=n*G,T+=n*W,A+=n*X,I+=n*Y,_+=n*$,g+=(n=t[10])*D,m+=n*U,y+=n*M,v+=n*V,b+=n*j,C+=n*F,E+=n*z,w+=n*K,k+=n*q,S+=n*H,B+=n*Q,T+=n*G,A+=n*W,I+=n*X,_+=n*Y,x+=n*$,m+=(n=t[11])*D,y+=n*U,v+=n*M,b+=n*V,C+=n*j,E+=n*F,w+=n*z,k+=n*K,S+=n*q,B+=n*H,T+=n*Q,A+=n*G,I+=n*W,_+=n*X,x+=n*Y,P+=n*$,y+=(n=t[12])*D,v+=n*U,b+=n*M,C+=n*V,E+=n*j,w+=n*F,k+=n*z,S+=n*K,B+=n*q,T+=n*H,A+=n*Q,I+=n*G,_+=n*W,x+=n*X,P+=n*Y,R+=n*$,v+=(n=t[13])*D,b+=n*U,C+=n*M,E+=n*V,w+=n*j,k+=n*F,S+=n*z,B+=n*K,T+=n*q,A+=n*H,I+=n*Q,_+=n*G,x+=n*W,P+=n*X,R+=n*Y,N+=n*$,b+=(n=t[14])*D,C+=n*U,E+=n*M,w+=n*V,k+=n*j,S+=n*F,B+=n*z,T+=n*K,A+=n*q,I+=n*H,_+=n*Q,x+=n*G,P+=n*W,R+=n*X,N+=n*Y,O+=n*$,C+=(n=t[15])*D,o+=38*(w+=n*M),s+=38*(k+=n*V),c+=38*(S+=n*j),u+=38*(B+=n*F),l+=38*(T+=n*z),d+=38*(A+=n*K),f+=38*(I+=n*q),p+=38*(_+=n*H),h+=38*(x+=n*Q),g+=38*(P+=n*G),m+=38*(R+=n*W),y+=38*(N+=n*X),v+=38*(O+=n*Y),b+=38*(L+=n*$),a=(n=(a+=38*(E+=n*U))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),C=(n=C+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=(a+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),C=(n=C+i+65535)-65536*(i=Math.floor(n/65536)),a+=i-1+37*(i-1),e[0]=a,e[1]=o,e[2]=s,e[3]=c,e[4]=u,e[5]=l,e[6]=d,e[7]=f,e[8]=p,e[9]=h,e[10]=g,e[11]=m,e[12]=y,e[13]=v,e[14]=b,e[15]=C}F.kem=F.kem||{};var Gr=F.jsbn.BigInteger;function Wr(e,t,r,n){e.generate=function(e,i){for(var a=new F.util.ByteBuffer,o=Math.ceil(i/n)+r,s=new F.util.ByteBuffer,c=r;c<o;++c){s.putInt32(c),t.start(),t.update(e+s.getBytes());var u=t.digest();a.putBytes(u.getBytes(n))}return a.truncate(a.length()-i),a.getBytes()}}F.kem.rsa={},F.kem.rsa.create=function(e,t){var r=(t=t||{}).prng||F.random;return{encrypt:function(t,n){var i,a=Math.ceil(t.n.bitLength()/8);do{i=new Gr(F.util.bytesToHex(r.getBytesSync(a)),16).mod(t.n)}while(i.compareTo(Gr.ONE)<=0);var o=a-(i=F.util.hexToBytes(i.toString(16))).length;return o>0&&(i=F.util.fillString(String.fromCharCode(0),o)+i),{encapsulation:t.encrypt(i,"NONE"),key:e.generate(i,n)}},decrypt:function(t,r,n){var i=t.decrypt(r,"NONE");return e.generate(i,n)}}},F.kem.kdf1=function(e,t){Wr(this,e,0,t||e.digestLength)},F.kem.kdf2=function(e,t){Wr(this,e,1,t||e.digestLength)},F.log=F.log||{},F.log.levels=["none","error","warning","info","debug","verbose","max"];var Xr={},Yr=[],$r=null;F.log.LEVEL_LOCKED=2,F.log.NO_LEVEL_CHECK=4,F.log.INTERPOLATE=8;for(var Zr=0;Zr<F.log.levels.length;++Zr){var Jr=F.log.levels[Zr];Xr[Jr]={index:Zr,name:Jr.toUpperCase()}}F.log.logMessage=function(e){for(var t=Xr[e.level].index,r=0;r<Yr.length;++r){var n=Yr[r];n.flags&F.log.NO_LEVEL_CHECK?n.f(e):t<=Xr[n.level].index&&n.f(n,e)}},F.log.prepareStandard=function(e){"standard"in e||(e.standard=Xr[e.level].name+" ["+e.category+"] "+e.message)},F.log.prepareFull=function(e){if(!("full"in e)){var t=[e.message];t=t.concat([]||e.arguments),e.full=F.util.format.apply(this,t)}},F.log.prepareStandardFull=function(e){"standardFull"in e||(F.log.prepareStandard(e),e.standardFull=e.standard)};var en=["error","warning","info","debug","verbose"];for(Zr=0;Zr<en.length;++Zr)!function(e){F.log[e]=function(t,r){var n=Array.prototype.slice.call(arguments).slice(2),i={timestamp:new Date,level:e,category:t,message:r,arguments:n};F.log.logMessage(i)}}(en[Zr]);if(F.log.makeLogger=function(e){var t={flags:0,f:e};return F.log.setLevel(t,"none"),t},F.log.setLevel=function(e,t){var r=!1;if(e&&!(e.flags&F.log.LEVEL_LOCKED))for(var n=0;n<F.log.levels.length;++n)if(t==F.log.levels[n]){e.level=t,r=!0;break}return r},F.log.lock=function(e,t){void 0===t||t?e.flags|=F.log.LEVEL_LOCKED:e.flags&=~F.log.LEVEL_LOCKED},F.log.addLogger=function(e){Yr.push(e)},"undefined"!=typeof console&&"log"in console){var tn;if(console.error&&console.warn&&console.info&&console.debug){var rn={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},nn=function(e,t){F.log.prepareStandard(t);var r=rn[t.level],n=[t.standard];n=n.concat(t.arguments.slice()),r.apply(console,n)};tn=F.log.makeLogger(nn)}else nn=function(e,t){F.log.prepareStandardFull(t),console.log(t.standardFull)},tn=F.log.makeLogger(nn);F.log.setLevel(tn,"debug"),F.log.addLogger(tn),$r=tn}else console={log:function(){}};if(null!==$r){var an=F.util.getQueryVariables();"console.level"in an&&F.log.setLevel($r,an["console.level"].slice(-1)[0]),"console.lock"in an&&"true"==an["console.lock"].slice(-1)[0]&&F.log.lock($r)}F.log.consoleLogger=$r,E((function(e){var t=F.asn1,r=e.exports=F.pkcs7=F.pkcs7||{};function n(e){var n={},i=[];if(!t.validate(e,r.asn1.recipientInfoValidator,n,i)){var a=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw a.errors=i,a}return{version:n.version.charCodeAt(0),issuer:F.pki.RDNAttributesAsArray(n.issuer),serialNumber:F.util.createBuffer(n.serial).toHex(),encryptedContent:{algorithm:t.derToOid(n.encAlgorithm),parameter:n.encParameter.value,content:n.encKey}}}function i(e){for(var r,n=[],i=0;i<e.length;++i)n.push((r=e[i],t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(r.version).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[F.pki.distinguishedNameToAsn1({attributes:r.issuer}),t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,F.util.hexToBytes(r.serialNumber))]),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.encryptedContent.algorithm).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")]),t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,r.encryptedContent.content)])));return n}function a(e){var r=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(e.version).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[F.pki.distinguishedNameToAsn1({attributes:e.issuer}),t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,F.util.hexToBytes(e.serialNumber))]),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.digestAlgorithm).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&r.value.push(e.authenticatedAttributesAsn1),r.value.push(t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.signatureAlgorithm).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")])),r.value.push(t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var n=t.create(t.Class.CONTEXT_SPECIFIC,1,!0,[]),i=0;i<e.unauthenticatedAttributes.length;++i){var a=e.unauthenticatedAttributes[i];n.values.push(o(a))}r.value.push(n)}return r}function o(e){var r;if(e.type===F.pki.oids.contentType)r=t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.value).getBytes());else if(e.type===F.pki.oids.messageDigest)r=t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===F.pki.oids.signingTime){var n=new Date("1950-01-01T00:00:00Z"),i=new Date("2050-01-01T00:00:00Z"),a=e.value;if("string"==typeof a){var o=Date.parse(a);a=isNaN(o)?13===a.length?t.utcTimeToDate(a):t.generalizedTimeToDate(a):new Date(o)}r=a>=n&&a<i?t.create(t.Class.UNIVERSAL,t.Type.UTCTIME,!1,t.dateToUtcTime(a)):t.create(t.Class.UNIVERSAL,t.Type.GENERALIZEDTIME,!1,t.dateToGeneralizedTime(a))}return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.type).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[r])])}function s(e,r,n){var i={};if(!t.validate(r,n,i,[])){var a=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw a.errors=a,a}if(t.derToOid(i.contentType)!==F.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(i.encryptedContent){var o="";if(F.util.isArray(i.encryptedContent))for(var s=0;s<i.encryptedContent.length;++s){if(i.encryptedContent[s].type!==t.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");o+=i.encryptedContent[s].value}else o=i.encryptedContent;e.encryptedContent={algorithm:t.derToOid(i.encAlgorithm),parameter:F.util.createBuffer(i.encParameter.value),content:F.util.createBuffer(o)}}if(i.content){if(o="",F.util.isArray(i.content))for(s=0;s<i.content.length;++s){if(i.content[s].type!==t.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");o+=i.content[s].value}else o=i.content;e.content=F.util.createBuffer(o)}return e.version=i.version.charCodeAt(0),e.rawCapture=i,i}function c(e){if(void 0===e.encryptedContent.key)throw new Error("Symmetric key not available.");if(void 0===e.content){var t;switch(e.encryptedContent.algorithm){case F.pki.oids["aes128-CBC"]:case F.pki.oids["aes192-CBC"]:case F.pki.oids["aes256-CBC"]:t=F.aes.createDecryptionCipher(e.encryptedContent.key);break;case F.pki.oids.desCBC:case F.pki.oids["des-EDE3-CBC"]:t=F.des.createDecryptionCipher(e.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+e.encryptedContent.algorithm)}if(t.start(e.encryptedContent.parameter),t.update(e.encryptedContent.content),!t.finish())throw new Error("Symmetric decryption failed.");e.content=t.output}}r.messageFromPem=function(e){var n=F.pem.decode(e)[0];if("PKCS7"!==n.type){var i=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw i.headerType=n.type,i}if(n.procType&&"ENCRYPTED"===n.procType.type)throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var a=t.fromDer(n.body);return r.messageFromAsn1(a)},r.messageToPem=function(e,r){var n={type:"PKCS7",body:t.toDer(e.toAsn1()).getBytes()};return F.pem.encode(n,{maxline:r})},r.messageFromAsn1=function(e){var n={},i=[];if(!t.validate(e,r.asn1.contentInfoValidator,n,i)){var a=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw a.errors=i,a}var o,s=t.derToOid(n.contentType);switch(s){case F.pki.oids.envelopedData:o=r.createEnvelopedData();break;case F.pki.oids.encryptedData:o=r.createEncryptedData();break;case F.pki.oids.signedData:o=r.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+s+" is not (yet) supported.")}return o.fromAsn1(n.content.value[0]),o},r.createSignedData=function(){var e=null;return e={type:F.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(t){if(s(e,t,r.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var n=e.rawCapture.certificates.value,i=0;i<n.length;++i)e.certificates.push(F.pki.certificateFromAsn1(n[i]))},toAsn1:function(){e.contentInfo||e.sign();for(var r=[],n=0;n<e.certificates.length;++n)r.push(F.pki.certificateToAsn1(e.certificates[n]));var i=[],a=t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(e.version).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return r.length>0&&a.value[0].value.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!0,r)),i.length>0&&a.value[0].value.push(t.create(t.Class.CONTEXT_SPECIFIC,1,!0,i)),a.value[0].value.push(t.create(t.Class.UNIVERSAL,t.Type.SET,!0,e.signerInfos)),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.type).getBytes()),a])},addSigner:function(t){var r=t.issuer,n=t.serialNumber;if(t.certificate){var i=t.certificate;"string"==typeof i&&(i=F.pki.certificateFromPem(i)),r=i.issuer.attributes,n=i.serialNumber}var a=t.key;if(!a)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof a&&(a=F.pki.privateKeyFromPem(a));var o=t.digestAlgorithm||F.pki.oids.sha1;switch(o){case F.pki.oids.sha1:case F.pki.oids.sha256:case F.pki.oids.sha384:case F.pki.oids.sha512:case F.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+o)}var s=t.authenticatedAttributes||[];if(s.length>0){for(var c=!1,u=!1,l=0;l<s.length;++l){var d=s[l];if(c||d.type!==F.pki.oids.contentType){if(u||d.type!==F.pki.oids.messageDigest);else if(u=!0,c)break}else if(c=!0,u)break}if(!c||!u)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}e.signers.push({key:a,version:1,issuer:r,serialNumber:n,digestAlgorithm:o,signatureAlgorithm:F.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:s,unauthenticatedAttributes:[]})},sign:function(r){var n;r=r||{},("object"!=typeof e.content||null===e.contentInfo)&&(e.contentInfo=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(F.pki.oids.data).getBytes())]),"content"in e&&(e.content instanceof F.util.ByteBuffer?n=e.content.bytes():"string"==typeof e.content&&(n=F.util.encodeUtf8(e.content)),r.detached?e.detachedContent=t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,n):e.contentInfo.value.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,n)])))),0!==e.signers.length&&function(r){var n;if(!(n=e.detachedContent?e.detachedContent:(n=e.contentInfo.value[1]).value[0]))throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var i=t.derToOid(e.contentInfo.value[0].value),s=t.toDer(n);for(var c in s.getByte(),t.getBerValueLength(s),s=s.getBytes(),r)r[c].start().update(s);for(var u=new Date,l=0;l<e.signers.length;++l){var d=e.signers[l];if(0===d.authenticatedAttributes.length){if(i!==F.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{d.authenticatedAttributesAsn1=t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var f=t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[]),p=0;p<d.authenticatedAttributes.length;++p){var h=d.authenticatedAttributes[p];h.type===F.pki.oids.messageDigest?h.value=r[d.digestAlgorithm].digest():h.type===F.pki.oids.signingTime&&(h.value||(h.value=u)),f.value.push(o(h)),d.authenticatedAttributesAsn1.value.push(o(h))}s=t.toDer(f).getBytes(),d.md.start().update(s)}d.signature=d.key.sign(d.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=function(e){for(var t=[],r=0;r<e.length;++r)t.push(a(e[r]));return t}(e.signers)}(function(){for(var r={},n=0;n<e.signers.length;++n){var i=e.signers[n];(a=i.digestAlgorithm)in r||(r[a]=F.md[F.pki.oids[a]].create()),0===i.authenticatedAttributes.length?i.md=r[a]:i.md=F.md[F.pki.oids[a]].create()}for(var a in e.digestAlgorithmIdentifiers=[],r)e.digestAlgorithmIdentifiers.push(t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(a).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")]));return r}())},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(t){"string"==typeof t&&(t=F.pki.certificateFromPem(t)),e.certificates.push(t)},addCertificateRevokationList:function(e){throw new Error("PKCS#7 CRL support not yet implemented.")}}},r.createEncryptedData=function(){var e=null;return e={type:F.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:F.pki.oids["aes256-CBC"]},fromAsn1:function(t){s(e,t,r.asn1.encryptedDataValidator)},decrypt:function(t){void 0!==t&&(e.encryptedContent.key=t),c(e)}}},r.createEnvelopedData=function(){var e=null;return e={type:F.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:F.pki.oids["aes256-CBC"]},fromAsn1:function(t){var i=s(e,t,r.asn1.envelopedDataValidator);e.recipients=function(e){for(var t=[],r=0;r<e.length;++r)t.push(n(e[r]));return t}(i.recipientInfos.value)},toAsn1:function(){return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.type).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(e.version).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,i(e.recipients)),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,(r=e.encryptedContent,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(F.pki.oids.data).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.algorithm).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,r.parameter.getBytes())]),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,r.content.getBytes())])]))])])]);var r},findRecipient:function(t){for(var r=t.issuer.attributes,n=0;n<e.recipients.length;++n){var i=e.recipients[n],a=i.issuer;if(i.serialNumber===t.serialNumber&&a.length===r.length){for(var o=!0,s=0;s<r.length;++s)if(a[s].type!==r[s].type||a[s].value!==r[s].value){o=!1;break}if(o)return i}}return null},decrypt:function(t,r){if(void 0===e.encryptedContent.key&&void 0!==t&&void 0!==r)switch(t.encryptedContent.algorithm){case F.pki.oids.rsaEncryption:case F.pki.oids.desCBC:var n=r.decrypt(t.encryptedContent.content);e.encryptedContent.key=F.util.createBuffer(n);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}c(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:F.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,r){if(void 0===e.encryptedContent.content){var n,i,a;switch(r=r||e.encryptedContent.algorithm,t=t||e.encryptedContent.key,r){case F.pki.oids["aes128-CBC"]:n=16,i=16,a=F.aes.createEncryptionCipher;break;case F.pki.oids["aes192-CBC"]:n=24,i=16,a=F.aes.createEncryptionCipher;break;case F.pki.oids["aes256-CBC"]:n=32,i=16,a=F.aes.createEncryptionCipher;break;case F.pki.oids["des-EDE3-CBC"]:n=24,i=8,a=F.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+r)}if(void 0===t)t=F.util.createBuffer(F.random.getBytes(n));else if(t.length()!=n)throw new Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+n+".");e.encryptedContent.algorithm=r,e.encryptedContent.key=t,e.encryptedContent.parameter=F.util.createBuffer(F.random.getBytes(i));var o=a(t);if(o.start(e.encryptedContent.parameter.copy()),o.update(e.content),!o.finish())throw new Error("Symmetric encryption failed.");e.encryptedContent.content=o.output}for(var s=0;s<e.recipients.length;++s){var c=e.recipients[s];if(void 0===c.encryptedContent.content)switch(c.encryptedContent.algorithm){case F.pki.oids.rsaEncryption:c.encryptedContent.content=c.encryptedContent.key.encrypt(e.encryptedContent.key.data);break;default:throw new Error("Unsupported asymmetric cipher, OID "+c.encryptedContent.algorithm)}}}}}})),E((function(e){var t=e.exports=F.ssh=F.ssh||{};function r(e,t){var r=t.toString(16);r[0]>="8"&&(r="00"+r);var n=F.util.hexToBytes(r);e.putInt32(n.length),e.putBytes(n)}function n(e,t){e.putInt32(t.length),e.putString(t)}function i(){for(var e=F.md.sha1.create(),t=arguments.length,r=0;r<t;++r)e.update(arguments[r]);return e.digest()}t.privateKeyToPutty=function(e,t,a){var o=""===(t=t||"")?"none":"aes256-cbc",s="PuTTY-User-Key-File-2: ssh-rsa\r\n";s+="Encryption: "+o+"\r\n",s+="Comment: "+(a=a||"")+"\r\n";var c=F.util.createBuffer();n(c,"ssh-rsa"),r(c,e.e),r(c,e.n);var u=F.util.encode64(c.bytes(),64),l=Math.floor(u.length/66)+1;s+="Public-Lines: "+l+"\r\n",s+=u;var d,f=F.util.createBuffer();if(r(f,e.d),r(f,e.p),r(f,e.q),r(f,e.qInv),t){var p=f.length()+16-1;p-=p%16;var h=i(f.bytes());h.truncate(h.length()-p+f.length()),f.putBuffer(h);var g=F.util.createBuffer();g.putBuffer(i("\0\0\0\0",t)),g.putBuffer(i("\0\0\0",t));var m=F.aes.createEncryptionCipher(g.truncate(8),"CBC");m.start(F.util.createBuffer().fillWithByte(0,16)),m.update(f.copy()),m.finish();var y=m.output;y.truncate(16),d=F.util.encode64(y.bytes(),64)}else d=F.util.encode64(f.bytes(),64);s+="\r\nPrivate-Lines: "+(l=Math.floor(d.length/66)+1)+"\r\n",s+=d;var v=i("putty-private-key-file-mac-key",t),b=F.util.createBuffer();n(b,"ssh-rsa"),n(b,o),n(b,a),b.putInt32(c.length()),b.putBuffer(c),b.putInt32(f.length()),b.putBuffer(f);var C=F.hmac.create();return C.start("sha1",v),C.update(b.bytes()),s+"\r\nPrivate-MAC: "+C.digest().toHex()+"\r\n"},t.publicKeyToOpenSSH=function(e,t){t=t||"";var i=F.util.createBuffer();return n(i,"ssh-rsa"),r(i,e.e),r(i,e.n),"ssh-rsa "+F.util.encode64(i.bytes())+" "+t},t.privateKeyToOpenSSH=function(e,t){return t?F.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):F.pki.privateKeyToPem(e)},t.getPublicKeyFingerprint=function(e,t){var i=(t=t||{}).md||F.md.md5.create(),a=F.util.createBuffer();n(a,"ssh-rsa"),r(a,e.e),r(a,e.n),i.start(),i.update(a.getBytes());var o=i.digest();if("hex"===t.encoding){var s=o.toHex();return t.delimiter?s.match(/.{2}/g).join(t.delimiter):s}if("binary"===t.encoding)return o.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".');return o}}));var on="forge.task",sn={},cn=0;F.debug.set(on,"tasks",sn);var un={};F.debug.set(on,"queues",un);var ln="ready",dn="running",fn="blocked",pn="sleeping",hn="done",gn="error",mn={ready:{}};mn.ready.stop=ln,mn.ready.start=dn,mn.ready.cancel=hn,mn.ready.fail=gn,mn.running={},mn.running.stop=ln,mn.running.start=dn,mn.running.block=fn,mn.running.unblock=dn,mn.running.sleep=pn,mn.running.wakeup=dn,mn.running.cancel=hn,mn.running.fail=gn,mn.blocked={},mn.blocked.stop=fn,mn.blocked.start=fn,mn.blocked.block=fn,mn.blocked.unblock=fn,mn.blocked.sleep=fn,mn.blocked.wakeup=fn,mn.blocked.cancel=hn,mn.blocked.fail=gn,mn.sleeping={},mn.sleeping.stop=pn,mn.sleeping.start=pn,mn.sleeping.block=pn,mn.sleeping.unblock=pn,mn.sleeping.sleep=pn,mn.sleeping.wakeup=pn,mn.sleeping.cancel=hn,mn.sleeping.fail=gn,mn.done={},mn.done.stop=hn,mn.done.start=hn,mn.done.block=hn,mn.done.unblock=hn,mn.done.sleep=hn,mn.done.wakeup=hn,mn.done.cancel=hn,mn.done.fail=gn,mn.error={},mn.error.stop=gn,mn.error.start=gn,mn.error.block=gn,mn.error.unblock=gn,mn.error.sleep=gn,mn.error.wakeup=gn,mn.error.cancel=gn,mn.error.fail=gn;var yn=function(e){this.id=-1,this.name=e.name||"?",this.parent=e.parent||null,this.run=e.run,this.subtasks=[],this.error=!1,this.state=ln,this.blocks=0,this.timeoutId=null,this.swapTime=null,this.userData=null,this.id=cn++,sn[this.id]=this};yn.prototype.debug=function(e){e=e||"",F.log.debug(on,e,"[%s][%s] task:",this.id,this.name,this,"subtasks:",this.subtasks.length,"queue:",un)},yn.prototype.next=function(e,t){"function"==typeof e&&(t=e,e=this.name);var r=new yn({run:t,name:e,parent:this});return r.state=dn,r.type=this.type,r.successCallback=this.successCallback||null,r.failureCallback=this.failureCallback||null,this.subtasks.push(r),this},yn.prototype.parallel=function(e,t){return F.util.isArray(e)&&(t=e,e=this.name),this.next(e,(function(r){var n=r;n.block(t.length);for(var i=function(e,r){F.task.start({type:e,run:function(e){t[r](e)},success:function(e){n.unblock()},failure:function(e){n.unblock()}})},a=0;a<t.length;a++)i(e+"__parallel-"+r.id+"-"+a,a)}))},yn.prototype.stop=function(){this.state=mn[this.state].stop},yn.prototype.start=function(){this.error=!1,this.state=mn[this.state].start,this.state===dn&&(this.start=new Date,this.run(this),vn(this,0))},yn.prototype.block=function(e){e=void 0===e?1:e,this.blocks+=e,this.blocks>0&&(this.state=mn[this.state].block)},yn.prototype.unblock=function(e){return e=void 0===e?1:e,this.blocks-=e,0===this.blocks&&this.state!==hn&&(this.state=dn,vn(this,0)),this.blocks},yn.prototype.sleep=function(e){e=void 0===e?0:e,this.state=mn[this.state].sleep;var t=this;this.timeoutId=setTimeout((function(){t.timeoutId=null,t.state=dn,vn(t,0)}),e)},yn.prototype.wait=function(e){e.wait(this)},yn.prototype.wakeup=function(){this.state===pn&&(cancelTimeout(this.timeoutId),this.timeoutId=null,this.state=dn,vn(this,0))},yn.prototype.cancel=function(){this.state=mn[this.state].cancel,this.permitsNeeded=0,null!==this.timeoutId&&(cancelTimeout(this.timeoutId),this.timeoutId=null),this.subtasks=[]},yn.prototype.fail=function(e){if(this.error=!0,bn(this,!0),e)e.error=this.error,e.swapTime=this.swapTime,e.userData=this.userData,vn(e,0);else{if(null!==this.parent){for(var t=this.parent;null!==t.parent;)t.error=this.error,t.swapTime=this.swapTime,t.userData=this.userData,t=t.parent;bn(t,!0)}this.failureCallback&&this.failureCallback(this)}};var vn=function(e,t){var r=t>30||+new Date-e.swapTime>20,n=function(t){if(t++,e.state===dn)if(r&&(e.swapTime=+new Date),e.subtasks.length>0){var n=e.subtasks.shift();n.error=e.error,n.swapTime=e.swapTime,n.userData=e.userData,n.run(n),n.error||vn(n,t)}else bn(e),e.error||null!==e.parent&&(e.parent.error=e.error,e.parent.swapTime=e.swapTime,e.parent.userData=e.userData,vn(e.parent,t))};r?setTimeout(n,0):n(t)},bn=function(e,t){e.state=hn,delete sn[e.id],null===e.parent&&(e.type in un?0===un[e.type].length?F.log.error(on,"[%s][%s] task queue empty [%s]",e.id,e.name,e.type):un[e.type][0]!==e?F.log.error(on,"[%s][%s] task not first in queue [%s]",e.id,e.name,e.type):(un[e.type].shift(),0===un[e.type].length?delete un[e.type]:un[e.type][0].start()):F.log.error(on,"[%s][%s] task queue missing [%s]",e.id,e.name,e.type),t||(e.error&&e.failureCallback?e.failureCallback(e):!e.error&&e.successCallback&&e.successCallback(e)))};F.task=F.task||{},F.task.start=function(e){var t=new yn({run:e.run,name:e.name||"?"});t.type=e.type,t.successCallback=e.success||null,t.failureCallback=e.failure||null,t.type in un?un[e.type].push(t):(un[t.type]=[t],function(e){e.error=!1,e.state=mn[e.state].start,setTimeout((function(){e.state===dn&&(e.swapTime=+new Date,e.run(e),vn(e,0))}),0)}(t))},F.task.cancel=function(e){e in un&&(un[e]=[un[e][0]])},F.task.createCondition=function(){var e={tasks:{},wait:function(t){t.id in e.tasks||(t.block(),e.tasks[t.id]=t)},notify:function(){var t=e.tasks;for(var r in e.tasks={},t)t[r].unblock()}};return e};var Cn=F,En=function(){function e(e){this.secretKey=e}return e.prototype.encrypt=function(e,t){throw new Error("Method not implemented.")},e.prototype.decrypt=function(e,t){return function(e,t,r){void 0===r&&(r=Cn.util.createBuffer(Uint8Array.from([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]).buffer));var n,i,a=Cn.cipher.createDecipher("AES-CBC",t);return a.start({iv:r}),a.update(Cn.util.createBuffer(Cn.util.hexToBytes(e))),i=(n=a.output.data).charCodeAt(n.length-1),n.slice(0,-i)}(e,(r=this.secretKey,n=t.transactionID,""+r.slice(0,16)+n.slice(0,16)));var r,n},e}(),wn=function(){function e(e,t,n,i){void 0===n&&(n="production"),void 0===i&&(i={supportTransaction:!1,enableEncryption:!1}),this.transactionEnabled=i.supportTransaction||!1,this.encryptionEnabled=i.enableEncryption||!1;var a=D(e,t,n,{headers:i.httpHeaders});this.transactionManager=new j(a),this.encryptionService=new En(t),this.compareFaceService=new d(a),this.clientSettingsService=new f(a),this.convertPDFService=new v(a),this.ekycPDFService=new b(a),this.readIDCardService=new r(a),this.requestVerifyIDCardService=new h(a),this.requestVerifyPortraitSerivce=new g(a),this.imagesService=new u(a),this.fileService=new l(a),this.verifyFaceLivenessService=new p(a),this.searchFaceService=new y(a),this.detectIDTamperingService=new m(a),this.httpClient=a}return e.prototype.enableTransaction=function(){this.transactionEnabled=!0},e.prototype.disableTransaction=function(){this.transactionEnabled=!1},e.prototype.enableEncryption=function(){this.encryptionEnabled=!0},e.prototype.disableEncryption=function(){this.encryptionEnabled=!1},e.prototype.compareFaces=function(e,t){return this.compareFaceService.request(e,t)},e.prototype.clientSettings=function(){return this.clientSettingsService.request()},e.prototype.uploadImage=function(e){return this.imagesService.request(e)},e.prototype.uploadFile=function(e){return this.fileService.uploadFile(e)},e.prototype.convertPDF=function(e,t){return this.convertPDFService.request(e,t)},e.prototype.ekycPDF=function(e,t){return this.ekycPDFService.request(e,t)},e.prototype.readIDCard=function(e,t){return this.readIDCardService.request(e,t)},e.prototype.requestVerifyIDCard=function(e,t){return this.requestVerifyIDCardService.request(e,t)},e.prototype.requestVerifyPortrait=function(e,t){return this.requestVerifyPortraitSerivce.request(e,t)},e.prototype.verifyFaceLiveness=function(e,t){return this.verifyFaceLivenessService.request(e,t)},e.prototype.searchFaces=function(e,t){return this.searchFaceService.request(e,t)},e.prototype.deleteFaces=function(e,t){return this.searchFaceService.deleteFaces(e,t)},e.prototype.indexFaces=function(e,t){return this.searchFaceService.indexFaces(e,t)},e.prototype.downloadFaceImage=function(e){return this.searchFaceService.downloadFaceImage(e)},e.prototype.downloadImage=function(e){return this.imagesService.download(e)},e.prototype.updateMetadata=function(e,t){return this.imagesService.updateMetadata(e,t)},e.prototype.detectIDTampering=function(e,t){return this.detectIDTamperingService.request(e,t)},i([M({headerIndex:1}),V(),o("design:type",Function),o("design:paramtypes",[Object,Object]),o("design:returntype",Promise)],e.prototype,"compareFaces",null),i([M({headerIndex:1}),V(),o("design:type",Function),o("design:paramtypes",[Object,Object]),o("design:returntype",Promise)],e.prototype,"convertPDF",null),i([M({headerIndex:1}),V(),o("design:type",Function),o("design:paramtypes",[Object,Object]),o("design:returntype",Promise)],e.prototype,"readIDCard",null),i([M({headerIndex:1}),V(),o("design:type",Function),o("design:paramtypes",[Object,Object]),o("design:returntype",Promise)],e.prototype,"requestVerifyIDCard",null),i([M({headerIndex:1}),V(),o("design:type",Function),o("design:paramtypes",[Object,Object]),o("design:returntype",Promise)],e.prototype,"requestVerifyPortrait",null),i([M({headerIndex:1}),V(),o("design:type",Function),o("design:paramtypes",[Object,Object]),o("design:returntype",Promise)],e.prototype,"verifyFaceLiveness",null),i([M({headerIndex:1}),V(),o("design:type",Function),o("design:paramtypes",[Object,Object]),o("design:returntype",Promise)],e.prototype,"searchFaces",null),i([M({headerIndex:1}),V(),o("design:type",Function),o("design:paramtypes",[Object,Object]),o("design:returntype",Promise)],e.prototype,"deleteFaces",null),i([M({headerIndex:1}),V(),o("design:type",Function),o("design:paramtypes",[Object,Object]),o("design:returntype",Promise)],e.prototype,"indexFaces",null),i([M({headerIndex:1}),V(),o("design:type",Function),o("design:paramtypes",[Object,Object]),o("design:returntype",Promise)],e.prototype,"detectIDTampering",null),e}();e.ReadIDCard=r,e.UploadImage=u,e.UploadFile=l,e.CompareFaces=d,e.ClientSettings=f,e.VerifyFaceLiveness=p,e.RequestVerifyIDCard=h,e.RequestVerifyPortrait=g,e.DetectIDTampering=m,e.SearchFaces=y,e.ConvertPDF=v,e.EkycPDF=b,e.HttpClient=_,e.MockClient=x,e.TVAuthorizer=O,e.createHelpers=function(e,t,r){void 0===r&&(r="production");var n=new O(e,t),i=function(e){switch(e){case"testing":return"https://tv-testing.trustingsocial.com/api";case"staging":return"https://tv-staging.trustingsocial.com/api";case"production":default:return"https://vn-vision.trustingsocial.com/api"}}(r);return new _({authorizer:n,domain:i})},e.createHttpClient=D,e.SimpleTrustVisionAPI=U,e.default=wn,Object.defineProperty(e,"__esModule",{value:!0})}(t,i.default)})),g8=o(h8),m8=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,y8=/^\w*$/;function v8(e,t){if(E3(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!p5(e))||(y8.test(e)||!m8.test(e)||null!=t&&e in Object(t))}var b8=v8,C8=m1(Object,"create"),E8=C8;function w8(){this.__data__=E8?E8(null):{},this.size=0}var k8=w8;function S8(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var B8=S8,T8="__lodash_hash_undefined__",A8=Object.prototype,I8=A8.hasOwnProperty;function _8(e){var t=this.__data__;if(E8){var r=t[e];return r===T8?void 0:r}return I8.call(t,e)?t[e]:void 0}var x8=_8,P8=Object.prototype,R8=P8.hasOwnProperty;function N8(e){var t=this.__data__;return E8?void 0!==t[e]:R8.call(t,e)}var O8=N8,L8="__lodash_hash_undefined__";function D8(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=E8&&void 0===t?L8:t,this}var U8=D8;function M8(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}M8.prototype.clear=k8,M8.prototype.delete=B8,M8.prototype.get=x8,M8.prototype.has=O8,M8.prototype.set=U8;var V8=M8;function j8(){this.__data__=[],this.size=0}var F8=j8;function z8(e,t){for(var r=e.length;r--;)if(w1(e[r][0],t))return r;return-1}var K8=z8,q8=Array.prototype,H8=q8.splice;function Q8(e){var t=this.__data__,r=K8(t,e);return!(r<0)&&(r==t.length-1?t.pop():H8.call(t,r,1),--this.size,!0)}var G8=Q8;function W8(e){var t=this.__data__,r=K8(t,e);return r<0?void 0:t[r][1]}var X8=W8;function Y8(e){return K8(this.__data__,e)>-1}var $8=Y8;function Z8(e,t){var r=this.__data__,n=K8(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var J8=Z8;function e7(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}e7.prototype.clear=F8,e7.prototype.delete=G8,e7.prototype.get=X8,e7.prototype.has=$8,e7.prototype.set=J8;var t7=e7,r7=m1(k0,"Map"),n7=r7;function i7(){this.size=0,this.__data__={hash:new V8,map:new(n7||t7),string:new V8}}var a7=i7;function o7(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}var s7=o7;function c7(e,t){var r=e.__data__;return s7(t)?r["string"==typeof t?"string":"hash"]:r.map}var u7=c7;function l7(e){var t=u7(this,e).delete(e);return this.size-=t?1:0,t}var d7=l7;function f7(e){return u7(this,e).get(e)}var p7=f7;function h7(e){return u7(this,e).has(e)}var g7=h7;function m7(e,t){var r=u7(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var y7=m7;function v7(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}v7.prototype.clear=a7,v7.prototype.delete=d7,v7.prototype.get=p7,v7.prototype.has=g7,v7.prototype.set=y7;var b7=v7,C7="Expected a function";function E7(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(C7);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(E7.Cache||b7),r}E7.Cache=b7;var w7=E7,k7=500;function S7(e){var t=w7(e,(function(e){return r.size===k7&&r.clear(),e})),r=t.cache;return t}var B7=S7,T7=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,A7=/\\(\\)?/g,I7=B7((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(T7,(function(e,r,n,i){t.push(n?i.replace(A7,"$1"):r||e)})),t})),_7=I7;function x7(e,t){return E3(e)?e:b8(e,t)?[e]:_7(C5(e))}var P7=x7,R7=1/0;function N7(e){if("string"==typeof e||p5(e))return e;var t=e+"";return"0"==t&&1/e==-R7?"-0":t}var O7=N7;function L7(e,t){for(var r=0,n=(t=P7(t,e)).length;null!=e&&r<n;)e=e[O7(t[r++])];return r&&r==n?e:void 0}var D7=L7;function U7(e,t,r){var n=null==e?void 0:D7(e,t);return void 0===n?r:n}var M7,V7,j7,F7,z7,K7,q7,H7,Q7=U7;function G7(e){var t=e.className;return SC.createElement("svg",{className:t,width:"320",height:"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg"},SC.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"}))}G7.propTypes={className:SE.string},G7.defaultProps={className:""};var W7=GW.Camera,X7=cY.blink,Y7=cY.slide,$7=cY.splash,Z7=$7.default,J7=qJ.FaceDetectionError,e9=qJ.FaceVerificationInstructions,t9=qJ.FaceVerificationStepsWrapper,r9=qJ.StepItem,n9=qJ.BottomButtonsOverlay,i9=qJ.Button,a9=qJ.CountDownOverlay,o9=qJ.InstructionsOverlay,s9=qJ.CountdownTime,c9=cB(zG)(M7||(M7=Kv(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"]))),u9=cB(G7)(V7||(V7=Kv(["\n width: 100%;\n height: 100%;\n vertical-align: middle;\n margin: 0;\n color: ",";\n"])),(function(e){var t=e.color;return null!=t?t:"rgba(0, 0, 0, 0.6)"})),l9=cB.div(j7||(j7=Kv(["\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"]))),d9=cB(e9)(F7||(F7=Kv(["\n font-size: 20px;\n"]))),f9=cB(o9)(z7||(z7=Kv(["\n ",";\n ",";\n"])),Y7.default,X7.default),p9=cB(s9)(K7||(K7=Kv(["\n background-color: unset;\n color: #ffffff;\n font-size: 20px;\n"]))),h9=v0.isMobile?{width:640}:null,g9={background:"#000000",opacity:.6};function m9(e){return new Promise((function(t){var r=new Image;r.onload=t,r.onerror=t,r.src=e}))}function y9(e){var t=e.apiCheck,r=e.mode,n=e.onLivenessDetectionDone,i=e.onClose,a=e.onError,o=e.captureFrameSettings,s=e.onFramesCaptured,c=e.frontCamera,u=e.customStepTimeConstraints,l=e.onProcessing,d=e.customErrors,f=e.customMessages,p=e.livenessSettings,h=e.customInstructions,g=e.apiCredentials,m=d_.useAsset("bg_camera_mask.png"),y=d_.useAsset("bg_camera_mask_red.png"),v=qv(SC.useState({}),2),b=v[0],C=v[1],E=b.yFaceVerificationStepsWrapper,w=qv(SC.useState(""),2),k=w[0],S=w[1],B=qv(SC.useState(!1),2),T=B[0],A=B[1],I=SC.useCallback((function(e){var t=e.lostY,r=e.height,n=t+25,i=n+30;return C({yFaceDetectionError:n,yFaceVerificationStepsWrapper:i+r+20}),{y:Math.floor(i)}}),[]),_=KJ({apiCheck:t,mode:r,bgCameraMask:m,bgCameraMaskRed:y,surroundStyle:g9,onLivenessDetectionDone:n,onError:a,cropAreaDimension:I,captureFrameSettings:o,onFramesCaptured:s,livenessSettings:p,setRemainingTime:S,customStepTimeConstraints:u,onProcessing:l,customErrors:d,customMessages:f,customInstructions:h,apiCredentials:g}),x=_.countdownToTakePicture,P=_.cropArea,R=_.curStepIndex,N=_.directionIcon,O=_.faceDetectionError,L=_.handleTriggerPassiveMode,D=_.handleVideoPlayed,U=_.instructions,M=_.isActiveMode,V=_.refVideo,j=_.showCountdown,F=_.steps,z=_.videoPlayed,K=_.directionIconAnimation,q=_.isFirstValidFrameFound,H=_.warmupDone;SC.useEffect((function(){Promise.all(F.map((function(e){return m9(e.directionIcon)}))).then((function(){return A(!0)}))}),[F]);var Q=SC.useRef(!1);return SC.useEffect((function(){q||(Q.current=!1)}),[q]),O&&"liveness_terminated_time_out"===O.code&&(Q.current=!0),SC.createElement(zK,{frontCamera:c,onVideoPlayed:D,onClose:i,flipHorizontal:c,ref:V,videoSettings:h9,onError:a},!H&&SC.createElement(EW,null),z&&T?SC.createElement(SC.Fragment,null,SC.createElement(Z7,{keyForTransition:R}),SC.createElement(J7,{top:E,className:"face-detection-error",error:O}),k&&SC.createElement(p9,{top:P.current.y-20},k),P.current?SC.createElement(WK,{x:"".concat(P.current.x,"px"),y:"".concat(P.current.y,"px"),width:"".concat(P.current.width,"px"),height:"".concat(P.current.height,"px"),surroundStyle:P.current.surroundStyle},SC.createElement(u9,null),SC.createElement(c9,{progress:R/F.length*100,hasError:!!O,showDashedRing:!1,showOutsideRing:!1,insideRingWidth:1,errorRingWidth:2,insideRingStrokeDash:"none"}),j?SC.createElement(a9,null,x):null,M?SC.createElement(f9,null,N?SC.createElement("img",{className:K,src:N,alt:"",style:{maxWidth:"98px",maxHeight:"98px",marginBottom:"25px"}}):null):null,O&&SC.createElement(l9,null)):null,M?SC.createElement(SC.Fragment,null,U?SC.createElement(d9,{top:E-30,className:"instructions"},U):null,q&&!Q.current&&SC.createElement(t9,{top:E+35},F.map((function(e,t){var r=e.name,n=e.image.objUrl;return SC.createElement(r9,{key:r,active:R>=t,className:"step-item"},n?SC.createElement("img",{src:n,alt:""}):SC.createElement("span",null,t+1))})))):SC.createElement(SC.Fragment,null,O?null:SC.createElement(n9,null,SC.createElement(i9,{onClick:L},SC.createElement(W7,null))))):null)}y9.propTypes={apiCheck:SE.bool,mode:SE.string,onLivenessDetectionDone:SE.func,onClose:SE.func,onError:SE.func,captureFrameSettings:SE.shape({}),onFramesCaptured:SE.func,frontCamera:SE.bool,customStepTimeConstraints:SE.shape({}),onProcessing:SE.func,customErrors:SE.shape({}),customMessages:SE.shape({}),livenessSettings:SE.shape({}),customInstructions:SE.shape({}),apiCredentials:SE.shape({accessKey:SE.string,secretKey:SE.string,apiUrl:SE.string})},y9.defaultProps={apiCheck:!1,mode:null,onLivenessDetectionDone:null,onClose:null,onError:function(){},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},onFramesCaptured:function(){},frontCamera:!0,customStepTimeConstraints:(q7={},Ov(q7,hB.FaceDirection.UP,{delayTime:0}),Ov(q7,hB.FaceDirection.LEFT,{delayTime:0}),Ov(q7,hB.FaceDirection.RIGHT,{delayTime:0}),Ov(q7,hB.FaceDirection.FRONTAL,{delayTime:2e3}),q7),onProcessing:function(){},customErrors:{no_face:{code:"no_face",msg:{en:"Face is not detected.",vi:"Không nhận diện được khuôn mặt."}},multiple_faces:{code:"multiple_faces",msg:{en:"There are more than one face in the frame",vi:"Nhiều khuôn mặt xuất hiện trong khung hình"}},face_too_small:{code:"face_too_small",msg:{en:"The face is too small",vi:"Khuôn mặt quá nhỏ"}},face_too_large:{code:"face_too_large",msg:{en:"The face is too big",vi:"Khuôn mặt quá lớn"}},face_out_of_box:{code:"face_out_of_box",msg:{en:"Face is out of box",vi:"Khuôn mặt nằm ngoài khung ảnh"}},liveness_terminated_time_out:{code:"liveness_terminated_time_out",msg:{en:"The face verification need to be completed in <%= x %> seconds.\nPlease try again.",vi:"Xác thực khuôn mặt cần thực hiện trong <%= x %> giây.\nVui lòng thử lại."}}},customMessages:{REMAIN_TIME:{en:"Remaining time: <%= x %> seconds",vi:"Kết thúc sau <%= x %>"}},customInstructions:(H7={},Ov(H7,hB.FaceDirection.LEFT,{en:"Please turn to the left",vi:"Vui lòng quay trái"}),Ov(H7,hB.FaceDirection.RIGHT,{en:"Please turn to the right",vi:"Vui lòng quay phải"}),Ov(H7,hB.FaceDirection.UP,{en:"Please look up",vi:"Vui lòng nhìn lên"}),Ov(H7,hB.FaceDirection.FRONTAL,{en:"Please look straight to camera",vi:"Vui lòng nhìn thẳng vào camera"}),H7),livenessSettings:{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,limit_time_liveness_check:{enable:!0,limit_time_second:45,remain_time_show:15,format:"mm:ss"},terminate_if_no_face:{enable:!1,max_invalid_frame:5,max_time_ms:1e3}},apiCredentials:{accessKey:"5767c20d-87aa-4cad-8dbb-f5429f76c34b",secretKey:"c1446919-e60a-4575-a05d-304318212a1b",apiUrl:"https://tv-testing.trustingsocial.com/api"}};var v9,b9=["tracking","clientSettings","livenessSettings"],C9=hB.Errors,E9=cB.div(v9||(v9=Kv(["\n text-align: center;\n font-size: 20px;\n font-weight: 600;\n"])));function w9(e){var t=e.tracking,r=void 0===t?{enable:!0}:t,n=e.clientSettings,i=e.livenessSettings,a=zv(e,b9),o=vB.useSDKSettings().lang,s=C9.wrong_orientation.msg[o],c=XW().curOrientation,u=Q7(n,"data.settings.sdk_settings.active_liveness_settings",i),l=Q7(n,"data.settings.sdk_settings.server_log_settings.enable",r.enable);return SC.createElement(SC.Fragment,null,c===WW.LANDSCAPE&&SC.createElement(rW,{open:!0},SC.createElement(E9,null,s)),(c===WW.PORTRAIT||c===WW.DESKTOP)&&SC.createElement(c_.SDKTrackingProvider,{value:{tracking:Uv(Uv({},r),{},{enable:l})}},SC.createElement(y9,Lv({},a,{livenessSettings:u}))))}var k9=["tracking","clientSettings"];function S9(e){var t=e.tracking,r=e.clientSettings,n=zv(e,k9),i=SC.useMemo((function(){return Q7(r,"data.settings.sdk_settings.server_log_settings.enable",null==t?void 0:t.enable)}),[r,t]);return SC.createElement(c_.SDKTrackingProvider,{value:{tracking:Uv(Uv({},t),{},{enable:i})}},SC.createElement(d8,Lv({},n,{clientSettings:r})))}S9.propTypes={tracking:SE.shape({}),clientSettings:SE.shape({})},S9.defaultProps={tracking:void 0,clientSettings:void 0};var B9=hB.Errors,T9=function(e){var t=e.onClose,r=e.onError,n=e.detectIdCard,i=e.steps,a=e.onStepDone,o=e.apiCredentials,s=e.tracking,c=qv(SC.useState(null),2),u=c[0],l=c[1],d=kP.useApiClient({apiCredentials:o,tracking:s}).apiClient,f=SC.useRef(""),p=SC.useRef("");SC.useEffect((function(){function e(){return(e=xv(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.clientSettings();case 2:t=e.sent,l(t);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[d]);var h=SC.useCallback(function(){var e=xv(regeneratorRuntime.mark((function e(t){var n,o,s,c,u,l,h,g;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.stepNumber,o=t.recordedVideos,s=t.qrScannedResult,c=t.image,u=i[n],l=u.cardType,h=u.cardSide,g=null,e.prev=3,e.next=6,UJ({image:c,cardSide:h,frontCardId:f.current,qrImageId:p.current,onError:r,apiClient:d,cardType:l,recordedVideos:o,qrScannedResult:s});case 6:g=e.sent,h===hB.IDCardSide.FRONT&&(f.current=g.cardInfo.image1.id),p.current=g.qrImageId,e.next=14;break;case 11:e.prev=11,e.t0=e.catch(3),r(Uv(Uv({},B9.api_call_error),{},{details:e.t0}));case 14:g&&a(Uv(Uv({},t),{},{apiResult:g}));case 15:case"end":return e.stop()}}),e,null,[[3,11]])})));return function(t){return e.apply(this,arguments)}}(),[d,r,i,a]);return u&&SC.createElement(S9,{tracking:s,onClose:t,onError:r,clientSettings:u,detectIdCard:n,onStepDone:h,steps:i})};T9.propTypes={onClose:SE.func,onError:SE.func,detectIdCard:SE.func,onStepDone:SE.func,steps:SE.arrayOf(SE.shape({})),apiCredentials:SE.shape({accessKey:SE.string,secretKey:SE.string,apiUrl:SE.string}),tracking:SE.shape({})},T9.defaultProps={onClose:function(){},onError:function(){},detectIdCard:function(){return Promise.resolve({card_label:""})},onStepDone:function(){},steps:l8,apiCredentials:{accessKey:"5767c20d-87aa-4cad-8dbb-f5429f76c34b",secretKey:"c1446919-e60a-4575-a05d-304318212a1b",apiUrl:"https://tv-testing.trustingsocial.com/api"},tracking:void 0};var A9=["apiCheck","mode","accessKey","secretKey","apiUrl","onLivenessDetectionDone","onError"],I9="https://unpkg.com/@tsocial/tvweb-sdk@latest/assets",_9=KI.getUAMetadata(),x9=function(){function e(t){var r=this,n=t.container,i=t.lang,a=void 0===i?"en":i,o=t.assetRoot,s=void 0===o?I9:o,c=t.customUrls,u=void 0===c?{}:c,l=t.enableAntiDebug,d=void 0===l||l;Pv(this,e),Ov(this,"checkCamera",KW),Ov(this,"initNativeCamera",(function(e){var t=document.createElement("div");document.body.appendChild(t);var r=SC.createRef();return zz.render(SC.createElement(HW,Lv({},e,{ref:r})),t),{openCamera:function(){r.current.click()}}})),Ov(this,"runWarmUpReadIDCard",xv(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.commonSettings.customUrls,e.abrupt("return",a$(t));case 2:case"end":return e.stop()}}),e)})))),Ov(this,"destroyView",(function(){zz.unmountComponentAtNode(r.container)})),p8(n,"container is a required parameter"),this.container=n,this.commonSettings={lang:a,assetRoot:s,customUrls:u,enableAntiDebug:d,debug:!1}}return Nv(e,[{key:"readIDCardWithApiCall",value:function(e){zz.render(SC.createElement(vB.SDKSettingsProvider,{value:Uv({},this.commonSettings)},SC.createElement(T9,Lv({onClose:this.destroyView},e))),this.container)}},{key:"readIDCardUIOnly",value:function(e){zz.render(SC.createElement(vB.SDKSettingsProvider,{value:this.commonSettings},SC.createElement(S9,Lv({onClose:this.destroyView},e))),this.container)}},{key:"livenessDetection",value:function(e){var t=e.apiCheck,r=e.mode,n=(e.accessKey,e.secretKey,e.apiUrl,e.onLivenessDetectionDone),i=e.onError,a=zv(e,A9);zz.render(SC.createElement(vB.SDKSettingsProvider,{value:Uv({},this.commonSettings)},SC.createElement(w9,Lv({},a,{apiCheck:t,mode:r,onLivenessDetectionDone:n,onClose:this.destroyView,onError:i}))),this.container)}},{key:"compareFaces",value:function(e){var t=e.accessKey,r=e.secretKey,n=e.apiUrl,i=e.image1,a=e.image2,o=e.onSuccess,s=e.onError;kP.createRetryAPIClient(new g8(t,r,n,{httpHeaders:_9})).compareFaces({image1:{id:i},image2:{id:a}}).then((function(e){o(e)})).catch((function(e){s(e)}))}}]),e}();t.APIUtils=kP,t.Animations=cY,t.AntiDebugUtils=GP,t.AssetUtils=d_,t.AsyncUtils=p_,t.BASE_Z_INDEX=kK,t.BlurUtils=U_,t.Button=_$,t.ButtonLink=x$,t.Camera=zK,t.CameraUtils=V_,t.CommonUtils=F_,t.Constants=hB,t.CoordinateUtils=Q_,t.CropAreaOverlayWrapper=WK,t.CryptoUtils=YP,t.FaceUtils=ex,t.GlareUtils=pP,t.HashUtils=JI,t.HighlightResult=LZ,t.HighlightResultType=IZ,t.Icons=GW,t.ImageUtils=uP,t.LivenessDetection=JW,t.LivenessDetectionComponents=qJ,t.LoadResourceUtils=PP,t.LocalStorageUtils=XI,t.MobileDetect=CK,t.ModelUtils=QP,t.NativeCamera=HW,t.OrientationMode=WW,t.PlacementArea=GK,t.Popup=rW,t.PredictionUtils=ix,t.ProgressCircle=zG,t.RatioWrapper=W$,t.ReadIDCardUIOnly=SJ,t.ReadIDCardWithApiCall=FJ,t.RectangleMask=wX,t.RectangleMaskType=EX,t.SDK=x9,t.ScannerType=bJ,t.SettingsContext=vB,t.Spacing=w$,t.ThemeUtils=WP,t.TimeUtils=QI,t.TrackingContext=c_,t.UserAgentUtils=KI,t.WarmupPopup=EW,t.checkCamera=KW,t.defaultClientSettings=pJ,t.defaultReadIDCardSteps=l8,t.getQrScannerWorkerPath=$P,t.handleApiCheckReadIdCard=UJ,t.readIdCardFromImage=zJ,t.readQRCodeFromImage=CZ,t.useDetectOrientation=XW,t.useLivenessDetection=KJ,t.useMainProcessQRCodeScanner=EZ,t.useMainProcessReadIdCard=f$,t.useSettingsReadIdCard=hJ,t.useShowPopup=_Y,t.warmUpQRCodeScanner=oZ,t.warmUpReadIdCard=a$,Object.defineProperty(t,"__esModule",{value:!0})}));
|