Estonian-ID-card-mobile-aut.../demoBackend/src/demo-website/dist/js/app.c2a68e49.js

4 lines
114 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(function(e){function t(t){for(var r,a,s=t[0],u=t[1],c=t[2],l=0,f=[];l<s.length;l++)a=s[l],Object.prototype.hasOwnProperty.call(i,a)&&i[a]&&f.push(i[a][0]),i[a]=0;for(r in u)Object.prototype.hasOwnProperty.call(u,r)&&(e[r]=u[r]);h&&h(t);while(f.length)f.shift()();return o.push.apply(o,c||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,s=1;s<n.length;s++){var u=n[s];0!==i[u]&&(r=!1)}r&&(o.splice(t--,1),e=a(a.s=n[0]))}return e}var r={},i={app:0},o=[];function a(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=r,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="/";var s=window["webpackJsonp"]=window["webpackJsonp"]||[],u=s.push.bind(s);s.push=t,s=s.slice();for(var c=0;c<s.length;c++)t(s[c]);var h=u;o.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("56d7")},"25c9":function(e,t,n){},"3dcc":function(e,t,n){},"56d7":function(e,t,n){"use strict";n.r(t);n("e260"),n("e6cf"),n("cca6"),n("a79d"),n("d3b7");var r=n("7a23");function i(e,t){var n=Object(r["J"])("router-view");return Object(r["B"])(),Object(r["g"])(n)}n("b6b4");var o=n("6b0d"),a=n.n(o);const s={},u=a()(s,[["render",i]]);var c=u,h=n("5502"),l=n("b80d"),f=n("0e44"),d=n("032f"),p=(n("f9e3"),n("1a26"),n("6c02"));function g(e,t,n,i,o,a){var s=Object(r["J"])("Navbar"),u=Object(r["J"])("LoginComponent");return Object(r["B"])(),Object(r["i"])(r["b"],null,[Object(r["l"])(s),Object(r["l"])(u)],64)}var v=function(e){return Object(r["E"])("data-v-2dcb24ca"),e=e(),Object(r["C"])(),e},m={class:"container container-md d-flex flex-column"},b=v((function(){return Object(r["j"])("div",null,[Object(r["j"])("h3",{class:"text-center"},"Welcome to Estonian ID card mobile authentication demo website. When using an Android mobile phone, you can log in to the website using your ID card by using the button below."),Object(r["j"])("p",{class:"text-center"},[Object(r["k"])("Read more from "),Object(r["j"])("a",{href:"https://github.com/TanelOrumaa/Estonian-ID-card-mobile-authenticator-POC"},"here.")])],-1)})),E=v((function(){return Object(r["j"])("div",{id:"canvas"},null,-1)})),y={class:"justify-content-center d-flex"},w={key:0,class:"d-flex justify-content-center"},_=v((function(){return Object(r["j"])("div",{class:"spinner-border text-light spinner-border-sm",role:"status"},[Object(r["j"])("span",{class:"visually-hidden"},"Loading...")],-1)})),R=[_],O={key:1},A={class:"btn-group-sm d-flex justify-content-center",role:"group","aria-label":"Basic radio toggle button group"},I=v((function(){return Object(r["j"])("label",{class:"btn btn-outline-secondary",for:"btnCardReader"},"using ID-card reader",-1)})),T=v((function(){return Object(r["j"])("label",{class:"btn btn-outline-secondary",for:"btnApp"},"using Android App",-1)}));function S(e,t,n,i,o,a){return Object(r["B"])(),Object(r["i"])("div",m,[b,E,Object(r["j"])("div",y,[Object(r["j"])("button",{type:"button",class:"btn loginButton btn-dark",onClick:t[0]||(t[0]=function(){return a.authenticate&&a.authenticate.apply(a,arguments)})},[a.loading?(Object(r["B"])(),Object(r["i"])("div",w,R)):(Object(r["B"])(),Object(r["i"])("span",O,"Authenticate"))])]),Object(r["j"])("div",A,[Object(r["j"])("input",{type:"radio",class:"btn-check",name:"btnradio",id:"btnCardReader",autocomplete:"off",onClick:t[1]||(t[1]=function(){return a.useCardReader&&a.useCardReader.apply(a,arguments)})}),I,Object(r["j"])("input",{type:"radio",class:"btn-check",name:"btnradio",id:"btnApp",autocomplete:"off",checked:"",onClick:t[2]||(t[2]=function(){return a.useApp&&a.useApp.apply(a,arguments)})}),T])])}var j=n("1da1"),C=(n("96cf"),n("a3f2")),N={name:"LoginComponent",props:{csrftoken:String,csrfHeaderName:String},data:function(){return{useAndroidApp:!0,loading:!1}},methods:{useApp:function(){this.useAndroidApp=!0},useCardReader:function(){this.useAndroidApp=!1},authenticate:function(){var e=Object(j["a"])(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.loading=!0,t={getAuthChallengeUrl:window.location.origin+"/auth/challenge",postAuthTokenUrl:window.location.origin+"/auth/login",getAuthSuccessUrl:window.location.origin+"/auth/login",useAuthApp:this.useAndroidApp,headers:{sessionId:this.$store.getters.getSessionId}},console.log(t),e.prev=3,e.next=6,C["a"](t);case 6:return n=e.sent,console.log("Authentication successful! Response:",n),this.loading=!1,this.$store.commit("setLoggedIn",!0),e.next=12,oe.push("welcome");case 12:e.next=20;break;case 14:throw e.prev=14,e.t0=e["catch"](3),console.log("Authentication failed! Error:",e.t0),alert(e.t0.message),this.loading=!1,e.t0;case 20:case"end":return e.stop()}}),e,this,[[3,14]])})));function t(){return e.apply(this,arguments)}return t}()},computed:{isLoggedIn:function(){return this.$store.getAuthenticated},loading:function(){return this.loading}}};n("7a11");const k=a()(N,[["render",S],["__scopeId","data-v-2dcb24ca"]]);var L=k,U=function(e){return Object(r["E"])("data-v-21165a6a"),e=e(),Object(r["C"])(),e},M={class:"navbar navbar-dark bg-dark container-fluid flex-row"},D=U((function(){return Object(r["j"])("div",{class:""},[Object(r["j"])("span",{class:"navbar-brand mb-0 h1"},"Mobile authentication demo")],-1)})),B={key:0,class:"nav-item"};function P(e,t,n,i,o,a){return Object(r["B"])(),Object(r["i"])("nav",M,[D,a.isLoggedIn?(Object(r["B"])(),Object(r["i"])("div",B,[Object(r["j"])("button",{type:"button",class:"btn btn-light",onClick:t[0]||(t[0]=function(){return a.logOut&&a.logOut.apply(a,arguments)})},"Log out")])):Object(r["h"])("",!0)])}n("e9c4");var x={name:"Navbar",computed:{isLoggedIn:function(){return this.$store.getters.getAuthenticated}},methods:{logOut:function(){var e=this,t={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:this.$store.getters.getSessionId})};fetch("/auth/logout",t).then((function(t){console.log(t),e.$store.commit("setLoggedIn",!1),oe.push("/")}))}},mounted:function(){if(null==this.$store.getters.getSessionId){var e=this.$cookie.getCookie("JSESSIONID");this.$store.dispatch("fetchSessionId",e)}}};n("a848");const W=a()(x,[["render",P],["__scopeId","data-v-21165a6a"]]);var z=W,H={name:"Login",components:{LoginComponent:L,Navbar:z},methods:{csrf_token:function(){return"csrf-token"}}};const F=a()(H,[["render",g]]);var q=F;function V(e,t,n,i,o,a){var s=Object(r["J"])("Navbar"),u=Object(r["J"])("WelcomeComponent");return Object(r["B"])(),Object(r["i"])(r["b"],null,[Object(r["l"])(s),Object(r["l"])(u)],64)}var Y=function(e){return Object(r["E"])("data-v-cd8fea1a"),e=e(),Object(r["C"])(),e},G={class:"container container-md d-flex flex-column"},K=Y((function(){return Object(r["j"])("div",null,[Object(r["j"])("h3",{class:"text-center"},"Congratulations, you logged into the site. Log out to try again."),Object(r["j"])("p",{class:"text-center"},[Object(r["k"])("Read more from "),Object(r["j"])("a",{href:"https://github.com/TanelOrumaa/Estonian-ID-card-mobile-authenticator-POC"},"here.")])],-1)})),$=[K];function X(e,t,n,i,o,a){return Object(r["B"])(),Object(r["i"])("div",G,$)}var J={name:"WelcomeComponent",props:{csrftoken:String},computed:{isLoggedIn:function(){return this.$store.getters.getAuthenticated}}};n("9a5c");const Z=a()(J,[["render",X],["__scopeId","data-v-cd8fea1a"]]);var Q=Z,ee={name:"Welcome",components:{WelcomeComponent:Q,Navbar:z},methods:{csrf_token:function(){return"csrf-token"}}};const te=a()(ee,[["render",V]]);var ne=te,re=[{path:"/",name:"Login",component:q,meta:{requiresAuth:!1}},{path:"/welcome",name:"Welcome",component:ne,meta:{requiresAuth:!0}}],ie=Object(p["a"])({history:Object(p["b"])("/"),routes:re}),oe=ie,ae=Object(h["a"])({state:function(){return{authenticated:!1,jSessionId:null}},mutations:{setLoggedIn:function(e,t){e.authenticated=t},setSessionId:function(e,t){e.jSessionId=t}},actions:{fetchSessionId:function(e,t){e.commit("setSessionId",t)}},getters:{getAuthenticated:function(e){return e.authenticated},getSessionId:function(e){return e.jSessionId}},plugins:[Object(f["a"])()]});oe.beforeEach((function(e,t,n){e.matched.some((function(e){return e.meta.requiresAuth}))?ae.state.authenticated?n():n({name:"Login"}):n()}));var se=Object(r["f"])(c);se.use(l["a"]),se.use(oe),se.use(ae),se.use(d["a"]),se.mount("#app"),d["a"].config({expire:"7d"})},"7a11":function(e,t,n){"use strict";n("3dcc")},"9a5c":function(e,t,n){"use strict";n("df0f")},a3f2:function(e,t,n){"use strict";(function(e,r,i){n.d(t,"a",(function(){return xo}));var o,a,s,u,c,h=n("5530"),l=n("1da1"),f=n("53ca"),d=n("b85c"),p=n("bee2"),g=n("3835"),v=n("ade3"),m=n("8785"),b=n("257e"),E=n("d4ec"),y=n("262e"),w=n("2caf"),_=n("9072"),R=(n("96cf"),n("dca8"),n("b0c0"),n("4fadc"),n("e9c4"),n("99af"),n("a15b"),n("fb6a"),n("ac1f"),n("00b4"),n("d3b7"),n("a434"),n("d81d"),n("159b"),n("c19f"),n("5319"),n("a9e3"),n("4d63"),n("c607"),n("2c3e"),n("25f0"),n("b64b"),n("7039"),n("466d"),n("e439"),n("1276"),n("3410"),n("1bf2"),n("f8c9"),n("5cc6"),n("907a"),n("9a8c"),n("a975"),n("735e"),n("c1ac"),n("d139"),n("3a7b"),n("d5d6"),n("82f8"),n("e91f"),n("60bd"),n("5f96"),n("3280"),n("3fcc"),n("ca91"),n("25a1"),n("cd26"),n("3c5d"),n("2954"),n("649e"),n("219c"),n("170b"),n("b39a"),n("72f7"),n("cb29"),n("caad"),n("2532"),n("bf19"),n("498a"),n("d28b"),n("3ca3"),n("ddb0"),n("a4d3"),n("e01a"),n("841c"),n("2ca0"),n("7db0"),n("4de4"),n("9129"),n("2af1"),Object.freeze({VERSION:"1.0.1",EXTENSION_HANDSHAKE_TIMEOUT:1e3,NATIVE_APP_HANDSHAKE_TIMEOUT:5e3,DEFAULT_USER_INTERACTION_TIMEOUT:12e4,DEFAULT_SERVER_REQUEST_TIMEOUT:2e4,AUTH_APP_INTENT_URL_BASE:"authapp://start/"}));(function(e){e["ERR_WEBEID_ACTION_TIMEOUT"]="ERR_WEBEID_ACTION_TIMEOUT",e["ERR_WEBEID_USER_TIMEOUT"]="ERR_WEBEID_USER_TIMEOUT",e["ERR_WEBEID_SERVER_TIMEOUT"]="ERR_WEBEID_SERVER_TIMEOUT",e["ERR_WEBEID_VERSION_MISMATCH"]="ERR_WEBEID_VERSION_MISMATCH",e["ERR_WEBEID_VERSION_INVALID"]="ERR_WEBEID_VERSION_INVALID",e["ERR_WEBEID_EXTENSION_UNAVAILABLE"]="ERR_WEBEID_EXTENSION_UNAVAILABLE",e["ERR_WEBEID_NATIVE_UNAVAILABLE"]="ERR_WEBEID_NATIVE_UNAVAILABLE",e["ERR_WEBEID_UNKNOWN_ERROR"]="ERR_WEBEID_UNKNOWN_ERROR",e["AUTH_APP_NOT_INSTALLED"]="AUTH_APP_NOT_INSTALLED",e["ERR_WEBEID_CONTEXT_INSECURE"]="ERR_WEBEID_CONTEXT_INSECURE",e["ERR_WEBEID_PROTOCOL_INSECURE"]="ERR_WEBEID_PROTOCOL_INSECURE",e["ERR_WEBEID_TLS_CONNECTION_BROKEN"]="ERR_WEBEID_TLS_CONNECTION_BROKEN",e["ERR_WEBEID_TLS_CONNECTION_INSECURE"]="ERR_WEBEID_TLS_CONNECTION_INSECURE",e["ERR_WEBEID_TLS_CONNECTION_WEAK"]="ERR_WEBEID_TLS_CONNECTION_WEAK",e["ERR_WEBEID_CERTIFICATE_CHANGED"]="ERR_WEBEID_CERTIFICATE_CHANGED",e["ERR_WEBEID_ORIGIN_MISMATCH"]="ERR_WEBEID_ORIGIN_MISMATCH",e["ERR_WEBEID_SERVER_REJECTED"]="ERR_WEBEID_SERVER_REJECTED",e["ERR_WEBEID_USER_CANCELLED"]="ERR_WEBEID_USER_CANCELLED",e["ERR_WEBEID_NATIVE_INVALID_ARGUMENT"]="ERR_WEBEID_NATIVE_INVALID_ARGUMENT",e["ERR_WEBEID_NATIVE_FATAL"]="ERR_WEBEID_NATIVE_FATAL",e["ERR_WEBEID_ACTION_PENDING"]="ERR_WEBEID_ACTION_PENDING",e["ERR_WEBEID_MISSING_PARAMETER"]="ERR_WEBEID_MISSING_PARAMETER"})(c||(c={}));var O,A=c;(function(e){e["STATUS"]="web-eid:status",e["STATUS_ACK"]="web-eid:status-ack",e["STATUS_SUCCESS"]="web-eid:status-success",e["STATUS_FAILURE"]="web-eid:status-failure",e["AUTHENTICATE"]="web-eid:authenticate",e["AUTHENTICATE_ACK"]="web-eid:authenticate-ack",e["AUTHENTICATE_SUCCESS"]="web-eid:authenticate-success",e["AUTHENTICATE_FAILURE"]="web-eid:authenticate-failure",e["SIGN"]="web-eid:sign",e["SIGN_ACK"]="web-eid:sign-ack",e["SIGN_SUCCESS"]="web-eid:sign-success",e["SIGN_FAILURE"]="web-eid:sign-failure"})(O||(O={}));var I=O,T=function(e){Object(y["a"])(n,e);var t=Object(w["a"])(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"server certificate changed between requests";return Object(E["a"])(this,n),e=t.call(this,r),e.name=e.constructor.name,e.code=A.ERR_WEBEID_CERTIFICATE_CHANGED,e}return n}(Object(_["a"])(Error)),S=function(e){Object(y["a"])(n,e);var t=Object(w["a"])(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"URLs for a single operation require the same origin";return Object(E["a"])(this,n),e=t.call(this,r),e.name=e.constructor.name,e.code=A.ERR_WEBEID_ORIGIN_MISMATCH,e}return n}(Object(_["a"])(Error)),j="https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts",C=function(e){Object(y["a"])(n,e);var t=Object(w["a"])(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Secure context required, see "+j;return Object(E["a"])(this,n),e=t.call(this,r),e.name=e.constructor.name,e.code=A.ERR_WEBEID_CONTEXT_INSECURE,e}return n}(Object(_["a"])(Error)),N=function(e){Object(y["a"])(n,e);var t=Object(w["a"])(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Web-eID extension is not available";return Object(E["a"])(this,n),e=t.call(this,r),e.name=e.constructor.name,e.code=A.ERR_WEBEID_EXTENSION_UNAVAILABLE,e}return n}(Object(_["a"])(Error)),k=function(e){Object(y["a"])(n,e);var t=Object(w["a"])(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"same action for Web-eID browser extension is already pending";return Object(E["a"])(this,n),e=t.call(this,r),e.name=e.constructor.name,e.code=A.ERR_WEBEID_ACTION_PENDING,e}return n}(Object(_["a"])(Error)),L=function(e){Object(y["a"])(n,e);var t=Object(w["a"])(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"native application received an invalid argument";return Object(E["a"])(this,n),e=t.call(this,r),e.name=e.constructor.name,e.code=A.ERR_WEBEID_NATIVE_INVALID_ARGUMENT,e}return n}(Object(_["a"])(Error)),U=function(e){Object(y["a"])(n,e);var t=Object(w["a"])(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"native application terminated with a fatal error";return Object(E["a"])(this,n),e=t.call(this,r),e.name=e.constructor.name,e.code=A.ERR_WEBEID_NATIVE_FATAL,e}return n}(Object(_["a"])(Error)),M=function(e){Object(y["a"])(n,e);var t=Object(w["a"])(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Web-eID native application is not available";return Object(E["a"])(this,n),e=t.call(this,r),e.name=e.constructor.name,e.code=A.ERR_WEBEID_NATIVE_UNAVAILABLE,e}return n}(Object(_["a"])(Error)),D=function(e){Object(y["a"])(n,e);var t=Object(w["a"])(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"server rejected the request";return Object(E["a"])(this,n),e=t.call(this,r),e.name=e.constructor.name,e.code=A.ERR_WEBEID_SERVER_REJECTED,e}return n}(Object(_["a"])(Error)),B=function(e){Object(y["a"])(n,e);var t=Object(w["a"])(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"user failed to respond in time";return Object(E["a"])(this,n),e=t.call(this,r),e.name=e.constructor.name,e.code=A.ERR_WEBEID_USER_TIMEOUT,e}return n}(Object(_["a"])(Error)),P=function(e){Object(y["a"])(n,e);var t=Object(w["a"])(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"request was cancelled by the user";return Object(E["a"])(this,n),e=t.call(this,r),e.name=e.constructor.name,e.code=A.ERR_WEBEID_USER_CANCELLED,e}return n}(Object(_["a"])(Error));function x(e,t){return"Update required for Web-eID ".concat(t)}var W=function(e){Object(y["a"])(n,e);var t=Object(w["a"])(n);function n(e,r,i){var u;if(Object(E["a"])(this,n),e||(i?i.extension&&i.nativeApp?e=x(o||(o=Object(m["a"])(["",""])),"extension and native app"):i.extension?e=x(a||(a=Object(m["a"])(["",""])),"extension"):i.nativeApp&&(e=x(s||(s=Object(m["a"])(["",""])),"native app")):e="requiresUpdate not provided"),u=t.call(this,e),u.name=u.constructor.name,u.code=A.ERR_WEBEID_VERSION_MISMATCH,u.requiresUpdate=i,r){var c=r.library,h=r.extension,l=r.nativeApp;Object.assign(Object(b["a"])(u),{library:c,extension:h,nativeApp:l})}return u}return n}(Object(_["a"])(Error)),z=function(e){Object(y["a"])(n,e);var t=Object(w["a"])(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"TLS connection was broken";return Object(E["a"])(this,n),e=t.call(this,r),e.name=e.constructor.name,e.code=A.ERR_WEBEID_TLS_CONNECTION_BROKEN,e}return n}(Object(_["a"])(Error)),H=function(e){Object(y["a"])(n,e);var t=Object(w["a"])(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"TLS connection was insecure";return Object(E["a"])(this,n),e=t.call(this,r),e.name=e.constructor.name,e.code=A.ERR_WEBEID_TLS_CONNECTION_INSECURE,e}return n}(Object(_["a"])(Error)),F=function(e){Object(y["a"])(n,e);var t=Object(w["a"])(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"TLS connection was weak";return Object(E["a"])(this,n),e=t.call(this,r),e.name=e.constructor.name,e.code=A.ERR_WEBEID_TLS_CONNECTION_WEAK,e}return n}(Object(_["a"])(Error)),q=function(e){Object(y["a"])(n,e);var t=Object(w["a"])(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"HTTPS required";return Object(E["a"])(this,n),e=t.call(this,r),e.name=e.constructor.name,e.code=A.ERR_WEBEID_PROTOCOL_INSECURE,e}return n}(Object(_["a"])(Error)),V=function(e){Object(y["a"])(n,e);var t=Object(w["a"])(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"extension message timeout";return Object(E["a"])(this,n),e=t.call(this,r),e.name=e.constructor.name,e.code=A.ERR_WEBEID_ACTION_TIMEOUT,e}return n}(Object(_["a"])(Error)),Y=function(e){Object(y["a"])(n,e);var t=Object(w["a"])(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"invalid version string";return Object(E["a"])(this,n),e=t.call(this,r),e.name=e.constructor.name,e.code=A.ERR_WEBEID_VERSION_INVALID,e}return n}(Object(_["a"])(Error)),G=function(e){Object(y["a"])(n,e);var t=Object(w["a"])(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"server failed to respond in time";return Object(E["a"])(this,n),e=t.call(this,r),e.name=e.constructor.name,e.code=A.ERR_WEBEID_SERVER_TIMEOUT,e}return n}(Object(_["a"])(Error)),K=function(e){Object(y["a"])(n,e);var t=Object(w["a"])(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"an unknown error occurred";return Object(E["a"])(this,n),e=t.call(this,r),e.name=e.constructor.name,e.code=A.ERR_WEBEID_UNKNOWN_ERROR,e}return n}(Object(_["a"])(Error)),$=(u={},Object(v["a"])(u,A.ERR_WEBEID_ACTION_PENDING,k),Object(v["a"])(u,A.ERR_WEBEID_ACTION_TIMEOUT,V),Object(v["a"])(u,A.ERR_WEBEID_CERTIFICATE_CHANGED,T),Object(v["a"])(u,A.ERR_WEBEID_ORIGIN_MISMATCH,S),Object(v["a"])(u,A.ERR_WEBEID_CONTEXT_INSECURE,C),Object(v["a"])(u,A.ERR_WEBEID_EXTENSION_UNAVAILABLE,N),Object(v["a"])(u,A.ERR_WEBEID_NATIVE_INVALID_ARGUMENT,L),Object(v["a"])(u,A.ERR_WEBEID_NATIVE_FATAL,U),Object(v["a"])(u,A.ERR_WEBEID_NATIVE_UNAVAILABLE,M),Object(v["a"])(u,A.ERR_WEBEID_PROTOCOL_INSECURE,q),Object(v["a"])(u,A.ERR_WEBEID_SERVER_REJECTED,D),Object(v["a"])(u,A.ERR_WEBEID_SERVER_TIMEOUT,G),Object(v["a"])(u,A.ERR_WEBEID_TLS_CONNECTION_BROKEN,z),Object(v["a"])(u,A.ERR_WEBEID_TLS_CONNECTION_INSECURE,H),Object(v["a"])(u,A.ERR_WEBEID_TLS_CONNECTION_WEAK,F),Object(v["a"])(u,A.ERR_WEBEID_USER_CANCELLED,P),Object(v["a"])(u,A.ERR_WEBEID_USER_TIMEOUT,B),Object(v["a"])(u,A.ERR_WEBEID_VERSION_INVALID,Y),Object(v["a"])(u,A.ERR_WEBEID_VERSION_MISMATCH,W),u);function X(e){var t;if("string"==typeof e.code&&e.code in $){var n=$[e.code];t=new n}else t=new K;for(var r=0,i=Object.entries(e);r<i.length;r++){var o=Object(g["a"])(i[r],2),a=o[0],s=o[1];t[a]=s}return t}var J=function(e){Object(y["a"])(n,e);var t=Object(w["a"])(n);function n(e){var r;return Object(E["a"])(this,n),r=t.call(this,e),r.name=r.constructor.name,r.code=A.ERR_WEBEID_MISSING_PARAMETER,r}return n}(Object(_["a"])(Error)),Z=function(){function e(t){Object(E["a"])(this,e),this.action=t.action,t.getAuthChallengeUrl&&(this.getAuthChallengeUrl=t.getAuthChallengeUrl),t.postAuthTokenUrl&&(this.postAuthTokenUrl=t.postAuthTokenUrl),t.headers&&(this.headers=t.headers),t.postPrepareSigningUrl&&(this.postPrepareSigningUrl=t.postPrepareSigningUrl),t.postFinalizeSigningUrl&&(this.postFinalizeSigningUrl=t.postFinalizeSigningUrl),t.applicationName&&(this.applicationName=t.applicationName),t.actionDescription&&(this.actionDescription=t.actionDescription),t.userInteractionTimeout&&(this.userInteractionTimeout=t.userInteractionTimeout),t.serverRequestTimeout&&(this.serverRequestTimeout=t.serverRequestTimeout),t.lang&&(this.lang=t.lang),this.validate()}return Object(p["a"])(e,[{key:"validate",value:function(){if(null==this.action||(null==this.getAuthChallengeUrl||null==this.postAuthTokenUrl)&&(null==this.postFinalizeSigningUrl||null==this.postPrepareSigningUrl))throw new J("Missing parameters for IntentUrl.")}},{key:"toString",value:function(){var e=R.AUTH_APP_INTENT_URL_BASE;return e+='?action="'+this.action+'"',e+=this.getAuthChallengeUrl?'&getAuthChallengeUrl="'+encodeURIComponent(this.getAuthChallengeUrl)+'"':"",e+=this.postAuthTokenUrl?'&postAuthTokenUrl="'+encodeURIComponent(this.postAuthTokenUrl)+'"':"",e+=this.postPrepareSigningUrl?'&postPrepareSigningUrl="'+encodeURIComponent(this.postPrepareSigningUrl)+'"':"",e+=this.postFinalizeSigningUrl?'&postFinalizeSigningUrl="'+encodeURIComponent(this.postFinalizeSigningUrl)+'"':"",e+=this.applicationName?'&applicationName="'+encodeURIComponent(this.applicationName)+'"':"",e+=this.actionDescription?'&actionDescription="'+encodeURIComponent(this.actionDescription)+'"':"",e+=this.headers?'&headers="'+JSON.stringify(this.headers)+'"':"",e+=this.userInteractionTimeout?'&userInteractionTimeout="'+this.userInteractionTimeout+'"':"",e+=this.serverRequestTimeout?'&serverRequestTimeout="'+this.serverRequestTimeout+'"':"",e+=this.lang?'&lang="'+this.lang+'"':"",e}}]),e}(),Q=function(e){Object(y["a"])(n,e);var t=Object(w["a"])(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Authentication app is not installed. Install it from: https://github.com/TanelOrumaa/Estonian-ID-card-mobile-authenticator-POC/tree/main/MobileAuthApp";return Object(E["a"])(this,n),e=t.call(this,r),e.name=e.constructor.name,e.code=A.AUTH_APP_NOT_INSTALLED,e}return n}(Object(_["a"])(Error)),ee=function e(t,n){Object(E["a"])(this,e),this.ordinal=t,this.formatBits=n};ee.LOW=new ee(0,1),ee.MEDIUM=new ee(1,0),ee.QUARTILE=new ee(2,3),ee.HIGH=new ee(3,2);var te=function(){function e(t,n){Object(E["a"])(this,e),this.modeBits=t,this.numBitsCharCount=n}return Object(p["a"])(e,[{key:"numCharCountBits",value:function(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}}]),e}();function ne(e,t,n){if(t<0||t>31||e>>>t!=0)throw"Value out of range";for(var r=t-1;r>=0;r--)n.push(e>>>r&1)}function re(e,t){return 0!=(e>>>t&1)}function ie(e){if(!e)throw"Assertion error"}function oe(e,t,n,r){if(t<0)throw"Border must be non-negative";for(var i=[],o=0;o<e.size;o++)for(var a=0;a<e.size;a++)e.getModule(a,o)&&i.push("M".concat(a+t,",").concat(o+t,"h1v1h-1z"));return'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '.concat(e.size+2*t," ").concat(e.size+2*t,'" stroke="none">\n\t<rect width="100%" height="100%" fill="').concat(n,'"/>\n\t<path d="').concat(i.join(" "),'" fill="').concat(r,'"/>\n</svg>')}te.NUMERIC=new te(1,[10,12,14]),te.ALPHANUMERIC=new te(2,[9,11,13]),te.BYTE=new te(4,[8,16,16]),te.KANJI=new te(8,[8,10,12]),te.ECI=new te(7,[0,0,0]);var ae=function(){function e(t,n,r){if(Object(E["a"])(this,e),this.mode=t,this.numChars=n,this.bitData=r,n<0)throw"Invalid argument";this.bitData=r.slice()}return Object(p["a"])(e,[{key:"getData",value:function(){return this.bitData.slice()}}],[{key:"makeBytes",value:function(t){var n,r=[],i=Object(d["a"])(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;ne(o,8,r)}}catch(a){i.e(a)}finally{i.f()}return new e(te.BYTE,t.length,r)}},{key:"makeNumeric",value:function(t){if(!e.isNumeric(t))throw"String contains non-numeric characters";for(var n=[],r=0;r<t.length;){var i=Math.min(t.length-r,3);ne(parseInt(t.substr(r,i),10),3*i+1,n),r+=i}return new e(te.NUMERIC,t.length,n)}},{key:"makeAlphanumeric",value:function(t){if(!e.isAlphanumeric(t))throw"String contains unencodable characters in alphanumeric mode";var n,r=[];for(n=0;n+2<=t.length;n+=2){var i=45*e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(n));i+=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(n+1)),ne(i,11,r)}return n<t.length&&ne(e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(n)),6,r),new e(te.ALPHANUMERIC,t.length,r)}},{key:"makeSegments",value:function(t){return""==t?[]:e.isNumeric(t)?[e.makeNumeric(t)]:e.isAlphanumeric(t)?[e.makeAlphanumeric(t)]:[e.makeBytes(e.toUtf8ByteArray(t))]}},{key:"makeEci",value:function(t){var n=[];if(t<0)throw"ECI assignment value out of range";if(t<128)ne(t,8,n);else if(t<16384)ne(2,2,n),ne(t,14,n);else{if(!(t<1e6))throw"ECI assignment value out of range";ne(6,3,n),ne(t,21,n)}return new e(te.ECI,0,n)}},{key:"isNumeric",value:function(t){return e.NUMERIC_REGEX.test(t)}},{key:"isAlphanumeric",value:function(t){return e.ALPHANUMERIC_REGEX.test(t)}},{key:"getTotalBits",value:function(e,t){var n,r=0,i=Object(d["a"])(e);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=o.mode.numCharCountBits(t);if(o.numChars>=1<<a)return 1/0;r+=4+a+o.bitData.length}}catch(s){i.e(s)}finally{i.f()}return r}},{key:"toUtf8ByteArray",value:function(e){e=encodeURI(e);for(var t=[],n=0;n<e.length;n++)"%"!=e.charAt(n)?t.push(e.charCodeAt(n)):(t.push(parseInt(e.substr(n+1,2),16)),n+=2);return t}}]),e}();ae.NUMERIC_REGEX=/^[0-9]*$/,ae.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+./:-]*$/,ae.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";var se=function(){function e(t,n,r,i){if(Object(E["a"])(this,e),this.version=t,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],t<e.MIN_VERSION||t>e.MAX_VERSION)throw"Version value out of range";if(i<-1||i>7)throw"Mask value out of range";this.size=4*t+17;for(var o=[],a=0;a<this.size;a++)o.push(!1);for(var s=0;s<this.size;s++)this.modules.push(o.slice()),this.isFunction.push(o.slice());this.drawFunctionPatterns();var u=this.addEccAndInterleave(r);if(this.drawCodewords(u),-1==i)for(var c=1e9,h=0;h<8;h++){this.applyMask(h),this.drawFormatBits(h);var l=this.getPenaltyScore();l<c&&(i=h,c=l),this.applyMask(h)}ie(0<=i&&i<=7),this.mask=i,this.applyMask(i),this.drawFormatBits(i),this.isFunction=[]}return Object(p["a"])(e,[{key:"getModule",value:function(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}},{key:"drawFunctionPatterns",value:function(){for(var e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);for(var t=this.getAlignmentPatternPositions(),n=t.length,r=0;r<n;r++)for(var i=0;i<n;i++)0==r&&0==i||0==r&&i==n-1||r==n-1&&0==i||this.drawAlignmentPattern(t[r],t[i]);this.drawFormatBits(0),this.drawVersion()}},{key:"drawFormatBits",value:function(e){for(var t=this.errorCorrectionLevel.formatBits<<3|e,n=t,r=0;r<10;r++)n=n<<1^1335*(n>>>9);var i=21522^(t<<10|n);ie(i>>>15==0);for(var o=0;o<=5;o++)this.setFunctionModule(8,o,re(i,o));this.setFunctionModule(8,7,re(i,6)),this.setFunctionModule(8,8,re(i,7)),this.setFunctionModule(7,8,re(i,8));for(var a=9;a<15;a++)this.setFunctionModule(14-a,8,re(i,a));for(var s=0;s<8;s++)this.setFunctionModule(this.size-1-s,8,re(i,s));for(var u=8;u<15;u++)this.setFunctionModule(8,this.size-15+u,re(i,u));this.setFunctionModule(8,this.size-8,!0)}},{key:"drawVersion",value:function(){if(!(this.version<7)){for(var e=this.version,t=0;t<12;t++)e=e<<1^7973*(e>>>11);var n=this.version<<12|e;ie(n>>>18==0);for(var r=0;r<18;r++){var i=re(n,r),o=this.size-11+r%3,a=Math.floor(r/3);this.setFunctionModule(o,a,i),this.setFunctionModule(a,o,i)}}}},{key:"drawFinderPattern",value:function(e,t){for(var n=-4;n<=4;n++)for(var r=-4;r<=4;r++){var i=Math.max(Math.abs(r),Math.abs(n)),o=e+r,a=t+n;0<=o&&o<this.size&&0<=a&&a<this.size&&this.setFunctionModule(o,a,2!=i&&4!=i)}}},{key:"drawAlignmentPattern",value:function(e,t){for(var n=-2;n<=2;n++)for(var r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,1!=Math.max(Math.abs(r),Math.abs(n)))}},{key:"setFunctionModule",value:function(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}},{key:"addEccAndInterleave",value:function(t){var n=this.version,r=this.errorCorrectionLevel;if(t.length!=e.getNumDataCodewords(n,r))throw"Invalid argument";for(var i=e.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],o=e.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],a=Math.floor(e.getNumRawDataModules(n)/8),s=i-a%i,u=Math.floor(a/i),c=[],h=e.reedSolomonComputeDivisor(o),l=0,f=0;l<i;l++){var d=t.slice(f,f+u-o+(l<s?0:1));f+=d.length;var p=e.reedSolomonComputeRemainder(d,h);l<s&&d.push(0),c.push(d.concat(p))}for(var g=[],v=function(e){c.forEach((function(t,n){(e!=u-o||n>=s)&&g.push(t[e])}))},m=0;m<c[0].length;m++)v(m);return ie(g.length==a),g}},{key:"drawCodewords",value:function(t){if(t.length!=Math.floor(e.getNumRawDataModules(this.version)/8))throw"Invalid argument";for(var n=0,r=this.size-1;r>=1;r-=2){6==r&&(r=5);for(var i=0;i<this.size;i++)for(var o=0;o<2;o++){var a=r-o,s=0==(r+1&2),u=s?this.size-1-i:i;!this.isFunction[u][a]&&n<8*t.length&&(this.modules[u][a]=re(t[n>>>3],7-(7&n)),n++)}}ie(n==8*t.length)}},{key:"applyMask",value:function(e){if(e<0||e>7)throw"Mask value out of range";for(var t=0;t<this.size;t++)for(var n=0;n<this.size;n++){var r=void 0;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw"Unreachable"}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}},{key:"getPenaltyScore",value:function(){for(var t=0,n=0;n<this.size;n++){for(var r=!1,i=0,o=[0,0,0,0,0,0,0],a=0;a<this.size;a++)this.modules[n][a]==r?(i++,5==i?t+=e.PENALTY_N1:i>5&&t++):(this.finderPenaltyAddHistory(i,o),r||(t+=this.finderPenaltyCountPatterns(o)*e.PENALTY_N3),r=this.modules[n][a],i=1);t+=this.finderPenaltyTerminateAndCount(r,i,o)*e.PENALTY_N3}for(var s=0;s<this.size;s++){for(var u=!1,c=0,h=[0,0,0,0,0,0,0],l=0;l<this.size;l++)this.modules[l][s]==u?(c++,5==c?t+=e.PENALTY_N1:c>5&&t++):(this.finderPenaltyAddHistory(c,h),u||(t+=this.finderPenaltyCountPatterns(h)*e.PENALTY_N3),u=this.modules[l][s],c=1);t+=this.finderPenaltyTerminateAndCount(u,c,h)*e.PENALTY_N3}for(var f=0;f<this.size-1;f++)for(var p=0;p<this.size-1;p++){var g=this.modules[f][p];g==this.modules[f][p+1]&&g==this.modules[f+1][p]&&g==this.modules[f+1][p+1]&&(t+=e.PENALTY_N2)}var v,m=0,b=Object(d["a"])(this.modules);try{for(b.s();!(v=b.n()).done;){var E=v.value;m=E.reduce((function(e,t){return e+(t?1:0)}),m)}}catch(_){b.e(_)}finally{b.f()}var y=this.size*this.size,w=Math.ceil(Math.abs(20*m-10*y)/y)-1;return ie(0<=w&&w<=9),t+=w*e.PENALTY_N4,ie(0<=t&&t<=2568888),t}},{key:"getAlignmentPatternPositions",value:function(){if(1==this.version)return[];for(var e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2)),n=[6],r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}},{key:"finderPenaltyCountPatterns",value:function(e){var t=e[1];ie(t<=3*this.size);var n=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(n&&e[0]>=4*t&&e[6]>=t?1:0)+(n&&e[6]>=4*t&&e[0]>=t?1:0)}},{key:"finderPenaltyTerminateAndCount",value:function(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}},{key:"finderPenaltyAddHistory",value:function(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}}],[{key:"encodeText",value:function(t,n){var r=ae.makeSegments(t);return e.encodeSegments(r,n)}},{key:"encodeBinary",value:function(t,n){var r=ae.makeBytes(t);return e.encodeSegments([r],n)}},{key:"encodeSegments",value:function(t,n){var r,i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:40,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,u=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];if(!(e.MIN_VERSION<=o&&o<=a&&a<=e.MAX_VERSION)||s<-1||s>7)throw"Invalid value";for(r=o;;r++){var c=8*e.getNumDataCodewords(r,n),h=ae.getTotalBits(t,r);if(h<=c){i=h;break}if(r>=a)throw"Data too long"}for(var l=0,f=[ee.MEDIUM,ee.QUARTILE,ee.HIGH];l<f.length;l++){var p=f[l];u&&i<=8*e.getNumDataCodewords(r,p)&&(n=p)}var g,v=[],m=Object(d["a"])(t);try{for(m.s();!(g=m.n()).done;){var b=g.value;ne(b.mode.modeBits,4,v),ne(b.numChars,b.mode.numCharCountBits(r),v);var E,y=Object(d["a"])(b.getData());try{for(y.s();!(E=y.n()).done;){var w=E.value;v.push(w)}}catch(A){y.e(A)}finally{y.f()}}}catch(A){m.e(A)}finally{m.f()}ie(v.length==i);var _=8*e.getNumDataCodewords(r,n);ie(v.length<=_),ne(0,Math.min(4,_-v.length),v),ne(0,(8-v.length%8)%8,v),ie(v.length%8==0);for(var R=236;v.length<_;R^=253)ne(R,8,v);var O=[];while(8*O.length<v.length)O.push(0);return v.forEach((function(e,t){return O[t>>>3]|=e<<7-(7&t)})),new e(r,n,O,s)}},{key:"getNumRawDataModules",value:function(t){if(t<e.MIN_VERSION||t>e.MAX_VERSION)throw"Version number out of range";var n=(16*t+128)*t+64;if(t>=2){var r=Math.floor(t/7)+2;n-=(25*r-10)*r-55,t>=7&&(n-=36)}return ie(208<=n&&n<=29648),n}},{key:"getNumDataCodewords",value:function(t,n){return Math.floor(e.getNumRawDataModules(t)/8)-this.ECC_CODEWORDS_PER_BLOCK[n.ordinal][t]*e.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][t]}},{key:"reedSolomonComputeDivisor",value:function(t){if(t<1||t>255)throw"Degree out of range";for(var n=[],r=0;r<t-1;r++)n.push(0);n.push(1);for(var i=1,o=0;o<t;o++){for(var a=0;a<n.length;a++)n[a]=e.reedSolomonMultiply(n[a],i),a+1<n.length&&(n[a]^=n[a+1]);i=e.reedSolomonMultiply(i,2)}return n}},{key:"reedSolomonComputeRemainder",value:function(t,n){var r,i=n.map((function(){return 0})),o=Object(d["a"])(t);try{var a=function(){var t=r.value,o=t^i.shift();i.push(0),n.forEach((function(t,n){return i[n]^=e.reedSolomonMultiply(t,o)}))};for(o.s();!(r=o.n()).done;)a()}catch(s){o.e(s)}finally{o.f()}return i}},{key:"reedSolomonMultiply",value:function(e,t){if(e>>>8!=0||t>>>8!=0)throw"Byte out of range";for(var n=0,r=7;r>=0;r--)n=n<<1^285*(n>>>7),n^=(t>>>r&1)*e;return ie(n>>>8==0),n}}]),e}();se.MIN_VERSION=1,se.MAX_VERSION=40,se.PENALTY_N1=3,se.PENALTY_N2=3,se.PENALTY_N3=40,se.PENALTY_N4=10,se.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],se.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];var ue,ce,he=ye(e.fetch)&&ye(e.ReadableStream);function le(){if("undefined"!==typeof ue)return ue;try{new e.Blob([new ArrayBuffer(1)]),ue=!0}catch(t){ue=!1}return ue}function fe(t){ce||(ce=new e.XMLHttpRequest,ce.open("GET",e.location.host?"/":"https://example.com"));try{return ce.responseType=t,ce.responseType===t}catch(n){return!1}}var de="undefined"!==typeof e.ArrayBuffer,pe=de&&ye(e.ArrayBuffer.prototype.slice),ge=de&&fe("arraybuffer"),ve=!he&&pe&&fe("ms-stream"),me=!he&&de&&fe("moz-chunked-arraybuffer"),be=ye(ce.overrideMimeType),Ee=ye(e.VBArray);function ye(e){return"function"===typeof e}function we(){throw new Error("setTimeout has not been defined")}function _e(){throw new Error("clearTimeout has not been defined")}ce=null;var Re=we,Oe=_e;function Ae(e){if(Re===setTimeout)return setTimeout(e,0);if((Re===we||!Re)&&setTimeout)return Re=setTimeout,setTimeout(e,0);try{return Re(e,0)}catch(t){try{return Re.call(null,e,0)}catch(t){return Re.call(this,e,0)}}}function Ie(e){if(Oe===clearTimeout)return clearTimeout(e);if((Oe===_e||!Oe)&&clearTimeout)return Oe=clearTimeout,clearTimeout(e);try{return Oe(e)}catch(t){try{return Oe.call(null,e)}catch(t){return Oe.call(this,e)}}}"function"===typeof e.setTimeout&&(Re=setTimeout),"function"===typeof e.clearTimeout&&(Oe=clearTimeout);var Te,Se=[],je=!1,Ce=-1;function Ne(){je&&Te&&(je=!1,Te.length?Se=Te.concat(Se):Ce=-1,Se.length&&ke())}function ke(){if(!je){var e=Ae(Ne);je=!0;var t=Se.length;while(t){Te=Se,Se=[];while(++Ce<t)Te&&Te[Ce].run();Ce=-1,t=Se.length}Te=null,je=!1,Ie(e)}}function Le(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Se.push(new Ue(e,t)),1!==Se.length||je||Ae(ke)}function Ue(e,t){this.fun=e,this.array=t}Ue.prototype.run=function(){this.fun.apply(null,this.array)};var Me="browser",De="browser",Be=!0,Pe={},xe=[],We="",ze={},He={},Fe={};function qe(){}var Ve=qe,Ye=qe,Ge=qe,Ke=qe,$e=qe,Xe=qe,Je=qe;function Ze(e){throw new Error("process.binding is not supported")}function Qe(){return"/"}function et(e){throw new Error("process.chdir is not supported")}function tt(){return 0}var nt=e.performance||{},rt=nt.now||nt.mozNow||nt.msNow||nt.oNow||nt.webkitNow||function(){return(new Date).getTime()};function it(e){var t=.001*rt.call(nt),n=Math.floor(t),r=Math.floor(t%1*1e9);return e&&(n-=e[0],r-=e[1],r<0&&(n--,r+=1e9)),[n,r]}var ot=new Date;function at(){var e=new Date,t=e-ot;return t/1e3}var st,ut={nextTick:Le,title:Me,browser:Be,env:Pe,argv:xe,version:We,versions:ze,on:Ve,addListener:Ye,once:Ge,off:Ke,removeListener:$e,removeAllListeners:Xe,emit:Je,binding:Ze,cwd:Qe,chdir:et,umask:tt,hrtime:it,platform:De,release:He,config:Fe,uptime:at};st="function"===typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e};var ct=st,ht=/%[sdj%]/g;function lt(e){if(!kt(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(mt(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,i=r.length,o=String(e).replace(ht,(function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return e}})),a=r[n];n<i;a=r[++n])jt(a)||!Mt(a)?o+=" "+a:o+=" "+mt(a);return o}function ft(t,n){if(Lt(e.process))return function(){return ft(t,n).apply(this,arguments)};if(!0===ut.noDeprecation)return t;var r=!1;function i(){return r||(console.error(n),r=!0),t.apply(this,arguments)}return i}var dt,pt,gt={};function vt(e){if(Lt(dt)&&(dt=""),e=e.toUpperCase(),!gt[e])if(new RegExp("\\b"+e+"\\b","i").test(dt)){var t=0;gt[e]=function(){var n=lt.apply(null,arguments);console.error("%s %d: %s",e,t,n)}}else gt[e]=function(){};return gt[e]}function mt(e,t){var n={seen:[],stylize:Et};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),St(t)?n.showHidden=t:t&&Wt(n,t),Lt(n.showHidden)&&(n.showHidden=!1),Lt(n.depth)&&(n.depth=2),Lt(n.colors)&&(n.colors=!1),Lt(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=bt),wt(n,e,n.depth)}function bt(e,t){var n=mt.styles[t];return n?"["+mt.colors[n][0]+"m"+e+"["+mt.colors[n][1]+"m":e}function Et(e,t){return e}function yt(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}function wt(e,t,n){if(e.customInspect&&t&&Pt(t.inspect)&&t.inspect!==mt&&(!t.constructor||t.constructor.prototype!==t)){var r=t.inspect(n,e);return kt(r)||(r=wt(e,r,n)),r}var i=_t(e,t);if(i)return i;var o=Object.keys(t),a=yt(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),Bt(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return Rt(t);if(0===o.length){if(Pt(t)){var s=t.name?": "+t.name:"";return e.stylize("[Function"+s+"]","special")}if(Ut(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(Dt(t))return e.stylize(Date.prototype.toString.call(t),"date");if(Bt(t))return Rt(t)}var u,c="",h=!1,l=["{","}"];if(Tt(t)&&(h=!0,l=["[","]"]),Pt(t)){var f=t.name?": "+t.name:"";c=" [Function"+f+"]"}return Ut(t)&&(c=" "+RegExp.prototype.toString.call(t)),Dt(t)&&(c=" "+Date.prototype.toUTCString.call(t)),Bt(t)&&(c=" "+Rt(t)),0!==o.length||h&&0!=t.length?n<0?Ut(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),u=h?Ot(e,t,n,a,o):o.map((function(r){return At(e,t,n,a,r,h)})),e.seen.pop(),It(u,c,l)):l[0]+c+l[1]}function _t(e,t){if(Lt(t))return e.stylize("undefined","undefined");if(kt(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return Nt(t)?e.stylize(""+t,"number"):St(t)?e.stylize(""+t,"boolean"):jt(t)?e.stylize("null","null"):void 0}function Rt(e){return"["+Error.prototype.toString.call(e)+"]"}function Ot(e,t,n,r,i){for(var o=[],a=0,s=t.length;a<s;++a)zt(t,String(a))?o.push(At(e,t,n,r,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(At(e,t,n,r,i,!0))})),o}function At(e,t,n,r,i,o){var a,s,u;if(u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},u.get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),zt(r,i)||(a="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=jt(n)?wt(e,u.value,null):wt(e,u.value,n-1),s.indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n"))):s=e.stylize("[Circular]","special")),Lt(a)){if(o&&i.match(/^\d+$/))return s;a=JSON.stringify(""+i),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function It(e,t,n){var r=e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0);return r>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function Tt(e){return Array.isArray(e)}function St(e){return"boolean"===typeof e}function jt(e){return null===e}function Ct(e){return null==e}function Nt(e){return"number"===typeof e}function kt(e){return"string"===typeof e}function Lt(e){return void 0===e}function Ut(e){return Mt(e)&&"[object RegExp]"===xt(e)}function Mt(e){return"object"===Object(f["a"])(e)&&null!==e}function Dt(e){return Mt(e)&&"[object Date]"===xt(e)}function Bt(e){return Mt(e)&&("[object Error]"===xt(e)||e instanceof Error)}function Pt(e){return"function"===typeof e}function xt(e){return Object.prototype.toString.call(e)}function Wt(e,t){if(!t||!Mt(t))return e;var n=Object.keys(t),r=n.length;while(r--)e[n[r]]=t[n[r]];return e}function zt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Ht(){}function Ft(){Ft.init.call(this)}function qt(e){return void 0===e._maxListeners?Ft.defaultMaxListeners:e._maxListeners}function Vt(e,t,n){if(t)e.call(n);else for(var r=e.length,i=tn(e,r),o=0;o<r;++o)i[o].call(n)}function Yt(e,t,n,r){if(t)e.call(n,r);else for(var i=e.length,o=tn(e,i),a=0;a<i;++a)o[a].call(n,r)}function Gt(e,t,n,r,i){if(t)e.call(n,r,i);else for(var o=e.length,a=tn(e,o),s=0;s<o;++s)a[s].call(n,r,i)}function Kt(e,t,n,r,i,o){if(t)e.call(n,r,i,o);else for(var a=e.length,s=tn(e,a),u=0;u<a;++u)s[u].call(n,r,i,o)}function $t(e,t,n,r){if(t)e.apply(n,r);else for(var i=e.length,o=tn(e,i),a=0;a<i;++a)o[a].apply(n,r)}function Xt(e,t,n,r){var i,o,a;if("function"!==typeof n)throw new TypeError('"listener" argument must be a function');if(o=e._events,o?(o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),a=o[t]):(o=e._events=new Ht,e._eventsCount=0),a){if("function"===typeof a?a=o[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),!a.warned&&(i=qt(e),i&&i>0&&a.length>i)){a.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=a.length,Jt(s)}}else a=o[t]=n,++e._eventsCount;return e}function Jt(e){"function"===typeof console.warn?console.warn(e):console.log(e)}function Zt(e,t,n){var r=!1;function i(){e.removeListener(t,i),r||(r=!0,n.apply(e,arguments))}return i.listener=n,i}function Qt(e){var t=this._events;if(t){var n=t[e];if("function"===typeof n)return 1;if(n)return n.length}return 0}function en(e,t){for(var n=t,r=n+1,i=e.length;r<i;n+=1,r+=1)e[n]=e[r];e.pop()}function tn(e,t){var n=new Array(t);while(t--)n[t]=e[t];return n}function nn(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}mt.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},mt.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},Ht.prototype=Object.create(null),Ft.EventEmitter=Ft,Ft.usingDomains=!1,Ft.prototype.domain=void 0,Ft.prototype._events=void 0,Ft.prototype._maxListeners=void 0,Ft.defaultMaxListeners=10,Ft.init=function(){this.domain=null,Ft.usingDomains&&pt.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new Ht,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Ft.prototype.setMaxListeners=function(e){if("number"!==typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},Ft.prototype.getMaxListeners=function(){return qt(this)},Ft.prototype.emit=function(e){var t,n,r,i,o,a,s,u="error"===e;if(a=this._events,a)u=u&&null==a.error;else if(!u)return!1;if(s=this.domain,u){if(t=arguments[1],!s){if(t instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=s,t.domainThrown=!1,s.emit("error",t),!1}if(n=a[e],!n)return!1;var h="function"===typeof n;switch(r=arguments.length,r){case 1:Vt(n,h,this);break;case 2:Yt(n,h,this,arguments[1]);break;case 3:Gt(n,h,this,arguments[1],arguments[2]);break;case 4:Kt(n,h,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];$t(n,h,this,i)}return!0},Ft.prototype.addListener=function(e,t){return Xt(this,e,t,!1)},Ft.prototype.on=Ft.prototype.addListener,Ft.prototype.prependListener=function(e,t){return Xt(this,e,t,!0)},Ft.prototype.once=function(e,t){if("function"!==typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,Zt(this,e,t)),this},Ft.prototype.prependOnceListener=function(e,t){if("function"!==typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,Zt(this,e,t)),this},Ft.prototype.removeListener=function(e,t){var n,r,i,o,a;if("function"!==typeof t)throw new TypeError('"listener" argument must be a function');if(r=this._events,!r)return this;if(n=r[e],!n)return this;if(n===t||n.listener&&n.listener===t)0===--this._eventsCount?this._events=new Ht:(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!==typeof n){for(i=-1,o=n.length;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;if(1===n.length){if(n[0]=void 0,0===--this._eventsCount)return this._events=new Ht,this;delete r[e]}else en(n,i);r.removeListener&&this.emit("removeListener",e,a||t)}return this},Ft.prototype.off=function(e,t){return this.removeListener(e,t)},Ft.prototype.removeAllListeners=function(e){var t,n;if(n=this._events,!n)return this;if(!n.removeListener)return 0===arguments.length?(this._events=new Ht,this._eventsCount=0):n[e]&&(0===--this._eventsCount?this._events=new Ht:delete n[e]),this;if(0===arguments.length){for(var r,i=Object.keys(n),o=0;o<i.length;++o)r=i[o],"removeListener"!==r&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=new Ht,this._eventsCount=0,this}if(t=n[e],"function"===typeof t)this.removeListener(e,t);else if(t)do{this.removeListener(e,t[t.length-1])}while(t[0]);return this},Ft.prototype.listeners=function(e){var t,n,r=this._events;return r?(t=r[e],n=t?"function"===typeof t?[t.listener||t]:nn(t):[]):n=[],n},Ft.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):Qt.call(e,t)},Ft.prototype.listenerCount=Qt,Ft.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var rn=[],on=[],an="undefined"!==typeof Uint8Array?Uint8Array:Array,sn=!1;function un(){sn=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,n=e.length;t<n;++t)rn[t]=e[t],on[e.charCodeAt(t)]=t;on["-".charCodeAt(0)]=62,on["_".charCodeAt(0)]=63}function cn(e){var t,n,r,i,o,a;sn||un();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[s-2]?2:"="===e[s-1]?1:0,a=new an(3*s/4-o),r=o>0?s-4:s;var u=0;for(t=0,n=0;t<r;t+=4,n+=3)i=on[e.charCodeAt(t)]<<18|on[e.charCodeAt(t+1)]<<12|on[e.charCodeAt(t+2)]<<6|on[e.charCodeAt(t+3)],a[u++]=i>>16&255,a[u++]=i>>8&255,a[u++]=255&i;return 2===o?(i=on[e.charCodeAt(t)]<<2|on[e.charCodeAt(t+1)]>>4,a[u++]=255&i):1===o&&(i=on[e.charCodeAt(t)]<<10|on[e.charCodeAt(t+1)]<<4|on[e.charCodeAt(t+2)]>>2,a[u++]=i>>8&255,a[u++]=255&i),a}function hn(e){return rn[e>>18&63]+rn[e>>12&63]+rn[e>>6&63]+rn[63&e]}function ln(e,t,n){for(var r,i=[],o=t;o<n;o+=3)r=(e[o]<<16)+(e[o+1]<<8)+e[o+2],i.push(hn(r));return i.join("")}function fn(e){var t;sn||un();for(var n=e.length,r=n%3,i="",o=[],a=16383,s=0,u=n-r;s<u;s+=a)o.push(ln(e,s,s+a>u?u:s+a));return 1===r?(t=e[n-1],i+=rn[t>>2],i+=rn[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=rn[t>>10],i+=rn[t>>4&63],i+=rn[t<<2&63],i+="="),o.push(i),o.join("")}function dn(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,c=u>>1,h=-7,l=n?i-1:0,f=n?-1:1,d=e[t+l];for(l+=f,o=d&(1<<-h)-1,d>>=-h,h+=s;h>0;o=256*o+e[t+l],l+=f,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=r;h>0;a=256*a+e[t+l],l+=f,h-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),o-=c}return(d?-1:1)*a*Math.pow(2,o-r)}function pn(e,t,n,r,i,o){var a,s,u,c=8*o-i-1,h=(1<<c)-1,l=h>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),t+=a+l>=1?f/u:f*Math.pow(2,1-l),t*u>=2&&(a++,u/=2),a+l>=h?(s=0,a=h):a+l>=1?(s=(t*u-1)*Math.pow(2,i),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;e[n+d]=255&s,d+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;e[n+d]=255&a,d+=p,a/=256,c-=8);e[n+d-p]|=128*g}var gn={}.toString,vn=Array.isArray||function(e){return"[object Array]"==gn.call(e)},mn=50;function bn(){return yn.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function En(e,t){if(bn()<t)throw new RangeError("Invalid typed array length");return yn.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=yn.prototype):(null===e&&(e=new yn(t)),e.length=t),e}function yn(e,t,n){if(!yn.TYPED_ARRAY_SUPPORT&&!(this instanceof yn))return new yn(e,t,n);if("number"===typeof e){if("string"===typeof t)throw new Error("If encoding is specified then the first argument must be a string");return On(this,e)}return wn(this,e,t,n)}function wn(e,t,n,r){if("number"===typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!==typeof ArrayBuffer&&t instanceof ArrayBuffer?Tn(e,t,n,r):"string"===typeof t?An(e,t,n):Sn(e,t)}function _n(e){if("number"!==typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function Rn(e,t,n,r){return _n(t),t<=0?En(e,t):void 0!==n?"string"===typeof r?En(e,t).fill(n,r):En(e,t).fill(n):En(e,t)}function On(e,t){if(_n(t),e=En(e,t<0?0:0|jn(t)),!yn.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function An(e,t,n){if("string"===typeof n&&""!==n||(n="utf8"),!yn.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|Nn(t,n);e=En(e,r);var i=e.write(t,n);return i!==r&&(e=e.slice(0,i)),e}function In(e,t){var n=t.length<0?0:0|jn(t.length);e=En(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function Tn(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r),yn.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=yn.prototype):e=In(e,t),e}function Sn(e,t){if(Cn(t)){var n=0|jn(t.length);return e=En(e,n),0===e.length?e:(t.copy(e,0,0,n),e)}if(t){if("undefined"!==typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!==typeof t.length||fr(t.length)?En(e,0):In(e,t);if("Buffer"===t.type&&vn(t.data))return In(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function jn(e){if(e>=bn())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+bn().toString(16)+" bytes");return 0|e}function Cn(e){return!(null==e||!e._isBuffer)}function Nn(e,t){if(Cn(e))return e.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!==typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return sr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return hr(e).length;default:if(r)return sr(e).length;t=(""+t).toLowerCase(),r=!0}}function kn(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";e||(e="utf8");while(1)switch(e){case"hex":return Kn(this,t,n);case"utf8":case"utf-8":return Fn(this,t,n);case"ascii":return Yn(this,t,n);case"latin1":case"binary":return Gn(this,t,n);case"base64":return Hn(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $n(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function Ln(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function Un(e,t,n,r,i){if(0===e.length)return-1;if("string"===typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"===typeof t&&(t=yn.from(t,r)),Cn(t))return 0===t.length?-1:Mn(e,t,n,r,i);if("number"===typeof t)return t&=255,yn.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):Mn(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function Mn(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&(r=String(r).toLowerCase(),"ucs2"===r||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var h=-1;for(o=n;o<s;o++)if(c(e,o)===c(t,-1===h?0:o-h)){if(-1===h&&(h=o),o-h+1===u)return h*a}else-1!==h&&(o-=o-h),h=-1}else for(n+u>s&&(n=s-u),o=n;o>=0;o--){for(var l=!0,f=0;f<u;f++)if(c(e,o+f)!==c(t,f)){l=!1;break}if(l)return o}return-1}function Dn(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function Bn(e,t,n,r){return lr(sr(t,e.length-n),e,n,r)}function Pn(e,t,n,r){return lr(ur(t),e,n,r)}function xn(e,t,n,r){return Pn(e,t,n,r)}function Wn(e,t,n,r){return lr(hr(t),e,n,r)}function zn(e,t,n,r){return lr(cr(t,e.length-n),e,n,r)}function Hn(e,t,n){return 0===t&&n===e.length?fn(e):fn(e.slice(t,n))}function Fn(e,t,n){n=Math.min(e.length,n);var r=[],i=t;while(i<n){var o,a,s,u,c=e[i],h=null,l=c>239?4:c>223?3:c>191?2:1;if(i+l<=n)switch(l){case 1:c<128&&(h=c);break;case 2:o=e[i+1],128===(192&o)&&(u=(31&c)<<6|63&o,u>127&&(h=u));break;case 3:o=e[i+1],a=e[i+2],128===(192&o)&&128===(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a,u>2047&&(u<55296||u>57343)&&(h=u));break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128===(192&o)&&128===(192&a)&&128===(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s,u>65535&&u<1114112&&(h=u))}null===h?(h=65533,l=1):h>65535&&(h-=65536,r.push(h>>>10&1023|55296),h=56320|1023&h),r.push(h),i+=l}return Vn(r)}yn.TYPED_ARRAY_SUPPORT=void 0===e.TYPED_ARRAY_SUPPORT||e.TYPED_ARRAY_SUPPORT,yn.poolSize=8192,yn._augment=function(e){return e.__proto__=yn.prototype,e},yn.from=function(e,t,n){return wn(null,e,t,n)},yn.TYPED_ARRAY_SUPPORT&&(yn.prototype.__proto__=Uint8Array.prototype,yn.__proto__=Uint8Array),yn.alloc=function(e,t,n){return Rn(null,e,t,n)},yn.allocUnsafe=function(e){return On(null,e)},yn.allocUnsafeSlow=function(e){return On(null,e)},yn.isBuffer=dr,yn.compare=function(e,t){if(!Cn(e)||!Cn(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},yn.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},yn.concat=function(e,t){if(!vn(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return yn.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=yn.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(!Cn(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},yn.byteLength=Nn,yn.prototype._isBuffer=!0,yn.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)Ln(this,t,t+1);return this},yn.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)Ln(this,t,t+3),Ln(this,t+1,t+2);return this},yn.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)Ln(this,t,t+7),Ln(this,t+1,t+6),Ln(this,t+2,t+5),Ln(this,t+3,t+4);return this},yn.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?Fn(this,0,e):kn.apply(this,arguments)},yn.prototype.equals=function(e){if(!Cn(e))throw new TypeError("Argument must be a Buffer");return this===e||0===yn.compare(this,e)},yn.prototype.inspect=function(){var e="",t=mn;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},yn.prototype.compare=function(e,t,n,r,i){if(!Cn(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;for(var o=i-r,a=n-t,s=Math.min(o,a),u=this.slice(r,i),c=e.slice(t,n),h=0;h<s;++h)if(u[h]!==c[h]){o=u[h],a=c[h];break}return o<a?-1:a<o?1:0},yn.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},yn.prototype.indexOf=function(e,t,n){return Un(this,e,t,n,!0)},yn.prototype.lastIndexOf=function(e,t,n){return Un(this,e,t,n,!1)},yn.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"===typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return Dn(this,e,t,n);case"utf8":case"utf-8":return Bn(this,e,t,n);case"ascii":return Pn(this,e,t,n);case"latin1":case"binary":return xn(this,e,t,n);case"base64":return Wn(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return zn(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},yn.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var qn=4096;function Vn(e){var t=e.length;if(t<=qn)return String.fromCharCode.apply(String,e);var n="",r=0;while(r<t)n+=String.fromCharCode.apply(String,e.slice(r,r+=qn));return n}function Yn(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function Gn(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function Kn(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=ar(e[o]);return i}function $n(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function Xn(e,t,n){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function Jn(e,t,n,r,i,o){if(!Cn(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function Zn(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function Qn(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function er(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function tr(e,t,n,r,i){return i||er(e,t,n,4),pn(e,t,n,r,23,4),n+4}function nr(e,t,n,r,i){return i||er(e,t,n,8),pn(e,t,n,r,52,8),n+8}yn.prototype.slice=function(e,t){var n,r=this.length;if(e=~~e,t=void 0===t?r:~~t,e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),t<e&&(t=e),yn.TYPED_ARRAY_SUPPORT)n=this.subarray(e,t),n.__proto__=yn.prototype;else{var i=t-e;n=new yn(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+e]}return n},yn.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||Xn(e,t,this.length);var r=this[e],i=1,o=0;while(++o<t&&(i*=256))r+=this[e+o]*i;return r},yn.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||Xn(e,t,this.length);var r=this[e+--t],i=1;while(t>0&&(i*=256))r+=this[e+--t]*i;return r},yn.prototype.readUInt8=function(e,t){return t||Xn(e,1,this.length),this[e]},yn.prototype.readUInt16LE=function(e,t){return t||Xn(e,2,this.length),this[e]|this[e+1]<<8},yn.prototype.readUInt16BE=function(e,t){return t||Xn(e,2,this.length),this[e]<<8|this[e+1]},yn.prototype.readUInt32LE=function(e,t){return t||Xn(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},yn.prototype.readUInt32BE=function(e,t){return t||Xn(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},yn.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||Xn(e,t,this.length);var r=this[e],i=1,o=0;while(++o<t&&(i*=256))r+=this[e+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},yn.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||Xn(e,t,this.length);var r=t,i=1,o=this[e+--r];while(r>0&&(i*=256))o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},yn.prototype.readInt8=function(e,t){return t||Xn(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},yn.prototype.readInt16LE=function(e,t){t||Xn(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},yn.prototype.readInt16BE=function(e,t){t||Xn(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},yn.prototype.readInt32LE=function(e,t){return t||Xn(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},yn.prototype.readInt32BE=function(e,t){return t||Xn(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},yn.prototype.readFloatLE=function(e,t){return t||Xn(e,4,this.length),dn(this,e,!0,23,4)},yn.prototype.readFloatBE=function(e,t){return t||Xn(e,4,this.length),dn(this,e,!1,23,4)},yn.prototype.readDoubleLE=function(e,t){return t||Xn(e,8,this.length),dn(this,e,!0,52,8)},yn.prototype.readDoubleBE=function(e,t){return t||Xn(e,8,this.length),dn(this,e,!1,52,8)},yn.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t|=0,n|=0,!r){var i=Math.pow(2,8*n)-1;Jn(this,e,t,n,i,0)}var o=1,a=0;this[t]=255&e;while(++a<n&&(o*=256))this[t+a]=e/o&255;return t+n},yn.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t|=0,n|=0,!r){var i=Math.pow(2,8*n)-1;Jn(this,e,t,n,i,0)}var o=n-1,a=1;this[t+o]=255&e;while(--o>=0&&(a*=256))this[t+o]=e/a&255;return t+n},yn.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||Jn(this,e,t,1,255,0),yn.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},yn.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||Jn(this,e,t,2,65535,0),yn.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Zn(this,e,t,!0),t+2},yn.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||Jn(this,e,t,2,65535,0),yn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Zn(this,e,t,!1),t+2},yn.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||Jn(this,e,t,4,4294967295,0),yn.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Qn(this,e,t,!0),t+4},yn.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||Jn(this,e,t,4,4294967295,0),yn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Qn(this,e,t,!1),t+4},yn.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);Jn(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;this[t]=255&e;while(++o<n&&(a*=256))e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},yn.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);Jn(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;this[t+o]=255&e;while(--o>=0&&(a*=256))e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},yn.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||Jn(this,e,t,1,127,-128),yn.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},yn.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||Jn(this,e,t,2,32767,-32768),yn.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Zn(this,e,t,!0),t+2},yn.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||Jn(this,e,t,2,32767,-32768),yn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Zn(this,e,t,!1),t+2},yn.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||Jn(this,e,t,4,2147483647,-2147483648),yn.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Qn(this,e,t,!0),t+4},yn.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||Jn(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),yn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Qn(this,e,t,!1),t+4},yn.prototype.writeFloatLE=function(e,t,n){return tr(this,e,t,!0,n)},yn.prototype.writeFloatBE=function(e,t,n){return tr(this,e,t,!1,n)},yn.prototype.writeDoubleLE=function(e,t,n){return nr(this,e,t,!0,n)},yn.prototype.writeDoubleBE=function(e,t,n){return nr(this,e,t,!1,n)},yn.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&n<t&&t<r)for(i=o-1;i>=0;--i)e[i+t]=this[i+n];else if(o<1e3||!yn.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},yn.prototype.fill=function(e,t,n,r){if("string"===typeof e){if("string"===typeof t?(r=t,t=0,n=this.length):"string"===typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!==typeof r)throw new TypeError("encoding must be a string");if("string"===typeof r&&!yn.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"===typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"===typeof e)for(o=t;o<n;++o)this[o]=e;else{var a=Cn(e)?e:sr(new yn(e,r).toString()),s=a.length;for(o=0;o<n-t;++o)this[o+t]=a[o%s]}return this};var rr=/[^+\/0-9A-Za-z-_]/g;function ir(e){if(e=or(e).replace(rr,""),e.length<2)return"";while(e.length%4!==0)e+="=";return e}function or(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function ar(e){return e<16?"0"+e.toString(16):e.toString(16)}function sr(e,t){var n;t=t||1/0;for(var r=e.length,i=null,o=[],a=0;a<r;++a){if(n=e.charCodeAt(a),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function ur(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}function cr(e,t){for(var n,r,i,o=[],a=0;a<e.length;++a){if((t-=2)<0)break;n=e.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r)}return o}function hr(e){return cn(ir(e))}function lr(e,t,n,r){for(var i=0;i<r;++i){if(i+n>=t.length||i>=e.length)break;t[i+n]=e[i]}return i}function fr(e){return e!==e}function dr(e){return null!=e&&(!!e._isBuffer||pr(e)||gr(e))}function pr(e){return!!e.constructor&&"function"===typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function gr(e){return"function"===typeof e.readFloatLE&&"function"===typeof e.slice&&pr(e.slice(0,0))}function vr(){this.head=null,this.tail=null,this.length=0}vr.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},vr.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},vr.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},vr.prototype.clear=function(){this.head=this.tail=null,this.length=0},vr.prototype.join=function(e){if(0===this.length)return"";var t=this.head,n=""+t.data;while(t=t.next)n+=e+t.data;return n},vr.prototype.concat=function(e){if(0===this.length)return yn.alloc(0);if(1===this.length)return this.head.data;var t=yn.allocUnsafe(e>>>0),n=this.head,r=0;while(n)n.data.copy(t,r),r+=n.data.length,n=n.next;return t};var mr=yn.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function br(e){if(e&&!mr(e))throw new Error("Unknown encoding: "+e)}function Er(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),br(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=wr;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=_r;break;default:return void(this.write=yr)}this.charBuffer=new yn(6),this.charReceived=0,this.charLength=0}function yr(e){return e.toString(this.encoding)}function wr(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function _r(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}Er.prototype.write=function(e){var t="";while(this.charLength){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived<this.charLength)return"";e=e.slice(n,e.length),t=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var r=t.charCodeAt(t.length-1);if(!(r>=55296&&r<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var i=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,i),i-=this.charReceived),t+=e.toString(this.encoding,0,i);i=t.length-1,r=t.charCodeAt(i);if(r>=55296&&r<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),t.substring(0,i)}return t},Er.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},Er.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;t+=r.slice(0,n).toString(i)}return t},Tr.ReadableState=Ir;var Rr=vt("stream");function Or(e,t,n){if("function"===typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}function Ar(e,t){return e.listeners(t).length}function Ir(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof wi&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var n=e.highWaterMark,r=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r,this.highWaterMark=~~this.highWaterMark,this.buffer=new vr,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(this.decoder=new Er(e.encoding),this.encoding=e.encoding)}function Tr(e){if(!(this instanceof Tr))return new Tr(e);this._readableState=new Ir(e,this),this.readable=!0,e&&"function"===typeof e.read&&(this._read=e.read),Ft.call(this)}function Sr(e,t,n,r,i){var o=Lr(t,n);if(o)e.emit("error",o);else if(null===n)t.reading=!1,Ur(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!i){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{var u;!t.decoder||i||r||(n=t.decoder.write(n),u=!t.objectMode&&0===n.length),i||(t.reading=!1),u||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,i?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&Mr(e))),Br(e,t)}else i||(t.reading=!1);return jr(t)}function jr(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}ct(Tr,Ft),Tr.prototype.push=function(e,t){var n=this._readableState;return n.objectMode||"string"!==typeof e||(t=t||n.defaultEncoding,t!==n.encoding&&(e=r.from(e,t),t="")),Sr(this,n,e,t,!1)},Tr.prototype.unshift=function(e){var t=this._readableState;return Sr(this,t,e,"",!0)},Tr.prototype.isPaused=function(){return!1===this._readableState.flowing},Tr.prototype.setEncoding=function(e){return this._readableState.decoder=new Er(e),this._readableState.encoding=e,this};var Cr=8388608;function Nr(e){return e>=Cr?e=Cr:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function kr(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=Nr(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function Lr(e,t){var n=null;return r.isBuffer(t)||"string"===typeof t||null===t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function Ur(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,Mr(e)}}function Mr(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(Rr("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?Le(Dr,e):Dr(e))}function Dr(e){Rr("emit readable"),e.emit("readable"),Fr(e)}function Br(e,t){t.readingMore||(t.readingMore=!0,Le(Pr,e,t))}function Pr(e,t){var n=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark){if(Rr("maybeReadMore read 0"),e.read(0),n===t.length)break;n=t.length}t.readingMore=!1}function xr(e){return function(){var t=e._readableState;Rr("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&e.listeners("data").length&&(t.flowing=!0,Fr(e))}}function Wr(e){Rr("readable nexttick read 0"),e.read(0)}function zr(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Le(Hr,e,t))}function Hr(e,t){t.reading||(Rr("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),Fr(e),t.flowing&&!t.reading&&e.read(0)}function Fr(e){var t=e._readableState;Rr("flow",t.flowing);while(t.flowing&&null!==e.read());}function qr(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=Vr(e,t.buffer,t.decoder),n);var n}function Vr(e,t,n){var r;return e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?Yr(e,t):Gr(e,t),r}function Yr(e,t){var n=t.head,r=1,i=n.data;e-=i.length;while(n=n.next){var o=n.data,a=e>o.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),e-=a,0===e){a===o.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++r}return t.length-=r,i}function Gr(e,t){var n=r.allocUnsafe(e),i=t.head,o=1;i.data.copy(n),e-=i.data.length;while(i=i.next){var a=i.data,s=e>a.length?a.length:e;if(a.copy(n,n.length-e,0,s),e-=s,0===e){s===a.length?(++o,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=a.slice(s));break}++o}return t.length-=o,n}function Kr(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,Le($r,t,e))}function $r(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function Xr(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)}function Jr(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function Zr(){}function Qr(e,t,n){this.chunk=e,this.encoding=t,this.callback=n,this.next=null}function ei(e,t){Object.defineProperty(this,"buffer",{get:ft((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")}),e=e||{},this.objectMode=!!e.objectMode,t instanceof wi&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,r=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var i=!1===e.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){ci(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new mi(this)}function ti(e){if(!(this instanceof ti)&&!(this instanceof wi))return new ti(e);this._writableState=new ei(e,this),this.writable=!0,e&&("function"===typeof e.write&&(this._write=e.write),"function"===typeof e.writev&&(this._writev=e.writev)),Ft.call(this)}function ni(e,t){var n=new Error("write after end");e.emit("error",n),Le(t,n)}function ri(e,t,n,r){var i=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):yn.isBuffer(n)||"string"===typeof n||void 0===n||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),Le(r,o),i=!1),i}function ii(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!==typeof t||(t=yn.from(t,n)),t}function oi(e,t,n,r,i){n=ii(t,n,r),yn.isBuffer(n)&&(r="buffer");var o=t.objectMode?1:n.length;t.length+=o;var a=t.length<t.highWaterMark;if(a||(t.needDrain=!0),t.writing||t.corked){var s=t.lastBufferedRequest;t.lastBufferedRequest=new Qr(n,r,i),s?s.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else ai(e,t,!1,o,n,r,i);return a}function ai(e,t,n,r,i,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function si(e,t,n,r,i){--t.pendingcb,n?Le(i,r):i(r),e._writableState.errorEmitted=!0,e.emit("error",r)}function ui(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function ci(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(ui(n),t)si(e,n,r,t,i);else{var o=di(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||fi(e,n),r?Le(hi,e,n,o,i):hi(e,n,o,i)}}function hi(e,t,n,r){n||li(e,t),t.pendingcb--,r(),gi(e,t)}function li(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function fi(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),o=t.corkedRequestsFree;o.entry=n;var a=0;while(n)i[a]=n,n=n.next,a+=1;ai(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new mi(t)}else{while(n){var s=n.chunk,u=n.encoding,c=n.callback,h=t.objectMode?1:s.length;if(ai(e,t,!1,h,s,u,c),n=n.next,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=n,t.bufferProcessing=!1}function di(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function pi(e,t){t.prefinished||(t.prefinished=!0,e.emit("prefinish"))}function gi(e,t){var n=di(t);return n&&(0===t.pendingcb?(pi(e,t),t.finished=!0,e.emit("finish")):pi(e,t)),n}function vi(e,t,n){t.ending=!0,gi(e,t),n&&(t.finished?Le(n):e.once("finish",n)),t.ended=!0,e.writable=!1}function mi(e){var t=this;this.next=null,this.entry=null,this.finish=function(n){var r=t.entry;t.entry=null;while(r){var i=r.callback;e.pendingcb--,i(n),r=r.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}}Tr.prototype.read=function(e){Rr("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return Rr("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?Kr(this):Mr(this),null;if(e=kr(e,t),0===e&&t.ended)return 0===t.length&&Kr(this),null;var r,i=t.needReadable;return Rr("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&(i=!0,Rr("length less than watermark",i)),t.ended||t.reading?(i=!1,Rr("reading or ended",i)):i&&(Rr("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=kr(n,t))),r=e>0?qr(e,t):null,null===r?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&Kr(this)),null!==r&&this.emit("data",r),r},Tr.prototype._read=function(e){this.emit("error",new Error("not implemented"))},Tr.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e);break}r.pipesCount+=1,Rr("pipe count=%d opts=%j",r.pipesCount,t);var i=!t||!1!==t.end,o=i?s:h;function a(e){Rr("onunpipe"),e===n&&h()}function s(){Rr("onend"),e.end()}r.endEmitted?Le(o):n.once("end",o),e.on("unpipe",a);var u=xr(n);e.on("drain",u);var c=!1;function h(){Rr("cleanup"),e.removeListener("close",p),e.removeListener("finish",g),e.removeListener("drain",u),e.removeListener("error",d),e.removeListener("unpipe",a),n.removeListener("end",s),n.removeListener("end",h),n.removeListener("data",f),c=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||u()}var l=!1;function f(t){Rr("ondata"),l=!1;var i=e.write(t);!1!==i||l||((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==Jr(r.pipes,e))&&!c&&(Rr("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,l=!0),n.pause())}function d(t){Rr("onerror",t),v(),e.removeListener("error",d),0===Ar(e,"error")&&e.emit("error",t)}function p(){e.removeListener("finish",g),v()}function g(){Rr("onfinish"),e.removeListener("close",p),v()}function v(){Rr("unpipe"),n.unpipe(e)}return n.on("data",f),Or(e,"error",d),e.once("close",p),e.once("finish",g),e.emit("pipe",n),r.flowing||(Rr("pipe resume"),n.resume()),e},Tr.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this)),this;if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<r;i++)n[i].emit("unpipe",this);return this}var o=Jr(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this)),this},Tr.prototype.on=function(e,t){var n=Ft.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&Mr(this):Le(Wr,this))}return n},Tr.prototype.addListener=Tr.prototype.on,Tr.prototype.resume=function(){var e=this._readableState;return e.flowing||(Rr("resume"),e.flowing=!0,zr(this,e)),this},Tr.prototype.pause=function(){return Rr("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(Rr("pause"),this._readableState.flowing=!1,this.emit("pause")),this},Tr.prototype.wrap=function(e){var t=this._readableState,n=!1,r=this;for(var i in e.on("end",(function(){if(Rr("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&r.push(e)}r.push(null)})),e.on("data",(function(i){if(Rr("wrapped data"),t.decoder&&(i=t.decoder.write(i)),(!t.objectMode||null!==i&&void 0!==i)&&(t.objectMode||i&&i.length)){var o=r.push(i);o||(n=!0,e.pause())}})),e)void 0===this[i]&&"function"===typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));var o=["error","close","destroy","pause","resume"];return Xr(o,(function(t){e.on(t,r.emit.bind(r,t))})),r._read=function(t){Rr("wrapped _read",t),n&&(n=!1,e.resume())},r},Tr._fromList=qr,ti.WritableState=ei,ct(ti,Ft),ei.prototype.getBuffer=function(){var e=this.bufferedRequest,t=[];while(e)t.push(e),e=e.next;return t},ti.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},ti.prototype.write=function(e,t,n){var r=this._writableState,i=!1;return"function"===typeof t&&(n=t,t=null),yn.isBuffer(e)?t="buffer":t||(t=r.defaultEncoding),"function"!==typeof n&&(n=Zr),r.ended?ni(this,n):ri(this,r,e,n)&&(r.pendingcb++,i=oi(this,r,e,t,n)),i},ti.prototype.cork=function(){var e=this._writableState;e.corked++},ti.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||fi(this,e))},ti.prototype.setDefaultEncoding=function(e){if("string"===typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},ti.prototype._write=function(e,t,n){n(new Error("not implemented"))},ti.prototype._writev=null,ti.prototype.end=function(e,t,n){var r=this._writableState;"function"===typeof e?(n=e,e=null,t=null):"function"===typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||vi(this,r,n)},ct(wi,Tr);for(var bi=Object.keys(ti.prototype),Ei=0;Ei<bi.length;Ei++){var yi=bi[Ei];wi.prototype[yi]||(wi.prototype[yi]=ti.prototype[yi])}function wi(e){if(!(this instanceof wi))return new wi(e);Tr.call(this,e),ti.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",_i)}function _i(){this.allowHalfOpen||this._writableState.ended||Le(Ri,this)}function Ri(e){e.end()}function Oi(e){this.afterTransform=function(t,n){return Ai(e,t,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function Ai(e,t,n){var r=e._transformState;r.transforming=!1;var i=r.writecb;if(!i)return e.emit("error",new Error("no writecb in Transform class"));r.writechunk=null,r.writecb=null,null!==n&&void 0!==n&&e.push(n),i(t);var o=e._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&e._read(o.highWaterMark)}function Ii(e){if(!(this instanceof Ii))return new Ii(e);wi.call(this,e),this._transformState=new Oi(this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"===typeof e.transform&&(this._transform=e.transform),"function"===typeof e.flush&&(this._flush=e.flush)),this.once("prefinish",(function(){"function"===typeof this._flush?this._flush((function(e){Ti(t,e)})):Ti(t)}))}function Ti(e,t){if(t)return e.emit("error",t);var n=e._writableState,r=e._transformState;if(n.length)throw new Error("Calling transform done when ws.length != 0");if(r.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}function Si(e){if(!(this instanceof Si))return new Si(e);Ii.call(this,e)}function ji(){Ft.call(this)}ct(Ii,wi),Ii.prototype.push=function(e,t){return this._transformState.needTransform=!1,wi.prototype.push.call(this,e,t)},Ii.prototype._transform=function(e,t,n){throw new Error("Not implemented")},Ii.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},Ii.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},ct(Si,Ii),Si.prototype._transform=function(e,t,n){n(null,e)},ct(ji,Ft),ji.Readable=Tr,ji.Writable=ti,ji.Duplex=wi,ji.Transform=Ii,ji.PassThrough=Si,ji.Stream=ji,ji.prototype.pipe=function(e,t){var n=this;function r(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function i(){n.readable&&n.resume&&n.resume()}n.on("data",r),e.on("drain",i),e._isStdio||t&&!1===t.end||(n.on("end",a),n.on("close",s));var o=!1;function a(){o||(o=!0,e.end())}function s(){o||(o=!0,"function"===typeof e.destroy&&e.destroy())}function u(e){if(c(),0===Ft.listenerCount(this,"error"))throw e}function c(){n.removeListener("data",r),e.removeListener("drain",i),n.removeListener("end",a),n.removeListener("close",s),n.removeListener("error",u),e.removeListener("error",u),n.removeListener("end",c),n.removeListener("close",c),e.removeListener("close",c)}return n.on("error",u),e.on("error",u),n.on("end",c),n.on("close",c),e.on("close",c),e.emit("pipe",n),e};var Ci={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4};function Ni(e,t,n){var o,a=this;if(Tr.call(a),a._mode=n,a.headers={},a.rawHeaders=[],a.trailers={},a.rawTrailers=[],a.on("end",(function(){i.nextTick((function(){a.emit("close")}))})),"fetch"===n){a._fetchResponse=t,a.url=t.url,a.statusCode=t.status,a.statusMessage=t.statusText;for(var s,u,c=t.headers[Symbol.iterator]();s=(u=c.next()).value,!u.done;)a.headers[s[0].toLowerCase()]=s[1],a.rawHeaders.push(s[0],s[1]);var h=t.body.getReader();o=function(){h.read().then((function(e){a._destroyed||(e.done?a.push(null):(a.push(new r(e.value)),o()))}))},o()}else{a._xhr=e,a._pos=0,a.url=e.responseURL,a.statusCode=e.status,a.statusMessage=e.statusText;var l=e.getAllResponseHeaders().split(/\r?\n/);if(l.forEach((function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var n=t[1].toLowerCase();"set-cookie"===n?(void 0===a.headers[n]&&(a.headers[n]=[]),a.headers[n].push(t[2])):void 0!==a.headers[n]?a.headers[n]+=", "+t[2]:a.headers[n]=t[2],a.rawHeaders.push(t[1],t[2])}})),a._charset="x-user-defined",!be){var f=a.rawHeaders["mime-type"];if(f){var d=f.match(/;\s*charset=([^;])(;|$)/);d&&(a._charset=d[1].toLowerCase())}a._charset||(a._charset="utf-8")}}}function ki(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if("function"===typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(dr(e)){for(var t=new Uint8Array(e.length),n=e.length,r=0;r<n;r++)t[r]=e[r];return t.buffer}throw new Error("Argument must be a Buffer")}function Li(e,t){return he&&t?"fetch":me?"moz-chunked-arraybuffer":ve?"ms-stream":ge&&e?"arraybuffer":Ee&&e?"text:vbarray":"text"}function Ui(e){var t,n=this;ti.call(n),n._opts=e,n._body=[],n._headers={},e.auth&&n.setHeader("Authorization","Basic "+new r(e.auth).toString("base64")),Object.keys(e.headers).forEach((function(t){n.setHeader(t,e.headers[t])}));var i=!0;if("disable-fetch"===e.mode)i=!1,t=!0;else if("prefer-streaming"===e.mode)t=!1;else if("allow-wrong-content-type"===e.mode)t=!be;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");t=!0}n._mode=Li(t,i),n.on("finish",(function(){n._onFinish()}))}ct(Ni,Tr),Ni.prototype._read=function(){},Ni.prototype._onXHRProgress=function(){var t=this,n=t._xhr,i=null;switch(t._mode){case"text:vbarray":if(n.readyState!==Ci.DONE)break;try{i=new e.VBArray(n.responseBody).toArray()}catch(c){}if(null!==i){t.push(new r(i));break}case"text":try{i=n.responseText}catch(c){t._mode="text:vbarray";break}if(i.length>t._pos){var o=i.substr(t._pos);if("x-user-defined"===t._charset){for(var a=new r(o.length),s=0;s<o.length;s++)a[s]=255&o.charCodeAt(s);t.push(a)}else t.push(o,t._charset);t._pos=i.length}break;case"arraybuffer":if(n.readyState!==Ci.DONE||!n.response)break;i=n.response,t.push(new r(new Uint8Array(i)));break;case"moz-chunked-arraybuffer":if(i=n.response,n.readyState!==Ci.LOADING||!i)break;t.push(new r(new Uint8Array(i)));break;case"ms-stream":if(i=n.response,n.readyState!==Ci.LOADING)break;var u=new e.MSStreamReader;u.onprogress=function(){u.result.byteLength>t._pos&&(t.push(new r(new Uint8Array(u.result.slice(t._pos)))),t._pos=u.result.byteLength)},u.onload=function(){t.push(null)},u.readAsArrayBuffer(i);break}t._xhr.readyState===Ci.DONE&&"ms-stream"!==t._mode&&t.push(null)},ct(Ui,ti);var Mi=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];function Di(e){try{var t=e.status;return null!==t&&0!==t}catch(n){return!1}}Ui.prototype.setHeader=function(e,t){var n=this,r=e.toLowerCase();-1===Mi.indexOf(r)&&(n._headers[r]={name:e,value:t})},Ui.prototype.getHeader=function(e){var t=this;return t._headers[e.toLowerCase()].value},Ui.prototype.removeHeader=function(e){var t=this;delete t._headers[e.toLowerCase()]},Ui.prototype._onFinish=function(){var t=this;if(!t._destroyed){var n,o=t._opts,a=t._headers;if("POST"!==o.method&&"PUT"!==o.method&&"PATCH"!==o.method||(n=le()?new e.Blob(t._body.map((function(e){return ki(e)})),{type:(a["content-type"]||{}).value||""}):r.concat(t._body).toString()),"fetch"===t._mode){var s=Object.keys(a).map((function(e){return[a[e].name,a[e].value]}));e.fetch(t._opts.url,{method:t._opts.method,headers:s,body:n,mode:"cors",credentials:o.withCredentials?"include":"same-origin"}).then((function(e){t._fetchResponse=e,t._connect()}),(function(e){t.emit("error",e)}))}else{var u=t._xhr=new e.XMLHttpRequest;try{u.open(t._opts.method,t._opts.url,!0)}catch(c){return void i.nextTick((function(){t.emit("error",c)}))}"responseType"in u&&(u.responseType=t._mode.split(":")[0]),"withCredentials"in u&&(u.withCredentials=!!o.withCredentials),"text"===t._mode&&"overrideMimeType"in u&&u.overrideMimeType("text/plain; charset=x-user-defined"),Object.keys(a).forEach((function(e){u.setRequestHeader(a[e].name,a[e].value)})),t._response=null,u.onreadystatechange=function(){switch(u.readyState){case Ci.LOADING:case Ci.DONE:t._onXHRProgress();break}},"moz-chunked-arraybuffer"===t._mode&&(u.onprogress=function(){t._onXHRProgress()}),u.onerror=function(){t._destroyed||t.emit("error",new Error("XHR error"))};try{u.send(n)}catch(c){return void i.nextTick((function(){t.emit("error",c)}))}}}},Ui.prototype._onXHRProgress=function(){var e=this;Di(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress())},Ui.prototype._connect=function(){var e=this;e._destroyed||(e._response=new Ni(e._xhr,e._fetchResponse,e._mode),e.emit("response",e._response))},Ui.prototype._write=function(e,t,n){var r=this;r._body.push(e),n()},Ui.prototype.abort=Ui.prototype.destroy=function(){var e=this;e._destroyed=!0,e._response&&(e._response._destroyed=!0),e._xhr&&e._xhr.abort()},Ui.prototype.end=function(e,t,n){var r=this;"function"===typeof e&&(n=e,e=void 0),ti.prototype.end.call(r,e,t,n)},Ui.prototype.flushHeaders=function(){},Ui.prototype.setTimeout=function(){},Ui.prototype.setNoDelay=function(){},Ui.prototype.setSocketKeepAlive=function(){};
/*! https://mths.be/punycode v1.4.1 by @mathias */
var Bi=2147483647,Pi=36,xi=1,Wi=26,zi=38,Hi=700,Fi=72,qi=128,Vi="-",Yi=/[^\x20-\x7E]/,Gi=/[\x2E\u3002\uFF0E\uFF61]/g,Ki={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},$i=Pi-xi,Xi=Math.floor,Ji=String.fromCharCode;function Zi(e){throw new RangeError(Ki[e])}function Qi(e,t){var n=e.length,r=[];while(n--)r[n]=t(e[n]);return r}function eo(e,t){var n=e.split("@"),r="";n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace(Gi,".");var i=e.split("."),o=Qi(i,t).join(".");return r+o}function to(e){var t,n,r=[],i=0,o=e.length;while(i<o)t=e.charCodeAt(i++),t>=55296&&t<=56319&&i<o?(n=e.charCodeAt(i++),56320==(64512&n)?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--)):r.push(t);return r}function no(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function ro(e,t,n){var r=0;for(e=n?Xi(e/Hi):e>>1,e+=Xi(e/t);e>$i*Wi>>1;r+=Pi)e=Xi(e/$i);return Xi(r+($i+1)*e/(e+zi))}function io(e){var t,n,r,i,o,a,s,u,c,h,l,f,d,p,g,v=[];for(e=to(e),f=e.length,t=qi,n=0,o=Fi,a=0;a<f;++a)l=e[a],l<128&&v.push(Ji(l));r=i=v.length,i&&v.push(Vi);while(r<f){for(s=Bi,a=0;a<f;++a)l=e[a],l>=t&&l<s&&(s=l);for(d=r+1,s-t>Xi((Bi-n)/d)&&Zi("overflow"),n+=(s-t)*d,t=s,a=0;a<f;++a)if(l=e[a],l<t&&++n>Bi&&Zi("overflow"),l==t){for(u=n,c=Pi;;c+=Pi){if(h=c<=o?xi:c>=o+Wi?Wi:c-o,u<h)break;g=u-h,p=Pi-h,v.push(Ji(no(h+g%p,0))),u=Xi(g/p)}v.push(Ji(no(u,0))),o=ro(n,d,r==i),n=0,++r}++n,++t}return v.join("")}function oo(e){return eo(e,(function(e){return Yi.test(e)?"xn--"+io(e):e}))}function ao(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var so=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function uo(e){switch(Object(f["a"])(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}}function co(e,t,n,r){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"===Object(f["a"])(e)?ho(lo(e),(function(r){var i=encodeURIComponent(uo(r))+n;return so(e[r])?ho(e[r],(function(e){return i+encodeURIComponent(uo(e))})).join(t):i+encodeURIComponent(uo(e[r]))})).join(t):r?encodeURIComponent(uo(r))+n+encodeURIComponent(uo(e)):""}function ho(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var lo=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t};function fo(e,t,n,r){t=t||"&",n=n||"=";var i={};if("string"!==typeof e||0===e.length)return i;var o=/\+/g;e=e.split(t);var a=1e3;r&&"number"===typeof r.maxKeys&&(a=r.maxKeys);var s=e.length;a>0&&s>a&&(s=a);for(var u=0;u<s;++u){var c,h,l,f,d=e[u].replace(o,"%20"),p=d.indexOf(n);p>=0?(c=d.substr(0,p),h=d.substr(p+1)):(c=d,h=""),l=decodeURIComponent(c),f=decodeURIComponent(h),ao(i,l)?so(i[l])?i[l].push(f):i[l]=[i[l],f]:i[l]=f}return i}function po(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var go=/^([a-z0-9.+-]+:)/i,vo=/:[0-9]*$/,mo=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,bo=["<",">",'"',"`"," ","\r","\n","\t"],Eo=["{","}","|","\\","^","`"].concat(bo),yo=["'"].concat(Eo),wo=["%","/","?",";","#"].concat(yo),_o=["/","?","#"],Ro=255,Oo=/^[+a-z0-9A-Z_-]{0,63}$/,Ao=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Io={javascript:!0,"javascript:":!0},To={javascript:!0,"javascript:":!0},So={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function jo(e,t,n){if(e&&Mt(e)&&e instanceof po)return e;var r=new po;return r.parse(e,t,n),r}function Co(e,t,n,r){if(!kt(t))throw new TypeError("Parameter 'url' must be a string, not "+Object(f["a"])(t));var i=t.indexOf("?"),o=-1!==i&&i<t.indexOf("#")?"?":"#",a=t.split(o),s=/\\/g;a[0]=a[0].replace(s,"/"),t=a.join(o);var u=t;if(u=u.trim(),!r&&1===t.split("#").length){var c=mo.exec(u);if(c)return e.path=u,e.href=u,e.pathname=c[1],c[2]?(e.search=c[2],e.query=n?fo(e.search.substr(1)):e.search.substr(1)):n&&(e.search="",e.query={}),e}var h,l,d,p,g=go.exec(u);if(g){g=g[0];var v=g.toLowerCase();e.protocol=v,u=u.substr(g.length)}if(r||g||u.match(/^\/\/[^@\/]+@[^@\/]+/)){var m="//"===u.substr(0,2);!m||g&&To[g]||(u=u.substr(2),e.slashes=!0)}if(!To[g]&&(m||g&&!So[g])){var b,E,y=-1;for(h=0;h<_o.length;h++)l=u.indexOf(_o[h]),-1!==l&&(-1===y||l<y)&&(y=l);for(E=-1===y?u.lastIndexOf("@"):u.lastIndexOf("@",y),-1!==E&&(b=u.slice(0,E),u=u.slice(E+1),e.auth=decodeURIComponent(b)),y=-1,h=0;h<wo.length;h++)l=u.indexOf(wo[h]),-1!==l&&(-1===y||l<y)&&(y=l);-1===y&&(y=u.length),e.host=u.slice(0,y),u=u.slice(y),ko(e),e.hostname=e.hostname||"";var w="["===e.hostname[0]&&"]"===e.hostname[e.hostname.length-1];if(!w){var _=e.hostname.split(/\./);for(h=0,d=_.length;h<d;h++){var R=_[h];if(R&&!R.match(Oo)){for(var O="",A=0,I=R.length;A<I;A++)R.charCodeAt(A)>127?O+="x":O+=R[A];if(!O.match(Oo)){var T=_.slice(0,h),S=_.slice(h+1),j=R.match(Ao);j&&(T.push(j[1]),S.unshift(j[2])),S.length&&(u="/"+S.join(".")+u),e.hostname=T.join(".");break}}}}e.hostname.length>Ro?e.hostname="":e.hostname=e.hostname.toLowerCase(),w||(e.hostname=oo(e.hostname)),p=e.port?":"+e.port:"";var C=e.hostname||"";e.host=C+p,e.href+=e.host,w&&(e.hostname=e.hostname.substr(1,e.hostname.length-2),"/"!==u[0]&&(u="/"+u))}if(!Io[v])for(h=0,d=yo.length;h<d;h++){var N=yo[h];if(-1!==u.indexOf(N)){var k=encodeURIComponent(N);k===N&&(k=escape(N)),u=u.split(N).join(k)}}var L=u.indexOf("#");-1!==L&&(e.hash=u.substr(L),u=u.slice(0,L));var U=u.indexOf("?");if(-1!==U?(e.search=u.substr(U),e.query=u.substr(U+1),n&&(e.query=fo(e.query)),u=u.slice(0,U)):n&&(e.search="",e.query={}),u&&(e.pathname=u),So[v]&&e.hostname&&!e.pathname&&(e.pathname="/"),e.pathname||e.search){p=e.pathname||"";var M=e.search||"";e.path=p+M}return e.href=No(e),e}function No(e){var t=e.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var n=e.protocol||"",r=e.pathname||"",i=e.hash||"",o=!1,a="";e.host?o=t+e.host:e.hostname&&(o=t+(-1===e.hostname.indexOf(":")?e.hostname:"["+this.hostname+"]"),e.port&&(o+=":"+e.port)),e.query&&Mt(e.query)&&Object.keys(e.query).length&&(a=co(e.query));var s=e.search||a&&"?"+a||"";return n&&":"!==n.substr(-1)&&(n+=":"),e.slashes||(!n||So[n])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),i&&"#"!==i.charAt(0)&&(i="#"+i),s&&"?"!==s.charAt(0)&&(s="?"+s),r=r.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})),s=s.replace("#","%23"),n+o+r+s+i}function ko(e){var t=e.host,n=vo.exec(t);n&&(n=n[0],":"!==n&&(e.port=n.substr(1)),t=t.substr(0,t.length-n.length)),t&&(e.hostname=t)}function Lo(t,n){"string"===typeof t&&(t=jo(t));var r=-1===e.location.protocol.search(/^https?:$/)?"http:":"",i=t.protocol||r,o=t.hostname||t.host,a=t.port,s=t.path||"/";o&&-1!==o.indexOf(":")&&(o="["+o+"]"),t.url=(o?i+"//"+o:"")+(a?":"+a:"")+s,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var u=new Ui(t);return n&&u.on("response",n),u}function Uo(e,t){var n=Lo(e,t);return n.end(),n}po.prototype.parse=function(e,t,n){return Co(this,e,t,n)},po.prototype.format=function(){return No(this)},po.prototype.resolve=function(e){return this.resolveObject(jo(e,!1,!0)).format()},po.prototype.resolveObject=function(e){if(kt(e)){var t=new po;t.parse(e,!1,!0),e=t}for(var n,r=new po,i=Object.keys(this),o=0;o<i.length;o++){var a=i[o];r[a]=this[a]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var s=Object.keys(e),u=0;u<s.length;u++){var c=s[u];"protocol"!==c&&(r[c]=e[c])}return So[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!So[e.protocol]){for(var h=Object.keys(e),l=0;l<h.length;l++){var f=h[l];r[f]=e[f]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||To[e.protocol])r.pathname=e.pathname;else{n=(e.pathname||"").split("/");while(n.length&&!(e.host=n.shift()));e.host||(e.host=""),e.hostname||(e.hostname=""),""!==n[0]&&n.unshift(""),n.length<2&&n.unshift(""),r.pathname=n.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var d=r.pathname||"",p=r.search||"";r.path=d+p}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var g,v=r.pathname&&"/"===r.pathname.charAt(0),m=e.host||e.pathname&&"/"===e.pathname.charAt(0),b=m||v||r.host&&e.pathname,E=b,y=r.pathname&&r.pathname.split("/")||[],w=r.protocol&&!So[r.protocol];if(n=e.pathname&&e.pathname.split("/")||[],w&&(r.hostname="",r.port=null,r.host&&(""===y[0]?y[0]=r.host:y.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===n[0]?n[0]=e.host:n.unshift(e.host)),e.host=null),b=b&&(""===n[0]||""===y[0])),m)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,y=n;else if(n.length)y||(y=[]),y.pop(),y=y.concat(n),r.search=e.search,r.query=e.query;else if(!Ct(e.search))return w&&(r.hostname=r.host=y.shift(),g=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"),g&&(r.auth=g.shift(),r.host=r.hostname=g.shift())),r.search=e.search,r.query=e.query,jt(r.pathname)&&jt(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!y.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var _=y.slice(-1)[0],R=(r.host||e.host||y.length>1)&&("."===_||".."===_)||""===_,O=0,A=y.length;A>=0;A--)_=y[A],"."===_?y.splice(A,1):".."===_?(y.splice(A,1),O++):O&&(y.splice(A,1),O--);if(!b&&!E)for(;O--;O)y.unshift("..");!b||""===y[0]||y[0]&&"/"===y[0].charAt(0)||y.unshift(""),R&&"/"!==y.join("/").substr(-1)&&y.push("");var I=""===y[0]||y[0]&&"/"===y[0].charAt(0);return w&&(r.hostname=r.host=I?"":y.length?y.shift():"",g=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"),g&&(r.auth=g.shift(),r.host=r.hostname=g.shift())),b=b||r.host&&y.length,b&&!I&&y.unshift(""),y.length?r.pathname=y.join("/"):(r.pathname=null,r.path=null),jt(r.pathname)&&jt(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},po.prototype.parseHost=function(){return ko(this)};var Mo,Do=function(){function e(){var t=this;Object(E["a"])(this,e),this.queue=[],window.addEventListener("message",(function(e){return t.receive(e)}))}return Object(p["a"])(e,[{key:"receive",value:function(e){var t,n,r,i,o;if(/^web-eid:/.test(null===(t=e.data)||void 0===t?void 0:t.action)){var a=e.data,s=null===(r=null===(n=a.action)||void 0===n?void 0:n.match(/success$|failure$|ack$/))||void 0===r?void 0:r[0],u=this.getInitialAction(a.action),c=this.getPendingMessage(u);if("ack"===s&&(console.log("ack message",a),console.log("ack pending",null===c||void 0===c?void 0:c.message.action),console.log("ack queue",JSON.stringify(this.queue))),c)switch(s){case"ack":clearTimeout(c.ackTimer);break;case"success":null===(i=c.resolve)||void 0===i||i.call(c,a),this.removeFromQueue(u);break;case"failure":null===(o=c.reject)||void 0===o||o.call(c,a.error?X(a.error):a),this.removeFromQueue(u);break}}}},{key:"send",value:function(e,t){var n=this;if(this.getPendingMessage(e.action))return Promise.reject(new k);if(window.isSecureContext){var r={message:e};return this.queue.push(r),r.promise=new Promise((function(e,t){r.resolve=e,r.reject=t})),r.ackTimer=window.setTimeout((function(){return n.onAckTimeout(r)}),R.EXTENSION_HANDSHAKE_TIMEOUT),r.replyTimer=window.setTimeout((function(){return n.onReplyTimeout(r)}),t),this.publishMessage(e,t),r.promise}return Promise.reject(new C)}},{key:"publishMessage",value:function(e,t){e.useAuthApp&&1==e.useAuthApp?(this.isAndroidDevice()?this.launchAuthApp(e):this.displayQRCode(e),this.pollForLoginSuccess(e,t).then((function(e){console.log(e)}))):window.postMessage(e,"*")}},{key:"launchAuthApp",value:function(e){var t=new Z(e);document.addEventListener("visibilitychange",function t(){document.hidden&&(window.postMessage({action:this.getRelevantAckAction(e)},location.origin),setTimeout((function(){return document.removeEventListener("visibilitychange",t)}),R.EXTENSION_HANDSHAKE_TIMEOUT))}.bind(this)),window.location.href=t.toString()}},{key:"displayQRCode",value:function(e){var t=new Z(e),n=se,r=n.encodeText(t.toString(),ee.MEDIUM),i=oe(r,24,"#FFF","#000"),o=document.getElementById("canvas");o&&(o.innerHTML=i),window.postMessage({action:this.getRelevantAckAction(e)},location.origin)}},{key:"pollForLoginSuccess",value:function(){var e=Object(l["a"])(regeneratorRuntime.mark((function e(t,n){var r,i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.getAuthSuccessUrl){e.next=8;break}if(t.getAuthSuccessUrl.startsWith("https://")){e.next=3;break}throw new q("HTTPS required for getAuthSuccessUrl ".concat(t.getAuthSuccessUrl));case 3:return r=t.headers,i={method:"GET",headers:r,timeout:n},e.abrupt("return",Uo(t.getAuthSuccessUrl,i).on("error",(function(e){console.error(e)})).on("timeout",(function(){console.error("Timeout")})));case 8:throw new J("getAuthSuccessUrl missing for Android auth app authentication option.");case 9:case"end":return e.stop()}}),e)})));function t(t,n){return e.apply(this,arguments)}return t}()},{key:"throwAfterTimeout",value:function(){var e=Object(l["a"])(regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.sleep(t);case 2:throw n;case 3:case"end":return e.stop()}}),e,this)})));function t(t,n){return e.apply(this,arguments)}return t}()},{key:"sleep",value:function(){var e=Object(l["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){setTimeout((function(){return e()}),t)})));case 1:case"end":return e.stop()}}),e)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"isAndroidDevice",value:function(){return navigator.userAgent.toLowerCase().indexOf("android")>-1}},{key:"getRelevantAckAction",value:function(e){var t;switch(e.action){case I.AUTHENTICATE:t=I.AUTHENTICATE_ACK;break;case I.SIGN:t=I.SIGN_ACK;break;case I.STATUS:t=I.STATUS_ACK;break;default:t=I.STATUS_ACK;break}return t}},{key:"onReplyTimeout",value:function(e){var t;console.log("onReplyTimeout",e.message.action),null===(t=e.reject)||void 0===t||t.call(e,new V),this.removeFromQueue(e.message.action)}},{key:"onAckTimeout",value:function(e){var t,n;console.log("onAckTimeout",e.message.action),console.log("Pending message"),console.log(e.message.authApp),e.message.useAuthApp&&1==e.message.useAuthApp?null===(t=e.reject)||void 0===t||t.call(e,new Q):null===(n=e.reject)||void 0===n||n.call(e,new N),clearTimeout(e.replyTimer)}},{key:"getPendingMessage",value:function(e){return this.queue.find((function(t){return t.message.action===e}))}},{key:"getInitialAction",value:function(e){return e.replace(/-success$|-failure$|-ack$/,"")}},{key:"removeFromQueue",value:function(e){var t=this.getPendingMessage(e);clearTimeout(null===t||void 0===t?void 0:t.replyTimer),this.queue=this.queue.filter((function(t){return t.message.action!==e}))}}]),e}();new RegExp("^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$");function Bo(){return new Promise((function(e){return setTimeout(e)}))}(function(e){e[e["NEWER"]=1]="NEWER",e[e["SAME"]=0]="SAME",e[e["OLDER"]=-1]="OLDER"})(Mo||(Mo={}));var Po=new Do;function xo(e){return Wo.apply(this,arguments)}function Wo(){return Wo=Object(l["a"])(regeneratorRuntime.mark((function e(t){var n,r,i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Bo();case 2:if("object"==Object(f["a"])(t)){e.next=4;break}throw new J("authenticate function requires an options object as parameter");case 4:if(t.getAuthChallengeUrl){e.next=6;break}throw new J("getAuthChallengeUrl missing from authenticate options");case 6:if(t.postAuthTokenUrl){e.next=8;break}throw new J("postAuthTokenUrl missing from authenticate options");case 8:return n=R.EXTENSION_HANDSHAKE_TIMEOUT+R.NATIVE_APP_HANDSHAKE_TIMEOUT+2*(t.serverRequestTimeout||R.DEFAULT_SERVER_REQUEST_TIMEOUT)+(t.userInteractionTimeout||R.DEFAULT_USER_INTERACTION_TIMEOUT),r=Object(h["a"])(Object(h["a"])({},t),{},{action:I.AUTHENTICATE}),e.next=12,Po.send(r,n);case 12:return i=e.sent,e.abrupt("return",i.response);case 14:case"end":return e.stop()}}),e)}))),Wo.apply(this,arguments)}}).call(this,n("c8ba"),n("b639").Buffer,n("4362"))},a848:function(e,t,n){"use strict";n("da3d")},b6b4:function(e,t,n){"use strict";n("25c9")},da3d:function(e,t,n){},df0f:function(e,t,n){}});
//# sourceMappingURL=app.c2a68e49.js.map